mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-30 23:33:17 +00:00
cpu_patches: Patch just-in-time using signal handlers. (#852)
* cpu_patches: Patch just-in-time using illegal instruction handler. * core: Add common signal dispatch system and use for on-demand TCB patches. * page_manager: Re-add userfaultfd implementation.
This commit is contained in:
parent
b09b28c7f3
commit
75a4df53a5
7 changed files with 404 additions and 143 deletions
|
@ -3,10 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Xbyak {
|
||||
class CodeGenerator;
|
||||
}
|
||||
|
||||
namespace Core {
|
||||
|
||||
/// Initializes a stack for the current thread for use by patch implementations.
|
||||
|
@ -15,7 +11,11 @@ void InitializeThreadPatchStack();
|
|||
/// Cleans up the patch stack for the current thread.
|
||||
void CleanupThreadPatchStack();
|
||||
|
||||
/// Patches CPU instructions that cannot run as-is on the host.
|
||||
void PatchInstructions(u64 segment_addr, u64 segment_size, Xbyak::CodeGenerator& c);
|
||||
/// Registers a module for patching, providing an area to generate trampoline code.
|
||||
void RegisterPatchModule(void* module_ptr, u64 module_size, void* trampoline_area_ptr,
|
||||
u64 trampoline_area_size);
|
||||
|
||||
/// Applies CPU patches that need to be done before beginning executions.
|
||||
void PrePatchInstructions(u64 segment_addr, u64 segment_size);
|
||||
|
||||
} // namespace Core
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue