Commit Graph

89820 Commits

Author SHA1 Message Date
xtraeme
6c4da82b5e New changes to support the new configuration file format for
envstat(8) and the envsys framework:

- Modify the ENVSYS_SETDICTIONARY ioctl to support the following
  plist structure:

  <dict>
	<key>foo0</key>
	<array>
		<dict>
			<key>index</key>
			<string>sensor0</string>
			<key>description</key>
			<string>cpu temp</string>
			...
			Another property for this sensor
			...
		</dict>
		...
		Another dictionary for other sensor
		...
	</array>
	...
	Another device as above
	...
  </dict>

  Multiple devices with multiple sensors can now be specified, that means
  that to set the properties only one copyin(9) is needed now.

- Added the ENVSYS_REMOVEPROPS ioctl, that accepts a boolean object
  "envsys-remove-props" and when set to true, all properties that were
  set previously by ENVSYS_SETDICTIONARY will be removed. That means that
  you can now set multiple critical limits, descriptions and all they
  will be removed or changed to its default value (for rfact and
  description objects).

- Added the 'index' and 'allow-rfact' objects into the sensor dictionaries,
  for better interactivity with userland. To know the position of the
  sensor and to know if sensor allows to change the rfact.

- Misc cosmetic changes for consistency.

- Use a two clause license for all my code.
2007-10-07 04:11:15 +00:00
xtraeme
50509ea822 Forgot to change the kmem_zalloc(9) calls to use KM_NOSLEEP in previous,
as was suggested by rmind.
2007-10-06 22:07:42 +00:00
xtraeme
4814127d51 Fix a bug that happened when two or more events were received almost
at the same time and the code accessed to an unexistent dictionary:

- Rather than using a global dictionary, use a singly linked list to
  access to the dictionaries, one per event.
- When the dictionary has been sent to userland, destroy it and remove
  it from the list.

With that change it is possible to receive multiple events at the
same time without panics; again thanks to rmind@ for comments and help
with locking.

Reviewed and ok by rmind.
2007-10-06 21:58:40 +00:00
bouyer
975e5c30a0 Move check for b_resid value to the right place. Should definitively fix
kern/36690.
2007-10-06 12:52:43 +00:00
xtraeme
8b2678bd7e Use a two clause license for all the code I contributed.
The envsys code will be changed later.
2007-10-06 07:21:02 +00:00
joerg
f4fa1c68c7 Merge from mpacpi.h 1.4.32.1, acpi_machdep.c 1.13.22.5 and
mpacpi.c 1.48.12.2 from jmcneill-pm:

Don't process the MADT and modify the interrupt config at one moment and
later trying to figure out if an entry was overriden and matches the
ACPI SCI. This is brain-dead and breaks in various situations.

