MCPcopy Create free account
hub / github.com/coreboot/coreboot / convert_region_offset

Function convert_region_offset

util/cbfstool/cbfstool.c:588–606  ·  view source on GitHub ↗

* This function takes offset value which represents the offset from one end of the region and * converts it to offset from the other end of the region. offset is expected to be positive. */

Source from the content-addressed store, hash-verified

586 * converts it to offset from the other end of the region. offset is expected to be positive.
587 */
588static int convert_region_offset(unsigned int offset, uint32_t *region_offset)
589{
590 size_t size;
591
592 if (param.size) {
593 size = param.size;
594 } else {
595 assert(param.image_region);
596 size = param.image_region->size;
597 }
598
599 if (size < offset) {
600 ERROR("Cannot convert region offset (size=0x%zx, offset=0x%x)\n", size, offset);
601 return 1;
602 }
603
604 *region_offset = size - offset;
605 return 0;
606}
607
608static int do_cbfs_locate(uint32_t *cbfs_addr, size_t data_size)
609{

Callers 2

add_topswap_bootblockFunction · 0.85
get_region_offsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected