freebsd-src/sys/cam
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
..
scsi Add support for Nikon Coolpix E775 and E885 cameras. 2002-01-01 13:28:43 +00:00
cam_ccb.h Add a transport settings variant for Fibre Channel. 2001-06-24 18:17:45 +00:00
cam_debug.h Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam_extend.c Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00
cam_extend.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_periph.c Kill the command (don't rerun it) if we had an AUTOSENSE failure. 2001-07-30 00:44:32 +00:00
cam_periph.h Change the peripheral driver list from a linker set to module driven 2001-02-07 07:05:59 +00:00
cam_queue.c
cam_queue.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
cam_sim.c Const'ify cam_sim.sim_name to quiet warnings. 2001-01-24 01:46:18 +00:00
cam_sim.h Const'ify cam_sim.sim_name to quiet warnings. 2001-01-24 01:46:18 +00:00
cam_xpt_periph.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
cam_xpt_sim.h Clean up the xpt_sim creation to mirror how HBA drivers perform this task. 2000-01-14 23:08:46 +00:00
cam_xpt.c Change the preemption code for software interrupt thread schedules and 2002-01-05 08:47:13 +00:00
cam_xpt.h Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam.c Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
cam.h comment typo: subsytem -> subsystem 2001-03-31 04:34:15 +00:00