diff options
author | Edgar Hucek <hostmaster@ed-soft.at> | 2006-03-06 18:42:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-06 21:40:45 -0500 |
commit | e8c3b5a6faf50b426cd8d06912a52e24837a73ad (patch) | |
tree | f451afcabdb67cf19f5590d6265b23c2dea918d4 /arch/i386/kernel/efi.c | |
parent | 397874dfe9862b494e1fdcd2baef4ac432d224c8 (diff) |
[PATCH] EFI: Fix gdt load
This patch makes the kernel bootable again on ia32 EFI systems.
Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/efi.c')
-rw-r--r-- | arch/i386/kernel/efi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index e3e42fd62401..c9cad7ba0d2d 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c | |||
@@ -70,10 +70,13 @@ static void efi_call_phys_prelog(void) | |||
70 | { | 70 | { |
71 | unsigned long cr4; | 71 | unsigned long cr4; |
72 | unsigned long temp; | 72 | unsigned long temp; |
73 | struct Xgt_desc_struct *cpu_gdt_descr; | ||
73 | 74 | ||
74 | spin_lock(&efi_rt_lock); | 75 | spin_lock(&efi_rt_lock); |
75 | local_irq_save(efi_rt_eflags); | 76 | local_irq_save(efi_rt_eflags); |
76 | 77 | ||
78 | cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0); | ||
79 | |||
77 | /* | 80 | /* |
78 | * If I don't have PSE, I should just duplicate two entries in page | 81 | * If I don't have PSE, I should just duplicate two entries in page |
79 | * directory. If I have PSE, I just need to duplicate one entry in | 82 | * directory. If I have PSE, I just need to duplicate one entry in |
@@ -103,18 +106,17 @@ static void efi_call_phys_prelog(void) | |||
103 | */ | 106 | */ |
104 | local_flush_tlb(); | 107 | local_flush_tlb(); |
105 | 108 | ||
106 | per_cpu(cpu_gdt_descr, 0).address = | 109 | cpu_gdt_descr->address = __pa(cpu_gdt_descr->address); |
107 | __pa(per_cpu(cpu_gdt_descr, 0).address); | 110 | load_gdt(cpu_gdt_descr); |
108 | load_gdt((struct Xgt_desc_struct *)__pa(&per_cpu(cpu_gdt_descr, 0))); | ||
109 | } | 111 | } |
110 | 112 | ||
111 | static void efi_call_phys_epilog(void) | 113 | static void efi_call_phys_epilog(void) |
112 | { | 114 | { |
113 | unsigned long cr4; | 115 | unsigned long cr4; |
116 | struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0); | ||
114 | 117 | ||
115 | per_cpu(cpu_gdt_descr, 0).address = | 118 | cpu_gdt_descr->address = __va(cpu_gdt_descr->address); |
116 | (unsigned long)__va(per_cpu(cpu_gdt_descr, 0).address); | 119 | load_gdt(cpu_gdt_descr); |
117 | load_gdt((struct Xgt_desc_struct *)__va(&per_cpu(cpu_gdt_descr, 0))); | ||
118 | 120 | ||
119 | cr4 = read_cr4(); | 121 | cr4 = read_cr4(); |
120 | 122 | ||