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.5 2003/08/07 21:17:23 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 <bus/isa/i386/isa.h>
24 * Interrupt counters and names for export to vmstat(8) and friends.
26 * XXX this doesn't really belong here; everything except the labels
27 * for the endpointers is almost machine-independent.
29 #define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
31 .globl intrcnt, eintrcnt
33 .space NR_INTRNAMES * 4
36 .globl intrnames, eintrnames
38 .space NR_INTRNAMES * 16
44 * Macros for interrupt interrupt entry, call to handler, and exit.
46 * XXX - the interrupt frame is set up to look like a trap frame. This is
47 * usually a waste of time. The only interrupt handlers that want a frame
48 * are the clock handler (it wants a clock frame), the npx handler (it's
49 * easier to do right all in assembler). The interrupt return routine
50 * needs a trap frame for rare AST's (it could easily convert the frame).
51 * The direct costs of setting up a trap frame are two pushl's (error
52 * code and trap number), an addl to get rid of these, and pushing and
53 * popping the call-saved regs %esi, %edi and %ebp twice, The indirect
54 * costs are making the driver interface nonuniform so unpending of
55 * interrupts is more complicated and slower (call_driver(unit) would
56 * be easier than ensuring an interrupt frame for all handlers. Finally,
57 * there are some struct copies in the npx handler and maybe in the clock
58 * handler that could be avoided by working more with pointers to frames
61 * XXX - should we do a cld on every system entry to avoid the requirement
62 * for scattered cld's?
64 * Coding notes for *.s:
66 * If possible, avoid operations that involve an operand size override.
67 * Word-sized operations might be smaller, but the operand size override
68 * makes them slower on on 486's and no faster on 386's unless perhaps
69 * the instruction pipeline is depleted. E.g.,
71 * Use movl to seg regs instead of the equivalent but more descriptive
72 * movw - gas generates an irelevant (slower) operand size override.
74 * Use movl to ordinary regs in preference to movw and especially
75 * in preference to movz[bw]l. Use unsigned (long) variables with the
76 * top bits clear instead of unsigned short variables to provide more
77 * opportunities for movl.
79 * If possible, use byte-sized operations. They are smaller and no slower.
81 * Use (%reg) instead of 0(%reg) - gas generates larger code for the latter.
83 * If the interrupt frame is made more flexible, INTR can push %eax first
84 * and decide the ipending case with less overhead, e.g., by avoiding
89 #include "i386/isa/apic_vector.s"
91 #include "i386/isa/icu_vector.s"