mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03:00
Kernel: Add kmalloc.cpp to aarch64
This commit is contained in:
parent
b0f701d053
commit
2b442ae44f
Notes:
sideshowbarker
2024-07-17 14:30:17 +09:00
Author: https://github.com/jamesmintram Commit: https://github.com/SerenityOS/serenity/commit/2b442ae44f Pull-request: https://github.com/SerenityOS/serenity/pull/13484 Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -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 {
|
||||
|
@ -422,6 +422,8 @@ else()
|
||||
MiniStdLib.cpp
|
||||
Prekernel/UBSanitizer.cpp
|
||||
|
||||
Heap/kmalloc.cpp
|
||||
|
||||
Memory/AddressSpace.cpp
|
||||
Memory/AnonymousVMObject.cpp
|
||||
Memory/InodeVMObject.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());
|
||||
|
Loading…
Reference in New Issue
Block a user