* Copyright (c) 1989, 1990 William F. Jolitz.
* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* @(#)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
* 24 Mar 93 Rodney W. Grimes Added interrupt counters for vmstat
* also stray and false intr counters added
* Vector interrupt control section
_cpl: .long 0xffff # current priority level (all off)
_imen: .long 0xffff # interrupt mask enable (all off)
* 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 */
.space 4 /* false IRQ7's */
.space 4 /* false IRQ15's */
.space 4 /* stray interrupts */
_eintrcnt: /* Added to make vmstat happy */
* 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 $0x1f,13*4(%esp) # to user?
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
# back to an interrupt frame for a moment
cmpw $0x1f,13*4(%esp) # to user?
* 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
/* hardware interrupt catcher (IDT 32 - 47) */
INTRSTRAY(0, _highmask, 0) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(1, _highmask, 1) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(2, _highmask, 2) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(3, _highmask, 3) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(4, _highmask, 4) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(5, _highmask, 5) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(6, _highmask, 6) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(7, _highmask, 7) ; call _isa_strayintr ; INTREXIT1
INTRSTRAY(8, _highmask, 8) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(9, _highmask, 9) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(10, _highmask, 10) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(11, _highmask, 11) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(12, _highmask, 12) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(13, _highmask, 13) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(14, _highmask, 14) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(15, _highmask, 15) ; call _isa_strayintr ; INTREXIT2
INTRSTRAY(255, _highmask, 255) ; call _isa_strayintr ; INTREXIT2