make kernel includes standard
[unix-history] / usr / src / sys / i386 / isa / icu.h
index 8f4864b..3a6451d 100644 (file)
@@ -7,12 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)icu.h       5.6 (Berkeley) %G%
- */
-
-/*
- * AT/386 Interrupt Control constants
- * W. Jolitz 8/89
+ *     @(#)icu.h       5.9 (Berkeley) %G%
  */
 
 #ifndef        __ICU__
  */
 
 #ifndef        __ICU__
@@ -42,12 +37,16 @@ extern      unsigned short netmask; /* group of interrupts masked with splimp() */
  */
 
 /* Mask a group of interrupts atomically */
  */
 
 /* Mask a group of interrupts atomically */
-#define        INTR(unit,mask,offst) \
-       pushl   $0 ; \
+#define        INTR_HEAD(unit,mask,offst) \
+       pushl   $ offst ; \
        pushl   $ T_ASTFLT ; \
        pushal ; \
        pushl   $ T_ASTFLT ; \
        pushal ; \
-       push    %ds ; \
-       push    %es ; \
+       movb    $0x20,%al ; \
+
+#define INTR_TAIL(unit,mask,offst) \
+       outb    %al,$ IO_ICU1 ; \
+       pushl   %ds ; \
+       pushl   %es ; \
        movw    $0x10, %ax ; \
        movw    %ax, %ds ; \
        movw    %ax,%es ; \
        movw    $0x10, %ax ; \
        movw    %ax, %ds ; \
        movw    %ax,%es ; \
@@ -59,28 +58,30 @@ extern      unsigned short netmask; /* group of interrupts masked with splimp() */
        orw     mask ,%ax ; \
        movw    %ax,_cpl ; \
        orw     _imen,%ax ; \
        orw     mask ,%ax ; \
        movw    %ax,_cpl ; \
        orw     _imen,%ax ; \
-       NOP ; \
        outb    %al,$ IO_ICU1+1 ; \
        outb    %al,$ IO_ICU1+1 ; \
-       NOP ; \
        movb    %ah,%al ; \
        outb    %al,$ IO_ICU2+1 ; \
        movb    %ah,%al ; \
        outb    %al,$ IO_ICU2+1 ; \
-       NOP     ; \
-       inb     $0x84,%al ; \
-       sti
+       sti ;
+
+#define INTR1(unit,mask,offst) \
+       INTR_HEAD(unit,mask,offst) \
+       INTR_TAIL(unit,mask,offst)
+
+#define INTR2(unit,mask,offst) \
+       INTR_HEAD(unit,mask,offst) \
+       outb    %al,$ IO_ICU2 ; \
+       INTR_TAIL(unit,mask,offst)
+
+
 
 /* Interrupt vector exit macros */
 
 /* First eight interrupts (ICU1) */
 #define        INTREXIT1       \
 
 /* Interrupt vector exit macros */
 
 /* First eight interrupts (ICU1) */
 #define        INTREXIT1       \
-       movb    $0x20,%al ; \
-       outb    %al,$ IO_ICU1 ; \
        jmp     doreti
 
 /* Second eight interrupts (ICU2) */
 #define        INTREXIT2       \
        jmp     doreti
 
 /* Second eight interrupts (ICU2) */
 #define        INTREXIT2       \
-       movb    $0x20,%al ; \
-       outb    %al,$ IO_ICU1 ; \
-       outb    %al,$ IO_ICU2 ; \
        jmp     doreti
 
 #endif
        jmp     doreti
 
 #endif