mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 17:00:17 +00:00
Address some PR feedback
This commit is contained in:
parent
dd187b0ac3
commit
99bf357b92
17 changed files with 40 additions and 20 deletions
|
@ -722,6 +722,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
|||
bool isLight,
|
||||
[PointerSized] ulong namePtr)
|
||||
{
|
||||
// The kernel doesn't use the name pointer, so we can just pass null as the name.
|
||||
return CreatePort(out serverPortHandle, out clientPortHandle, maxSessions, isLight, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -471,6 +471,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
|
|||
private static string GetCanonicalTypeNameWithGenericArguments(Compilation compilation, SyntaxNode syntaxNode)
|
||||
{
|
||||
TypeInfo typeInfo = compilation.GetSemanticModel(syntaxNode.SyntaxTree).GetTypeInfo(syntaxNode);
|
||||
|
||||
return typeInfo.Type.ToDisplayString();
|
||||
}
|
||||
|
||||
|
@ -491,6 +492,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
|
|||
private static SpecialType GetSpecialTypeName(Compilation compilation, SyntaxNode syntaxNode)
|
||||
{
|
||||
TypeInfo typeInfo = compilation.GetSemanticModel(syntaxNode.SyntaxTree).GetTypeInfo(syntaxNode);
|
||||
|
||||
return typeInfo.Type.SpecialType;
|
||||
}
|
||||
|
||||
|
@ -505,6 +507,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
|
|||
if (typeInfo.Type.SpecialType == SpecialType.None)
|
||||
{
|
||||
string pack = GetTypeFirstNamedAttributeAgument(compilation, syntaxNode, TypeStructLayoutAttribute, "Pack");
|
||||
|
||||
return pack ?? "1";
|
||||
}
|
||||
else
|
||||
|
@ -623,6 +626,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
|
|||
private static bool IsUnmanagedType(Compilation compilation, SyntaxNode syntaxNode)
|
||||
{
|
||||
TypeInfo typeInfo = compilation.GetSemanticModel(syntaxNode.SyntaxTree).GetTypeInfo(syntaxNode);
|
||||
|
||||
return typeInfo.Type.IsUnmanagedType;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,7 @@ namespace Ryujinx.Horizon.Generators.Hipc
|
|||
{
|
||||
if (syntaxNode is ClassDeclarationSyntax classDeclaration)
|
||||
{
|
||||
if (!classDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword) ||
|
||||
classDeclaration.BaseList == null)
|
||||
if (!classDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword) || classDeclaration.BaseList == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
namespace Ryujinx.Horizon.Sdk
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk
|
||||
{
|
||||
static class DebugUtil
|
||||
{
|
||||
public static void Assert(bool condition)
|
||||
{
|
||||
|
||||
Debug.Assert(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,16 +2,10 @@
|
|||
{
|
||||
struct EventType
|
||||
{
|
||||
public enum InitializatonState : byte
|
||||
{
|
||||
NotInitialized,
|
||||
Initialized
|
||||
}
|
||||
|
||||
public bool Signaled;
|
||||
public bool InitiallySignaled;
|
||||
public byte ClearMode;
|
||||
public InitializatonState State;
|
||||
public InitializationState State;
|
||||
public ulong BroadcastCounter;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace Ryujinx.Horizon.Sdk.OsTypes.Impl
|
|||
|
||||
public static void Destroy(ref InterProcessEventType ipEvent)
|
||||
{
|
||||
ipEvent.State = InterProcessEventType.InitializationState.NotInitialized;
|
||||
ipEvent.State = InitializationState.NotInitialized;
|
||||
|
||||
if (ipEvent.ReadableHandleManaged)
|
||||
{
|
||||
|
|
8
Ryujinx.Horizon/Sdk/OsTypes/InitializationState.cs
Normal file
8
Ryujinx.Horizon/Sdk/OsTypes/InitializationState.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.Horizon.Sdk.OsTypes
|
||||
{
|
||||
enum InitializationState : byte
|
||||
{
|
||||
NotInitialized,
|
||||
Initialized
|
||||
}
|
||||
}
|
|
@ -2,12 +2,6 @@
|
|||
{
|
||||
struct InterProcessEventType
|
||||
{
|
||||
public enum InitializationState : byte
|
||||
{
|
||||
NotInitialized,
|
||||
Initialized
|
||||
}
|
||||
|
||||
public readonly bool AutoClear;
|
||||
public InitializationState State;
|
||||
public bool ReadableHandleManaged;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Signaled = signaled,
|
||||
InitiallySignaled = signaled,
|
||||
ClearMode = (byte)clearMode,
|
||||
State = EventType.InitializatonState.Initialized
|
||||
State = InitializationState.Initialized
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
{
|
||||
struct CmifDomainOutHeader
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public uint ObjectsCount;
|
||||
public uint Padding;
|
||||
public uint Padding2;
|
||||
public uint Padding3;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,11 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
|
|||
{
|
||||
struct CmifOutHeader
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public uint Magic;
|
||||
public uint Version;
|
||||
public Result Result;
|
||||
public uint Token;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
struct CmifRequestFormat
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
public int ObjectId;
|
||||
public uint RequestId;
|
||||
public uint Context;
|
||||
|
@ -18,5 +19,6 @@
|
|||
public int ObjectsCount;
|
||||
public int HandlesCount;
|
||||
public bool SendPid;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,15 +14,18 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
if (result == KernelResult.PortRemoteClosed)
|
||||
{
|
||||
recvResult = ReceiveResult.Closed;
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
else if (result == KernelResult.ReceiveListBroken)
|
||||
{
|
||||
recvResult = ReceiveResult.NeedsRetry;
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
recvResult = ReceiveResult.Success;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
{
|
||||
struct HipcBufferDescriptor
|
||||
{
|
||||
#pragma warning disable CS0649
|
||||
private uint _sizeLow;
|
||||
private uint _addressLow;
|
||||
private uint _word2;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
public ulong Address => _addressLow | (((ulong)_word2 << 4) & 0xf00000000UL) | (((ulong)_word2 << 34) & 0x7000000000UL);
|
||||
public ulong Size => _sizeLow | ((ulong)_word2 << 8) & 0xf00000000UL;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
{
|
||||
[Flags]
|
||||
enum HipcBufferFlags : byte
|
||||
{
|
||||
In = 1 << 0,
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||
protected override Result DispatchManagerRequest(ServerSession session, Span<byte> inMessage, Span<byte> outMessage)
|
||||
{
|
||||
HipcManager hipcManager = new HipcManager(this, session);
|
||||
|
||||
return DispatchRequest(new ServiceObjectHolder(hipcManager), session, inMessage, outMessage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace Ryujinx.Horizon.Sm
|
|||
{
|
||||
_clientProcessId = clientProcessId;
|
||||
_initialized = true;
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
|
@ -31,6 +32,7 @@ namespace Ryujinx.Horizon.Sm
|
|||
if (!_initialized)
|
||||
{
|
||||
handle = 0;
|
||||
|
||||
return SmResult.InvalidClient;
|
||||
}
|
||||
|
||||
|
@ -43,6 +45,7 @@ namespace Ryujinx.Horizon.Sm
|
|||
if (!_initialized)
|
||||
{
|
||||
handle = 0;
|
||||
|
||||
return SmResult.InvalidClient;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue