* Copyright 2021, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
*/
#include <OS.h>
#include <boot/platform.h>
#include <boot/stdio.h>
#include <boot/kernel_args.h>
#include <boot/stage2.h>
#include <arch/cpu.h>
#include <arch_kernel.h>
#include <arch_system_info.h>
#include <string.h>
*/
extern "C" status_t
boot_arch_cpu_init(void)
{
return B_OK;
}
extern "C" void
arch_ucode_load(BootVolume& volume)
{
}
extern "C" bigtime_t
system_time()
{
#warning Implement system_time in ARM64 bootloader!
uint64_t ticks;
__asm__ volatile("mrs %0, cntpct_el0" : "=r"(ticks));
return ticks;
}
extern "C" void
spin(bigtime_t microseconds)
{
auto time = system_time();
while ((system_time() - time) < microseconds)
asm volatile ("yield;");
}