Just check for each ISA override entry, if it matches the SCI. If it
does, remember it and use it for the interrupt setup. If there's no such
override assume that it is not changed, but override the polarity and
level from ISA settings to PCI settings.
2007-10-06 04:39:10 +00:00
joerg
a544202cb5 Merge from jmcneill-pm: Close a small race in the IOAPIC setup.
When changing the redirection entry for an interrupt, write the
high 32bit first. The low 32bit contain the mask bit and removing
that before setting the destionation ID can lead to lost interrupts.
2007-10-06 04:37:06 +00:00
dyoung
1dc4f12dca Change some ints to bools. 2007-10-06 03:35:14 +00:00
dyoung
2c54ff5913 Good-bye, kernel thread, we don't need you any longer. 2007-10-06 03:30:25 +00:00
xtraeme
07f9bca5af - sysmon_power_daemon_task: check if pev is valid before use.
- Add two more KASSERTS in strategic places.
2007-10-06 02:49:46 +00:00
uwe
bcb355867b Mark __COPYRIGHT strings as __used to bring them back, as gcc4
optimizes away __unused vars (but doesn't complain about them).
__used instructs it to keep them.

Per discussion with Christos.
2007-10-06 00:42:19 +00:00
uwe
6f23ef4104 Use .pushsection/.popsection instead of going "back" with .previous
(it does but has a side-effect) or .text (which is probably ok, but
still less kosher).

Make section macros work for traditional cpp (I guess we haven't used
that for a *long* time, b/c it was broken).

Use __unused instead of explicit attribute for __COPYRIGHT (to be
changed in the next commit).

Define __KERNEL_COPYRIGHT in terms of __COPYRIGHT rather than
duplicating the logic and accidentally inverting it.

Results in identical obj tree for an i386 build modulo ar archives
(with timestamps embedded) and few .o files (and programs they are
part of) that embed timestamps as strings.
2007-10-06 00:21:46 +00:00
jmcneill
02ef36ec48 Sort IO resources before attempting to attach; resolves issues on ACPI
firmware that reports 0x64,0x60 instead of 0x60,0x64. Patch tested by
Greg A. Woods.
2007-10-05 18:31:46 +00:00
joerg
04512a3ea9 Add re* at cardbus. 2007-10-05 17:58:38 +00:00
martin
38e2704180 Add missing include for definition of struct evcnt. 2007-10-05 08:05:37 +00:00
dogcow
360a5fad96 since ip_gre.c is gone, it's unhelpful to have dependencies on it. 2007-10-05 07:28:24 +00:00
dyoung
32fddb3293 Cosmetic: KNF. Litter the code with fewer #if NBPFILTER > 0. 2007-10-05 05:15:58 +00:00
dyoung
944a024048 Remove a lot of dead code. Move gre_do_send() code into greintr(),
and move gre_do_recv() code into gre_receive().  Get rid of some
unused event counters.
2007-10-05 04:55:10 +00:00
dyoung
60149b1ce8 Work in progress: use a raw socket for GRE in IP encapsulation
instead of adding/subtracting our own IPv4 header.

There are many benefits:  gre(4) needn't grok the outer encapsulation
header any longer, so this simplifies the gre(4) code.  The IP
stack needn't grok GRE, so it is simplified, too.  gre(4) will
benefit from optimizations in the socket code.  Eventually, gre(4)
will gain an IPv6 encapsulation with very few new lines of code.

There is a small performance loss.  A 133 MHz, 486-class AMD Elan
sinks/sources a TCP stream over GRE with about 93% the throughput
of the old code.  TCP throughput on a 266 MHz, 586-class AMD Geode
is about 96% the throughput of the old code.  A 175-MHz ADM5120
(MIPS) only sinks a TCP stream over GRE at about 90% of the old
code; I am still investigating that.

I produced stripped-down versions of sosend() and soreceive() for
gre(4) to use.  They are guaranteed not to block, so they can be
called from a software interrupt and from a socket upcall,
respectively.

A kernel thread is no longer necessary for socket transmit/receive,
but I didn't get around to removing it, yet.

Thanks to Matt Thomas for suggesting the use of stripped-down socket
code and software interrupts, and to Andrew Doran for advice and
answers concerning software interrupts, threads, and performance.
2007-10-05 03:28:12 +00:00
dyoung
c3d21ddcd4 Cosmetic: KNF. Shorten a staircase. Indent a complicated
if-condition.  This code remains hard to read.
2007-10-05 02:40:25 +00:00
dyoung
b7300a687a Use getsombuf(). 2007-10-05 02:34:58 +00:00
oster
8b11ddb95c Implement dumping kernel cores to RAID 1 sets. The component used
for the dump is selected in this order of preference:
   1) the master
   2) a used_spare of the master
   3) the slave
   4) a used_spare of the slave
2007-10-05 01:40:04 +00:00
pooka
a6bfd0bd84 g/c the "sizeop" code previous used for ioctl/fcntl. It was already
commented out and has bitrotted beyond all recognition, so it needs
complete rethinking.
2007-10-04 21:20:47 +00:00
kiyohara
97cc00811e Fix some bugs.
* Cast to integer the 2nd args of m_adj().
  * Move test/set flag BTF_XMIT to bcsp_start().
  * The initialization of the array was clarified.
