diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2011-02-12 15:11:32 +1100 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2011-02-12 15:11:32 +1100 |
commit | 0c24c9cc71cb3e0976a4806d57450e79b349fb40 (patch) | |
tree | 6a4cddc7fd1e317dab27889a22ad50f7013e7879 /arch/i386/cpu/cpu.c | |
parent | c53fd2bb6dc63c10fd2817f3041de24fd277255b (diff) | |
download | bootable_bootloader_goldelico_gta04-0c24c9cc71cb3e0976a4806d57450e79b349fb40.zip bootable_bootloader_goldelico_gta04-0c24c9cc71cb3e0976a4806d57450e79b349fb40.tar.gz bootable_bootloader_goldelico_gta04-0c24c9cc71cb3e0976a4806d57450e79b349fb40.tar.bz2 |
x86: Add processor flags header from linux
Diffstat (limited to 'arch/i386/cpu/cpu.c')
-rw-r--r-- | arch/i386/cpu/cpu.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/i386/cpu/cpu.c b/arch/i386/cpu/cpu.c index 1dcbb98..e96380a 100644 --- a/arch/i386/cpu/cpu.c +++ b/arch/i386/cpu/cpu.c @@ -36,6 +36,7 @@ #include <common.h> #include <command.h> #include <asm/processor.h> +#include <asm/processor-flags.h> #include <asm/interrupt.h> /* Constructor for a conventional segment GDT (or LDT) entry */ @@ -88,12 +89,16 @@ static void reload_gdt(void) int cpu_init_f(void) { + const u32 em_rst = ~X86_CR0_EM; + const u32 mp_ne_set = X86_CR0_MP | X86_CR0_NE; + /* initialize FPU, reset EM, set MP and NE */ asm ("fninit\n" \ - "movl %cr0, %eax\n" \ - "andl $~0x4, %eax\n" \ - "orl $0x22, %eax\n" \ - "movl %eax, %cr0\n" ); + "movl %%cr0, %%eax\n" \ + "andl %0, %%eax\n" \ + "orl %1, %%eax\n" \ + "movl %%eax, %%cr0\n" \ + : : "i" (em_rst), "i" (mp_ne_set) : "eax"); return 0; } |