Lines Matching refs:kbuf

250 static int __locate_mem_hole_top_down(struct kexec_buf *kbuf,  in __locate_mem_hole_top_down()  argument
278 start = ALIGN(start, kbuf->buf_align); in __locate_mem_hole_top_down()
279 if (start < end && (end - start + 1) >= kbuf->memsz) { in __locate_mem_hole_top_down()
281 kbuf->mem = ALIGN_DOWN(end - kbuf->memsz + 1, in __locate_mem_hole_top_down()
282 kbuf->buf_align); in __locate_mem_hole_top_down()
301 static int locate_mem_hole_top_down_ppc64(struct kexec_buf *kbuf, in locate_mem_hole_top_down_ppc64() argument
318 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax); in locate_mem_hole_top_down_ppc64()
334 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax); in locate_mem_hole_top_down_ppc64()
349 static int __locate_mem_hole_bottom_up(struct kexec_buf *kbuf, in __locate_mem_hole_bottom_up() argument
377 start = ALIGN(start, kbuf->buf_align); in __locate_mem_hole_bottom_up()
378 if (start < end && (end - start + 1) >= kbuf->memsz) { in __locate_mem_hole_bottom_up()
380 kbuf->mem = start; in __locate_mem_hole_bottom_up()
399 static int locate_mem_hole_bottom_up_ppc64(struct kexec_buf *kbuf, in locate_mem_hole_bottom_up_ppc64() argument
416 ret = __locate_mem_hole_bottom_up(kbuf, tmin, tmax); in locate_mem_hole_bottom_up_ppc64()
432 ret = __locate_mem_hole_bottom_up(kbuf, tmin, tmax); in locate_mem_hole_bottom_up_ppc64()
726 static int load_backup_segment(struct kimage *image, struct kexec_buf *kbuf) in load_backup_segment() argument
743 kbuf->buffer = buf; in load_backup_segment()
744 kbuf->mem = KEXEC_BUF_MEM_UNKNOWN; in load_backup_segment()
745 kbuf->bufsz = kbuf->memsz = BACKUP_SRC_SIZE; in load_backup_segment()
746 kbuf->top_down = false; in load_backup_segment()
748 ret = kexec_add_buffer(kbuf); in load_backup_segment()
755 image->arch.backup_start = kbuf->mem; in load_backup_segment()
794 static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf) in load_elfcorehdr_segment() argument
815 kbuf->buffer = headers; in load_elfcorehdr_segment()
816 kbuf->mem = KEXEC_BUF_MEM_UNKNOWN; in load_elfcorehdr_segment()
817 kbuf->bufsz = kbuf->memsz = headers_sz; in load_elfcorehdr_segment()
818 kbuf->top_down = false; in load_elfcorehdr_segment()
820 ret = kexec_add_buffer(kbuf); in load_elfcorehdr_segment()
826 image->elf_load_addr = kbuf->mem; in load_elfcorehdr_segment()
843 struct kexec_buf *kbuf) in load_crashdump_segments_ppc64() argument
848 ret = load_backup_segment(image, kbuf); in load_crashdump_segments_ppc64()
853 pr_debug("Loaded the backup region at 0x%lx\n", kbuf->mem); in load_crashdump_segments_ppc64()
856 ret = load_elfcorehdr_segment(image, kbuf); in load_crashdump_segments_ppc64()
862 image->elf_load_addr, kbuf->bufsz, kbuf->memsz); in load_crashdump_segments_ppc64()
1261 int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf) in arch_kexec_locate_mem_hole() argument
1268 emem = &(kbuf->image->arch.exclude_ranges); in arch_kexec_locate_mem_hole()
1271 return kexec_locate_mem_hole(kbuf); in arch_kexec_locate_mem_hole()
1274 buf_min = kbuf->buf_min; in arch_kexec_locate_mem_hole()
1275 buf_max = kbuf->buf_max; in arch_kexec_locate_mem_hole()
1277 if (kbuf->image->type == KEXEC_TYPE_CRASH) { in arch_kexec_locate_mem_hole()
1289 if (kbuf->top_down) in arch_kexec_locate_mem_hole()
1290 ret = locate_mem_hole_top_down_ppc64(kbuf, buf_min, buf_max, in arch_kexec_locate_mem_hole()
1293 ret = locate_mem_hole_bottom_up_ppc64(kbuf, buf_min, buf_max, in arch_kexec_locate_mem_hole()
1298 add_mem_range(emem, kbuf->mem, kbuf->memsz); in arch_kexec_locate_mem_hole()
1302 kbuf->memsz); in arch_kexec_locate_mem_hole()