summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-07-18 14:23:41 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-08-24 09:12:47 +0000
commit14adb7eaa9f31e9db346f7b9de61e3a63905b03e (patch)
tree720df63e952e5d5e5c71f035e30b08aacb6faf4d /payloads/libpayload/include
parent2f6d5551b015d009a94c61b6741bc33a0e01b410 (diff)
libpayload: Cache physical cbmem console address
Same as with other consoles and drivers that cache an address outside the payload (e.g. video/corebootfb), we should store the physical address, so we can derive the virtual address on demand. This makes it save to use the address across relocations. As a first step in migrating `libsysinfo` to `uintptr_t`, we also switch to the physical address there. Fixes the default build of FILO, tested with Qemu/i440FX and Qemu/Q35. Change-Id: I4b8434af69e0526f78523ae61981a15abb1295b0 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37478 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/coreboot_tables.h2
-rw-r--r--payloads/libpayload/include/sysinfo.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index 91d3520ad5..c281417f10 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -31,6 +31,7 @@
#include <arch/types.h>
#include <ipchksum.h>
+#include <stdint.h>
enum {
CB_TAG_UNUSED = 0x0000,
@@ -396,4 +397,5 @@ static inline const char *cb_mb_part_string(const struct cb_mainboard *cbm)
/* Helper functions */
void *get_cbmem_ptr(unsigned char *ptr);
+uintptr_t get_cbmem_addr(const void *cbmem_tab_entry);
#endif
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h
index 6e83f684df..3b1b9c9742 100644
--- a/payloads/libpayload/include/sysinfo.h
+++ b/payloads/libpayload/include/sysinfo.h
@@ -29,6 +29,8 @@
#ifndef _SYSINFO_H
#define _SYSINFO_H
+#include <stdint.h>
+
/* Maximum number of memory range definitions. */
#define SYSINFO_MAX_MEM_RANGES 32
/* Allow a maximum of 8 GPIOs */
@@ -101,7 +103,7 @@ struct sysinfo_t {
#endif
void *tstamp_table;
- void *cbmem_cons;
+ uintptr_t cbmem_cons;
void *mrc_cache;
void *acpi_gnvs;