Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cleanup.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/smp.h>
#include <linux/cpu.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>
#include <linux/kvm_para.h>
#include <linux/range.h>
#include <asm/processor.h>
#include <asm/e820.h>
#include <asm/mtrr.h>
#include <asm/msr.h>
#include "mtrr.h"

Go to the source code of this file.

Data Structures

struct  var_mtrr_range_state
 
struct  var_mtrr_state
 

Macros

#define RANGE_NUM   256
 
#define Dprintk(x...)   do { if (debug_print) printk(KERN_DEBUG x); } while (0)
 
#define BIOS_BUG_MSG
 
#define Tom2Enabled   (1U << 21)
 
#define Tom2ForceMemTypeWB   (1U << 22)
 

Functions

int __init mtrr_cleanup (unsigned address_bits)
 
 early_param ("disable_mtrr_trim", disable_mtrr_trim_setup)
 
int __init amd_special_default_mtrr (void)
 
int __init mtrr_trim_uncached_memory (unsigned long end_pfn)
 

Macro Definition Documentation

#define BIOS_BUG_MSG
Value:
"WARNING: BIOS bug: VAR MTRR %d contains strange UC entry under 1M, check with your system vendor!\n"

Definition at line 62 of file cleanup.c.

#define Dprintk (   x...)    do { if (debug_print) printk(KERN_DEBUG x); } while (0)

Definition at line 60 of file cleanup.c.

#define RANGE_NUM   256

Definition at line 52 of file cleanup.c.

#define Tom2Enabled   (1U << 21)

Definition at line 821 of file cleanup.c.

#define Tom2ForceMemTypeWB   (1U << 22)

Definition at line 822 of file cleanup.c.

Function Documentation

int __init amd_special_default_mtrr ( void  )

Definition at line 824 of file cleanup.c.

early_param ( "disable_mtrr_trim"  ,
disable_mtrr_trim_setup   
)
int __init mtrr_cleanup ( unsigned  address_bits)

Definition at line 800 of file cleanup.c.

int __init mtrr_trim_uncached_memory ( unsigned long  end_pfn)

mtrr_trim_uncached_memory - trim RAM not covered by MTRRs : ending page frame number

Some buggy BIOSes don't setup the MTRRs properly for systems with certain memory configurations. This routine checks that the highest MTRR matches the end of memory, to make sure the MTRRs having a write back type cover all of the memory the kernel is intending to use. If not, it'll trim any memory off the end by adjusting end_pfn, removing it from the kernel's allocation pools, warning the user with an obnoxious message.

Definition at line 871 of file cleanup.c.