aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/relocate_kernel_64.S
diff options
context:
space:
mode:
authorgorcunov@gmail.com <gorcunov@gmail.com>2008-03-22 17:00:08 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:29 -0400
commitfd3af53122e616c0ddba44a3da6d1c1877f72d29 (patch)
tree34f1d9d653087ae76e528186c288dd5507f5afe0 /arch/x86/kernel/relocate_kernel_64.S
parenta7bba17bf09e1c5bdbdd6c0ab0c7833baedf4653 (diff)
x86: relocate_kernel - use predefined macroses for processor state
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/relocate_kernel_64.S')
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S32
1 files changed, 11 insertions, 21 deletions
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index c2c8b9d6e24..0c93a945b32 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -9,6 +9,7 @@
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/kexec.h> 11#include <asm/kexec.h>
12#include <asm/processor-flags.h>
12 13
13/* 14/*
14 * Must be relocatable PIC code callable as a C function 15 * Must be relocatable PIC code callable as a C function
@@ -171,33 +172,22 @@ identity_mapped:
171 pushq %rdx 172 pushq %rdx
172 173
173 /* Set cr0 to a known state: 174 /* Set cr0 to a known state:
174 * 31 1 == Paging enabled 175 * - Paging enabled
175 * 18 0 == Alignment check disabled 176 * - Alignment check disabled
176 * 16 0 == Write protect disabled 177 * - Write protect disabled
177 * 3 0 == No task switch 178 * - No task switch
178 * 2 0 == Don't do FP software emulation. 179 * - Don't do FP software emulation.
179 * 0 1 == Proctected mode enabled 180 * - Proctected mode enabled
180 */ 181 */
181 movq %cr0, %rax 182 movq %cr0, %rax
182 andq $~((1<<18)|(1<<16)|(1<<3)|(1<<2)), %rax 183 andq $~(X86_CR0_AM | X86_CR0_WP | X86_CR0_TS | X86_CR0_EM), %rax
183 orl $((1<<31)|(1<<0)), %eax 184 orl $(X86_CR0_PG | X86_CR0_PE), %eax
184 movq %rax, %cr0 185 movq %rax, %cr0
185 186
186 /* Set cr4 to a known state: 187 /* Set cr4 to a known state:
187 * 10 0 == xmm exceptions disabled 188 * - physical address extension enabled
188 * 9 0 == xmm registers instructions disabled
189 * 8 0 == performance monitoring counter disabled
190 * 7 0 == page global disabled
191 * 6 0 == machine check exceptions disabled
192 * 5 1 == physical address extension enabled
193 * 4 0 == page size extensions disabled
194 * 3 0 == Debug extensions disabled
195 * 2 0 == Time stamp disable (disabled)
196 * 1 0 == Protected mode virtual interrupts disabled
197 * 0 0 == VME disabled
198 */ 189 */
199 190 movq $X86_CR4_PAE, %rax
200 movq $((1<<5)), %rax
201 movq %rax, %cr4 191 movq %rax, %cr4
202 192
203 jmp 1f 193 jmp 1f