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

Go to the source code of this file.

Functions

void var_mtrr_context_init (struct var_mtrr_context *ctx, void *arg)
 
int var_mtrr_set_with_cb (struct var_mtrr_context *ctx, uintptr_t addr, size_t size, int type, void(*callback)(const struct var_mtrr_context *ctx, uintptr_t base_addr, size_t size, msr_t base, msr_t mask))
 
static void set_mtrr (const struct var_mtrr_context *ctx, uintptr_t base_addr, size_t size, msr_t base, msr_t mask)
 
int var_mtrr_set (struct var_mtrr_context *ctx, uintptr_t addr, size_t size, int type)
 

Function Documentation

◆ set_mtrr()

static void set_mtrr ( const struct var_mtrr_context ctx,
uintptr_t  base_addr,
size_t  size,
msr_t  base,
msr_t  mask 
)
static

Definition at line 62 of file earlymtrr.c.

References base, mask, MTRR_PHYS_BASE, MTRR_PHYS_MASK, var_mtrr_context_current_mtrr(), and wrmsr().

Referenced by var_mtrr_set().

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

◆ var_mtrr_context_init()

void var_mtrr_context_init ( struct var_mtrr_context ctx,
void arg 
)

Definition at line 9 of file earlymtrr.c.

References var_mtrr_context::arg, arg, cpu_phys_address_size(), get_var_mtrr_count(), var_mtrr_context::max_var_mtrrs, var_mtrr_context::upper_mask, and var_mtrr_context::used_var_mtrrs.

Referenced by early_cache_setup(), and postcar_frame_prepare().

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

◆ var_mtrr_set()

int var_mtrr_set ( struct var_mtrr_context ctx,
uintptr_t  addr,
size_t  size,
int  type 
)

Definition at line 71 of file earlymtrr.c.

References addr, set_mtrr(), type, and var_mtrr_set_with_cb().

Referenced by early_cache_setup().

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

◆ var_mtrr_set_with_cb()

int var_mtrr_set_with_cb ( struct var_mtrr_context ctx,
uintptr_t  addr,
size_t  size,
int  type,
void(*)(const struct var_mtrr_context *ctx, uintptr_t base_addr, size_t size, msr_t base, msr_t mask callback 
)

Definition at line 17 of file earlymtrr.c.

References addr, base, BIOS_ERR, fls(), fms(), mask, var_mtrr_context::max_var_mtrrs, MTRR_PHYS_MASK_VALID, printk, type, var_mtrr_context::upper_mask, and var_mtrr_context::used_var_mtrrs.

Referenced by postcar_frame_add_mtrr(), and var_mtrr_set().

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