summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-06-22 03:47:55 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-06-23 00:24:19 +0200
commit81488d7a6ab09ff980a9325901113449800f5146 (patch)
tree12eeb017c1e82984e02b5f0a72aeb6584155d065 /src/core/hle/kernel
parentMerge pull request #860 from yuriks/y2r-color (diff)
downloadyuzu-81488d7a6ab09ff980a9325901113449800f5146.tar
yuzu-81488d7a6ab09ff980a9325901113449800f5146.tar.gz
yuzu-81488d7a6ab09ff980a9325901113449800f5146.tar.bz2
yuzu-81488d7a6ab09ff980a9325901113449800f5146.tar.lz
yuzu-81488d7a6ab09ff980a9325901113449800f5146.tar.xz
yuzu-81488d7a6ab09ff980a9325901113449800f5146.tar.zst
yuzu-81488d7a6ab09ff980a9325901113449800f5146.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/session.h34
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 @@
#include "core/hle/kernel/thread.h"
#include "core/memory.h"
+namespace IPC {
+
+inline u32 MakeHeader(u16 command_id, unsigned int regular_params, unsigned int translate_params) {
+ return ((u32)command_id << 16) | (((u32)regular_params & 0x3F) << 6) | (((u32)translate_params & 0x3F) << 0);
+}
+
+inline u32 MoveHandleDesc(unsigned int num_handles = 1) {
+ return 0x0 | ((num_handles - 1) << 26);
+}
+
+inline u32 CopyHandleDesc(unsigned int num_handles = 1) {
+ return 0x10 | ((num_handles - 1) << 26);
+}
+
+inline u32 CallingPidDesc() {
+ return 0x20;
+}
+
+inline u32 StaticBufferDesc(u32 size, unsigned int buffer_id) {
+ return 0x2 | (size << 14) | ((buffer_id & 0xF) << 10);
+}
+
+enum MappedBufferPermissions {
+ R = 2,
+ W = 4,
+ RW = R | W,
+};
+
+inline u32 MappedBufferDesc(u32 size, MappedBufferPermissions perms) {
+ return 0x8 | (size << 4) | (u32)perms;
+}
+
+}
+
namespace Kernel {
static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header