Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/stop_machine.h>
#include <linux/kvm_para.h>
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/init.h>
#include <linux/sort.h>
#include <linux/cpu.h>
#include <linux/pci.h>
#include <linux/smp.h>
#include <linux/syscore_ops.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 | set_mtrr_data |
struct | mtrr_value |
Macros | |
#define | DEBUG |
Functions | |
void | set_mtrr_ops (const struct mtrr_ops *ops) |
int | mtrr_add_page (unsigned long base, unsigned long size, unsigned int type, bool increment) |
int | mtrr_add (unsigned long base, unsigned long size, unsigned int type, bool increment) |
EXPORT_SYMBOL (mtrr_add) | |
int | mtrr_del_page (int reg, unsigned long base, unsigned long size) |
int | mtrr_del (int reg, unsigned long base, unsigned long size) |
EXPORT_SYMBOL (mtrr_del) | |
void __init | mtrr_bp_init (void) |
void | mtrr_ap_init (void) |
void | mtrr_save_state (void) |
void | set_mtrr_aps_delayed_init (void) |
void | mtrr_aps_init (void) |
void | mtrr_bp_restore (void) |
subsys_initcall (mtrr_init_finialize) | |
Variables | |
u32 | num_var_ranges |
unsigned int | mtrr_usage_table [MTRR_MAX_VAR_RANGES] |
u64 | size_or_mask |
u64 | size_and_mask |
struct mtrr_ops * | mtrr_if |
int __initdata | changed_by_mtrr_cleanup |
EXPORT_SYMBOL | ( | mtrr_add | ) |
EXPORT_SYMBOL | ( | mtrr_del | ) |
mtrr_add - Add a memory type region : Physical base address of region : Physical size of region : Type of MTRR desired : If this is true do usage counting on the region
Memory type region registers control the caching on newer Intel and non Intel processors. This function allows drivers to request an MTRR is added. The details and hardware specifics of each processor's implementation are hidden from the caller, but nevertheless the caller should expect to need to provide a power of two size on an equivalent power of two boundary.
If the region cannot be added either because all regions are in use or the CPU cannot support it a negative value is returned. On success the register number for this entry is returned, but should be treated as a cookie only.
On a multiprocessor machine the changes are made to all processors. This is required on x86 by the Intel processors.
The available types are
MTRR_TYPE_UNCACHABLE - No caching
MTRR_TYPE_WRBACK - Write data back in bursts whenever
MTRR_TYPE_WRCOMB - Write data back soon but allow bursts
MTRR_TYPE_WRTHROUGH - Cache reads but not writes
BUGS: Needs a quiet flag for the cases where drivers do not mind failures and do not wish system log messages to be sent.
mtrr_add_page - Add a memory type region : Physical base address of region in pages (in units of 4 kB!) : Physical size of region in pages (4 kB) : Type of MTRR desired : If this is true do usage counting on the region
Memory type region registers control the caching on newer Intel and non Intel processors. This function allows drivers to request an MTRR is added. The details and hardware specifics of each processor's implementation are hidden from the caller, but nevertheless the caller should expect to need to provide a power of two size on an equivalent power of two boundary.
If the region cannot be added either because all regions are in use or the CPU cannot support it a negative value is returned. On success the register number for this entry is returned, but should be treated as a cookie only.
On a multiprocessor machine the changes are made to all processors. This is required on x86 by the Intel processors.
The available types are
MTRR_TYPE_UNCACHABLE - No caching
MTRR_TYPE_WRBACK - Write data back in bursts whenever
MTRR_TYPE_WRCOMB - Write data back soon but allow bursts
MTRR_TYPE_WRTHROUGH - Cache reads but not writes
BUGS: Needs a quiet flag for the cases where drivers do not mind failures and do not wish system log messages to be sent.
mtrr_bp_init - initialize mtrrs on the boot CPU
This needs to be called early; before any of the other CPUs are initialized (i.e. before smp_init()).
mtrr_del - delete a memory type region : Register returned by mtrr_add : Physical base address : Size of region
If register is supplied then base and size are ignored. This is how drivers should call it.
Releases an MTRR region. If the usage count drops to zero the register is freed and the region returns to default state. On success the register is returned, on failure a negative error code.
mtrr_del_page - delete a memory type region : Register returned by mtrr_add : Physical base address : Size of region
If register is supplied then base and size are ignored. This is how drivers should call it.
Releases an MTRR region. If the usage count drops to zero the register is freed and the region returns to default state. On success the register is returned, on failure a negative error code.
subsys_initcall | ( | mtrr_init_finialize | ) |
int __initdata changed_by_mtrr_cleanup |
unsigned int mtrr_usage_table[MTRR_MAX_VAR_RANGES] |