/* * We require a kernel with an unambiguous Image header. Per * Documentation/arch/arm64/booting.rst, this is the case when image_size * is non-zero (practically speaking, since v3.17).
*/
h = (struct arm64_image_header *)kernel; if (!h->image_size) return ERR_PTR(-EINVAL);
/* Check cpu features */
flags = le64_to_cpu(h->flags);
be_image = arm64_image_flag_field(flags, ARM64_IMAGE_FLAG_BE);
be_kernel = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN); if ((be_image != be_kernel) && !system_supports_mixed_endian()) return ERR_PTR(-EINVAL);
/* Adjust kernel segment with TEXT_OFFSET */
kbuf.memsz += text_offset;
kernel_segment_number = image->nr_segments;
/* * The location of the kernel segment may make it impossible to satisfy * the other segment requirements, so we try repeatedly to find a * location that will work.
*/ while ((ret = kexec_add_buffer(&kbuf)) == 0) { /* Try to load additional data */
kernel_segment = &image->segment[kernel_segment_number];
ret = load_other_segments(image, kernel_segment->mem,
kernel_segment->memsz, initrd,
initrd_len, cmdline); if (!ret) break;
/* * We couldn't find space for the other segments; erase the * kernel segment and try the next available hole.
*/
image->nr_segments -= 1;
kbuf.buf_min = kernel_segment->mem + kernel_segment->memsz;
kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
}
if (ret) {
pr_err("Could not find any suitable kernel location!"); return ERR_PTR(ret);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.