aboutsummaryrefslogtreecommitdiff
path: root/src/commonlib
diff options
context:
space:
mode:
authorJianjun Wang <jianjun.wang@mediatek.com>2022-04-08 16:57:28 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-04-14 22:27:50 +0000
commitb2537bdad552443aba58bda7c42af1f039a58c94 (patch)
treeaac90b0d8e31c8986dd9be460199af7503a08263 /src/commonlib
parent6f023ece0860a7988ef7f1f15bea5b54df0161ff (diff)
coreboot_tables: Replace 'struct lb_uint64' with lb_uint64_t
Replace 'struct lb_uint64' with 'typedef __aligned(4) uint64_t lb_uint64_t', and remove unpack_lb64/pack_lb64 functions since it's no longer needed. Also replace 'struct cbuint64' with 'cb_uint64_t' and remove 'cb_unpack64' in libpayload for compatible with lb_uint64_t. Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: If6b037e4403a8000625f4a5fb8d20311fe76200a Reviewed-on: https://review.coreboot.org/c/coreboot/+/63494 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/commonlib')
-rw-r--r--src/commonlib/include/commonlib/coreboot_tables.h56
1 files changed, 17 insertions, 39 deletions
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 01b12f3a48..206ddb4558 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -99,33 +99,11 @@ enum {
* 64bit system, a uint64_t would be aligned to 64bit boundaries,
* breaking the table format.
*
- * lb_uint64 will keep 64bit coreboot table values aligned to 32bit
- * to ensure compatibility. They can be accessed with the two functions
- * below: unpack_lb64() and pack_lb64()
- *
- * See also: util/lbtdump/lbtdump.c
+ * lb_uint64_t will keep 64bit coreboot table values aligned to 32bit
+ * to ensure compatibility.
*/
-struct lb_uint64 {
- uint32_t lo;
- uint32_t hi;
-};
-
-static inline uint64_t unpack_lb64(struct lb_uint64 value)
-{
- uint64_t result;
- result = value.hi;
- result = (result << 32) + value.lo;
- return result;
-}
-
-static inline struct lb_uint64 pack_lb64(uint64_t value)
-{
- struct lb_uint64 result;
- result.lo = (value >> 0) & 0xffffffff;
- result.hi = (value >> 32) & 0xffffffff;
- return result;
-}
+typedef __aligned(4) uint64_t lb_uint64_t;
struct lb_header {
uint8_t signature[4]; /* LBIO */
@@ -148,8 +126,8 @@ struct lb_record {
};
struct lb_memory_range {
- struct lb_uint64 start;
- struct lb_uint64 size;
+ lb_uint64_t start;
+ lb_uint64_t size;
uint32_t type;
#define LB_MEM_RAM 1 /* Memory anyone can use */
#define LB_MEM_RESERVED 2 /* Don't use this memory region */
@@ -169,7 +147,7 @@ struct lb_memory {
struct lb_hwrpb {
uint32_t tag;
uint32_t size;
- uint64_t hwrpb;
+ lb_uint64_t hwrpb;
};
struct lb_mainboard {
@@ -237,7 +215,7 @@ struct lb_console {
struct lb_forward {
uint32_t tag;
uint32_t size;
- uint64_t forward;
+ lb_uint64_t forward;
};
/**
@@ -295,7 +273,7 @@ struct lb_framebuffer {
uint32_t tag;
uint32_t size;
- uint64_t physical_address;
+ lb_uint64_t physical_address;
uint32_t x_resolution;
uint32_t y_resolution;
uint32_t bytes_per_line;
@@ -333,7 +311,7 @@ struct lb_range {
uint32_t tag;
uint32_t size;
- uint64_t range_start;
+ lb_uint64_t range_start;
uint32_t range_size;
};
@@ -343,7 +321,7 @@ struct lb_cbmem_ref {
uint32_t tag;
uint32_t size;
- uint64_t cbmem_addr;
+ lb_uint64_t cbmem_addr;
};
struct lb_x86_rom_mtrr {
@@ -379,10 +357,10 @@ struct lb_boot_media_params {
uint32_t tag;
uint32_t size;
/* offsets are relative to start of boot media */
- uint64_t fmap_offset;
- uint64_t cbfs_offset;
- uint64_t cbfs_size;
- uint64_t boot_media_size;
+ lb_uint64_t fmap_offset;
+ lb_uint64_t cbfs_offset;
+ lb_uint64_t cbfs_size;
+ lb_uint64_t boot_media_size;
};
/*
@@ -392,7 +370,7 @@ struct lb_cbmem_entry {
uint32_t tag;
uint32_t size;
- uint64_t address;
+ lb_uint64_t address;
uint32_t entry_size;
uint32_t id;
};
@@ -461,7 +439,7 @@ struct lb_board_config {
uint32_t tag;
uint32_t size;
- struct lb_uint64 fw_config;
+ lb_uint64_t fw_config;
uint32_t board_id;
uint32_t ram_code;
uint32_t sku_id;
@@ -583,7 +561,7 @@ struct lb_tpm_physical_presence {
struct lb_acpi_rsdp {
uint32_t tag;
uint32_t size;
- struct lb_uint64 rsdp_pointer; /* Address of the ACPI RSDP */
+ lb_uint64_t rsdp_pointer; /* Address of the ACPI RSDP */
};
#endif