diff options
| author | 2016-03-21 04:07:03 -0400 | |
|---|---|---|
| committer | 2016-03-21 04:07:03 -0400 | |
| commit | 04f8d39a96f5c8335e480592a44e5a0ccbae05fa (patch) | |
| tree | 95e0ac7e418472020d95f08c38adbc9b221f0d91 /src | |
| parent | loader: Make MakeMagic constexpr (diff) | |
| download | yuzu-04f8d39a96f5c8335e480592a44e5a0ccbae05fa.tar.gz yuzu-04f8d39a96f5c8335e480592a44e5a0ccbae05fa.tar.xz yuzu-04f8d39a96f5c8335e480592a44e5a0ccbae05fa.zip | |
session: Make helper functions constexpr
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/session.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h index adaffcafe..6ddaf970e 100644 --- a/src/core/hle/kernel/session.h +++ b/src/core/hle/kernel/session.h | |||
| @@ -16,23 +16,23 @@ | |||
| 16 | 16 | ||
| 17 | namespace IPC { | 17 | namespace IPC { |
| 18 | 18 | ||
| 19 | inline u32 MakeHeader(u16 command_id, unsigned int regular_params, unsigned int translate_params) { | 19 | constexpr u32 MakeHeader(u16 command_id, unsigned int regular_params, unsigned int translate_params) { |
| 20 | return ((u32)command_id << 16) | (((u32)regular_params & 0x3F) << 6) | (((u32)translate_params & 0x3F) << 0); | 20 | return ((u32)command_id << 16) | (((u32)regular_params & 0x3F) << 6) | (((u32)translate_params & 0x3F) << 0); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | inline u32 MoveHandleDesc(unsigned int num_handles = 1) { | 23 | constexpr u32 MoveHandleDesc(unsigned int num_handles = 1) { |
| 24 | return 0x0 | ((num_handles - 1) << 26); | 24 | return 0x0 | ((num_handles - 1) << 26); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | inline u32 CopyHandleDesc(unsigned int num_handles = 1) { | 27 | constexpr u32 CopyHandleDesc(unsigned int num_handles = 1) { |
| 28 | return 0x10 | ((num_handles - 1) << 26); | 28 | return 0x10 | ((num_handles - 1) << 26); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | inline u32 CallingPidDesc() { | 31 | constexpr u32 CallingPidDesc() { |
| 32 | return 0x20; | 32 | return 0x20; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | inline u32 StaticBufferDesc(u32 size, unsigned int buffer_id) { | 35 | constexpr u32 StaticBufferDesc(u32 size, unsigned int buffer_id) { |
| 36 | return 0x2 | (size << 14) | ((buffer_id & 0xF) << 10); | 36 | return 0x2 | (size << 14) | ((buffer_id & 0xF) << 10); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| @@ -42,7 +42,7 @@ enum MappedBufferPermissions { | |||
| 42 | RW = R | W, | 42 | RW = R | W, |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | inline u32 MappedBufferDesc(u32 size, MappedBufferPermissions perms) { | 45 | constexpr u32 MappedBufferDesc(u32 size, MappedBufferPermissions perms) { |
| 46 | return 0x8 | (size << 4) | (u32)perms; | 46 | return 0x8 | (size << 4) | (u32)perms; |
| 47 | } | 47 | } |
| 48 | 48 | ||