Lines Matching +full:align +full:- +full:end
1 // SPDX-License-Identifier: GPL-2.0
35 return &physmem_info.online_extended[n - MEM_INLINED_ENTRIES]; in __get_physmem_range_ptr()
42 void add_physmem_online_range(u64 start, u64 end) in add_physmem_online_range() argument
47 range = __get_physmem_range_ptr(physmem_info.range_count - 1); in add_physmem_online_range()
48 if (range->end == start) { in add_physmem_online_range()
49 range->end = end; in add_physmem_online_range()
55 range->start = start; in add_physmem_online_range()
56 range->end = end; in add_physmem_online_range()
79 cc = exception ? -1 : CC_TRANSFORM(cc); in __diag260()
80 return cc == 0 ? ry : -1; in __diag260()
89 unsigned long end; in diag260() member
94 if (rc == -1) in diag260()
95 return -1; in diag260()
98 add_physmem_online_range(storage_extents[i].start, storage_extents[i].end + 1); in diag260()
118 return -EINVAL; in diag500_storage_limit()
119 /* Convert inclusive end to exclusive end */ in diag500_storage_limit()
138 cc = exception ? -EFAULT : CC_TRANSFORM(cc); in tprot()
144 unsigned long range = 1 << (MAX_PHYSMEM_BITS - 20); /* in 1MB blocks */ in search_mem_end()
176 unsigned long start, end; in detect_physmem_online_ranges() local
194 for_each_physmem_online_range(i, &start, &end) in detect_physmem_online_ranges()
195 boot_debug(" online [%d]: 0x%016lx-0x%016lx\n", i, start, end); in detect_physmem_online_ranges()
205 static void die_oom(unsigned long size, unsigned long align, unsigned long min, unsigned long max) in die_oom() argument
207 unsigned long start, end, total_mem = 0, total_reserved_mem = 0; in die_oom() local
216 size, align, min, max); in die_oom()
218 for_each_physmem_reserved_range(t, range, &start, &end) { in die_oom()
219 boot_emerg("%016lx %016lx %s\n", start, end, get_rr_type_name(t)); in die_oom()
220 total_reserved_mem += end - start; in die_oom()
224 for_each_physmem_usable_range(i, &start, &end) { in die_oom()
225 boot_emerg("%016lx %016lx\n", start, end); in die_oom()
226 total_mem += end - start; in die_oom()
230 total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0); in die_oom()
232 boot_emerg(" -- System halted\n"); in die_oom()
239 physmem_info.reserved[type].end = addr + size; in _physmem_reserve()
245 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Reserve:", addr, addr + size, in physmem_reserve()
251 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Free:", physmem_info.reserved[type].start, in physmem_free()
252 physmem_info.reserved[type].end, get_rr_type_name(type)); in physmem_free()
254 physmem_info.reserved[type].end = 0; in physmem_free()
274 static unsigned long __physmem_alloc_range(unsigned long size, unsigned long align, in __physmem_alloc_range() argument
284 align = max(align, 8UL); in __physmem_alloc_range()
286 __get_physmem_range(nranges - 1, &range_start, &range_end, false); in __physmem_alloc_range()
289 if (round_up(min, align) + size > pos) in __physmem_alloc_range()
291 addr = round_down(pos - size, align); in __physmem_alloc_range()
293 nranges--; in __physmem_alloc_range()
306 die_oom(size, align, min, max); in __physmem_alloc_range()
311 unsigned long align, unsigned long min, unsigned long max, in physmem_alloc_range() argument
317 addr = __physmem_alloc_range(size, align, min, max, 0, NULL, die_on_oom); in physmem_alloc_range()
320 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Alloc range:", addr, addr + size, in physmem_alloc_range()
326 unsigned long align, bool die_on_oom) in physmem_alloc() argument
333 addr = __physmem_alloc_range(size, align, 0, physmem_alloc_pos, physmem_alloc_ranges, in physmem_alloc()
338 if (range->start != addr + size) { in physmem_alloc()
339 if (range->end) { in physmem_alloc()
344 addr = __physmem_alloc_range(size, align, 0, addr, ranges_left, in physmem_alloc()
349 range->chain = new_range; in physmem_alloc()
351 range->end = addr + size; in physmem_alloc()
354 boot_debug("%-14s 0x%016lx-0x%016lx %-20s align 0x%lx split %d\n", "Alloc topdown:", in physmem_alloc()
355 addr, addr + size, get_rr_type_name(type), align, !!new_range); in physmem_alloc()
357 range->start = addr; in physmem_alloc()
364 unsigned long align) in physmem_alloc_or_die() argument
366 return physmem_alloc(type, size, align, true); in physmem_alloc_or_die()
378 unsigned long start, end; in dump_physmem_reserved() local
381 for_each_physmem_reserved_range(t, range, &start, &end) { in dump_physmem_reserved()
382 if (end) { in dump_physmem_reserved()
383 boot_debug("%-14s 0x%016lx-0x%016lx @%012lx chain %012lx\n", in dump_physmem_reserved()
384 get_rr_type_name(t), start, end, (unsigned long)range, in dump_physmem_reserved()
385 (unsigned long)range->chain); in dump_physmem_reserved()