ia64/xen-unstable
changeset 16572:207ad1afe9bb
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>
* 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>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Dec 10 11:34:02 2007 +0000 (2007-12-10) |
parents | d571fb2a1c0d |
children | 38a45b7c6cb5 |
files | xen/arch/x86/boot/head.S xen/arch/x86/boot/trampoline.S xen/arch/x86/boot/video.S xen/arch/x86/boot/wakeup.S |
line diff
1.1 --- a/xen/arch/x86/boot/head.S Sat Dec 08 17:35:32 2007 +0000 1.2 +++ b/xen/arch/x86/boot/head.S Mon Dec 10 11:34:02 2007 +0000 1.3 @@ -168,7 +168,7 @@ 1: stosl /* low mappings cover up 1.4 mov $trampoline_end - trampoline_start,%ecx 1.5 rep movsb 1.6 1.7 - mov $0x90000,%esp 1.8 + mov $bootsym_phys(early_stack),%esp 1.9 call cmdline_parse_early 1.10 1.11 /* Jump into the relocated trampoline. */ 1.12 @@ -180,7 +180,6 @@ 1: stosl /* low mappings cover up 1.13 .globl trampoline_start, trampoline_end 1.14 trampoline_start: 1.15 #include "trampoline.S" 1.16 -#include "wakeup.S" 1.17 trampoline_end: 1.18 1.19 .text
2.1 --- a/xen/arch/x86/boot/trampoline.S Sat Dec 08 17:35:32 2007 +0000 2.2 +++ b/xen/arch/x86/boot/trampoline.S Mon Dec 10 11:34:02 2007 +0000 2.3 @@ -150,8 +150,8 @@ 1: mov $(BOOT_TRAMPOLINE>>4),%a 2.4 mov %ax,%es 2.5 mov %ax,%ss 2.6 2.7 - /* Stack grows down from +0x3000. Initialise IDT and enable irqs. */ 2.8 - mov $0x3000,%sp 2.9 + /* Initialise stack pointer and IDT, and enable irqs. */ 2.10 + mov $bootsym(early_stack),%sp 2.11 lidt bootsym(rm_idt) 2.12 sti 2.13 2.14 @@ -202,3 +202,8 @@ rm_idt: .word 256*4-1, 0, 0 2.15 #include "mem.S" 2.16 #include "edd.S" 2.17 #include "video.S" 2.18 +#include "wakeup.S" 2.19 + 2.20 + .align 16 2.21 + .fill PAGE_SIZE,1,0 2.22 +early_stack:
3.1 --- a/xen/arch/x86/boot/video.S Sat Dec 08 17:35:32 2007 +0000 3.2 +++ b/xen/arch/x86/boot/video.S Mon Dec 10 11:34:02 2007 +0000 3.3 @@ -15,8 +15,8 @@ 3.4 3.5 #include "video.h" 3.6 3.7 -/* Scratch space layout: +0x3000 to +0x4000. */ 3.8 -#define modelist (0x3000) /* 2kB (256 entries) */ 3.9 +/* Scratch space layout: trampoline_end to trampoline_end+0x1000. */ 3.10 +#define modelist bootsym(trampoline_end) /* 2kB (256 entries) */ 3.11 #define vesa_glob_info (modelist + 0x800) /* 1kB */ 3.12 #define vesa_mode_info (vesa_glob_info + 0x400) /* 1kB */ 3.13
4.1 --- a/xen/arch/x86/boot/wakeup.S Sat Dec 08 17:35:32 2007 +0000 4.2 +++ b/xen/arch/x86/boot/wakeup.S Mon Dec 10 11:34:02 2007 +0000 4.3 @@ -1,12 +1,9 @@ 4.4 .code16 4.5 4.6 -#undef wakesym 4.7 -/* Used in real mode, to cal offset in current segment */ 4.8 #define wakesym(sym) (sym - wakeup_start) 4.9 4.10 + .align 16 4.11 ENTRY(wakeup_start) 4.12 - wakeup_code_start = . 4.13 - 4.14 cli 4.15 cld 4.16 4.17 @@ -14,7 +11,7 @@ ENTRY(wakeup_start) 4.18 movw %cs, %ax 4.19 movw %ax, %ds 4.20 movw %ax, %ss # A stack required for BIOS call 4.21 - movw $wakesym(wakeup_stack), %sp 4.22 + movw $wakesym(early_stack), %sp 4.23 4.24 pushl $0 # Kill dangerous flag early 4.25 popfl 4.26 @@ -117,7 +114,7 @@ wakeup_32: 4.27 mov $BOOT_DS, %eax 4.28 mov %eax, %ds 4.29 mov %eax, %ss 4.30 - mov $bootsym_phys(wakeup_stack), %esp 4.31 + mov $bootsym_phys(early_stack), %esp 4.32 4.33 # check saved magic again 4.34 mov $sym_phys(saved_magic), %eax 4.35 @@ -203,10 +200,3 @@ ret_point: 4.36 bogus_saved_magic: 4.37 movw $0x0e00 + 'S', 0xb8014 4.38 jmp bogus_saved_magic 4.39 - 4.40 - .align 16 4.41 -wakeup_stack_begin: # Stack grows down 4.42 - 4.43 - .fill PAGE_SIZE,1,0 4.44 -wakeup_stack: # Just below end of first page in this section 4.45 -ENTRY(wakeup_end)