diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_shared_memory.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/core/hle/kernel/k_shared_memory.h b/src/core/hle/kernel/k_shared_memory.h index 8b29f0b4a..54b23d7ac 100644 --- a/src/core/hle/kernel/k_shared_memory.h +++ b/src/core/hle/kernel/k_shared_memory.h @@ -6,11 +6,11 @@ #include <optional> #include <string> -#include "common/common_types.h" #include "core/device_memory.h" #include "core/hle/kernel/k_memory_block.h" #include "core/hle/kernel/k_page_group.h" #include "core/hle/kernel/k_process.h" +#include "core/hle/kernel/k_typed_address.h" #include "core/hle/kernel/slab_helpers.h" #include "core/hle/result.h" @@ -23,12 +23,12 @@ class KSharedMemory final KERNEL_AUTOOBJECT_TRAITS(KSharedMemory, KAutoObject); public: - explicit KSharedMemory(KernelCore& kernel_); + explicit KSharedMemory(KernelCore& kernel); ~KSharedMemory() override; Result Initialize(Core::DeviceMemory& device_memory_, KProcess* owner_process_, Svc::MemoryPermission owner_permission_, - Svc::MemoryPermission user_permission_, std::size_t size_, std::string name_); + Svc::MemoryPermission user_permission_, std::size_t size_); /** * Maps a shared memory block to an address in the target process' address space @@ -37,7 +37,7 @@ public: * @param map_size Size of the shared memory block to map * @param permissions Memory block map permissions (specified by SVC field) */ - Result Map(KProcess& target_process, VAddr address, std::size_t map_size, + Result Map(KProcess& target_process, KProcessAddress address, std::size_t map_size, Svc::MemoryPermission permissions); /** @@ -46,7 +46,7 @@ public: * @param address Address in system memory to unmap shared memory block * @param unmap_size Size of the shared memory block to unmap */ - Result Unmap(KProcess& target_process, VAddr address, std::size_t unmap_size); + Result Unmap(KProcess& target_process, KProcessAddress address, std::size_t unmap_size); /** * Gets a pointer to the shared memory block @@ -54,7 +54,7 @@ public: * @return A pointer to the shared memory block from the specified offset */ u8* GetPointer(std::size_t offset = 0) { - return device_memory->GetPointer<u8>(physical_address + offset); + return m_device_memory->GetPointer<u8>(m_physical_address + offset); } /** @@ -63,26 +63,26 @@ public: * @return A pointer to the shared memory block from the specified offset */ const u8* GetPointer(std::size_t offset = 0) const { - return device_memory->GetPointer<u8>(physical_address + offset); + return m_device_memory->GetPointer<u8>(m_physical_address + offset); } void Finalize() override; bool IsInitialized() const override { - return is_initialized; + return m_is_initialized; } - static void PostDestroy([[maybe_unused]] uintptr_t arg) {} + static void PostDestroy(uintptr_t arg) {} private: - Core::DeviceMemory* device_memory{}; - KProcess* owner_process{}; - std::optional<KPageGroup> page_group{}; - Svc::MemoryPermission owner_permission{}; - Svc::MemoryPermission user_permission{}; - PAddr physical_address{}; - std::size_t size{}; - KResourceLimit* resource_limit{}; - bool is_initialized{}; + Core::DeviceMemory* m_device_memory{}; + KProcess* m_owner_process{}; + std::optional<KPageGroup> m_page_group{}; + Svc::MemoryPermission m_owner_permission{}; + Svc::MemoryPermission m_user_permission{}; + KPhysicalAddress m_physical_address{}; + std::size_t m_size{}; + KResourceLimit* m_resource_limit{}; + bool m_is_initialized{}; }; } // namespace Kernel |