summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
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 /payloads/libpayload/include
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 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/coreboot_tables.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index bd23d34c83..1d38c19a80 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -91,10 +91,7 @@ enum {
CB_TAG_OPTION_CHECKSUM = 0x00cc,
};
-struct cbuint64 {
- u32 lo;
- u32 hi;
-};
+typedef __aligned(4) uint64_t cb_uint64_t;
struct cb_header {
u8 signature[4];
@@ -111,8 +108,8 @@ struct cb_record {
};
struct cb_memory_range {
- struct cbuint64 start;
- struct cbuint64 size;
+ cb_uint64_t start;
+ cb_uint64_t size;
u32 type;
};
@@ -271,14 +268,14 @@ struct cb_gpios {
struct lb_range {
uint32_t tag;
uint32_t size;
- uint64_t range_start;
+ cb_uint64_t range_start;
uint32_t range_size;
};
struct cb_cbmem_tab {
uint32_t tag;
uint32_t size;
- uint64_t cbmem_tab;
+ cb_uint64_t cbmem_tab;
};
struct cb_x86_rom_mtrr {
@@ -316,10 +313,10 @@ struct cb_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;
+ cb_uint64_t fmap_offset;
+ cb_uint64_t cbfs_offset;
+ cb_uint64_t cbfs_size;
+ cb_uint64_t boot_media_size;
};
@@ -327,7 +324,7 @@ struct cb_cbmem_entry {
uint32_t tag;
uint32_t size;
- uint64_t address;
+ cb_uint64_t address;
uint32_t entry_size;
uint32_t id;
};
@@ -369,7 +366,7 @@ struct cb_board_config {
uint32_t tag;
uint32_t size;
- struct cbuint64 fw_config;
+ cb_uint64_t fw_config;
uint32_t board_id;
uint32_t ram_code;
uint32_t sku_id;
@@ -429,17 +426,12 @@ struct cb_cmos_checksum {
struct cb_acpi_rsdp {
uint32_t tag;
uint32_t size;
- struct cbuint64 rsdp_pointer; /* Address of the ACPI RSDP */
+ cb_uint64_t rsdp_pointer; /* Address of the ACPI RSDP */
};
/* Helpful inlines */
-static inline u64 cb_unpack64(struct cbuint64 val)
-{
- return (((u64) val.hi) << 32) | val.lo;
-}
-
static inline u16 cb_checksum(const void *ptr, unsigned len)
{
return ipchksum(ptr, len);