am: IApplicationFunctions GetGpuErrorDetectedSystemEvent implementation (#775)
This commit is contained in:
parent
f48df486e2
commit
92e5e3c505
3 changed files with 29 additions and 3 deletions
|
@ -1,12 +1,21 @@
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage;
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy
|
namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy
|
||||||
{
|
{
|
||||||
class IApplicationFunctions : IpcService
|
class IApplicationFunctions : IpcService
|
||||||
{
|
{
|
||||||
public IApplicationFunctions() { }
|
private KEvent _gpuErrorDetectedSystemEvent;
|
||||||
|
|
||||||
|
public IApplicationFunctions(Horizon system)
|
||||||
|
{
|
||||||
|
_gpuErrorDetectedSystemEvent = new KEvent(system);
|
||||||
|
}
|
||||||
|
|
||||||
[Command(1)]
|
[Command(1)]
|
||||||
// PopLaunchParameter(u32) -> object<nn::am::service::IStorage>
|
// PopLaunchParameter(u32) -> object<nn::am::service::IStorage>
|
||||||
|
@ -113,5 +122,23 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command(130)] // 8.0.0+
|
||||||
|
// GetGpuErrorDetectedSystemEvent() -> handle<copy>
|
||||||
|
public ResultCode GetGpuErrorDetectedSystemEvent(ServiceCtx context)
|
||||||
|
{
|
||||||
|
if (context.Process.HandleTable.GenerateHandle(_gpuErrorDetectedSystemEvent.ReadableEvent, out int gpuErrorDetectedSystemEventHandle) != KernelResult.Success)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Out of handles!");
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(gpuErrorDetectedSystemEventHandle);
|
||||||
|
|
||||||
|
// NOTE: This is used by "sdk" NSO during applet-application initialization.
|
||||||
|
// A seperate thread is setup where event-waiting is handled.
|
||||||
|
// When the Event is signaled, official sw will assert.
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -65,7 +65,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
|
||||||
// GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions>
|
// GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions>
|
||||||
public ResultCode GetApplicationFunctions(ServiceCtx context)
|
public ResultCode GetApplicationFunctions(ServiceCtx context)
|
||||||
{
|
{
|
||||||
MakeObject(context, new IApplicationFunctions());
|
MakeObject(context, new IApplicationFunctions(context.Device.System));
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
|
||||||
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService;
|
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Am
|
namespace Ryujinx.HLE.HOS.Services.Am
|
||||||
|
|
Reference in a new issue