summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Mintram <me@jamesrm.com>2022-04-03 00:06:34 +0100
committerAndreas Kling <kling@serenityos.org>2022-04-03 23:21:04 +0200
commit2b442ae44f30096e958186458d0e1d80157405b2 (patch)
treea31a036f86a2b3498c1264cec1cfeb7fa2d41c99
parentb0f701d05383ebcf6d08f5407522b2233aad7249 (diff)
downloadserenity-2b442ae44f30096e958186458d0e1d80157405b2.zip
Kernel: Add kmalloc.cpp to aarch64
-rw-r--r--Kernel/Arch/aarch64/dummy.cpp31
-rw-r--r--Kernel/CMakeLists.txt2
-rw-r--r--Kernel/Heap/kmalloc.cpp3
3 files changed, 7 insertions, 29 deletions
diff --git a/Kernel/Arch/aarch64/dummy.cpp b/Kernel/Arch/aarch64/dummy.cpp
index 39f5bafc29..550fec7d65 100644
--- a/Kernel/Arch/aarch64/dummy.cpp
+++ b/Kernel/Arch/aarch64/dummy.cpp
@@ -120,34 +120,9 @@ READONLY_AFTER_INIT u8 multiboot_framebuffer_bpp;
READONLY_AFTER_INIT u8 multiboot_framebuffer_type;
}
-// kmalloc.h
-size_t kmalloc_good_size(size_t);
-size_t kmalloc_good_size(size_t) { return 0; }
-
-void* kcalloc(unsigned long, unsigned long) { return nullptr; }
-
-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); }
-
-void* operator new(size_t, std::nothrow_t const&) noexcept { return nullptr; }
-void* operator new(size_t, std::align_val_t, std::nothrow_t const&) noexcept { return nullptr; }
-void* operator new[](size_t) { return (void*)0xdeadbeef; }
-void* operator new[](size_t, std::nothrow_t const&) noexcept { return nullptr; }
-
-void operator delete(void*) noexcept { }
-void operator delete(void*, size_t) noexcept { }
-void operator delete(void*, size_t, std::align_val_t) noexcept { }
-void operator delete[](void*) noexcept { }
-void operator delete[](void*, size_t) noexcept { }
-
-namespace std {
-const nothrow_t nothrow;
+// KSyms.cpp
+namespace Kernel {
+bool g_kernel_symbols_available = false;
}
namespace Kernel {
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt
index 94871b8ddc..16feb05d52 100644
--- a/Kernel/CMakeLists.txt
+++ b/Kernel/CMakeLists.txt
@@ -422,6 +422,8 @@ else()
MiniStdLib.cpp
Prekernel/UBSanitizer.cpp
+ Heap/kmalloc.cpp
+
Memory/AddressSpace.cpp
Memory/AnonymousVMObject.cpp
Memory/InodeVMObject.cpp
diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp
index a2b12b6e7a..c35f818314 100644
--- a/Kernel/Heap/kmalloc.cpp
+++ b/Kernel/Heap/kmalloc.cpp
@@ -6,6 +6,7 @@
#include <AK/Assertions.h>
#include <AK/Types.h>
+#include <Kernel/Arch/PageDirectory.h>
#include <Kernel/Debug.h>
#include <Kernel/Heap/Heap.h>
#include <Kernel/Heap/kmalloc.h>
@@ -327,7 +328,7 @@ struct KmallocGlobalData {
expansion_data->next_virtual_address = expansion_data->next_virtual_address.offset(new_subheap_size);
- auto cpu_supports_nx = Processor::current().has_feature(CPUFeature::NX);
+ auto cpu_supports_nx = Processor::current().has_nx();
SpinlockLocker mm_locker(Memory::s_mm_lock);
SpinlockLocker pd_locker(MM.kernel_page_directory().get_lock());