Lines Matching refs:kbuf

238  *                              for the buffer. If found, sets kbuf->mem.
239 * @kbuf: Buffer contents and memory parameters.
245 static int __locate_mem_hole_top_down(struct kexec_buf *kbuf,
273 start = ALIGN(start, kbuf->buf_align);
274 if (start < end && (end - start + 1) >= kbuf->memsz) {
275 /* Suitable memory range found. Set kbuf->mem */
276 kbuf->mem = ALIGN_DOWN(end - kbuf->memsz + 1,
277 kbuf->buf_align);
289 * @kbuf: Buffer contents and memory parameters.
296 static int locate_mem_hole_top_down_ppc64(struct kexec_buf *kbuf,
313 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax);
329 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax);
337 * for the buffer. If found, sets kbuf->mem.
338 * @kbuf: Buffer contents and memory parameters.
344 static int __locate_mem_hole_bottom_up(struct kexec_buf *kbuf,
372 start = ALIGN(start, kbuf->buf_align);
373 if (start < end && (end - start + 1) >= kbuf->memsz) {
374 /* Suitable memory range found. Set kbuf->mem */
375 kbuf->mem = start;
387 * @kbuf: Buffer contents and memory parameters.
394 static int locate_mem_hole_bottom_up_ppc64(struct kexec_buf *kbuf,
411 ret = __locate_mem_hole_bottom_up(kbuf, tmin, tmax);
427 ret = __locate_mem_hole_bottom_up(kbuf, tmin, tmax);
715 * @kbuf: Buffer contents and memory parameters.
719 static int load_backup_segment(struct kimage *image, struct kexec_buf *kbuf)
736 kbuf->buffer = buf;
737 kbuf->mem = KEXEC_BUF_MEM_UNKNOWN;
738 kbuf->bufsz = kbuf->memsz = BACKUP_SRC_SIZE;
739 kbuf->top_down = false;
741 ret = kexec_add_buffer(kbuf);
748 image->arch.backup_start = kbuf->mem;
783 * @kbuf: Buffer contents and memory parameters.
787 static int load_elfcorehdr_segment(struct kimage *image, struct kexec_buf *kbuf)
808 kbuf->buffer = headers;
809 kbuf->mem = KEXEC_BUF_MEM_UNKNOWN;
810 kbuf->bufsz = kbuf->memsz = headers_sz;
811 kbuf->top_down = false;
813 ret = kexec_add_buffer(kbuf);
819 image->arch.elfcorehdr_addr = kbuf->mem;
831 * @kbuf: Buffer contents and memory parameters.
836 struct kexec_buf *kbuf)
841 ret = load_backup_segment(image, kbuf);
846 pr_debug("Loaded the backup region at 0x%lx\n", kbuf->mem);
849 ret = load_elfcorehdr_segment(image, kbuf);
855 image->arch.elfcorehdr_addr, kbuf->bufsz, kbuf->memsz);
1144 * segment buffer. Sets kbuf->mem when a suitable
1146 * @kbuf: Buffer contents and memory parameters.
1148 * Assumes minimum of PAGE_SIZE alignment for kbuf->memsz & kbuf->buf_align.
1152 int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf)
1159 emem = &(kbuf->image->arch.exclude_ranges);
1162 return kexec_locate_mem_hole(kbuf);
1165 buf_min = kbuf->buf_min;
1166 buf_max = kbuf->buf_max;
1168 if (kbuf->image->type == KEXEC_TYPE_CRASH) {
1180 if (kbuf->top_down)
1181 ret = locate_mem_hole_top_down_ppc64(kbuf, buf_min, buf_max,
1184 ret = locate_mem_hole_bottom_up_ppc64(kbuf, buf_min, buf_max,
1189 add_mem_range(emem, kbuf->mem, kbuf->memsz);
1193 kbuf->memsz);