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()
1019 * r2 is the first available region. The region counter and total size
1030 .size = SZ_4K in memblock_remove_simple_check()
1034 .size = SZ_4M in memblock_remove_simple_check()
1040 memblock_add(r1.base, r1.size); in memblock_remove_simple_check()
1041 memblock_add(r2.base, r2.size); in memblock_remove_simple_check()
1042 memblock_remove(r1.base, r1.size); in memblock_remove_simple_check()
1045 ASSERT_EQ(rgn->size, r2.size); in memblock_remove_simple_check()
1048 ASSERT_EQ(memblock.memory.total_size, r2.size); in memblock_remove_simple_check()
1069 * Expect the array, regions counter and total size to not be modified.
1079 .size = SZ_4M in memblock_remove_absent_check()
1083 .size = SZ_1G in memblock_remove_absent_check()
1089 memblock_add(r1.base, r1.size); in memblock_remove_absent_check()
1090 memblock_remove(r2.base, r2.size); in memblock_remove_absent_check()
1093 ASSERT_EQ(rgn->size, r1.size); in memblock_remove_absent_check()
1096 ASSERT_EQ(memblock.memory.total_size, r1.size); in memblock_remove_absent_check()
1106 * (that is r1.base < r2.base + r2.size):
1120 * available memory pool. The regions counter and total size are updated.
1131 .size = SZ_32M in memblock_remove_overlap_top_check()
1135 .size = SZ_32M in memblock_remove_overlap_top_check()
1140 r1_end = r1.base + r1.size; in memblock_remove_overlap_top_check()
1141 r2_end = r2.base + r2.size; in memblock_remove_overlap_top_check()
1145 memblock_add(r1.base, r1.size); in memblock_remove_overlap_top_check()
1146 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_top_check()
1149 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_top_check()
1161 * the already existing region r1 (that is r2.base < r1.base + r1.size):
1174 * available memory pool. The regions counter and total size are updated.
1185 .size = SZ_64M in memblock_remove_overlap_bottom_check()
1189 .size = SZ_256M in memblock_remove_overlap_bottom_check()
1197 memblock_add(r1.base, r1.size); in memblock_remove_overlap_bottom_check()
1198 memblock_remove(r2.base, r2.size); in memblock_remove_overlap_bottom_check()
1201 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_bottom_check()
1214 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1227 * another that starts at r2.base + r2.size, with appropriate sizes. The
1228 * region counter and total size are updated.
1240 .size = SZ_32M in memblock_remove_within_check()
1244 .size = SZ_1M in memblock_remove_within_check()
1250 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_remove_within_check()
1254 memblock_add(r1.base, r1.size); in memblock_remove_within_check()
1255 memblock_remove(r2.base, r2.size); in memblock_remove_within_check()
1258 ASSERT_EQ(rgn1->size, r1_size); in memblock_remove_within_check()
1260 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_remove_within_check()
1261 ASSERT_EQ(rgn2->size, r2_size); in memblock_remove_within_check()
1275 * region is added. The region counter stays the same, and the total size
1286 .size = SZ_4K in memblock_remove_only_region_check()
1292 memblock_add(r1.base, r1.size); in memblock_remove_only_region_check()
1293 memblock_remove(r1.base, r1.size); in memblock_remove_only_region_check()
1296 ASSERT_EQ(rgn->size, 0); in memblock_remove_only_region_check()
1318 * Expect the total size of available memory to be updated and the counter to
1330 .size = SZ_2M in memblock_remove_near_max_check()
1335 .size = SZ_2M in memblock_remove_near_max_check()
1340 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_remove_near_max_check()
1343 memblock_add(r1.base, r1.size); in memblock_remove_near_max_check()
1344 memblock_remove(r2.base, r2.size); in memblock_remove_near_max_check()
1347 ASSERT_EQ(rgn->size, total_size); in memblock_remove_near_max_check()
1369 * from the available memory pool. Expect the total size of available memory to
1382 .size = SZ_32M in memblock_remove_overlap_two_check()
1386 .size = SZ_64M in memblock_remove_overlap_two_check()
1390 .size = SZ_64M in memblock_remove_overlap_two_check()
1395 r2_end = r2.base + r2.size; in memblock_remove_overlap_two_check()
1396 r3_end = r3.base + r3.size; in memblock_remove_overlap_two_check()
1402 memblock_add(r1.base, r1.size); in memblock_remove_overlap_two_check()
1403 memblock_add(r2.base, r2.size); in memblock_remove_overlap_two_check()
1404 memblock_remove(r3.base, r3.size); in memblock_remove_overlap_two_check()
1407 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_remove_overlap_two_check()
1410 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_remove_overlap_two_check()
1453 * value of r2. The region counter and total size are updated.
1463 .size = SZ_1M in memblock_free_simple_check()
1467 .size = SZ_1M in memblock_free_simple_check()
1473 memblock_reserve(r1.base, r1.size); in memblock_free_simple_check()
1474 memblock_reserve(r2.base, r2.size); in memblock_free_simple_check()
1475 memblock_free((void *)r1.base, r1.size); in memblock_free_simple_check()
1478 ASSERT_EQ(rgn->size, r2.size); in memblock_free_simple_check()
1481 ASSERT_EQ(memblock.reserved.total_size, r2.size); in memblock_free_simple_check()
1502 * The array, regions counter and total size are not modified.
1512 .size = SZ_8K in memblock_free_absent_check()
1516 .size = SZ_128M in memblock_free_absent_check()
1522 memblock_reserve(r1.base, r1.size); in memblock_free_absent_check()
1523 memblock_free((void *)r2.base, r2.size); in memblock_free_absent_check()
1526 ASSERT_EQ(rgn->size, r1.size); in memblock_free_absent_check()
1529 ASSERT_EQ(memblock.reserved.total_size, r1.size); in memblock_free_absent_check()
1538 * of the already existing entry r1 (that is r1.base < r2.base + r2.size):
1553 * regions counter and total size are updated.
1564 .size = SZ_32M in memblock_free_overlap_top_check()
1568 .size = SZ_8M in memblock_free_overlap_top_check()
1573 total_size = (r1.size + r1.base) - (r2.base + r2.size); in memblock_free_overlap_top_check()
1576 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_top_check()
1577 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_top_check()
1579 ASSERT_EQ(rgn->base, r2.base + r2.size); in memblock_free_overlap_top_check()
1580 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_top_check()
1592 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1602 * regions counter and total size are updated.
1613 .size = SZ_32M in memblock_free_overlap_bottom_check()
1617 .size = SZ_32M in memblock_free_overlap_bottom_check()
1625 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_bottom_check()
1626 memblock_free((void *)r2.base, r2.size); in memblock_free_overlap_bottom_check()
1629 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_bottom_check()
1642 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1655 * another that starts at r2.base + r2.size, with appropriate sizes. The
1656 * region counter and total size fields are updated.
1668 .size = SZ_8M in memblock_free_within_check()
1672 .size = SZ_1M in memblock_free_within_check()
1678 r2_size = (r1.base + r1.size) - (r2.base + r2.size); in memblock_free_within_check()
1682 memblock_reserve(r1.base, r1.size); in memblock_free_within_check()
1683 memblock_free((void *)r2.base, r2.size); in memblock_free_within_check()
1686 ASSERT_EQ(rgn1->size, r1_size); in memblock_free_within_check()
1688 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_free_within_check()
1689 ASSERT_EQ(rgn2->size, r2_size); in memblock_free_within_check()
1704 * and the total size is updated.
1714 .size = SZ_4K in memblock_free_only_region_check()
1720 memblock_reserve(r1.base, r1.size); in memblock_free_only_region_check()
1721 memblock_free((void *)r1.base, r1.size); in memblock_free_only_region_check()
1724 ASSERT_EQ(rgn->size, 0); in memblock_free_only_region_check()
1745 * Expect the total size of reserved memory to be updated and the counter to
1757 .size = SZ_2M in memblock_free_near_max_check()
1762 .size = SZ_2M in memblock_free_near_max_check()
1767 total_size = r1.size - (PHYS_ADDR_MAX - r2.base); in memblock_free_near_max_check()
1770 memblock_reserve(r1.base, r1.size); in memblock_free_near_max_check()
1771 memblock_free((void *)r2.base, r2.size); in memblock_free_near_max_check()
1774 ASSERT_EQ(rgn->size, total_size); in memblock_free_near_max_check()
1796 * from the collection of reserved memory. Expect the total size of reserved
1809 .size = SZ_32M in memblock_free_overlap_two_check()
1813 .size = SZ_64M in memblock_free_overlap_two_check()
1817 .size = SZ_64M in memblock_free_overlap_two_check()
1822 r2_end = r2.base + r2.size; in memblock_free_overlap_two_check()
1823 r3_end = r3.base + r3.size; in memblock_free_overlap_two_check()
1829 memblock_reserve(r1.base, r1.size); in memblock_free_overlap_two_check()
1830 memblock_reserve(r2.base, r2.size); in memblock_free_overlap_two_check()
1831 memblock_free((void *)r3.base, r3.size); in memblock_free_overlap_two_check()
1834 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_free_overlap_two_check()
1837 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_free_overlap_two_check()
1925 .size = alignment * 4 in memblock_trim_memory_aligned_check()
1931 memblock_add(r.base, r.size); in memblock_trim_memory_aligned_check()
1935 ASSERT_EQ(rgn->size, r.size); in memblock_trim_memory_aligned_check()
1971 .size = alignment * 2 in memblock_trim_memory_too_small_check()
1975 .size = alignment - SZ_2 in memblock_trim_memory_too_small_check()
1981 memblock_add(r1.base, r1.size); in memblock_trim_memory_too_small_check()
1982 memblock_add(r2.base, r2.size); in memblock_trim_memory_too_small_check()
1986 ASSERT_EQ(rgn->size, r1.size); in memblock_trim_memory_too_small_check()
2026 .size = alignment * 2 in memblock_trim_memory_unaligned_base_check()
2030 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_base_check()
2036 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_base_check()
2039 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_base_check()
2040 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_base_check()
2044 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_base_check()
2047 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_base_check()
2087 .size = alignment * 2 in memblock_trim_memory_unaligned_end_check()
2091 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_end_check()
2096 new_r2_size = r2.size - (alignment - offset); in memblock_trim_memory_unaligned_end_check()
2099 memblock_add(r1.base, r1.size); in memblock_trim_memory_unaligned_end_check()
2100 memblock_add(r2.base, r2.size); in memblock_trim_memory_unaligned_end_check()
2104 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_end_check()
2107 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_end_check()