FreeBSD/Linux Kernel Cross Reference
sys/i386/isa/vector.s
1 /*
2 * from: vector.s, 386BSD 0.1 unknown origin
3 * $FreeBSD$
4 */
5
6 /*
7 * modified for PC98 by Kakefuda
8 */
9
10 #include "opt_auto_eoi.h"
11
12 #include <i386/isa/icu.h>
13 #ifdef PC98
14 #include <pc98/pc98/pc98.h>
15 #else
16 #include <i386/isa/isa.h>
17 #endif
18
19 #ifdef FAST_INTR_HANDLER_USES_ES
20 #define ACTUALLY_PUSHED 1
21 #define MAYBE_MOVW_AX_ES movl %ax,%es
22 #define MAYBE_POPL_ES popl %es
23 #define MAYBE_PUSHL_ES pushl %es
24 #else
25 /*
26 * We can usually skip loading %es for fastintr handlers. %es should
27 * only be used for string instructions, and fastintr handlers shouldn't
28 * do anything slow enough to justify using a string instruction.
29 */
30 #define ACTUALLY_PUSHED 0
31 #define MAYBE_MOVW_AX_ES
32 #define MAYBE_POPL_ES
33 #define MAYBE_PUSHL_ES
34 #endif
35
36 .data
37 ALIGN_DATA
38
39 .globl _intr_nesting_level
40 _intr_nesting_level:
41 .byte 0
42 .space 3
43
44 .text
45
46 /*
47 * Macros for interrupt interrupt entry, call to handler, and exit.
48 *
49 * XXX - the interrupt frame is set up to look like a trap frame. This is
50 * usually a waste of time. The only interrupt handlers that want a frame
51 * are the clock handler (it wants a clock frame), the npx handler (it's
52 * easier to do right all in assembler). The interrupt return routine
53 * needs a trap frame for rare AST's (it could easily convert the frame).
54 * The direct costs of setting up a trap frame are two pushl's (error
55 * code and trap number), an addl to get rid of these, and pushing and
56 * popping the call-saved regs %esi, %edi and %ebp twice, The indirect
57 * costs are making the driver interface nonuniform so unpending of
58 * interrupts is more complicated and slower (call_driver(unit) would
59 * be easier than ensuring an interrupt frame for all handlers. Finally,
60 * there are some struct copies in the npx handler and maybe in the clock
61 * handler that could be avoided by working more with pointers to frames
62 * instead of frames.
63 *
64 * XXX - should we do a cld on every system entry to avoid the requirement
65 * for scattered cld's?
66 *
67 * Coding notes for *.s:
68 *
69 * If possible, avoid operations that involve an operand size override.
70 * Word-sized operations might be smaller, but the operand size override
71 * makes them slower on on 486's and no faster on 386's unless perhaps
72 * the instruction pipeline is depleted. E.g.,
73 *
74 * Use movl to seg regs instead of the equivalent but more descriptive
75 * movw - gas generates an irelevant (slower) operand size override.
76 *
77 * Use movl to ordinary regs in preference to movw and especially
78 * in preference to movz[bw]l. Use unsigned (long) variables with the
79 * top bits clear instead of unsigned short variables to provide more
80 * opportunities for movl.
81 *
82 * If possible, use byte-sized operations. They are smaller and no slower.
83 *
84 * Use (%reg) instead of 0(%reg) - gas generates larger code for the latter.
85 *
86 * If the interrupt frame is made more flexible, INTR can push %eax first
87 * and decide the ipending case with less overhead, e.g., by avoiding
88 * loading segregs.
89 */
90
91 #ifdef APIC_IO
92 #include "i386/isa/apic_vector.s"
93 #else
94 #include "i386/isa/icu_vector.s"
95 #endif /* APIC_IO */
Cache object: c3a4aa94a492585a768a9fb4f113d6ae
|