mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user