From 66431bcedaf406e5d356da1aad8baf55e1cc9cb9 Mon Sep 17 00:00:00 2001
From: purpasmart96 <purpasmart96@users.noreply.github.com>
Date: Fri, 7 Nov 2014 18:53:18 -0800
Subject: [PATCH] Kernel:Add missing permissions in shared memory & svc

---
 src/core/hle/kernel/shared_memory.h | 14 +++++++++-----
 src/core/hle/svc.cpp                |  4 ++++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h
index 5312b8854..6204d8a45 100644
--- a/src/core/hle/kernel/shared_memory.h
+++ b/src/core/hle/kernel/shared_memory.h
@@ -12,11 +12,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)
+    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)
 };
 
 /**
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 1eda36c53..2aa1303f6 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -62,6 +62,10 @@ Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permis
     case Kernel::MemoryPermission::Read:
     case Kernel::MemoryPermission::Write:
     case Kernel::MemoryPermission::ReadWrite:
+    case Kernel::MemoryPermission::Execute:
+    case Kernel::MemoryPermission::ReadExecute:
+    case Kernel::MemoryPermission::WriteExecute:
+    case Kernel::MemoryPermission::ReadWriteExecute:
     case Kernel::MemoryPermission::DontCare:
         Kernel::MapSharedMemory(handle, addr, permissions_type, 
             static_cast<Kernel::MemoryPermission>(other_permissions));