coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cbfs_private.c File Reference
#include <commonlib/bsd/cbfs_private.h>
#include <assert.h>
Include dependency graph for cbfs_private.c:

Go to the source code of this file.

Data Structures

struct  cbfs_lookup_args
 

Functions

static enum cb_err read_next_header (cbfs_dev_t dev, size_t *offset, struct cbfs_file *buffer, const size_t devsize)
 
enum cb_err cbfs_walk (cbfs_dev_t dev, enum cb_err(*walker)(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, size_t already_read, void *arg), void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags flags)
 
enum cb_err cbfs_copy_fill_metadata (union cbfs_mdata *dst, const union cbfs_mdata *src, size_t already_read, cbfs_dev_t dev, size_t offset)
 
static enum cb_err lookup_walker (cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, size_t already_read, void *arg)
 
enum cb_err cbfs_lookup (cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, size_t *data_offset_out, struct vb2_hash *metadata_hash)
 
const voidcbfs_find_attr (const union cbfs_mdata *mdata, uint32_t attr_tag, size_t size_check)
 
const struct vb2_hash * cbfs_file_hash (const union cbfs_mdata *mdata)
 

Function Documentation

◆ cbfs_copy_fill_metadata()

enum cb_err cbfs_copy_fill_metadata ( union cbfs_mdata dst,
const union cbfs_mdata src,
size_t  already_read,
cbfs_dev_t  dev,
size_t  offset 
)

Definition at line 1 of file cbfs_private.c.

References ALIGN_UP, buffer, CB_CBFS_IO, CB_CBFS_NOT_FOUND, CB_SUCCESS, CBFS_ALIGNMENT, cbfs_dev_read(), CBFS_FILE_MAGIC, DEBUG, memcmp(), and offset.

Here is the call graph for this function:

◆ cbfs_file_hash()

const struct vb2_hash* cbfs_file_hash ( const union cbfs_mdata mdata)

Definition at line 199 of file cbfs_private.c.

References be32toh(), CBFS_FILE_ATTR_TAG_HASH, cbfs_find_attr(), ERROR, cbfs_file::filename, cbfs_mdata::h, cbfs_file_attr_hash::hash, cbfs_file_attr_hash::len, NULL, and offsetof.

Referenced by cbfs_file_hash_mismatch().

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

◆ cbfs_find_attr()

const void* cbfs_find_attr ( const union cbfs_mdata mdata,
uint32_t  attr_tag,
size_t  size_check 
)

Definition at line 167 of file cbfs_private.c.

References cbfs_file::attributes_offset, be32toh(), ERROR, cbfs_file::filename, cbfs_mdata::h, cbfs_file_attribute::len, NULL, cbfs_file::offset, offset, cbfs_mdata::raw, and cbfs_file_attribute::tag.

Referenced by cbfs_file_hash(), do_alloc(), and rmodule_cbfs_allocator().

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

◆ cbfs_lookup()

enum cb_err cbfs_lookup ( cbfs_dev_t  dev,
const char *  name,
union cbfs_mdata mdata_out,
size_t data_offset_out,
struct vb2_hash *  metadata_hash 
)

Definition at line 1 of file cbfs_private.c.

Referenced by _cbfs_unverified_area_alloc().

Here is the caller graph for this function:

◆ cbfs_walk()

enum cb_err cbfs_walk ( cbfs_dev_t  dev,
enum cb_err(*)(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, size_t already_read, void *arg walker,
void arg,
struct vb2_hash *  metadata_hash,
enum cbfs_walk_flags  flags 
)

Definition at line 1 of file cbfs_private.c.

◆ lookup_walker()

static enum cb_err lookup_walker ( cbfs_dev_t  dev,
size_t  offset,
const union cbfs_mdata mdata,
size_t  already_read,
void arg 
)
static

Definition at line 1 of file cbfs_private.c.

◆ read_next_header()

static enum cb_err read_next_header ( cbfs_dev_t  dev,
size_t offset,
struct cbfs_file buffer,
const size_t  devsize 
)
static

Definition at line 1 of file cbfs_private.c.