* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* @(#)icu.s 5.4 (Berkeley) %G%
* Vector interrupt control section
* Copyright (C) 1989,90 W. Jolitz
_cpl: .long 0xffff # current priority level (all off)
_imen: .long 0xffff # interrupt mask enable (all off)
* Handle return from interrupt after device handler finishes
popl %ebx # remove intr number
popl %eax # get previous priority
# now interrupt frame is a trap frame!
outb %al,$ IO_ICU1+1 # re-enable intr?
cmpw $0,%cx # returning to zero?
pop %es # nope, going to non-zero level
1: cmpl $0,_netisr # check for softint s/traps
pop %es # none, going back to base pri
#include "../net/netisr.h"
DONET(NETISR_RAW,_rawintr)
DONET(NETISR_IMP,_impintr)
outb %al,$ IO_ICU1+1 # re-enable intr?
# btrl $ NETISR_SCLK,_netisr
movl $ NETISR_SCLK,%eax # stupid assembler, as usual
# back to an interrupt frame for a moment
/* 1: btrl $NETISR_AST,_netisr*/
cmpw $0x1f,13*4(%esp) # to user?
movl $ NETISR_AST,%eax # stupid assembler, as usual
* Interrupt priority mechanism
* Two flavors -- imlXX masks relative to ISA noemenclature (for PC compat sw)
* -- splXX masks with group mechanism for BSD purposes
movw $0xffff,%ax # set new priority level
# orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _spltty # block clists
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
orw $0x8000,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
pushl _cpl # save old priority
orw _netmask,%ax # mask off those network devices
movw %ax,_cpl # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
DONET(NETISR_RAW,_rawintr)
popl _cpl # save old priority
movw $0,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
movw 4(%esp),%ax # new priority level
je _spl0 # going to "zero level" is special
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml8 # mask off all but irq0-1
movw $0xfffc,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml10 # mask off all but irq0-1,8-9
movw $0xfcf8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml11 # mask off all but irq0-1,8-10
movw $0xf8f8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml12 # mask off all but irq0-1,8-11
movw $0xf0f8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml13 # mask off all but irq0-1,8-12
movw $0xe0f8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml15 # mask off all but irq0-1,8-14
movw $0x80f8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml3 # mask off all but irq0-1,8-15
movw $0x00f8,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml4 # mask off all but irq0-1,8-15,3
movw $0x00f0,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml5 # mask off all but irq0-1,8-15,3-4
movw $0x00e0,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
.globl _iml6 # mask off all but irq0-1,8-15,3-5
movw $0x00c0,%ax # set new priority level
orw _imen,%ax # mask off those not enabled yet
outb %al,$ IO_ICU1+1 /* update icu's */
movzwl _cpl,%eax # return old priority
movw %dx,_cpl # set new priority level
/* hardware interrupt catcher (IDT 32 - 47) */
INTR(0) ; call _isa_strayintr ; INTREXT1
INTR(1) ; call _isa_strayintr ; INTREXT1
INTR(2) ; call _isa_strayintr ; INTREXT1
INTR(3) ; call _isa_strayintr ; INTREXT1
INTR(4) ; call _isa_strayintr ; INTREXT1
INTR(5) ; call _isa_strayintr ; INTREXT1
INTR(6) ; call _isa_strayintr ; INTREXT1
INTR(7) ; call _isa_strayintr ; INTREXT1
INTR(8) ; call _isa_strayintr ; INTREXT2
INTR(9) ; call _isa_strayintr ; INTREXT2
INTR(10) ; call _isa_strayintr ; INTREXT2
INTR(11) ; call _isa_strayintr ; INTREXT2
INTR(12) ; call _isa_strayintr ; INTREXT2
INTR(13) ; call _isa_strayintr ; INTREXT2
INTR(14) ; call _isa_strayintr ; INTREXT2
INTR(15) ; call _isa_strayintr ; INTREXT2