diff options
author | Liam <byteslice@airmail.cc> | 2023-03-18 02:26:04 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-22 14:35:16 +0100 |
commit | fb49ec19c1fb6030fcc960077e82c998290d0ab8 (patch) | |
tree | aa5f53cbbfc2b255923bcf362ee0009938ed8187 /src/core/hle/kernel/k_memory_block_manager.h | |
parent | Merge pull request #9955 from liamwhite/color-blend-equation (diff) | |
download | yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.gz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.bz2 yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.lz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.xz yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.tar.zst yuzu-fb49ec19c1fb6030fcc960077e82c998290d0ab8.zip |
Diffstat (limited to 'src/core/hle/kernel/k_memory_block_manager.h')
-rw-r--r-- | src/core/hle/kernel/k_memory_block_manager.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/core/hle/kernel/k_memory_block_manager.h b/src/core/hle/kernel/k_memory_block_manager.h index d382722a6..7c0bd16f0 100644 --- a/src/core/hle/kernel/k_memory_block_manager.h +++ b/src/core/hle/kernel/k_memory_block_manager.h @@ -7,9 +7,9 @@ #include <functional> #include "common/common_funcs.h" -#include "common/common_types.h" #include "core/hle/kernel/k_dynamic_resource_manager.h" #include "core/hle/kernel/k_memory_block.h" +#include "core/hle/kernel/k_typed_address.h" namespace Kernel { @@ -85,9 +85,10 @@ public: public: KMemoryBlockManager(); - using HostUnmapCallback = std::function<void(VAddr, u64)>; + using HostUnmapCallback = std::function<void(Common::ProcessAddress, u64)>; - Result Initialize(VAddr st, VAddr nd, KMemoryBlockSlabManager* slab_manager); + Result Initialize(KProcessAddress st, KProcessAddress nd, + KMemoryBlockSlabManager* slab_manager); void Finalize(KMemoryBlockSlabManager* slab_manager, HostUnmapCallback&& host_unmap_callback); iterator end() { @@ -100,27 +101,28 @@ public: return m_memory_block_tree.cend(); } - VAddr FindFreeArea(VAddr region_start, size_t region_num_pages, size_t num_pages, - size_t alignment, size_t offset, size_t guard_pages) const; + KProcessAddress FindFreeArea(KProcessAddress region_start, size_t region_num_pages, + size_t num_pages, size_t alignment, size_t offset, + size_t guard_pages) const; - void Update(KMemoryBlockManagerUpdateAllocator* allocator, VAddr address, size_t num_pages, - KMemoryState state, KMemoryPermission perm, KMemoryAttribute attr, + void Update(KMemoryBlockManagerUpdateAllocator* allocator, KProcessAddress address, + size_t num_pages, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attr, KMemoryBlockDisableMergeAttribute set_disable_attr, KMemoryBlockDisableMergeAttribute clear_disable_attr); - void UpdateLock(KMemoryBlockManagerUpdateAllocator* allocator, VAddr address, size_t num_pages, - MemoryBlockLockFunction lock_func, KMemoryPermission perm); + void UpdateLock(KMemoryBlockManagerUpdateAllocator* allocator, KProcessAddress address, + size_t num_pages, MemoryBlockLockFunction lock_func, KMemoryPermission perm); - void UpdateIfMatch(KMemoryBlockManagerUpdateAllocator* allocator, VAddr address, + void UpdateIfMatch(KMemoryBlockManagerUpdateAllocator* allocator, KProcessAddress address, size_t num_pages, KMemoryState test_state, KMemoryPermission test_perm, KMemoryAttribute test_attr, KMemoryState state, KMemoryPermission perm, KMemoryAttribute attr); - iterator FindIterator(VAddr address) const { + iterator FindIterator(KProcessAddress address) const { return m_memory_block_tree.find(KMemoryBlock( address, 1, KMemoryState::Free, KMemoryPermission::None, KMemoryAttribute::None)); } - const KMemoryBlock* FindBlock(VAddr address) const { + const KMemoryBlock* FindBlock(KProcessAddress address) const { if (const_iterator it = this->FindIterator(address); it != m_memory_block_tree.end()) { return std::addressof(*it); } @@ -132,12 +134,12 @@ public: bool CheckState() const; private: - void CoalesceForUpdate(KMemoryBlockManagerUpdateAllocator* allocator, VAddr address, + void CoalesceForUpdate(KMemoryBlockManagerUpdateAllocator* allocator, KProcessAddress address, size_t num_pages); MemoryBlockTree m_memory_block_tree; - VAddr m_start_address{}; - VAddr m_end_address{}; + KProcessAddress m_start_address{}; + KProcessAddress m_end_address{}; }; class KScopedMemoryBlockManagerAuditor { |