Lines Matching refs:kernel

157 // Parse the device tree to find our ZBI, kernel command line, and RAM size.
207 // append kernel command line
261 zircon_kernel_t* kernel = NULL;
271 kernel = (zircon_kernel_t*) zbi;
280 // have been appended to the shim image. If not, the kernel is appended.
281 if (kernel == NULL) {
289 kernel = &embedded_zbi;
291 fail("no ARM64 kernel in ZBI from device tree or embedded ZBI\n");
296 // along with the embedded kernel. Otherwise always use the ZBI from
297 // device tree, whether the kernel is in that ZBI or was embedded.
299 zbi = &kernel->hdr_file;
309 (uint8_t*)&kernel->data_kernel +
310 kernel->hdr_kernel.length +
311 kernel->data_kernel.reserve_memory_size;
314 uart_print_hex((uintptr_t)kernel);
318 uart_print_hex(kernel->data_kernel.reserve_memory_size);
325 if ((uint8_t*)zbi < kernel_end && zbi != &kernel->hdr_file) {
326 fail("expected kernel to be loaded lower in memory than initrd\n");
333 if (zbi == &kernel->hdr_file || (uintptr_t)zbi % 4096 != 0) {
335 // If it's a complete ZBI, splice out the kernel and move it higher.
338 if (old == &kernel->hdr_file) {
339 // Length of the kernel item payload, without header.
340 uint32_t kernel_len = kernel->hdr_kernel.length;
342 // Length of the ZBI container, including header, without kernel.
343 uint32_t zbi_len = kernel->hdr_file.length - kernel_len;
345 uart_puts("Splitting kernel ");
350 // First move the kernel up out of the way.
355 kernel = (void*)((zbi_end + KERNEL_ALIGN - 1) &
358 uart_print_hex((uintptr_t)kernel);
359 memcpy(kernel, old, (2 * sizeof(*zbi)) + kernel_len);
360 // Fix up the kernel's solo container size.
361 kernel->hdr_file.length = sizeof(*zbi) + kernel_len;
364 // container header to exclude the kernel.
368 header.length -= kernel->hdr_file.length;
369 void* payload = (uint8_t*)(old + 1) + kernel->hdr_file.length;
374 uart_print_hex(kernel->hdr_file.length);
384 if ((uintptr_t)kernel % KERNEL_ALIGN != 0) {
385 // The kernel has to be relocated for alignment.
386 uart_puts("Relocating kernel for alignment\n");
387 zbi_header_t* old = &kernel->hdr_file;
388 kernel = (void*)(((uintptr_t)(zbi + 1) + zbi->length +
390 memmove(kernel, old, sizeof(*old) + old->length);
394 .entry = (uintptr_t)kernel + kernel->data_kernel.entry,
397 uart_puts("Entering kernel at ");