coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
imd.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for imd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  imd_lookup
 
struct  imdr
 
struct  imd
 
struct  imd_cursor
 

Functions

void imd_handle_init (struct imd *imd, void *upper_limit)
 
void imd_handle_init_partial_recovery (struct imd *imd)
 
int imd_create_empty (struct imd *imd, size_t root_size, size_t entry_align)
 
int imd_create_tiered_empty (struct imd *imd, size_t lg_root_size, size_t lg_entry_align, size_t sm_root_size, size_t sm_entry_align)
 
int imd_recover (struct imd *imd)
 
int imd_limit_size (struct imd *imd, size_t max_size)
 
int imd_lockdown (struct imd *imd)
 
int imd_region_used (struct imd *imd, void **base, size_t *size)
 
const struct imd_entryimd_entry_add (const struct imd *imd, uint32_t id, size_t size)
 
const struct imd_entryimd_entry_find (const struct imd *imd, uint32_t id)
 
const struct imd_entryimd_entry_find_or_add (const struct imd *imd, uint32_t id, size_t size)
 
size_t imd_entry_size (const struct imd_entry *entry)
 
voidimd_entry_at (const struct imd *imd, const struct imd_entry *entry)
 
uint32_t imd_entry_id (const struct imd_entry *entry)
 
int imd_entry_remove (const struct imd *imd, const struct imd_entry *entry)
 
int imd_print_entries (const struct imd *imd, const struct imd_lookup *lookup, size_t size)
 
int imd_cursor_init (const struct imd *imd, struct imd_cursor *cursor)
 
const struct imd_entryimd_cursor_next (struct imd_cursor *cursor)
 

Variables

static const size_t LIMIT_ALIGN = 4096
 

Function Documentation

◆ imd_create_empty()

int imd_create_empty ( struct imd imd,
size_t  root_size,
size_t  entry_align 
)

Definition at line 386 of file imd.c.

References imdr_create_empty(), and imd::lg.

Here is the call graph for this function:

◆ imd_create_tiered_empty()

int imd_create_tiered_empty ( struct imd imd,
size_t  lg_root_size,
size_t  lg_entry_align,
size_t  sm_root_size,
size_t  sm_entry_align 
)

Definition at line 391 of file imd.c.

References ALIGN_UP, imd_handle_init(), imdr_create_empty(), imdr_entry_add(), imdr_entry_at(), imdr_limit_size(), imd::lg, imdr::limit, NULL, root_num_entries(), imd::sm, and SMALL_REGION_ID.

Referenced by cbmem_initialize_empty_id_size(), and stage_cache_create_empty().

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

◆ imd_cursor_init()

int imd_cursor_init ( const struct imd imd,
struct imd_cursor cursor 
)

Definition at line 662 of file imd.c.

References imd::lg, memset(), NULL, and imd::sm.

Referenced by cbmem_add_records_to_cbtable().

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

◆ imd_cursor_next()

const struct imd_entry* imd_cursor_next ( struct imd_cursor cursor)

Definition at line 675 of file imd.c.

References ARRAY_SIZE, imd_root::entries, imd_cursor_next(), imdr_root(), NULL, and imd_root::num_entries.

Referenced by cbmem_add_records_to_cbtable(), and imd_cursor_next().

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

◆ imd_entry_add()

const struct imd_entry* imd_entry_add ( const struct imd imd,
uint32_t  id,
size_t  size 
)

Definition at line 509 of file imd.c.

References imd_root_data_left(), imdr_entry_add(), imdr_root(), imd::lg, NULL, imd_entry::size, and imd::sm.

Referenced by imd_entry_find_or_add(), stage_cache_add(), and stage_cache_add_raw().

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

◆ imd_entry_at()

void* imd_entry_at ( const struct imd imd,
const struct imd_entry entry 
)

Definition at line 568 of file imd.c.

References imd_entry_to_imdr(), imdr_entry_at(), and NULL.

Referenced by cbmem_add(), cbmem_add_records_to_cbtable(), cbmem_entry_start(), cbmem_find(), stage_cache_add(), stage_cache_add_raw(), stage_cache_get_raw(), and stage_cache_load_stage().

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

