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()
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()
103 unsigned long end; in diag260() member
108 if (rc == -1) in diag260()
109 return -1; in diag260()
112 add_physmem_online_range(storage_extents[i].start, storage_extents[i].end + 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()
147 /* Convert inclusive end to exclusive end */ 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()
218 unsigned long start, end; in detect_physmem_online_ranges() local
236 for_each_physmem_online_range(i, &start, &end) in detect_physmem_online_ranges()
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
249 unsigned long start, end, total_mem = 0, total_reserved_mem = 0; in die_oom() local
258 size, align, min, max); in die_oom()
260 for_each_physmem_reserved_range(t, range, &start, &end) { in die_oom()
261 boot_emerg("%016lx %016lx %s\n", start, end, get_rr_type_name(t)); in die_oom()
262 total_reserved_mem += end - start; in die_oom()
266 for_each_physmem_usable_range(i, &start, &end) { in die_oom()
267 boot_emerg("%016lx %016lx\n", start, end); 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()
281 physmem_info.reserved[type].end = 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()
294 physmem_info.reserved[type].end, get_rr_type_name(type)); in physmem_free()
296 physmem_info.reserved[type].end = 0; in physmem_free()
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()
348 die_oom(size, align, min, max); in __physmem_alloc_range()
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()
362 boot_debug("%-14s 0x%016lx-0x%016lx %s\n", "Alloc range:", addr, addr + size, in physmem_alloc_range()
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()
406 unsigned long align) in physmem_alloc_or_die() argument
408 return physmem_alloc(type, size, align, true); in physmem_alloc_or_die()
420 unsigned long start, end; in dump_physmem_reserved() local
423 for_each_physmem_reserved_range(t, range, &start, &end) { in dump_physmem_reserved()
424 if (end) { in dump_physmem_reserved()
425 boot_debug("%-14s 0x%016lx-0x%016lx @%012lx chain %012lx\n", in dump_physmem_reserved()
426 get_rr_type_name(t), start, end, (unsigned long)range, in dump_physmem_reserved()
427 (unsigned long)range->chain); in dump_physmem_reserved()