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

Function add_mmap_window

util/cbfstool/cbfstool.c:369–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367static struct mmap_window mmap_window_table[MMAP_MAX_WINDOWS];
368
369static int add_mmap_window(unsigned long flash_offset, unsigned long host_offset, unsigned long window_size)
370{
371 if (mmap_window_table_size >= MMAP_MAX_WINDOWS) {
372 ERROR("Too many memory map windows\n");
373 return 1;
374 }
375
376 if (region_create_untrusted(
377 &mmap_window_table[mmap_window_table_size].flash_space,
378 flash_offset, window_size) != CB_SUCCESS ||
379 region_create_untrusted(
380 &mmap_window_table[mmap_window_table_size].host_space,
381 host_offset, window_size) != CB_SUCCESS) {
382 ERROR("Invalid mmap window size %lu.\n", window_size);
383 return 1;
384 }
385
386 mmap_window_table_size++;
387 return 0;
388}
389
390
391static int decode_mmap_arg(char *arg)

Callers 2

decode_mmap_argFunction · 0.85
create_mmap_windowsFunction · 0.85

Calls 1

region_create_untrustedFunction · 0.85

Tested by

no test coverage detected