Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88647
b: refs/heads/master
c: e0f0257
h: refs/heads/master
i:
  88645: 2d79cdb
  88643: 9400701
  88639: 299671c
v: v3
  • Loading branch information
Paolo Ciarrocchi authored and Ingo Molnar committed Apr 17, 2008
1 parent fcc6d1f commit 119a7c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0067cc996ee7a0dd282d8da5b64fa60aa2066bb2
refs/heads/master: e0f025704437dfd6cb5adc077f05709c31189edc
14 changes: 8 additions & 6 deletions trunk/arch/x86/kernel/cpu/mtrr/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)
if (use_intel() || is_cpu(CYRIX)) {

/* Save value of CR4 and clear Page Global Enable (bit 7) */
if ( cpu_has_pge ) {
if (cpu_has_pge) {
ctxt->cr4val = read_cr4();
write_cr4(ctxt->cr4val & ~X86_CR4_PGE);
}

/* Disable and flush caches. Note that wbinvd flushes the TLBs as
a side-effect */
/*
* Disable and flush caches. Note that wbinvd flushes the TLBs
* as a side-effect
*/
cr0 = read_cr0() | X86_CR0_CD;
wbinvd();
write_cr0(cr0);
Expand All @@ -42,7 +44,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt)

void set_mtrr_cache_disable(struct set_mtrr_context *ctxt)
{
if (use_intel())
if (use_intel())
/* Disable MTRRs, and set the default type to uncached */
mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL,
ctxt->deftype_hi);
Expand All @@ -66,12 +68,12 @@ void set_mtrr_done(struct set_mtrr_context *ctxt)
else
/* Cyrix ARRs - everything else was excluded at the top */
setCx86(CX86_CCR3, ctxt->ccr3);

/* Enable caches */
write_cr0(read_cr0() & 0xbfffffff);

/* Restore value of CR4 */
if ( cpu_has_pge )
if (cpu_has_pge)
write_cr4(ctxt->cr4val);
}
/* Re-enable interrupts locally (if enabled previously) */
Expand Down

0 comments on commit 119a7c4

Please sign in to comment.