diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/session.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h index 54a062971..257da9105 100644 --- a/src/core/hle/kernel/session.h +++ b/src/core/hle/kernel/session.h | |||
| @@ -8,6 +8,40 @@ | |||
| 8 | #include "core/hle/kernel/thread.h" | 8 | #include "core/hle/kernel/thread.h" |
| 9 | #include "core/memory.h" | 9 | #include "core/memory.h" |
| 10 | 10 | ||
| 11 | namespace IPC { | ||
| 12 | |||
| 13 | inline u32 MakeHeader(u16 command_id, unsigned int regular_params, unsigned int translate_params) { | ||
| 14 | return ((u32)command_id << 16) | (((u32)regular_params & 0x3F) << 6) | (((u32)translate_params & 0x3F) << 0); | ||
| 15 | } | ||
| 16 | |||
| 17 | inline u32 MoveHandleDesc(unsigned int num_handles = 1) { | ||
| 18 | return 0x0 | ((num_handles - 1) << 26); | ||
| 19 | } | ||
| 20 | |||
| 21 | inline u32 CopyHandleDesc(unsigned int num_handles = 1) { | ||
| 22 | return 0x10 | ((num_handles - 1) << 26); | ||
| 23 | } | ||
| 24 | |||
| 25 | inline u32 CallingPidDesc() { | ||
| 26 | return 0x20; | ||
| 27 | } | ||
| 28 | |||
| 29 | inline u32 StaticBufferDesc(u32 size, unsigned int buffer_id) { | ||
| 30 | return 0x2 | (size << 14) | ((buffer_id & 0xF) << 10); | ||
| 31 | } | ||
| 32 | |||
| 33 | enum MappedBufferPermissions { | ||
| 34 | R = 2, | ||
| 35 | W = 4, | ||
| 36 | RW = R | W, | ||
| 37 | }; | ||
| 38 | |||
| 39 | inline u32 MappedBufferDesc(u32 size, MappedBufferPermissions perms) { | ||
| 40 | return 0x8 | (size << 4) | (u32)perms; | ||
| 41 | } | ||
| 42 | |||
| 43 | } | ||
| 44 | |||
| 11 | namespace Kernel { | 45 | namespace Kernel { |
| 12 | 46 | ||
| 13 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header | 47 | static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header |