Lines Matching full:size

37  * and size to the collection of available memory regions (memblock.memory).
49 .size = SZ_4M in memblock_add_simple_check()
55 memblock_add(r.base, r.size); in memblock_add_simple_check()
58 ASSERT_EQ(rgn->size, r.size); in memblock_add_simple_check()
61 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_simple_check()
69 * A simple test that adds a memory block of a specified base address, size,
82 .size = SZ_16M in memblock_add_node_simple_check()
88 memblock_add_node(r.base, r.size, 1, MEMBLOCK_HOTPLUG); in memblock_add_node_simple_check()
91 ASSERT_EQ(rgn->size, r.size); in memblock_add_node_simple_check()
98 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_node_simple_check()
114 * available memory regions (memblock.memory). The total size and
126 .size = SZ_8K in memblock_add_disjoint_check()
130 .size = SZ_8K 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()
140 ASSERT_EQ(rgn1->size, r1.size); 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()
155 * with the beginning of r1 (that is r1.base < r2.base + r2.size):
167 * and has size of two regions minus their intersection. The total size of
179 .size = SZ_1G in memblock_add_overlap_top_check()
183 .size = SZ_512M 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()
195 ASSERT_EQ(rgn->size, total_size); in memblock_add_overlap_top_check()
207 * with the end of r1 (that is r2.base < r1.base + r1.size):
219 * and has size of two regions minus their intersection. The total size of
231 .size = SZ_512M in memblock_add_overlap_bottom_check()
235 .size = SZ_1G 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()
247 ASSERT_EQ(rgn->size, total_size); in memblock_add_overlap_bottom_check()
260 * r2.base + r2.size < r1.base + r1.size):
270 * The counter and total size of available memory are not updated.
280 .size = SZ_32M in memblock_add_within_check()
284 .size = SZ_1M 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()
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()
306 * the counter and total size of available memory to not be updated.
312 .size = SZ_2M 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()
323 ASSERT_EQ(memblock.memory.total_size, r.size); in memblock_add_twice_check()
339 * and has size of r1.size + r2.size + r3.size. The region counter and total
340 * size of the available memory are updated.
351 .size = SZ_8K in memblock_add_between_check()
355 .size = SZ_8K in memblock_add_between_check()
359 .size = SZ_8K in memblock_add_between_check()
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()
368 memblock_add(r2.base, r2.size); in memblock_add_between_check()
369 memblock_add(r3.base, r3.size); in memblock_add_between_check()
372 ASSERT_EQ(rgn->size, total_size); in memblock_add_between_check()
393 * Expect to add a memory block of size PHYS_ADDR_MAX - r.base. Expect the
394 * total size of available memory and the counter to be updated.
405 .size = SZ_2M in memblock_add_near_max_check()
413 memblock_add(r.base, r.size); in memblock_add_near_max_check()
416 ASSERT_EQ(rgn->size, total_size); in memblock_add_near_max_check()
438 .size = SZ_16K, in memblock_add_many_check()
441 phys_addr_t base, size = SZ_64; in memblock_add_many_check() local
470 memblock_add(base, size); in memblock_add_many_check()
471 base += size + gap_size; in memblock_add_many_check()
475 (i + 1) * size); in memblock_add_many_check()
492 memblock_add(r.base, r.size); in memblock_add_many_check()
494 ASSERT_EQ(memblock.memory.regions[0].size, r.size); in memblock_add_many_check()
497 ASSERT_EQ(memblock.memory.total_size, INIT_MEMBLOCK_REGIONS * size + in memblock_add_many_check()
499 r.size); in memblock_add_many_check()
542 * and size as reserved and to the collection of reserved memory regions
544 * and total memory size are updated.
554 .size = SZ_128M in memblock_reserve_simple_check()
560 memblock_reserve(r.base, r.size); in memblock_reserve_simple_check()
563 ASSERT_EQ(rgn->size, r.size); in memblock_reserve_simple_check()
578 * (memblock.reserved). The total size and region counter for
590 .size = SZ_16M in memblock_reserve_disjoint_check()
594 .size = SZ_512M in memblock_reserve_disjoint_check()
600 memblock_reserve(r1.base, r1.size); in memblock_reserve_disjoint_check()
601 memblock_reserve(r2.base, r2.size); in memblock_reserve_disjoint_check()
604 ASSERT_EQ(rgn1->size, r1.size); in memblock_reserve_disjoint_check()
607 ASSERT_EQ(rgn2->size, r2.size); in memblock_reserve_disjoint_check()
610 ASSERT_EQ(memblock.reserved.total_size, r1.size + r2.size); in memblock_reserve_disjoint_check()
620 * r1.base < r2.base + r2.size):
632 * has size of two regions minus their intersection. The total size of the
644 .size = SZ_1G in memblock_reserve_overlap_top_check()
648 .size = SZ_1G in memblock_reserve_overlap_top_check()
653 total_size = (r1.base - r2.base) + r1.size; in memblock_reserve_overlap_top_check()
656 memblock_reserve(r1.base, r1.size); in memblock_reserve_overlap_top_check()
657 memblock_reserve(r2.base, r2.size); in memblock_reserve_overlap_top_check()
660 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_overlap_top_check()
673 * r2.base < r1.base + r1.size):
685 * has size of two regions minus their intersection. The total size of the
697 .size = SZ_128K in memblock_reserve_overlap_bottom_check()
701 .size = SZ_128K in memblock_reserve_overlap_bottom_check()
706 total_size = (r2.base - r1.base) + r2.size; in memblock_reserve_overlap_bottom_check()
709 memblock_reserve(r1.base, r1.size); in memblock_reserve_overlap_bottom_check()
710 memblock_reserve(r2.base, r2.size); in memblock_reserve_overlap_bottom_check()
713 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_overlap_bottom_check()
726 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
738 * counter and total size of available memory are not updated.
748 .size = SZ_8M in memblock_reserve_within_check()
752 .size = SZ_64K in memblock_reserve_within_check()
758 memblock_reserve(r1.base, r1.size); in memblock_reserve_within_check()
759 memblock_reserve(r2.base, r2.size); in memblock_reserve_within_check()
762 ASSERT_EQ(rgn->size, r1.size); in memblock_reserve_within_check()
765 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_reserve_within_check()
774 * Expect the region counter and total size of reserved memory to not
781 .size = SZ_2M in memblock_reserve_twice_check()
788 memblock_reserve(r.base, r.size); in memblock_reserve_twice_check()
789 memblock_reserve(r.base, r.size); in memblock_reserve_twice_check()
792 ASSERT_EQ(memblock.reserved.total_size, r.size); in memblock_reserve_twice_check()
808 * r1.base and has size of r1.size + r2.size + r3.size. The region counter and
820 .size = SZ_8K in memblock_reserve_between_check()
824 .size = SZ_8K in memblock_reserve_between_check()
828 .size = SZ_8K in memblock_reserve_between_check()
833 total_size = r1.size + r2.size + r3.size; in memblock_reserve_between_check()
836 memblock_reserve(r1.base, r1.size); in memblock_reserve_between_check()
837 memblock_reserve(r2.base, r2.size); in memblock_reserve_between_check()
838 memblock_reserve(r3.base, r3.size); in memblock_reserve_between_check()
841 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_between_check()
862 * Expect to reserve a memory block of size PHYS_ADDR_MAX - r.base. Expect the
863 * total size of reserved memory and the counter to be updated.
874 .size = SZ_2M in memblock_reserve_near_max_check()
882 memblock_reserve(r.base, r.size); in memblock_reserve_near_max_check()
885 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_near_max_check()
907 .size = SZ_16K, in memblock_reserve_many_check()
938 * This is the memory region size used by the doubled reserved.regions, in memblock_reserve_many_check()
939 * and it has been reserved due to it has been used. The size is used to in memblock_reserve_many_check()
948 * one more reserved region's size is new_reserved_regions_size. in memblock_reserve_many_check()
959 memblock_reserve(r.base, r.size); in memblock_reserve_many_check()
961 ASSERT_EQ(memblock.reserved.regions[0].size, r.size); in memblock_reserve_many_check()
966 r.size); in memblock_reserve_many_check()
1006 .size = SZ_16K, in memblock_reserve_all_locations_check()
1043 * This is the memory region size used by the doubled reserved.regions, in memblock_reserve_all_locations_check()
1044 * and it has been reserved due to it has been used. The size is used to in memblock_reserve_all_locations_check()
1053 * one more reserved region's size is new_reserved_regions_size. in memblock_reserve_all_locations_check()
1064 memblock_reserve(r.base, r.size); in memblock_reserve_all_locations_check()
1066 ASSERT_EQ(memblock.reserved.regions[0].size, r.size); in memblock_reserve_all_locations_check()
1071 r.size); in memblock_reserve_all_locations_check()
1129 .size = SZ_16K, in memblock_reserve_many_may_conflict_check()
1184 * This is the memory region size used by the doubled reserved.regions, in memblock_reserve_many_may_conflict_check()
1185 * and it has been reserved due to it has been used. The size is used to in memblock_reserve_many_may_conflict_check()
1194 * one more reserved region's size is new_reserved_regions_size. in memblock_reserve_many_may_conflict_check()
1203 * with the size of new_reserved_regions_size and the base to be in memblock_reserve_many_may_conflict_check()
1206 ASSERT_EQ(memblock.reserved.regions[0].base + memblock.reserved.regions[0].size, in memblock_reserve_many_may_conflict_check()
1208 ASSERT_EQ(memblock.reserved.regions[0].size, new_reserved_regions_size); in memblock_reserve_many_may_conflict_check()
1214 memblock_reserve(r.base, r.size); in memblock_reserve_many_may_conflict_check()
1216 ASSERT_EQ(memblock.reserved.regions[0].size, r.size); in memblock_reserve_many_may_conflict_check()
1221 r.size); in memblock_reserve_many_may_conflict_check()
1277 * r2 is the first available region. The region counter and total size
1288 .size = SZ_4K in memblock_remove_simple_check()
1292 .size = SZ_4M in memblock_remove_simple_check()
1298 memblock_add(r1.base, r1.size); in memblock_remove_simple_check()
1299 memblock_add(r2.base, r2.size); in memblock_remove_simple_check()
1300 memblock_remove(r1.base, r1.size); in memblock_remove_simple_check()
1303 ASSERT_EQ(rgn->size, r2.size); in memblock_remove_simple_check()
1306 ASSERT_EQ(memblock.memory.total_size, r2.size); in memblock_remove_simple_check()
1327 * Expect the array, regions counter and total size to not be modified.
1337 .size = SZ_4M in memblock_remove_absent_check()
1341 .size = SZ_1G in memblock_remove_absent_check()
1347 memblock_add(r1.base, r1.size); in memblock_remove_absent_check()
1348 memblock_remove(r2.base, r2.size); in memblock_remove_absent_check()
1351 ASSERT_EQ(rgn->size, r1.size); in memblock_remove_absent_check()
1354 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_remove_absent_check()
1364 * (that is r1.base < r2.base + r2.size):
1378 * available memory pool. The regions counter and total size are updated.
1389 .size = SZ_32M in memblock_remove_overlap_top_check()
1393 .size = SZ_32M in memblock_remove_overlap_top_check()
1398 r1_end = r1.base + r1.size; in memblock_remove_overlap_top_check()
1399 r2_end = r2.base + r2.size; in memblock_remove_overlap_top_check()
1403 memblock_add(r1.base, r1.size); in memblock_remove_overlap_top_check()
1404 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_top_check()
1407 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_top_check()
1419 * the already existing region r1 (that is r2.base < r1.base + r1.size):
1432 * available memory pool. The regions counter and total size are updated.
1443 .size = SZ_64M in memblock_remove_overlap_bottom_check()
1447 .size = SZ_256M in memblock_remove_overlap_bottom_check()
1455 memblock_add(r1.base, r1.size); in memblock_remove_overlap_bottom_check()
1456 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_bottom_check()
1459 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_bottom_check()
1472 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1485 * another that starts at r2.base + r2.size, with appropriate sizes. The
1486 * region counter and total size are updated.
1498 .size = SZ_32M in memblock_remove_within_check()
1502 .size = SZ_1M in memblock_remove_within_check()
1508 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_remove_within_check()
1512 memblock_add(r1.base, r1.size); in memblock_remove_within_check()
1513 memblock_remove(r2.base, r2.size); in memblock_remove_within_check()
1516 ASSERT_EQ(rgn1->size, r1_size); in memblock_remove_within_check()
1518 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_remove_within_check()
1519 ASSERT_EQ(rgn2->size, r2_size); in memblock_remove_within_check()
1533 * region is added. The region counter stays the same, and the total size
1544 .size = SZ_4K in memblock_remove_only_region_check()
1550 memblock_add(r1.base, r1.size); in memblock_remove_only_region_check()
1551 memblock_remove(r1.base, r1.size); in memblock_remove_only_region_check()
1554 ASSERT_EQ(rgn->size, 0); in memblock_remove_only_region_check()
1576 * Expect the total size of available memory to be updated and the counter to
1588 .size = SZ_2M in memblock_remove_near_max_check()
1593 .size = SZ_2M in memblock_remove_near_max_check()
1598 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_remove_near_max_check()
1601 memblock_add(r1.base, r1.size); in memblock_remove_near_max_check()
1602 memblock_remove(r2.base, r2.size); in memblock_remove_near_max_check()
1605 ASSERT_EQ(rgn->size, total_size); in memblock_remove_near_max_check()
1627 * from the available memory pool. Expect the total size of available memory to
1640 .size = SZ_32M in memblock_remove_overlap_two_check()
1644 .size = SZ_64M in memblock_remove_overlap_two_check()
1648 .size = SZ_64M in memblock_remove_overlap_two_check()
1653 r2_end = r2.base + r2.size; in memblock_remove_overlap_two_check()
1654 r3_end = r3.base + r3.size; in memblock_remove_overlap_two_check()
1660 memblock_add(r1.base, r1.size); in memblock_remove_overlap_two_check()
1661 memblock_add(r2.base, r2.size); in memblock_remove_overlap_two_check()
1662 memblock_remove(r3.base, r3.size); in memblock_remove_overlap_two_check()
1665 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_remove_overlap_two_check()
1668 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_remove_overlap_two_check()
1711 * value of r2. The region counter and total size are updated.
1721 .size = SZ_1M in memblock_free_simple_check()
1725 .size = SZ_1M in memblock_free_simple_check()
1731 memblock_reserve(r1.base, r1.size); in memblock_free_simple_check()
1732 memblock_reserve(r2.base, r2.size); in memblock_free_simple_check()
1733 memblock_free((void *)r1.base, r1.size); in memblock_free_simple_check()
1736 ASSERT_EQ(rgn->size, r2.size); in memblock_free_simple_check()
1739 ASSERT_EQ(memblock.reserved.total_size, r2.size); in memblock_free_simple_check()
1760 * The array, regions counter and total size are not modified.
1770 .size = SZ_8K in memblock_free_absent_check()
1774 .size = SZ_128M in memblock_free_absent_check()
1780 memblock_reserve(r1.base, r1.size); in memblock_free_absent_check()
1781 memblock_free((void *)r2.base, r2.size); in memblock_free_absent_check()
1784 ASSERT_EQ(rgn->size, r1.size); in memblock_free_absent_check()
1787 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_free_absent_check()
1796 * of the already existing entry r1 (that is r1.base < r2.base + r2.size):
1811 * regions counter and total size are updated.
1822 .size = SZ_32M in memblock_free_overlap_top_check()
1826 .size = SZ_8M in memblock_free_overlap_top_check()
1831 total_size = (r1.size + r1.base) - (r2.base + r2.size); in memblock_free_overlap_top_check()
1834 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_top_check()
1835 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_top_check()
1837 ASSERT_EQ(rgn->base, r2.base + r2.size); in memblock_free_overlap_top_check()
1838 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_top_check()
1850 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1860 * regions counter and total size are updated.
1871 .size = SZ_32M in memblock_free_overlap_bottom_check()
1875 .size = SZ_32M in memblock_free_overlap_bottom_check()
1883 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_bottom_check()
1884 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_bottom_check()
1887 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_bottom_check()
1900 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1913 * another that starts at r2.base + r2.size, with appropriate sizes. The
1914 * region counter and total size fields are updated.
1926 .size = SZ_8M in memblock_free_within_check()
1930 .size = SZ_1M in memblock_free_within_check()
1936 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_free_within_check()
1940 memblock_reserve(r1.base, r1.size); in memblock_free_within_check()
1941 memblock_free((void *)r2.base, r2.size); in memblock_free_within_check()
1944 ASSERT_EQ(rgn1->size, r1_size); in memblock_free_within_check()
1946 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_free_within_check()
1947 ASSERT_EQ(rgn2->size, r2_size); in memblock_free_within_check()
1962 * and the total size is updated.
1972 .size = SZ_4K in memblock_free_only_region_check()
1978 memblock_reserve(r1.base, r1.size); in memblock_free_only_region_check()
1979 memblock_free((void *)r1.base, r1.size); in memblock_free_only_region_check()
1982 ASSERT_EQ(rgn->size, 0); in memblock_free_only_region_check()
2003 * Expect the total size of reserved memory to be updated and the counter to
2015 .size = SZ_2M in memblock_free_near_max_check()
2020 .size = SZ_2M in memblock_free_near_max_check()
2025 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_free_near_max_check()
2028 memblock_reserve(r1.base, r1.size); in memblock_free_near_max_check()
2029 memblock_free((void *)r2.base, r2.size); in memblock_free_near_max_check()
2032 ASSERT_EQ(rgn->size, total_size); in memblock_free_near_max_check()
2054 * from the collection of reserved memory. Expect the total size of reserved
2067 .size = SZ_32M in memblock_free_overlap_two_check()
2071 .size = SZ_64M in memblock_free_overlap_two_check()
2075 .size = SZ_64M in memblock_free_overlap_two_check()
2080 r2_end = r2.base + r2.size; in memblock_free_overlap_two_check()
2081 r3_end = r3.base + r3.size; in memblock_free_overlap_two_check()
2087 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_two_check()
2088 memblock_reserve(r2.base, r2.size); in memblock_free_overlap_two_check()
2089 memblock_free((void *)r3.base, r3.size); in memblock_free_overlap_two_check()
2092 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_free_overlap_two_check()
2095 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_free_overlap_two_check()
2183 .size = alignment * 4 in memblock_trim_memory_aligned_check()
2189 memblock_add(r.base, r.size); in memblock_trim_memory_aligned_check()
2193 ASSERT_EQ(rgn->size, r.size); in memblock_trim_memory_aligned_check()
2229 .size = alignment * 2 in memblock_trim_memory_too_small_check()
2233 .size = alignment - SZ_2 in memblock_trim_memory_too_small_check()
2239 memblock_add(r1.base, r1.size); in memblock_trim_memory_too_small_check()
2240 memblock_add(r2.base, r2.size); in memblock_trim_memory_too_small_check()
2244 ASSERT_EQ(rgn->size, r1.size); in memblock_trim_memory_too_small_check()
2284 .size = alignment * 2 in memblock_trim_memory_unaligned_base_check()
2288 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_base_check()
2294 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_base_check()
2297 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_base_check()
2298 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_base_check()
2302 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_base_check()
2305 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_base_check()
2345 .size = alignment * 2 in memblock_trim_memory_unaligned_end_check()
2349 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_end_check()
2354 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_end_check()
2357 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_end_check()
2358 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_end_check()
2362 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_end_check()
2365 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_end_check()
2394 .size = SZ_4M in memblock_overlaps_region_check()
2400 memblock_add(r.base, r.size); in memblock_overlaps_region_check()