diff options
author | bunnei <bunneidev@gmail.com> | 2014-07-05 10:22:03 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-07-05 10:24:54 -0400 |
commit | 7ff92c36ed70e75a54d8a15a7806ab9be34b3168 (patch) | |
tree | fe2d322dc00edc55786956e5c94588205ae332b6 /src/core/hle/kernel/shared_memory.h | |
parent | 882dc0792904ec47d57a356a3c9e8fc1a240cc73 (diff) |
SharedMemory: Updated MapSharedMemory to use an enum for permissions.
- Also added some safety checks to MapSharedMemory.
Diffstat (limited to 'src/core/hle/kernel/shared_memory.h')
-rw-r--r-- | src/core/hle/kernel/shared_memory.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index 4e235f60..5312b885 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -10,6 +10,15 @@ namespace Kernel { +/// Permissions for mapped shared memory blocks +enum class MemoryPermission : u32 { + None = 0, + Read = (1u << 0), + Write = (1u << 1), + ReadWrite = (Read | Write), + DontCare = (1u << 28) +}; + /** * Creates a shared memory object * @param name Optional name of shared memory object @@ -25,7 +34,8 @@ Handle CreateSharedMemory(const std::string& name="Unknown"); * @param other_permissions Memory block map other permissions (specified by SVC field) * @return Result of operation, 0 on success, otherwise error code */ -Result MapSharedMemory(u32 handle, u32 address, u32 permissions, u32 other_permissions); +Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, + MemoryPermission other_permissions); /** * Gets a pointer to the shared memory block |