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

Function convert_host_to_flash

util/cbfstool/cbfstool.c:527–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527static unsigned int convert_host_to_flash(const struct buffer *region, unsigned int addr)
528{
529 int idx;
530 const struct region *to, *from;
531
532 idx = find_mmap_window(HOST_SPACE_ADDR, addr);
533 if (idx == -1) {
534 ERROR("Host address(%x) not in any mmap window!\n", addr);
535 return 0;
536 }
537
538 to = &mmap_window_table[idx].flash_space;
539 from = &mmap_window_table[idx].host_space;
540
541 /* region->offset is subtracted because caller expects offset in the given region. */
542 return convert_address(to, from, addr) - region->offset;
543}
544
545static unsigned int convert_flash_to_host(const struct buffer *region, unsigned int addr)
546{

Callers 1

convert_addr_spaceFunction · 0.85

Calls 2

find_mmap_windowFunction · 0.85
convert_addressFunction · 0.85

Tested by

no test coverage detected