* SUCH DAMAGE.
*
* @(#)icu.s 7.2 (Berkeley) 5/21/91
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 2 00117
+ * -------------------- ----- ----------------------
+ *
+ * 28 Nov 92 Frank MacLachlan Aligned addresses and data
+ * on 32bit boundaries.
+ * 24 Mar 93 Rodney W. Grimes Added interrupt counters for vmstat
+ * also stray and false intr counters added
*/
/*
*/
.data
+ ALIGN32
.globl _imen
.globl _cpl
_cpl: .long 0xffff # current priority level (all off)
.globl _netmask
_netmask: .long 0
.globl _isa_intr
+ /*
+ * This is the names of the counters for vmstat added by
+ * rgrimes@agora.rain.com (Rodney W. Grimes) 10/30/1992
+ * Added false and stray counters 3/25/1993 rgrimes
+ */
+ .globl _intrcnt, _eintrcnt /* Added to make vmstat happy */
+ .globl _isa_false7_intrcnt, _isa_false15_intrcnt, _isa_stray_intrcnt
+_intrcnt: /* Added to make vmstat happy */
+_isa_false7_intrcnt:
+ .space 4 /* false IRQ7's */
+_isa_false15_intrcnt:
+ .space 4 /* false IRQ15's */
+_isa_stray_intrcnt:
+ .space 4 /* stray interrupts */
_isa_intr: .space 16*4
+_eintrcnt: /* Added to make vmstat happy */
.text
/*
* Handle return from interrupt after device handler finishes
*/
+ ALIGN32
doreti:
cli
popl %ebx # remove intr number
+ NOP
popl %eax # get previous priority
# now interrupt frame is a trap frame!
movw %ax,%cx
movw %ax,_cpl
orw _imen,%ax
- NOP
outb %al,$ IO_ICU1+1 # re-enable intr?
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
+ cmpw $0x1f,13*4(%esp) # to user?
+ je 1f # nope, leave
andw $0xffff,%cx
cmpw $0,%cx # returning to zero?
je 1f
addl $8,%esp
iret
+ ALIGN32
1: cmpl $0,_netisr # check for softint s/traps
jne 1f
+ cmpl $0,_want_resched
+ jne 1f
pop %es # none, going back to base pri
pop %ds
#include "../net/netisr.h"
+ ALIGN32
1:
#define DONET(s, c) ; \
.globl c ; \
- movl $ s ,%eax ; \
- btrl %eax,_netisr ; \
+ btrl $ s ,_netisr ; \
jnb 1f ; \
call c ; \
1:
call _splnet
- pushl %eax
DONET(NETISR_RAW,_rawintr)
#ifdef INET
DONET(NETISR_NS,_nsintr)
#endif
+#ifdef notdef
+ NOP
popl %eax
movw %ax,_cpl
orw _imen,%ax
- NOP
outb %al,$ IO_ICU1+1 # re-enable intr?
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
+#else
+ call _spl0
+#endif
- # btrl $ NETISR_SCLK,_netisr
- movl $ NETISR_SCLK,%eax # stupid assembler, as usual
- btrl %eax,_netisr
+ btrl $ NETISR_SCLK,_netisr
jnb 1f
# back to an interrupt frame for a moment
call _splsoftclock
- pushl %eax
pushl $0xff # dummy intr
call _softclock
popl %eax
- call _splx
- popl %eax
+ call _spl0
- jmp 2f
+ # jmp 2f
- /* 1: btrl $NETISR_AST,_netisr*/
1:
cmpw $0x1f,13*4(%esp) # to user?
jne 2f # nope, leave
- movl $ NETISR_AST,%eax # stupid assembler, as usual
- btrl %eax,_netisr
- jnb 2f
+ cmpl $0,_want_resched
+ je 2f
call _trap
2: pop %es
.globl _splhigh
.globl _splclock
+ ALIGN32
_splhigh:
_splclock:
cli # disable interrupts
+ NOP
movw $0xffff,%ax # set new priority level
movw %ax,%dx
# orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
ret
.globl _spltty # block clists
+ ALIGN32
_spltty:
cli # disable interrupts
+ NOP
movw _cpl,%ax
orw _ttymask,%ax
movw %ax,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
.globl _splimp
.globl _splnet
+ ALIGN32
_splimp:
_splnet:
cli # disable interrupts
+ NOP
movw _cpl,%ax
orw _netmask,%ax
movw %ax,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
ret
.globl _splbio
+ ALIGN32
_splbio:
cli # disable interrupts
+ NOP
movw _cpl,%ax
orw _biomask,%ax
movw %ax,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
ret
.globl _splsoftclock
+ ALIGN32
_splsoftclock:
cli # disable interrupts
+ NOP
movw _cpl,%ax
orw $0x8000,%ax # set new priority level
movw %ax,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
.globl _splnone
.globl _spl0
+ ALIGN32
_splnone:
_spl0:
cli # disable interrupts
+ NOP
pushl _cpl # save old priority
movw _cpl,%ax
orw _netmask,%ax # mask off those network devices
movw %ax,_cpl # set new priority level
orw _imen,%ax # mask off those not enabled yet
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
sti # enable interrupts
DONET(NETISR_RAW,_rawintr)
#endif
cli # disable interrupts
popl _cpl # save old priority
+ NOP
movw $0,%ax # set new priority level
movw %ax,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
- inb $0x84,%al
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
sti # enable interrupts
ret
.globl _splx
+ ALIGN32
_splx:
cli # disable interrupts
+ NOP
movw 4(%esp),%ax # new priority level
movw %ax,%dx
cmpw $0,%dx
orw _imen,%ax # mask off those not enabled yet
movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- inb $0x84,%al
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
-#ifdef notyet
- .globl _iml8 # mask off all but irq0-1
-_iml8:
- cli # disable interrupts
- movw $0xfffc,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml10 # mask off all but irq0-1,8-9
-_iml10:
- cli # disable interrupts
- movw $0xfcf8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml11 # mask off all but irq0-1,8-10
-_iml11:
- cli # disable interrupts
- movw $0xf8f8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml12 # mask off all but irq0-1,8-11
-_iml12:
- cli # disable interrupts
- movw $0xf0f8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml13 # mask off all but irq0-1,8-12
-_iml13:
- cli # disable interrupts
- movw $0xe0f8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml15 # mask off all but irq0-1,8-14
-_iml15:
- cli # disable interrupts
- movw $0x80f8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml3 # mask off all but irq0-1,8-15
-_iml3:
- cli # disable interrupts
- movw $0x00f8,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml4 # mask off all but irq0-1,8-15,3
-_iml4:
- cli # disable interrupts
- movw $0x00f0,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
outb %al,$ IO_ICU1+1 /* update icu's */
NOP
movb %ah,%al
- NOP
outb %al,$ IO_ICU2+1
NOP
movzwl _cpl,%eax # return old priority
sti # enable interrupts
ret
- .globl _iml5 # mask off all but irq0-1,8-15,3-4
-_iml5:
- cli # disable interrupts
- movw $0x00e0,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
- .globl _iml6 # mask off all but irq0-1,8-15,3-5
-_iml6:
- cli # disable interrupts
- movw $0x00c0,%ax # set new priority level
- movw %ax,%dx
- orw _imen,%ax # mask off those not enabled yet
- movw %ax,%cx
- NOP
- outb %al,$ IO_ICU1+1 /* update icu's */
- NOP
- movb %ah,%al
- NOP
- outb %al,$ IO_ICU2+1
- NOP
- movzwl _cpl,%eax # return old priority
- movw %dx,_cpl # set new priority level
- sti # enable interrupts
- ret
-
-#endif notyet
-
/* hardware interrupt catcher (IDT 32 - 47) */
.globl _isa_strayintr
IDTVEC(intr0)
- INTR(0, _highmask, 0) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(0, _highmask, 0) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr1)
- INTR(1, _highmask, 1) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(1, _highmask, 1) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr2)
- INTR(2, _highmask, 2) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(2, _highmask, 2) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr3)
- INTR(3, _highmask, 3) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(3, _highmask, 3) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr4)
- INTR(4, _highmask, 4) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(4, _highmask, 4) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr5)
- INTR(5, _highmask, 5) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(5, _highmask, 5) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr6)
- INTR(6, _highmask, 6) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(6, _highmask, 6) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr7)
- INTR(7, _highmask, 7) ; call _isa_strayintr ; INTREXIT1
+ INTRSTRAY(7, _highmask, 7) ; call _isa_strayintr ; INTREXIT1
IDTVEC(intr8)
- INTR(8, _highmask, 8) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(8, _highmask, 8) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr9)
- INTR(9, _highmask, 9) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(9, _highmask, 9) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr10)
- INTR(10, _highmask, 10) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(10, _highmask, 10) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr11)
- INTR(11, _highmask, 11) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(11, _highmask, 11) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr12)
- INTR(12, _highmask, 12) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(12, _highmask, 12) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr13)
- INTR(13, _highmask, 13) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(13, _highmask, 13) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr14)
- INTR(14, _highmask, 14) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(14, _highmask, 14) ; call _isa_strayintr ; INTREXIT2
IDTVEC(intr15)
- INTR(15, _highmask, 15) ; call _isa_strayintr ; INTREXIT2
+ INTRSTRAY(15, _highmask, 15) ; call _isa_strayintr ; INTREXIT2
+IDTVEC(intrdefault)
+ INTRSTRAY(255, _highmask, 255) ; call _isa_strayintr ; INTREXIT2