diff options
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/ipc.h | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/kernel/mutex.cpp | 1 | ||||
-rw-r--r-- | src/core/hle/result.h | 46 | ||||
-rw-r--r-- | src/core/hle/service/audio/audin_u.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 8 | ||||
-rw-r--r-- | src/core/hle/service/audio/audrec_u.cpp | 3 | ||||
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 25 | ||||
-rw-r--r-- | src/core/hle/service/audio/codecctl.cpp | 26 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal.h | 4 | ||||
-rw-r--r-- | src/core/hle/service/fatal/fatal_u.cpp | 5 | ||||
-rw-r--r-- | src/core/hle/service/nfp/nfp.cpp | 48 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 2 |
14 files changed, 112 insertions, 72 deletions
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index ef6595550..c9257de77 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h @@ -32,6 +32,8 @@ enum class CommandType : u32 { Close = 2, Request = 4, Control = 5, + RequestWithContext = 6, + ControlWithContext = 7, Unspecified, }; diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 349bc11df..01904467e 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -110,7 +110,9 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { // Padding to align to 16 bytes rp.AlignWithPadding(); - if (Session()->IsDomain() && (command_header->type == IPC::CommandType::Request || !incoming)) { + if (Session()->IsDomain() && ((command_header->type == IPC::CommandType::Request || + command_header->type == IPC::CommandType::RequestWithContext) || + !incoming)) { // If this is an incoming message, only CommandType "Request" has a domain header // All outgoing domain messages have the domain header, if only incoming has it if (incoming || domain_message_header) { diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 63733ad79..bc144f3de 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -104,7 +104,6 @@ ResultCode Mutex::Release(VAddr address) { // There are no more threads waiting for the mutex, release it completely. if (thread == nullptr) { - ASSERT(GetCurrentThread()->wait_mutex_threads.empty()); Memory::Write32(address, 0); return RESULT_SUCCESS; } diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 052f49979..e3eda4f54 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -42,41 +42,75 @@ enum class ErrorModule : u32 { PM = 15, NS = 16, HTC = 18, + NCMContent = 20, SM = 21, RO = 22, SDMMC = 24, + OVLN = 25, SPL = 26, ETHC = 100, I2C = 101, + GPIO = 102, + UART = 103, Settings = 105, + WLAN = 107, + XCD = 108, NIFM = 110, - Display = 114, - NTC = 116, + Hwopus = 111, + Bluetooth = 113, + VI = 114, + NFP = 115, + Time = 116, FGM = 117, - PCIE = 120, + PCIe = 120, Friends = 121, + BCAT = 122, SSL = 123, Account = 124, + News = 125, Mii = 126, + NFC = 127, AM = 128, PlayReport = 129, + AHID = 130, + Qlaunch = 132, PCV = 133, OMM = 134, + BPC = 135, + PSM = 136, NIM = 137, PSC = 138, + TC = 139, USB = 140, + NSD = 141, + PCTL = 142, BTM = 143, + ETicket = 145, + NGC = 146, ERPT = 147, APM = 148, + ErrorUpload = 151, + Audio = 153, NPNS = 154, + NPNSHTTPSTREAM = 155, ARP = 157, BOOT = 158, - NFC = 161, + NFCMifare = 161, UserlandAssert = 162, + Fatal = 163, + NIMShop = 164, + SPSM = 165, + BGTC = 167, UserlandCrash = 168, - HID = 203, + SREPO = 180, + HID = 202, + LDN = 203, + Irsensor = 205, Capture = 206, - TC = 651, + Manu = 208, + GRC = 212, + Migration = 216, + MigrationLdcServ = 217, GeneralWebApplet = 800, WifiWebAuthApplet = 809, WhitelistedApplet = 810, diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index dca2bfb92..cbc49e55e 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp @@ -35,10 +35,8 @@ public: AudInU::AudInU() : ServiceFramework("audin:u") { static const FunctionInfo functions[] = { - {0, nullptr, "ListAudioIns"}, - {1, nullptr, "OpenAudioIn"}, - {3, nullptr, "OpenAudioInAuto"}, - {4, nullptr, "ListAudioInsAuto"}, + {0, nullptr, "ListAudioIns"}, {1, nullptr, "OpenAudioIn"}, {2, nullptr, "Unknown"}, + {3, nullptr, "OpenAudioInAuto"}, {4, nullptr, "ListAudioInsAuto"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index fa3728672..402eaa306 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -196,10 +196,10 @@ void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) { } AudOutU::AudOutU() : ServiceFramework("audout:u") { - static const FunctionInfo functions[] = {{0x00000000, &AudOutU::ListAudioOuts, "ListAudioOuts"}, - {0x00000001, &AudOutU::OpenAudioOut, "OpenAudioOut"}, - {0x00000002, nullptr, "ListAudioOutsAuto"}, - {0x00000003, nullptr, "OpenAudioOutAuto"}}; + static const FunctionInfo functions[] = {{0, &AudOutU::ListAudioOuts, "ListAudioOuts"}, + {1, &AudOutU::OpenAudioOut, "OpenAudioOut"}, + {2, nullptr, "ListAudioOutsAuto"}, + {3, nullptr, "OpenAudioOutAuto"}}; RegisterHandlers(functions); } diff --git a/src/core/hle/service/audio/audrec_u.cpp b/src/core/hle/service/audio/audrec_u.cpp index b2be10919..74909415c 100644 --- a/src/core/hle/service/audio/audrec_u.cpp +++ b/src/core/hle/service/audio/audrec_u.cpp @@ -20,6 +20,7 @@ public: {4, nullptr, "RegisterBufferEvent"}, {5, nullptr, "GetReleasedFinalOutputRecorderBuffer"}, {6, nullptr, "ContainsFinalOutputRecorderBuffer"}, + {7, nullptr, "Unknown"}, {8, nullptr, "AppendFinalOutputRecorderBufferAuto"}, {9, nullptr, "GetReleasedFinalOutputRecorderBufferAuto"}, }; @@ -30,7 +31,7 @@ public: AudRecU::AudRecU() : ServiceFramework("audrec:u") { static const FunctionInfo functions[] = { - {0x00000000, nullptr, "OpenFinalOutputRecorder"}, + {0, nullptr, "OpenFinalOutputRecorder"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 0d6eb1d51..38bc65d95 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -156,19 +156,20 @@ class IAudioDevice final : public ServiceFramework<IAudioDevice> { public: IAudioDevice() : ServiceFramework("IAudioDevice") { static const FunctionInfo functions[] = { - {0x0, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceName"}, - {0x1, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolume"}, - {0x2, nullptr, "GetAudioDeviceOutputVolume"}, - {0x3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, - {0x4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, - {0x5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, - {0x6, &IAudioDevice::ListAudioDeviceName, + {0, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceName"}, + {1, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolume"}, + {2, nullptr, "GetAudioDeviceOutputVolume"}, + {3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"}, + {4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"}, + {5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"}, + {6, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceNameAuto"}, // TODO(ogniK): Confirm if autos are identical to non auto - {0x7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, - {0x8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, - {0xa, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, - {0xb, nullptr, "QueryAudioDeviceInputEvent"}, - {0xc, nullptr, "QueryAudioDeviceOutputEvent"}}; + {7, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolumeAuto"}, + {8, nullptr, "GetAudioDeviceOutputVolumeAuto"}, + {10, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceNameAuto"}, + {11, nullptr, "QueryAudioDeviceInputEvent"}, + {12, nullptr, "QueryAudioDeviceOutputEvent"}, + }; RegisterHandlers(functions); buffer_event = diff --git a/src/core/hle/service/audio/codecctl.cpp b/src/core/hle/service/audio/codecctl.cpp index ba0f1d228..212c8d448 100644 --- a/src/core/hle/service/audio/codecctl.cpp +++ b/src/core/hle/service/audio/codecctl.cpp @@ -11,19 +11,19 @@ namespace Service::Audio { CodecCtl::CodecCtl() : ServiceFramework("codecctl") { static const FunctionInfo functions[] = { - {0x00000000, nullptr, "InitializeCodecController"}, - {0x00000001, nullptr, "FinalizeCodecController"}, - {0x00000002, nullptr, "SleepCodecController"}, - {0x00000003, nullptr, "WakeCodecController"}, - {0x00000004, nullptr, "SetCodecVolume"}, - {0x00000005, nullptr, "GetCodecVolumeMax"}, - {0x00000006, nullptr, "GetCodecVolumeMin"}, - {0x00000007, nullptr, "SetCodecActiveTarget"}, - {0x00000008, nullptr, "Unknown"}, - {0x00000009, nullptr, "BindCodecHeadphoneMicJackInterrupt"}, - {0x00000010, nullptr, "IsCodecHeadphoneMicJackInserted"}, - {0x00000011, nullptr, "ClearCodecHeadphoneMicJackInterrupt"}, - {0x00000012, nullptr, "IsCodecDeviceRequested"}, + {0, nullptr, "InitializeCodecController"}, + {1, nullptr, "FinalizeCodecController"}, + {2, nullptr, "SleepCodecController"}, + {3, nullptr, "WakeCodecController"}, + {4, nullptr, "SetCodecVolume"}, + {5, nullptr, "GetCodecVolumeMax"}, + {6, nullptr, "GetCodecVolumeMin"}, + {7, nullptr, "SetCodecActiveTarget"}, + {8, nullptr, "GetCodecActiveTarget"}, + {9, nullptr, "BindCodecHeadphoneMicJackInterrupt"}, + {10, nullptr, "IsCodecHeadphoneMicJackInserted"}, + {11, nullptr, "ClearCodecHeadphoneMicJackInterrupt"}, + {12, nullptr, "IsCodecDeviceRequested"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp index bb75e7314..2d4282209 100644 --- a/src/core/hle/service/fatal/fatal.cpp +++ b/src/core/hle/service/fatal/fatal.cpp @@ -13,7 +13,7 @@ namespace Service::Fatal { Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) : ServiceFramework(name), module(std::move(module)) {} -void Module::Interface::FatalSimple(Kernel::HLERequestContext& ctx) { +void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx); u32 error_code = rp.Pop<u32>(); NGLOG_WARNING(Service_Fatal, "(STUBBED) called, error_code=0x{:X}", error_code); @@ -21,7 +21,7 @@ void Module::Interface::FatalSimple(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); } -void Module::Interface::TransitionToFatalError(Kernel::HLERequestContext& ctx) { +void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) { NGLOG_WARNING(Service_Fatal, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); diff --git a/src/core/hle/service/fatal/fatal.h b/src/core/hle/service/fatal/fatal.h index 2d8d08320..5bd111a14 100644 --- a/src/core/hle/service/fatal/fatal.h +++ b/src/core/hle/service/fatal/fatal.h @@ -14,8 +14,8 @@ public: public: Interface(std::shared_ptr<Module> module, const char* name); - void FatalSimple(Kernel::HLERequestContext& ctx); - void TransitionToFatalError(Kernel::HLERequestContext& ctx); + void ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx); + void ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx); protected: std::shared_ptr<Module> module; diff --git a/src/core/hle/service/fatal/fatal_u.cpp b/src/core/hle/service/fatal/fatal_u.cpp index 26aa9f3b7..f0631329e 100644 --- a/src/core/hle/service/fatal/fatal_u.cpp +++ b/src/core/hle/service/fatal/fatal_u.cpp @@ -8,8 +8,9 @@ namespace Service::Fatal { Fatal_U::Fatal_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "fatal:u") { static const FunctionInfo functions[] = { - {1, &Fatal_U::FatalSimple, "FatalSimple"}, - {2, &Fatal_U::TransitionToFatalError, "TransitionToFatalError"}, + {0, nullptr, "ThrowFatal"}, + {1, &Fatal_U::ThrowFatalWithPolicy, "ThrowFatalWithPolicy"}, + {2, &Fatal_U::ThrowFatalWithCpuContext, "ThrowFatalWithCpuContext"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index cc0247881..2af4465de 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -17,30 +17,30 @@ public: IUser() : ServiceFramework("IUser") { static const FunctionInfo functions[] = { {0, &IUser::Initialize, "Initialize"}, - {1, nullptr, "Unknown1"}, - {2, nullptr, "Unknown2"}, - {3, nullptr, "Unknown3"}, - {4, nullptr, "Unknown4"}, - {5, nullptr, "Unknown5"}, - {6, nullptr, "Unknown6"}, - {7, nullptr, "Unknown7"}, - {8, nullptr, "Unknown8"}, - {9, nullptr, "Unknown9"}, - {10, nullptr, "Unknown10"}, - {11, nullptr, "Unknown11"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, - {14, nullptr, "Unknown14"}, - {15, nullptr, "Unknown15"}, - {16, nullptr, "Unknown16"}, - {17, nullptr, "Unknown17"}, - {18, nullptr, "Unknown18"}, - {19, nullptr, "Unknown19"}, - {20, nullptr, "Unknown20"}, - {21, nullptr, "Unknown21"}, - {22, nullptr, "Unknown22"}, - {23, nullptr, "Unknown23"}, - {24, nullptr, "Unknown24"}, + {1, nullptr, "Finalize"}, + {2, nullptr, "ListDevices"}, + {3, nullptr, "StartDetection"}, + {4, nullptr, "StopDetection"}, + {5, nullptr, "Mount"}, + {6, nullptr, "Unmount"}, + {7, nullptr, "OpenApplicationArea"}, + {8, nullptr, "GetApplicationArea"}, + {9, nullptr, "SetApplicationArea"}, + {10, nullptr, "Flush"}, + {11, nullptr, "Restore"}, + {12, nullptr, "CreateApplicationArea"}, + {13, nullptr, "GetTagInfo"}, + {14, nullptr, "GetRegisterInfo"}, + {15, nullptr, "GetCommonInfo"}, + {16, nullptr, "GetModelInfo"}, + {17, nullptr, "AttachActivateEvent"}, + {18, nullptr, "AttachDeactivateEvent"}, + {19, nullptr, "GetState"}, + {20, nullptr, "GetDeviceState"}, + {21, nullptr, "GetNpadId"}, + {22, nullptr, "GetApplicationArea2"}, + {23, nullptr, "AttachAvailabilityChangeEvent"}, + {24, nullptr, "RecreateApplicationArea"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index dc30702c6..5b91089cf 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -144,10 +144,12 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& co rb.Push(RESULT_SUCCESS); return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead); } + case IPC::CommandType::ControlWithContext: case IPC::CommandType::Control: { Core::System::GetInstance().ServiceManager().InvokeControlRequest(context); break; } + case IPC::CommandType::RequestWithContext: case IPC::CommandType::Request: { InvokeRequest(context); break; |