Refactoring HOS folder structure (#771)

* Refactoring HOS folder structure

Refactoring HOS folder structure:

- Added some subfolders when needed (Following structure decided in private).
- Added some `Types` folders when needed.
- Little cleanup here and there.
- Add services placeholders for every HOS services (close #766 and #753).

* Remove Types namespaces
This commit is contained in:
Ac_K 2019-09-19 02:45:11 +02:00 committed by jduncanator
parent 4af3101b22
commit a0720b5681
393 changed files with 2540 additions and 1299 deletions

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Nv
{
[Service("nvdrvdbg")]
class INvDrvDebugFSServices : IpcService
{
public INvDrvDebugFSServices(ServiceCtx context) { }
}
}

View file

@ -4,11 +4,11 @@ using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Kernel.Threading;
using Ryujinx.HLE.HOS.Services.Nv.NvGpuAS;
using Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu;
using Ryujinx.HLE.HOS.Services.Nv.NvHostChannel;
using Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl;
using Ryujinx.HLE.HOS.Services.Nv.NvMap;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap;
using System;
using System.Collections.Generic;

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Nv
{
[Service("nvgem:c")]
class INvGemControl : IpcService
{
public INvGemControl(ServiceCtx context) { }
}
}

View file

@ -0,0 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Nv
{
[Service("nvgem:cd")]
class INvGemCoreDump : IpcService
{
public INvGemCoreDump(ServiceCtx context) { }
}
}

View file

@ -2,11 +2,11 @@ using ARMeilleure.Memory;
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Memory;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Services.Nv.NvMap;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap;
using System;
using System.Collections.Concurrent;
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
class NvGpuASIoctl
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
struct NvGpuASAllocSpace
{

View file

@ -1,7 +1,7 @@
using Ryujinx.Graphics.Memory;
using System.Collections.Generic;
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
class NvGpuASCtx
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
struct NvGpuASMapBufferEx
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
struct NvGpuASRemap
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS
{
struct NvGpuASUnmapBuffer
{

View file

@ -3,7 +3,7 @@ using Ryujinx.Common.Logging;
using System;
using System.Diagnostics;
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
class NvGpuGpuIoctl
{
@ -40,9 +40,10 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
{
long outputPosition = context.Request.GetBufferType0x22().Position;
NvGpuGpuZcullGetCtxSize args = new NvGpuGpuZcullGetCtxSize();
args.Size = 1;
NvGpuGpuZcullGetCtxSize args = new NvGpuGpuZcullGetCtxSize
{
Size = 1
};
MemoryHelper.Write(context.Memory, outputPosition, args);
@ -55,18 +56,19 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
{
long outputPosition = context.Request.GetBufferType0x22().Position;
NvGpuGpuZcullGetInfo args = new NvGpuGpuZcullGetInfo();
args.WidthAlignPixels = 0x20;
args.HeightAlignPixels = 0x20;
args.PixelSquaresByAliquots = 0x400;
args.AliquotTotal = 0x800;
args.RegionByteMultiplier = 0x20;
args.RegionHeaderSize = 0x20;
args.SubregionHeaderSize = 0xc0;
args.SubregionWidthAlignPixels = 0x20;
args.SubregionHeightAlignPixels = 0x40;
args.SubregionCount = 0x10;
NvGpuGpuZcullGetInfo args = new NvGpuGpuZcullGetInfo
{
WidthAlignPixels = 0x20,
HeightAlignPixels = 0x20,
PixelSquaresByAliquots = 0x400,
AliquotTotal = 0x800,
RegionByteMultiplier = 0x20,
RegionHeaderSize = 0x20,
SubregionHeaderSize = 0xc0,
SubregionWidthAlignPixels = 0x20,
SubregionHeightAlignPixels = 0x40,
SubregionCount = 0x10
};
MemoryHelper.Write(context.Memory, outputPosition, args);
@ -156,10 +158,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
{
long outputPosition = context.Request.GetBufferType0x22().Position;
NvGpuGpuGetActiveSlotMask args = new NvGpuGpuGetActiveSlotMask();
args.Slot = 0x07;
args.Mask = 0x01;
NvGpuGpuGetActiveSlotMask args = new NvGpuGpuGetActiveSlotMask
{
Slot = 0x07,
Mask = 0x01
};
MemoryHelper.Write(context.Memory, outputPosition, args);

View file

@ -1,8 +1,8 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
struct NvGpuGpuGetActiveSlotMask
{
public int Slot;
public int Mask;
}
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
struct NvGpuGpuGetCharacteristics
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
struct NvGpuGpuGetTpcMasks
{

View file

@ -1,7 +1,7 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
struct NvGpuGpuZcullGetCtxSize
{
public int Size;
}
}
}

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuGpu
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuGpu
{
struct NvGpuGpuZcullGetInfo
{
@ -13,4 +13,4 @@
public int SubregionHeightAlignPixels;
public int SubregionCount;
}
}
}

View file

@ -2,12 +2,12 @@ using ARMeilleure.Memory;
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.Memory;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Services.Nv.NvGpuAS;
using Ryujinx.HLE.HOS.Services.Nv.NvMap;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvGpuAS;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap;
using System;
using System.Collections.Concurrent;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
class NvHostChannelIoctl
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
class NvChannel
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
enum NvChannelPriority
{

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
[StructLayout(LayoutKind.Sequential, Size = 8, Pack = 4)]
struct NvHostChannelCmdBuf

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
[StructLayout(LayoutKind.Sequential, Size = 8, Pack = 4)]
struct NvHostChannelGetParamArg

View file

@ -1,12 +1,12 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
[StructLayout(LayoutKind.Sequential, Size = 0xc, Pack = 4)]
struct NvHostChannelMapBuffer
{
public int NumEntries;
public int DataAddress; //Ignored by the driver.
public int DataAddress; // Ignored by the driver.
public bool AttachHostChDas;
}
}

View file

@ -1,6 +1,6 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
[StructLayout(LayoutKind.Sequential, Size = 8, Pack = 4)]
struct NvHostChannelSubmit

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
{
struct NvHostChannelSubmitGpfifo
{

View file

@ -1,12 +1,13 @@
using ARMeilleure.Memory;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.HOS.Services.Settings;
using System;
using System.Collections.Concurrent;
using System.Text;
using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
class NvHostCtrlIoctl
{
@ -18,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
{
_userCtxs = new ConcurrentDictionary<KProcess, NvHostCtrlUserCtx>();
if (Set.NxSettings.Settings.TryGetValue("nv!rmos_set_production_mode", out object productionModeSetting))
if (NxSettings.Settings.TryGetValue("nv!rmos_set_production_mode", out object productionModeSetting))
{
_isProductionMode = ((string)productionModeSetting) != "0"; // Default value is ""
}
@ -88,7 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
string domain = MemoryHelper.ReadAsciiString(context.Memory, inputPosition + 0, 0x41);
string name = MemoryHelper.ReadAsciiString(context.Memory, inputPosition + 0x41, 0x41);
if (Set.NxSettings.Settings.TryGetValue($"{domain}!{name}", out object nvSetting))
if (NxSettings.Settings.TryGetValue($"{domain}!{name}", out object nvSetting))
{
byte[] settingBuffer = new byte[0x101];

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
struct NvHostCtrlSyncptRead
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
struct NvHostCtrlSyncptWait
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
struct NvHostCtrlSyncptWaitEx
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
class NvHostCtrlUserCtx
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
class NvHostEvent
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
enum NvHostEventState
{

View file

@ -3,7 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
{
class NvHostSyncpt
{

View file

@ -5,7 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.Utilities;
using System.Collections.Concurrent;
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
class NvMapIoctl
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapAlloc
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapCreate
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapFree
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapFromId
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapGetId
{

View file

@ -1,6 +1,6 @@
using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
class NvMapHandle
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
enum NvMapHandleParam
{

View file

@ -1,4 +1,4 @@
namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
{
struct NvMapParam
{