From 264438ff19898bcb8f8fc16dc9243bf9f4eba072 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 4 May 2023 13:16:51 -0300 Subject: Revert "bcat ipc (#4446)" (#4801) This reverts commit 42507323535443ad79be071367f3d4815afca688. --- .../Bcat/Ipc/ServiceCreator/BcatService.cs | 25 -------- .../DeliveryCacheDirectoryService.cs | 48 -------------- .../Ipc/ServiceCreator/DeliveryCacheFileService.cs | 54 ---------------- .../ServiceCreator/DeliveryCacheProgressService.cs | 58 ----------------- .../ServiceCreator/DeliveryCacheStorageService.cs | 74 ---------------------- .../Types/DeliveryCacheProgressImpl.cs | 18 ------ 6 files changed, 277 deletions(-) delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheDirectoryService.cs delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheFileService.cs delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheProgressService.cs delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheStorageService.cs delete mode 100644 src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/Types/DeliveryCacheProgressImpl.cs (limited to 'src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator') diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs deleted file mode 100644 index e82f597e..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/BcatService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Ryujinx.Horizon.Bcat.Types; -using Ryujinx.Horizon.Common; -using Ryujinx.Horizon.Sdk.Bcat; -using Ryujinx.Horizon.Sdk.Sf; - -namespace Ryujinx.Horizon.Bcat.Ipc -{ - partial class BcatService : IBcatService - { - private readonly BcatServicePermissionLevel _permissionLevel; - - public BcatService(BcatServicePermissionLevel permissionLevel) - { - _permissionLevel = permissionLevel; - } - - [CmifCommand(10100)] - public Result RequestSyncDeliveryCache(out IDeliveryCacheProgressService deliveryCacheProgressService) - { - deliveryCacheProgressService = new DeliveryCacheProgressService(); - - return Result.Success; - } - } -} diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheDirectoryService.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheDirectoryService.cs deleted file mode 100644 index dd13eefb..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheDirectoryService.cs +++ /dev/null @@ -1,48 +0,0 @@ -using LibHac.Bcat; -using LibHac.Common; -using Ryujinx.Horizon.Common; -using Ryujinx.Horizon.Sdk.Bcat; -using Ryujinx.Horizon.Sdk.Sf; -using Ryujinx.Horizon.Sdk.Sf.Hipc; -using System; -using System.Threading; - -namespace Ryujinx.Horizon.Bcat.Ipc -{ - partial class DeliveryCacheDirectoryService : IDeliveryCacheDirectoryService, IDisposable - { - private SharedRef _libHacService; - private int _disposalState; - - public DeliveryCacheDirectoryService(ref SharedRef libHacService) - { - _libHacService = SharedRef.CreateMove(ref libHacService); - } - - [CmifCommand(0)] - public Result Open(DirectoryName directoryName) - { - return _libHacService.Get.Open(ref directoryName).ToHorizonResult(); - } - - [CmifCommand(1)] - public Result Read(out int entriesRead, [Buffer(Sdk.Sf.Hipc.HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span entriesBuffer) - { - return _libHacService.Get.Read(out entriesRead, entriesBuffer).ToHorizonResult(); - } - - [CmifCommand(2)] - public Result GetCount(out int count) - { - return _libHacService.Get.GetCount(out count).ToHorizonResult(); - } - - public void Dispose() - { - if (Interlocked.Exchange(ref _disposalState, 1) == 0) - { - _libHacService.Destroy(); - } - } - } -} diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheFileService.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheFileService.cs deleted file mode 100644 index d23f5f41..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheFileService.cs +++ /dev/null @@ -1,54 +0,0 @@ -using LibHac.Bcat; -using LibHac.Common; -using Ryujinx.Horizon.Common; -using Ryujinx.Horizon.Sdk.Bcat; -using Ryujinx.Horizon.Sdk.Sf; -using Ryujinx.Horizon.Sdk.Sf.Hipc; -using System; -using System.Threading; - -namespace Ryujinx.Horizon.Bcat.Ipc -{ - partial class DeliveryCacheFileService : IDeliveryCacheFileService, IDisposable - { - private SharedRef _libHacService; - private int _disposalState; - - public DeliveryCacheFileService(ref SharedRef libHacService) - { - _libHacService = SharedRef.CreateMove(ref libHacService); - } - - [CmifCommand(0)] - public Result Open(DirectoryName directoryName, FileName fileName) - { - return _libHacService.Get.Open(ref directoryName, ref fileName).ToHorizonResult(); - } - - [CmifCommand(1)] - public Result Read(long offset, out long bytesRead, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span data) - { - return _libHacService.Get.Read(out bytesRead, offset, data).ToHorizonResult(); - } - - [CmifCommand(2)] - public Result GetSize(out long size) - { - return _libHacService.Get.GetSize(out size).ToHorizonResult(); - } - - [CmifCommand(3)] - public Result GetDigest(out Digest digest) - { - return _libHacService.Get.GetDigest(out digest).ToHorizonResult(); - } - - public void Dispose() - { - if (Interlocked.Exchange(ref _disposalState, 1) == 0) - { - _libHacService.Destroy(); - } - } - } -} diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheProgressService.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheProgressService.cs deleted file mode 100644 index 91aa2686..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheProgressService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Ryujinx.Common.Logging; -using Ryujinx.Horizon.Bcat.Ipc.Types; -using Ryujinx.Horizon.Common; -using Ryujinx.Horizon.Sdk.Bcat; -using Ryujinx.Horizon.Sdk.OsTypes; -using Ryujinx.Horizon.Sdk.Sf; -using Ryujinx.Horizon.Sdk.Sf.Hipc; -using System; -using System.Threading; - -namespace Ryujinx.Horizon.Bcat.Ipc -{ - partial class DeliveryCacheProgressService : IDeliveryCacheProgressService, IDisposable - { - private int _handle; - private SystemEventType _systemEvent; - private int _disposalState; - - [CmifCommand(0)] - public Result GetEvent([CopyHandle] out int handle) - { - if (_handle == 0) - { - Os.CreateSystemEvent(out _systemEvent, EventClearMode.ManualClear, true).AbortOnFailure(); - - _handle = Os.GetReadableHandleOfSystemEvent(ref _systemEvent); - } - - handle = _handle; - - Logger.Stub?.PrintStub(LogClass.ServiceBcat); - - return Result.Success; - } - - [CmifCommand(1)] - public Result GetImpl([Buffer(HipcBufferFlags.Out | HipcBufferFlags.Pointer, 0x200)] out DeliveryCacheProgressImpl deliveryCacheProgressImpl) - { - deliveryCacheProgressImpl = new DeliveryCacheProgressImpl - { - State = DeliveryCacheProgressImpl.Status.Done, - Result = 0 - }; - - Logger.Stub?.PrintStub(LogClass.ServiceBcat); - - return Result.Success; - } - - public void Dispose() - { - if (_handle != 0 && Interlocked.Exchange(ref _disposalState, 1) == 0) - { - Os.DestroySystemEvent(ref _systemEvent); - } - } - } -} diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheStorageService.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheStorageService.cs deleted file mode 100644 index 9507a8a0..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/DeliveryCacheStorageService.cs +++ /dev/null @@ -1,74 +0,0 @@ -using LibHac.Bcat; -using LibHac.Common; -using Ryujinx.Horizon.Common; -using Ryujinx.Horizon.Sdk.Bcat; -using Ryujinx.Horizon.Sdk.Sf; -using Ryujinx.Horizon.Sdk.Sf.Hipc; -using System; -using System.Threading; - -namespace Ryujinx.Horizon.Bcat.Ipc -{ - partial class DeliveryCacheStorageService : IDeliveryCacheStorageService, IDisposable - { - private SharedRef _libHacService; - private int _disposalState; - - public DeliveryCacheStorageService(ref SharedRef libHacService) - { - _libHacService = SharedRef.CreateMove(ref libHacService); - } - - [CmifCommand(0)] - public Result CreateFileService(out IDeliveryCacheFileService service) - { - using var libHacService = new SharedRef(); - - var resultCode = _libHacService.Get.CreateFileService(ref libHacService.Ref); - - if (resultCode.IsSuccess()) - { - service = new DeliveryCacheFileService(ref libHacService.Ref); - } - else - { - service = null; - } - - return resultCode.ToHorizonResult(); - } - - [CmifCommand(1)] - public Result CreateDirectoryService(out IDeliveryCacheDirectoryService service) - { - using var libHacService = new SharedRef(); - - var resultCode = _libHacService.Get.CreateDirectoryService(ref libHacService.Ref); - - if (resultCode.IsSuccess()) - { - service = new DeliveryCacheDirectoryService(ref libHacService.Ref); - } - else - { - service = null; - } - - return resultCode.ToHorizonResult(); - } - - [CmifCommand(10)] - public Result EnumerateDeliveryCacheDirectory(out int count, [Buffer(HipcBufferFlags.Out | HipcBufferFlags.MapAlias)] Span directoryNames) - { - return _libHacService.Get.EnumerateDeliveryCacheDirectory(out count, directoryNames).ToHorizonResult(); - } - - public void Dispose() - { - if (Interlocked.Exchange(ref _disposalState, 1) == 0) - { - _libHacService.Destroy(); - } - } - } -} diff --git a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/Types/DeliveryCacheProgressImpl.cs b/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/Types/DeliveryCacheProgressImpl.cs deleted file mode 100644 index 10e0b54f..00000000 --- a/src/Ryujinx.Horizon/Bcat/Ipc/ServiceCreator/Types/DeliveryCacheProgressImpl.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Ryujinx.Horizon.Bcat.Ipc.Types -{ - [StructLayout(LayoutKind.Sequential, Size = 0x200)] - public struct DeliveryCacheProgressImpl - { - public enum Status - { - // TODO: determine other values - Done = 9 - } - - public Status State; - public uint Result; - // TODO: reverse the rest of the structure - } -} -- cgit v1.2.3