Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
62585755fd | ||
|
56621615b1 | ||
|
2099a3e84b | ||
|
7d26e4ac7b |
@@ -296,27 +296,33 @@ namespace ARMeilleure.Instructions
|
|||||||
{
|
{
|
||||||
if (op.Op)
|
if (op.Op)
|
||||||
{
|
{
|
||||||
// Convert to half
|
// Convert to half.
|
||||||
|
|
||||||
Operand src = ExtractScalar(context, op.Size == 1 ? OperandType.FP64 : OperandType.FP32, op.Vm);
|
Operand src = ExtractScalar(context, op.Size == 1 ? OperandType.FP64 : OperandType.FP32, op.Vm);
|
||||||
|
|
||||||
MethodInfo method = op.Size == 1
|
MethodInfo method = op.Size == 1
|
||||||
? typeof(SoftFloat64_16).GetMethod(nameof(SoftFloat64_16.FPConvert))
|
? typeof(SoftFloat64_16).GetMethod(nameof(SoftFloat64_16.FPConvert))
|
||||||
: typeof(SoftFloat32_16).GetMethod(nameof(SoftFloat32_16.FPConvert));
|
: typeof(SoftFloat32_16).GetMethod(nameof(SoftFloat32_16.FPConvert));
|
||||||
|
|
||||||
|
context.StoreToContext();
|
||||||
Operand res = context.Call(method, src);
|
Operand res = context.Call(method, src);
|
||||||
|
context.LoadFromContext();
|
||||||
|
|
||||||
InsertScalar16(context, op.Vd, op.T, res);
|
InsertScalar16(context, op.Vd, op.T, res);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Convert from half
|
// Convert from half.
|
||||||
|
|
||||||
Operand src = ExtractScalar16(context, op.Vm, op.T);
|
Operand src = ExtractScalar16(context, op.Vm, op.T);
|
||||||
|
|
||||||
MethodInfo method = op.Size == 1
|
MethodInfo method = op.Size == 1
|
||||||
? typeof(SoftFloat16_64).GetMethod(nameof(SoftFloat16_64.FPConvert))
|
? typeof(SoftFloat16_64).GetMethod(nameof(SoftFloat16_64.FPConvert))
|
||||||
: typeof(SoftFloat16_32).GetMethod(nameof(SoftFloat16_32.FPConvert));
|
: typeof(SoftFloat16_32).GetMethod(nameof(SoftFloat16_32.FPConvert));
|
||||||
|
|
||||||
|
context.StoreToContext();
|
||||||
Operand res = context.Call(method, src);
|
Operand res = context.Call(method, src);
|
||||||
|
context.LoadFromContext();
|
||||||
|
|
||||||
InsertScalar(context, op.Vd, res);
|
InsertScalar(context, op.Vd, res);
|
||||||
}
|
}
|
||||||
|
@@ -455,13 +455,16 @@ namespace ARMeilleure.Translation
|
|||||||
|
|
||||||
public void InvalidateJitCacheRegion(ulong address, ulong size)
|
public void InvalidateJitCacheRegion(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
// If rejit is running, stop it as it may be trying to rejit a function on the invalidated region.
|
|
||||||
ClearRejitQueue(allowRequeue: true);
|
|
||||||
|
|
||||||
ulong[] overlapAddresses = Array.Empty<ulong>();
|
ulong[] overlapAddresses = Array.Empty<ulong>();
|
||||||
|
|
||||||
int overlapsCount = Functions.GetOverlaps(address, size, ref overlapAddresses);
|
int overlapsCount = Functions.GetOverlaps(address, size, ref overlapAddresses);
|
||||||
|
|
||||||
|
if (overlapsCount != 0)
|
||||||
|
{
|
||||||
|
// If rejit is running, stop it as it may be trying to rejit a function on the invalidated region.
|
||||||
|
ClearRejitQueue(allowRequeue: true);
|
||||||
|
}
|
||||||
|
|
||||||
for (int index = 0; index < overlapsCount; index++)
|
for (int index = 0; index < overlapsCount; index++)
|
||||||
{
|
{
|
||||||
ulong overlapAddress = overlapAddresses[index];
|
ulong overlapAddress = overlapAddresses[index];
|
||||||
|
@@ -5,22 +5,48 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.NfcManager
|
|||||||
class INfc : IpcService
|
class INfc : IpcService
|
||||||
{
|
{
|
||||||
private NfcPermissionLevel _permissionLevel;
|
private NfcPermissionLevel _permissionLevel;
|
||||||
|
private State _state;
|
||||||
|
|
||||||
public INfc(NfcPermissionLevel permissionLevel)
|
public INfc(NfcPermissionLevel permissionLevel)
|
||||||
{
|
{
|
||||||
_permissionLevel = permissionLevel;
|
_permissionLevel = permissionLevel;
|
||||||
|
_state = State.NonInitialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandHipc(0)]
|
[CommandHipc(0)]
|
||||||
[CommandHipc(400)] // 4.0.0+
|
[CommandHipc(400)] // 4.0.0+
|
||||||
// Initialize()
|
// Initialize(u64, u64, pid, buffer<unknown, 5>)
|
||||||
public ResultCode Initialize(ServiceCtx context)
|
public ResultCode Initialize(ServiceCtx context)
|
||||||
{
|
{
|
||||||
|
_state = State.Initialized;
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel });
|
Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel });
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandHipc(1)]
|
||||||
|
[CommandHipc(401)] // 4.0.0+
|
||||||
|
// Finalize()
|
||||||
|
public ResultCode Finalize(ServiceCtx context)
|
||||||
|
{
|
||||||
|
_state = State.NonInitialized;
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceNfc, new { _permissionLevel });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandHipc(2)]
|
||||||
|
[CommandHipc(402)] // 4.0.0+
|
||||||
|
// GetState() -> u32
|
||||||
|
public ResultCode GetState(ServiceCtx context)
|
||||||
|
{
|
||||||
|
context.ResponseData.Write((int)_state);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandHipc(3)]
|
[CommandHipc(3)]
|
||||||
[CommandHipc(403)] // 4.0.0+
|
[CommandHipc(403)] // 4.0.0+
|
||||||
// IsNfcEnabled() -> b8
|
// IsNfcEnabled() -> b8
|
||||||
|
8
Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/State.cs
Normal file
8
Ryujinx.HLE/HOS/Services/Nfc/NfcManager/Types/State.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Ryujinx.HLE.HOS.Services.Nfc.NfcManager
|
||||||
|
{
|
||||||
|
enum State
|
||||||
|
{
|
||||||
|
NonInitialized,
|
||||||
|
Initialized
|
||||||
|
}
|
||||||
|
}
|
@@ -349,7 +349,11 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
|
|||||||
// GetSessionCacheMode() -> nn::ssl::sf::SessionCacheMode
|
// GetSessionCacheMode() -> nn::ssl::sf::SessionCacheMode
|
||||||
public ResultCode GetSessionCacheMode(ServiceCtx context)
|
public ResultCode GetSessionCacheMode(ServiceCtx context)
|
||||||
{
|
{
|
||||||
throw new ServiceNotImplementedException(this, context);
|
context.ResponseData.Write((uint)_sessionCacheMode);
|
||||||
|
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceSsl, new { _sessionCacheMode });
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandHipc(19)]
|
[CommandHipc(19)]
|
||||||
|
@@ -92,5 +92,31 @@ namespace Ryujinx.Memory.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_AliasMapLeak()
|
||||||
|
{
|
||||||
|
if (OperatingSystem.IsMacOS())
|
||||||
|
{
|
||||||
|
// Memory aliasing tests fail on CI at the moment.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong pageSize = 4096;
|
||||||
|
ulong size = 100000 * pageSize; // The mappings limit on Linux is usually around 65K, so let's make sure we are above that.
|
||||||
|
|
||||||
|
using MemoryBlock backing = new MemoryBlock(pageSize, MemoryAllocationFlags.Mirrorable);
|
||||||
|
using MemoryBlock toAlias = new MemoryBlock(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||||
|
|
||||||
|
for (ulong offset = 0; offset < size; offset += pageSize)
|
||||||
|
{
|
||||||
|
toAlias.MapView(backing, 0, offset, pageSize);
|
||||||
|
|
||||||
|
toAlias.Write(offset, 0xbadc0de);
|
||||||
|
Assert.AreEqual(0xbadc0de, backing.Read<int>(0));
|
||||||
|
|
||||||
|
toAlias.UnmapView(backing, offset, pageSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -177,7 +177,7 @@ namespace Ryujinx.Memory
|
|||||||
|
|
||||||
public static void UnmapView(IntPtr location, ulong size)
|
public static void UnmapView(IntPtr location, ulong size)
|
||||||
{
|
{
|
||||||
mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED, -1, 0);
|
mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED | MmapFlags.MAP_PRIVATE | MmapFlags.MAP_ANONYMOUS | MmapFlags.MAP_NORESERVE, -1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user