ia64/xen-unstable

view extras/mini-os/x86_64.S @ 9788:bdcc838b9a72

Add small memory warning message to domain configuration examples.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
author stekloff@dyn9047022152.beaverton.ibm.com
date Wed Apr 19 22:58:24 2006 +0100 (2006-04-19)
parents 323d40eefbce
children f6507937cb7c
line source
1 #include <os.h>
3 .section __xen_guest
4 .ascii "GUEST_OS=Mini-OS"
5 .ascii ",XEN_VER=xen-3.0"
6 .ascii ",HYPERCALL_PAGE=0x2"
7 .ascii ",LOADER=generic"
8 .ascii ",PT_MODE_WRITABLE"
9 .byte 0
10 .text
12 #define ENTRY(X) .globl X ; X :
13 .globl _start, shared_info, hypercall_page
15 #define SAVE_ALL \
16 cld; \
17 pushq %rdi; \
18 pushq %rsi; \
19 pushq %rdx; \
20 pushq %rcx; \
21 pushq %rax; \
22 pushq %r8; \
23 pushq %r9; \
24 pushq %r10; \
25 pushq %r11; \
26 pushq %rbx; \
27 pushq %rbp; \
28 pushq %r12; \
29 pushq %r13; \
30 pushq %r14; \
31 pushq %r15;
33 #define RESTORE_ALL \
34 popq %r15; \
35 popq %r14; \
36 popq %r13; \
37 popq %r12; \
38 popq %rbp; \
39 popq %rbx; \
40 popq %r11; \
41 popq %r10; \
42 popq %r9; \
43 popq %r8; \
44 popq %rax; \
45 popq %rcx; \
46 popq %rdx; \
47 popq %rsi; \
48 popq %rdi
50 _start:
51 cld
52 movq stack_start(%rip),%rsp
53 movq %rsi,%rdi
54 call start_kernel
56 stack_start:
57 .quad stack+8192
59 /* Unpleasant -- the PTE that maps this page is actually overwritten */
60 /* to map the real shared-info page! :-) */
61 .org 0x1000
62 shared_info:
63 .org 0x2000
65 hypercall_page:
66 .org 0x3000
68 ENTRY(hypervisor_callback)
69 popq %rcx
70 popq %r11
71 iretq
73 ENTRY(failsafe_callback)
74 popq %rcx
75 popq %r11
76 iretq
78 error_code:
79 SAVE_ALL
80 movq %rsp,%rdi
81 movl 15*8+4(%rsp),%eax
82 leaq exception_table(%rip),%rdx
83 callq *(%rdx,%rax,8)
84 RESTORE_ALL
85 addq $8,%rsp
86 iretq
88 ENTRY(divide_error)
89 popq %rcx
90 popq %r11
91 pushq $0
92 movl $TRAP_divide_error,4(%rsp)
93 jmp error_code
95 ENTRY(coprocessor_error)
96 popq %rcx
97 popq %r11
98 pushq $0
99 movl $TRAP_copro_error,4(%rsp)
100 jmp error_code
102 ENTRY(simd_coprocessor_error)
103 popq %rcx
104 popq %r11
105 pushq $0
106 movl $TRAP_simd_error,4(%rsp)
107 jmp error_code
109 ENTRY(device_not_available)
110 popq %rcx
111 popq %r11
112 movl $TRAP_no_device,4(%rsp)
113 jmp error_code
115 ENTRY(debug)
116 popq %rcx
117 popq %r11
118 pushq $0
119 movl $TRAP_debug,4(%rsp)
120 jmp error_code
122 ENTRY(int3)
123 popq %rcx
124 popq %r11
125 pushq $0
126 movl $TRAP_int3,4(%rsp)
127 jmp error_code
129 ENTRY(overflow)
130 popq %rcx
131 popq %r11
132 pushq $0
133 movl $TRAP_overflow,4(%rsp)
134 jmp error_code
136 ENTRY(bounds)
137 popq %rcx
138 popq %r11
139 pushq $0
140 movl $TRAP_bounds,4(%rsp)
141 jmp error_code
143 ENTRY(invalid_op)
144 popq %rcx
145 popq %r11
146 pushq $0
147 movl $TRAP_invalid_op,4(%rsp)
148 jmp error_code
150 ENTRY(coprocessor_segment_overrun)
151 popq %rcx
152 popq %r11
153 pushq $0
154 movl $TRAP_copro_seg,4(%rsp)
155 jmp error_code
157 ENTRY(invalid_TSS)
158 popq %rcx
159 popq %r11
160 movl $TRAP_invalid_tss,4(%rsp)
161 jmp error_code
163 ENTRY(segment_not_present)
164 popq %rcx
165 popq %r11
166 movl $TRAP_no_segment,4(%rsp)
167 jmp error_code
169 ENTRY(stack_segment)
170 popq %rcx
171 popq %r11
172 movl $TRAP_stack_error,4(%rsp)
173 jmp error_code
175 ENTRY(general_protection)
176 popq %rcx
177 popq %r11
178 movl $TRAP_gp_fault,4(%rsp)
179 jmp error_code
181 ENTRY(alignment_check)
182 popq %rcx
183 popq %r11
184 movl $TRAP_alignment_check,4(%rsp)
185 jmp error_code
187 ENTRY(virt_cr2)
188 .quad 0
189 ENTRY(page_fault)
190 popq %rcx
191 popq %r11
192 popq virt_cr2(%rip)
193 movl $TRAP_page_fault,4(%rsp)
194 jmp error_code
196 ENTRY(machine_check)
197 popq %rcx
198 popq %r11
199 pushq $0
200 movl $TRAP_machine_check,4(%rsp)
201 jmp error_code
203 ENTRY(spurious_interrupt_bug)
204 popq %rcx
205 popq %r11
206 pushq $0
207 movl $TRAP_spurious_int,4(%rsp)
208 jmp error_code
210 ENTRY(exception_table)
211 .quad do_divide_error
212 .quad do_debug
213 .quad 0 # nmi
214 .quad do_int3
215 .quad do_overflow
216 .quad do_bounds
217 .quad do_invalid_op
218 .quad 0
219 .quad 0
220 .quad do_coprocessor_segment_overrun
221 .quad do_invalid_TSS
222 .quad do_segment_not_present
223 .quad do_stack_segment
224 .quad do_general_protection
225 .quad do_page_fault
226 .quad do_spurious_interrupt_bug
227 .quad do_coprocessor_error
228 .quad do_alignment_check
229 .quad do_machine_check
230 .quad do_simd_coprocessor_error