From 2dbbc9bc05998baa94d7b1953d9e0ffc7f1651f8 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 18 Jan 2024 14:08:40 -0300 Subject: Move most of signal handling to Ryujinx.Cpu project (#6128) * Move most of signal handling to Ryujinx.Cpu project * Format whitespace * Remove unused member * Format whitespace * This does not need to be public anymore --- src/Ryujinx.Cpu/Jit/JitCpuContext.cs | 8 ++++++++ src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Ryujinx.Cpu/Jit') diff --git a/src/Ryujinx.Cpu/Jit/JitCpuContext.cs b/src/Ryujinx.Cpu/Jit/JitCpuContext.cs index 24bc1e59..5876346a 100644 --- a/src/Ryujinx.Cpu/Jit/JitCpuContext.cs +++ b/src/Ryujinx.Cpu/Jit/JitCpuContext.cs @@ -1,5 +1,7 @@ using ARMeilleure.Memory; using ARMeilleure.Translation; +using Ryujinx.Cpu.Signal; +using Ryujinx.Memory; namespace Ryujinx.Cpu.Jit { @@ -12,6 +14,12 @@ namespace Ryujinx.Cpu.Jit { _tickSource = tickSource; _translator = new Translator(new JitMemoryAllocator(), memory, for64Bit); + + if (memory.Type.IsHostMapped()) + { + NativeSignalHandler.InitializeSignalHandler(MemoryBlock.GetPageSize()); + } + memory.UnmapEvent += UnmapHandler; } diff --git a/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs b/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs index 529a1a80..eb665c2d 100644 --- a/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs +++ b/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs @@ -7,7 +7,5 @@ namespace Ryujinx.Cpu.Jit { public IJitMemoryBlock Allocate(ulong size) => new JitMemoryBlock(size, MemoryAllocationFlags.None); public IJitMemoryBlock Reserve(ulong size) => new JitMemoryBlock(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Jit); - - public ulong GetPageSize() => MemoryBlock.GetPageSize(); } } -- cgit v1.2.3