Major cleanup of the interrupt registration subsystem.
[dragonfly.git] / sys / i386 / isa / vector.s
1 /*
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.7 2005/10/13 00:02:47 dillon Exp $
5  */
6
7 #include "opt_auto_eoi.h"
8
9 #include <i386/isa/icu.h>
10 #include <bus/isa/i386/isa.h>
11
12         .text
13
14 /*
15  * Macros for interrupt interrupt entry, call to handler, and exit.
16  *
17  * XXX - the interrupt frame is set up to look like a trap frame.  This is
18  * usually a waste of time.  The only interrupt handlers that want a frame
19  * are the clock handler (it wants a clock frame), the npx handler (it's
20  * easier to do right all in assembler).  The interrupt return routine
21  * needs a trap frame for rare AST's (it could easily convert the frame).
22  * The direct costs of setting up a trap frame are two pushl's (error
23  * code and trap number), an addl to get rid of these, and pushing and
24  * popping the call-saved regs %esi, %edi and %ebp twice,  The indirect
25  * costs are making the driver interface nonuniform so unpending of
26  * interrupts is more complicated and slower (call_driver(unit) would
27  * be easier than ensuring an interrupt frame for all handlers.  Finally,
28  * there are some struct copies in the npx handler and maybe in the clock
29  * handler that could be avoided by working more with pointers to frames
30  * instead of frames.
31  *
32  * XXX - should we do a cld on every system entry to avoid the requirement
33  * for scattered cld's?
34  *
35  * Coding notes for *.s:
36  *
37  * If possible, avoid operations that involve an operand size override.
38  * Word-sized operations might be smaller, but the operand size override
39  * makes them slower on on 486's and no faster on 386's unless perhaps
40  * the instruction pipeline is depleted.  E.g.,
41  *
42  *      Use movl to seg regs instead of the equivalent but more descriptive
43  *      movw - gas generates an irelevant (slower) operand size override.
44  *
45  *      Use movl to ordinary regs in preference to movw and especially
46  *      in preference to movz[bw]l.  Use unsigned (long) variables with the
47  *      top bits clear instead of unsigned short variables to provide more
48  *      opportunities for movl.
49  *
50  * If possible, use byte-sized operations.  They are smaller and no slower.
51  *
52  * Use (%reg) instead of 0(%reg) - gas generates larger code for the latter.
53  *
54  * If the interrupt frame is made more flexible,  INTR can push %eax first
55  * and decide the ipending case with less overhead, e.g., by avoiding
56  * loading segregs.
57  */
58
59 #ifdef APIC_IO
60 #include "i386/isa/apic_vector.s"
61 #else
62 #include "i386/isa/icu_vector.s"
63 #endif  /* APIC_IO */