ia64/xen-unstable

view xen/include/asm-x86/x86_64/asm_defns.h @ 3650:8c6281ec8860

bitkeeper revision 1.1159.212.87 (4203b25aTB_XSOA2G0yxgrj0ey-vIA)

Defined per-CPU SYSCALL entry point for hypercalls. We enter the DOM0
kernel and can receive hypercalls. Now probably need to fix the
user-access (uaccess.h) functions and macros.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Fri Feb 04 17:35:22 2005 +0000 (2005-02-04)
parents bf2c38625b39
children 393483ae9f62
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 #define RESTORE_ALL \
26 "popq %r15;" \
27 "popq %r14;" \
28 "popq %r13;" \
29 "popq %r12;" \
30 "popq %rbp;" \
31 "popq %rbx;" \
32 "popq %r11;" \
33 "popq %r10;" \
34 "popq %r9;" \
35 "popq %r8;" \
36 "popq %rax;" \
37 "popq %rcx;" \
38 "popq %rdx;" \
39 "popq %rsi;" \
40 "popq %rdi;"
42 #else
44 #define SAVE_ALL \
45 cld; \
46 pushq %rdi; \
47 pushq %rsi; \
48 pushq %rdx; \
49 pushq %rcx; \
50 pushq %rax; \
51 pushq %r8; \
52 pushq %r9; \
53 pushq %r10; \
54 pushq %r11; \
55 pushq %rbx; \
56 pushq %rbp; \
57 pushq %r12; \
58 pushq %r13; \
59 pushq %r14; \
60 pushq %r15;
62 #define RESTORE_ALL \
63 popq %r15; \
64 popq %r14; \
65 popq %r13; \
66 popq %r12; \
67 popq %rbp; \
68 popq %rbx; \
69 popq %r11; \
70 popq %r10; \
71 popq %r9; \
72 popq %r8; \
73 popq %rax; \
74 popq %rcx; \
75 popq %rdx; \
76 popq %rsi; \
77 popq %rdi;
79 #endif
81 #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
82 #define XBUILD_SMP_INTERRUPT(x,v)\
83 asmlinkage void x(void); \
84 __asm__( \
85 "\n"__ALIGN_STR"\n" \
86 SYMBOL_NAME_STR(x) ":\n\t" \
87 "pushq $0\n\t" \
88 "movl $"#v",4(%rsp)\n\t" \
89 SAVE_ALL \
90 "callq "SYMBOL_NAME_STR(smp_##x)"\n\t" \
91 "jmp ret_from_intr\n");
93 #define BUILD_SMP_TIMER_INTERRUPT(x,v) XBUILD_SMP_TIMER_INTERRUPT(x,v)
94 #define XBUILD_SMP_TIMER_INTERRUPT(x,v) \
95 asmlinkage void x(struct xen_regs * regs); \
96 __asm__( \
97 "\n"__ALIGN_STR"\n" \
98 SYMBOL_NAME_STR(x) ":\n\t" \
99 "pushq $0\n\t" \
100 "movl $"#v",4(%rsp)\n\t" \
101 SAVE_ALL \
102 "movq %rsp,%rdi\n\t" \
103 "callq "SYMBOL_NAME_STR(smp_##x)"\n\t" \
104 "jmp ret_from_intr\n");
106 #define BUILD_COMMON_IRQ() \
107 __asm__( \
108 "\n" __ALIGN_STR"\n" \
109 "common_interrupt:\n\t" \
110 SAVE_ALL \
111 "movq %rsp,%rdi\n\t" \
112 "callq " SYMBOL_NAME_STR(do_IRQ) "\n\t" \
113 "jmp ret_from_intr\n");
115 #define IRQ_NAME2(nr) nr##_interrupt(void)
116 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
118 #define BUILD_IRQ(nr) \
119 asmlinkage void IRQ_NAME(nr); \
120 __asm__( \
121 "\n"__ALIGN_STR"\n" \
122 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
123 "pushq $0\n\t" \
124 "movl $"#nr",4(%rsp)\n\t" \
125 "jmp common_interrupt");
127 #endif /* __X86_64_ASM_DEFNS_H__ */