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

Go to the source code of this file.

Enumerations

enum  { MRC_TRAINING_DATA , MRC_VARIABLE_DATA }
 

Functions

ssize_t mrc_cache_load_current (int type, uint32_t version, void *buffer, size_t buffer_size)
 mrc_cache_load_current More...
 
voidmrc_cache_current_mmap_leak (int type, uint32_t version, size_t *data_size)
 mrc_cache_mmap_leak More...
 
int mrc_cache_stash_data (int type, uint32_t version, const void *data, size_t size)
 Returns < 0 on error, 0 on success. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MRC_TRAINING_DATA 
MRC_VARIABLE_DATA 

Definition at line 10 of file mrc_cache.h.

Function Documentation

◆ mrc_cache_current_mmap_leak()

void* mrc_cache_current_mmap_leak ( int  type,
uint32_t  version,
size_t data_size 
)

mrc_cache_mmap_leak

Return a pointer to a buffer with the latest slot data. An mmap will be executed (without a matching unmap). This will be a common entry point for platforms where mmap is considered a noop, like x86

Definition at line 342 of file mrc_cache.c.

References BIOS_INFO, mrc_metadata::data_size, mrc_cache_find_current(), mrc_data_valid(), NULL, printk, rdev, rdev_mmap_full(), region_device_sz(), type, and version.

Referenced by check_region_overlap(), get_cached_training(), init_dram_ddr3(), OemInitResume(), platform_fsp_memory_init_params_cb(), prepare_mrc_cache(), raminit(), raminit_common(), and sdram_initialize().

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

◆ mrc_cache_load_current()

ssize_t mrc_cache_load_current ( int  type,
uint32_t  version,
void buffer,
size_t  buffer_size 
)

mrc_cache_load_current

Fill in the buffer with the latest slot data. This will be a common entry point for ARM platforms. Returns < 0 on error, size of the returned data on success.

Definition at line 319 of file mrc_cache.c.

References buffer, mrc_metadata::data_size, mrc_cache_find_current(), mrc_data_valid(), rdev, rdev_readat(), region_device_sz(), type, and version.

Referenced by mt_mem_init_run(), and qclib_load_and_run().

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

◆ mrc_cache_stash_data()

int mrc_cache_stash_data ( int  type,
uint32_t  version,
const void data,
size_t  size 
)