coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mtrrlib.c File Reference
#include <cpu/cpu.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
#include <console/console.h>
Include dependency graph for mtrrlib.c:

Go to the source code of this file.

Functions

int get_free_var_mtrr (void)
 
void set_var_mtrr (unsigned int reg, unsigned int base, unsigned int size, unsigned int type)
 
void clear_all_var_mtrr (void)
 

Function Documentation

◆ clear_all_var_mtrr()

void clear_all_var_mtrr ( void  )

Definition at line 53 of file mtrrlib.c.

References get_var_mtrr_count(), MTRR_PHYS_BASE, MTRR_PHYS_MASK, and wrmsr().

Referenced by early_cache_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_free_var_mtrr()

int get_free_var_mtrr ( void  )

Definition at line 11 of file mtrrlib.c.

References get_var_mtrr_count(), msr_struct::lo, MTRR_PHYS_MASK, MTRR_PHYS_MASK_VALID, and rdmsr().

Referenced by fast_spi_enable_cache_range(), and platform_prog_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_var_mtrr()

void set_var_mtrr ( unsigned int  reg,
unsigned int  base,
unsigned int  size,
unsigned int  type 
)

Definition at line 30 of file mtrrlib.c.

References base, BIOS_ERR, cpu_phys_address_size(), msr_struct::hi, IS_POWER_OF_2, KiB, msr_struct::lo, MTRR_PHYS_BASE, MTRR_PHYS_MASK, MTRR_PHYS_MASK_VALID, printk, type, and wrmsr().

Referenced by amd_initmmio(), fast_spi_enable_cache_range(), platform_prog_run(), and set_early_mtrrs().

Here is the call graph for this function:
Here is the caller graph for this function: