[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/23] x86/boot: use %ecx instead of %eax
From: |
Daniel Kiper |
Subject: |
[PATCH v2 06/23] x86/boot: use %ecx instead of %eax |
Date: |
Mon, 20 Jul 2015 16:29:01 +0200 |
Use %ecx instead of %eax to store low memory upper limit from EBDA.
This way we do not wipe multiboot protocol identifier. It is needed
in reloc() to differentiate between multiboot (v1) and
multiboot2 protocol.
Signed-off-by: Daniel Kiper <address@hidden>
Reviewed-by: Andrew Cooper <address@hidden>
---
xen/arch/x86/boot/head.S | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 3cbb2e6..77e7da9 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -87,14 +87,14 @@ __start:
jne not_multiboot
/* Set up trampoline segment 64k below EBDA */
- movzwl 0x40e,%eax /* EBDA segment */
- cmp $0xa000,%eax /* sanity check (high) */
+ movzwl 0x40e,%ecx /* EBDA segment */
+ cmp $0xa000,%ecx /* sanity check (high) */
jae 0f
- cmp $0x4000,%eax /* sanity check (low) */
+ cmp $0x4000,%ecx /* sanity check (low) */
jae 1f
0:
- movzwl 0x413,%eax /* use base memory size on failure */
- shl $10-4,%eax
+ movzwl 0x413,%ecx /* use base memory size on failure */
+ shl $10-4,%ecx
1:
/*
* Compare the value in the BDA with the information from the
@@ -106,21 +106,21 @@ __start:
cmp $0x100,%edx /* is the multiboot value too small? */
jb 2f /* if so, do not use it */
shl $10-4,%edx
- cmp %eax,%edx /* compare with BDA value */
- cmovb %edx,%eax /* and use the smaller */
+ cmp %ecx,%edx /* compare with BDA value */
+ cmovb %edx,%ecx /* and use the smaller */
2: /* Reserve 64kb for the trampoline */
- sub $0x1000,%eax
+ sub $0x1000,%ecx
/* From arch/x86/smpboot.c: start_eip had better be page-aligned! */
- xor %al, %al
- shl $4, %eax
- mov %eax,sym_phys(trampoline_phys)
+ xor %cl, %cl
+ shl $4, %ecx
+ mov %ecx,sym_phys(trampoline_phys)
/* Save the Multiboot info struct (after relocation) for later use. */
mov $sym_phys(cpu0_stack)+1024,%esp
push %ebx /* Multiboot information address. */
- push %eax /* Boot trampoline address. */
+ push %ecx /* Boot trampoline address. */
call reloc
add $8,%esp /* Remove reloc() args from stack. */
mov %eax,sym_phys(multiboot_ptr)
--
1.7.10.4
- [PATCH v2 00/23] x86: multiboot2 protocol support, Daniel Kiper, 2015/07/20
- [PATCH v2 01/23] x86/boot: remove unneeded instruction, Daniel Kiper, 2015/07/20
- [PATCH v2 04/23] x86/boot: call reloc() using cdecl calling convention, Daniel Kiper, 2015/07/20
- [PATCH v2 03/23] x86: zero BSS using stosl instead of stosb, Daniel Kiper, 2015/07/20
- [PATCH v2 07/23] x86/boot/reloc: Rename some variables and rearrange code a bit, Daniel Kiper, 2015/07/20
- [PATCH v2 06/23] x86/boot: use %ecx instead of %eax,
Daniel Kiper <=
- [PATCH v2 05/23] x86/boot/reloc: create generic alloc and copy functions, Daniel Kiper, 2015/07/20
- [PATCH v2 08/23] x86: add multiboot2 protocol support, Daniel Kiper, 2015/07/20
- [PATCH v2 11/23] efi: split out efi_init(), Daniel Kiper, 2015/07/20
- [PATCH v2 12/23] efi: split out efi_console_set_mode(), Daniel Kiper, 2015/07/20
- [PATCH v2 02/23] x86/boot: copy only text section from *.lnk file to *.bin file, Daniel Kiper, 2015/07/20
- [PATCH v2 13/23] efi: split out efi_get_gop(), Daniel Kiper, 2015/07/20
- [PATCH v2 16/23] efi: split out efi_variables(), Daniel Kiper, 2015/07/20
- [PATCH v2 19/23] x86/efi: create new early memory allocator, Daniel Kiper, 2015/07/20
- [PATCH v2 18/23] efi: split out efi_exit_boot(), Daniel Kiper, 2015/07/20
- [PATCH v2 21/23] x86/boot: implement early command line parser in C, Daniel Kiper, 2015/07/20