coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
postcar_loader.c File Reference
#include <arch/romstage.h>
#include <cbmem.h>
#include <console/console.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/smm.h>
#include <program_loading.h>
#include <reset.h>
#include <rmodule.h>
#include <stage_cache.h>
#include <timestamp.h>
#include <security/vboot/vboot_common.h>
Include dependency graph for postcar_loader.c:

Go to the source code of this file.

Functions

static void stack_push (struct postcar_frame *pcf, uint32_t val)
 
static void postcar_frame_prepare (struct postcar_frame *pcf)
 
int postcar_frame_init (struct postcar_frame *pcf, size_t stack_size)
 
static void postcar_var_mtrr_set (const struct var_mtrr_context *ctx, uintptr_t addr, size_t size, msr_t base, msr_t mask)
 
void postcar_frame_add_mtrr (struct postcar_frame *pcf, uintptr_t addr, size_t size, int type)
 
void postcar_frame_add_romcache (struct postcar_frame *pcf, int type)
 
static void postcar_frame_common_mtrrs (struct postcar_frame *pcf)
 
void prepare_and_run_postcar (struct postcar_frame *pcf)
 
static void postcar_commit_mtrrs (struct postcar_frame *pcf)
 
static void finalize_load (uintptr_t *stack_top_ptr, uintptr_t stack_top)
 
static void load_postcar_cbfs (struct prog *prog, struct postcar_frame *pcf)
 
void postcar_enable_tseg_cache (struct postcar_frame *pcf)
 
static void postcar_cache_invalid (void)
 
void run_postcar_phase (struct postcar_frame *pcf)
 

Function Documentation

◆ finalize_load()

static void finalize_load ( uintptr_t stack_top_ptr,
uintptr_t  stack_top 
)
static

Definition at line 118 of file postcar_loader.c.

References prog_segment_loaded(), SEG_FINAL, and stack_top.

Referenced by load_postcar_cbfs(), and run_postcar_phase().

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

◆ load_postcar_cbfs()

static void load_postcar_cbfs ( struct prog prog,
struct postcar_frame pcf 
)
static

◆ postcar_cache_invalid()

static void postcar_cache_invalid ( void  )
static

Definition at line 169 of file postcar_loader.c.

References BIOS_ERR, board_reset(), and printk.

Referenced by run_postcar_phase().

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

◆ postcar_commit_mtrrs()

static void postcar_commit_mtrrs ( struct postcar_frame pcf)
static

Definition at line 108 of file postcar_loader.c.

References postcar_frame::ctx, var_mtrr_context::max_var_mtrrs, stack_push(), and var_mtrr_context::used_var_mtrrs.

Referenced by run_postcar_phase().

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

◆ postcar_enable_tseg_cache()

void postcar_enable_tseg_cache ( struct postcar_frame pcf)

Definition at line 159 of file postcar_loader.c.

References MTRR_TYPE_WRBACK, postcar_frame_add_mtrr(), and smm_region().

Referenced by car_stage_entry(), and fill_postcar_frame().

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

◆ postcar_frame_add_mtrr()

void postcar_frame_add_mtrr ( struct postcar_frame pcf,
uintptr_t  addr,
size_t  size,
int  type 
)

Definition at line 71 of file postcar_loader.c.

References addr, postcar_frame::ctx, postcar_var_mtrr_set(), type, and var_mtrr_set_with_cb().

Referenced by car_stage_entry(), fast_spi_cache_ext_bios_postcar(), fill_postcar_frame(), postcar_enable_tseg_cache(), postcar_frame_add_romcache(), and recover_postcar_frame().

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

◆ postcar_frame_add_romcache()

void postcar_frame_add_romcache ( struct postcar_frame pcf,
int  type 
)

Definition at line 77 of file postcar_loader.c.

References CACHE_ROM_BASE, CACHE_ROM_SIZE, CONFIG, postcar_frame_add_mtrr(), and type.

Referenced by car_stage_entry(), fill_postcar_frame(), and postcar_frame_common_mtrrs().

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

◆ postcar_frame_common_mtrrs()

static void postcar_frame_common_mtrrs ( struct postcar_frame pcf)
static

Definition at line 84 of file postcar_loader.c.

References MTRR_TYPE_WRPROT, postcar_frame_add_romcache(), and postcar_frame::skip_common_mtrr.

Referenced by prepare_and_run_postcar().

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

◆ postcar_frame_init()

int postcar_frame_init ( struct postcar_frame pcf,
size_t  stack_size 
)

Definition at line 30 of file postcar_loader.c.

References BIOS_ERR, cbmem_add(), CBMEM_ID_ROMSTAGE_RAM_STACK, KiB, NULL, postcar_frame_prepare(), printk, and postcar_frame::stack.

Referenced by car_stage_entry(), prepare_and_run_postcar(), and romstage_main().

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

◆ postcar_frame_prepare()

static void postcar_frame_prepare ( struct postcar_frame pcf)
static

Definition at line 25 of file postcar_loader.c.

References postcar_frame::ctx, and var_mtrr_context_init().

Referenced by postcar_frame_init().

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

◆ postcar_var_mtrr_set()

static void postcar_var_mtrr_set ( const struct var_mtrr_context ctx,
uintptr_t  addr,
size_t  size,
msr_t  base,
msr_t  mask 
)
static

Definition at line 56 of file postcar_loader.c.

References addr, var_mtrr_context::arg, base, BIOS_DEBUG, postcar_frame::ctx, mask, printk, and stack_push().

Referenced by postcar_frame_add_mtrr().

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

◆ prepare_and_run_postcar()

void prepare_and_run_postcar ( struct postcar_frame pcf)

Definition at line 95 of file postcar_loader.c.

References die(), fill_postcar_frame(), postcar_frame_common_mtrrs(), postcar_frame_init(), and run_postcar_phase().

Referenced by romstage_main().

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

◆ run_postcar_phase()

◆ stack_push()

static void stack_push ( struct postcar_frame pcf,
uint32_t  val 
)
inlinestatic

Definition at line 16 of file postcar_loader.c.

References postcar_frame::stack, and val.

Referenced by postcar_commit_mtrrs(), and postcar_var_mtrr_set().

Here is the caller graph for this function: