diff options
author | Simon Glass <sjg@chromium.org> | 2025-01-10 17:00:01 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-01-22 15:58:03 -0600 |
commit | c487381d50b280a0dce09e00cd29620be9598c90 (patch) | |
tree | e09f7f88ccdd6308d6b4a2288331de68d8acdfd9 /test/lib | |
parent | 864106f3c477052dae932d80a89522532efe76fe (diff) |
abuf: Provide a way to get the buffer address
In many cases it is useful to get the address of a buffer, e.g. when
booting from it. Add a function to handle this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/abuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lib/abuf.c b/test/lib/abuf.c index 7c0481ab610..5d61f9261c6 100644 --- a/test/lib/abuf.c +++ b/test/lib/abuf.c @@ -46,7 +46,7 @@ static int lib_test_abuf_set(struct unit_test_state *uts) } LIB_TEST(lib_test_abuf_set, 0); -/* Test abuf_map_sysmem() */ +/* Test abuf_map_sysmem() and abuf_addr() */ static int lib_test_abuf_map_sysmem(struct unit_test_state *uts) { struct abuf buf; @@ -60,6 +60,8 @@ static int lib_test_abuf_map_sysmem(struct unit_test_state *uts) ut_asserteq(TEST_DATA_LEN, buf.size); ut_asserteq(false, buf.alloced); + ut_asserteq(addr, abuf_addr(&buf)); + return 0; } LIB_TEST(lib_test_abuf_map_sysmem, 0); |