diff options
| author | 2022-02-08 19:46:45 +0100 | |
|---|---|---|
| committer | 2022-02-15 00:45:19 +0100 | |
| commit | c3242abe95ec7b4b2279401ed08affb5b3e3e1da (patch) | |
| tree | f2e8ad3536399e9a18b80642395ecf85ce41182b /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #7871 from german77/svc2 (diff) | |
| download | yuzu-c3242abe95ec7b4b2279401ed08affb5b3e3e1da.tar.gz yuzu-c3242abe95ec7b4b2279401ed08affb5b3e3e1da.tar.xz yuzu-c3242abe95ec7b4b2279401ed08affb5b3e3e1da.zip | |
kernel: svc: Add OutputDebugString32, CreateCodeMemory32, ControlCodeMemory32
Very straightforward, they are just wrappers to the 64-bit version of
the SVC.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 3a2c9d18d..9836809f2 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -645,6 +645,10 @@ static void OutputDebugString(Core::System& system, VAddr address, u64 len) { | |||
| 645 | LOG_DEBUG(Debug_Emulated, "{}", str); | 645 | LOG_DEBUG(Debug_Emulated, "{}", str); |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | static void OutputDebugString32(Core::System& system, u32 address, u32 len) { | ||
| 649 | OutputDebugString(system, address, len); | ||
| 650 | } | ||
| 651 | |||
| 648 | /// Gets system/memory information for the current process | 652 | /// Gets system/memory information for the current process |
| 649 | static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle handle, | 653 | static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle handle, |
| 650 | u64 info_sub_id) { | 654 | u64 info_sub_id) { |
| @@ -1404,7 +1408,7 @@ static ResultCode UnmapProcessMemory(Core::System& system, VAddr dst_address, Ha | |||
| 1404 | } | 1408 | } |
| 1405 | 1409 | ||
| 1406 | static ResultCode CreateCodeMemory(Core::System& system, Handle* out, VAddr address, size_t size) { | 1410 | static ResultCode CreateCodeMemory(Core::System& system, Handle* out, VAddr address, size_t size) { |
| 1407 | LOG_TRACE(Kernel_SVC, "called, handle_out=0x{:X}, address=0x{:X}, size=0x{:X}", | 1411 | LOG_TRACE(Kernel_SVC, "called, handle_out={}, address=0x{:X}, size=0x{:X}", |
| 1408 | static_cast<void*>(out), address, size); | 1412 | static_cast<void*>(out), address, size); |
| 1409 | // Get kernel instance. | 1413 | // Get kernel instance. |
| 1410 | auto& kernel = system.Kernel(); | 1414 | auto& kernel = system.Kernel(); |
| @@ -1438,6 +1442,10 @@ static ResultCode CreateCodeMemory(Core::System& system, Handle* out, VAddr addr | |||
| 1438 | return ResultSuccess; | 1442 | return ResultSuccess; |
| 1439 | } | 1443 | } |
| 1440 | 1444 | ||
| 1445 | static ResultCode CreateCodeMemory32(Core::System& system, Handle* out, u32 address, u32 size) { | ||
| 1446 | return CreateCodeMemory(system, out, address, size); | ||
| 1447 | } | ||
| 1448 | |||
| 1441 | static ResultCode ControlCodeMemory(Core::System& system, Handle code_memory_handle, u32 operation, | 1449 | static ResultCode ControlCodeMemory(Core::System& system, Handle code_memory_handle, u32 operation, |
| 1442 | VAddr address, size_t size, Svc::MemoryPermission perm) { | 1450 | VAddr address, size_t size, Svc::MemoryPermission perm) { |
| 1443 | 1451 | ||
| @@ -1517,6 +1525,12 @@ static ResultCode ControlCodeMemory(Core::System& system, Handle code_memory_han | |||
| 1517 | return ResultSuccess; | 1525 | return ResultSuccess; |
| 1518 | } | 1526 | } |
| 1519 | 1527 | ||
| 1528 | static ResultCode ControlCodeMemory32(Core::System& system, Handle code_memory_handle, | ||
| 1529 | u32 operation, u64 address, u64 size, | ||
| 1530 | Svc::MemoryPermission perm) { | ||
| 1531 | return ControlCodeMemory(system, code_memory_handle, operation, address, size, perm); | ||
| 1532 | } | ||
| 1533 | |||
| 1520 | static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address, | 1534 | static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address, |
| 1521 | VAddr page_info_address, Handle process_handle, | 1535 | VAddr page_info_address, Handle process_handle, |
| 1522 | VAddr address) { | 1536 | VAddr address) { |
| @@ -2598,7 +2612,7 @@ static const FunctionDef SVC_Table_32[] = { | |||
| 2598 | {0x24, SvcWrap32<GetProcessId32>, "GetProcessId32"}, | 2612 | {0x24, SvcWrap32<GetProcessId32>, "GetProcessId32"}, |
| 2599 | {0x25, SvcWrap32<GetThreadId32>, "GetThreadId32"}, | 2613 | {0x25, SvcWrap32<GetThreadId32>, "GetThreadId32"}, |
| 2600 | {0x26, SvcWrap32<Break32>, "Break32"}, | 2614 | {0x26, SvcWrap32<Break32>, "Break32"}, |
| 2601 | {0x27, nullptr, "OutputDebugString32"}, | 2615 | {0x27, SvcWrap32<OutputDebugString32>, "OutputDebugString32"}, |
| 2602 | {0x28, nullptr, "ReturnFromException32"}, | 2616 | {0x28, nullptr, "ReturnFromException32"}, |
| 2603 | {0x29, SvcWrap32<GetInfo32>, "GetInfo32"}, | 2617 | {0x29, SvcWrap32<GetInfo32>, "GetInfo32"}, |
| 2604 | {0x2a, nullptr, "FlushEntireDataCache32"}, | 2618 | {0x2a, nullptr, "FlushEntireDataCache32"}, |
| @@ -2634,8 +2648,8 @@ static const FunctionDef SVC_Table_32[] = { | |||
| 2634 | {0x48, nullptr, "MapPhysicalMemoryUnsafe32"}, | 2648 | {0x48, nullptr, "MapPhysicalMemoryUnsafe32"}, |
| 2635 | {0x49, nullptr, "UnmapPhysicalMemoryUnsafe32"}, | 2649 | {0x49, nullptr, "UnmapPhysicalMemoryUnsafe32"}, |
| 2636 | {0x4a, nullptr, "SetUnsafeLimit32"}, | 2650 | {0x4a, nullptr, "SetUnsafeLimit32"}, |
| 2637 | {0x4b, nullptr, "CreateCodeMemory32"}, | 2651 | {0x4b, SvcWrap32<CreateCodeMemory32>, "CreateCodeMemory32"}, |
| 2638 | {0x4c, nullptr, "ControlCodeMemory32"}, | 2652 | {0x4c, SvcWrap32<ControlCodeMemory32>, "ControlCodeMemory32"}, |
| 2639 | {0x4d, nullptr, "SleepSystem32"}, | 2653 | {0x4d, nullptr, "SleepSystem32"}, |
| 2640 | {0x4e, nullptr, "ReadWriteRegister32"}, | 2654 | {0x4e, nullptr, "ReadWriteRegister32"}, |
| 2641 | {0x4f, nullptr, "SetProcessActivity32"}, | 2655 | {0x4f, nullptr, "SetProcessActivity32"}, |