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