Address comments
This commit is contained in:
parent
69dbde450c
commit
d17389d83d
6 changed files with 23 additions and 25 deletions
|
@ -23,14 +23,13 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|||
{
|
||||
return new TimeSpanType(ticks * 1000000000 / frequency);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SteadyClockTimePoint
|
||||
{
|
||||
public ulong TimePoint;
|
||||
public UInt128 ClockSourceId;
|
||||
public ulong TimePoint;
|
||||
public UInt128 ClockSourceId;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
@ -39,6 +38,4 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|||
public ulong Offset;
|
||||
public SteadyClockTimePoint SteadyTimePoint;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|||
TimeSpanType ticksTimeSpan = TimeSpanType.FromTicks(thread.Context.ThreadState.CntpctEl0, thread.Context.ThreadState.CntfrqEl0);
|
||||
|
||||
result.TimePoint = _internalOffset.ToSeconds() + ticksTimeSpan.ToSeconds();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,19 +5,6 @@ using System;
|
|||
|
||||
namespace Ryujinx.HLE.HOS.Services.Time
|
||||
{
|
||||
[Flags]
|
||||
enum TimePermissions
|
||||
{
|
||||
LocalSystemClockWritableMask = 0x1,
|
||||
UserSystemClockWritableMask = 0x2,
|
||||
NetworkSystemClockWritableMask = 0x4,
|
||||
UnknwonPermissionMask = 0x8,
|
||||
|
||||
User = 0,
|
||||
Applet = LocalSystemClockWritableMask | UserSystemClockWritableMask | UnknwonPermissionMask,
|
||||
System = NetworkSystemClockWritableMask
|
||||
}
|
||||
|
||||
[Service("time:a", TimePermissions.Applet)]
|
||||
[Service("time:s", TimePermissions.System)]
|
||||
[Service("time:u", TimePermissions.User)]
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Ryujinx.HLE.HOS.Services.Time
|
|||
{
|
||||
class ISteadyClock : IpcService
|
||||
{
|
||||
|
||||
[Command(0)]
|
||||
// GetCurrentTimePoint() -> nn::time::SteadyClockTimePoint
|
||||
public ResultCode GetCurrentTimePoint(ServiceCtx context)
|
||||
|
|
|
@ -18,8 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
|
|||
// GetCurrentTime() -> nn::time::PosixTime
|
||||
public ResultCode GetCurrentTime(ServiceCtx context)
|
||||
{
|
||||
SteadyClockCore steadyClockCore = _clockCore.GetSteadyClockCore();
|
||||
|
||||
SteadyClockCore steadyClockCore = _clockCore.GetSteadyClockCore();
|
||||
SteadyClockTimePoint currentTimePoint = steadyClockCore.GetCurrentTimePoint(context.Thread);
|
||||
|
||||
ResultCode result = _clockCore.GetSystemClockContext(context.Thread, out SystemClockContext clockContext);
|
||||
|
@ -50,10 +49,8 @@ namespace Ryujinx.HLE.HOS.Services.Time
|
|||
return ResultCode.PermissionDenied;
|
||||
}
|
||||
|
||||
ulong posixTime = context.RequestData.ReadUInt64();
|
||||
|
||||
SteadyClockCore steadyClockCore = _clockCore.GetSteadyClockCore();
|
||||
|
||||
ulong posixTime = context.RequestData.ReadUInt64();
|
||||
SteadyClockCore steadyClockCore = _clockCore.GetSteadyClockCore();
|
||||
SteadyClockTimePoint currentTimePoint = steadyClockCore.GetCurrentTimePoint(context.Thread);
|
||||
|
||||
SystemClockContext clockContext = new SystemClockContext()
|
||||
|
|
17
Ryujinx.HLE/HOS/Services/Time/TimePermissions.cs
Normal file
17
Ryujinx.HLE/HOS/Services/Time/TimePermissions.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Time
|
||||
{
|
||||
[Flags]
|
||||
enum TimePermissions
|
||||
{
|
||||
LocalSystemClockWritableMask = 0x1,
|
||||
UserSystemClockWritableMask = 0x2,
|
||||
NetworkSystemClockWritableMask = 0x4,
|
||||
UnknownPermissionMask = 0x8,
|
||||
|
||||
User = 0,
|
||||
Applet = LocalSystemClockWritableMask | UserSystemClockWritableMask | UnknownPermissionMask,
|
||||
System = NetworkSystemClockWritableMask
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue