Lines Matching +full:align +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0
35 return &physmem_info.online_extended[n - MEM_INLINED_ENTRIES]; in __get_physmem_range_ptr()
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()
87 "+Q" (get_lowcore()->program_new_psw), in __diag260()
91 [psw_pgm] "a" (&get_lowcore()->program_new_psw) in __diag260()
93 cc = exception ? -1 : CC_TRANSFORM(cc); in __diag260()
94 return cc == 0 ? ry : -1; in __diag260()
108 if (rc == -1) in diag260()
109 return -1; in diag260()
139 "=Q" (get_lowcore()->program_new_psw), in diag500_storage_limit()
142 [psw_pgm] "a" (&get_lowcore()->program_new_psw), in diag500_storage_limit()
146 return -EINVAL; in diag500_storage_limit()
174 "=Q" (get_lowcore()->program_new_psw.addr), in tprot()
177 [psw_pgm] "a" (&get_lowcore()->program_new_psw), in tprot()
180 cc = exception ? -EFAULT : CC_TRANSFORM(cc); in tprot()
186 unsigned long range = 1 << (MAX_PHYSMEM_BITS - 20); /* in 1MB blocks */ in search_mem_end()
237 boot_debug(" online [%d]: 0x%016lx-0x%016lx\n", i, start, end); in detect_physmem_online_ranges()
247 static void die_oom(unsigned long size, unsigned long align, unsigned long min, unsigned long max) in die_oom() argument
258 size, align, min, max); in die_oom()
262 total_reserved_mem += end - start; in die_oom()
268 total_mem += end - start; in die_oom()
272 total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0); in die_oom()
274 boot_emerg(" -- System halted\n"); in die_oom()
278 static void _physmem_reserve(enum reserved_range_type type, unsigned long addr, unsigned long size) in _physmem_reserve() argument
281 physmem_info.reserved[type].end = addr + size; in _physmem_reserve()
284 void physmem_reserve(enum reserved_range_type type, unsigned long addr, unsigned long size) in physmem_reserve() argument
286 _physmem_reserve(type, addr, size); in physmem_reserve()
287 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Reserve:", addr, addr + size, in physmem_reserve()
293 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Free:", physmem_info.reserved[type].start, in physmem_free()
299 static bool __physmem_alloc_intersects(unsigned long addr, unsigned long size, in __physmem_alloc_intersects() argument
308 if (intersects(addr, size, res_addr, res_size)) { in __physmem_alloc_intersects()
313 return ipl_report_certs_intersects(addr, size, intersection_start); in __physmem_alloc_intersects()
316 static unsigned long __physmem_alloc_range(unsigned long size, unsigned long align, in __physmem_alloc_range() argument
326 align = max(align, 8UL); in __physmem_alloc_range()
328 __get_physmem_range(nranges - 1, &range_start, &range_end, false); in __physmem_alloc_range()
331 if (round_up(min, align) + size > pos) in __physmem_alloc_range()
333 addr = round_down(pos - size, align); in __physmem_alloc_range()
335 nranges--; in __physmem_alloc_range()
338 if (__physmem_alloc_intersects(addr, size, &intersection_start)) { in __physmem_alloc_range()
348 die_oom(size, align, min, max); in __physmem_alloc_range()
352 unsigned long physmem_alloc_range(enum reserved_range_type type, unsigned long size, in physmem_alloc_range() argument
353 unsigned long align, unsigned long min, unsigned long max, in physmem_alloc_range() argument
359 addr = __physmem_alloc_range(size, align, min, max, 0, NULL, die_on_oom); in physmem_alloc_range()
361 _physmem_reserve(type, addr, size); in physmem_alloc_range()
362 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Alloc range:", addr, addr + size, in physmem_alloc_range()
367 unsigned long physmem_alloc(enum reserved_range_type type, unsigned long size, in physmem_alloc() argument
368 unsigned long align, bool die_on_oom) in physmem_alloc() argument
375 addr = __physmem_alloc_range(size, align, 0, physmem_alloc_pos, physmem_alloc_ranges, in physmem_alloc()
380 if (range->start != addr + size) { in physmem_alloc()
381 if (range->end) { in physmem_alloc()
386 addr = __physmem_alloc_range(size, align, 0, addr, ranges_left, in physmem_alloc()
391 range->chain = new_range; in physmem_alloc()
393 range->end = addr + size; in physmem_alloc()
396 boot_debug("%-14s 0x%016lx-0x%016lx %-20s align 0x%lx split %d\n", "Alloc topdown:", in physmem_alloc()
397 addr, addr + size, get_rr_type_name(type), align, !!new_range); in physmem_alloc()
399 range->start = addr; in physmem_alloc()
405 unsigned long physmem_alloc_or_die(enum reserved_range_type type, unsigned long size, in physmem_alloc_or_die() argument
406 unsigned long align) in physmem_alloc_or_die() argument
408 return physmem_alloc(type, size, align, true); in physmem_alloc_or_die()
425 boot_debug("%-14s 0x%016lx-0x%016lx @%012lx chain %012lx\n", in dump_physmem_reserved()
427 (unsigned long)range->chain); in dump_physmem_reserved()