aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorBin Meng2019-01-31 08:22:14 -0800
committerBin Meng2019-02-12 14:37:17 +0800
commitbc1a8f0d7a57fbc1b0c03f323412a56761c82240 (patch)
treed498668956511d20d2d9a746f4e94cfe79725f3d /arch/x86
parent916832603762847afcf112152473d305f7c502e3 (diff)
x86: Use the existing GDT in the ROM for 64-bit U-Boot proper
It is unnecessary to use a RAM version GDT for 64-bit U-Boot proper. In fact we can just use the ROM version directly, which not only eliminates the risk of being overwritten by application, but also removes the complexity of patching the cpu_call64(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/cpu/i386/cpu.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index e4b551452d6..3bde44ebf53 100644
--- a/arch/x86/cpu/i386/cpu.c
+++ b/arch/x86/cpu/i386/cpu.c
@@ -535,23 +535,9 @@ int cpu_jump_to_64bit_uboot(ulong target)
printf("Failed to allocate the cpu_call64 stub\n");
return -ENOMEM;
}
- char *gdt = (char *)0x3100000;
-
- extern char gdt64[];
-
memcpy(ptr, cpu_call64, call64_stub_size);
- memcpy(gdt, gdt64, 0x100);
- /*
- * TODO(sjg@chromium.org): This manually inserts the pointers into
- * the code. Tidy this up to avoid this.
- */
func = (func_t)ptr;
- ulong ofs = (ulong)cpu_call64 - (ulong)ptr;
- *(ulong *)(ptr + 7) = (ulong)gdt;
- *(ulong *)(ptr + 0xc) = (ulong)gdt + 2;
- *(ulong *)(ptr + 0x13) = (ulong)gdt;
- *(ulong *)(ptr + 0x117 - 0xd4) -= ofs;
/*
* Copy U-Boot from ROM