summaryrefslogtreecommitdiff
path: root/src/core/hle/syscall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/syscall.cpp')
-rw-r--r--src/core/hle/syscall.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp
index c5b887795..0cb563955 100644
--- a/src/core/hle/syscall.cpp
+++ b/src/core/hle/syscall.cpp
@@ -4,6 +4,10 @@
4 4
5#include <map> 5#include <map>
6 6
7#include "core/mem_map.h"
8
9#include "core/hw/hw_lcd.h"
10
7#include "core/hle/function_wrappers.h" 11#include "core/hle/function_wrappers.h"
8#include "core/hle/syscall.h" 12#include "core/hle/syscall.h"
9#include "core/hle/service/service.h" 13#include "core/hle/service/service.h"
@@ -13,6 +17,26 @@
13 17
14namespace Syscall { 18namespace Syscall {
15 19
20/// Map application or GSP heap memory
21Result ControlMemory(void* outaddr, u32 addr0, u32 addr1, u32 size, u32 operation, u32 permissions) {
22 u32 virtual_address = 0x00000000;
23
24 switch (operation) {
25
26 // Map GSP heap memory?
27 case 0x00010003:
28 virtual_address = Memory::MapBlock_HeapGSP(size, operation, permissions);
29 break;
30
31 // Unknown ControlMemory operation
32 default:
33 ERROR_LOG(OSHLE, "Unknown ControlMemory operation %08X", operation);
34 }
35
36 Core::g_app_core->SetReg(1, Memory::MapBlock_HeapGSP(size, operation, permissions));
37 return 0;
38}
39
16/// Connect to an OS service given the port name, returns the handle to the port to out 40/// Connect to an OS service given the port name, returns the handle to the port to out
17Result ConnectToPort(void* out, const char* port_name) { 41Result ConnectToPort(void* out, const char* port_name) {
18 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); 42 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
@@ -41,7 +65,7 @@ Result WaitSynchronization1(Handle handle, s64 nanoseconds) {
41 65
42const HLE::FunctionDef Syscall_Table[] = { 66const HLE::FunctionDef Syscall_Table[] = {
43 {0x00, NULL, "Unknown"}, 67 {0x00, NULL, "Unknown"},
44 {0x01, NULL, "ControlMemory"}, 68 {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"},
45 {0x02, NULL, "QueryMemory"}, 69 {0x02, NULL, "QueryMemory"},
46 {0x03, NULL, "ExitProcess"}, 70 {0x03, NULL, "ExitProcess"},
47 {0x04, NULL, "GetProcessAffinityMask"}, 71 {0x04, NULL, "GetProcessAffinityMask"},