Lines Matching +full:address +full:- +full:aligned

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * aligned address:
9 * | +-----------+ |
11 * +----------+-----------+---------+
14 * Aligned min_addr
16 * Expect to allocate a cleared region at the minimal memory address.
28 min_addr = memblock_end_of_DRAM() - SMP_CACHE_BYTES; in alloc_from_simple_generic_check()
35 ASSERT_EQ(rgn->size, size); in alloc_from_simple_generic_check()
36 ASSERT_EQ(rgn->base, min_addr); in alloc_from_simple_generic_check()
47 * A test that tries to allocate a memory region above a certain address.
48 * The minimal address here is not aligned:
51 * | + +---------+ |
53 * +------+------+---------+------------+
54 * ^ ^------.
56 * min_addr Aligned address
59 * Expect to allocate a cleared region at the closest aligned memory address.
71 /* A misaligned address */ in alloc_from_misaligned_generic_check()
72 min_addr = memblock_end_of_DRAM() - (SMP_CACHE_BYTES * 2 - 1); in alloc_from_misaligned_generic_check()
79 ASSERT_EQ(rgn->size, size); in alloc_from_misaligned_generic_check()
80 ASSERT_EQ(rgn->base, memblock_end_of_DRAM() - SMP_CACHE_BYTES); in alloc_from_misaligned_generic_check()
91 * A test that tries to allocate a memory region above an address that is too
95 * | +--------+---+ |
97 * +-----------+--------+---+------+
102 * Aligned address
105 * Expect to prioritize granting memory over satisfying the minimal address
118 /* The address is too close to the end of the memory */ in alloc_from_top_down_high_addr_check()
119 min_addr = memblock_end_of_DRAM() - SZ_16; in alloc_from_top_down_high_addr_check()
124 ASSERT_EQ(rgn->size, size); in alloc_from_top_down_high_addr_check()
125 ASSERT_EQ(rgn->base, memblock_end_of_DRAM() - SMP_CACHE_BYTES); in alloc_from_top_down_high_addr_check()
137 * available above the minimal address above a certain address:
140 * | +---------+-------------|
142 * +--------+---------+-------------+
147 * Expect to prioritize granting memory over satisfying the minimal address
163 min_addr = memblock_end_of_DRAM() - SMP_CACHE_BYTES * 2; in alloc_from_top_down_no_space_above_check()
165 /* No space above this address */ in alloc_from_top_down_no_space_above_check()
171 ASSERT_EQ(rgn->base, min_addr - r1_size); in alloc_from_top_down_no_space_above_check()
172 ASSERT_EQ(rgn->size, total_size); in alloc_from_top_down_no_space_above_check()
183 * A test that tries to allocate a memory region with a minimal address below
184 * the start address of the available memory. As the allocation is top-down,
200 min_addr = start_addr - SMP_CACHE_BYTES * 3; in alloc_from_top_down_min_addr_cap_check()
202 memblock_reserve(start_addr + r1_size, MEM_SIZE - r1_size); in alloc_from_top_down_min_addr_cap_check()
207 ASSERT_EQ(rgn->base, start_addr); in alloc_from_top_down_min_addr_cap_check()
208 ASSERT_EQ(rgn->size, MEM_SIZE); in alloc_from_top_down_min_addr_cap_check()
219 * A test that tries to allocate a memory region above an address that is too
223 * |-----------+ + |
225 * +-----------+--------------+-----+
228 * Aligned address min_addr
231 * Expect to prioritize granting memory over satisfying the minimal address
244 /* The address is too close to the end of the memory */ in alloc_from_bottom_up_high_addr_check()
245 min_addr = memblock_end_of_DRAM() - SZ_8; in alloc_from_bottom_up_high_addr_check()
250 ASSERT_EQ(rgn->size, size); in alloc_from_bottom_up_high_addr_check()
251 ASSERT_EQ(rgn->base, memblock_start_of_DRAM()); in alloc_from_bottom_up_high_addr_check()
263 * available above the minimal address above a certain address:
266 * |-----------+ +-------------------|
268 * +-----------+----+-------------------+
273 * Expect to prioritize granting memory over satisfying the minimal address
288 r2_size = memblock_end_of_DRAM() - min_addr; in alloc_from_bottom_up_no_space_above_check()
290 /* No space above this address */ in alloc_from_bottom_up_no_space_above_check()
291 memblock_reserve(min_addr - SMP_CACHE_BYTES, r2_size); in alloc_from_bottom_up_no_space_above_check()
296 ASSERT_EQ(rgn->base, memblock_start_of_DRAM()); in alloc_from_bottom_up_no_space_above_check()
297 ASSERT_EQ(rgn->size, r1_size); in alloc_from_bottom_up_no_space_above_check()
308 * A test that tries to allocate a memory region with a minimal address below
309 * the start address of the available memory. Expect to allocate a region
324 min_addr = start_addr - SMP_CACHE_BYTES * 3; in alloc_from_bottom_up_min_addr_cap_check()
329 ASSERT_EQ(rgn->base, start_addr); in alloc_from_bottom_up_min_addr_cap_check()
330 ASSERT_EQ(rgn->size, r1_size); in alloc_from_bottom_up_min_addr_cap_check()