diff options
author | comex | 2015-02-24 20:39:14 -0500 |
---|---|---|
committer | comex | 2015-02-24 20:39:14 -0500 |
commit | 24eddaa8240137328a0522eccf741e7868a2ee58 (patch) | |
tree | ef7915f83133d966ff8986d3ea41c640832d3d96 /lib/darwin/manual-syscall.h | |
parent | Add transform-dis-cases-arm64.S and fix a serious bug thus discovered. (diff) | |
download | substitute-24eddaa8240137328a0522eccf741e7868a2ee58.tar.gz |
fix arm64/armv7 ish
Diffstat (limited to '')
-rw-r--r-- | lib/darwin/manual-syscall.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/darwin/manual-syscall.h b/lib/darwin/manual-syscall.h index 88ac179..f16ec54 100644 --- a/lib/darwin/manual-syscall.h +++ b/lib/darwin/manual-syscall.h @@ -3,10 +3,12 @@ #define GEN_SYSCALL(name, num) \ __asm__(".globl _manual_" #name "\n" \ ".pushsection __TEXT,__text,regular,pure_instructions\n" \ + GEN_SYSCALL_PRE(name) \ "_manual_" #name ":\n" \ ".set num, " #num "\n" \ GEN_SYSCALL_INNER() \ ".popsection\n") +#define GEN_SYSCALL_PRE(name) #if defined(__x86_64__) /* Look at me, I'm different! */ @@ -30,13 +32,18 @@ "sysenter\n" \ "1: ret\n" #elif defined(__arm__) +#ifdef __thumb__ +#undef GEN_SYSCALL_PRE +#define GEN_SYSCALL_PRE(name) \ + ".thumb_func _manual_" #name "\n" +#endif #define GEN_SYSCALL_INNER() \ "mov r12, #num\n" \ "svc #0x80\n" \ "bx lr\n" #elif defined(__arm64__) #define GEN_SYSCALL_INNER() \ - "mov x12, #num\n" \ + "mov x16, #num\n" \ "svc #0x80\n" \ "ret\n" #else |