summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/apic_vector.s24
-rw-r--r--sys/i386/i386/exception.s2
-rw-r--r--sys/i386/i386/swtch.s1
-rw-r--r--sys/i386/i386/tsc.c6
-rw-r--r--sys/i386/include/asnames.h2
-rw-r--r--sys/i386/include/ipl.h75
-rw-r--r--sys/i386/include/md_var.h1
-rw-r--r--sys/i386/isa/apic_vector.s24
-rw-r--r--sys/i386/isa/atpic_vector.s13
-rw-r--r--sys/i386/isa/clock.c6
-rw-r--r--sys/i386/isa/icu_vector.s13
-rw-r--r--sys/i386/isa/intr_machdep.c11
-rw-r--r--sys/i386/isa/intr_machdep.h2
-rw-r--r--sys/i386/isa/ipl.s18
-rw-r--r--sys/i386/isa/ipl_funcs.c73
-rw-r--r--sys/i386/isa/ithread.c166
-rw-r--r--sys/i386/isa/nmi.c11
-rw-r--r--sys/i386/isa/npx.c2
18 files changed, 39 insertions, 411 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s
index 54bf003..11d9797 100644
--- a/sys/i386/i386/apic_vector.s
+++ b/sys/i386/i386/apic_vector.s
@@ -628,30 +628,6 @@ _Xrendezvous:
.data
-/*
- * Addresses of interrupt handlers.
- * XresumeNN: Resumption addresses for HWIs.
- */
- .globl _ihandlers
-_ihandlers:
-/*
- * used by:
- * ipl.s: doreti_unpend
- */
- .long Xresume0, Xresume1, Xresume2, Xresume3
- .long Xresume4, Xresume5, Xresume6, Xresume7
- .long Xresume8, Xresume9, Xresume10, Xresume11
- .long Xresume12, Xresume13, Xresume14, Xresume15
- .long Xresume16, Xresume17, Xresume18, Xresume19
- .long Xresume20, Xresume21, Xresume22, Xresume23
-/*
- * used by:
- * ipl.s: doreti_unpend
- * apic_ipl.s: splz_unpend
- */
- .long _swi_null, swi_net, _swi_null, _swi_null
- .long _swi_vm, _swi_null, _softclock
-
#if 0
/* active flag for lazy masking */
iactive:
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index 9e77114..36f5bba3 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -36,7 +36,7 @@
#include "npx.h"
#include <machine/asmacros.h>
-#include <machine/ipl.h>
+#include <sys/ipl.h>
#include <machine/lock.h>
#include <machine/mutex.h>
#include <machine/psl.h>
diff --git a/sys/i386/i386/swtch.s b/sys/i386/i386/swtch.s
index d7bc755..ac71f0c 100644
--- a/sys/i386/i386/swtch.s
+++ b/sys/i386/i386/swtch.s
@@ -42,7 +42,6 @@
#include <sys/rtprio.h>
#include <machine/asmacros.h>
-#include <machine/ipl.h>
#ifdef SMP
#include <machine/pmap.h>
diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c
index 0e2c098..0e630d9 100644
--- a/sys/i386/i386/tsc.c
+++ b/sys/i386/i386/tsc.c
@@ -130,9 +130,7 @@ static void setup_8254_mixed_mode __P((void));
int adjkerntz; /* local offset from GMT in seconds */
int clkintr_pending;
int disable_rtc_set; /* disable resettodr() if != 0 */
-volatile u_int idelayed;
int statclock_disable;
-u_int stat_imask = SWI_LOW_MASK;
#ifndef TIMER_FREQ
#define TIMER_FREQ 1193182
#endif
@@ -143,9 +141,6 @@ int tsc_is_broken;
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
-#if 0
-static u_int clk_imask = HWI_MASK | SWI_MASK;
-#endif
static const u_char daysinmonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
static u_int hardclock_max_count;
static u_int32_t i8254_lastcount;
@@ -1005,7 +1000,6 @@ cpu_initclocks()
* flag which would normally cause the RTC to generate
* interrupts.
*/
- stat_imask = HWI_MASK | SWI_MASK;
rtc_statusb = RTCSB_24HR;
} else {
/* Setting stathz to nonzero early helps avoid races. */
diff --git a/sys/i386/include/asnames.h b/sys/i386/include/asnames.h
index efdb0f9..fe5d6ca 100644
--- a/sys/i386/include/asnames.h
+++ b/sys/i386/include/asnames.h
@@ -225,7 +225,6 @@
#define _get_syscall_lock get_syscall_lock
#define _Giant Giant
#define _idle idle
-#define _ihandlers ihandlers
#define _imen imen
#define _imen_lock imen_lock
#define _in_vm86call in_vm86call
@@ -309,6 +308,7 @@
#define _svr4_szsigcode svr4_szsigcode
#define _swi_dispatcher swi_dispatcher
#define _swi_generic swi_generic
+#define _swi_net swi_net
#define _swi_null swi_null
#define _swi_vm swi_vm
#define _syscall2 syscall2
diff --git a/sys/i386/include/ipl.h b/sys/i386/include/ipl.h
index 08726df..431775f 100644
--- a/sys/i386/include/ipl.h
+++ b/sys/i386/include/ipl.h
@@ -42,87 +42,12 @@
#include <i386/isa/icu_ipl.h>
#endif
-/*
- * Software interrupt level. We treat the software interrupt as a
- * single interrupt at a fictive hardware interrupt level.
- */
-#define SOFTINTR (NHWI + 0)
-
-/*
- * Software interrupt bit numbers in priority order. The priority only
- * determines which swi will be dispatched next; a higher priority swi
- * may be dispatched when a nested h/w interrupt handler returns.
- *
- * XXX FIXME: There's no longer a relation between the SWIs and the
- * HWIs, so it makes more sense for these values to start at 0, but
- * there's lots of code which expects them to start at NHWI.
- */
-#define SWI_TTY (NHWI + 0)
-#define SWI_NET (NHWI + 1)
-#define SWI_CAMNET (NHWI + 2)
-#define SWI_CAMBIO (NHWI + 3)
-#define SWI_VM (NHWI + 4)
-#define SWI_TQ (NHWI + 5)
-#define SWI_CLOCK (NHWI + 6)
#define NSWI 7
/*
- * Corresponding interrupt-pending bits for ipending.
- */
-#define SWI_TTY_PENDING (1 << SWI_TTY)
-#define SWI_NET_PENDING (1 << SWI_NET)
-#define SWI_CAMNET_PENDING (1 << SWI_CAMNET)
-#define SWI_CAMBIO_PENDING (1 << SWI_CAMBIO)
-#define SWI_VM_PENDING (1 << SWI_VM)
-#define SWI_TQ_PENDING (1 << SWI_TQ)
-#define SWI_CLOCK_PENDING (1 << SWI_CLOCK)
-
-/*
- * Corresponding interrupt-disable masks for cpl. The ordering is now by
- * inclusion (where each mask is considered as a set of bits). Everything
- * except SWI_CLOCK_MASK includes SWI_LOW_MASK so that softclock() and low
- * priority swi's don't run while other swi handlers are running and timeout
- * routines can call swi handlers. SWI_TTY_MASK includes SWI_NET_MASK in
- * case tty interrupts are processed at splsofttty() for a tty that is in
- * SLIP or PPP line discipline (this is weaker than merging net_imask with
- * tty_imask in isa.c - splimp() must mask hard and soft tty interrupts, but
- * spltty() apparently only needs to mask soft net interrupts).
- */
-#define SWI_TTY_MASK (SWI_TTY_PENDING | SWI_LOW_MASK | SWI_NET_MASK)
-#define SWI_CAMNET_MASK (SWI_CAMNET_PENDING | SWI_LOW_MASK)
-#define SWI_CAMBIO_MASK (SWI_CAMBIO_PENDING | SWI_LOW_MASK)
-#define SWI_NET_MASK (SWI_NET_PENDING | SWI_LOW_MASK)
-#define SWI_VM_MASK (SWI_VM_PENDING | SWI_LOW_MASK)
-#define SWI_TQ_MASK (SWI_TQ_PENDING | SWI_LOW_MASK)
-#define SWI_CLOCK_MASK SWI_CLOCK_PENDING
-#define SWI_LOW_MASK (SWI_TQ_PENDING | SWI_CLOCK_MASK)
-#define SWI_MASK (~HWI_MASK)
-
-/*
* astpending bits
*/
#define AST_PENDING 0x00000001
#define AST_RESCHED 0x00000002
-#ifndef LOCORE
-
-/*
- * cpl is preserved by interrupt handlers so it is effectively nonvolatile.
- * ipending and idelayed are changed by interrupt handlers so they are
- * volatile.
- */
-#ifdef notyet /* in <sys/interrupt.h> until pci drivers stop hacking on them */
-extern unsigned bio_imask; /* group of interrupts masked with splbio() */
-#endif
-
-extern volatile unsigned idelayed; /* interrupts to become pending */
-extern volatile unsigned spending; /* pending software interrupts */
-#ifdef notyet /* in <sys/systm.h> until pci drivers stop hacking on them */
-extern unsigned net_imask; /* group of interrupts masked with splimp() */
-extern unsigned stat_imask; /* interrupts masked with splstatclock() */
-extern unsigned tty_imask; /* group of interrupts masked with spltty() */
-#endif
-
-#endif /* !LOCORE */
-
#endif /* !_MACHINE_IPL_H_ */
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index 4c05237..1660a75 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -95,6 +95,7 @@ u_long kvtop __P((void *addr));
void setidt __P((int idx, alias_for_inthand_t *func, int typ, int dpl,
int selec));
void swi_vm __P((void));
+void swi_net __P((void));
void userconfig __P((void));
int user_dbreg_trap __P((void));
int vm_page_zero_idle __P((void));
diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s
index 54bf003..11d9797 100644
--- a/sys/i386/isa/apic_vector.s
+++ b/sys/i386/isa/apic_vector.s
@@ -628,30 +628,6 @@ _Xrendezvous:
.data
-/*
- * Addresses of interrupt handlers.
- * XresumeNN: Resumption addresses for HWIs.
- */
- .globl _ihandlers
-_ihandlers:
-/*
- * used by:
- * ipl.s: doreti_unpend
- */
- .long Xresume0, Xresume1, Xresume2, Xresume3
- .long Xresume4, Xresume5, Xresume6, Xresume7
- .long Xresume8, Xresume9, Xresume10, Xresume11
- .long Xresume12, Xresume13, Xresume14, Xresume15
- .long Xresume16, Xresume17, Xresume18, Xresume19
- .long Xresume20, Xresume21, Xresume22, Xresume23
-/*
- * used by:
- * ipl.s: doreti_unpend
- * apic_ipl.s: splz_unpend
- */
- .long _swi_null, swi_net, _swi_null, _swi_null
- .long _swi_vm, _swi_null, _softclock
-
#if 0
/* active flag for lazy masking */
iactive:
diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s
index d2b88bf..0a89492 100644
--- a/sys/i386/isa/atpic_vector.s
+++ b/sys/i386/isa/atpic_vector.s
@@ -211,16 +211,3 @@ MCOUNT_LABEL(bintr)
INTR(15,intr15, IO_ICU2, ENABLE_ICU1_AND_2, ah,)
MCOUNT_LABEL(eintr)
-
- .data
- .globl _ihandlers
-_ihandlers: /* addresses of interrupt handlers */
- /* actually resumption addresses for HWI's */
- .long Xresume0, Xresume1, Xresume2, Xresume3
- .long Xresume4, Xresume5, Xresume6, Xresume7
- .long Xresume8, Xresume9, Xresume10, Xresume11
- .long Xresume12, Xresume13, Xresume14, Xresume15
- .long _swi_null, swi_net, _swi_null, _swi_null
- .long _swi_vm, _swi_null, _softclock
-
- .text
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index 0e2c098..0e630d9 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -130,9 +130,7 @@ static void setup_8254_mixed_mode __P((void));
int adjkerntz; /* local offset from GMT in seconds */
int clkintr_pending;
int disable_rtc_set; /* disable resettodr() if != 0 */
-volatile u_int idelayed;
int statclock_disable;
-u_int stat_imask = SWI_LOW_MASK;
#ifndef TIMER_FREQ
#define TIMER_FREQ 1193182
#endif
@@ -143,9 +141,6 @@ int tsc_is_broken;
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
static int beeping = 0;
-#if 0
-static u_int clk_imask = HWI_MASK | SWI_MASK;
-#endif
static const u_char daysinmonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
static u_int hardclock_max_count;
static u_int32_t i8254_lastcount;
@@ -1005,7 +1000,6 @@ cpu_initclocks()
* flag which would normally cause the RTC to generate
* interrupts.
*/
- stat_imask = HWI_MASK | SWI_MASK;
rtc_statusb = RTCSB_24HR;
} else {
/* Setting stathz to nonzero early helps avoid races. */
diff --git a/sys/i386/isa/icu_vector.s b/sys/i386/isa/icu_vector.s
index d2b88bf..0a89492 100644
--- a/sys/i386/isa/icu_vector.s
+++ b/sys/i386/isa/icu_vector.s
@@ -211,16 +211,3 @@ MCOUNT_LABEL(bintr)
INTR(15,intr15, IO_ICU2, ENABLE_ICU1_AND_2, ah,)
MCOUNT_LABEL(eintr)
-
- .data
- .globl _ihandlers
-_ihandlers: /* addresses of interrupt handlers */
- /* actually resumption addresses for HWI's */
- .long Xresume0, Xresume1, Xresume2, Xresume3
- .long Xresume4, Xresume5, Xresume6, Xresume7
- .long Xresume8, Xresume9, Xresume10, Xresume11
- .long Xresume12, Xresume13, Xresume14, Xresume15
- .long _swi_null, swi_net, _swi_null, _swi_null
- .long _swi_vm, _swi_null, _softclock
-
- .text
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index 4506c05..a8d701b 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -90,13 +90,12 @@
#endif
/*
- * Per-interrupt data. We consider the soft interrupt to be a special
- * case, so these arrays have NHWI + NSWI entries, not ICU_LEN.
+ * Per-interrupt data.
*/
-u_long *intr_countp[NHWI + NSWI]; /* pointers to interrupt counters */
-driver_intr_t *intr_handler[NHWI + NSWI]; /* first level interrupt handler */
-struct ithd *ithds[NHWI + NSWI]; /* real interrupt handler */
-void *intr_unit[NHWI + NSWI];
+u_long *intr_countp[ICU_LEN]; /* pointers to interrupt counters */
+driver_intr_t *intr_handler[ICU_LEN]; /* first level interrupt handler */
+struct ithd *ithds[ICU_LEN]; /* real interrupt handler */
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
diff --git a/sys/i386/isa/intr_machdep.h b/sys/i386/isa/intr_machdep.h
index 5d9d9d2..999df15 100644
--- a/sys/i386/isa/intr_machdep.h
+++ b/sys/i386/isa/intr_machdep.h
@@ -214,8 +214,6 @@ int icu_setup __P((int intr, driver_intr_t *func, void *arg,
int flags));
int icu_unset __P((int intr, driver_intr_t *handler));
-intrmask_t splq __P((intrmask_t mask));
-
/*
* WARNING: These are internal functions and not to be used by device drivers!
* They are subject to change without notice.
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s
index 1ee9ace..9bd36cf 100644
--- a/sys/i386/isa/ipl.s
+++ b/sys/i386/isa/ipl.s
@@ -54,19 +54,19 @@
/* current priority (all off) */
.globl _tty_imask
-_tty_imask: .long SWI_TTY_MASK
+_tty_imask: .long 0
.globl _bio_imask
-_bio_imask: .long SWI_CLOCK_MASK | SWI_CAMBIO_MASK
+_bio_imask: .long 0
.globl _net_imask
-_net_imask: .long SWI_NET_MASK | SWI_CAMNET_MASK
+_net_imask: .long 0
.globl _cam_imask
-_cam_imask: .long SWI_CAMBIO_MASK | SWI_CAMNET_MASK
+_cam_imask: .long 0
.globl _soft_imask
-_soft_imask: .long SWI_MASK
+_soft_imask: .long 0
.globl _softnet_imask
-_softnet_imask: .long SWI_NET_MASK
+_softnet_imask: .long 0
.globl _softtty_imask
-_softtty_imask: .long SWI_TTY_MASK
+_softtty_imask: .long 0
/* pending software interrupts */
.globl _spending
@@ -173,7 +173,9 @@ doreti_ast:
jmp doreti_next
ALIGN_TEXT
-swi_net:
+ .globl _swi_net
+ .type _swi_net,@function
+_swi_net:
MCOUNT
bsfl _netisr,%eax
je swi_net_done
diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c
index 1cd6070..5ee8fa5 100644
--- a/sys/i386/isa/ipl_funcs.c
+++ b/sys/i386/isa/ipl_funcs.c
@@ -29,70 +29,11 @@
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <machine/ipl.h>
-#include <sys/proc.h>
-#include <i386/isa/icu.h>
-#include <i386/isa/intr_machdep.h>
+#include <sys/ipl.h>
+#include <sys/interrupt.h>
+#include <machine/md_var.h>
-/*
- * Bits in the ipending bitmap variable must be set atomically because
- * ipending may be manipulated by interrupts or other cpu's without holding
- * any locks.
- *
- * Note: setbits uses a locked or, making simple cases MP safe.
- */
-#define DO_SETBITS(name, var, bits) \
-void name(void) \
-{ \
- atomic_set_int(var, bits); \
- sched_ithd((void *) SOFTINTR); \
-}
-
-#define DO_SETBITS_AND_NO_MORE(name, var, bits) \
-void name(void) \
-{ \
- atomic_set_int(var, bits); \
-}
-
-DO_SETBITS(setdelayed, &spending, loadandclear(&idelayed))
-DO_SETBITS(setsoftcamnet,&spending, SWI_CAMNET_PENDING)
-DO_SETBITS(setsoftcambio,&spending, SWI_CAMBIO_PENDING)
-DO_SETBITS(setsoftclock, &spending, SWI_CLOCK_PENDING)
-DO_SETBITS(setsoftnet, &spending, SWI_NET_PENDING)
-DO_SETBITS(setsofttty, &spending, SWI_TTY_PENDING)
-DO_SETBITS(setsoftvm, &spending, SWI_VM_PENDING)
-DO_SETBITS(setsofttq, &spending, SWI_TQ_PENDING)
-
-DO_SETBITS_AND_NO_MORE(schedsofttty, &idelayed, SWI_TTY_PENDING)
-
-unsigned
-softclockpending(void)
-{
- return (spending & SWI_CLOCK_PENDING);
-}
-
-/*
- * Dummy spl calls. The only reason for these is to not break
- * all the code which expects to call them.
- */
-void spl0 (void) {}
-void splx (intrmask_t x) {}
-intrmask_t splq(intrmask_t mask) {return 0; }
-intrmask_t splbio(void) {return 0; }
-intrmask_t splcam(void) {return 0; }
-intrmask_t splclock(void) {return 0; }
-intrmask_t splhigh(void) {return 0; }
-intrmask_t splimp(void) {return 0; }
-intrmask_t splnet(void) {return 0; }
-intrmask_t splsoftcam(void) {return 0; }
-intrmask_t splsoftcambio(void) {return 0; }
-intrmask_t splsoftcamnet(void) {return 0; }
-intrmask_t splsoftclock(void) {return 0; }
-intrmask_t splsofttty(void) {return 0; }
-intrmask_t splsoftvm(void) {return 0; }
-intrmask_t splsofttq(void) {return 0; }
-intrmask_t splstatclock(void) {return 0; }
-intrmask_t spltty(void) {return 0; }
-intrmask_t splvm(void) {return 0; }
+swihand_t *shandlers[NSWI] = { /* software interrupts */
+ swi_null, swi_net, swi_null, swi_null,
+ swi_vm, swi_null, softclock
+};
diff --git a/sys/i386/isa/ithread.c b/sys/i386/isa/ithread.c
index f8326ea..b2a98a2 100644
--- a/sys/i386/isa/ithread.c
+++ b/sys/i386/isa/ithread.c
@@ -87,15 +87,9 @@
#include <machine/mutex.h>
#include <sys/ktr.h>
#include <machine/cpu.h>
-#if 0
-#include <ddb/ddb.h>
-#endif
-u_long softintrcnt [NSWI];
static u_int straycount[NHWI];
-SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr, NULL)
-
#define MAX_STRAY_LOG 5
/*
@@ -115,8 +109,7 @@ sched_ithd(void *cookie)
* argument for counting hardware interrupts when they're
* processed too.
*/
- if (irq < NHWI) /* real interrupt, */
- atomic_add_long(intr_countp[irq], 1); /* one more for this IRQ */
+ atomic_add_long(intr_countp[irq], 1); /* one more for this IRQ */
atomic_add_int(&cnt.v_intr, 1); /* one more global interrupt */
/*
@@ -124,47 +117,19 @@ sched_ithd(void *cookie)
* this IRQ, log it as a stray interrupt.
*/
if (ir == NULL || ir->it_proc == NULL) {
- if (irq < NHWI) {
- if (straycount[irq] < MAX_STRAY_LOG) {
- printf("stray irq %d\n", irq);
- if (++straycount[irq] == MAX_STRAY_LOG)
- printf("got %d stray irq %d's: "
- "not logging anymore\n",
- MAX_STRAY_LOG, irq);
- }
- return;
+ if (straycount[irq] < MAX_STRAY_LOG) {
+ printf("stray irq %d\n", irq);
+ if (++straycount[irq] == MAX_STRAY_LOG)
+ printf(
+ "got %d stray irq %d's: not logging anymore\n",
+ MAX_STRAY_LOG, irq);
}
- panic("sched_ithd: ithds[%d] == NULL", irq);
+ return;
}
CTR3(KTR_INTR, "sched_ithd pid %d(%s) need=%d",
ir->it_proc->p_pid, ir->it_proc->p_comm, ir->it_need);
-#if 0
- /*
- * If we are in the debugger, we can't use interrupt threads to
- * process interrupts since the threads are scheduled. Instead,
- * call the interrupt handlers directly. This should be able to
- * go away once we have light-weight interrupt handlers.
- */
- if (db_active) {
- struct intrec *ih; /* and our interrupt handler chain */
-#if 0
- membar_unlock(); /* push out "it_need=0" */
-#endif
- for (ih = ir->it_ih; ih != NULL; ih = ih->next) {
- if ((ih->flags & INTR_MPSAFE) == 0)
- mtx_enter(&Giant, MTX_DEF);
- ih->handler(ih->argument);
- if ((ih->flags & INTR_MPSAFE) == 0)
- mtx_exit(&Giant, MTX_DEF);
- }
-
- INTREN (1 << ir->irq); /* reset the mask bit */
- return;
- }
-#endif
-
/*
* Set it_need so that if the thread is already running but close
* to done, it will do another go-round. Then get the sched lock
@@ -183,18 +148,13 @@ sched_ithd(void *cookie)
aston();
}
else {
-if (irq < NHWI && (irq & 7) != 0)
CTR3(KTR_INTR, "sched_ithd %d: it_need %d, state %d",
ir->it_proc->p_pid,
ir->it_need,
ir->it_proc->p_stat );
}
mtx_exit(&sched_lock, MTX_SPIN);
-#if 0
- aston(); /* ??? check priorities first? */
-#else
need_resched();
-#endif
}
/*
@@ -266,113 +226,3 @@ ithd_loop(void *dummy)
mtx_exit(&sched_lock, MTX_SPIN);
}
}
-
-/*
- * Start soft interrupt thread.
- */
-void
-start_softintr(void *dummy)
-{
- int error;
- struct proc *p;
- struct ithd *softintr; /* descriptor for the "IRQ" */
- struct intrec *idesc; /* descriptor for this handler */
- char *name = "sintr"; /* name for idesc */
- int i;
-
- if (ithds[SOFTINTR]) { /* we already have a thread */
- printf("start_softintr: already running");
- return;
- }
- /* first handler for this irq. */
- softintr = malloc(sizeof (struct ithd), M_DEVBUF, M_WAITOK);
- if (softintr == NULL)
- panic ("Can't create soft interrupt thread");
- bzero(softintr, sizeof(struct ithd));
- softintr->irq = SOFTINTR;
- ithds[SOFTINTR] = softintr;
- error = kthread_create(intr_soft, NULL, &p,
- RFSTOPPED | RFHIGHPID, "softinterrupt");
- if (error)
- panic("start_softintr: kthread_create error %d\n", error);
-
- p->p_rtprio.type = RTP_PRIO_ITHREAD;
- p->p_rtprio.prio = PI_SOFT; /* soft interrupt */
- p->p_stat = SWAIT; /* we're idle */
- p->p_flag |= P_NOLOAD;
-
- /* Put in linkages. */
- softintr->it_proc = p;
- p->p_ithd = softintr; /* reverse link */
-
- idesc = malloc(sizeof (struct intrec), M_DEVBUF, M_WAITOK);
- if (idesc == NULL)
- panic ("Can't create soft interrupt thread");
- bzero(idesc, sizeof (struct intrec));
-
- idesc->ithd = softintr;
- idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK);
- if (idesc->name == NULL)
- panic ("Can't create soft interrupt thread");
- strcpy(idesc->name, name);
- for (i = NHWI; i < NHWI + NSWI; i++)
- intr_countp[i] = &softintrcnt [i - NHWI];
-}
-
-/*
- * Software interrupt process code.
- */
-void
-intr_soft(void *dummy)
-{
- int i;
- struct ithd *me; /* our thread context */
-
- me = curproc->p_ithd; /* point to myself */
-
- /* Main loop */
- for (;;) {
-#if 0
- CTR3(KTR_INTR, "intr_soft pid %d(%s) need=%d",
- me->it_proc->p_pid, me->it_proc->p_comm,
- me->it_need);
-#endif
-
- /*
- * Service interrupts. If another interrupt arrives
- * while we are running, they will set it_need to
- * denote that we should make another pass.
- */
- me->it_need = 0;
- while ((i = ffs(spending))) {
- i--;
- atomic_add_long(intr_countp[i], 1);
- spending &= ~ (1 << i);
- mtx_enter(&Giant, MTX_DEF);
- if (ihandlers[i] == swi_generic)
- swi_dispatcher(i);
- else
- (ihandlers[i])();
- mtx_exit(&Giant, MTX_DEF);
- }
- /*
- * Processed all our interrupts. Now get the sched
- * lock. This may take a while and it_need may get
- * set again, so we have to check it again.
- */
- mtx_enter(&sched_lock, MTX_SPIN);
- if (!me->it_need) {
-#if 0
- CTR1(KTR_INTR, "intr_soft pid %d: done",
- me->it_proc->p_pid);
-#endif
- me->it_proc->p_stat = SWAIT; /* we're idle */
- mi_switch();
-#if 0
- CTR1(KTR_INTR, "intr_soft pid %d: resumed",
- me->it_proc->p_pid);
-#endif
- }
- mtx_exit(&sched_lock, MTX_SPIN);
- }
-}
diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c
index 4506c05..a8d701b 100644
--- a/sys/i386/isa/nmi.c
+++ b/sys/i386/isa/nmi.c
@@ -90,13 +90,12 @@
#endif
/*
- * Per-interrupt data. We consider the soft interrupt to be a special
- * case, so these arrays have NHWI + NSWI entries, not ICU_LEN.
+ * Per-interrupt data.
*/
-u_long *intr_countp[NHWI + NSWI]; /* pointers to interrupt counters */
-driver_intr_t *intr_handler[NHWI + NSWI]; /* first level interrupt handler */
-struct ithd *ithds[NHWI + NSWI]; /* real interrupt handler */
-void *intr_unit[NHWI + NSWI];
+u_long *intr_countp[ICU_LEN]; /* pointers to interrupt counters */
+driver_intr_t *intr_handler[ICU_LEN]; /* first level interrupt handler */
+struct ithd *ithds[ICU_LEN]; /* real interrupt handler */
+void *intr_unit[ICU_LEN];
static inthand_t *fastintr[ICU_LEN] = {
&IDTVEC(fastintr0), &IDTVEC(fastintr1),
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 8610e35..e53c54c 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -136,7 +136,7 @@ SYSCTL_INT(_hw,HW_FLOATINGPT, floatingpoint,
"Floatingpoint instructions executed in hardware");
#ifndef SMP
-static u_int npx0_imask = SWI_LOW_MASK;
+static u_int npx0_imask = 0;
static struct gate_descriptor npx_idt_probeintr;
static int npx_intrno;
static volatile u_int npx_intrs_while_probing;
OpenPOWER on IntegriCloud