![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <boot_device.h>
#include <fmap.h>
#include <fmap_config.h>
#include <commonlib/helpers.h>
#include <commonlib/region.h>
#include <console/console.h>
#include <smmstore.h>
#include <types.h>
Go to the source code of this file.
Macros | |
#define | SMMSTORE_REGION "SMMSTORE" |
Functions | |
_Static_assert (IS_ALIGNED(FMAP_SECTION_SMMSTORE_START, SMM_BLOCK_SIZE), "SMMSTORE FMAP region not aligned to 64K") | |
_Static_assert (SMM_BLOCK_SIZE<=FMAP_SECTION_SMMSTORE_SIZE, "SMMSTORE FMAP region must be at least 64K") | |
static enum cb_err | lookup_store_region (struct region *region) |
static int | lookup_store (struct region_device *rstore) |
int | smmstore_read_region (void *buf, ssize_t *bufsize) |
static enum cb_err | scan_end (struct region_device *store) |
int | smmstore_append_data (void *key, uint32_t key_sz, void *value, uint32_t value_sz) |
int | smmstore_clear_region (void) |
static int | smmstore_rdev_chain (struct region_device *rdev) |
int | smmstore_init (void *buf, size_t len) |
Call once before using the store. More... | |
static int | lookup_block_in_store (struct region_device *store, uint32_t block_id) |
static void * | mmap_com_buf (struct region_device *com_buf, uint32_t offset, uint32_t bufsize) |
int | smmstore_rawread_region (uint32_t block_id, uint32_t offset, uint32_t bufsize) |
Reads the specified block of the SMMSTORE and places it in the communication buffer. More... | |
int | smmstore_rawwrite_region (uint32_t block_id, uint32_t offset, uint32_t bufsize) |
Writes the specified block of the SMMSTORE by reading it from the communication buffer. More... | |
int | smmstore_rawclear_region (uint32_t block_id) |
Erases the specified block of the SMMSTORE. More... | |
Variables | |
static bool | store_initialized |
static struct region_device | mdev_com_buf |
_Static_assert | ( | IS_ALIGNED(FMAP_SECTION_SMMSTORE_START, SMM_BLOCK_SIZE) | , |
"SMMSTORE FMAP region not aligned to 64K" | |||
) |
_Static_assert | ( | SMM_BLOCK_SIZE<= | FMAP_SECTION_SMMSTORE_SIZE, |
"SMMSTORE FMAP region must be at least 64K" | |||
) |
|
static |
Definition at line 326 of file store.c.
References BIOS_ERR, lookup_store(), printk, region_device_sz(), and SMM_BLOCK_SIZE.
Referenced by smmstore_rawclear_region(), smmstore_rawread_region(), and smmstore_rawwrite_region().
|
static |
Definition at line 67 of file store.c.
References boot_device_ro_subregion(), boot_device_rw_subregion(), CB_SUCCESS, incoherent_rdev_init(), lookup_store_region(), NULL, rdev, rdev_chain(), and region_device_sz().
Referenced by lookup_block_in_store(), scan_end(), smmstore_append_data(), and smmstore_clear_region().
Definition at line 18 of file store.c.
Referenced by lookup_store().
|
static |
Definition at line 342 of file store.c.
References BIOS_ERR, NULL, offset, printk, rdev_mmap(), region_device_sz(), and smmstore_rdev_chain().
Referenced by smmstore_rawread_region(), and smmstore_rawwrite_region().
|
static |
Definition at line 97 of file store.c.
References BIOS_WARNING, buf, lookup_store(), MIN, NULL, printk, rdev_readat(), and region_device_sz().
Referenced by smmstore_append_data().
Definition at line 179 of file store.c.
References BIOS_DEBUG, BIOS_WARNING, CB_SUCCESS, lookup_store(), offset, printk, rdev_chain(), rdev_writeat(), region_device_offset(), region_device_sz(), scan_end(), and value.
Referenced by smmstorev1_exec().
int smmstore_clear_region | ( | void | ) |
Definition at line 242 of file store.c.
References BIOS_WARNING, lookup_store(), printk, rdev_eraseat(), and region_device_sz().
Referenced by smmstorev1_exec().
Call once before using the store.
In SMM this must be called through an APM SMI handler providing the communication buffer address and length.
Definition at line 278 of file store.c.
References buf, mdev_com_buf, rdev_chain_mem_rw(), SMM_BLOCK_SIZE, and store_initialized.
Referenced by smmstorev2_exec().
int smmstore_rawclear_region | ( | uint32_t | block_id | ) |
Erases the specified block of the SMMSTORE.
The communication buffer remains untouched.
block_id | The id of the block to operate on |
Definition at line 441 of file store.c.
References BIOS_ERR, lookup_block_in_store(), printk, rdev_eraseat(), and SMM_BLOCK_SIZE.
Referenced by smmstorev2_exec().
Reads the specified block of the SMMSTORE and places it in the communication buffer.
block_id | The id of the block to operate on |
offset | Offset within the block. Must be smaller than the block size. |
bufsize | Size of chunk to read within the block. Must be smaller than the block size. |
Definition at line 372 of file store.c.
References BIOS_DEBUG, lookup_block_in_store(), mmap_com_buf(), offset, printk, rdev_munmap(), rdev_readat(), and SMM_BLOCK_SIZE.
Referenced by smmstorev2_exec().
Writes the specified block of the SMMSTORE by reading it from the communication buffer.
block_id | The id of the block to operate on |
offset | Offset within the block. Must be smaller than the block size. |
bufsize | Size of chunk to read within the block. Must be smaller than the block size. |
Definition at line 406 of file store.c.
References BIOS_DEBUG, BIOS_ERR, lookup_block_in_store(), mmap_com_buf(), offset, printk, rdev_chain(), rdev_munmap(), rdev_writeat(), and SMM_BLOCK_SIZE.
Referenced by smmstorev2_exec().
|
static |
Definition at line 266 of file store.c.
References mdev_com_buf, rdev, rdev_chain_full(), and store_initialized.
Referenced by mmap_com_buf().
Definition at line 97 of file store.c.
Referenced by smmstorev1_exec().
|
static |
Definition at line 263 of file store.c.
Referenced by smmstore_init(), and smmstore_rdev_chain().
|
static |
Definition at line 263 of file store.c.
Referenced by smmstore_init(), and smmstore_rdev_chain().