mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Update the stub and callback code to handle lazy compilation. The stub
is re-written by the callback to branch directly to the compiled code in future invocations. Added back in range-based memory permission functions for the updating of the stub on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -127,3 +127,24 @@ bool llvm::sys::Memory::setExecutable (MemoryBlock &M, std::string *ErrMsg) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool llvm::sys::Memory::setRangeWritable(const void *Addr, size_t Size) {
|
||||
#if defined(__APPLE__) && defined(__arm__)
|
||||
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)Addr,
|
||||
(vm_size_t)Size, 0,
|
||||
VM_PROT_READ | VM_PROT_WRITE);
|
||||
return KERN_SUCCESS == kr;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool llvm::sys::Memory::setRangeExecutable(const void *Addr, size_t Size) {
|
||||
#if defined(__APPLE__) && defined(__arm__)
|
||||
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)Addr,
|
||||
(vm_size_t)Size, 0,
|
||||
VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_COPY);
|
||||
return KERN_SUCCESS == kr;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user