Initial support for the new 12.x IPC system (#2182)

* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC
This commit is contained in:
Mary 2021-04-14 00:01:24 +02:00 committed by GitHub
parent faa654dbaf
commit 0746b83edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 1077 additions and 951 deletions

View file

@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
_timeManager = manager;
}
[Command(0)]
[CommandHipc(0)]
// GetStandardUserSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public ResultCode GetStandardUserSystemClock(ServiceCtx context)
{
@ -41,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(1)]
[CommandHipc(1)]
// GetStandardNetworkSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public ResultCode GetStandardNetworkSystemClock(ServiceCtx context)
{
@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(2)]
[CommandHipc(2)]
// GetStandardSteadyClock() -> object<nn::timesrv::detail::service::ISteadyClock>
public ResultCode GetStandardSteadyClock(ServiceCtx context)
{
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(3)]
[CommandHipc(3)]
// GetTimeZoneService() -> object<nn::timesrv::detail::service::ITimeZoneService>
public ResultCode GetTimeZoneService(ServiceCtx context)
{
@ -73,7 +73,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(4)]
[CommandHipc(4)]
// GetStandardLocalSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public ResultCode GetStandardLocalSystemClock(ServiceCtx context)
{
@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(5)] // 4.0.0+
[CommandHipc(5)] // 4.0.0+
// GetEphemeralNetworkSystemClock() -> object<nn::timesrv::detail::service::ISystemClock>
public ResultCode GetEphemeralNetworkSystemClock(ServiceCtx context)
{
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(20)] // 6.0.0+
[CommandHipc(20)] // 6.0.0+
// GetSharedMemoryNativeHandle() -> handle<copy>
public ResultCode GetSharedMemoryNativeHandle(ServiceCtx context)
{
@ -112,7 +112,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(50)] // 4.0.0+
[CommandHipc(50)] // 4.0.0+
// SetStandardSteadyClockInternalOffset(nn::TimeSpanType internal_offset)
public ResultCode SetStandardSteadyClockInternalOffset(ServiceCtx context)
{
@ -120,7 +120,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.NotImplemented;
}
[Command(51)] // 9.0.0+
[CommandHipc(51)] // 9.0.0+
// GetStandardSteadyClockRtcValue() -> u64
public ResultCode GetStandardSteadyClockRtcValue(ServiceCtx context)
{
@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.NotImplemented;
}
[Command(100)]
[CommandHipc(100)]
// IsStandardUserSystemClockAutomaticCorrectionEnabled() -> bool
public ResultCode IsStandardUserSystemClockAutomaticCorrectionEnabled(ServiceCtx context)
{
@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(101)]
[CommandHipc(101)]
// SetStandardUserSystemClockAutomaticCorrectionEnabled(b8)
public ResultCode SetStandardUserSystemClockAutomaticCorrectionEnabled(ServiceCtx context)
{
@ -178,7 +178,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return result;
}
[Command(102)] // 5.0.0+
[CommandHipc(102)] // 5.0.0+
// GetStandardUserSystemClockInitialYear() -> u32
public ResultCode GetStandardUserSystemClockInitialYear(ServiceCtx context)
{
@ -186,7 +186,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.NotImplemented;
}
[Command(200)] // 3.0.0+
[CommandHipc(200)] // 3.0.0+
// IsStandardNetworkSystemClockAccuracySufficient() -> bool
public ResultCode IsStandardNetworkSystemClockAccuracySufficient(ServiceCtx context)
{
@ -195,7 +195,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(201)] // 6.0.0+
[CommandHipc(201)] // 6.0.0+
// GetStandardUserSystemClockAutomaticCorrectionUpdatedTime() -> nn::time::SteadyClockTimePoint
public ResultCode GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(ServiceCtx context)
{
@ -211,7 +211,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(300)] // 4.0.0+
[CommandHipc(300)] // 4.0.0+
// CalculateMonotonicSystemClockBaseTimePoint(nn::time::SystemClockContext) -> s64
public ResultCode CalculateMonotonicSystemClockBaseTimePoint(ServiceCtx context)
{
@ -240,7 +240,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return result;
}
[Command(400)] // 4.0.0+
[CommandHipc(400)] // 4.0.0+
// GetClockSnapshot(u8) -> buffer<nn::time::sf::ClockSnapshot, 0x1a>
public ResultCode GetClockSnapshot(ServiceCtx context)
{
@ -268,7 +268,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return result;
}
[Command(401)] // 4.0.0+
[CommandHipc(401)] // 4.0.0+
// GetClockSnapshotFromSystemClockContext(u8, nn::time::SystemClockContext, nn::time::SystemClockContext) -> buffer<nn::time::sf::ClockSnapshot, 0x1a>
public ResultCode GetClockSnapshotFromSystemClockContext(ServiceCtx context)
{
@ -291,7 +291,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return result;
}
[Command(500)] // 4.0.0+
[CommandHipc(500)] // 4.0.0+
// CalculateStandardUserSystemClockDifferenceByUser(buffer<nn::time::sf::ClockSnapshot, 0x19>, buffer<nn::time::sf::ClockSnapshot, 0x19>) -> nn::TimeSpanType
public ResultCode CalculateStandardUserSystemClockDifferenceByUser(ServiceCtx context)
{
@ -309,7 +309,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(501)] // 4.0.0+
[CommandHipc(501)] // 4.0.0+
// CalculateSpanBetween(buffer<nn::time::sf::ClockSnapshot, 0x19>, buffer<nn::time::sf::ClockSnapshot, 0x19>) -> nn::TimeSpanType
public ResultCode CalculateSpanBetween(ServiceCtx context)
{