@ -6,144 +6,154 @@
# include "core/hle/function_wrappers.h"
# include "core/hle/syscall.h"
# include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace Syscall
namespace Syscall {
Result SVC_ConnectToPort ( void * out , const char * port_name ) {
NOTICE_LOG ( OSHLE , " svcConnectToPort called, port_name: %s " , port_name ) ;
/// Connect to an OS service given the port name, returns the handle to the port to out
Result ConnectToPort ( void * out , const char * port_name ) {
Service : : Interface * service = Service : : g_manager - > FetchFromPortName ( port_name ) ;
Core : : g_app_core - > SetReg ( 1 , service - > GetUID ( ) ) ;
return 0 ;
}
/// Synchronize to an OS service
Result SendSyncRequest ( Handle session ) {
Service : : Interface * service = Service : : g_manager - > FetchFromUID ( session ) ;
service - > Sync ( ) ;
return 0 ;
}
const HLE : : FunctionDef Syscall_Table [ ] = {
{ 0x00 , NULL , " Unknown " } ,
{ 0x01 , NULL , " svcControlMemory " } ,
{ 0x02 , NULL , " svcQueryMemory " } ,
{ 0x03 , NULL , " svcExitProcess " } ,
{ 0x04 , NULL , " svcGetProcessAffinityMask " } ,
{ 0x05 , NULL , " svc SetProcessAffinityMask" } ,
{ 0x06 , NULL , " svc GetProcessIdealProcessor" } ,
{ 0x07 , NULL , " svc SetProcessIdealProcessor" } ,
{ 0x08 , NULL , " svc CreateThread" } ,
{ 0x09 , NULL , " svc ExitThread" } ,
{ 0x0A , NULL , " svc SleepThread" } ,
{ 0x0B , NULL , " svc GetThreadPriority" } ,
{ 0x0C , NULL , " svc SetThreadPriority" } ,
{ 0x0D , NULL , " svc GetThreadAffinityMask" } ,
{ 0x0E , NULL , " svc SetThreadAffinityMask" } ,
{ 0x0F , NULL , " svc GetThreadIdealProcessor" } ,
{ 0x10 , NULL , " svc SetThreadIdealProcessor" } ,
{ 0x11 , NULL , " svc GetCurrentProcessorNumber" } ,
{ 0x12 , NULL , " svc Run" } ,
{ 0x13 , NULL , " svc CreateMutex" } ,
{ 0x14 , NULL , " svc ReleaseMutex" } ,
{ 0x15 , NULL , " svc CreateSemaphore" } ,
{ 0x16 , NULL , " svc ReleaseSemaphore" } ,
{ 0x17 , NULL , " svc CreateEvent" } ,
{ 0x18 , NULL , " svc SignalEvent" } ,
{ 0x19 , NULL , " svc ClearEvent" } ,
{ 0x1A , NULL , " svc CreateTimer" } ,
{ 0x1B , NULL , " svc SetTimer" } ,
{ 0x1C , NULL , " svc CancelTimer" } ,
{ 0x1D , NULL , " svc ClearTimer" } ,
{ 0x1E , NULL , " svc CreateMemoryBlock" } ,
{ 0x1F , NULL , " svc MapMemoryBlock" } ,
{ 0x20 , NULL , " svc UnmapMemoryBlock" } ,
{ 0x21 , NULL , " svc CreateAddressArbiter" } ,
{ 0x22 , NULL , " svc ArbitrateAddress" } ,
{ 0x23 , NULL , " svc CloseHandle" } ,
{ 0x24 , NULL , " svc WaitSynchronization1" } ,
{ 0x25 , NULL , " svc WaitSynchronizationN" } ,
{ 0x26 , NULL , " svc SignalAndWait" } ,
{ 0x27 , NULL , " svc DuplicateHandle" } ,
{ 0x28 , NULL , " svc GetSystemTick" } ,
{ 0x29 , NULL , " svc GetHandleInfo" } ,
{ 0x2A , NULL , " svc GetSystemInfo" } ,
{ 0x2B , NULL , " svc GetProcessInfo" } ,
{ 0x2C , NULL , " svc GetThreadInfo" } ,
{ 0x2D , WrapI_VC < SVC_ ConnectToPort> , " svc ConnectToPort" } ,
{ 0x2E , NULL , " svc SendSyncRequest1" } ,
{ 0x2F , NULL , " svc SendSyncRequest2" } ,
{ 0x30 , NULL , " svc SendSyncRequest3" } ,
{ 0x31 , NULL , " svc SendSyncRequest4" } ,
{ 0x32 , NULL , " svc SendSyncRequest" } ,
{ 0x33 , NULL , " svc OpenProcess" } ,
{ 0x34 , NULL , " svc OpenThread" } ,
{ 0x35 , NULL , " svc GetProcessId" } ,
{ 0x36 , NULL , " svc GetProcessIdOfThread" } ,
{ 0x37 , NULL , " svc GetThreadId" } ,
{ 0x38 , NULL , " svc GetResourceLimit" } ,
{ 0x39 , NULL , " svc GetResourceLimitLimitValues" } ,
{ 0x3A , NULL , " svc GetResourceLimitCurrentValues" } ,
{ 0x3B , NULL , " svc GetThreadContext" } ,
{ 0x3C , NULL , " svc Break" } ,
{ 0x3D , NULL , " svc OutputDebugString" } ,
{ 0x3E , NULL , " svc ControlPerformanceCounter" } ,
{ 0x3F , NULL , " Unknown " } ,
{ 0x40 , NULL , " Unknown " } ,
{ 0x41 , NULL , " Unknown " } ,
{ 0x42 , NULL , " Unknown " } ,
{ 0x43 , NULL , " Unknown " } ,
{ 0x44 , NULL , " Unknown " } ,
{ 0x45 , NULL , " Unknown " } ,
{ 0x46 , NULL , " Unknown " } ,
{ 0x47 , NULL , " svc CreatePort" } ,
{ 0x48 , NULL , " svc CreateSessionToPort" } ,
{ 0x49 , NULL , " svc CreateSession" } ,
{ 0x4A , NULL , " svc AcceptSession" } ,
{ 0x4B , NULL , " svc ReplyAndReceive1" } ,
{ 0x4C , NULL , " svc ReplyAndReceive2" } ,
{ 0x4D , NULL , " svc ReplyAndReceive3" } ,
{ 0x4E , NULL , " svc ReplyAndReceive4" } ,
{ 0x4F , NULL , " svc ReplyAndReceive" } ,
{ 0x50 , NULL , " svc BindInterrupt" } ,
{ 0x51 , NULL , " svc UnbindInterrupt" } ,
{ 0x52 , NULL , " svc InvalidateProcessDataCache" } ,
{ 0x53 , NULL , " svc StoreProcessDataCache" } ,
{ 0x54 , NULL , " svc FlushProcessDataCache" } ,
{ 0x55 , NULL , " svc StartInterProcessDma" } ,
{ 0x56 , NULL , " svc StopDma" } ,
{ 0x57 , NULL , " svc GetDmaState" } ,
{ 0x58 , NULL , " svc RestartDma" } ,
{ 0x59 , NULL , " Unknown " } ,
{ 0x5A , NULL , " Unknown " } ,
{ 0x5B , NULL , " Unknown " } ,
{ 0x5C , NULL , " Unknown " } ,
{ 0x5D , NULL , " Unknown " } ,
{ 0x5E , NULL , " Unknown " } ,
{ 0x5F , NULL , " Unknown " } ,
{ 0x60 , NULL , " svc DebugActiveProcess" } ,
{ 0x61 , NULL , " svc BreakDebugProcess" } ,
{ 0x62 , NULL , " svc TerminateDebugProcess" } ,
{ 0x63 , NULL , " svc GetProcessDebugEvent" } ,
{ 0x64 , NULL , " svc ContinueDebugEvent" } ,
{ 0x65 , NULL , " svc GetProcessList" } ,
{ 0x66 , NULL , " svc GetThreadList" } ,
{ 0x67 , NULL , " svc GetDebugThreadContext" } ,
{ 0x68 , NULL , " svc SetDebugThreadContext" } ,
{ 0x69 , NULL , " svc QueryDebugProcessMemory" } ,
{ 0x6A , NULL , " svc ReadProcessMemory" } ,
{ 0x6B , NULL , " svc WriteProcessMemory" } ,
{ 0x6C , NULL , " svc SetHardwareBreakPoint" } ,
{ 0x6D , NULL , " svc GetDebugThreadParam" } ,
{ 0x6E , NULL , " Unknown " } ,
{ 0x6F , NULL , " Unknown " } ,
{ 0x70 , NULL , " svc ControlProcessMemory" } ,
{ 0x71 , NULL , " svc MapProcessMemory" } ,
{ 0x72 , NULL , " svc UnmapProcessMemory" } ,
{ 0x73 , NULL , " Unknown " } ,
{ 0x74 , NULL , " Unknown " } ,
{ 0x75 , NULL , " Unknown " } ,
{ 0x76 , NULL , " svc TerminateProcess" } ,
{ 0x77 , NULL , " Unknown " } ,
{ 0x78 , NULL , " svc CreateResourceLimit" } ,
{ 0x79 , NULL , " Unknown " } ,
{ 0x7A , NULL , " Unknown " } ,
{ 0x7B , NULL , " Unknown " } ,
{ 0x7C , NULL , " svc KernelSetState" } ,
{ 0x7D , NULL , " svc QueryProcessMemory" } ,
{ 0x00 , NULL , " Unknown " } ,
{ 0x01 , NULL , " ControlMemory" } ,
{ 0x02 , NULL , " QueryMemory" } ,
{ 0x03 , NULL , " ExitProcess" } ,
{ 0x04 , NULL , " GetProcessAffinityMask" } ,
{ 0x05 , NULL , " SetProcessAffinityMask" } ,
{ 0x06 , NULL , " GetProcessIdealProcessor" } ,
{ 0x07 , NULL , " SetProcessIdealProcessor" } ,
{ 0x08 , NULL , " CreateThread" } ,
{ 0x09 , NULL , " ExitThread" } ,
{ 0x0A , NULL , " SleepThread" } ,
{ 0x0B , NULL , " GetThreadPriority" } ,
{ 0x0C , NULL , " SetThreadPriority" } ,
{ 0x0D , NULL , " GetThreadAffinityMask" } ,
{ 0x0E , NULL , " SetThreadAffinityMask" } ,
{ 0x0F , NULL , " GetThreadIdealProcessor" } ,
{ 0x10 , NULL , " SetThreadIdealProcessor" } ,
{ 0x11 , NULL , " GetCurrentProcessorNumber" } ,
{ 0x12 , NULL , " Run" } ,
{ 0x13 , NULL , " CreateMutex" } ,
{ 0x14 , NULL , " ReleaseMutex" } ,
{ 0x15 , NULL , " CreateSemaphore" } ,
{ 0x16 , NULL , " ReleaseSemaphore" } ,
{ 0x17 , NULL , " CreateEvent" } ,
{ 0x18 , NULL , " SignalEvent" } ,
{ 0x19 , NULL , " ClearEvent" } ,
{ 0x1A , NULL , " CreateTimer" } ,
{ 0x1B , NULL , " SetTimer" } ,
{ 0x1C , NULL , " CancelTimer" } ,
{ 0x1D , NULL , " ClearTimer" } ,
{ 0x1E , NULL , " CreateMemoryBlock" } ,
{ 0x1F , NULL , " MapMemoryBlock" } ,
{ 0x20 , NULL , " UnmapMemoryBlock" } ,
{ 0x21 , NULL , " CreateAddressArbiter" } ,
{ 0x22 , NULL , " ArbitrateAddress" } ,
{ 0x23 , NULL , " CloseHandle" } ,
{ 0x24 , NULL , " WaitSynchronization1" } ,
{ 0x25 , NULL , " WaitSynchronizationN" } ,
{ 0x26 , NULL , " SignalAndWait" } ,
{ 0x27 , NULL , " DuplicateHandle" } ,
{ 0x28 , NULL , " GetSystemTick" } ,
{ 0x29 , NULL , " GetHandleInfo" } ,
{ 0x2A , NULL , " GetSystemInfo" } ,
{ 0x2B , NULL , " GetProcessInfo" } ,
{ 0x2C , NULL , " GetThreadInfo" } ,
{ 0x2D , WrapI_VC < ConnectToPort> , " ConnectToPort" } ,
{ 0x2E , NULL , " SendSyncRequest1" } ,
{ 0x2F , NULL , " SendSyncRequest2" } ,
{ 0x30 , NULL , " SendSyncRequest3" } ,
{ 0x31 , NULL , " SendSyncRequest4" } ,
{ 0x32 , WrapI_U < SendSyncRequest > , " SendSyncRequest" } ,
{ 0x33 , NULL , " OpenProcess" } ,
{ 0x34 , NULL , " OpenThread" } ,
{ 0x35 , NULL , " GetProcessId" } ,
{ 0x36 , NULL , " GetProcessIdOfThread" } ,
{ 0x37 , NULL , " GetThreadId" } ,
{ 0x38 , NULL , " GetResourceLimit" } ,
{ 0x39 , NULL , " GetResourceLimitLimitValues" } ,
{ 0x3A , NULL , " GetResourceLimitCurrentValues" } ,
{ 0x3B , NULL , " GetThreadContext" } ,
{ 0x3C , NULL , " Break" } ,
{ 0x3D , NULL , " OutputDebugString" } ,
{ 0x3E , NULL , " ControlPerformanceCounter" } ,
{ 0x3F , NULL , " Unknown " } ,
{ 0x40 , NULL , " Unknown " } ,
{ 0x41 , NULL , " Unknown " } ,
{ 0x42 , NULL , " Unknown " } ,
{ 0x43 , NULL , " Unknown " } ,
{ 0x44 , NULL , " Unknown " } ,
{ 0x45 , NULL , " Unknown " } ,
{ 0x46 , NULL , " Unknown " } ,
{ 0x47 , NULL , " CreatePort" } ,
{ 0x48 , NULL , " CreateSessionToPort" } ,
{ 0x49 , NULL , " CreateSession" } ,
{ 0x4A , NULL , " AcceptSession" } ,
{ 0x4B , NULL , " ReplyAndReceive1" } ,
{ 0x4C , NULL , " ReplyAndReceive2" } ,
{ 0x4D , NULL , " ReplyAndReceive3" } ,
{ 0x4E , NULL , " ReplyAndReceive4" } ,
{ 0x4F , NULL , " ReplyAndReceive" } ,
{ 0x50 , NULL , " BindInterrupt" } ,
{ 0x51 , NULL , " UnbindInterrupt" } ,
{ 0x52 , NULL , " InvalidateProcessDataCache" } ,
{ 0x53 , NULL , " StoreProcessDataCache" } ,
{ 0x54 , NULL , " FlushProcessDataCache" } ,
{ 0x55 , NULL , " StartInterProcessDma" } ,
{ 0x56 , NULL , " StopDma" } ,
{ 0x57 , NULL , " GetDmaState" } ,
{ 0x58 , NULL , " RestartDma" } ,
{ 0x59 , NULL , " Unknown " } ,
{ 0x5A , NULL , " Unknown " } ,
{ 0x5B , NULL , " Unknown " } ,
{ 0x5C , NULL , " Unknown " } ,
{ 0x5D , NULL , " Unknown " } ,
{ 0x5E , NULL , " Unknown " } ,
{ 0x5F , NULL , " Unknown " } ,
{ 0x60 , NULL , " DebugActiveProcess" } ,
{ 0x61 , NULL , " BreakDebugProcess" } ,
{ 0x62 , NULL , " TerminateDebugProcess" } ,
{ 0x63 , NULL , " GetProcessDebugEvent" } ,
{ 0x64 , NULL , " ContinueDebugEvent" } ,
{ 0x65 , NULL , " GetProcessList" } ,
{ 0x66 , NULL , " GetThreadList" } ,
{ 0x67 , NULL , " GetDebugThreadContext" } ,
{ 0x68 , NULL , " SetDebugThreadContext" } ,
{ 0x69 , NULL , " QueryDebugProcessMemory" } ,
{ 0x6A , NULL , " ReadProcessMemory" } ,
{ 0x6B , NULL , " WriteProcessMemory" } ,
{ 0x6C , NULL , " SetHardwareBreakPoint" } ,
{ 0x6D , NULL , " GetDebugThreadParam" } ,
{ 0x6E , NULL , " Unknown " } ,
{ 0x6F , NULL , " Unknown " } ,
{ 0x70 , NULL , " ControlProcessMemory" } ,
{ 0x71 , NULL , " MapProcessMemory" } ,
{ 0x72 , NULL , " UnmapProcessMemory" } ,
{ 0x73 , NULL , " Unknown " } ,
{ 0x74 , NULL , " Unknown " } ,
{ 0x75 , NULL , " Unknown " } ,
{ 0x76 , NULL , " TerminateProcess" } ,
{ 0x77 , NULL , " Unknown " } ,
{ 0x78 , NULL , " CreateResourceLimit" } ,
{ 0x79 , NULL , " Unknown " } ,
{ 0x7A , NULL , " Unknown " } ,
{ 0x7B , NULL , " Unknown " } ,
{ 0x7C , NULL , " KernelSetState" } ,
{ 0x7D , NULL , " QueryProcessMemory" } ,
} ;
void Register ( ) {