◆ imd_entry_find()

const struct imd_entry* imd_entry_find ( const struct imd imd,
uint32_t  id 
)

Definition at line 536 of file imd.c.

References imdr_entry_find(), imd::lg, NULL, and imd::sm.

Referenced by cbmem_entry_find(), cbmem_find(), imd_entry_find_or_add(), stage_cache_get_raw(), and stage_cache_load_stage().

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

◆ imd_entry_find_or_add()

const struct imd_entry* imd_entry_find_or_add ( const struct imd imd,
uint32_t  id,
size_t  size 
)

Definition at line 550 of file imd.c.

References imd_entry_add(), imd_entry_find(), NULL, and imd_entry::size.

Referenced by cbmem_add(), and cbmem_entry_add().

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

◆ imd_entry_id()

uint32_t imd_entry_id ( const struct imd_entry entry)

Definition at line 580 of file imd.c.

References imd_entry::id.

Referenced by cbmem_add_records_to_cbtable().

Here is the caller graph for this function:

◆ imd_entry_remove()

int imd_entry_remove ( const struct imd imd,
const struct imd_entry entry 
)

Definition at line 585 of file imd.c.

References imd_entry_to_imdr(), imdr_root(), NULL, imdr::r, root_is_locked(), and root_last_entry().

Referenced by cbmem_entry_remove().

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

◆ imd_entry_size()

size_t imd_entry_size ( const struct imd_entry entry)

Definition at line 563 of file imd.c.

References imdr_entry_size().

Referenced by cbmem_add_records_to_cbtable(), cbmem_entry_size(), stage_cache_get_raw(), and stage_cache_load_stage().

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

◆ imd_handle_init()

void imd_handle_init ( struct imd imd,
void upper_limit 
)

Definition at line 352 of file imd.c.

References imdr_init(), imd::lg, NULL, and imd::sm.

Referenced by cbmem_initialize_empty_id_size(), cbmem_initialize_id_size(), imd_create_tiered_empty(), imd_handle_init_partial_recovery(), imd_recover(), stage_cache_create_empty(), and stage_cache_recover().

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

◆ imd_handle_init_partial_recovery()

void imd_handle_init_partial_recovery ( struct imd imd)

◆ imd_limit_size()

int imd_limit_size ( struct imd imd,
size_t  max_size 
)

Definition at line 458 of file imd.c.

References imdr_limit_size(), and imd::lg.

Referenced by stage_cache_create_empty().

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

◆ imd_lockdown()

int imd_lockdown ( struct imd imd)

Definition at line 463 of file imd.c.

References imd_root::flags, IMD_FLAG_LOCKED, imdr_root(), imd::lg, NULL, and imd::sm.

Referenced by cbmem_initialize_id_size().

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

◆ imd_print_entries()

int imd_print_entries ( const struct imd imd,
const struct imd_lookup lookup,
size_t  size 
)

Definition at line 647 of file imd.c.

References BIOS_DEBUG, imdr_print_entries(), imdr_root(), imd::lg, NULL, printk, imd_entry::size, and imd::sm.

Here is the call graph for this function:

◆ imd_recover()

int imd_recover ( struct imd imd)

Definition at line 428 of file imd.c.

References imd_handle_init(), imdr_entry_at(), imdr_entry_find(), imdr_entry_size(), imdr_recover(), imd::lg, imdr::limit, NULL, imd::sm, and SMALL_REGION_ID.

Referenced by cbmem_initialize_id_size(), and stage_cache_recover().

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

◆ imd_region_used()

int imd_region_used ( struct imd imd,
void **  base,
size_t size 
)

Definition at line 480 of file imd.c.

References base, imdr_root(), imd::lg, imdr::limit, NULL, relative_pointer(), root_last_entry(), imd_entry::size, and imd_entry::start_offset.

Referenced by cbmem_get_region().

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

Variable Documentation

◆ LIMIT_ALIGN

const size_t LIMIT_ALIGN = 4096
static

Definition at line 43 of file imd.h.