summaryrefslogtreecommitdiff
path: root/tests/lib/coreboot_table-test.c
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 /tests/lib/coreboot_table-test.c
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 'tests/lib/coreboot_table-test.c')
-rw-r--r--tests/lib/coreboot_table-test.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/coreboot_table-test.c b/tests/lib/coreboot_table-test.c
index a50dd15d08..2bf1f61da0 100644
--- a/tests/lib/coreboot_table-test.c
+++ b/tests/lib/coreboot_table-test.c
@@ -229,8 +229,8 @@ void bootmem_write_memory_table(struct lb_memory *mem)
/* Insert entries for testing */
for (i = 0; i < ARRAY_SIZE(mock_bootmem_ranges); ++i) {
struct resource *res = &mock_bootmem_ranges[i];
- lb_r->start = pack_lb64(res->base);
- lb_r->size = pack_lb64(res->size);
+ lb_r->start = res->base;
+ lb_r->size = res->size;
lb_r->type = res->flags;
lb_r++;
mem->size += sizeof(struct lb_memory_range);
@@ -362,18 +362,18 @@ static void test_write_tables(void **state)
const struct lb_memory *memory = (struct lb_memory *)record;
const struct lb_memory_range *range;
const struct resource *res;
- struct lb_uint64 value;
+ lb_uint64_t value;
for (int i = 0; i < ARRAY_SIZE(mock_bootmem_ranges); ++i) {
res = &mock_bootmem_ranges[i];
range = &memory->map[i];
- value = pack_lb64(res->base);
+ value = res->base;
assert_memory_equal(&value, &range->start,
- sizeof(struct lb_uint64));
- value = pack_lb64(res->size);
+ sizeof(lb_uint64_t));
+ value = res->size;
assert_memory_equal(&value, &range->size,
- sizeof(struct lb_uint64));
+ sizeof(lb_uint64_t));
assert_int_equal(range->type, res->flags);
}
break;
@@ -475,9 +475,9 @@ static void test_write_tables(void **state)
const struct lb_board_config *board_config =
(struct lb_board_config *)record;
- const struct lb_uint64 expected_fw_version = pack_lb64(fw_config_get());
+ const lb_uint64_t expected_fw_version = fw_config_get();
assert_memory_equal(&expected_fw_version, &board_config->fw_config,
- sizeof(struct lb_uint64));
+ sizeof(lb_uint64_t));
assert_int_equal(board_id(), board_config->board_id);
assert_int_equal(ram_code(), board_config->ram_code);
assert_int_equal(sku_id(), board_config->sku_id);
@@ -486,7 +486,7 @@ static void test_write_tables(void **state)
assert_int_equal(sizeof(struct lb_acpi_rsdp), record->size);
const struct lb_acpi_rsdp *acpi_rsdp = (struct lb_acpi_rsdp *)record;
- assert_int_equal(ebda_base, unpack_lb64(acpi_rsdp->rsdp_pointer));
+ assert_int_equal(ebda_base, acpi_rsdp->rsdp_pointer);
break;
default:
fail_msg("Unexpected tag found in record. Tag ID: 0x%x", record->tag);