diff options
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/apic_vector.s | 14 | ||||
-rw-r--r-- | sys/i386/isa/atpic_vector.s | 8 | ||||
-rw-r--r-- | sys/i386/isa/icu_vector.s | 8 | ||||
-rw-r--r-- | sys/i386/isa/intr_machdep.c | 1 | ||||
-rw-r--r-- | sys/i386/isa/ipl.s | 3 | ||||
-rw-r--r-- | sys/i386/isa/nmi.c | 1 |
6 files changed, 24 insertions, 11 deletions
diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s index 4ebf35d..a2cdb47 100644 --- a/sys/i386/isa/apic_vector.s +++ b/sys/i386/isa/apic_vector.s @@ -48,7 +48,8 @@ IDTVEC(vec_name) ; \ movl $KPSEL,%eax ; \ mov %ax,%fs ; \ FAKE_MCOUNT(13*4(%esp)) ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ pushl _intr_unit + (irq_num) * 4 ; \ call *_intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \ addl $4, %esp ; \ @@ -58,6 +59,7 @@ IDTVEC(vec_name) ; \ movl _intr_countp + (irq_num) * 4, %eax ; \ lock ; \ incl (%eax) ; \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ jmp _doreti @@ -150,7 +152,8 @@ IDTVEC(vec_name) ; \ MASK_LEVEL_IRQ(irq_num) ; \ EOI_IRQ(irq_num) ; \ 0: ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ ; \ /* entry point used by doreti_unpend for HWIs. */ \ __CONCAT(Xresume,irq_num): ; \ @@ -160,6 +163,7 @@ __CONCAT(Xresume,irq_num): ; \ call _sched_ithd ; \ addl $4, %esp ; /* discard the parameter */ \ ; \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ jmp _doreti @@ -301,7 +305,8 @@ _Xcpuast: FAKE_MCOUNT(13*4(%esp)) orl $AST_PENDING, PCPU(ASTPENDING) /* XXX */ - incb PCPU(INTR_NESTING_LEVEL) + movl PCPU(CURPROC),%ebx + incl P_INTR_NESTING_LEVEL(%ebx) sti movl PCPU(CPUID), %eax @@ -316,6 +321,7 @@ _Xcpuast: 2: lock incl CNAME(cpuast_cnt) + decl P_INTR_NESTING_LEVEL(%ebx) MEXITCOUNT jmp _doreti 1: @@ -323,6 +329,7 @@ _Xcpuast: POP_FRAME iret +#if 0 /* * Executed by a CPU when it receives an XFORWARD_IRQ IPI. @@ -360,7 +367,6 @@ _Xforward_irq: POP_FRAME iret -#if 0 /* * */ diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s index 635d2ad..0a3456f 100644 --- a/sys/i386/isa/atpic_vector.s +++ b/sys/i386/isa/atpic_vector.s @@ -61,7 +61,8 @@ IDTVEC(vec_name) ; \ mov $KPSEL,%ax ; \ mov %ax,%fs ; \ FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ pushl _intr_unit + (irq_num) * 4 ; \ call *_intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \ enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \ @@ -69,6 +70,7 @@ IDTVEC(vec_name) ; \ incl _cnt+V_INTR ; /* book-keeping can wait */ \ movl _intr_countp + (irq_num) * 4,%eax ; \ incl (%eax) ; \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ jmp _doreti @@ -102,13 +104,15 @@ IDTVEC(vec_name) ; \ movb %al,_imen + IRQ_BYTE(irq_num) ; \ outb %al,$icu+ICU_IMR_OFFSET ; \ enable_icus ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ __CONCAT(Xresume,irq_num): ; \ FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \ pushl $irq_num; /* pass the IRQ */ \ sti ; \ call _sched_ithd ; \ addl $4, %esp ; /* discard the parameter */ \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ /* We could usually avoid the following jmp by inlining some of */ \ /* _doreti, but it's probably better to use less cache. */ \ diff --git a/sys/i386/isa/icu_vector.s b/sys/i386/isa/icu_vector.s index 635d2ad..0a3456f 100644 --- a/sys/i386/isa/icu_vector.s +++ b/sys/i386/isa/icu_vector.s @@ -61,7 +61,8 @@ IDTVEC(vec_name) ; \ mov $KPSEL,%ax ; \ mov %ax,%fs ; \ FAKE_MCOUNT((12+ACTUALLY_PUSHED)*4(%esp)) ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ pushl _intr_unit + (irq_num) * 4 ; \ call *_intr_handler + (irq_num) * 4 ; /* do the work ASAP */ \ enable_icus ; /* (re)enable ASAP (helps edge trigger?) */ \ @@ -69,6 +70,7 @@ IDTVEC(vec_name) ; \ incl _cnt+V_INTR ; /* book-keeping can wait */ \ movl _intr_countp + (irq_num) * 4,%eax ; \ incl (%eax) ; \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ jmp _doreti @@ -102,13 +104,15 @@ IDTVEC(vec_name) ; \ movb %al,_imen + IRQ_BYTE(irq_num) ; \ outb %al,$icu+ICU_IMR_OFFSET ; \ enable_icus ; \ - incb PCPU(INTR_NESTING_LEVEL) ; \ + movl PCPU(CURPROC),%ebx ; \ + incl P_INTR_NESTING_LEVEL(%ebx) ; \ __CONCAT(Xresume,irq_num): ; \ FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \ pushl $irq_num; /* pass the IRQ */ \ sti ; \ call _sched_ithd ; \ addl $4, %esp ; /* discard the parameter */ \ + decl P_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ /* We could usually avoid the following jmp by inlining some of */ \ /* _doreti, but it's probably better to use less cache. */ \ diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c index 00f5f23..b9328ae 100644 --- a/sys/i386/isa/intr_machdep.c +++ b/sys/i386/isa/intr_machdep.c @@ -577,6 +577,7 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, if (errcode) panic("inthand_add: Can't create " "interrupt thread"); + p->p_intr_nesting_level = 1; p->p_rtprio.type = RTP_PRIO_ITHREAD; p->p_stat = SWAIT; /* we're idle */ diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s index ca874ea..7c41589 100644 --- a/sys/i386/isa/ipl.s +++ b/sys/i386/isa/ipl.s @@ -57,8 +57,6 @@ _doreti: FAKE_MCOUNT(_bintr) /* init "from" _bintr -> _doreti */ doreti_next: - decb PCPU(INTR_NESTING_LEVEL) - /* Check for ASTs that can be handled now. */ testl $AST_PENDING,PCPU(ASTPENDING) je doreti_exit /* no AST, exit */ @@ -128,7 +126,6 @@ doreti_ast: sti movl $T_ASTFLT,TF_TRAPNO(%esp) call _ast - movb $1,PCPU(INTR_NESTING_LEVEL) /* for doreti_next to decrement */ jmp doreti_next #ifdef APIC_IO diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c index 00f5f23..b9328ae 100644 --- a/sys/i386/isa/nmi.c +++ b/sys/i386/isa/nmi.c @@ -577,6 +577,7 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, if (errcode) panic("inthand_add: Can't create " "interrupt thread"); + p->p_intr_nesting_level = 1; p->p_rtprio.type = RTP_PRIO_ITHREAD; p->p_stat = SWAIT; /* we're idle */ |