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()
449 * and size as reserved and to the collection of reserved memory regions
451 * and total memory size are updated.
461 .size = SZ_128M in memblock_reserve_simple_check()
467 memblock_reserve(r.base, r.size); in memblock_reserve_simple_check()
470 ASSERT_EQ(rgn->size, r.size); in memblock_reserve_simple_check()
485 * (memblock.reserved). The total size and region counter for
497 .size = SZ_16M in memblock_reserve_disjoint_check()
501 .size = 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()
511 ASSERT_EQ(rgn1->size, r1.size); 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()
527 * r1.base < r2.base + r2.size):
539 * has size of two regions minus their intersection. The total size of the
551 .size = SZ_1G in memblock_reserve_overlap_top_check()
555 .size = SZ_1G 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()
567 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_overlap_top_check()
580 * r2.base < r1.base + r1.size):
592 * has size of two regions minus their intersection. The total size of the
604 .size = SZ_128K in memblock_reserve_overlap_bottom_check()
608 .size = 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()
620 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_overlap_bottom_check()
633 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
645 * counter and total size of available memory are not updated.
655 .size = SZ_8M in memblock_reserve_within_check()
659 .size = SZ_64K 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()
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()
681 * Expect the region counter and total size of reserved memory to not
688 .size = SZ_2M 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()
699 ASSERT_EQ(memblock.reserved.total_size, r.size); in memblock_reserve_twice_check()
715 * r1.base and has size of r1.size + r2.size + r3.size. The region counter and
727 .size = SZ_8K in memblock_reserve_between_check()
731 .size = SZ_8K in memblock_reserve_between_check()
735 .size = SZ_8K in memblock_reserve_between_check()
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()
744 memblock_reserve(r2.base, r2.size); in memblock_reserve_between_check()
745 memblock_reserve(r3.base, r3.size); in memblock_reserve_between_check()
748 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_between_check()
769 * Expect to reserve a memory block of size PHYS_ADDR_MAX - r.base. Expect the
770 * total size of reserved memory and the counter to be updated.
781 .size = SZ_2M in memblock_reserve_near_max_check()
789 memblock_reserve(r.base, r.size); in memblock_reserve_near_max_check()
792 ASSERT_EQ(rgn->size, total_size); in memblock_reserve_near_max_check()
835 * r2 is the first available region. The region counter and total size
846 .size = SZ_4K in memblock_remove_simple_check()
850 .size = SZ_4M 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()
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()
885 * Expect the array, regions counter and total size to not be modified.
895 .size = SZ_4M in memblock_remove_absent_check()
899 .size = SZ_1G 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()
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()
922 * (that is r1.base < r2.base + r2.size):
936 * available memory pool. The regions counter and total size are updated.
947 .size = SZ_32M in memblock_remove_overlap_top_check()
951 .size = SZ_32M 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()
965 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_top_check()
977 * the already existing region r1 (that is r2.base < r1.base + r1.size):
990 * available memory pool. The regions counter and total size are updated.
1001 .size = SZ_64M in memblock_remove_overlap_bottom_check()
1005 .size = SZ_256M 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()
1017 ASSERT_EQ(rgn->size, total_size); in memblock_remove_overlap_bottom_check()
1030 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1043 * another that starts at r2.base + r2.size, with appropriate sizes. The
1044 * region counter and total size are updated.
1056 .size = SZ_32M in memblock_remove_within_check()
1060 .size = SZ_1M 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()
1074 ASSERT_EQ(rgn1->size, r1_size); in memblock_remove_within_check()
1076 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_remove_within_check()
1077 ASSERT_EQ(rgn2->size, r2_size); in memblock_remove_within_check()
1091 * region is added. The region counter stays the same, and the total size
1102 .size = SZ_4K 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()
1112 ASSERT_EQ(rgn->size, 0); in memblock_remove_only_region_check()
1134 * Expect the total size of available memory to be updated and the counter to
1146 .size = SZ_2M in memblock_remove_near_max_check()
1151 .size = SZ_2M 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()
1163 ASSERT_EQ(rgn->size, total_size); in memblock_remove_near_max_check()
1185 * from the available memory pool. Expect the total size of available memory to
1198 .size = SZ_32M in memblock_remove_overlap_two_check()
1202 .size = SZ_64M in memblock_remove_overlap_two_check()
1206 .size = SZ_64M 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()
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()
1223 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_remove_overlap_two_check()
1226 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_remove_overlap_two_check()
1269 * value of r2. The region counter and total size are updated.
1279 .size = SZ_1M in memblock_free_simple_check()
1283 .size = SZ_1M 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()
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()
1318 * The array, regions counter and total size are not modified.
1328 .size = SZ_8K in memblock_free_absent_check()
1332 .size = SZ_128M 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()
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):
1369 * regions counter and total size are updated.
1380 .size = SZ_32M in memblock_free_overlap_top_check()
1384 .size = SZ_8M 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()
1396 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_top_check()
1408 * the already existing entry r1 (that is r2.base < r1.base + r1.size):
1418 * regions counter and total size are updated.
1429 .size = SZ_32M in memblock_free_overlap_bottom_check()
1433 .size = SZ_32M 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()
1445 ASSERT_EQ(rgn->size, total_size); in memblock_free_overlap_bottom_check()
1458 * (r1.base < r2.base) && (r2.base + r2.size < r1.base + r1.size)):
1471 * another that starts at r2.base + r2.size, with appropriate sizes. The
1472 * region counter and total size fields are updated.
1484 .size = SZ_8M in memblock_free_within_check()
1488 .size = SZ_1M 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()
1502 ASSERT_EQ(rgn1->size, r1_size); in memblock_free_within_check()
1504 ASSERT_EQ(rgn2->base, r2.base + r2.size); in memblock_free_within_check()
1505 ASSERT_EQ(rgn2->size, r2_size); in memblock_free_within_check()
1520 * and the total size is updated.
1530 .size = SZ_4K 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()
1540 ASSERT_EQ(rgn->size, 0); in memblock_free_only_region_check()
1561 * Expect the total size of reserved memory to be updated and the counter to
1573 .size = SZ_2M in memblock_free_near_max_check()
1578 .size = SZ_2M 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()
1590 ASSERT_EQ(rgn->size, total_size); in memblock_free_near_max_check()
1612 * from the collection of reserved memory. Expect the total size of reserved
1625 .size = SZ_32M in memblock_free_overlap_two_check()
1629 .size = SZ_64M in memblock_free_overlap_two_check()
1633 .size = SZ_64M 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()
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()
1650 ASSERT_EQ(rgn1->size, new_r1_size); in memblock_free_overlap_two_check()
1653 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_free_overlap_two_check()
1741 .size = alignment * 4 in memblock_trim_memory_aligned_check()
1747 memblock_add(r.base, r.size); in memblock_trim_memory_aligned_check()
1751 ASSERT_EQ(rgn->size, r.size); in memblock_trim_memory_aligned_check()
1787 .size = alignment * 2 in memblock_trim_memory_too_small_check()
1791 .size = alignment - SZ_2 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()
1802 ASSERT_EQ(rgn->size, r1.size); in memblock_trim_memory_too_small_check()
1842 .size = alignment * 2 in memblock_trim_memory_unaligned_base_check()
1846 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_base_check()
1852 new_r2_size = r2.size - (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()
1860 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_base_check()
1863 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_base_check()
1903 .size = alignment * 2 in memblock_trim_memory_unaligned_end_check()
1907 .size = alignment * 2 - offset in memblock_trim_memory_unaligned_end_check()
1912 new_r2_size = r2.size - (alignment - offset); 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()
1920 ASSERT_EQ(rgn1->size, r1.size); in memblock_trim_memory_unaligned_end_check()
1923 ASSERT_EQ(rgn2->size, new_r2_size); in memblock_trim_memory_unaligned_end_check()