@@ -167,14 +167,28 @@
# define HAVE_CLONE3_WRAPPER 1
+# define MSTR_HELPER(x) # x
+# define MSTR(x) MSTR_HELPER(x)
+
# undef INTERNAL_SYSCALL_RAW
# define INTERNAL_SYSCALL_RAW(name, nr, args...) \
({ long _sys_result; \
{ \
LOAD_ARGS_##nr (args) \
- register long _x8 asm ("x8") = (name); \
- asm volatile ("svc 0 // syscall " # name \
- : "=r" (_x0) : "r"(_x8) ASM_ARGS_##nr : "memory"); \
+ if (__builtin_constant_p(name)) \
+ asm volatile ("mov x8, %1\n" \
+ "svc 0 // syscall " # name \
+ : "=r" (_x0) \
+ : "i" (name) ASM_ARGS_##nr \
+ : "x8", "memory"); \
+ else \
+ { \
+ register long _x8 asm ("x8") = (name); \
+ asm volatile ("svc 0 // syscall " # name \
+ : "=r" (_x0) \
+ : "r"(_x8) ASM_ARGS_##nr \
+ : "memory"); \
+ } \
_sys_result = _x0; \
} \
_sys_result; })