diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2014-07-31 21:02:57 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-20 15:31:59 +0100 |
commit | 864ec8c488eb195b73c876be8fe2b879efa470e0 (patch) | |
tree | 9c4bcf30b485a7dfce96df41e09ecacd12db2ed6 /payloads/libpayload/include | |
parent | 6051e8334eb46651f069138bdcd5c7285c0b4026 (diff) |
libpayload: Consolidate coreboot table parsing
There are three instances of coreboot.c in libpayload. for x86, arm
and arm64 architectures. The arm and arm64 instances are exactly the
same. The differences with the x86 instance are as follows:
- a very slightly different set of coreboot table tags is parsed (one
tag added and two removed)
- instead of checking a fixed address if it contains the coreboot
table, the x86 version iterates over two address ranges.
This patch refactors the module, leaving architecture specific
processing in arch subdirectories and moving the common code into
libc.
BUG=none
TEST=none yet
Change-Id: I1c7ad6f74e3498e93df78086ba0ff708c08e0a5c
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 3df209d58ebd5c5b1cf0168f6466e065d1ef3598
Original-Change-Id: I6dfed73f6ba5939f692d0f98d2774c0e0312a25f
Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/210770
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/8750
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r-- | payloads/libpayload/include/sysinfo.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index afcf3d8c38..1753f6f1c6 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -113,5 +113,19 @@ struct sysinfo_t { extern struct sysinfo_t lib_sysinfo; +/* + * Check if this is an architecture specific coreboot table record and process + * it, if it is. Return 1 if record type was recognized, 0 otherwise. + */ +int cb_parse_arch_specific(struct cb_record *rec, struct sysinfo_t *info); + +/* + * Check if the region in range addr..addr+len contains a 16 byte aligned + * coreboot table. If it does - process the table filling up the sysinfo + * structure with information from the table. Return 0 on success and -1 on + * failure. + */ +int cb_parse_header(void *addr, int len, struct sysinfo_t *info); + #endif |