Richard Henderson <richard.hender...@linaro.org> writes:
> Cribbed from code posted by Joelle van Dyne <j...@getutm.app>, > and rearranged to a cleaner structure. Completely untested. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > accel/tcg/translate-all.c | 65 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 65 insertions(+) > > diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c > index 1931e65365..17df6c94fa 100644 > --- a/accel/tcg/translate-all.c > +++ b/accel/tcg/translate-all.c > @@ -1166,9 +1166,71 @@ static bool alloc_code_gen_buffer_splitwx_memfd(size_t > size, Error **errp) > } > #endif /* CONFIG_POSIX */ > > +#ifdef CONFIG_DARWIN > +#include <mach/mach.h> > + > +extern kern_return_t mach_vm_remap(vm_map_t target_task, > + mach_vm_address_t *target_address, > + mach_vm_size_t size, > + mach_vm_offset_t mask, > + int flags, > + vm_map_t src_task, > + mach_vm_address_t src_address, > + boolean_t copy, > + vm_prot_t *cur_protection, > + vm_prot_t *max_protection, > + vm_inherit_t inheritance); Our checkpatch really doesn't like the extern being dropped in here but having grepped the xnu source I'm not sure we have a choice. I'm curious how stable the function might be given it's not in a published header. -- Alex Bennée