debuggers.hg

view xen/include/asm-x86/x86_64/asm_defns.h @ 3659:bf2c38625b39

bitkeeper revision 1.1159.212.72 (42011b79Y7C9nEKFZ5pdQXwp8jC9hw)

More x86/64. Now boot secondary CPUs, but I seem to have problems
executing IRET, so interrupts are fatal.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Wed Feb 02 18:27:05 2005 +0000 (2005-02-02)
parents dda5ab69e74a
children bbe8541361dd 8c6281ec8860
line source
1 #ifndef __X86_64_ASM_DEFNS_H__
2 #define __X86_64_ASM_DEFNS_H__
4 /* Maybe auto-generate the following two cases (quoted vs. unquoted). */
5 #ifndef __ASSEMBLY__
7 #define SAVE_ALL \
8 "cld;" \
9 "pushq %rdi;" \
10 "pushq %rsi;" \
11 "pushq %rdx;" \
12 "pushq %rcx;" \
13 "pushq %rax;" \
14 "pushq %r8;" \
15 "pushq %r9;" \
16 "pushq %r10;" \
17 "pushq %r11;" \
18 "pushq %rbx;" \
19 "pushq %rbp;" \
20 "pushq %r12;" \
21 "pushq %r13;" \
22 "pushq %r14;" \
23 "pushq %r15;"
25 #else
27 #define SAVE_ALL \
28 cld; \
29 pushq %rdi; \
30 pushq %rsi; \
31 pushq %rdx; \
32 pushq %rcx; \
33 pushq %rax; \
34 pushq %r8; \
35 pushq %r9; \
36 pushq %r10; \
37 pushq %r11; \
38 pushq %rbx; \
39 pushq %rbp; \
40 pushq %r12; \
41 pushq %r13; \
42 pushq %r14; \
43 pushq %r15;
45 #endif
47 #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
48 #define XBUILD_SMP_INTERRUPT(x,v)\
49 asmlinkage void x(void); \
50 __asm__( \
51 "\n"__ALIGN_STR"\n" \
52 SYMBOL_NAME_STR(x) ":\n\t" \
53 "pushq $0\n\t" \
54 "movl $"#v",4(%rsp)\n\t" \
55 SAVE_ALL \
56 "callq "SYMBOL_NAME_STR(smp_##x)"\n\t" \
57 "jmp ret_from_intr\n");
59 #define BUILD_SMP_TIMER_INTERRUPT(x,v) XBUILD_SMP_TIMER_INTERRUPT(x,v)
60 #define XBUILD_SMP_TIMER_INTERRUPT(x,v) \
61 asmlinkage void x(struct xen_regs * regs); \
62 __asm__( \
63 "\n"__ALIGN_STR"\n" \
64 SYMBOL_NAME_STR(x) ":\n\t" \
65 "pushq $0\n\t" \
66 "movl $"#v",4(%rsp)\n\t" \
67 SAVE_ALL \
68 "movq %rsp,%rdi\n\t" \
69 "callq "SYMBOL_NAME_STR(smp_##x)"\n\t" \
70 "jmp ret_from_intr\n");
72 #define BUILD_COMMON_IRQ() \
73 __asm__( \
74 "\n" __ALIGN_STR"\n" \
75 "common_interrupt:\n\t" \
76 SAVE_ALL \
77 "movq %rsp,%rdi\n\t" \
78 "callq " SYMBOL_NAME_STR(do_IRQ) "\n\t" \
79 "jmp ret_from_intr\n");
81 #define IRQ_NAME2(nr) nr##_interrupt(void)
82 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
84 #define BUILD_IRQ(nr) \
85 asmlinkage void IRQ_NAME(nr); \
86 __asm__( \
87 "\n"__ALIGN_STR"\n" \
88 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
89 "pushq $0\n\t" \
90 "movl $"#nr",4(%rsp)\n\t" \
91 "jmp common_interrupt");
93 #endif /* __X86_64_ASM_DEFNS_H__ */