diff options
author | Julius Werner <jwerner@chromium.org> | 2013-08-27 15:38:54 -0700 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2014-08-10 22:23:19 +0200 |
commit | 1f5487a7c0687b910a898b1fe704e9b75947b5dc (patch) | |
tree | 90bcbe5a0f6055a1ea214637536c92bb5d2e9844 /src | |
parent | 579538b5c764e813866b3eae60f79bfc1d801471 (diff) | |
download | coreboot-1f5487a7c0687b910a898b1fe704e9b75947b5dc.tar.xz |
coreboot_tables: reduce redundant data structures
There are three coreboot table tags that all define some kind of memory
region, and each has their own homologous struct. I'm about to add a
fourth so I'll just clean this up and turn it into a generic struct
lb_range instead.
Change-Id: Id148b2737d442e0636d2c05e74efa1fdf844a0d3
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/167154
(cherry picked from commit 22d82ffa3f5500fbc1b785e343add25e61f4f194)
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6456
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/boot/coreboot_tables.h | 28 | ||||
-rw-r--r-- | src/lib/coreboot_table.c | 22 |
2 files changed, 17 insertions, 33 deletions
diff --git a/src/include/boot/coreboot_tables.h b/src/include/boot/coreboot_tables.h index f8f80228cf..3c569a132d 100644 --- a/src/include/boot/coreboot_tables.h +++ b/src/include/boot/coreboot_tables.h @@ -215,13 +215,15 @@ struct lb_gpios { struct lb_gpio gpios[0]; }; -#define LB_TAG_VDAT 0x0015 -struct lb_vdat { +#define LB_TAG_VDAT 0x0015 +#define LB_TAG_VBNV 0x0019 +#define LB_TAB_VBOOT_HANDOFF 0x0020 +struct lb_range { uint32_t tag; uint32_t size; - uint64_t vdat_addr; - uint32_t vdat_size; + uint64_t range_start; + uint32_t range_size; }; #define LB_TAG_TIMESTAMPS 0x0016 @@ -235,24 +237,6 @@ struct lb_cbmem_ref { uint64_t cbmem_addr; }; -#define LB_TAG_VBNV 0x0019 -struct lb_vbnv { - uint32_t tag; - uint32_t size; - - uint32_t vbnv_start; - uint32_t vbnv_size; -}; - -#define LB_TAB_VBOOT_HANDOFF 0x0020 -struct lb_vboot_handoff { - uint32_t tag; - uint32_t size; - - uint64_t vboot_handoff_addr; - uint32_t vboot_handoff_size; -}; - #define LB_TAG_X86_ROM_MTRR 0x0021 struct lb_x86_rom_mtrr { uint32_t tag; diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index 1e1ad828bb..f0ae6c5bc0 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -169,25 +169,25 @@ static void lb_gpios(struct lb_header *header) static void lb_vdat(struct lb_header *header) { #if CONFIG_GENERATE_ACPI_TABLES - struct lb_vdat* vdat; + struct lb_range *vdat; - vdat = (struct lb_vdat *)lb_new_record(header); + vdat = (struct lb_range *)lb_new_record(header); vdat->tag = LB_TAG_VDAT; vdat->size = sizeof(*vdat); - acpi_get_vdat_info(&vdat->vdat_addr, &vdat->vdat_size); + acpi_get_vdat_info(&vdat->range_start, &vdat->range_size); #endif } static void lb_vbnv(struct lb_header *header) { #if CONFIG_PC80_SYSTEM - struct lb_vbnv* vbnv; + struct lb_range *vbnv; - vbnv = (struct lb_vbnv *)lb_new_record(header); + vbnv = (struct lb_range *)lb_new_record(header); vbnv->tag = LB_TAG_VBNV; vbnv->size = sizeof(*vbnv); - vbnv->vbnv_start = CONFIG_VBNV_OFFSET + 14; - vbnv->vbnv_size = CONFIG_VBNV_SIZE; + vbnv->range_start = CONFIG_VBNV_OFFSET + 14; + vbnv->range_size = CONFIG_VBNV_SIZE; #endif } @@ -196,16 +196,16 @@ static void lb_vboot_handoff(struct lb_header *header) { void *addr; uint32_t size; - struct lb_vboot_handoff* vbho; + struct lb_range *vbho; if (vboot_get_handoff_info(&addr, &size)) return; - vbho = (struct lb_vboot_handoff *)lb_new_record(header); + vbho = (struct lb_range *)lb_new_record(header); vbho->tag = LB_TAB_VBOOT_HANDOFF; vbho->size = sizeof(*vbho); - vbho->vboot_handoff_addr = (intptr_t)addr; - vbho->vboot_handoff_size = size; + vbho->range_start = (intptr_t)addr; + vbho->range_size = size; } #else static inline void lb_vboot_handoff(struct lb_header *header) {} |