diff options
author | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
commit | 937122ae6dc02a639d13dd06132201548bd7364f (patch) | |
tree | 75b59a2832d9f622680ddf91bb405ee9b1f761d4 /sys/i386/isa/atpic_vector.s | |
parent | d326c51b74ea24afabc190774a1b7721c3e6d1e8 (diff) | |
download | FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.zip FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.tar.gz |
Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context. This is also necessary
in order to context switch from sched_ithd() directly.
Reviewed By: peter
Diffstat (limited to 'sys/i386/isa/atpic_vector.s')
-rw-r--r-- | sys/i386/isa/atpic_vector.s | 8 |
1 files changed, 6 insertions, 2 deletions
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. */ \ |