2007-10-04 14:43:06 +00:00
xtraeme
63467beed0 AMD CS5536 Companion Device is able to work in Ultra DMA Mode 5,
patch from Andreas Wrede in PR kern/37059.
2007-10-04 13:30:59 +00:00
ad
2222038772 G/C the HIGHBALL stuff. 2007-10-04 12:55:48 +00:00
christos
18bad5abba busfunc depends on assym.h 2007-10-04 00:00:42 +00:00
christos
03095013ed add an smbus controller. 2007-10-04 00:00:01 +00:00
ad
8338d4a584 Fix the ifdefs to match i386. 2007-10-03 20:19:47 +00:00
veego
d7415fbd43 Add support to ignore hid attachments for some devices, right now MGE and
APC UPS devices.
No objections on tech-kern at the end of June 2007
Patch is from PR kern/31884
2007-10-03 15:01:28 +00:00
veego
0a0c1ae8c2 Add a debug printf (aprint_debug) when a erratum was patched. 2007-10-03 14:51:47 +00:00
ad
bf299679c7 Make kaputt code compile. 2007-10-03 14:49:24 +00:00
ad
0a4c80e2c7 Protect ksiginfo_pool with splvm to be on the safe side. 2007-10-03 13:21:22 +00:00
ad
5939a3f4b8 Make the atomics inline unless !__GNUC__. 2007-10-03 12:24:48 +00:00
ad
14b1d38f4d Back out the ALIGNBYTES change. There are structures used in userspace
that depend on the constant.
2007-10-03 12:23:44 +00:00
ad
b30dffc0e4 - sched_yield: When yielding, drop the priority to MAXPRI ensuring that the
calling thread really does yield. The scheduler will adjust it back to a
  reasonable level within 1 second. This contradicts POSIX, which specifies
  that sched_yield() put the thread onto the back of its current runqueue.
  However, POSIX doesn't really have any business specifying what should
  happen for SCHED_OTHER (i.e.  a timesharing scheduler like ours), and
  Java, MySQL and libpthread rely on sched_yield() doing something useful.

- mi_switch: adjust spc_curpriority and newl->l_priority if we avoided
  the runqueues and are doing a direct switch. Since nothing currently
  does that, there should be no functional change.
2007-10-03 11:20:09 +00:00
ad
b4bc650271 Fix a dodgy bit of code in the PERFCTRS case. 2007-10-03 11:05:58 +00:00
ad
74dc12ed8b fxsave() is a function, don't re-use the name. 2007-10-03 10:54:16 +00:00
dyoung
d07b0a69f6 Delete the unused second argument to ip_stripoptions(), move it
closer to its single caller in if_eon.c, try to move fewer bytes
by moving the IP header forward instead of moving the tail of the
mbuf backward, and use m_adj(9) instead of fiddling directly with
mbuf data members.
2007-10-02 20:35:04 +00:00
skrll
20d370f9df Make want_resched a member of cpu_info. 2007-10-02 13:49:45 +00:00
ad
f10a4e3b61 Fix assertion that broke debug kernels. 2007-10-02 13:17:16 +00:00
pooka
87319696e5 Add a comment clarifying that in the succesful case the function
returns from the middle of the loop.
2007-10-02 12:01:17 +00:00
ad
631240c898 Make want_resched a member of cpu_info. 2007-10-02 11:07:19 +00:00
martin
9b58206ecf Some cleanup:
- When registering command tables, make sure the builtin commands are
   already registered
 - Make the command table entry structure private
 - Do not bother to store the number of commands in a table, we can quickly
   calc that if needed.
2007-10-02 08:47:26 +00:00
martin
06e24dfa05 Add verbose help for (the one and only) "mach" command. 2007-10-02 08:44:03 +00:00
martti
811a7577e8 Bring some fixes from IPF 4.1.27 in order to fix kern/37037. 2007-10-02 06:15:11 +00:00
plunky
2e43d32311 fix typo : -> ; 2007-10-02 05:53:47 +00:00
junyoung
24ae586ea3 Use __packed rather than __attribute__ ((__packed__)). 2007-10-02 05:40:10 +00:00
plunky
0327efae31 clean up activate function 2007-10-02 05:38:06 +00:00
plunky
41358e9b10 remove unused activate function 2007-10-02 05:37:50 +00:00