Lines Matching full:base
36 * A simple test that adds a memory block of a specified base address
48 .base = SZ_1G, in memblock_add_simple_check()
55 memblock_add(r.base, r.size); in memblock_add_simple_check()
57 ASSERT_EQ(rgn->base, r.base); in memblock_add_simple_check()
69 * A simple test that adds a memory block of a specified base address, size,
81 .base = SZ_1M, in memblock_add_node_simple_check()
88 memblock_add_node(r.base, r.size, 1, MEMBLOCK_HOTPLUG); in memblock_add_node_simple_check()
90 ASSERT_EQ(rgn->base, r.base); in memblock_add_node_simple_check()
125 .base = SZ_1G, in memblock_add_disjoint_check()
129 .base = SZ_1G + SZ_16K, in memblock_add_disjoint_check()
136 memblock_add(r1.base, r1.size); in memblock_add_disjoint_check()
137 memblock_add(r2.base, r2.size); in memblock_add_disjoint_check()
139 ASSERT_EQ(rgn1->base, r1.base); in memblock_add_disjoint_check()
142 ASSERT_EQ(rgn2->base, r2.base); in memblock_add_disjoint_check()
155 * with the beginning of r1 (that is r1.base < r2.base + r2.size):
162 * | r1.base
164 * r2.base
166 * Expect to merge the two entries into one region that starts at r2.base
178 .base = SZ_512M, in memblock_add_overlap_top_check()
182 .base = SZ_256M, in memblock_add_overlap_top_check()
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()
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()
207 * with the end of r1 (that is r2.base < r1.base + r1.size):
214 * | r2.base
216 * r1.base
218 * Expect to merge the two entries into one region that starts at r1.base
230 .base = SZ_128M, in memblock_add_overlap_bottom_check()
234 .base = SZ_256M, in memblock_add_overlap_bottom_check()
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()
244 memblock_add(r2.base, r2.size); in memblock_add_overlap_bottom_check()
246 ASSERT_EQ(rgn->base, r1.base); in memblock_add_overlap_bottom_check()
259 * within the range of r1 (that is r1.base < r2.base &&
260 * r2.base + r2.size < r1.base + r1.size):
267 * r1.base
279 .base = SZ_8M, in memblock_add_within_check()
283 .base = SZ_16M, in memblock_add_within_check()
290 memblock_add(r1.base, r1.size); in memblock_add_within_check()
291 memblock_add(r2.base, r2.size); in memblock_add_within_check()
293 ASSERT_EQ(rgn->base, r1.base); in memblock_add_within_check()
311 .base = SZ_16K, in memblock_add_twice_check()
319 memblock_add(r.base, r.size); in memblock_add_twice_check()
320 memblock_add(r.base, r.size); in memblock_add_twice_check()
338 * Expect to merge the three entries into one region that starts at r1.base
350 .base = SZ_1G, in memblock_add_between_check()
354 .base = SZ_1G + SZ_16K, in memblock_add_between_check()
358 .base = SZ_1G + SZ_8K, in memblock_add_between_check()
367 memblock_add(r1.base, r1.size); in memblock_add_between_check()
368 memblock_add(r2.base, r2.size); in memblock_add_between_check()
369 memblock_add(r3.base, r3.size); in memblock_add_between_check()
371 ASSERT_EQ(rgn->base, r1.base); in memblock_add_between_check()
393 * Expect to add a memory block of size PHYS_ADDR_MAX - r.base. Expect the
404 .base = PHYS_ADDR_MAX - SZ_1M, in memblock_add_near_max_check()
410 total_size = PHYS_ADDR_MAX - r.base; in memblock_add_near_max_check()
413 memblock_add(r.base, r.size); in memblock_add_near_max_check()
415 ASSERT_EQ(rgn->base, r.base); in memblock_add_near_max_check()
448 * A simple test that marks a memory block of a specified base address
460 .base = SZ_2G, in memblock_reserve_simple_check()
467 memblock_reserve(r.base, r.size); in memblock_reserve_simple_check()
469 ASSERT_EQ(rgn->base, r.base); in memblock_reserve_simple_check()
496 .base = SZ_256M, in memblock_reserve_disjoint_check()
500 .base = SZ_512M, in memblock_reserve_disjoint_check()
507 memblock_reserve(r1.base, r1.size); in memblock_reserve_disjoint_check()
508 memblock_reserve(r2.base, r2.size); in memblock_reserve_disjoint_check()
510 ASSERT_EQ(rgn1->base, r1.base); in memblock_reserve_disjoint_check()
513 ASSERT_EQ(rgn2->base, r2.base); in memblock_reserve_disjoint_check()
527 * r1.base < r2.base + r2.size):
534 * | r1.base
536 * r2.base
538 * Expect to merge two entries into one region that starts at r2.base and
550 .base = SZ_1G, in memblock_reserve_overlap_top_check()
554 .base = SZ_128M, in memblock_reserve_overlap_top_check()
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()
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()
580 * r2.base < r1.base + r1.size):
587 * | r2.base
589 * r1.base
591 * Expect to merge two entries into one region that starts at r1.base and
603 .base = SZ_2K, in memblock_reserve_overlap_bottom_check()
607 .base = SZ_128K, in memblock_reserve_overlap_bottom_check()
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()
617 memblock_reserve(r2.base, r2.size); in memblock_reserve_overlap_bottom_check()
619 ASSERT_EQ(rgn->base, r1.base); in memblock_reserve_overlap_bottom_check()
633 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
640 * | r2.base
642 * r1.base
654 .base = SZ_1M, in memblock_reserve_within_check()
658 .base = SZ_2M, in memblock_reserve_within_check()
665 memblock_reserve(r1.base, r1.size); in memblock_reserve_within_check()
666 memblock_reserve(r2.base, r2.size); in memblock_reserve_within_check()
668 ASSERT_EQ(rgn->base, r1.base); in memblock_reserve_within_check()
687 .base = SZ_16K, in memblock_reserve_twice_check()
695 memblock_reserve(r.base, r.size); in memblock_reserve_twice_check()
696 memblock_reserve(r.base, r.size); in memblock_reserve_twice_check()
715 * r1.base and has size of r1.size + r2.size + r3.size. The region counter and
726 .base = SZ_1G, in memblock_reserve_between_check()
730 .base = SZ_1G + SZ_16K, in memblock_reserve_between_check()
734 .base = SZ_1G + SZ_8K, in memblock_reserve_between_check()
743 memblock_reserve(r1.base, r1.size); in memblock_reserve_between_check()
744 memblock_reserve(r2.base, r2.size); in memblock_reserve_between_check()
745 memblock_reserve(r3.base, r3.size); in memblock_reserve_between_check()
747 ASSERT_EQ(rgn->base, r1.base); in memblock_reserve_between_check()
769 * Expect to reserve a memory block of size PHYS_ADDR_MAX - r.base. Expect the
780 .base = PHYS_ADDR_MAX - SZ_1M, in memblock_reserve_near_max_check()
786 total_size = PHYS_ADDR_MAX - r.base; in memblock_reserve_near_max_check()
789 memblock_reserve(r.base, r.size); in memblock_reserve_near_max_check()
791 ASSERT_EQ(rgn->base, r.base); in memblock_reserve_near_max_check()
832 * rgn.base
845 .base = SZ_2K, in memblock_remove_simple_check()
849 .base = SZ_128K, in memblock_remove_simple_check()
856 memblock_add(r1.base, r1.size); in memblock_remove_simple_check()
857 memblock_add(r2.base, r2.size); in memblock_remove_simple_check()
858 memblock_remove(r1.base, r1.size); in memblock_remove_simple_check()
860 ASSERT_EQ(rgn->base, r2.base); in memblock_remove_simple_check()
883 * rgn.base
894 .base = SZ_512K, in memblock_remove_absent_check()
898 .base = SZ_64M, in memblock_remove_absent_check()
905 memblock_add(r1.base, r1.size); in memblock_remove_absent_check()
906 memblock_remove(r2.base, r2.size); in memblock_remove_absent_check()
908 ASSERT_EQ(rgn->base, r1.base); in memblock_remove_absent_check()
922 * (that is r1.base < r2.base + r2.size):
932 * | rgn.base
933 * r1.base
946 .base = SZ_32M, in memblock_remove_overlap_top_check()
950 .base = SZ_16M, in memblock_remove_overlap_top_check()
956 r1_end = r1.base + r1.size; in memblock_remove_overlap_top_check()
957 r2_end = r2.base + r2.size; in memblock_remove_overlap_top_check()
961 memblock_add(r1.base, r1.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()
977 * the already existing region r1 (that is r2.base < r1.base + r1.size):
987 * r1.base
1000 .base = SZ_2M, in memblock_remove_overlap_bottom_check()
1004 .base = SZ_32M, in memblock_remove_overlap_bottom_check()
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()
1014 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_bottom_check()
1016 ASSERT_EQ(rgn->base, r1.base); in memblock_remove_overlap_bottom_check()
1030 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1040 * r1.base
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
1055 .base = SZ_1M, in memblock_remove_within_check()
1059 .base = SZ_16M, in memblock_remove_within_check()
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()
1071 memblock_remove(r2.base, r2.size); in memblock_remove_within_check()
1073 ASSERT_EQ(rgn1->base, r1.base); in memblock_remove_within_check()
1076 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_remove_within_check()
1101 .base = SZ_2K, in memblock_remove_only_region_check()
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()
1111 ASSERT_EQ(rgn->base, 0); in memblock_remove_only_region_check()
1133 * Expect that only the portion between PHYS_ADDR_MAX and r2.base is removed.
1145 .base = PHYS_ADDR_MAX - SZ_2M, in memblock_remove_near_max_check()
1150 .base = PHYS_ADDR_MAX - SZ_1M, in memblock_remove_near_max_check()
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()
1160 memblock_remove(r2.base, r2.size); in memblock_remove_near_max_check()
1162 ASSERT_EQ(rgn->base, r1.base); in memblock_remove_near_max_check()
1197 .base = SZ_16M, in memblock_remove_overlap_two_check()
1201 .base = SZ_64M, in memblock_remove_overlap_two_check()
1205 .base = SZ_32M, in memblock_remove_overlap_two_check()
1211 r2_end = r2.base + r2.size; in memblock_remove_overlap_two_check()
1212 r3_end = r3.base + r3.size; in memblock_remove_overlap_two_check()
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()
1219 memblock_add(r2.base, r2.size); in memblock_remove_overlap_two_check()
1220 memblock_remove(r3.base, r3.size); in memblock_remove_overlap_two_check()
1222 ASSERT_EQ(rgn1->base, r1.base); in memblock_remove_overlap_two_check()
1225 ASSERT_EQ(rgn2->base, r3_end); in memblock_remove_overlap_two_check()
1266 * rgn.base
1278 .base = SZ_4M, in memblock_free_simple_check()
1282 .base = SZ_8M, in memblock_free_simple_check()
1289 memblock_reserve(r1.base, r1.size); in memblock_free_simple_check()
1290 memblock_reserve(r2.base, r2.size); in memblock_free_simple_check()
1291 memblock_free((void *)r1.base, r1.size); in memblock_free_simple_check()
1293 ASSERT_EQ(rgn->base, r2.base); in memblock_free_simple_check()
1316 * rgn.base
1327 .base = SZ_2M, in memblock_free_absent_check()
1331 .base = SZ_16M, in memblock_free_absent_check()
1338 memblock_reserve(r1.base, r1.size); in memblock_free_absent_check()
1339 memblock_free((void *)r2.base, r2.size); in memblock_free_absent_check()
1341 ASSERT_EQ(rgn->base, r1.base); in memblock_free_absent_check()
1354 * of the already existing entry r1 (that is r1.base < r2.base + r2.size):
1364 * | rgn.base
1366 * r1.base
1379 .base = SZ_8M, in memblock_free_overlap_top_check()
1383 .base = SZ_1M, in memblock_free_overlap_top_check()
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()
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()
1408 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1428 .base = SZ_8M, in memblock_free_overlap_bottom_check()
1432 .base = SZ_32M, in memblock_free_overlap_bottom_check()
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()
1442 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_bottom_check()
1444 ASSERT_EQ(rgn->base, r1.base); in memblock_free_overlap_bottom_check()
1458 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1468 * r1.base
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
1483 .base = SZ_1M, in memblock_free_within_check()
1487 .base = SZ_4M, in memblock_free_within_check()
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()
1499 memblock_free((void *)r2.base, r2.size); in memblock_free_within_check()
1501 ASSERT_EQ(rgn1->base, r1.base); in memblock_free_within_check()
1504 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_free_within_check()
1529 .base = SZ_2K, in memblock_free_only_region_check()
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()
1539 ASSERT_EQ(rgn->base, 0); in memblock_free_only_region_check()
1560 * Expect that only the portion between PHYS_ADDR_MAX and r2.base is freed.
1572 .base = PHYS_ADDR_MAX - SZ_2M, in memblock_free_near_max_check()
1577 .base = PHYS_ADDR_MAX - SZ_1M, in memblock_free_near_max_check()
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()
1587 memblock_free((void *)r2.base, r2.size); in memblock_free_near_max_check()
1589 ASSERT_EQ(rgn->base, r1.base); in memblock_free_near_max_check()
1624 .base = SZ_16M, in memblock_free_overlap_two_check()
1628 .base = SZ_64M, in memblock_free_overlap_two_check()
1632 .base = SZ_32M, in memblock_free_overlap_two_check()
1638 r2_end = r2.base + r2.size; in memblock_free_overlap_two_check()
1639 r3_end = r3.base + r3.size; in memblock_free_overlap_two_check()
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()
1646 memblock_reserve(r2.base, r2.size); in memblock_free_overlap_two_check()
1647 memblock_free((void *)r3.base, r3.size); in memblock_free_overlap_two_check()
1649 ASSERT_EQ(rgn1->base, r1.base); in memblock_free_overlap_two_check()
1652 ASSERT_EQ(rgn2->base, r3_end); in memblock_free_overlap_two_check()
1740 .base = alignment, in memblock_trim_memory_aligned_check()
1747 memblock_add(r.base, r.size); in memblock_trim_memory_aligned_check()
1750 ASSERT_EQ(rgn->base, r.base); in memblock_trim_memory_aligned_check()
1786 .base = alignment, in memblock_trim_memory_too_small_check()
1790 .base = alignment * 4, in memblock_trim_memory_too_small_check()
1797 memblock_add(r1.base, r1.size); in memblock_trim_memory_too_small_check()
1798 memblock_add(r2.base, r2.size); in memblock_trim_memory_too_small_check()
1801 ASSERT_EQ(rgn->base, r1.base); in memblock_trim_memory_too_small_check()
1813 * r2. Region r1 is aligned on both ends and region r2 is unaligned at the base
1827 * Expect that r1 will not be trimmed and r2 will be trimmed at the base.
1841 .base = alignment, in memblock_trim_memory_unaligned_base_check()
1845 .base = alignment * 4 + offset, in memblock_trim_memory_unaligned_base_check()
1851 new_r2_base = r2.base + (alignment - offset); in memblock_trim_memory_unaligned_base_check()
1855 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_base_check()
1856 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_base_check()
1859 ASSERT_EQ(rgn1->base, r1.base); in memblock_trim_memory_unaligned_base_check()
1862 ASSERT_EQ(rgn2->base, new_r2_base); in memblock_trim_memory_unaligned_base_check()
1874 * r2. Region r1 is aligned on both ends and region r2 is aligned at the base
1902 .base = alignment, in memblock_trim_memory_unaligned_end_check()
1906 .base = alignment * 4, in memblock_trim_memory_unaligned_end_check()
1915 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_end_check()
1916 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_end_check()
1919 ASSERT_EQ(rgn1->base, r1.base); in memblock_trim_memory_unaligned_end_check()
1922 ASSERT_EQ(rgn2->base, r2.base); in memblock_trim_memory_unaligned_end_check()