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

@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
_bypassUninitializedClock = bypassUninitializedClock;
}
[Command(0)]
[CommandHipc(0)]
// GetCurrentTimePoint() -> nn::time::SteadyClockTimePoint
public ResultCode GetCurrentTimePoint(ServiceCtx context)
{
@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(2)]
[CommandHipc(2)]
// GetTestOffset() -> nn::TimeSpanType
public ResultCode GetTestOffset(ServiceCtx context)
{
@ -46,7 +46,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(3)]
[CommandHipc(3)]
// SetTestOffset(nn::TimeSpanType)
public ResultCode SetTestOffset(ServiceCtx context)
{
@ -67,7 +67,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(100)] // 2.0.0+
[CommandHipc(100)] // 2.0.0+
// GetRtcValue() -> u64
public ResultCode GetRtcValue(ServiceCtx context)
{
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(101)] // 2.0.0+
[CommandHipc(101)] // 2.0.0+
// IsRtcResetDetected() -> bool
public ResultCode IsRtcResetDetected(ServiceCtx context)
{
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(102)] // 2.0.0+
[CommandHipc(102)] // 2.0.0+
// GetSetupResultValue() -> u32
public ResultCode GetSetupResultValue(ServiceCtx context)
{
@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(200)] // 3.0.0+
[CommandHipc(200)] // 3.0.0+
// GetInternalOffset() -> nn::TimeSpanType
public ResultCode GetInternalOffset(ServiceCtx context)
{
@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(201)] // 3.0.0-3.0.2
[CommandHipc(201)] // 3.0.0-3.0.2
// SetInternalOffset(nn::TimeSpanType)
public ResultCode SetInternalOffset(ServiceCtx context)
{

View file

@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
_operationEventReadableHandle = 0;
}
[Command(0)]
[CommandHipc(0)]
// GetCurrentTime() -> nn::time::PosixTime
public ResultCode GetCurrentTime(ServiceCtx context)
{
@ -41,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(1)]
[CommandHipc(1)]
// SetCurrentTime(nn::time::PosixTime)
public ResultCode SetCurrentTime(ServiceCtx context)
{
@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return _clockCore.SetCurrentTime(context.Thread, posixTime);
}
[Command(2)]
[CommandHipc(2)]
// GetClockContext() -> nn::time::SystemClockContext
public ResultCode GetSystemClockContext(ServiceCtx context)
{
@ -79,7 +79,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(3)]
[CommandHipc(3)]
// SetClockContext(nn::time::SystemClockContext)
public ResultCode SetSystemClockContext(ServiceCtx context)
{
@ -100,7 +100,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(4)] // 9.0.0+
[CommandHipc(4)] // 9.0.0+
// GetOperationEventReadableHandle() -> handle<copy>
public ResultCode GetOperationEventReadableHandle(ServiceCtx context)
{

View file

@ -19,14 +19,14 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
_inner = new ITimeZoneServiceForPsc(timeZoneContentManager.Manager, writePermission);
}
[Command(0)]
[CommandHipc(0)]
// GetDeviceLocationName() -> nn::time::LocationName
public ResultCode GetDeviceLocationName(ServiceCtx context)
{
return _inner.GetDeviceLocationName(context);
}
[Command(1)]
[CommandHipc(1)]
// SetDeviceLocationName(nn::time::LocationName)
public ResultCode SetDeviceLocationName(ServiceCtx context)
{
@ -40,14 +40,14 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return _timeZoneContentManager.SetDeviceLocationName(locationName);
}
[Command(2)]
[CommandHipc(2)]
// GetTotalLocationNameCount() -> u32
public ResultCode GetTotalLocationNameCount(ServiceCtx context)
{
return _inner.GetTotalLocationNameCount(context);
}
[Command(3)]
[CommandHipc(3)]
// LoadLocationNameList(u32 index) -> (u32 outCount, buffer<nn::time::LocationName, 6>)
public ResultCode LoadLocationNameList(ServiceCtx context)
{
@ -82,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return errorCode;
}
[Command(4)]
[CommandHipc(4)]
// LoadTimeZoneRule(nn::time::LocationName locationName) -> buffer<nn::time::TimeZoneRule, 0x16>
public ResultCode LoadTimeZoneRule(ServiceCtx context)
{
@ -110,28 +110,28 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return resultCode;
}
[Command(100)]
[CommandHipc(100)]
// ToCalendarTime(nn::time::PosixTime time, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (nn::time::CalendarTime, nn::time::sf::CalendarAdditionalInfo)
public ResultCode ToCalendarTime(ServiceCtx context)
{
return _inner.ToCalendarTime(context);
}
[Command(101)]
[CommandHipc(101)]
// ToCalendarTimeWithMyRule(nn::time::PosixTime) -> (nn::time::CalendarTime, nn::time::sf::CalendarAdditionalInfo)
public ResultCode ToCalendarTimeWithMyRule(ServiceCtx context)
{
return _inner.ToCalendarTimeWithMyRule(context);
}
[Command(201)]
[CommandHipc(201)]
// ToPosixTime(nn::time::CalendarTime calendarTime, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (u32 outCount, buffer<nn::time::PosixTime, 0xa>)
public ResultCode ToPosixTime(ServiceCtx context)
{
return _inner.ToPosixTime(context);
}
[Command(202)]
[CommandHipc(202)]
// ToPosixTimeWithMyRule(nn::time::CalendarTime calendarTime) -> (u32 outCount, buffer<nn::time::PosixTime, 0xa>)
public ResultCode ToPosixTimeWithMyRule(ServiceCtx context)
{

View file

@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
_writePermission = writePermission;
}
[Command(0)]
[CommandHipc(0)]
// GetDeviceLocationName() -> nn::time::LocationName
public ResultCode GetDeviceLocationName(ServiceCtx context)
{
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(1)]
[CommandHipc(1)]
// SetDeviceLocationName(nn::time::LocationName)
public ResultCode SetDeviceLocationName(ServiceCtx context)
{
@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.NotImplemented;
}
[Command(2)]
[CommandHipc(2)]
// GetTotalLocationNameCount() -> u32
public ResultCode GetTotalLocationNameCount(ServiceCtx context)
{
@ -62,21 +62,21 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.Success;
}
[Command(3)]
[CommandHipc(3)]
// LoadLocationNameList(u32 index) -> (u32 outCount, buffer<nn::time::LocationName, 6>)
public ResultCode LoadLocationNameList(ServiceCtx context)
{
return ResultCode.NotImplemented;
}
[Command(4)]
[CommandHipc(4)]
// LoadTimeZoneRule(nn::time::LocationName locationName) -> buffer<nn::time::TimeZoneRule, 0x16>
public ResultCode LoadTimeZoneRule(ServiceCtx context)
{
return ResultCode.NotImplemented;
}
[Command(5)] // 2.0.0+
[CommandHipc(5)] // 2.0.0+
// GetTimeZoneRuleVersion() -> nn::time::TimeZoneRuleVersion
public ResultCode GetTimeZoneRuleVersion(ServiceCtx context)
{
@ -90,7 +90,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(6)] // 5.0.0+
[CommandHipc(6)] // 5.0.0+
// GetDeviceLocationNameAndUpdatedTime() -> (nn::time::LocationName, nn::time::SteadyClockTimePoint)
public ResultCode GetDeviceLocationNameAndUpdatedTime(ServiceCtx context)
{
@ -114,7 +114,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(7)] // 9.0.0+
[CommandHipc(7)] // 9.0.0+
// SetDeviceLocationNameWithTimeZoneRule(nn::time::LocationName locationName, buffer<nn::time::TimeZoneBinary, 0x21> timeZoneBinary)
public ResultCode SetDeviceLocationNameWithTimeZoneRule(ServiceCtx context)
{
@ -141,7 +141,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(8)] // 9.0.0+
[CommandHipc(8)] // 9.0.0+
// ParseTimeZoneBinary(buffer<nn::time::TimeZoneBinary, 0x21> timeZoneBinary) -> buffer<nn::time::TimeZoneRule, 0x16>
public ResultCode ParseTimeZoneBinary(ServiceCtx context)
{
@ -177,14 +177,14 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return result;
}
[Command(20)] // 9.0.0+
[CommandHipc(20)] // 9.0.0+
// GetDeviceLocationNameOperationEventReadableHandle() -> handle<copy>
public ResultCode GetDeviceLocationNameOperationEventReadableHandle(ServiceCtx context)
{
return ResultCode.NotImplemented;
}
[Command(100)]
[CommandHipc(100)]
// ToCalendarTime(nn::time::PosixTime time, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (nn::time::CalendarTime, nn::time::sf::CalendarAdditionalInfo)
public ResultCode ToCalendarTime(ServiceCtx context)
{
@ -212,7 +212,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return resultCode;
}
[Command(101)]
[CommandHipc(101)]
// ToCalendarTimeWithMyRule(nn::time::PosixTime) -> (nn::time::CalendarTime, nn::time::sf::CalendarAdditionalInfo)
public ResultCode ToCalendarTimeWithMyRule(ServiceCtx context)
{
@ -228,7 +228,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return resultCode;
}
[Command(201)]
[CommandHipc(201)]
// ToPosixTime(nn::time::CalendarTime calendarTime, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (u32 outCount, buffer<nn::time::PosixTime, 0xa>)
public ResultCode ToPosixTime(ServiceCtx context)
{
@ -261,7 +261,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return resultCode;
}
[Command(202)]
[CommandHipc(202)]
// ToPosixTimeWithMyRule(nn::time::CalendarTime calendarTime) -> (u32 outCount, buffer<nn::time::PosixTime, 0xa>)
public ResultCode ToPosixTimeWithMyRule(ServiceCtx context)
{