coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
imd_cbmem.c File Reference
#include <assert.h>
#include <boot/coreboot_tables.h>
#include <bootmem.h>
#include <console/console.h>
#include <cbmem.h>
#include <imd.h>
#include <lib.h>
#include <types.h>
Include dependency graph for imd_cbmem.c:

Go to the source code of this file.

Functions

voidcbmem_top (void)
 
static const struct cbmem_entry * imd_to_cbmem (const struct imd_entry *e)
 
static const struct imd_entrycbmem_to_imd (const struct cbmem_entry *e)
 
void cbmem_initialize_empty (void)
 
static void cbmem_top_init_once (void)
 
void cbmem_initialize_empty_id_size (u32 id, u64 size)
 
int cbmem_initialize (void)
 
int cbmem_initialize_id_size (u32 id, u64 size)
 
int cbmem_recovery (int is_wakeup)
 
const struct cbmem_entry * cbmem_entry_add (u32 id, u64 size64)
 
voidcbmem_add (u32 id, u64 size)
 
const struct cbmem_entry * cbmem_entry_find (u32 id)
 
voidcbmem_find (u32 id)
 
int cbmem_entry_remove (const struct cbmem_entry *entry)
 
u64 cbmem_entry_size (const struct cbmem_entry *entry)
 
voidcbmem_entry_start (const struct cbmem_entry *entry)
 
void cbmem_add_bootmem (void)
 
void cbmem_get_region (void **baseptr, size_t *size)
 
void cbmem_add_records_to_cbtable (struct lb_header *header)
 

Variables

uintptr_t _cbmem_top_ptr
 
static struct imd imd
 
int cbmem_initialized
 

Function Documentation

◆ cbmem_add()

◆ cbmem_add_bootmem()

void cbmem_add_bootmem ( void  )

Definition at line 195 of file imd_cbmem.c.

References BM_MEM_TABLE, bootmem_add_range(), cbmem_get_region(), NULL, and imd_entry::size.

Referenced by bootmem_init().

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

◆ cbmem_add_records_to_cbtable()

void cbmem_add_records_to_cbtable ( struct lb_header header)

◆ cbmem_entry_add()

const struct cbmem_entry* cbmem_entry_add ( u32  id,
u64  size64 
)

Definition at line 135 of file imd_cbmem.c.

References imd_entry_find_or_add(), and imd_to_cbmem().

Referenced by bmp_load_logo().

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

◆ cbmem_entry_find()

const struct cbmem_entry* cbmem_entry_find ( u32  id)

◆ cbmem_entry_remove()

int cbmem_entry_remove ( const struct cbmem_entry *  entry)

Definition at line 180 of file imd_cbmem.c.

References cbmem_to_imd(), and imd_entry_remove().

Referenced by bmp_release_logo(), and fmap_add_cbmem_cache().

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

◆ cbmem_entry_size()

u64 cbmem_entry_size ( const struct cbmem_entry *  entry)

Definition at line 185 of file imd_cbmem.c.

References cbmem_to_imd(), and imd_entry_size().

Referenced by acpi_ssdt_write_cbtable(), cbfs_boot_device_find_mcache(), fmap_register_cbmem_cache(), get_tcpa_log(), get_tpm2_log(), lb_smmstorev2(), smm_load_module(), stage_cache_get_raw(), stage_cache_load_stage(), and update_mrc_cache_from_cbmem().

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

◆ cbmem_entry_start()

void* cbmem_entry_start ( const struct cbmem_entry *  entry)

◆ cbmem_find()

◆ cbmem_get_region()

void cbmem_get_region ( void **  baseptr,
size_t size 
)

Definition at line 204 of file imd_cbmem.c.

References imd_region_used(), and imd_entry::size.

Referenced by add_cb_fdt_data(), cbmem_add_bootmem(), clear_memory(), and fill_postcar_frame().

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

◆ cbmem_initialize()

int cbmem_initialize ( void  )

Definition at line 88 of file imd_cbmem.c.

References cbmem_initialize_id_size().

Referenced by cbmem_recovery(), chipset_teardown_car_main(), and main().

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

◆ cbmem_initialize_empty()

void cbmem_initialize_empty ( void  )

Definition at line 45 of file imd_cbmem.c.

References cbmem_initialize_empty_id_size().

Referenced by cbmem_recovery(), main(), mainboard_romstage_entry(), platform_romstage_main(), and romstage().

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

◆ cbmem_initialize_empty_id_size()

void cbmem_initialize_empty_id_size ( u32  id,
u64  size 
)

◆ cbmem_initialize_id_size()

int cbmem_initialize_id_size ( u32  id,
u64  size 
)

Definition at line 93 of file imd_cbmem.c.

References cbmem_add(), cbmem_initialized, cbmem_run_init_hooks(), cbmem_top(), cbmem_top_init_once(), ENV_ROMSTAGE, imd_handle_init(), imd_lockdown(), imd_recover(), and imd_entry::size.

Referenced by cbmem_initialize(), do_fsp_post_memory_init(), and raminit().

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

◆ cbmem_recovery()

int cbmem_recovery ( int  is_wakeup)

Definition at line 125 of file imd_cbmem.c.

References cbmem_initialize(), and cbmem_initialize_empty().

Referenced by car_stage_entry(), i945_prepare_resume(), init_dram_ddr3(), mainboard_romstage_entry(), perform_raminit(), raminit(), romstage_main(), and sdram_initialize().

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

◆ cbmem_to_imd()

static const struct imd_entry* cbmem_to_imd ( const struct cbmem_entry *  e)
inlinestatic

Definition at line 40 of file imd_cbmem.c.

Referenced by cbmem_entry_remove(), cbmem_entry_size(), and cbmem_entry_start().

Here is the caller graph for this function:

◆ cbmem_top()

◆ cbmem_top_init_once()

static void cbmem_top_init_once ( void  )
static

Definition at line 50 of file imd_cbmem.c.

References cbmem_top(), ENV_ROMSTAGE, ENV_X86, and quick_ram_check_or_die().

Referenced by cbmem_initialize_empty_id_size(), and cbmem_initialize_id_size().

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

◆ imd_to_cbmem()

static const struct cbmem_entry* imd_to_cbmem ( const struct imd_entry e)
inlinestatic

Definition at line 35 of file imd_cbmem.c.

Referenced by cbmem_entry_add(), and cbmem_entry_find().

Here is the caller graph for this function:

Variable Documentation

◆ _cbmem_top_ptr

uintptr_t _cbmem_top_ptr

Definition at line 14 of file imd_cbmem.c.

Referenced by cbmem_top(), ramstage_entry(), and stage_entry().

◆ cbmem_initialized

int cbmem_initialized

◆ imd