aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mtrr/generic.c
diff options
context:
space:
mode:
authorPaul Jimenez <pj@place.org>2008-01-30 07:30:31 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:31 -0500
commit2d2ee8de5f6d26ef2942e0b449aa68d9236d5777 (patch)
tree09589fa4f7386b9bc2c0ac07aa5a272396286d35 /arch/x86/kernel/cpu/mtrr/generic.c
parent3e7593966be6f6d29a15138c0c96b961d437f2f5 (diff)
x86: mtrr use type bool [RESEND AGAIN]
This is a janitorish patch to 1) remove private TRUE/FALSE #def's in favor of using the standard enum from linux/stddef.h and 2) switch the variables holding those values to type 'bool' (from linux/types.h) since it both seems more appropriate and allows for potentially better optimization. As a truly minor aside, I removed a couple of comments documenting a 'do_safe' parameter that seems to no longer exist. Signed-off-by: Paul Jimenez <pj@place.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/mtrr/generic.c')
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 992f08dfbb6c..1c331c373a43 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -188,7 +188,7 @@ static inline void k8_enable_fixed_iorrs(void)
188 * \param changed pointer which indicates whether the MTRR needed to be changed 188 * \param changed pointer which indicates whether the MTRR needed to be changed
189 * \param msrwords pointer to the MSR values which the MSR should have 189 * \param msrwords pointer to the MSR values which the MSR should have
190 */ 190 */
191static void set_fixed_range(int msr, int * changed, unsigned int * msrwords) 191static void set_fixed_range(int msr, bool *changed, unsigned int *msrwords)
192{ 192{
193 unsigned lo, hi; 193 unsigned lo, hi;
194 194
@@ -200,7 +200,7 @@ static void set_fixed_range(int msr, int * changed, unsigned int * msrwords)
200 ((msrwords[0] | msrwords[1]) & K8_MTRR_RDMEM_WRMEM_MASK)) 200 ((msrwords[0] | msrwords[1]) & K8_MTRR_RDMEM_WRMEM_MASK))
201 k8_enable_fixed_iorrs(); 201 k8_enable_fixed_iorrs();
202 mtrr_wrmsr(msr, msrwords[0], msrwords[1]); 202 mtrr_wrmsr(msr, msrwords[0], msrwords[1]);
203 *changed = TRUE; 203 *changed = true;
204 } 204 }
205} 205}
206 206
@@ -260,7 +260,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
260static int set_fixed_ranges(mtrr_type * frs) 260static int set_fixed_ranges(mtrr_type * frs)
261{ 261{
262 unsigned long long *saved = (unsigned long long *) frs; 262 unsigned long long *saved = (unsigned long long *) frs;
263 int changed = FALSE; 263 bool changed = false;
264 int block=-1, range; 264 int block=-1, range;
265 265
266 while (fixed_range_blocks[++block].ranges) 266 while (fixed_range_blocks[++block].ranges)
@@ -273,17 +273,17 @@ static int set_fixed_ranges(mtrr_type * frs)
273 273
274/* Set the MSR pair relating to a var range. Returns TRUE if 274/* Set the MSR pair relating to a var range. Returns TRUE if
275 changes are made */ 275 changes are made */
276static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr) 276static bool set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
277{ 277{
278 unsigned int lo, hi; 278 unsigned int lo, hi;
279 int changed = FALSE; 279 bool changed = false;
280 280
281 rdmsr(MTRRphysBase_MSR(index), lo, hi); 281 rdmsr(MTRRphysBase_MSR(index), lo, hi);
282 if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL) 282 if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL)
283 || (vr->base_hi & (size_and_mask >> (32 - PAGE_SHIFT))) != 283 || (vr->base_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
284 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) { 284 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
285 mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi); 285 mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi);
286 changed = TRUE; 286 changed = true;
287 } 287 }
288 288
289 rdmsr(MTRRphysMask_MSR(index), lo, hi); 289 rdmsr(MTRRphysMask_MSR(index), lo, hi);
@@ -292,7 +292,7 @@ static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
292 || (vr->mask_hi & (size_and_mask >> (32 - PAGE_SHIFT))) != 292 || (vr->mask_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
293 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) { 293 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
294 mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi); 294 mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi);
295 changed = TRUE; 295 changed = true;
296 } 296 }
297 return changed; 297 return changed;
298} 298}
@@ -417,8 +417,6 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base,
417 <base> The base address of the region. 417 <base> The base address of the region.
418 <size> The size of the region. If this is 0 the region is disabled. 418 <size> The size of the region. If this is 0 the region is disabled.
419 <type> The type of the region. 419 <type> The type of the region.
420 <do_safe> If TRUE, do the change safely. If FALSE, safety measures should
421 be done externally.
422 [RETURNS] Nothing. 420 [RETURNS] Nothing.
423*/ 421*/
424{ 422{