Files
uniLoader/arch/arm/load-kernel.c
Igor Belwon 9a03aa6395 arch: Add architecture-dependent kernel copying functions
This is done to clean main/ code of ugly architecture ifdefs.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
2026-02-23 23:02:53 +02:00

18 lines
554 B
C

// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
* Copyright (c) 2026, Igor Belwon <igor.belwon@mentallysanemainliners.org>
*/
#include <main/boot.h>
#include <string.h>
void arch_load_kernel(void* kernel, void* dt, void* ramdisk)
{
memcpy((void*)CONFIG_PAYLOAD_ENTRY, kernel, (unsigned long) kernel_size);
#ifndef CONFIG_RAMDISK_NO_COPY
memcpy((void*)CONFIG_RAMDISK_ENTRY, ramdisk, (unsigned long) ramdisk_size);
#endif
load_kernel_and_jump(0, 0, dt, (void*)CONFIG_PAYLOAD_ENTRY);
}