aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mtrr
diff options
context:
space:
mode:
authorPaolo Ciarrocchi <paolo.ciarrocchi@gmail.com>2008-02-22 17:10:16 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:49 -0400
commite0f025704437dfd6cb5adc077f05709c31189edc (patch)
tree092ce378d0ae1de341f502dd04aaf9bfb8126dab /arch/x86/kernel/cpu/mtrr
parent0067cc996ee7a0dd282d8da5b64fa60aa2066bb2 (diff)
x86: coding style fixes to arch/x86/kernel/cpu/mtrr/state.c
Before: total: 6 errors, 5 warnings, 80 lines checked After: total: 0 errors, 4 warnings, 82 lines checked No code changed: arch/x86/kernel/cpu/mtrr/state.o: text data bss dec hex filename 313 0 4 317 13d state.o.before 313 0 4 317 13d state.o.after md5: a0fbd61096205f9180f0bf45ed386d61 state.o.before.asm a0fbd61096205f9180f0bf45ed386d61 state.o.after.asm Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/mtrr')
-rw-r--r--arch/x86/kernel/cpu/mtrr/state.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/state.c b/arch/x86/kernel/cpu/mtrr/state.c
index 9f8ba923d1c9..7f7e2753685b 100644
--- a/arch/x86/kernel/cpu/mtrr/state.c
+++ b/arch/x86/kernel/cpu/mtrr/state.c
@@ -19,13 +19,15 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
19 if (use_intel() || is_cpu(CYRIX)) { 19 if (use_intel() || is_cpu(CYRIX)) {
20 20
21 /* Save value of CR4 and clear Page Global Enable (bit 7) */ 21 /* Save value of CR4 and clear Page Global Enable (bit 7) */
22 if ( cpu_has_pge ) { 22 if (cpu_has_pge) {
23 ctxt->cr4val = read_cr4(); 23 ctxt->cr4val = read_cr4();
24 write_cr4(ctxt->cr4val & ~X86_CR4_PGE); 24 write_cr4(ctxt->cr4val & ~X86_CR4_PGE);
25 } 25 }
26 26
27 /* Disable and flush caches. Note that wbinvd flushes the TLBs as 27 /*
28 a side-effect */ 28 * Disable and flush caches. Note that wbinvd flushes the TLBs
29 * as a side-effect
30 */
29 cr0 = read_cr0() | X86_CR0_CD; 31 cr0 = read_cr0() | X86_CR0_CD;
30 wbinvd(); 32 wbinvd();
31 write_cr0(cr0); 33 write_cr0(cr0);
@@ -42,7 +44,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
42 44
43void set_mtrr_cache_disable(struct set_mtrr_context *ctxt) 45void set_mtrr_cache_disable(struct set_mtrr_context *ctxt)
44{ 46{
45 if (use_intel()) 47 if (use_intel())
46 /* Disable MTRRs, and set the default type to uncached */ 48 /* Disable MTRRs, and set the default type to uncached */
47 mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL, 49 mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL,
48 ctxt->deftype_hi); 50 ctxt->deftype_hi);
@@ -66,12 +68,12 @@ void set_mtrr_done(struct set_mtrr_context *ctxt)
66 else 68 else
67 /* Cyrix ARRs - everything else was excluded at the top */ 69 /* Cyrix ARRs - everything else was excluded at the top */
68 setCx86(CX86_CCR3, ctxt->ccr3); 70 setCx86(CX86_CCR3, ctxt->ccr3);
69 71
70 /* Enable caches */ 72 /* Enable caches */
71 write_cr0(read_cr0() & 0xbfffffff); 73 write_cr0(read_cr0() & 0xbfffffff);
72 74
73 /* Restore value of CR4 */ 75 /* Restore value of CR4 */
74 if ( cpu_has_pge ) 76 if (cpu_has_pge)
75 write_cr4(ctxt->cr4val); 77 write_cr4(ctxt->cr4val);
76 } 78 }
77 /* Re-enable interrupts locally (if enabled previously) */ 79 /* Re-enable interrupts locally (if enabled previously) */