xen-vtx-unstable

view xen/arch/x86/trampoline.S @ 6759:b5d91089e42c

Newer binutils is a bit stricter and errors out when you try
to use movl on a 16 bit word on x86_64. Using just a "mov"
compiles fine and should result in the same code.

{standard input}: Assembler messages:
{standard input}:2138: Error: suffix or operands invalid for `mov'
{standard input}:2140: Error: suffix or operands invalid for `mov'
{standard input}:2142: Error: suffix or operands invalid for `mov'
{standard input}:2144: Error: suffix or operands invalid for `mov'

Signed-off-by: Rik van Riel <riel@redhat.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Sep 13 10:21:22 2005 +0000 (2005-09-13)
parents 66543cb296a9
children
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/desc.h>
21 #include <asm/page.h>
23 #ifdef CONFIG_SMP
25 .data
27 .code16
29 ENTRY(trampoline_data)
30 r_base = .
31 mov %cs, %ax # Code and data in the same place
32 mov %ax, %ds
34 movl $0xA5A5A5A5, %ebx # Flag an SMP trampoline
35 cli # We should be safe anyway
37 movl $0xA5A5A5A5, trampoline_data - r_base
39 lidt idt_48 - r_base # load idt with 0, 0
40 lgdt gdt_48 - r_base # load gdt with whatever is appropriate
42 xor %ax, %ax
43 inc %ax # protected mode (PE) bit
44 lmsw %ax # into protected mode
45 jmp flush_instr
46 flush_instr:
47 #if defined(__x86_64__)
48 ljmpl $__HYPERVISOR_CS32, $0x100000 # 1MB
49 #else
50 ljmpl $__HYPERVISOR_CS, $0x100000 # 1MB
51 #endif
53 idt_48:
54 .word 0 # idt limit = 0
55 .word 0, 0 # idt base = 0L
57 gdt_48:
58 .word LAST_RESERVED_GDT_BYTE
59 #ifdef __i386__
60 .long gdt_table - FIRST_RESERVED_GDT_BYTE - __PAGE_OFFSET
61 #else
62 .long 0x101000 - FIRST_RESERVED_GDT_BYTE
63 #endif
65 ENTRY(trampoline_end)
67 #endif /* CONFIG_SMP */