Annotation of sys/arch/amd64/amd64/vector.S, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: vector.S,v 1.10 2007/06/01 21:01:51 art Exp $ */
2: /* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */
3:
4: /*
5: * Copyright (c) 2001 Wasabi Systems, Inc.
6: * All rights reserved.
7: *
8: * Written by Frank van der Linden for Wasabi Systems, Inc.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed for the NetBSD Project by
21: * Wasabi Systems, Inc.
22: * 4. The name of Wasabi Systems, Inc. may not be used to endorse
23: * or promote products derived from this software without specific prior
24: * written permission.
25: *
26: * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
30: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36: * POSSIBILITY OF SUCH DAMAGE.
37: */
38:
39: /*-
40: * Copyright (c) 1998 The NetBSD Foundation, Inc.
41: * All rights reserved.
42: *
43: * This code is derived from software contributed to The NetBSD Foundation
44: * by Charles M. Hannum.
45: *
46: * Redistribution and use in source and binary forms, with or without
47: * modification, are permitted provided that the following conditions
48: * are met:
49: * 1. Redistributions of source code must retain the above copyright
50: * notice, this list of conditions and the following disclaimer.
51: * 2. Redistributions in binary form must reproduce the above copyright
52: * notice, this list of conditions and the following disclaimer in the
53: * documentation and/or other materials provided with the distribution.
54: * 3. All advertising materials mentioning features or use of this software
55: * must display the following acknowledgement:
56: * This product includes software developed by the NetBSD
57: * Foundation, Inc. and its contributors.
58: * 4. Neither the name of The NetBSD Foundation nor the names of its
59: * contributors may be used to endorse or promote products derived
60: * from this software without specific prior written permission.
61: *
62: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
63: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
64: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
65: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
66: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
67: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
68: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
69: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
70: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
71: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
72: * POSSIBILITY OF SUCH DAMAGE.
73: */
74:
75: #define ALIGN_TEXT .align 16,0x90
76:
77: #include <machine/param.h>
78: #include <machine/i8259.h>
79: #include <machine/i82093reg.h>
80: #include <machine/i82489reg.h>
81: #include <machine/asm.h>
82: #include <machine/frameasm.h>
83: #include <machine/segments.h>
84: #include <machine/trap.h>
85: #include <machine/intr.h>
86: #include <machine/psl.h>
87:
88: #include <net/netisr.h>
89:
90: #include "ioapic.h"
91: #include "lapic.h"
92: #include "assym.h"
93:
94: /*****************************************************************************/
95:
96: /*
97: * Trap and fault vector routines
98: *
99: * On exit from the kernel to user mode, we always need to check for ASTs. In
100: * addition, we need to do this atomically; otherwise an interrupt may occur
101: * which causes an AST, but it won't get processed until the next kernel entry
102: * (possibly the next clock tick). Thus, we disable interrupt before checking,
103: * and only enable them again on the final `iret' or before calling the AST
104: * handler.
105: */
106:
107: /*****************************************************************************/
108:
109: #define TRAP(a) pushq $(a) ; jmp _C_LABEL(alltraps)
110: #define ZTRAP(a) pushq $0 ; TRAP(a)
111:
112: #define BPTTRAP(a) ZTRAP(a)
113:
114: .text
115: IDTVEC(trap00)
116: ZTRAP(T_DIVIDE)
117: IDTVEC(trap01)
118: BPTTRAP(T_TRCTRAP)
119: IDTVEC(trap02)
120: ZTRAP(T_NMI)
121: IDTVEC(trap03)
122: BPTTRAP(T_BPTFLT)
123: IDTVEC(trap04)
124: ZTRAP(T_OFLOW)
125: IDTVEC(trap05)
126: ZTRAP(T_BOUND)
127: IDTVEC(trap06)
128: ZTRAP(T_PRIVINFLT)
129: IDTVEC(trap07)
130: pushq $0 # dummy error code
131: pushq $T_DNA
132: INTRENTRY
133: sti
134: movq CPUVAR(SELF),%rdi
135: call _C_LABEL(fpudna)
136: INTRFASTEXIT
137: IDTVEC(trap08)
138: ZTRAP(T_DOUBLEFLT)
139: IDTVEC(trap09)
140: ZTRAP(T_FPOPFLT)
141: IDTVEC(trap0a)
142: TRAP(T_TSSFLT)
143: IDTVEC(trap0b)
144: TRAP(T_SEGNPFLT)
145: IDTVEC(trap0c)
146: TRAP(T_STKFLT)
147: IDTVEC(trap0d)
148: TRAP(T_PROTFLT)
149: IDTVEC(trap0e)
150: TRAP(T_PAGEFLT)
151: IDTVEC(intrspurious)
152: IDTVEC(trap0f)
153: iretq
154: IDTVEC(trap10)
155: ZTRAP(T_ARITHTRAP)
156: IDTVEC(trap11)
157: ZTRAP(T_ALIGNFLT)
158: IDTVEC(trap12)
159: ZTRAP(T_MCA)
160: IDTVEC(trap13)
161: ZTRAP(T_XMM)
162: IDTVEC(trap14)
163: IDTVEC(trap15)
164: IDTVEC(trap16)
165: IDTVEC(trap17)
166: IDTVEC(trap18)
167: IDTVEC(trap19)
168: IDTVEC(trap1a)
169: IDTVEC(trap1b)
170: IDTVEC(trap1c)
171: IDTVEC(trap1d)
172: IDTVEC(trap1e)
173: IDTVEC(trap1f)
174: /* 20 - 31 reserved for future exp */
175: ZTRAP(T_RESERVED)
176:
177: IDTVEC(exceptions)
178: .quad _C_LABEL(Xtrap00), _C_LABEL(Xtrap01)
179: .quad _C_LABEL(Xtrap02), _C_LABEL(Xtrap03)
180: .quad _C_LABEL(Xtrap04), _C_LABEL(Xtrap05)
181: .quad _C_LABEL(Xtrap06), _C_LABEL(Xtrap07)
182: .quad _C_LABEL(Xtrap08), _C_LABEL(Xtrap09)
183: .quad _C_LABEL(Xtrap0a), _C_LABEL(Xtrap0b)
184: .quad _C_LABEL(Xtrap0c), _C_LABEL(Xtrap0d)
185: .quad _C_LABEL(Xtrap0e), _C_LABEL(Xtrap0f)
186: .quad _C_LABEL(Xtrap10), _C_LABEL(Xtrap11)
187: .quad _C_LABEL(Xtrap12), _C_LABEL(Xtrap13)
188: .quad _C_LABEL(Xtrap14), _C_LABEL(Xtrap15)
189: .quad _C_LABEL(Xtrap16), _C_LABEL(Xtrap17)
190: .quad _C_LABEL(Xtrap18), _C_LABEL(Xtrap19)
191: .quad _C_LABEL(Xtrap1a), _C_LABEL(Xtrap1b)
192: .quad _C_LABEL(Xtrap1c), _C_LABEL(Xtrap1d)
193: .quad _C_LABEL(Xtrap1e), _C_LABEL(Xtrap1f)
194:
195: /*
196: * If an error is detected during trap, syscall, or interrupt exit, trap() will
197: * change %eip to point to one of these labels. We clean up the stack, if
198: * necessary, and resume as if we were handling a general protection fault.
199: * This will cause the process to get a SIGBUS.
200: *
201: * XXXfvdl currently unused, as pop %ds and pop %es are illegal in long
202: * mode. However, if the x86-64 port is going to support USER_LDT, we
203: * may need something like this after all.
204: */
205: NENTRY(resume_iret)
206: ZTRAP(T_PROTFLT)
207: #if 0
208: NENTRY(resume_pop_ds)
209: movl $GSEL(GDATA_SEL, SEL_KPL),%eax
210: movl %eax,%es
211: NENTRY(resume_pop_es)
212: movl $T_PROTFLT,TF_TRAPNO(%rsp)
213: jmp calltrap
214: #endif
215:
216: /*
217: * All traps go through here. Call the generic trap handler, and
218: * check for ASTs afterwards.
219: */
220: NENTRY(alltraps)
221: INTRENTRY
222: sti
223: calltrap:
224: #ifdef DIAGNOSTIC
225: movl CPUVAR(ILEVEL),%ebx
226: #endif /* DIAGNOSTIC */
227: movq %rsp, %rdi
228: call _C_LABEL(trap)
229: 2: /* Check for ASTs on exit to user mode. */
230: cli
231: CHECK_ASTPENDING(%r11)
232: je 1f
233: testb $SEL_RPL,TF_CS(%rsp)
234: jz 1f
235: 5: CLEAR_ASTPENDING(%r11)
236: sti
237: movl $T_ASTFLT,TF_TRAPNO(%rsp)
238: movq %rsp, %rdi
239: call _C_LABEL(trap)
240: jmp 2b
241: #ifndef DIAGNOSTIC
242: 1: INTRFASTEXIT
243: #else /* DIAGNOSTIC */
244: 1: cmpl CPUVAR(ILEVEL),%ebx
245: jne 3f
246: INTRFASTEXIT
247: 3: sti
248: movabsq $4f,%rdi
249: movl CPUVAR(ILEVEL),%esi
250: movl %ebx,%edx
251: xorq %rax,%rax
252: call _C_LABEL(printf)
253: #ifdef DDB
254: int $3
255: #endif /* DDB */
256: movl %ebx,CPUVAR(ILEVEL)
257: jmp 2b
258: 4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT %x %x\n"
259: #endif /* DIAGNOSTIC */
260:
261:
262: #define __HAVE_GENERIC_SOFT_INTERRUPTS /* XXX */
263:
264:
265: /*
266: * Macros for interrupt entry, call to handler, and exit.
267: *
268: * XXX
269: * The interrupt frame is set up to look like a trap frame. This may be a
270: * waste. The only handler which needs a frame is the clock handler, and it
271: * only needs a few bits. Xdoreti() needs a trap frame for handling ASTs, but
272: * it could easily convert the frame on demand.
273: *
274: * The direct costs of setting up a trap frame are two pushq's (error code and
275: * trap number), an addl to get rid of these, and pushing and popping the
276: * callee-saved registers %esi, %edi, %ebx, and %ebp twice.
277: *
278: * If the interrupt frame is made more flexible, INTR can push %eax first and
279: * decide the ipending case with less overhead, e.g., by avoiding loading the
280: * segment registers.
281: *
282: */
283:
284: #define MY_COUNT _C_LABEL(uvmexp)
285:
286: /* XXX See comment in locore.s */
287: #ifdef __ELF__
288: #define XINTR(name,num) Xintr_/**/name/**/num
289: #else
290: #define XINTR(name,num) _Xintr_/**/name/**/num
291: #endif
292:
293: #if NLAPIC > 0
294: #ifdef MULTIPROCESSOR
295: IDTVEC(recurse_lapic_ipi)
296: INTR_RECURSE_HWFRAME
297: pushq $0
298: pushq $T_ASTFLT
299: INTRENTRY
300: jmp 1f
301: IDTVEC(intr_lapic_ipi)
302: pushq $0
303: pushq $T_ASTFLT
304: INTRENTRY
305: movl $0,_C_LABEL(local_apic)+LAPIC_EOI
306: movl CPUVAR(ILEVEL),%ebx
307: cmpl $IPL_IPI,%ebx
308: jae 2f
309: IDTVEC(resume_lapic_ipi)
310: 1:
311: incl CPUVAR(IDEPTH)
312: movl $IPL_IPI,CPUVAR(ILEVEL)
313: sti
314: pushq %rbx
315: call _C_LABEL(x86_ipi_handler)
316: jmp _C_LABEL(Xdoreti)
317: 2:
318: orl $(1 << LIR_IPI),CPUVAR(IPENDING)
319: sti
320: INTRFASTEXIT
321:
322: IDTVEC(ipi_invltlb)
323: pushq %rax
324:
325: ioapic_asm_ack()
326:
327: movq %cr3, %rax
328: movq %rax, %cr3
329:
330: lock
331: decq tlb_shoot_wait
332:
333: popq %rax
334: iretq
335:
336: IDTVEC(ipi_invlpg)
337: pushq %rax
338:
339: ioapic_asm_ack()
340:
341: movq tlb_shoot_addr1, %rax
342: invlpg (%rax)
343:
344: lock
345: decq tlb_shoot_wait
346:
347: popq %rax
348: iretq
349:
350: IDTVEC(ipi_invlrange)
351: pushq %rax
352: pushq %rdx
353:
354: ioapic_asm_ack()
355:
356: movq tlb_shoot_addr1, %rax
357: movq tlb_shoot_addr2, %rdx
358: 1: invlpg (%rax)
359: addq $PAGE_SIZE, %rax
360: cmpq %rdx, %rax
361: jb 1b
362:
363: lock
364: decq tlb_shoot_wait
365:
366: popq %rdx
367: popq %rax
368: iretq
369:
370: #endif /* MULTIPROCESSOR */
371:
372: /*
373: * Interrupt from the local APIC timer.
374: */
375: IDTVEC(recurse_lapic_ltimer)
376: INTR_RECURSE_HWFRAME
377: pushq $0
378: pushq $T_ASTFLT
379: INTRENTRY
380: jmp 1f
381: IDTVEC(intr_lapic_ltimer)
382: pushq $0
383: pushq $T_ASTFLT
384: INTRENTRY
385: movl $0,_C_LABEL(local_apic)+LAPIC_EOI
386: movl CPUVAR(ILEVEL),%ebx
387: cmpl $IPL_CLOCK,%ebx
388: jae 2f
389: IDTVEC(resume_lapic_ltimer)
390: 1:
391: incl CPUVAR(IDEPTH)
392: movl $IPL_CLOCK,CPUVAR(ILEVEL)
393: sti
394: pushq %rbx
395: xorq %rdi,%rdi
396: call _C_LABEL(lapic_clockintr)
397: jmp _C_LABEL(Xdoreti)
398: 2:
399: orl $(1 << LIR_TIMER),CPUVAR(IPENDING)
400: sti
401: INTRFASTEXIT
402: #endif /* NLAPIC > 0 */
403:
404: #ifdef MULTIPROCESSOR
405: #define LOCK_KERNEL movq %rsp, %rdi; call _C_LABEL(x86_intlock)
406: #define UNLOCK_KERNEL movq %rsp, %rdi; call _C_LABEL(x86_intunlock)
407: #else
408: #define LOCK_KERNEL
409: #define UNLOCK_KERNEL
410: #endif
411:
412: #define voidop(num)
413:
414:
415: /*
416: * This macro defines the generic stub code. Its arguments modify it
417: * for specific PICs.
418: */
419:
420: #define INTRSTUB(name, num, early_ack, late_ack, mask, unmask, level_mask) \
421: IDTVEC(recurse_/**/name/**/num) ;\
422: INTR_RECURSE_HWFRAME ;\
423: subq $8,%rsp ;\
424: pushq $T_ASTFLT /* trap # for doing ASTs */ ;\
425: INTRENTRY ;\
426: IDTVEC(resume_/**/name/**/num) \
427: movq $IREENT_MAGIC,TF_ERR(%rsp) ;\
428: movl %ebx,%r13d ;\
429: movq CPUVAR(ISOURCES) + (num) * 8, %r14 ;\
430: movl IS_MAXLEVEL(%r14),%ebx ;\
431: jmp 1f ;\
432: IDTVEC(intr_/**/name/**/num) ;\
433: pushq $0 /* dummy error code */ ;\
434: pushq $T_ASTFLT /* trap # for doing ASTs */ ;\
435: INTRENTRY ;\
436: movq CPUVAR(ISOURCES) + (num) * 8, %r14 ;\
437: mask(num) /* mask it in hardware */ ;\
438: early_ack(num) /* and allow other intrs */ ;\
439: testq %r14,%r14 ;\
440: jz 9f /* stray */ ;\
441: movl IS_MAXLEVEL(%r14),%ebx ;\
442: movl CPUVAR(ILEVEL),%r13d ;\
443: cmpl %ebx,%r13d ;\
444: jae 10f /* currently masked; hold it */ ;\
445: incl MY_COUNT+V_INTR /* statistical info */ ;\
446: 1: \
447: pushq %r13 ;\
448: movl %ebx,CPUVAR(ILEVEL) ;\
449: sti ;\
450: incl CPUVAR(IDEPTH) ;\
451: movq IS_HANDLERS(%r14),%rbx ;\
452: LOCK_KERNEL ;\
453: 6: \
454: movl IH_LEVEL(%rbx),%r12d ;\
455: cmpl %r13d,%r12d ;\
456: jle 7f ;\
457: movq IH_ARG(%rbx),%rdi ;\
458: testq %rdi, %rdi ;\
459: jnz 8f ;\
460: movq %rsp, %rdi ;\
461: 8: movl %r12d,CPUVAR(ILEVEL) ;\
462: call *IH_FUN(%rbx) /* call it */ ;\
463: orq %rax,%rax /* should it be counted? */ ;\
464: jz 4f ;\
465: incq IH_COUNT(%rbx) ;\
466: 4: movq IH_NEXT(%rbx),%rbx /* next handler in chain */ ;\
467: testq %rbx,%rbx ;\
468: jnz 6b ;\
469: 5: \
470: UNLOCK_KERNEL ;\
471: cli ;\
472: unmask(num) /* unmask it in hardware */ ;\
473: late_ack(num) ;\
474: sti ;\
475: jmp _C_LABEL(Xdoreti) /* lower spl and do ASTs */ ;\
476: 7: \
477: UNLOCK_KERNEL ;\
478: cli ;\
479: orl $(1 << num),CPUVAR(IPENDING) ;\
480: level_mask(num) ;\
481: late_ack(num) ;\
482: sti ;\
483: jmp _C_LABEL(Xdoreti) /* lower spl and do ASTs */ ;\
484: 10: \
485: cli ;\
486: orl $(1 << num),CPUVAR(IPENDING) ;\
487: level_mask(num) ;\
488: late_ack(num) ;\
489: sti ;\
490: INTRFASTEXIT ;\
491: 9: \
492: unmask(num) ;\
493: late_ack(num) ;\
494: sti ;\
495: INTRFASTEXIT
496:
497: #define ICUADDR IO_ICU1
498:
499: INTRSTUB(legacy,0,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
500: voidop)
501: INTRSTUB(legacy,1,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
502: voidop)
503: INTRSTUB(legacy,2,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
504: voidop)
505: INTRSTUB(legacy,3,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
506: voidop)
507: INTRSTUB(legacy,4,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
508: voidop)
509: INTRSTUB(legacy,5,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
510: voidop)
511: INTRSTUB(legacy,6,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
512: voidop)
513: INTRSTUB(legacy,7,i8259_asm_ack1,voidop,i8259_asm_mask,i8259_asm_unmask,
514: voidop)
515: #undef ICUADDR
516: #define ICUADDR IO_ICU2
517:
518: INTRSTUB(legacy,8,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
519: voidop)
520: INTRSTUB(legacy,9,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
521: voidop)
522: INTRSTUB(legacy,10,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
523: voidop)
524: INTRSTUB(legacy,11,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
525: voidop)
526: INTRSTUB(legacy,12,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
527: voidop)
528: INTRSTUB(legacy,13,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
529: voidop)
530: INTRSTUB(legacy,14,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
531: voidop)
532: INTRSTUB(legacy,15,i8259_asm_ack2,voidop,i8259_asm_mask,i8259_asm_unmask,
533: voidop)
534:
535: #if NIOAPIC > 0
536:
537: INTRSTUB(ioapic_edge,0,voidop,ioapic_asm_ack,voidop,voidop,voidop)
538: INTRSTUB(ioapic_edge,1,voidop,ioapic_asm_ack,voidop,voidop,voidop)
539: INTRSTUB(ioapic_edge,2,voidop,ioapic_asm_ack,voidop,voidop,voidop)
540: INTRSTUB(ioapic_edge,3,voidop,ioapic_asm_ack,voidop,voidop,voidop)
541: INTRSTUB(ioapic_edge,4,voidop,ioapic_asm_ack,voidop,voidop,voidop)
542: INTRSTUB(ioapic_edge,5,voidop,ioapic_asm_ack,voidop,voidop,voidop)
543: INTRSTUB(ioapic_edge,6,voidop,ioapic_asm_ack,voidop,voidop,voidop)
544: INTRSTUB(ioapic_edge,7,voidop,ioapic_asm_ack,voidop,voidop,voidop)
545: INTRSTUB(ioapic_edge,8,voidop,ioapic_asm_ack,voidop,voidop,voidop)
546: INTRSTUB(ioapic_edge,9,voidop,ioapic_asm_ack,voidop,voidop,voidop)
547: INTRSTUB(ioapic_edge,10,voidop,ioapic_asm_ack,voidop,voidop,voidop)
548: INTRSTUB(ioapic_edge,11,voidop,ioapic_asm_ack,voidop,voidop,voidop)
549: INTRSTUB(ioapic_edge,12,voidop,ioapic_asm_ack,voidop,voidop,voidop)
550: INTRSTUB(ioapic_edge,13,voidop,ioapic_asm_ack,voidop,voidop,voidop)
551: INTRSTUB(ioapic_edge,14,voidop,ioapic_asm_ack,voidop,voidop,voidop)
552: INTRSTUB(ioapic_edge,15,voidop,ioapic_asm_ack,voidop,voidop,voidop)
553: INTRSTUB(ioapic_edge,16,voidop,ioapic_asm_ack,voidop,voidop,voidop)
554: INTRSTUB(ioapic_edge,17,voidop,ioapic_asm_ack,voidop,voidop,voidop)
555: INTRSTUB(ioapic_edge,18,voidop,ioapic_asm_ack,voidop,voidop,voidop)
556: INTRSTUB(ioapic_edge,19,voidop,ioapic_asm_ack,voidop,voidop,voidop)
557: INTRSTUB(ioapic_edge,20,voidop,ioapic_asm_ack,voidop,voidop,voidop)
558: INTRSTUB(ioapic_edge,21,voidop,ioapic_asm_ack,voidop,voidop,voidop)
559: INTRSTUB(ioapic_edge,22,voidop,ioapic_asm_ack,voidop,voidop,voidop)
560: INTRSTUB(ioapic_edge,23,voidop,ioapic_asm_ack,voidop,voidop,voidop)
561: INTRSTUB(ioapic_edge,24,voidop,ioapic_asm_ack,voidop,voidop,voidop)
562: INTRSTUB(ioapic_edge,25,voidop,ioapic_asm_ack,voidop,voidop,voidop)
563: INTRSTUB(ioapic_edge,26,voidop,ioapic_asm_ack,voidop,voidop,voidop)
564: INTRSTUB(ioapic_edge,27,voidop,ioapic_asm_ack,voidop,voidop,voidop)
565: INTRSTUB(ioapic_edge,28,voidop,ioapic_asm_ack,voidop,voidop,voidop)
566: INTRSTUB(ioapic_edge,29,voidop,ioapic_asm_ack,voidop,voidop,voidop)
567: INTRSTUB(ioapic_edge,30,voidop,ioapic_asm_ack,voidop,voidop,voidop)
568: INTRSTUB(ioapic_edge,31,voidop,ioapic_asm_ack,voidop,voidop,voidop)
569:
570: INTRSTUB(ioapic_level,0,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
571: INTRSTUB(ioapic_level,1,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
572: INTRSTUB(ioapic_level,2,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
573: INTRSTUB(ioapic_level,3,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
574: INTRSTUB(ioapic_level,4,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
575: INTRSTUB(ioapic_level,5,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
576: INTRSTUB(ioapic_level,6,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
577: INTRSTUB(ioapic_level,7,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
578: INTRSTUB(ioapic_level,8,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
579: INTRSTUB(ioapic_level,9,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
580: INTRSTUB(ioapic_level,10,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
581: INTRSTUB(ioapic_level,11,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
582: INTRSTUB(ioapic_level,12,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
583: INTRSTUB(ioapic_level,13,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
584: INTRSTUB(ioapic_level,14,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
585: INTRSTUB(ioapic_level,15,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
586: INTRSTUB(ioapic_level,16,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
587: INTRSTUB(ioapic_level,17,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
588: INTRSTUB(ioapic_level,18,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
589: INTRSTUB(ioapic_level,19,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
590: INTRSTUB(ioapic_level,20,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
591: INTRSTUB(ioapic_level,21,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
592: INTRSTUB(ioapic_level,22,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
593: INTRSTUB(ioapic_level,23,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
594: INTRSTUB(ioapic_level,24,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
595: INTRSTUB(ioapic_level,25,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
596: INTRSTUB(ioapic_level,26,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
597: INTRSTUB(ioapic_level,27,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
598: INTRSTUB(ioapic_level,28,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
599: INTRSTUB(ioapic_level,29,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
600: INTRSTUB(ioapic_level,30,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
601: INTRSTUB(ioapic_level,31,voidop,ioapic_asm_ack,voidop,ioapic_unmask,ioapic_mask)
602:
603: #endif
604:
605: .globl _C_LABEL(i8259_stubs)
606: _C_LABEL(i8259_stubs):
607: .quad _C_LABEL(Xintr_legacy0), _C_LABEL(Xrecurse_legacy0)
608: .quad _C_LABEL(Xresume_legacy0)
609: .quad _C_LABEL(Xintr_legacy1), _C_LABEL(Xrecurse_legacy1)
610: .quad _C_LABEL(Xresume_legacy1)
611: .quad _C_LABEL(Xintr_legacy2), _C_LABEL(Xrecurse_legacy2)
612: .quad _C_LABEL(Xresume_legacy2)
613: .quad _C_LABEL(Xintr_legacy3), _C_LABEL(Xrecurse_legacy3)
614: .quad _C_LABEL(Xresume_legacy3)
615: .quad _C_LABEL(Xintr_legacy4), _C_LABEL(Xrecurse_legacy4)
616: .quad _C_LABEL(Xresume_legacy4)
617: .quad _C_LABEL(Xintr_legacy5), _C_LABEL(Xrecurse_legacy5)
618: .quad _C_LABEL(Xresume_legacy5)
619: .quad _C_LABEL(Xintr_legacy6), _C_LABEL(Xrecurse_legacy6)
620: .quad _C_LABEL(Xresume_legacy6)
621: .quad _C_LABEL(Xintr_legacy7), _C_LABEL(Xrecurse_legacy7)
622: .quad _C_LABEL(Xresume_legacy7)
623: .quad _C_LABEL(Xintr_legacy8), _C_LABEL(Xrecurse_legacy8)
624: .quad _C_LABEL(Xresume_legacy8)
625: .quad _C_LABEL(Xintr_legacy9), _C_LABEL(Xrecurse_legacy9)
626: .quad _C_LABEL(Xresume_legacy9)
627: .quad _C_LABEL(Xintr_legacy10), _C_LABEL(Xrecurse_legacy10)
628: .quad _C_LABEL(Xresume_legacy10)
629: .quad _C_LABEL(Xintr_legacy11), _C_LABEL(Xrecurse_legacy11)
630: .quad _C_LABEL(Xresume_legacy11)
631: .quad _C_LABEL(Xintr_legacy12), _C_LABEL(Xrecurse_legacy12)
632: .quad _C_LABEL(Xresume_legacy12)
633: .quad _C_LABEL(Xintr_legacy13), _C_LABEL(Xrecurse_legacy13)
634: .quad _C_LABEL(Xresume_legacy13)
635: .quad _C_LABEL(Xintr_legacy14), _C_LABEL(Xrecurse_legacy14)
636: .quad _C_LABEL(Xresume_legacy14)
637: .quad _C_LABEL(Xintr_legacy15), _C_LABEL(Xrecurse_legacy15)
638: .quad _C_LABEL(Xresume_legacy15)
639:
640: #if NIOAPIC > 0
641: .globl _C_LABEL(ioapic_edge_stubs)
642: _C_LABEL(ioapic_edge_stubs):
643: .quad _C_LABEL(Xintr_ioapic_edge0), _C_LABEL(Xrecurse_ioapic_edge0)
644: .quad _C_LABEL(Xresume_ioapic_edge0)
645: .quad _C_LABEL(Xintr_ioapic_edge1), _C_LABEL(Xrecurse_ioapic_edge1)
646: .quad _C_LABEL(Xresume_ioapic_edge1)
647: .quad _C_LABEL(Xintr_ioapic_edge2), _C_LABEL(Xrecurse_ioapic_edge2)
648: .quad _C_LABEL(Xresume_ioapic_edge2)
649: .quad _C_LABEL(Xintr_ioapic_edge3), _C_LABEL(Xrecurse_ioapic_edge3)
650: .quad _C_LABEL(Xresume_ioapic_edge3)
651: .quad _C_LABEL(Xintr_ioapic_edge4), _C_LABEL(Xrecurse_ioapic_edge4)
652: .quad _C_LABEL(Xresume_ioapic_edge4)
653: .quad _C_LABEL(Xintr_ioapic_edge5), _C_LABEL(Xrecurse_ioapic_edge5)
654: .quad _C_LABEL(Xresume_ioapic_edge5)
655: .quad _C_LABEL(Xintr_ioapic_edge6), _C_LABEL(Xrecurse_ioapic_edge6)
656: .quad _C_LABEL(Xresume_ioapic_edge6)
657: .quad _C_LABEL(Xintr_ioapic_edge7), _C_LABEL(Xrecurse_ioapic_edge7)
658: .quad _C_LABEL(Xresume_ioapic_edge7)
659: .quad _C_LABEL(Xintr_ioapic_edge8), _C_LABEL(Xrecurse_ioapic_edge8)
660: .quad _C_LABEL(Xresume_ioapic_edge8)
661: .quad _C_LABEL(Xintr_ioapic_edge9), _C_LABEL(Xrecurse_ioapic_edge9)
662: .quad _C_LABEL(Xresume_ioapic_edge9)
663: .quad _C_LABEL(Xintr_ioapic_edge10), _C_LABEL(Xrecurse_ioapic_edge10)
664: .quad _C_LABEL(Xresume_ioapic_edge10)
665: .quad _C_LABEL(Xintr_ioapic_edge11), _C_LABEL(Xrecurse_ioapic_edge11)
666: .quad _C_LABEL(Xresume_ioapic_edge11)
667: .quad _C_LABEL(Xintr_ioapic_edge12), _C_LABEL(Xrecurse_ioapic_edge12)
668: .quad _C_LABEL(Xresume_ioapic_edge12)
669: .quad _C_LABEL(Xintr_ioapic_edge13), _C_LABEL(Xrecurse_ioapic_edge13)
670: .quad _C_LABEL(Xresume_ioapic_edge13)
671: .quad _C_LABEL(Xintr_ioapic_edge14), _C_LABEL(Xrecurse_ioapic_edge14)
672: .quad _C_LABEL(Xresume_ioapic_edge14)
673: .quad _C_LABEL(Xintr_ioapic_edge15), _C_LABEL(Xrecurse_ioapic_edge15)
674: .quad _C_LABEL(Xresume_ioapic_edge15)
675: .quad _C_LABEL(Xintr_ioapic_edge16), _C_LABEL(Xrecurse_ioapic_edge16)
676: .quad _C_LABEL(Xresume_ioapic_edge16)
677: .quad _C_LABEL(Xintr_ioapic_edge17), _C_LABEL(Xrecurse_ioapic_edge17)
678: .quad _C_LABEL(Xresume_ioapic_edge17)
679: .quad _C_LABEL(Xintr_ioapic_edge18), _C_LABEL(Xrecurse_ioapic_edge18)
680: .quad _C_LABEL(Xresume_ioapic_edge18)
681: .quad _C_LABEL(Xintr_ioapic_edge19), _C_LABEL(Xrecurse_ioapic_edge19)
682: .quad _C_LABEL(Xresume_ioapic_edge19)
683: .quad _C_LABEL(Xintr_ioapic_edge20), _C_LABEL(Xrecurse_ioapic_edge20)
684: .quad _C_LABEL(Xresume_ioapic_edge20)
685: .quad _C_LABEL(Xintr_ioapic_edge21), _C_LABEL(Xrecurse_ioapic_edge21)
686: .quad _C_LABEL(Xresume_ioapic_edge21)
687: .quad _C_LABEL(Xintr_ioapic_edge22), _C_LABEL(Xrecurse_ioapic_edge22)
688: .quad _C_LABEL(Xresume_ioapic_edge22)
689: .quad _C_LABEL(Xintr_ioapic_edge23), _C_LABEL(Xrecurse_ioapic_edge23)
690: .quad _C_LABEL(Xresume_ioapic_edge23)
691: .quad _C_LABEL(Xintr_ioapic_edge24), _C_LABEL(Xrecurse_ioapic_edge24)
692: .quad _C_LABEL(Xresume_ioapic_edge24)
693: .quad _C_LABEL(Xintr_ioapic_edge25), _C_LABEL(Xrecurse_ioapic_edge25)
694: .quad _C_LABEL(Xresume_ioapic_edge25)
695: .quad _C_LABEL(Xintr_ioapic_edge26), _C_LABEL(Xrecurse_ioapic_edge26)
696: .quad _C_LABEL(Xresume_ioapic_edge26)
697: .quad _C_LABEL(Xintr_ioapic_edge27), _C_LABEL(Xrecurse_ioapic_edge27)
698: .quad _C_LABEL(Xresume_ioapic_edge27)
699: .quad _C_LABEL(Xintr_ioapic_edge28), _C_LABEL(Xrecurse_ioapic_edge28)
700: .quad _C_LABEL(Xresume_ioapic_edge28)
701: .quad _C_LABEL(Xintr_ioapic_edge29), _C_LABEL(Xrecurse_ioapic_edge29)
702: .quad _C_LABEL(Xresume_ioapic_edge29)
703: .quad _C_LABEL(Xintr_ioapic_edge30), _C_LABEL(Xrecurse_ioapic_edge30)
704: .quad _C_LABEL(Xresume_ioapic_edge30)
705: .quad _C_LABEL(Xintr_ioapic_edge31), _C_LABEL(Xrecurse_ioapic_edge31)
706: .quad _C_LABEL(Xresume_ioapic_edge31)
707:
708: .globl _C_LABEL(ioapic_level_stubs)
709: _C_LABEL(ioapic_level_stubs):
710: .quad _C_LABEL(Xintr_ioapic_level0), _C_LABEL(Xrecurse_ioapic_level0)
711: .quad _C_LABEL(Xresume_ioapic_level0)
712: .quad _C_LABEL(Xintr_ioapic_level1), _C_LABEL(Xrecurse_ioapic_level1)
713: .quad _C_LABEL(Xresume_ioapic_level1)
714: .quad _C_LABEL(Xintr_ioapic_level2), _C_LABEL(Xrecurse_ioapic_level2)
715: .quad _C_LABEL(Xresume_ioapic_level2)
716: .quad _C_LABEL(Xintr_ioapic_level3), _C_LABEL(Xrecurse_ioapic_level3)
717: .quad _C_LABEL(Xresume_ioapic_level3)
718: .quad _C_LABEL(Xintr_ioapic_level4), _C_LABEL(Xrecurse_ioapic_level4)
719: .quad _C_LABEL(Xresume_ioapic_level4)
720: .quad _C_LABEL(Xintr_ioapic_level5), _C_LABEL(Xrecurse_ioapic_level5)
721: .quad _C_LABEL(Xresume_ioapic_level5)
722: .quad _C_LABEL(Xintr_ioapic_level6), _C_LABEL(Xrecurse_ioapic_level6)
723: .quad _C_LABEL(Xresume_ioapic_level6)
724: .quad _C_LABEL(Xintr_ioapic_level7), _C_LABEL(Xrecurse_ioapic_level7)
725: .quad _C_LABEL(Xresume_ioapic_level7)
726: .quad _C_LABEL(Xintr_ioapic_level8), _C_LABEL(Xrecurse_ioapic_level8)
727: .quad _C_LABEL(Xresume_ioapic_level8)
728: .quad _C_LABEL(Xintr_ioapic_level9), _C_LABEL(Xrecurse_ioapic_level9)
729: .quad _C_LABEL(Xresume_ioapic_level9)
730: .quad _C_LABEL(Xintr_ioapic_level10), _C_LABEL(Xrecurse_ioapic_level10)
731: .quad _C_LABEL(Xresume_ioapic_level10)
732: .quad _C_LABEL(Xintr_ioapic_level11), _C_LABEL(Xrecurse_ioapic_level11)
733: .quad _C_LABEL(Xresume_ioapic_level11)
734: .quad _C_LABEL(Xintr_ioapic_level12), _C_LABEL(Xrecurse_ioapic_level12)
735: .quad _C_LABEL(Xresume_ioapic_level12)
736: .quad _C_LABEL(Xintr_ioapic_level13), _C_LABEL(Xrecurse_ioapic_level13)
737: .quad _C_LABEL(Xresume_ioapic_level13)
738: .quad _C_LABEL(Xintr_ioapic_level14), _C_LABEL(Xrecurse_ioapic_level14)
739: .quad _C_LABEL(Xresume_ioapic_level14)
740: .quad _C_LABEL(Xintr_ioapic_level15), _C_LABEL(Xrecurse_ioapic_level15)
741: .quad _C_LABEL(Xresume_ioapic_level15)
742: .quad _C_LABEL(Xintr_ioapic_level16), _C_LABEL(Xrecurse_ioapic_level16)
743: .quad _C_LABEL(Xresume_ioapic_level16)
744: .quad _C_LABEL(Xintr_ioapic_level17), _C_LABEL(Xrecurse_ioapic_level17)
745: .quad _C_LABEL(Xresume_ioapic_level17)
746: .quad _C_LABEL(Xintr_ioapic_level18), _C_LABEL(Xrecurse_ioapic_level18)
747: .quad _C_LABEL(Xresume_ioapic_level18)
748: .quad _C_LABEL(Xintr_ioapic_level19), _C_LABEL(Xrecurse_ioapic_level19)
749: .quad _C_LABEL(Xresume_ioapic_level19)
750: .quad _C_LABEL(Xintr_ioapic_level20), _C_LABEL(Xrecurse_ioapic_level20)
751: .quad _C_LABEL(Xresume_ioapic_level20)
752: .quad _C_LABEL(Xintr_ioapic_level21), _C_LABEL(Xrecurse_ioapic_level21)
753: .quad _C_LABEL(Xresume_ioapic_level21)
754: .quad _C_LABEL(Xintr_ioapic_level22), _C_LABEL(Xrecurse_ioapic_level22)
755: .quad _C_LABEL(Xresume_ioapic_level22)
756: .quad _C_LABEL(Xintr_ioapic_level23), _C_LABEL(Xrecurse_ioapic_level23)
757: .quad _C_LABEL(Xresume_ioapic_level23)
758: .quad _C_LABEL(Xintr_ioapic_level24), _C_LABEL(Xrecurse_ioapic_level24)
759: .quad _C_LABEL(Xresume_ioapic_level24)
760: .quad _C_LABEL(Xintr_ioapic_level25), _C_LABEL(Xrecurse_ioapic_level25)
761: .quad _C_LABEL(Xresume_ioapic_level25)
762: .quad _C_LABEL(Xintr_ioapic_level26), _C_LABEL(Xrecurse_ioapic_level26)
763: .quad _C_LABEL(Xresume_ioapic_level26)
764: .quad _C_LABEL(Xintr_ioapic_level27), _C_LABEL(Xrecurse_ioapic_level27)
765: .quad _C_LABEL(Xresume_ioapic_level27)
766: .quad _C_LABEL(Xintr_ioapic_level28), _C_LABEL(Xrecurse_ioapic_level28)
767: .quad _C_LABEL(Xresume_ioapic_level28)
768: .quad _C_LABEL(Xintr_ioapic_level29), _C_LABEL(Xrecurse_ioapic_level29)
769: .quad _C_LABEL(Xresume_ioapic_level29)
770: .quad _C_LABEL(Xintr_ioapic_level30), _C_LABEL(Xrecurse_ioapic_level30)
771: .quad _C_LABEL(Xresume_ioapic_level30)
772: .quad _C_LABEL(Xintr_ioapic_level31), _C_LABEL(Xrecurse_ioapic_level31)
773: .quad _C_LABEL(Xresume_ioapic_level31)
774: #endif
775:
776: .data
777:
778: /*
779: * Soft interrupt handlers
780: */
781: .globl _C_LABEL(netisr)
782: _C_LABEL(netisr):
783: .word 0
784:
785: IDTVEC(softserial)
786: movl $IPL_SOFTSERIAL, CPUVAR(ILEVEL)
787: sti
788: incl CPUVAR(IDEPTH)
789: #ifdef MULTIPROCESSOR
790: call _C_LABEL(x86_softintlock)
791: #endif
792: movq CPUVAR(ISOURCES) + SIR_SERIAL * 8, %r12
793: movl $X86_SOFTINTR_SOFTSERIAL,%edi
794: call _C_LABEL(softintr_dispatch)
795: #ifdef MULTIPROCESSOR
796: call _C_LABEL(x86_softintunlock)
797: #endif
798: decl CPUVAR(IDEPTH)
799: jmp *%r13
800:
801: IDTVEC(softnet)
802: movl $IPL_SOFTNET, CPUVAR(ILEVEL)
803: sti
804: incl CPUVAR(IDEPTH)
805: #ifdef MULTIPROCESSOR
806: call _C_LABEL(x86_softintlock)
807: #endif
808: movq CPUVAR(ISOURCES) + SIR_NET * 8, %r12
809:
810: xorq %r12,%r12
811: xchgl _C_LABEL(netisr),%r12d
812:
813: /* XXX Do the legacy netisrs here for now. */
814: #define DONETISR(s, c) \
815: .globl _C_LABEL(c) ;\
816: testl $(1 << s),%r12d ;\
817: jz 1f ;\
818: call _C_LABEL(c) ;\
819: 1:
820: #include <net/netisr_dispatch.h>
821:
822: movl $X86_SOFTINTR_SOFTNET,%edi
823: call _C_LABEL(softintr_dispatch)
824: #ifdef MULTIPROCESSOR
825: call _C_LABEL(x86_softintunlock)
826: #endif
827: decl CPUVAR(IDEPTH)
828: jmp *%r13
829:
830: IDTVEC(softclock)
831: movl $IPL_SOFTCLOCK, CPUVAR(ILEVEL)
832: sti
833: incl CPUVAR(IDEPTH)
834: #ifdef MULTIPROCESSOR
835: call _C_LABEL(x86_softintlock)
836: #endif
837: movq CPUVAR(ISOURCES) + SIR_CLOCK * 8, %r12
838:
839: movl $X86_SOFTINTR_SOFTCLOCK,%edi
840: call _C_LABEL(softintr_dispatch)
841: #ifdef MULTIPROCESSOR
842: call _C_LABEL(x86_softintunlock)
843: #endif
844: decl CPUVAR(IDEPTH)
845: jmp *%r13
CVSweb