mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 20:04:46 +00:00
test: lmb: Add test for coalescing and overlap range
Add test case for an address range which is coalescing with one of range and overlapping with next range Cc: Simon Glass <sjg@google.com> Signed-off-by: Udit Kumar <u-kumar1@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
edb5824be1
commit
4a6105e783
1 changed files with 12 additions and 1 deletions
|
@ -451,12 +451,23 @@ static int lib_test_lmb_overlapping_reserve(struct unit_test_state *uts)
|
||||||
ut_asserteq(ret, 0);
|
ut_asserteq(ret, 0);
|
||||||
ASSERT_LMB(&lmb, ram, ram_size, 2, 0x40010000, 0x10000,
|
ASSERT_LMB(&lmb, ram, ram_size, 2, 0x40010000, 0x10000,
|
||||||
0x40030000, 0x10000, 0, 0);
|
0x40030000, 0x10000, 0, 0);
|
||||||
/* allocate 2nd region */
|
/* allocate 2nd region , This should coalesced all region into one */
|
||||||
ret = lmb_reserve(&lmb, 0x40020000, 0x10000);
|
ret = lmb_reserve(&lmb, 0x40020000, 0x10000);
|
||||||
ut_assert(ret >= 0);
|
ut_assert(ret >= 0);
|
||||||
ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40010000, 0x30000,
|
ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40010000, 0x30000,
|
||||||
0, 0, 0, 0);
|
0, 0, 0, 0);
|
||||||
|
|
||||||
|
/* allocate 2nd region, which should be added as first region */
|
||||||
|
ret = lmb_reserve(&lmb, 0x40000000, 0x8000);
|
||||||
|
ut_assert(ret >= 0);
|
||||||
|
ASSERT_LMB(&lmb, ram, ram_size, 2, 0x40000000, 0x8000,
|
||||||
|
0x40010000, 0x30000, 0, 0);
|
||||||
|
|
||||||
|
/* allocate 3rd region, coalesce with first and overlap with second */
|
||||||
|
ret = lmb_reserve(&lmb, 0x40008000, 0x10000);
|
||||||
|
ut_assert(ret >= 0);
|
||||||
|
ASSERT_LMB(&lmb, ram, ram_size, 1, 0x40000000, 0x40000,
|
||||||
|
0, 0, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue