freebsd-dev/sys/i386/i386
John Baldwin e0f66ef861 Reorganize the interrupt handling code a bit to make a few things cleaner
and increase flexibility to allow various different approaches to be tried
in the future.
- Split struct ithd up into two pieces.  struct intr_event holds the list
  of interrupt handlers associated with interrupt sources.
  struct intr_thread contains the data relative to an interrupt thread.
  Currently we still provide a 1:1 relationship of events to threads
  with the exception that events only have an associated thread if there
  is at least one threaded interrupt handler attached to the event.  This
  means that on x86 we no longer have 4 bazillion interrupt threads with
  no handlers.  It also means that interrupt events with only INTR_FAST
  handlers no longer have an associated thread either.
- Renamed struct intrhand to struct intr_handler to follow the struct
  intr_foo naming convention.  This did require renaming the powerpc
  MD struct intr_handler to struct ppc_intr_handler.
- INTR_FAST no longer implies INTR_EXCL on all architectures except for
  powerpc.  This means that multiple INTR_FAST handlers can attach to the
  same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach
  to the same interrupt.  Sharing INTR_FAST handlers may not always be
  desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun
  either.  Drivers can always still use INTR_EXCL to ask for an interrupt
  exclusively.  The way this sharing works is that when an interrupt
  comes in, all the INTR_FAST handlers are executed first, and if any
  threaded handlers exist, the interrupt thread is scheduled afterwards.
  This type of layout also makes it possible to investigate using interrupt
  filters ala OS X where the filter determines whether or not its companion
  threaded handler should run.
- Aside from the INTR_FAST changes above, the impact on MD interrupt code
  is mostly just 's/ithread/intr_event/'.
- A new MI ddb command 'show intrs' walks the list of interrupt events
  dumping their state.  It also has a '/v' verbose switch which dumps
  info about all of the handlers attached to each event.
- We currently don't destroy an interrupt thread when the last threaded
  handler is removed because it would suck for things like ppbus(8)'s
  braindead behavior.  The code is present, though, it is just under
  #if 0 for now.
- Move the code to actually execute the threaded handlers for an interrrupt
  event into a separate function so that ithread_loop() becomes more
  readable.  Previously this code was all in the middle of ithread_loop()
  and indented halfway across the screen.
- Made struct intr_thread private to kern_intr.c and replaced td_ithd
  with a thread private flag TDP_ITHREAD.
- In statclock, check curthread against idlethread directly rather than
  curthread's proc against idlethread's proc. (Not really related to intr
  changes)

