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

Function write_tables

src/lib/coreboot_table.c:597–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597void *write_tables(void)
598{
599 uintptr_t cbtable_start;
600 uintptr_t cbtable_end;
601 size_t cbtable_size;
602 const size_t max_table_size = COREBOOT_TABLE_SIZE;
603
604 cbtable_start = (uintptr_t)cbmem_add(CBMEM_ID_CBTABLE, max_table_size);
605
606 if (!cbtable_start) {
607 printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n");
608 return NULL;
609 }
610
611 /* Add architecture specific tables. */
612 arch_write_tables(cbtable_start);
613
614 /* Write the coreboot table. */
615 cbtable_end = write_coreboot_table(cbtable_start);
616 cbtable_size = cbtable_end - cbtable_start;
617
618 if (cbtable_size > max_table_size) {
619 printk(BIOS_ERR, "%s: coreboot table didn't fit (%zx/%zx)\n",
620 __func__, cbtable_size, max_table_size);
621 }
622
623 printk(BIOS_DEBUG, "coreboot table: %zd bytes.\n", cbtable_size);
624
625 /* Print CBMEM sections */
626 cbmem_list();
627 return (void *)cbtable_start;
628}

Callers 2

bs_write_tablesFunction · 0.85
test_write_tablesFunction · 0.85

Calls 5

write_coreboot_tableFunction · 0.85
cbmem_listFunction · 0.85
cbmem_addFunction · 0.70
printkFunction · 0.50
arch_write_tablesFunction · 0.50

Tested by 1

test_write_tablesFunction · 0.68