freebsd-skq/sys/amd64/isa
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
..
atpic_vector.S Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
clock.c Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
icu_ipl.s Remove the leading underscore from all symbols defined in x86 asm 2001-02-25 06:29:04 +00:00
icu_ipl.S Remove the leading underscore from all symbols defined in x86 asm 2001-02-25 06:29:04 +00:00
icu_vector.s Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
icu_vector.S Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
icu.h Axe a commented, unused #define related to the old giant lock. 2001-08-24 16:52:31 +00:00
intr_machdep.c Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
intr_machdep.h Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
isa_dma.c Add ACPI attachments. 2001-08-30 09:17:03 +00:00
isa_dma.h Stop isadma from abusing the B_READ, B_RAW and B_WRITE flags. 2000-03-13 10:19:32 +00:00
isa.c Use the new resource_list_print_type() function. 2001-12-21 21:54:56 +00:00
isa.h
ithread.c Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
nmi.c Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
npx.c Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
timerreg.h
vector.s Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00
vector.S Introduce a standard name for the lock protecting an interrupt controller 2001-12-20 23:48:31 +00:00