debuggers.hg

view xen/arch/x86/trampoline.S @ 3674:fb875591fd72

bitkeeper revision 1.1159.223.63 (42028527-fv-d9BM0_LRp8UKGP19gQ)

Fix NMI deferral.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 03 20:10:15 2005 +0000 (2005-02-03)
parents 3f929065a1d1
children 0a4b76b6b5a0
line source
1 /*
2 *
3 * Trampoline.S Derived from Setup.S by Linus Torvalds
4 *
5 * 4 Jan 1997 Michael Chastain: changed to gnu as.
6 *
7 * Entry: CS:IP point to the start of our code, we are
8 * in real mode with no stack, but the rest of the
9 * trampoline page to make our stack and everything else
10 * is a mystery.
11 *
12 * On entry to trampoline_data, the processor is in real mode
13 * with 16-bit addressing and 16-bit data. CS has some value
14 * and IP is zero. Thus, data addresses need to be absolute
15 * (no relocation) and are taken with regard to r_base.
16 */
18 #include <xen/config.h>
19 #include <public/xen.h>
20 #include <asm/page.h>
22 #ifdef CONFIG_SMP
24 .data
26 .code16
28 ENTRY(trampoline_data)
29 r_base = .
30 mov %cs, %ax # Code and data in the same place
31 mov %ax, %ds
33 movl $0xA5A5A5A5, %ebx # Flag an SMP trampoline
34 cli # We should be safe anyway
36 movl $0xA5A5A5A5, trampoline_data - r_base
38 lidt idt_48 - r_base # load idt with 0, 0
39 lgdt gdt_48 - r_base # load gdt with whatever is appropriate
41 xor %ax, %ax
42 inc %ax # protected mode (PE) bit
43 lmsw %ax # into protected mode
44 jmp flush_instr
45 flush_instr:
46 #if defined(__x86_64__)
47 ljmpl $__HYPERVISOR_CS32, $0x100000 # 1MB
48 #else
49 ljmpl $__HYPERVISOR_CS, $0x100000 # 1MB
50 #endif
52 idt_48:
53 .word 0 # idt limit = 0
54 .word 0, 0 # idt base = 0L
56 gdt_48:
57 .word (LAST_RESERVED_GDT_ENTRY*8)+7
58 #ifdef __i386__
59 .long gdt_table-__PAGE_OFFSET
60 #else
61 .long 0x100200 # gdt_table
62 #endif
64 .globl SYMBOL_NAME(trampoline_end)
65 SYMBOL_NAME_LABEL(trampoline_end)
67 #endif /* CONFIG_SMP */