debuggers.hg

view xen/arch/x86/x86_64/entry.S @ 3661:060c1ea52343

bitkeeper revision 1.1159.212.73 (420154ceFUvIANCrxSTgPyOjFi1Pag)

More x86_64 work. Interrupts and exceptions are now working. Next step is
DOM0 construction. First part of that is to map rest of physical memory,
allocate and map the mach_to_phys table, and fix arch_init_memory().
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@viper.(none)
date Wed Feb 02 22:31:42 2005 +0000 (2005-02-02)
parents bf2c38625b39
children d55d523078f7
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 iret
17 ENTRY(ret_from_intr)
18 restore_all_xen:
19 popq %r15
20 popq %r14
21 popq %r13
22 popq %r12
23 popq %rbp
24 popq %rbx
25 popq %r11
26 popq %r10
27 popq %r9
28 popq %r8
29 popq %rax
30 popq %rcx
31 popq %rdx
32 popq %rsi
33 popq %rdi
34 addq $8,%rsp
35 iretq
37 error_code:
38 SAVE_ALL
39 movq %rsp,%rdi
40 movl XREGS_entry_vector(%rsp),%eax
41 leaq SYMBOL_NAME(exception_table)(%rip),%rdx
42 callq *(%rdx,%rax,8)
43 jmp restore_all_xen
45 ENTRY(divide_error)
46 pushq $0
47 movl $TRAP_divide_error,4(%rsp)
48 jmp error_code
50 ENTRY(coprocessor_error)
51 pushq $0
52 movl $TRAP_copro_error,4(%rsp)
53 jmp error_code
55 ENTRY(simd_coprocessor_error)
56 pushq $0
57 movl $TRAP_simd_error,4(%rsp)
58 jmp error_code
60 ENTRY(device_not_available)
61 pushq $0
62 movl $TRAP_no_device,4(%rsp)
63 jmp error_code
65 ENTRY(debug)
66 pushq $0
67 movl $TRAP_debug,4(%rsp)
68 jmp error_code
70 ENTRY(int3)
71 pushq $0
72 movl $TRAP_int3,4(%rsp)
73 jmp error_code
75 ENTRY(overflow)
76 pushq $0
77 movl $TRAP_overflow,4(%rsp)
78 jmp error_code
80 ENTRY(bounds)
81 pushq $0
82 movl $TRAP_bounds,4(%rsp)
83 jmp error_code
85 ENTRY(invalid_op)
86 pushq $0
87 movl $TRAP_invalid_op,4(%rsp)
88 jmp error_code
90 ENTRY(coprocessor_segment_overrun)
91 pushq $0
92 movl $TRAP_copro_seg,4(%rsp)
93 jmp error_code
95 ENTRY(invalid_TSS)
96 movl $TRAP_invalid_tss,4(%rsp)
97 jmp error_code
99 ENTRY(segment_not_present)
100 movl $TRAP_no_segment,4(%rsp)
101 jmp error_code
103 ENTRY(stack_segment)
104 movl $TRAP_stack_error,4(%rsp)
105 jmp error_code
107 ENTRY(general_protection)
108 movl $TRAP_gp_fault,4(%rsp)
109 jmp error_code
111 ENTRY(alignment_check)
112 movl $TRAP_alignment_check,4(%rsp)
113 jmp error_code
115 ENTRY(page_fault)
116 movl $TRAP_page_fault,4(%rsp)
117 jmp error_code
119 ENTRY(machine_check)
120 pushq $0
121 movl $TRAP_machine_check,4(%rsp)
122 jmp error_code
124 ENTRY(spurious_interrupt_bug)
125 pushq $0
126 movl $TRAP_spurious_int,4(%rsp)
127 jmp error_code
129 ENTRY(nmi)
130 iret
132 .data
134 ENTRY(exception_table)
135 .quad SYMBOL_NAME(do_divide_error)
136 .quad SYMBOL_NAME(do_debug)
137 .quad 0 # nmi
138 .quad SYMBOL_NAME(do_int3)
139 .quad SYMBOL_NAME(do_overflow)
140 .quad SYMBOL_NAME(do_bounds)
141 .quad SYMBOL_NAME(do_invalid_op)
142 .quad SYMBOL_NAME(math_state_restore)
143 .quad 0 # double fault
144 .quad SYMBOL_NAME(do_coprocessor_segment_overrun)
145 .quad SYMBOL_NAME(do_invalid_TSS)
146 .quad SYMBOL_NAME(do_segment_not_present)
147 .quad SYMBOL_NAME(do_stack_segment)
148 .quad SYMBOL_NAME(do_general_protection)
149 .quad SYMBOL_NAME(do_page_fault)
150 .quad SYMBOL_NAME(do_spurious_interrupt_bug)
151 .quad SYMBOL_NAME(do_coprocessor_error)
152 .quad SYMBOL_NAME(do_alignment_check)
153 .quad SYMBOL_NAME(do_machine_check)
154 .quad SYMBOL_NAME(do_simd_coprocessor_error)