Lines Matching full:r2
110 * | | r1 | | r2 | |
128 struct region r2 = { in memblock_add_disjoint_check() local
137 memblock_add(r2.base, r2.size); in memblock_add_disjoint_check()
142 ASSERT_EQ(rgn2->base, r2.base); in memblock_add_disjoint_check()
143 ASSERT_EQ(rgn2->size, r2.size); in memblock_add_disjoint_check()
146 ASSERT_EQ(memblock.memory.total_size, r1.size + r2.size); in memblock_add_disjoint_check()
154 * A test that tries to add two memory blocks r1 and r2, where r2 overlaps
155 * with the beginning of r1 (that is r1.base < r2.base + r2.size):
158 * | | |r2 | r1 | |
164 * r2.base
166 * Expect to merge the two entries into one region that starts at r2.base
181 struct region r2 = { in memblock_add_overlap_top_check() local
188 total_size = (r1.base - r2.base) + r1.size; in memblock_add_overlap_top_check()
192 memblock_add(r2.base, r2.size); in memblock_add_overlap_top_check()
194 ASSERT_EQ(rgn->base, r2.base); in memblock_add_overlap_top_check()
206 * A test that tries to add two memory blocks r1 and r2, where r2 overlaps
207 * with the end of r1 (that is r2.base < r1.base + r1.size):
210 * | | | r1 | r2 | |
214 * | r2.base
233 struct region r2 = { in memblock_add_overlap_bottom_check() local
240 total_size = (r2.base - r1.base) + r2.size; in memblock_add_overlap_bottom_check()
244 memblock_add(r2.base, r2.size); in memblock_add_overlap_bottom_check()
258 * A test that tries to add two memory blocks r1 and r2, where r2 is
259 * within the range of r1 (that is r1.base < r2.base &&
260 * r2.base + r2.size < r1.base + r1.size):
263 * | | |r2| r1 |
282 struct region r2 = { in memblock_add_within_check() local
291 memblock_add(r2.base, r2.size); in memblock_add_within_check()
335 * | | r1 | r3 | r2 | |
339 * and has size of r1.size + r2.size + r3.size. The region counter and total
353 struct region r2 = { in memblock_add_between_check() local
364 total_size = r1.size + r2.size + r3.size; in memblock_add_between_check()
368 memblock_add(r2.base, r2.size); in memblock_add_between_check()
481 * | |r1| | r2 | |
499 struct region r2 = { in memblock_reserve_disjoint_check() local
508 memblock_reserve(r2.base, r2.size); in memblock_reserve_disjoint_check()
513 ASSERT_EQ(rgn2->base, r2.base); in memblock_reserve_disjoint_check()
514 ASSERT_EQ(rgn2->size, r2.size); in memblock_reserve_disjoint_check()
517 ASSERT_EQ(memblock.reserved.total_size, r1.size + r2.size); in memblock_reserve_disjoint_check()
525 * A test that tries to mark two memory blocks r1 and r2 as reserved,
526 * where r2 overlaps with the beginning of r1 (that is
527 * r1.base < r2.base + r2.size):
530 * | | r2 | | r1 | |
536 * r2.base
538 * Expect to merge two entries into one region that starts at r2.base and
553 struct region r2 = { in memblock_reserve_overlap_top_check() local
560 total_size = (r1.base - r2.base) + r1.size; in memblock_reserve_overlap_top_check()
564 memblock_reserve(r2.base, r2.size); in memblock_reserve_overlap_top_check()
566 ASSERT_EQ(rgn->base, r2.base); in memblock_reserve_overlap_top_check()
578 * A test that tries to mark two memory blocks r1 and r2 as reserved,
579 * where r2 overlaps with the end of r1 (that is
580 * r2.base < r1.base + r1.size):
583 * | | r1 | | r2 | |
587 * | r2.base
606 struct region r2 = { in memblock_reserve_overlap_bottom_check() local
613 total_size = (r2.base - r1.base) + r2.size; in memblock_reserve_overlap_bottom_check()
617 memblock_reserve(r2.base, r2.size); in memblock_reserve_overlap_bottom_check()
631 * A test that tries to mark two memory blocks r1 and r2 as reserved,
632 * where r2 is within the range of r1 (that is
633 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
636 * | | |r2| r1 |
640 * | r2.base
657 struct region r2 = { in memblock_reserve_within_check() local
666 memblock_reserve(r2.base, r2.size); in memblock_reserve_within_check()
711 * | | r1 | r3 | r2 | |
715 * r1.base and has size of r1.size + r2.size + r3.size. The region counter and
729 struct region r2 = { in memblock_reserve_between_check() local
740 total_size = r1.size + r2.size + r3.size; in memblock_reserve_between_check()
744 memblock_reserve(r2.base, r2.size); in memblock_reserve_between_check()
825 * with the next region r2 in memblock.memory:
828 * | : r1 : | r2 | |
834 * Expect to add two memory blocks r1 and r2 and then remove r1 so that
835 * r2 is the first available region. The region counter and total size
848 struct region r2 = { in memblock_remove_simple_check() local
857 memblock_add(r2.base, r2.size); in memblock_remove_simple_check()
860 ASSERT_EQ(rgn->base, r2.base); in memblock_remove_simple_check()
861 ASSERT_EQ(rgn->size, r2.size); in memblock_remove_simple_check()
864 ASSERT_EQ(memblock.memory.total_size, r2.size); in memblock_remove_simple_check()
872 * A test that tries to remove a region r2 that was not registered as
876 * | r2 |
897 struct region r2 = { in memblock_remove_absent_check() local
906 memblock_remove(r2.base, r2.size); in memblock_remove_absent_check()
920 * A test that tries to remove a region r2 that overlaps with the
922 * (that is r1.base < r2.base + r2.size):
925 * | r2 |
949 struct region r2 = { in memblock_remove_overlap_top_check() local
957 r2_end = r2.base + r2.size; in memblock_remove_overlap_top_check()
962 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_top_check()
964 ASSERT_EQ(rgn->base, r1.base + r2.base); in memblock_remove_overlap_top_check()
976 * A test that tries to remove a region r2 that overlaps with the end of
977 * the already existing region r1 (that is r2.base < r1.base + r1.size):
980 * | r2 |
1003 struct region r2 = { in memblock_remove_overlap_bottom_check() local
1010 total_size = r2.base - r1.base; in memblock_remove_overlap_bottom_check()
1014 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_bottom_check()
1028 * A test that tries to remove a region r2 that is within the range of
1030 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1033 * | r2 |
1042 * Expect that the region is split into two - one that ends at r2.base and
1043 * another that starts at r2.base + r2.size, with appropriate sizes. The
1058 struct region r2 = { in memblock_remove_within_check() local
1065 r1_size = r2.base - r1.base; in memblock_remove_within_check()
1066 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_remove_within_check()
1071 memblock_remove(r2.base, r2.size); in memblock_remove_within_check()
1076 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_remove_within_check()
1123 * A simple test that tries remove a region r2 from the array of available
1124 * memory regions when r2 extends past PHYS_ADDR_MAX:
1127 * | r2 |
1133 * Expect that only the portion between PHYS_ADDR_MAX and r2.base is removed.
1149 struct region r2 = { in memblock_remove_near_max_check() local
1156 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_remove_near_max_check()
1160 memblock_remove(r2.base, r2.size); in memblock_remove_near_max_check()
1175 * regions r1 and r2:
1181 * | | |r1 : : |r2 | |
1184 * Expect that only the intersections of r1 with r3 and r2 with r3 are removed
1200 struct region r2 = { in memblock_remove_overlap_two_check() local
1211 r2_end = r2.base + r2.size; in memblock_remove_overlap_two_check()
1219 memblock_add(r2.base, r2.size); in memblock_remove_overlap_two_check()
1259 * the next entry r2 in memblock.reserved:
1262 * | : r1 : | r2 | |
1269 * value of r2. The region counter and total size are updated.
1281 struct region r2 = { in memblock_free_simple_check() local
1290 memblock_reserve(r2.base, r2.size); in memblock_free_simple_check()
1293 ASSERT_EQ(rgn->base, r2.base); in memblock_free_simple_check()
1294 ASSERT_EQ(rgn->size, r2.size); in memblock_free_simple_check()
1297 ASSERT_EQ(memblock.reserved.total_size, r2.size); in memblock_free_simple_check()
1305 * A test that tries to free a region r2 that was not marked as reserved
1309 * | r2 |
1330 struct region r2 = { in memblock_free_absent_check() local
1339 memblock_free((void *)r2.base, r2.size); in memblock_free_absent_check()
1353 * A test that tries to free a region r2 that overlaps with the beginning
1354 * of the already existing entry r1 (that is r1.base < r2.base + r2.size):
1357 * | r2 |
1382 struct region r2 = { in memblock_free_overlap_top_check() local
1389 total_size = (r1.size + r1.base) - (r2.base + r2.size); in memblock_free_overlap_top_check()
1393 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_top_check()
1395 ASSERT_EQ(rgn->base, r2.base + r2.size); in memblock_free_overlap_top_check()
1407 * A test that tries to free a region r2 that overlaps with the end of
1408 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1411 * | r2 |
1431 struct region r2 = { in memblock_free_overlap_bottom_check() local
1438 total_size = r2.base - r1.base; in memblock_free_overlap_bottom_check()
1442 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_bottom_check()
1456 * A test that tries to free a region r2 that is within the range of the
1458 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1461 * | r2 |
1470 * Expect that the region is split into two - one that ends at r2.base and
1471 * another that starts at r2.base + r2.size, with appropriate sizes. The
1486 struct region r2 = { in memblock_free_within_check() local
1493 r1_size = r2.base - r1.base; in memblock_free_within_check()
1494 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_free_within_check()
1499 memblock_free((void *)r2.base, r2.size); in memblock_free_within_check()
1504 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_free_within_check()
1551 * A simple test that tries free a region r2 when r2 extends past PHYS_ADDR_MAX:
1554 * | r2 |
1560 * Expect that only the portion between PHYS_ADDR_MAX and r2.base is freed.
1576 struct region r2 = { in memblock_free_near_max_check() local
1583 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_free_near_max_check()
1587 memblock_free((void *)r2.base, r2.size); in memblock_free_near_max_check()
1602 * existing reserved regions r1 and r2:
1608 * | | |r1 : : |r2 | |
1611 * Expect that only the intersections of r1 with r3 and r2 with r3 are freed
1627 struct region r2 = { in memblock_free_overlap_two_check() local
1638 r2_end = r2.base + r2.size; in memblock_free_overlap_two_check()
1646 memblock_reserve(r2.base, r2.size); in memblock_free_overlap_two_check()
1762 * r2. Region r1 is aligned on both ends and region r2 is unaligned on one end
1768 * | | r1 | | r2 | |
1775 * Expect that r1 will not be trimmed and r2 will be removed. Expect the
1789 struct region r2 = { in memblock_trim_memory_too_small_check() local
1798 memblock_add(r2.base, r2.size); in memblock_trim_memory_too_small_check()
1813 * r2. Region r1 is aligned on both ends and region r2 is unaligned at the base
1820 * | | r1 | | r2 | |
1827 * Expect that r1 will not be trimmed and r2 will be trimmed at the base.
1844 struct region r2 = { in memblock_trim_memory_unaligned_base_check() local
1851 new_r2_base = r2.base + (alignment - offset); in memblock_trim_memory_unaligned_base_check()
1852 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_base_check()
1856 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_base_check()
1874 * r2. Region r1 is aligned on both ends and region r2 is aligned at the base
1881 * | | r1 | | r2 | |
1888 * Expect that r1 will not be trimmed and r2 will be trimmed at the end.
1905 struct region r2 = { in memblock_trim_memory_unaligned_end_check() local
1912 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_end_check()
1916 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_end_check()
1922 ASSERT_EQ(rgn2->base, r2.base); in memblock_trim_memory_unaligned_end_check()