mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
jit: Transfer the responsibility of detecting whether CodeMemory syscalls are available/usable to the homebrew environment
This commit is contained in:
parent
d0d64ce1ce
commit
8d51f7de1c
@ -15,8 +15,8 @@ Result jitCreate(Jit* j, size_t size)
|
||||
|
||||
// Use new CodeMemory object introduced in [4.0.0+], if available.
|
||||
// On [5.0.0+] this is only usable with a kernel patch, as svcControlCodeMemory now errors if it's used under the same process which owns the object.
|
||||
if (kernelAbove400() && envIsSyscallHinted(0x4B) && envIsSyscallHinted(0x4C)
|
||||
&& (!kernelAbove500() || detectJitKernelPatch())) {
|
||||
// The homebrew loading environment is responsible for hinting the syscalls if they are available/usable for jit.
|
||||
if (envIsSyscallHinted(0x4B) && envIsSyscallHinted(0x4C)) {
|
||||
type = JitType_CodeMemory;
|
||||
}
|
||||
// Fall back to JitType_SetProcessMemoryPermission if available.
|
||||
|
Loading…
Reference in New Issue
Block a user