Files
ladybird/Kernel/Prekernel/Arch/aarch64/init.cpp
Nico Weber 0319aa315a Kernel: Add __stack_chk_fail to aarch64 Prekernel init
This is needed for some functions with local variables. We'll grow
such a function soon.
2021-09-19 17:45:59 +02:00

34 lines
657 B
C++

/*
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Types.h>
#include <Kernel/Prekernel/Arch/aarch64/MainIdRegister.h>
extern "C" [[noreturn]] void init();
extern "C" [[noreturn]] void init()
{
Prekernel::MainIdRegister id;
[[maybe_unused]] unsigned part_num = id.part_num();
for (;;) { }
}
// FIXME: Share this with the Intel Prekernel.
extern size_t __stack_chk_guard;
size_t __stack_chk_guard;
extern "C" [[noreturn]] void __stack_chk_fail();
[[noreturn]] static void halt()
{
for (;;) {
asm volatile("wfi");
}
}
void __stack_chk_fail()
{
halt();
}