mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-29 16:51:20 +00:00
loader: add INSERTQ RDPID and CLWB fallbacks
Co-authored-by: nomolao2-cell <nomolao2@gmail.com>
This commit is contained in:
1 parent
a4d26cf81a
commit
19a9464b7d
6 files changed
+667
-107
No files matched your search
@@ -11,6 +11,14 @@
|
||||
|
||||
namespace Loader {
|
||||
|
||||
struct GuestInstructionHostFeatures {
|
||||
bool sse4a = false;
|
||||
bool rdpid = false;
|
||||
bool clwb = false;
|
||||
};
|
||||
|
||||
GuestInstructionHostFeatures GetGuestInstructionHostFeatures();
|
||||
|
||||
struct InstructionPatchCounts {
|
||||
uint64_t found = 0;
|
||||
uint64_t native = 0;
|
||||
@@ -39,6 +47,9 @@ struct GuestInstructionPatchResult {
|
||||
uint64_t indirect_red_zone_function_count = 0;
|
||||
InstructionPatchCounts reciprocal_sqrt;
|
||||
InstructionPatchCounts extrq;
|
||||
InstructionPatchCounts insertq;
|
||||
InstructionPatchCounts rdpid;
|
||||
InstructionPatchCounts clwb;
|
||||
};
|
||||
|
||||
void RegisterGuestInstructionPatchModule(void* module_ptr, uint64_t module_size,
|
||||
@@ -46,9 +57,10 @@ void RegisterGuestInstructionPatchModule(void* module_ptr, uint64_t module_size,
|
||||
void UnregisterGuestInstructionPatchModule(void* module_ptr);
|
||||
|
||||
// Apply enabled instruction fixes using native trampolines or safe trap fallbacks.
|
||||
GuestInstructionPatchResult PatchGuestInstructions(uint64_t segment_addr, uint64_t segment_size,
|
||||
std::span<const uintptr_t> function_starts,
|
||||
bool protect_memory, bool emulate_amd);
|
||||
GuestInstructionPatchResult PatchGuestInstructions(
|
||||
uint64_t segment_addr, uint64_t segment_size, std::span<const uintptr_t> function_starts,
|
||||
bool protect_memory, bool emulate_amd,
|
||||
GuestInstructionHostFeatures host_features = GetGuestInstructionHostFeatures());
|
||||
|
||||
bool DecodeEhFrameFunctionStarts(uint64_t eh_frame_header_addr, uint64_t eh_frame_header_size,
|
||||
std::vector<uintptr_t>* function_starts);
|
||||
|
||||
Reference in new issue
Block a user