freebsd-dev/sys/i386
John Baldwin c86b6ff551 Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
..
acpica Yet another verbose printing cleanup. Remove debug_wakeup flag and 2001-11-18 18:48:31 +00:00
apm Some fix for the recent apm module changes. 2001-11-01 16:34:07 +00:00
bios Some fix for the recent apm module changes. 2001-11-01 16:34:07 +00:00
compile Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
conf Add the nullmodem device 2002-01-01 05:16:03 +00:00
i386 Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
ibcs2 Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
include Add support for the AVM Fritz!Card PCI version 2 controller. 2001-12-22 09:25:55 +00:00
isa Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
linux Convert BSD trap codes to i386. 2001-11-20 09:39:31 +00:00
pci Add identification string for AMD-761 host to PCI bridge. 2001-12-10 09:27:00 +00:00
svr4 If we have a p variable pointing to td->td_proc already, use it instead of 2001-09-18 21:20:58 +00:00
Makefile Update pathnames for creation of tags file. 2001-12-05 01:23:21 +00:00