summaryrefslogtreecommitdiff
path: root/arch/x86/cpu
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-10-07 20:19:09 -0700
committerSimon Glass <sjg@chromium.org>2015-10-21 07:46:25 -0600
commit19038e1bb629a365aaf971a65744e2f0e8866d62 (patch)
tree2c9b02a3a1cdaf0d5e6243eef59eb2c13b482b30 /arch/x86/cpu
parent1f124eba11cb1619e6d575770756230484e47bf7 (diff)
downloadu-boot-imx-19038e1bb629a365aaf971a65744e2f0e8866d62.zip
u-boot-imx-19038e1bb629a365aaf971a65744e2f0e8866d62.tar.gz
u-boot-imx-19038e1bb629a365aaf971a65744e2f0e8866d62.tar.bz2
x86: Initialize GDT entry 1 to be the 32-bit CS as well
Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Jian Luo <jian.luo4@boschrexroth.de>
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r--arch/x86/cpu/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 1b76ca1..812c5e4 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -142,7 +142,12 @@ void arch_setup_gd(gd_t *new_gd)
gdt_addr = new_gd->arch.gdt;
- /* CS: code, read/execute, 4 GB, base 0 */
+ /*
+ * CS: code, read/execute, 4 GB, base 0
+ *
+ * Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS
+ */
+ gdt_addr[X86_GDT_ENTRY_UNUSED] = GDT_ENTRY(0xc09b, 0, 0xfffff);
gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff);
/* DS: data, read/write, 4 GB, base 0 */