libflashrom
|
Functions | |
int | flashrom_layout_new (struct flashrom_layout **layout) |
Create a new, empty layout. More... | |
int | flashrom_layout_read_from_ifd (struct flashrom_layout **layout, struct flashrom_flashctx *flashctx, const void *dump, size_t len) |
Read a layout from the Intel ICH descriptor in the flash. More... | |
int | flashrom_layout_read_fmap_from_rom (struct flashrom_layout **layout, struct flashrom_flashctx *flashctx, size_t offset, size_t length) |
Read a layout by searching the flash chip for fmap. More... | |
int | flashrom_layout_read_fmap_from_buffer (struct flashrom_layout **layout, struct flashrom_flashctx *flashctx, const uint8_t *buffer, size_t len) |
Read a layout by searching a buffer for fmap. More... | |
int | flashrom_layout_add_region (struct flashrom_layout *layout, size_t start, size_t end, const char *name) |
Add a region to an existing layout. More... | |
int | flashrom_layout_include_region (struct flashrom_layout *layout, const char *name) |
Mark given region as included. More... | |
int | flashrom_layout_exclude_region (struct flashrom_layout *layout, const char *name) |
Mark given region as not included. More... | |
int | flashrom_layout_get_region_range (struct flashrom_layout *layout, const char *name, unsigned int *start, unsigned int *len) |
Get given region's offset and length. More... | |
void | flashrom_layout_release (struct flashrom_layout *layout) |
Free a layout. More... | |
void | flashrom_layout_set (struct flashrom_flashctx *flashctx, const struct flashrom_layout *layout) |
Set the active layout for a flash context. More... | |
int flashrom_layout_add_region | ( | struct flashrom_layout * | layout, |
size_t | start, | ||
size_t | end, | ||
const char * | name | ||
) |
Add a region to an existing layout.
layout | The existing layout. |
start | Start address of the region. |
end | End address (inclusive) of the region. |
name | Name of the region. |
int flashrom_layout_exclude_region | ( | struct flashrom_layout * | layout, |
const char * | name | ||
) |
Mark given region as not included.
layout | The layout to alter. |
name | The name of the region to exclude. |
int flashrom_layout_get_region_range | ( | struct flashrom_layout * | layout, |
const char * | name, | ||
unsigned int * | start, | ||
unsigned int * | len | ||
) |
Get given region's offset and length.
[in] | layout | The existing layout. |
[in] | name | The name of the region. |
[out] | start | The start address to be written. |
[out] | len | The length of the region to be written. |
int flashrom_layout_include_region | ( | struct flashrom_layout * | layout, |
const char * | name | ||
) |
Mark given region as included.
layout | The layout to alter. |
name | The name of the region to include. |
int flashrom_layout_new | ( | struct flashrom_layout ** | layout | ) |
Create a new, empty layout.
layout | Pointer to returned layout reference. |
int flashrom_layout_read_fmap_from_buffer | ( | struct flashrom_layout ** | layout, |
struct flashrom_flashctx * | flashctx, | ||
const uint8_t * | buffer, | ||
size_t | len | ||
) |
Read a layout by searching a buffer for fmap.
[out] | layout | Points to a struct flashrom_layout pointer that gets set if the fmap is read and parsed successfully. |
[in] | flashctx | Flash context |
[in] | buffer | Buffer to search in |
[in] | len | Size of buffer to search |
int flashrom_layout_read_fmap_from_rom | ( | struct flashrom_layout ** | layout, |
struct flashrom_flashctx * | flashctx, | ||
size_t | offset, | ||
size_t | length | ||
) |
Read a layout by searching the flash chip for fmap.
[out] | layout | Points to a struct flashrom_layout pointer that gets set if the fmap is read and parsed successfully. |
[in] | flashctx | Flash context |
[in] | offset | Offset to begin searching for fmap. |
[in] | length | Length of address space to search. |
int flashrom_layout_read_from_ifd | ( | struct flashrom_layout ** | layout, |
struct flashrom_flashctx * | flashctx, | ||
const void * | dump, | ||
size_t | len | ||
) |
Read a layout from the Intel ICH descriptor in the flash.
Optionally verify that the layout matches the one in the given descriptor dump.
[out] | layout | Points to a struct flashrom_layout pointer that gets set if the descriptor is read and parsed successfully. |
[in] | flashctx | Flash context to read the descriptor from flash. |
[in] | dump | The descriptor dump to compare to or NULL. |
[in] | len | The length of the descriptor dump. |
void flashrom_layout_release | ( | struct flashrom_layout * | layout | ) |
Free a layout.
layout | Layout to free. |
void flashrom_layout_set | ( | struct flashrom_flashctx * | flashctx, |
const struct flashrom_layout * | layout | ||
) |
Set the active layout for a flash context.
Note: The caller must not release the layout as long as it is used through the given flash context.
flashctx | Flash context whose layout will be set. |
layout | Layout to bet set. |