Commit 7ebad705 authored by Dave Jones's avatar Dave Jones Committed by Ingo Molnar

x86: use CR0 defines.

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3578facf
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/utsname.h> #include <linux/utsname.h>
#include <asm/bugs.h> #include <asm/bugs.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/processor-flags.h>
#include <asm/i387.h> #include <asm/i387.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/paravirt.h> #include <asm/paravirt.h>
...@@ -35,7 +36,7 @@ __setup("mca-pentium", mca_pentium); ...@@ -35,7 +36,7 @@ __setup("mca-pentium", mca_pentium);
static int __init no_387(char *s) static int __init no_387(char *s)
{ {
boot_cpu_data.hard_math = 0; boot_cpu_data.hard_math = 0;
write_cr0(0xE | read_cr0()); write_cr0(X86_CR0_TS | X86_CR0_EM | X86_CR0_MP | read_cr0());
return 1; return 1;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/processor-cyrix.h> #include <asm/processor-cyrix.h>
#include <asm/processor-flags.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/pci-direct.h> #include <asm/pci-direct.h>
#include <asm/tsc.h> #include <asm/tsc.h>
...@@ -126,15 +127,12 @@ static void __cpuinit set_cx86_reorder(void) ...@@ -126,15 +127,12 @@ static void __cpuinit set_cx86_reorder(void)
static void __cpuinit set_cx86_memwb(void) static void __cpuinit set_cx86_memwb(void)
{ {
u32 cr0;
printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n");
/* CCR2 bit 2: unlock NW bit */ /* CCR2 bit 2: unlock NW bit */
setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04); setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04);
/* set 'Not Write-through' */ /* set 'Not Write-through' */
cr0 = 0x20000000; write_cr0(read_cr0() | X86_CR0_NW);
write_cr0(read_cr0() | cr0);
/* CCR2 bit 2: lock NW bit and set WT1 */ /* CCR2 bit 2: lock NW bit and set WT1 */
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 ); setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/processor-cyrix.h> #include <asm/processor-cyrix.h>
#include <asm/processor-flags.h>
#include "mtrr.h" #include "mtrr.h"
int arr3_protected; int arr3_protected;
...@@ -142,7 +143,7 @@ static void prepare_set(void) ...@@ -142,7 +143,7 @@ static void prepare_set(void)
/* Disable and flush caches. Note that wbinvd flushes the TLBs as /* Disable and flush caches. Note that wbinvd flushes the TLBs as
a side-effect */ a side-effect */
cr0 = read_cr0() | 0x40000000; cr0 = read_cr0() | X86_CR0_CD;
wbinvd(); wbinvd();
write_cr0(cr0); write_cr0(cr0);
wbinvd(); wbinvd();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include <asm/processor-flags.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include "mtrr.h" #include "mtrr.h"
...@@ -350,7 +351,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock) ...@@ -350,7 +351,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock)
spin_lock(&set_atomicity_lock); spin_lock(&set_atomicity_lock);
/* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */ /* Enter the no-fill (CD=1, NW=0) cache mode and flush caches. */
cr0 = read_cr0() | 0x40000000; /* set CD flag */ cr0 = read_cr0() | X86_CR0_CD;
write_cr0(cr0); write_cr0(cr0);
wbinvd(); wbinvd();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <asm/mtrr.h> #include <asm/mtrr.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/processor-cyrix.h> #include <asm/processor-cyrix.h>
#include <asm/processor-flags.h>
#include "mtrr.h" #include "mtrr.h"
...@@ -25,7 +26,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt) ...@@ -25,7 +26,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
/* Disable and flush caches. Note that wbinvd flushes the TLBs as /* Disable and flush caches. Note that wbinvd flushes the TLBs as
a side-effect */ a side-effect */
cr0 = read_cr0() | 0x40000000; cr0 = read_cr0() | X86_CR0_CD;
wbinvd(); wbinvd();
write_cr0(cr0); write_cr0(cr0);
wbinvd(); wbinvd();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment