summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64
diff options
context:
space:
mode:
authorJames Mintram <me@jamesrm.com>2021-10-13 19:21:24 +0100
committerLinus Groh <mail@linusgroh.de>2021-10-14 01:23:08 +0100
commitceb3328877697763987f8575737d111fb592fba3 (patch)
tree83461bffaa0af449469a889f4dbeed68b295e6bf /Kernel/Arch/aarch64
parentab70268d61fcd906bdd2dbafa4a37987194af759 (diff)
downloadserenity-ceb3328877697763987f8575737d111fb592fba3.zip
Kernel: Fix all linker errors for Aarch64 build
Diffstat (limited to 'Kernel/Arch/aarch64')
-rw-r--r--Kernel/Arch/aarch64/Processor.h5
-rw-r--r--Kernel/Arch/aarch64/dummy.cpp72
2 files changed, 77 insertions, 0 deletions
diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h
index 89143a35f8..4f053d0637 100644
--- a/Kernel/Arch/aarch64/Processor.h
+++ b/Kernel/Arch/aarch64/Processor.h
@@ -61,6 +61,11 @@ public:
ALWAYS_INLINE static Processor& current() { return *((Processor*)0); }
static void deferred_call_queue(Function<void()> /* callback */) { }
+
+ [[noreturn]] static void halt()
+ {
+ for (;;) { }
+ }
};
}
diff --git a/Kernel/Arch/aarch64/dummy.cpp b/Kernel/Arch/aarch64/dummy.cpp
index dfa2fa8039..d82c4e96f9 100644
--- a/Kernel/Arch/aarch64/dummy.cpp
+++ b/Kernel/Arch/aarch64/dummy.cpp
@@ -4,7 +4,79 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/Types.h>
+#include <Kernel/KSyms.h>
+#include <Kernel/Sections.h>
+
+// init.cpp
+extern size_t __stack_chk_guard;
+READONLY_AFTER_INIT size_t __stack_chk_guard;
+
// This is a temporary file to get a non-empty Kernel binary on aarch64.
// The prekernel currently never jumps to the kernel. This is dead code.
void dummy();
void dummy() { }
+
+// Assertions.h
+[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*);
+
+[[noreturn]] void __assertion_failed(const char*, const char*, unsigned, const char*)
+{
+ for (;;) { }
+}
+
+// kmalloc.h
+size_t kmalloc_good_size(size_t);
+size_t kmalloc_good_size(size_t) { return 0; }
+
+void kfree_sized(void*, size_t);
+void kfree_sized(void*, size_t) { }
+
+void* kmalloc(size_t);
+void* kmalloc(size_t) { return nullptr; }
+
+void* operator new(size_t size) { return kmalloc(size); }
+void* operator new(size_t size, std::align_val_t) { return kmalloc(size); }
+
+namespace Kernel {
+void dump_backtrace(PrintToScreen) { }
+}
+
+extern "C" {
+
+// StdLib.cpp
+[[noreturn]] void __stack_chk_fail();
+[[noreturn]] void __stack_chk_fail()
+{
+ for (;;) { }
+}
+
+int memcmp(const void*, const void*, size_t);
+int memcmp(const void*, const void*, size_t) { return 0; }
+
+int strcmp(char const*, const char*);
+int strcmp(char const*, const char*) { return 0; }
+
+// kstdio.h
+void kernelputstr(const char*, size_t);
+void kernelputstr(const char*, size_t) { }
+
+void kernelcriticalputstr(const char*, size_t);
+void kernelcriticalputstr(const char*, size_t) { }
+
+void kernelearlyputstr(const char*, size_t);
+void kernelearlyputstr(const char*, size_t) { }
+
+// MiniStdLib.cpp
+void* memcpy(void*, const void*, size_t);
+void* memcpy(void*, const void*, size_t) { return nullptr; }
+
+void* memmove(void*, const void*, size_t);
+void* memmove(void*, const void*, size_t) { return nullptr; }
+
+void* memset(void*, int, size_t);
+void* memset(void*, int, size_t) { return nullptr; }
+
+size_t strlen(const char*);
+size_t strlen(const char*) { return 0; }
+}