diff options
| author | 2014-04-17 23:05:31 -0400 | |
|---|---|---|
| committer | 2014-04-17 23:05:31 -0400 | |
| commit | b2baafaf8ba760ce2b975391fd04db52ad386e29 (patch) | |
| tree | db16aba20508121cd0d6d7cd489d1e1963b67525 /src/core/hle/syscall.cpp | |
| parent | fixed bug in Memory::GetPointer (diff) | |
| download | yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.gz yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.tar.xz yuzu-b2baafaf8ba760ce2b975391fd04db52ad386e29.zip | |
added GSP heap memory allocation
Diffstat (limited to 'src/core/hle/syscall.cpp')
| -rw-r--r-- | src/core/hle/syscall.cpp | 26 |
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 | ||
| 14 | namespace Syscall { | 18 | namespace Syscall { |
| 15 | 19 | ||
| 20 | /// Map application or GSP heap memory | ||
| 21 | Result 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 |
| 17 | Result ConnectToPort(void* out, const char* port_name) { | 41 | Result 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 | ||
| 42 | const HLE::FunctionDef Syscall_Table[] = { | 66 | const 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"}, |