From e2bbec91d70847cc5a2ff67eb84ca4a3c2d03e85 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 4 Feb 2024 10:59:24 +0100 Subject: Kernel: Depend less on NewFS, add support for FileSystem protocol in NewBoot. Signed-off-by: Amlal El Mahrouss --- Private/Source/KernelHeap.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Private/Source/KernelHeap.cxx') diff --git a/Private/Source/KernelHeap.cxx b/Private/Source/KernelHeap.cxx index 3c3cb9ce..72aa2d67 100644 --- a/Private/Source/KernelHeap.cxx +++ b/Private/Source/KernelHeap.cxx @@ -21,7 +21,7 @@ static Ref kLastWrapper; static Pmm kPmm; namespace Detail { -static voidPtr find_ptr(const SizeT &sz, const bool rw, const bool user) { +STATIC voidPtr ke_find_heap(const SizeT &sz, const bool rw, const bool user) { for (SizeT indexWrapper = 0; indexWrapper < kMaxWrappers; ++indexWrapper) { if (!kWrapperList[indexWrapper]->Present()) { kWrapperList[indexWrapper] @@ -35,21 +35,19 @@ static voidPtr find_ptr(const SizeT &sz, const bool rw, const bool user) { } } // namespace Detail -/// @brief manual allocation +/// @brief Page allocation routine. /// @param sz size of pointer /// @param rw read write (true to enable it) /// @param user is it accesible by user processes? /// @return the pointer -VoidPtr ke_new_ke_heap(const SizeT &sz, const bool rw, const bool user) { - if (kWrapperCount < sz) return nullptr; +VoidPtr ke_new_ke_heap(SizeT sz, const bool rw, const bool user) { + if (sz == 0) ++sz; - if (auto ptr = Detail::find_ptr(sz, rw, user); ptr) return ptr; + if (auto ptr = Detail::ke_find_heap(sz, rw, user); ptr) return ptr; Ref wrapper = kPmm.RequestPage(user, rw); if (wrapper) { - wrapper->NoExecute(true); - kLastWrapper = wrapper; kWrapperList[kWrapperCount] = wrapper; -- cgit v1.2.3