diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
| commit | e2bbec91d70847cc5a2ff67eb84ca4a3c2d03e85 (patch) | |
| tree | 1e7fec7c232b0c750157007113ce8f86d43b7e76 /Private/Source/KernelHeap.cxx | |
| parent | aff54fd3dc6855b62c047f126c6fe20ca717ee0f (diff) | |
Kernel: Depend less on NewFS, add support for FileSystem protocol in
NewBoot.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/KernelHeap.cxx')
| -rw-r--r-- | Private/Source/KernelHeap.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
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<PTEWrapper *> 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<PTEWrapper *> wrapper = kPmm.RequestPage(user, rw); if (wrapper) { - wrapper->NoExecute(true); - kLastWrapper = wrapper; kWrapperList[kWrapperCount] = wrapper; |
