diff options
author | bunnei <bunneidev@gmail.com> | 2022-01-12 06:57:01 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2022-01-15 06:16:33 +0100 |
commit | b54cbc985e68363acfe54a34d267b279f6d3245a (patch) | |
tree | 9ba950e678a04d659704ef8e5395ee4279c58c08 /src/core/hle/kernel/k_memory_manager.h | |
parent | Merge pull request #7707 from german77/slow-update (diff) | |
download | yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar.gz yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar.bz2 yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar.lz yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar.xz yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.tar.zst yuzu-b54cbc985e68363acfe54a34d267b279f6d3245a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_memory_manager.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_memory_manager.h b/src/core/hle/kernel/k_memory_manager.h index 39badc5f1..abd6c8ace 100644 --- a/src/core/hle/kernel/k_memory_manager.h +++ b/src/core/hle/kernel/k_memory_manager.h @@ -12,6 +12,10 @@ #include "core/hle/kernel/k_page_heap.h" #include "core/hle/result.h" +namespace Core { +class System; +} + namespace Kernel { class KPageLinkedList; @@ -42,7 +46,7 @@ public: Mask = (0xF << Shift), }; - KMemoryManager() = default; + explicit KMemoryManager(Core::System& system_); constexpr std::size_t GetSize(Pool pool) const { return managers[static_cast<std::size_t>(pool)].GetSize(); @@ -51,10 +55,10 @@ public: void InitializeManager(Pool pool, u64 start_address, u64 end_address); VAddr AllocateAndOpenContinuous(size_t num_pages, size_t align_pages, u32 option); - ResultCode Allocate(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, - Direction dir = Direction::FromFront); - ResultCode Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, - Direction dir = Direction::FromFront); + ResultCode Allocate(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, Direction dir, + u32 heap_fill_value = 0); + ResultCode Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, Direction dir, + u32 heap_fill_value = 0); static constexpr std::size_t MaxManagerCount = 10; @@ -129,6 +133,7 @@ private: }; private: + Core::System& system; std::array<std::mutex, static_cast<std::size_t>(Pool::Count)> pool_locks; std::array<Impl, MaxManagerCount> managers; }; |