summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-09-17 10:44:28 -0400
committerLinus Groh <mail@linusgroh.de>2021-09-19 17:45:59 +0200
commit0319aa315a5b489ec5e7dea8fcb7b38d42868e24 (patch)
tree12b882aab436df0692ecdcfbefd44f3871c34b42 /Kernel
parent58f6bf8a4ddcdeb24ab3fc31acdaf5820e4bfc31 (diff)
downloadserenity-0319aa315a5b489ec5e7dea8fcb7b38d42868e24.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Prekernel/Arch/aarch64/init.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Kernel/Prekernel/Arch/aarch64/init.cpp b/Kernel/Prekernel/Arch/aarch64/init.cpp
index 5771575aa4..36acd399ad 100644
--- a/Kernel/Prekernel/Arch/aarch64/init.cpp
+++ b/Kernel/Prekernel/Arch/aarch64/init.cpp
@@ -18,3 +18,16 @@ extern "C" [[noreturn]] void init()
// 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();
+}