diff options
| author | archshift <gh@archshift.com> | 2015-05-10 18:07:44 -0700 |
|---|---|---|
| committer | archshift <gh@archshift.com> | 2015-05-10 18:07:44 -0700 |
| commit | e98fbadf4a49eecc6d39c082cba683d5d88ea2c5 (patch) | |
| tree | 7901b6ad673f8950d4f36d731eaa45b195cac763 /src/core/hle/kernel/shared_memory.h | |
| parent | 2a19de1d09f725e8ef267a51d4c5ff994b036b04 (diff) | |
| parent | fd85367621a1428552ed4d8f43605dd0d7b5f100 (diff) | |
Merge pull request #740 from yuriks/gsp-shmem
Fix crashes due to un-initialized GSP shared memory
Diffstat (limited to 'src/core/hle/kernel/shared_memory.h')
| -rw-r--r-- | src/core/hle/kernel/shared_memory.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index 5833b411c..204266896 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -27,11 +27,16 @@ class SharedMemory final : public Object { public: /** * Creates a shared memory object - * @param name Optional object name, used only for debugging purposes. + * @param size Size of the memory block. Must be page-aligned. + * @param permissions Permission restrictions applied to the process which created the block. + * @param other_permissions Permission restrictions applied to other processes mapping the block. + * @param name Optional object name, used for debugging purposes. */ - static SharedPtr<SharedMemory> Create(std::string name = "Unknown"); + static SharedPtr<SharedMemory> Create(u32 size, MemoryPermission permissions, + MemoryPermission other_permissions, std::string name = "Unknown"); std::string GetTypeName() const override { return "SharedMemory"; } + std::string GetName() const override { return name; } static const HandleType HANDLE_TYPE = HandleType::SharedMemory; HandleType GetHandleType() const override { return HANDLE_TYPE; } @@ -49,12 +54,18 @@ public: * @param offset Offset from the start of the shared memory block to get pointer * @return Pointer to the shared memory block from the specified offset */ - ResultVal<u8*> GetPointer(u32 offset = 0); + u8* GetPointer(u32 offset = 0); - VAddr base_address; ///< Address of shared memory block in RAM - MemoryPermission permissions; ///< Permissions of shared memory block (SVC field) - MemoryPermission other_permissions; ///< Other permissions of shared memory block (SVC field) - std::string name; ///< Name of shared memory object (optional) + /// Address of shared memory block in the process. + VAddr base_address; + /// Size of the memory block. Page-aligned. + u32 size; + /// Permission restrictions applied to the process which created the block. + MemoryPermission permissions; + /// Permission restrictions applied to other processes mapping the block. + MemoryPermission other_permissions; + /// Name of shared memory object. + std::string name; private: SharedMemory(); |
