diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2007-12-10 11:34:02 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2007-12-10 11:34:02 +0000 |
commit | efc1fcfe555c03b74846c6d11b347341a0a4bf53 (patch) | |
tree | 0328e2c91a7da79a3ea902b0e91ea8c8fc269ef5 /xen/arch/x86/boot | |
parent | 6893569268c4530128829aaa2495c2a222a63ea0 (diff) | |
download | xen-efc1fcfe555c03b74846c6d11b347341a0a4bf53.tar.gz xen-efc1fcfe555c03b74846c6d11b347341a0a4bf53.tar.bz2 xen-efc1fcfe555c03b74846c6d11b347341a0a4bf53.zip |
x86: Clean up boot/wakeup code.
* Generalise wakeup stack to general 'early stack' used everywhere.
* Ensure things that must be aligned are aligned.
* Remove some unused symbols.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/boot')
-rw-r--r-- | xen/arch/x86/boot/head.S | 3 | ||||
-rw-r--r-- | xen/arch/x86/boot/trampoline.S | 9 | ||||
-rw-r--r-- | xen/arch/x86/boot/video.S | 4 | ||||
-rw-r--r-- | xen/arch/x86/boot/wakeup.S | 16 |
4 files changed, 13 insertions, 19 deletions
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 775c89a45b..e00659f710 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -168,7 +168,7 @@ __start: mov $trampoline_end - trampoline_start,%ecx rep movsb - mov $0x90000,%esp + mov $bootsym_phys(early_stack),%esp call cmdline_parse_early /* Jump into the relocated trampoline. */ @@ -180,7 +180,6 @@ __start: .globl trampoline_start, trampoline_end trampoline_start: #include "trampoline.S" -#include "wakeup.S" trampoline_end: .text diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index 6ffaa811ef..2c92dc6a00 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -150,8 +150,8 @@ trampoline_boot_cpu_entry: mov %ax,%es mov %ax,%ss - /* Stack grows down from +0x3000. Initialise IDT and enable irqs. */ - mov $0x3000,%sp + /* Initialise stack pointer and IDT, and enable irqs. */ + mov $bootsym(early_stack),%sp lidt bootsym(rm_idt) sti @@ -202,3 +202,8 @@ rm_idt: .word 256*4-1, 0, 0 #include "mem.S" #include "edd.S" #include "video.S" +#include "wakeup.S" + + .align 16 + .fill PAGE_SIZE,1,0 +early_stack: diff --git a/xen/arch/x86/boot/video.S b/xen/arch/x86/boot/video.S index b1fe52c56c..ad6514ebf0 100644 --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -15,8 +15,8 @@ #include "video.h" -/* Scratch space layout: +0x3000 to +0x4000. */ -#define modelist (0x3000) /* 2kB (256 entries) */ +/* Scratch space layout: trampoline_end to trampoline_end+0x1000. */ +#define modelist bootsym(trampoline_end) /* 2kB (256 entries) */ #define vesa_glob_info (modelist + 0x800) /* 1kB */ #define vesa_mode_info (vesa_glob_info + 0x400) /* 1kB */ diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S index 51a6ffa07e..a986b422f8 100644 --- a/xen/arch/x86/boot/wakeup.S +++ b/xen/arch/x86/boot/wakeup.S @@ -1,12 +1,9 @@ .code16 -#undef wakesym -/* Used in real mode, to cal offset in current segment */ #define wakesym(sym) (sym - wakeup_start) + .align 16 ENTRY(wakeup_start) - wakeup_code_start = . - cli cld @@ -14,7 +11,7 @@ ENTRY(wakeup_start) movw %cs, %ax movw %ax, %ds movw %ax, %ss # A stack required for BIOS call - movw $wakesym(wakeup_stack), %sp + movw $wakesym(early_stack), %sp pushl $0 # Kill dangerous flag early popfl @@ -117,7 +114,7 @@ wakeup_32: mov $BOOT_DS, %eax mov %eax, %ds mov %eax, %ss - mov $bootsym_phys(wakeup_stack), %esp + mov $bootsym_phys(early_stack), %esp # check saved magic again mov $sym_phys(saved_magic), %eax @@ -203,10 +200,3 @@ ret_point: bogus_saved_magic: movw $0x0e00 + 'S', 0xb8014 jmp bogus_saved_magic - - .align 16 -wakeup_stack_begin: # Stack grows down - - .fill PAGE_SIZE,1,0 -wakeup_stack: # Just below end of first page in this section -ENTRY(wakeup_end) |