[coreboot-gerrit] Patch set updated for coreboot: lib: add helper for constructing coreboot forwarding table
Aaron Durbin (adurbin@chromium.org)
gerrit at coreboot.org
Wed Apr 20 15:33:30 CEST 2016
Aaron Durbin (adurbin at chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14433
-gerrit
commit b6b28a239f6e3408b6174fc6ea7ea9d5587f64c8
Author: Aaron Durbin <adurbin at chromium.org>
Date: Tue Apr 19 17:06:09 2016 -0500
lib: add helper for constructing coreboot forwarding table
The x86 architecture needs to add a forwarding table to
the real coreboot table. Provide a helper function to do
this for aligning the architectures on a common
write_tables() implementation.
Change-Id: I9a2875507e6260679874a654ddf97b879222d44e
Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
src/include/boot/coreboot_tables.h | 6 ++++++
src/lib/coreboot_table.c | 13 +++++++++++++
2 files changed, 19 insertions(+)
diff --git a/src/include/boot/coreboot_tables.h b/src/include/boot/coreboot_tables.h
index 8fde545..dda1e1a 100644
--- a/src/include/boot/coreboot_tables.h
+++ b/src/include/boot/coreboot_tables.h
@@ -9,6 +9,12 @@ unsigned long write_coreboot_table(
unsigned long low_table_start, unsigned long low_table_end,
unsigned long rom_table_start, unsigned long rom_table_end);
+/*
+ * Write forwarding table of target address at entry address returning size
+ * of table written.
+ */
+size_t write_coreboot_forwarding_table(uintptr_t entry, uintptr_t target);
+
void fill_lb_gpios(struct lb_gpios *gpios);
void lb_add_gpios(struct lb_gpios *gpios, const struct lb_gpio *gpio_table,
size_t count);
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 091ceaf..6967217 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -445,6 +445,19 @@ static unsigned long lb_table_fini(struct lb_header *head)
return (unsigned long)rec + rec->size;
}
+size_t write_coreboot_forwarding_table(uintptr_t entry, uintptr_t target)
+{
+ struct lb_header *head;
+
+ printk(BIOS_DEBUG, "Writing table forward entry at 0x%p\n",
+ (void *)entry);
+
+ head = lb_table_init(entry);
+ lb_forward(head, (struct lb_header*)target);
+
+ return (uintptr_t)lb_table_fini(head) - entry;
+}
+
unsigned long write_coreboot_table(
unsigned long low_table_start, unsigned long low_table_end,
unsigned long rom_table_start __unused, unsigned long rom_table_end)
More information about the coreboot-gerrit
mailing list