Make modules work again part 1: linkup vfs, rename Makefile.module files,
[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.5 2003/08/07 21:17:23 dillon Exp $
5  */
6
7 /*
8  * modified for PC98 by Kakefuda
9  */
10
11 #include "opt_auto_eoi.h"
12
13 #include <i386/isa/icu.h>
14 #ifdef PC98
15 #include <pc98/pc98/pc98.h>
16 #else
17 #include <bus/isa/i386/isa.h>
18 #endif
19
20         .data
21         ALIGN_DATA
22
23 /*
24  * Interrupt counters and names for export to vmstat(8) and friends.
25  *
26  * XXX this doesn't really belong here; everything except the labels
27  * for the endpointers is almost machine-independent.
28  */
29 #define NR_INTRNAMES    (1 + ICU_LEN + 2 * ICU_LEN)
30
31         .globl  intrcnt, eintrcnt
32 intrcnt:
33         .space  NR_INTRNAMES * 4
34 eintrcnt:
35
36         .globl  intrnames, eintrnames
37 intrnames:
38         .space  NR_INTRNAMES * 16
39 eintrnames:
40
41         .text
42
43 /*
44  * Macros for interrupt interrupt entry, call to handler, and exit.
45  *
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
59  * instead of frames.
60  *
61  * XXX - should we do a cld on every system entry to avoid the requirement
62  * for scattered cld's?
63  *
64  * Coding notes for *.s:
65  *
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.,
70  *
71  *      Use movl to seg regs instead of the equivalent but more descriptive
72  *      movw - gas generates an irelevant (slower) operand size override.
73  *
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.
78  *
79  * If possible, use byte-sized operations.  They are smaller and no slower.
80  *
81  * Use (%reg) instead of 0(%reg) - gas generates larger code for the latter.
82  *
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
85  * loading segregs.
86  */
87
88 #ifdef APIC_IO
89 #include "i386/isa/apic_vector.s"
90 #else
91 #include "i386/isa/icu_vector.s"
92 #endif  /* APIC_IO */