# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1197286442 0
# Node ID 207ad1afe9bb264431de0f6568d6c4ece88b2ef9
# Parent d571fb2a1c0d1cf5f087b72c432c6e9f007bbc23
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@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
xen/arch/x86/boot/head.S | 3 +--
xen/arch/x86/boot/trampoline.S | 9 +++++++--
xen/arch/x86/boot/video.S | 4 ++--
xen/arch/x86/boot/wakeup.S | 16 +++-------------
4 files changed, 13 insertions(+), 19 deletions(-)
diff -r d571fb2a1c0d -r 207ad1afe9bb xen/arch/x86/boot/head.S
--- a/xen/arch/x86/boot/head.S Sat Dec 08 17:35:32 2007 +0000
+++ b/xen/arch/x86/boot/head.S Mon Dec 10 11:34:02 2007 +0000
@@ -168,7 +168,7 @@ 1: stosl /* low mappings cover up
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 @@ 1: stosl /* low mappings cover up
.globl trampoline_start, trampoline_end
trampoline_start:
#include "trampoline.S"
-#include "wakeup.S"
trampoline_end:
.text
diff -r d571fb2a1c0d -r 207ad1afe9bb xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S Sat Dec 08 17:35:32 2007 +0000
+++ b/xen/arch/x86/boot/trampoline.S Mon Dec 10 11:34:02 2007 +0000
@@ -150,8 +150,8 @@ 1: mov $(BOOT_TRAMPOLINE>>4),%a
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 -r d571fb2a1c0d -r 207ad1afe9bb xen/arch/x86/boot/video.S
--- a/xen/arch/x86/boot/video.S Sat Dec 08 17:35:32 2007 +0000
+++ b/xen/arch/x86/boot/video.S Mon Dec 10 11:34:02 2007 +0000
@@ -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 -r d571fb2a1c0d -r 207ad1afe9bb xen/arch/x86/boot/wakeup.S
--- a/xen/arch/x86/boot/wakeup.S Sat Dec 08 17:35:32 2007 +0000
+++ b/xen/arch/x86/boot/wakeup.S Mon Dec 10 11:34:02 2007 +0000
@@ -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 @@ bogus_saved_magic:
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)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|