Storage Types

This commit is contained in:
Isaac Marovitz 2024-02-15 12:36:57 -05:00
parent fe6dc1717c
commit ed5c8301ab
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
6 changed files with 109 additions and 7 deletions

View file

@ -0,0 +1,37 @@
using Ryujinx.Common.Logging;
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Am.Storage;
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Am.Ipc.Storage
{
partial class Storage : IStorage
{
[CmifCommand(0)]
public Result Open(out IStorageAccessor storageAccessor)
{
storageAccessor = new StorageAccessor();
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
[CmifCommand(1)]
public Result OpenTransferStorage(out ITransferStorageAccessor transferStorageAccessor)
{
transferStorageAccessor = new TransferStorageAccessor();
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
// TODO: Get CMD No.
public Result GetAndInvalidate(out IStorage storage)
{
storage = new Storage();
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
}
}

View file

@ -0,0 +1,36 @@
using Ryujinx.Common.Logging;
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Am.Storage;
using Ryujinx.Horizon.Sdk.Sf;
using System;
namespace Ryujinx.Horizon.Am.Ipc.Storage
{
partial class StorageAccessor : IStorageAccessor
{
[CmifCommand(0)]
public Result GetSize(out long size)
{
size = 0;
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
[CmifCommand(10)]
public Result Write(long arg0, ReadOnlySpan<byte> span)
{
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
[CmifCommand(11)]
public Result Read(long arg0, ReadOnlySpan<byte> span)
{
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
}
}

View file

@ -0,0 +1,29 @@
using Ryujinx.Common.Logging;
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Am.Storage;
using Ryujinx.Horizon.Sdk.Sf;
namespace Ryujinx.Horizon.Am.Ipc.Storage
{
partial class TransferStorageAccessor : ITransferStorageAccessor
{
[CmifCommand(0)]
public Result GetSize(out long size)
{
size = 0;
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
[CmifCommand(1)]
public Result GetHandle(out int arg0, out ulong arg1)
{
arg0 = 0;
arg1 = 0;
Logger.Stub?.PrintStub(LogClass.ServiceAm);
return Result.Success;
}
}
}

View file

@ -5,8 +5,8 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
{
interface IStorage : IServiceObject
{
Result Open(out IStorageAccessor arg0);
Result OpenTransferStorage(out ITransferStorageAccessor arg0);
Result GetAndInvalidate(out IStorage arg0);
Result Open(out IStorageAccessor storageAccessor);
Result OpenTransferStorage(out ITransferStorageAccessor transferStorageAccessor);
Result GetAndInvalidate(out IStorage storage);
}
}

View file

@ -6,8 +6,8 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
{
interface IStorageAccessor : IServiceObject
{
Result GetSize(out long arg0);
Result Write(long arg0, ReadOnlySpan<byte> arg1);
Result Read(long arg0, Span<byte> arg1);
Result GetSize(out long size);
Result Write(long arg0, ReadOnlySpan<byte> span);
Result Read(long arg0, ReadOnlySpan<byte> span);
}
}

View file

@ -5,7 +5,7 @@ namespace Ryujinx.Horizon.Sdk.Am.Storage
{
interface ITransferStorageAccessor : IServiceObject
{
Result GetSize(out long arg0);
Result GetSize(out long size);
Result GetHandle(out int arg0, out ulong arg1);
}
}