ia64/xen-unstable

view xen/arch/x86/x86_64/entry.S @ 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 d55d523078f7
children 393483ae9f62 253e8e10e986
line source
1 /*
2 * Hypercall and fault low-level handling routines.
3 *
4 * Copyright (c) 2005, K A Fraser
5 */
7 #include <xen/config.h>
8 #include <xen/errno.h>
9 #include <xen/softirq.h>
10 #include <asm/asm_defns.h>
11 #include <asm/apicdef.h>
12 #include <public/xen.h>
14 ENTRY(hypercall)
15 movl $0x0833,8(%rsp)
16 pushq %r11
17 pushq $0x082b
18 pushq %rcx
19 pushq $0
20 SAVE_ALL
21 andq $(NR_hypercalls-1),%rax
22 leaq SYMBOL_NAME(exception_table)(%rip),%rcx
23 callq *(%rcx,%rax,8)
24 RESTORE_ALL
25 addq $8,%rsp
26 popq %rcx
27 addq $8,%rsp
28 popq %r11
29 cli
30 popq %rsp
31 sysretq
33 ENTRY(ret_from_intr)
34 restore_all_xen:
35 RESTORE_ALL
36 addq $8,%rsp
37 iretq
39 error_code:
40 SAVE_ALL
41 movq %rsp,%rdi
42 movl XREGS_entry_vector(%rsp),%eax
43 leaq SYMBOL_NAME(exception_table)(%rip),%rdx
44 callq *(%rdx,%rax,8)
45 jmp restore_all_xen
47 ENTRY(divide_error)
48 pushq $0
49 movl $TRAP_divide_error,4(%rsp)
50 jmp error_code
52 ENTRY(coprocessor_error)
53 pushq $0
54 movl $TRAP_copro_error,4(%rsp)
55 jmp error_code
57 ENTRY(simd_coprocessor_error)
58 pushq $0
59 movl $TRAP_simd_error,4(%rsp)
60 jmp error_code
62 ENTRY(device_not_available)
63 pushq $0
64 movl $TRAP_no_device,4(%rsp)
65 jmp error_code
67 ENTRY(debug)
68 pushq $0
69 movl $TRAP_debug,4(%rsp)
70 jmp error_code
72 ENTRY(int3)
73 pushq $0
74 movl $TRAP_int3,4(%rsp)
75 jmp error_code
77 ENTRY(overflow)
78 pushq $0
79 movl $TRAP_overflow,4(%rsp)
80 jmp error_code
82 ENTRY(bounds)
83 pushq $0
84 movl $TRAP_bounds,4(%rsp)
85 jmp error_code
87 ENTRY(invalid_op)
88 pushq $0
89 movl $TRAP_invalid_op,4(%rsp)
90 jmp error_code
92 ENTRY(coprocessor_segment_overrun)
93 pushq $0
94 movl $TRAP_copro_seg,4(%rsp)
95 jmp error_code
97 ENTRY(invalid_TSS)
98 movl $TRAP_invalid_tss,4(%rsp)
99 jmp error_code
101 ENTRY(segment_not_present)
102 movl $TRAP_no_segment,4(%rsp)
103 jmp error_code
105 ENTRY(stack_segment)
106 movl $TRAP_stack_error,4(%rsp)
107 jmp error_code
109 ENTRY(general_protection)
110 movl $TRAP_gp_fault,4(%rsp)
111 jmp error_code
113 ENTRY(alignment_check)
114 movl $TRAP_alignment_check,4(%rsp)
115 jmp error_code
117 ENTRY(page_fault)
118 movl $TRAP_page_fault,4(%rsp)
119 jmp error_code
121 ENTRY(machine_check)
122 pushq $0
123 movl $TRAP_machine_check,4(%rsp)
124 jmp error_code
126 ENTRY(spurious_interrupt_bug)
127 pushq $0
128 movl $TRAP_spurious_int,4(%rsp)
129 jmp error_code
131 ENTRY(double_fault)
132 movl $TRAP_double_fault,4(%rsp)
133 jmp error_code
135 ENTRY(nmi)
136 iret
138 .data
140 ENTRY(exception_table)
141 .quad SYMBOL_NAME(do_divide_error)
142 .quad SYMBOL_NAME(do_debug)
143 .quad 0 # nmi
144 .quad SYMBOL_NAME(do_int3)
145 .quad SYMBOL_NAME(do_overflow)
146 .quad SYMBOL_NAME(do_bounds)
147 .quad SYMBOL_NAME(do_invalid_op)
148 .quad SYMBOL_NAME(math_state_restore)
149 .quad SYMBOL_NAME(do_double_fault)
150 .quad SYMBOL_NAME(do_coprocessor_segment_overrun)
151 .quad SYMBOL_NAME(do_invalid_TSS)
152 .quad SYMBOL_NAME(do_segment_not_present)
153 .quad SYMBOL_NAME(do_stack_segment)
154 .quad SYMBOL_NAME(do_general_protection)
155 .quad SYMBOL_NAME(do_page_fault)
156 .quad SYMBOL_NAME(do_spurious_interrupt_bug)
157 .quad SYMBOL_NAME(do_coprocessor_error)
158 .quad SYMBOL_NAME(do_alignment_check)
159 .quad SYMBOL_NAME(do_machine_check)
160 .quad SYMBOL_NAME(do_simd_coprocessor_error)
162 ENTRY(hypercall_table)
163 .quad SYMBOL_NAME(do_set_trap_table) /* 0 */
164 .quad SYMBOL_NAME(do_mmu_update)
165 .quad SYMBOL_NAME(do_set_gdt)
166 .quad SYMBOL_NAME(do_stack_switch)
167 .quad SYMBOL_NAME(do_set_callbacks)
168 .quad SYMBOL_NAME(do_fpu_taskswitch) /* 5 */
169 .quad SYMBOL_NAME(do_sched_op)
170 .quad SYMBOL_NAME(do_dom0_op)
171 .quad SYMBOL_NAME(do_set_debugreg)
172 .quad SYMBOL_NAME(do_get_debugreg)
173 .quad SYMBOL_NAME(do_update_descriptor) /* 10 */
174 .quad SYMBOL_NAME(do_ni_hypercall) # do_set_fast_trap
175 .quad SYMBOL_NAME(do_dom_mem_op)
176 .quad SYMBOL_NAME(do_multicall)
177 .quad SYMBOL_NAME(do_update_va_mapping)
178 .quad SYMBOL_NAME(do_set_timer_op) /* 15 */
179 .quad SYMBOL_NAME(do_event_channel_op)
180 .quad SYMBOL_NAME(do_xen_version)
181 .quad SYMBOL_NAME(do_console_io)
182 .quad SYMBOL_NAME(do_physdev_op)
183 .quad SYMBOL_NAME(do_grant_table_op) /* 20 */
184 .quad SYMBOL_NAME(do_vm_assist)
185 .quad SYMBOL_NAME(do_update_va_mapping_otherdomain)
186 .quad SYMBOL_NAME(do_ni_hypercall) # do_switch_vm86
187 .quad SYMBOL_NAME(do_boot_vcpu)
188 .rept NR_hypercalls-((.-hypercall_table)/4)
189 .quad SYMBOL_NAME(do_ni_hypercall)
190 .endr