diff options
author | jhb <jhb@FreeBSD.org> | 2000-09-13 18:33:25 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-09-13 18:33:25 +0000 |
commit | 7013b8322587468516f271030ba6f1e1e8ad2505 (patch) | |
tree | 094e936b4c4d7213d8c6c9ada2d1b54c3631a970 /sys/kern/kern_intr.c | |
parent | 2bef2cffd4590e0d732ee9af20c3fc37217d6b52 (diff) | |
download | FreeBSD-src-7013b8322587468516f271030ba6f1e1e8ad2505.zip FreeBSD-src-7013b8322587468516f271030ba6f1e1e8ad2505.tar.gz |
- Remove the inthand2_t type and use the equivalent driver_intr_t type from
newbus for referencing device interrupt handlers.
- Move the 'struct intrec' type which describes interrupt sources into
sys/interrupt.h instead of making it just be a x86 structure.
- Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd'
and 'struct intrec'
- Move the code to translate new-bus interrupt flags into an interrupt thread
priority out of the x86 nexus code and into a MI ithread_priority()
function in sys/kern/kern_intr.c.
- Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and
sys/pci/pci_compat.c.
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r-- | sys/kern/kern_intr.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index dd4b7c9..c55b294 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -29,6 +29,8 @@ #include <sys/param.h> +#include <sys/bus.h> +#include <sys/rtprio.h> #include <sys/systm.h> #include <sys/malloc.h> @@ -128,3 +130,40 @@ unregister_swi(intr, handler) splx(s); } +int +ithread_priority(flags) + int flags; +{ + int pri; + + switch (flags) { + case INTR_TYPE_TTY: /* keyboard or parallel port */ + pri = PI_TTYLOW; + break; + case (INTR_TYPE_TTY | INTR_FAST): /* sio */ + pri = PI_TTYHIGH; + break; + case INTR_TYPE_BIO: + /* + * XXX We need to refine this. BSD/OS distinguishes + * between tape and disk priorities. + */ + pri = PI_DISK; + break; + case INTR_TYPE_NET: + pri = PI_NET; + break; + case INTR_TYPE_CAM: + pri = PI_DISK; /* XXX or PI_CAM? */ + break; + case INTR_TYPE_MISC: + pri = PI_DULL; /* don't care */ + break; + /* We didn't specify an interrupt level. */ + default: + panic("ithread_priority: no interrupt type in flags"); + } + + return pri; +} + |