2 * from: vector.s, 386BSD 0.1 unknown origin
3 * $FreeBSD: src/sys/i386/isa/vector.s,v 1.32 1999/08/28 00:45:04 peter Exp $
4 * $DragonFly: src/sys/i386/isa/Attic/vector.s,v 1.2 2003/06/17 04:28:37 dillon Exp $
8 * modified for PC98 by Kakefuda
11 #include "opt_auto_eoi.h"
13 #include <i386/isa/icu.h>
15 #include <pc98/pc98/pc98.h>
17 #include <i386/isa/isa.h>
20 #ifdef FAST_INTR_HANDLER_USES_ES
21 #define ACTUALLY_PUSHED 1
22 #define MAYBE_MOVW_AX_ES movl %ax,%es
23 #define MAYBE_POPL_ES popl %es
24 #define MAYBE_PUSHL_ES pushl %es
27 * We can usually skip loading %es for fastintr handlers. %es should
28 * only be used for string instructions, and fastintr handlers shouldn't
29 * do anything slow enough to justify using a string instruction.
31 #define ACTUALLY_PUSHED 0
32 #define MAYBE_MOVW_AX_ES
34 #define MAYBE_PUSHL_ES
40 .globl _intr_nesting_level
46 * Interrupt counters and names for export to vmstat(8) and friends.
48 * XXX this doesn't really belong here; everything except the labels
49 * for the endpointers is almost machine-independent.
51 #define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
53 .globl _intrcnt, _eintrcnt
55 .space NR_INTRNAMES * 4
58 .globl _intrnames, _eintrnames
60 .space NR_INTRNAMES * 16
66 * Macros for interrupt interrupt entry, call to handler, and exit.
68 * XXX - the interrupt frame is set up to look like a trap frame. This is
69 * usually a waste of time. The only interrupt handlers that want a frame
70 * are the clock handler (it wants a clock frame), the npx handler (it's
71 * easier to do right all in assembler). The interrupt return routine
72 * needs a trap frame for rare AST's (it could easily convert the frame).
73 * The direct costs of setting up a trap frame are two pushl's (error
74 * code and trap number), an addl to get rid of these, and pushing and
75 * popping the call-saved regs %esi, %edi and %ebp twice, The indirect
76 * costs are making the driver interface nonuniform so unpending of
77 * interrupts is more complicated and slower (call_driver(unit) would
78 * be easier than ensuring an interrupt frame for all handlers. Finally,
79 * there are some struct copies in the npx handler and maybe in the clock
80 * handler that could be avoided by working more with pointers to frames
83 * XXX - should we do a cld on every system entry to avoid the requirement
84 * for scattered cld's?
86 * Coding notes for *.s:
88 * If possible, avoid operations that involve an operand size override.
89 * Word-sized operations might be smaller, but the operand size override
90 * makes them slower on on 486's and no faster on 386's unless perhaps
91 * the instruction pipeline is depleted. E.g.,
93 * Use movl to seg regs instead of the equivalent but more descriptive
94 * movw - gas generates an irelevant (slower) operand size override.
96 * Use movl to ordinary regs in preference to movw and especially
97 * in preference to movz[bw]l. Use unsigned (long) variables with the
98 * top bits clear instead of unsigned short variables to provide more
99 * opportunities for movl.
101 * If possible, use byte-sized operations. They are smaller and no slower.
103 * Use (%reg) instead of 0(%reg) - gas generates larger code for the latter.
105 * If the interrupt frame is made more flexible, INTR can push %eax first
106 * and decide the ipending case with less overhead, e.g., by avoiding
111 #include "i386/isa/apic_vector.s"
113 #include "i386/isa/icu_vector.s"