Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
df70442c46 | |||
e2ffa5a125 |
@ -130,11 +130,6 @@ namespace ARMeilleure.Instructions
|
|||||||
bool ordered = (accType & AccessType.Ordered) != 0;
|
bool ordered = (accType & AccessType.Ordered) != 0;
|
||||||
bool exclusive = (accType & AccessType.Exclusive) != 0;
|
bool exclusive = (accType & AccessType.Exclusive) != 0;
|
||||||
|
|
||||||
if (ordered)
|
|
||||||
{
|
|
||||||
EmitBarrier(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
Operand address = context.Copy(GetIntOrSP(context, op.Rn));
|
Operand address = context.Copy(GetIntOrSP(context, op.Rn));
|
||||||
|
|
||||||
Operand t = GetIntOrZR(context, op.Rt);
|
Operand t = GetIntOrZR(context, op.Rt);
|
||||||
@ -163,6 +158,11 @@ namespace ARMeilleure.Instructions
|
|||||||
{
|
{
|
||||||
EmitStoreExclusive(context, address, t, exclusive, op.Size, op.Rs, a32: false);
|
EmitStoreExclusive(context, address, t, exclusive, op.Size, op.Rs, a32: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ordered)
|
||||||
|
{
|
||||||
|
EmitBarrier(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void EmitBarrier(ArmEmitterContext context)
|
private static void EmitBarrier(ArmEmitterContext context)
|
||||||
|
@ -146,13 +146,13 @@ namespace ARMeilleure.Instructions
|
|||||||
var exclusive = (accType & AccessType.Exclusive) != 0;
|
var exclusive = (accType & AccessType.Exclusive) != 0;
|
||||||
var ordered = (accType & AccessType.Ordered) != 0;
|
var ordered = (accType & AccessType.Ordered) != 0;
|
||||||
|
|
||||||
|
if ((accType & AccessType.Load) != 0)
|
||||||
|
{
|
||||||
if (ordered)
|
if (ordered)
|
||||||
{
|
{
|
||||||
EmitBarrier(context);
|
EmitBarrier(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((accType & AccessType.Load) != 0)
|
|
||||||
{
|
|
||||||
if (size == DWordSizeLog2)
|
if (size == DWordSizeLog2)
|
||||||
{
|
{
|
||||||
// Keep loads atomic - make the call to get the whole region and then decompose it into parts
|
// Keep loads atomic - make the call to get the whole region and then decompose it into parts
|
||||||
@ -219,6 +219,11 @@ namespace ARMeilleure.Instructions
|
|||||||
Operand value = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt));
|
Operand value = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt));
|
||||||
EmitStoreExclusive(context, address, value, exclusive, size, op.Rd, a32: true);
|
EmitStoreExclusive(context, address, value, exclusive, size, op.Rd, a32: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ordered)
|
||||||
|
{
|
||||||
|
EmitBarrier(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
private const string OuterHeaderMagicString = "PTCohd\0\0";
|
||||||
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
private const string InnerHeaderMagicString = "PTCihd\0\0";
|
||||||
|
|
||||||
private const uint InternalVersion = 3179; //! To be incremented manually for each change to the ARMeilleure project.
|
private const uint InternalVersion = 3193; //! To be incremented manually for each change to the ARMeilleure project.
|
||||||
|
|
||||||
private const string ActualDir = "0";
|
private const string ActualDir = "0";
|
||||||
private const string BackupDir = "1";
|
private const string BackupDir = "1";
|
||||||
|
@ -47,6 +47,7 @@ namespace Ryujinx.Common.Logging
|
|||||||
ServiceNim,
|
ServiceNim,
|
||||||
ServiceNs,
|
ServiceNs,
|
||||||
ServiceNsd,
|
ServiceNsd,
|
||||||
|
ServiceNtc,
|
||||||
ServiceNv,
|
ServiceNv,
|
||||||
ServiceOlsc,
|
ServiceOlsc,
|
||||||
ServicePctl,
|
ServicePctl,
|
||||||
|
@ -1,8 +1,24 @@
|
|||||||
namespace Ryujinx.HLE.HOS.Services.Nim.Ntc
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Services.Nim.Ntc.StaticService;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Nim.Ntc
|
||||||
{
|
{
|
||||||
[Service("ntc")]
|
[Service("ntc")]
|
||||||
class IStaticService : IpcService
|
class IStaticService : IpcService
|
||||||
{
|
{
|
||||||
public IStaticService(ServiceCtx context) { }
|
public IStaticService(ServiceCtx context) { }
|
||||||
|
|
||||||
|
[CommandHipc(0)]
|
||||||
|
// OpenEnsureNetworkClockAvailabilityService(u64) -> object<nn::ntc::detail::service::IEnsureNetworkClockAvailabilityService>
|
||||||
|
public ResultCode CreateAsyncInterface(ServiceCtx context)
|
||||||
|
{
|
||||||
|
ulong unknown = context.RequestData.ReadUInt64();
|
||||||
|
|
||||||
|
MakeObject(context, new IEnsureNetworkClockAvailabilityService(context));
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceNtc, new { unknown });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.Ipc;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
||||||
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Nim.Ntc.StaticService
|
||||||
|
{
|
||||||
|
class IEnsureNetworkClockAvailabilityService : IpcService
|
||||||
|
{
|
||||||
|
private KEvent _finishNotificationEvent;
|
||||||
|
private ResultCode _taskResultCode;
|
||||||
|
|
||||||
|
public IEnsureNetworkClockAvailabilityService(ServiceCtx context)
|
||||||
|
{
|
||||||
|
_finishNotificationEvent = new KEvent(context.Device.System.KernelContext);
|
||||||
|
_taskResultCode = ResultCode.Success;
|
||||||
|
|
||||||
|
// NOTE: The service starts a thread that polls Nintendo NTP server and syncs the time with it.
|
||||||
|
// Additionnally it gets and uses some settings too:
|
||||||
|
// autonomic_correction_interval_seconds, autonomic_correction_failed_retry_interval_seconds,
|
||||||
|
// autonomic_correction_immediate_try_count_max, autonomic_correction_immediate_try_interval_milliseconds
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(0)]
|
||||||
|
// StartTask()
|
||||||
|
public ResultCode StartTask(ServiceCtx context)
|
||||||
|
{
|
||||||
|
if (!context.Device.Configuration.EnableInternetAccess)
|
||||||
|
{
|
||||||
|
return (ResultCode)Time.ResultCode.NetworkTimeNotAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE: Since we don't support the Nintendo NTP server, we can signal the event now to confirm the update task is done.
|
||||||
|
_finishNotificationEvent.ReadableEvent.Signal();
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceNtc);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(1)]
|
||||||
|
// GetFinishNotificationEvent() -> handle<copy>
|
||||||
|
public ResultCode GetFinishNotificationEvent(ServiceCtx context)
|
||||||
|
{
|
||||||
|
if (context.Process.HandleTable.GenerateHandle(_finishNotificationEvent.ReadableEvent, out int finishNotificationEventHandle) != KernelResult.Success)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Out of handles!");
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(finishNotificationEventHandle);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(2)]
|
||||||
|
// GetResult()
|
||||||
|
public ResultCode GetResult(ServiceCtx context)
|
||||||
|
{
|
||||||
|
return _taskResultCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(3)]
|
||||||
|
// Cancel()
|
||||||
|
public ResultCode Cancel(ServiceCtx context)
|
||||||
|
{
|
||||||
|
// NOTE: The update task should be canceled here.
|
||||||
|
_finishNotificationEvent.ReadableEvent.Signal();
|
||||||
|
|
||||||
|
_taskResultCode = (ResultCode)Time.ResultCode.NetworkTimeTaskCanceled;
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceNtc);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -18,5 +18,7 @@
|
|||||||
TimeZoneConversionFailed = (903 << ErrorCodeShift) | ModuleId,
|
TimeZoneConversionFailed = (903 << ErrorCodeShift) | ModuleId,
|
||||||
TimeZoneNotFound = (989 << ErrorCodeShift) | ModuleId,
|
TimeZoneNotFound = (989 << ErrorCodeShift) | ModuleId,
|
||||||
NotImplemented = (990 << ErrorCodeShift) | ModuleId,
|
NotImplemented = (990 << ErrorCodeShift) | ModuleId,
|
||||||
|
NetworkTimeNotAvailable = (1000 << ErrorCodeShift) | ModuleId,
|
||||||
|
NetworkTimeTaskCanceled = (1003 << ErrorCodeShift) | ModuleId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user