Lines Matching full:r1

110  *  |        |   r1   |        |   r2   |  |
124 struct region r1 = { in memblock_add_disjoint_check() local
136 memblock_add(r1.base, r1.size); in memblock_add_disjoint_check()
139 ASSERT_EQ(rgn1->base, r1.base); in memblock_add_disjoint_check()
140 ASSERT_EQ(rgn1->size, r1.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 | |
162 * | r1.base
177 struct region r1 = { in memblock_add_overlap_top_check() local
188 total_size = (r1.base - r2.base) + r1.size; in memblock_add_overlap_top_check()
191 memblock_add(r1.base, r1.size); 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 | |
216 * r1.base
218 * Expect to merge the two entries into one region that starts at r1.base
229 struct region r1 = { in memblock_add_overlap_bottom_check() local
240 total_size = (r2.base - r1.base) + r2.size; in memblock_add_overlap_bottom_check()
243 memblock_add(r1.base, r1.size); in memblock_add_overlap_bottom_check()
246 ASSERT_EQ(rgn->base, r1.base); 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 |
267 * r1.base
278 struct region r1 = { in memblock_add_within_check() local
290 memblock_add(r1.base, r1.size); in memblock_add_within_check()
293 ASSERT_EQ(rgn->base, r1.base); in memblock_add_within_check()
294 ASSERT_EQ(rgn->size, r1.size); in memblock_add_within_check()
297 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_add_within_check()
335 * | | r1 | r3 | r2 | |
338 * Expect to merge the three entries into one region that starts at r1.base
339 * and has size of r1.size + r2.size + r3.size. The region counter and total
349 struct region r1 = { in memblock_add_between_check() local
364 total_size = r1.size + r2.size + r3.size; in memblock_add_between_check()
367 memblock_add(r1.base, r1.size); in memblock_add_between_check()
371 ASSERT_EQ(rgn->base, r1.base); in memblock_add_between_check()
481 * | |r1| | r2 | |
495 struct region r1 = { in memblock_reserve_disjoint_check() local
507 memblock_reserve(r1.base, r1.size); in memblock_reserve_disjoint_check()
510 ASSERT_EQ(rgn1->base, r1.base); in memblock_reserve_disjoint_check()
511 ASSERT_EQ(rgn1->size, r1.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 | |
534 * | r1.base
549 struct region r1 = { in memblock_reserve_overlap_top_check() local
560 total_size = (r1.base - r2.base) + r1.size; in memblock_reserve_overlap_top_check()
563 memblock_reserve(r1.base, r1.size); 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 | |
589 * r1.base
591 * Expect to merge two entries into one region that starts at r1.base and
602 struct region r1 = { in memblock_reserve_overlap_bottom_check() local
613 total_size = (r2.base - r1.base) + r2.size; in memblock_reserve_overlap_bottom_check()
616 memblock_reserve(r1.base, r1.size); in memblock_reserve_overlap_bottom_check()
619 ASSERT_EQ(rgn->base, r1.base); 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 |
642 * r1.base
653 struct region r1 = { in memblock_reserve_within_check() local
665 memblock_reserve(r1.base, r1.size); in memblock_reserve_within_check()
668 ASSERT_EQ(rgn->base, r1.base); in memblock_reserve_within_check()
669 ASSERT_EQ(rgn->size, r1.size); in memblock_reserve_within_check()
672 ASSERT_EQ(memblock.reserved.total_size, r1.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
725 struct region r1 = { in memblock_reserve_between_check() local
740 total_size = r1.size + r2.size + r3.size; in memblock_reserve_between_check()
743 memblock_reserve(r1.base, r1.size); in memblock_reserve_between_check()
747 ASSERT_EQ(rgn->base, r1.base); in memblock_reserve_between_check()
823 * A simple test that tries to remove a region r1 from the array of
828 * | : r1 : | r2 | |
834 * Expect to add two memory blocks r1 and r2 and then remove r1 so that
844 struct region r1 = { in memblock_remove_simple_check() local
856 memblock_add(r1.base, r1.size); in memblock_remove_simple_check()
858 memblock_remove(r1.base, r1.size); in memblock_remove_simple_check()
879 * | | r1 | |
893 struct region r1 = { in memblock_remove_absent_check() local
905 memblock_add(r1.base, r1.size); in memblock_remove_absent_check()
908 ASSERT_EQ(rgn->base, r1.base); in memblock_remove_absent_check()
909 ASSERT_EQ(rgn->size, r1.size); in memblock_remove_absent_check()
912 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_remove_absent_check()
921 * beginning of the already existing entry r1
922 * (that is r1.base < r2.base + r2.size):
928 * | : r1 | rgn | |
933 * r1.base
945 struct region r1 = { in memblock_remove_overlap_top_check() local
956 r1_end = r1.base + r1.size; in memblock_remove_overlap_top_check()
961 memblock_add(r1.base, r1.size); in memblock_remove_overlap_top_check()
964 ASSERT_EQ(rgn->base, r1.base + r2.base); in memblock_remove_overlap_top_check()
977 * the already existing region r1 (that is r2.base < r1.base + r1.size):
983 * | |rgn| r1 : |
987 * r1.base
999 struct region r1 = { in memblock_remove_overlap_bottom_check() local
1010 total_size = r2.base - r1.base; in memblock_remove_overlap_bottom_check()
1013 memblock_add(r1.base, r1.size); in memblock_remove_overlap_bottom_check()
1016 ASSERT_EQ(rgn->base, r1.base); in memblock_remove_overlap_bottom_check()
1029 * the already existing entry r1 (that is
1030 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1036 * | | rgn1 | r1 | rgn2 | |
1040 * r1.base
1054 struct region r1 = { 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()
1070 memblock_add(r1.base, r1.size); in memblock_remove_within_check()
1073 ASSERT_EQ(rgn1->base, r1.base); in memblock_remove_within_check()
1088 * A simple test that tries to remove a region r1 from the array of
1089 * available memory regions when r1 is the only available region.
1090 * Expect to add a memory block r1 and then remove r1 so that a dummy
1100 struct region r1 = { in memblock_remove_only_region_check() local
1108 memblock_add(r1.base, r1.size); in memblock_remove_only_region_check()
1109 memblock_remove(r1.base, r1.size); in memblock_remove_only_region_check()
1144 struct region r1 = { in memblock_remove_near_max_check() local
1156 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_remove_near_max_check()
1159 memblock_add(r1.base, r1.size); in memblock_remove_near_max_check()
1162 ASSERT_EQ(rgn->base, r1.base); 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
1196 struct region r1 = { in memblock_remove_overlap_two_check() local
1213 new_r1_size = r3.base - r1.base; in memblock_remove_overlap_two_check()
1218 memblock_add(r1.base, r1.size); in memblock_remove_overlap_two_check()
1222 ASSERT_EQ(rgn1->base, r1.base); in memblock_remove_overlap_two_check()
1257 * A simple test that tries to free a memory block r1 that was marked
1262 * | : r1 : | r2 | |
1268 * Expect to reserve two memory regions and then erase r1 region with the
1277 struct region r1 = { in memblock_free_simple_check() local
1289 memblock_reserve(r1.base, r1.size); in memblock_free_simple_check()
1291 memblock_free((void *)r1.base, r1.size); in memblock_free_simple_check()
1312 * | | r1 | |
1326 struct region r1 = { in memblock_free_absent_check() local
1338 memblock_reserve(r1.base, r1.size); in memblock_free_absent_check()
1341 ASSERT_EQ(rgn->base, r1.base); in memblock_free_absent_check()
1342 ASSERT_EQ(rgn->size, r1.size); in memblock_free_absent_check()
1345 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_free_absent_check()
1354 * of the already existing entry r1 (that is r1.base < r2.base + r2.size):
1360 * | : | r1 | |
1366 * r1.base
1378 struct region r1 = { in memblock_free_overlap_top_check() local
1389 total_size = (r1.size + r1.base) - (r2.base + r2.size); in memblock_free_overlap_top_check()
1392 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_top_check()
1408 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1414 * | | r1 | : |
1427 struct region r1 = { in memblock_free_overlap_bottom_check() local
1438 total_size = r2.base - r1.base; in memblock_free_overlap_bottom_check()
1441 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_bottom_check()
1444 ASSERT_EQ(rgn->base, r1.base); in memblock_free_overlap_bottom_check()
1457 * already existing entry r1 (that is
1458 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1464 * | | rgn1 | r1 | rgn2 |
1468 * r1.base
1482 struct region r1 = { 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()
1498 memblock_reserve(r1.base, r1.size); in memblock_free_within_check()
1501 ASSERT_EQ(rgn1->base, r1.base); in memblock_free_within_check()
1516 * A simple test that tries to free a memory block r1 that was marked
1517 * earlier as reserved when r1 is the only available region.
1518 * Expect to reserve a memory block r1 and then free r1 so that r1 is
1528 struct region r1 = { in memblock_free_only_region_check() local
1536 memblock_reserve(r1.base, r1.size); in memblock_free_only_region_check()
1537 memblock_free((void *)r1.base, r1.size); in memblock_free_only_region_check()
1571 struct region r1 = { in memblock_free_near_max_check() local
1583 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_free_near_max_check()
1586 memblock_reserve(r1.base, r1.size); in memblock_free_near_max_check()
1589 ASSERT_EQ(rgn->base, r1.base); 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
1623 struct region r1 = { in memblock_free_overlap_two_check() local
1640 new_r1_size = r3.base - r1.base; in memblock_free_overlap_two_check()
1645 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_two_check()
1649 ASSERT_EQ(rgn1->base, r1.base); in memblock_free_overlap_two_check()
1761 * A test that tries to trim memory when there are two available regions, r1 and
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
1785 struct region r1 = { in memblock_trim_memory_too_small_check() local
1797 memblock_add(r1.base, r1.size); in memblock_trim_memory_too_small_check()
1801 ASSERT_EQ(rgn->base, r1.base); in memblock_trim_memory_too_small_check()
1802 ASSERT_EQ(rgn->size, r1.size); in memblock_trim_memory_too_small_check()
1812 * A test that tries to trim memory when there are two available regions, r1 and
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.
1840 struct region r1 = { in memblock_trim_memory_unaligned_base_check() local
1855 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_base_check()
1859 ASSERT_EQ(rgn1->base, r1.base); in memblock_trim_memory_unaligned_base_check()
1860 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_base_check()
1873 * A test that tries to trim memory when there are two available regions, r1 and
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.
1901 struct region r1 = { in memblock_trim_memory_unaligned_end_check() local
1915 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_end_check()
1919 ASSERT_EQ(rgn1->base, r1.base); in memblock_trim_memory_unaligned_end_check()
1920 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_end_check()