diff options
author | Liam <byteslice@airmail.cc> | 2023-10-11 17:39:09 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-10-20 08:34:15 +0200 |
commit | 0441853d0f82ce244f2fa1dec61f64e86304e636 (patch) | |
tree | a2c3bdc51de4d56fe197431921dab862091a0a41 /src/core/hle/kernel/k_memory_block.h | |
parent | k_page_table: add new CheckMemoryState helper (diff) | |
download | yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar.gz yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar.bz2 yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar.lz yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar.xz yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.tar.zst yuzu-0441853d0f82ce244f2fa1dec61f64e86304e636.zip |
Diffstat (limited to 'src/core/hle/kernel/k_memory_block.h')
-rw-r--r-- | src/core/hle/kernel/k_memory_block.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_memory_block.h b/src/core/hle/kernel/k_memory_block.h index 8437cb659..ef3f61321 100644 --- a/src/core/hle/kernel/k_memory_block.h +++ b/src/core/hle/kernel/k_memory_block.h @@ -192,7 +192,7 @@ enum class KMemoryAttribute : u8 { Uncached = static_cast<u8>(Svc::MemoryAttribute::Uncached), PermissionLocked = static_cast<u8>(Svc::MemoryAttribute::PermissionLocked), - SetMask = Uncached, + SetMask = Uncached | PermissionLocked, }; DECLARE_ENUM_FLAG_OPERATORS(KMemoryAttribute); @@ -339,6 +339,10 @@ public: return this->GetEndAddress() - 1; } + constexpr KMemoryState GetState() const { + return m_memory_state; + } + constexpr u16 GetIpcLockCount() const { return m_ipc_lock_count; } @@ -456,6 +460,13 @@ public: } } + constexpr void UpdateAttribute(KMemoryAttribute mask, KMemoryAttribute attr) { + ASSERT(False(mask & KMemoryAttribute::IpcLocked)); + ASSERT(False(mask & KMemoryAttribute::DeviceShared)); + + m_attribute = (m_attribute & ~mask) | attr; + } + constexpr void Split(KMemoryBlock* block, KProcessAddress addr) { ASSERT(this->GetAddress() < addr); ASSERT(this->Contains(addr)); |