Tested on:	alpha, amd64, i386, sparc64
Tested on:	arm, ia64 (older version of patch by cognet and marcel)
2005-10-25 19:48:48 +00:00
..
apic_vector.s Use xchg in Xcpustop to close a race and make cpustop_restartfunc truly 2005-10-24 20:52:26 +00:00
atomic.c Fix copyright comment & FBSDID style nits. 2003-08-25 09:48:48 +00:00
autoconf.c Create nexus in configure_first() instead of in configure(). This 2005-05-29 23:44:22 +00:00
bios.c Make the facility for recognizing BIOS-signatures more general 2005-07-21 09:48:37 +00:00
bioscall.s
busdma_machdep.c Guard against an integer underflow that could cause busdma to eat up all 2005-03-12 07:01:53 +00:00
db_disasm.c Start all license/copyright notice comments with /*-, per tradition 2005-01-05 19:10:48 +00:00
db_interface.c Start all license/copyright notice comments with /*-, per tradition 2005-01-05 19:10:48 +00:00
db_trace.c Move the prototypes of db_md_set_watchpoint(), db_md_clr_watchpoint() 2005-09-10 03:01:25 +00:00
dump_machdep.c Fix a buglet that was present in the ia64 code and that got inherited 2005-07-02 19:57:31 +00:00
elan-mmcr.c Make the facility for recognizing BIOS-signatures more general 2005-07-21 09:48:37 +00:00
elf_machdep.c Add __elfN(dump_thread). This function is called from __elfN(coredump) 2004-08-11 02:35:06 +00:00
exception.s Use an interrupt gate for the NMI handler and prevent too-early 2005-07-13 11:32:10 +00:00
gdb_machdep.c Start all license/copyright notice comments with /*-, per tradition 2005-01-05 19:10:48 +00:00
genassym.c Change the segment limits to 4GB, we set the user accessible bit on all 2005-04-13 22:57:17 +00:00
geode.c Make the facility for recognizing BIOS-signatures more general 2005-07-21 09:48:37 +00:00
i686_mem.c Trim a few things from the dmesg output and stick them under bootverbose to 2004-07-01 07:46:29 +00:00
identcpu.c Redo physical/logical CPU count. 2005-10-17 23:23:20 +00:00
in_cksum.c netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
initcpu.c - Print number of physical/logical cores and more CPUID info. 2005-10-14 22:52:01 +00:00
intr_machdep.c Reorganize the interrupt handling code a bit to make a few things cleaner 2005-10-25 19:48:48 +00:00
io_apic.c Add a tunable 'hw.apic.enable_extint' that can be set from the loader to 2005-07-29 18:58:33 +00:00
io.c Break out the MI part of the /dev/[k]mem and /dev/io drivers into 2004-08-01 11:40:54 +00:00
k6_mem.c Fix copyright comment & FBSDID style nits. 2003-08-25 09:48:48 +00:00
legacy.c Correct a few bugs in the legacy cpu attachment. Get the unit from the 2005-02-15 07:21:20 +00:00
local_apic.c Rename the lapic timer interrupt counters from lapicX: timer to cpuX: timer 2005-09-28 18:01:41 +00:00
locore.s Add the 2nd word of IA32 feature flags. This includes things such as SSE3. 2005-05-16 09:47:53 +00:00
longrun.c Move the author's copyright notice to match the initial LongRun import 2004-12-12 05:53:57 +00:00
machdep.c 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most 2005-10-14 12:43:47 +00:00
mem.c Fix module builds for i386 and amd64. 2004-08-04 18:30:31 +00:00
mp_clock.c Add missing #include <sys/module.h> 2004-05-30 20:34:58 +00:00
mp_machdep.c Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to all 2005-10-24 21:04:19 +00:00
mp_watchdog.c Fix typo. 2005-02-27 22:34:07 +00:00
mpboot.s Start all license/copyright notice comments with /*-, per tradition 2005-01-05 19:10:48 +00:00
mptable_pci.c Expose legacy_pcib_alloc_resource, and use it in the mptable pci bus 2005-09-17 23:57:53 +00:00
mptable.c Remove support for mixed mode altogether now that we no longer use IRQ 0 2005-04-14 17:59:58 +00:00
nexus.c Change a directory layout for pc98. 2005-05-10 12:02:18 +00:00
perfmon.c Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
pmap.c Specifically panic() in the case where pmap_insert_entry() fails to 2005-10-21 19:42:43 +00:00
ptrace_machdep.c Make kernel build suceed when with "options CPU_DISABLE_SSE". 2005-08-04 12:39:43 +00:00
support.s Eliminate an unpredictable branch from bcmp(). 2005-04-21 23:07:20 +00:00
swtch.s Clarify a comment. 2005-08-16 18:15:17 +00:00
symbols.raw Remove atdevbase and replace it's remaining uses with direct references to 2004-06-10 20:31:00 +00:00
sys_machdep.c Explicitly switch to the new TSS by updating the current CPU's TSS selector 2005-09-15 17:30:08 +00:00
trap.c Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to all 2005-10-24 21:04:19 +00:00
tsc.c Change all SYSCTLS which are readonly and have a related TUNABLE 2003-10-21 18:28:36 +00:00
uio_machdep.c Request a CPU private mapping from sf_buf_alloc(). 2005-02-13 23:09:36 +00:00
vm86.c Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57, 2005-09-28 07:03:03 +00:00
vm86bios.s Fix an evil bug that appeared in September 2003. VM86 bios calls use two 2005-04-13 18:13:40 +00:00
vm_machdep.c When restarting the BSP during cpu_reset() use a membar to ensure that 2005-10-24 20:53:52 +00:00