From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/hle/kernel/shared_memory.h | 59 ++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'src/core/hle/kernel/shared_memory.h') diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index 0c404a9f8..afb142380 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -16,15 +16,15 @@ namespace Kernel { /// Permissions for mapped shared memory blocks enum class MemoryPermission : u32 { - None = 0, - Read = (1u << 0), - Write = (1u << 1), - ReadWrite = (Read | Write), - Execute = (1u << 2), - ReadExecute = (Read | Execute), - WriteExecute = (Write | Execute), + None = 0, + Read = (1u << 0), + Write = (1u << 1), + ReadWrite = (Read | Write), + Execute = (1u << 2), + ReadExecute = (Read | Execute), + WriteExecute = (Write | Execute), ReadWriteExecute = (Read | Write | Execute), - DontCare = (1u << 28) + DontCare = (1u << 28) }; class SharedMemory final : public Object { @@ -34,13 +34,18 @@ public: * @param owner_process Process that created this shared memory object. * @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 other_permissions Permission restrictions applied to other processes mapping the + * block. * @param address The address from which to map the Shared Memory. - * @param region If the address is 0, the shared memory will be allocated in this region of the linear heap. + * @param region If the address is 0, the shared memory will be allocated in this region of the + * linear heap. * @param name Optional object name, used for debugging purposes. */ - static SharedPtr Create(SharedPtr owner_process, u32 size, MemoryPermission permissions, - MemoryPermission other_permissions, VAddr address = 0, MemoryRegion region = MemoryRegion::BASE, std::string name = "Unknown"); + static SharedPtr Create(SharedPtr owner_process, u32 size, + MemoryPermission permissions, + MemoryPermission other_permissions, VAddr address = 0, + MemoryRegion region = MemoryRegion::BASE, + std::string name = "Unknown"); /** * Creates a shared memory object from a block of memory managed by an HLE applet. @@ -48,17 +53,27 @@ public: * @param offset The offset into the heap block that the SharedMemory will map. * @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 other_permissions Permission restrictions applied to other processes mapping the + * block. * @param name Optional object name, used for debugging purposes. */ - static SharedPtr CreateForApplet(std::shared_ptr> heap_block, u32 offset, u32 size, - MemoryPermission permissions, MemoryPermission other_permissions, std::string name = "Unknown Applet"); - - std::string GetTypeName() const override { return "SharedMemory"; } - std::string GetName() const override { return name; } + static SharedPtr CreateForApplet(std::shared_ptr> heap_block, + u32 offset, u32 size, + MemoryPermission permissions, + MemoryPermission other_permissions, + std::string name = "Unknown Applet"); + + 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; } + HandleType GetHandleType() const override { + return HANDLE_TYPE; + } /** * Converts the specified MemoryPermission into the equivalent VMAPermission. @@ -73,7 +88,8 @@ public: * @param permissions Memory block map permissions (specified by SVC field) * @param other_permissions Memory block map other permissions (specified by SVC field) */ - ResultCode Map(Process* target_process, VAddr address, MemoryPermission permissions, MemoryPermission other_permissions); + ResultCode Map(Process* target_process, VAddr address, MemoryPermission permissions, + MemoryPermission other_permissions); /** * Unmaps a shared memory block from the specified address in system memory @@ -94,7 +110,8 @@ public: SharedPtr owner_process; /// Address of shared memory block in the owner process if specified. VAddr base_address; - /// Physical address of the shared memory block in the linear heap if no address was specified during creation. + /// Physical address of the shared memory block in the linear heap if no address was specified + /// during creation. PAddr linear_heap_phys_address; /// Backing memory for this shared memory block. std::shared_ptr> backing_block; -- cgit v1.2.3