diff options
author | comex | 2015-07-16 18:07:23 -0400 |
---|---|---|
committer | comex | 2015-07-16 18:07:23 -0400 |
commit | 955bc5e6abde5005a51963830a002a222e39206d (patch) | |
tree | 60df81f1847e1d85b60a28502038f0bf7a382b77 /lib/darwin/inject-asm-raw.c | |
parent | optimization (diff) | |
download | substitute-955bc5e6abde5005a51963830a002a222e39206d.tar.gz |
baton fix
Diffstat (limited to 'lib/darwin/inject-asm-raw.c')
-rw-r--r-- | lib/darwin/inject-asm-raw.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/darwin/inject-asm-raw.c b/lib/darwin/inject-asm-raw.c index 767562c..ddbffb0 100644 --- a/lib/darwin/inject-asm-raw.c +++ b/lib/darwin/inject-asm-raw.c @@ -55,9 +55,16 @@ static int bsd_thread_func(void *arg) { manual_semaphore_wait_trap(baton->sem_port); #ifndef __i386__ /* since we're munmapping our own code, this must be optimized into a jump - * (taill call elimination) */ + * (tail call elimination) */ + enum { page_size = +#ifdef __arm64__ + 0x4000 +#else + 0x1000 +#endif + }; unsigned long ptr = (unsigned long) baton & ~(_PAGE_SIZE - 1); - return baton->munmap((void *) ptr, 0x2000); + return baton->munmap((void *) ptr, 2 * page_size); #else /* i386 can't normally eliminate tail calls in caller-cleanup calling * conventions, unless the number of arguments is the same, so use a nasty |