summaryrefslogtreecommitdiffhomepage
path: root/vdso/syscalls.h
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-21 14:26:08 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-21 14:26:08 -0700
commiteba086642e466f275b1f2df1284997b2ba0c28dc (patch)
treec23a4c9d047d4b4cc219000094976c5ca912e59f /vdso/syscalls.h
parent89822a446161f1ccb3b84d53f8528bc8b0a28053 (diff)
parentfe001edb14e6e879ab4ebca0d2ac71d770ac8cce (diff)
Merge pull request #1818 from lubinszARM:pr_signal_1
PiperOrigin-RevId: 307680200
Diffstat (limited to 'vdso/syscalls.h')
-rw-r--r--vdso/syscalls.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/vdso/syscalls.h b/vdso/syscalls.h
index b6d15a7d3..0c6a922a0 100644
--- a/vdso/syscalls.h
+++ b/vdso/syscalls.h
@@ -26,6 +26,9 @@
#include <stddef.h>
#include <sys/types.h>
+#define __stringify_1(x...) #x
+#define __stringify(x...) __stringify_1(x)
+
namespace vdso {
#if __x86_64__
@@ -51,20 +54,13 @@ static inline int sys_getcpu(unsigned* cpu, unsigned* node,
return num;
}
-#elif __aarch64__
-
-static inline int sys_rt_sigreturn(void) {
- int num = __NR_rt_sigreturn;
-
- asm volatile(
- "mov x8, %0\n"
- "svc #0 \n"
- : "+r"(num)
- :
- :);
- return num;
+static inline void sys_rt_sigreturn(void) {
+ asm volatile("movl $" __stringify(__NR_rt_sigreturn)", %eax \n"
+ "syscall \n");
}
+#elif __aarch64__
+
static inline int sys_clock_gettime(clockid_t _clkid, struct timespec* _ts) {
register struct timespec* ts asm("x1") = _ts;
register clockid_t clkid asm("x0") = _clkid;
@@ -91,6 +87,11 @@ static inline int sys_clock_getres(clockid_t _clkid, struct timespec* _ts) {
return ret;
}
+static inline void sys_rt_sigreturn(void) {
+ asm volatile("mov x8, #" __stringify(__NR_rt_sigreturn)" \n"
+ "svc #0 \n");
+}
+
#else
#error "unsupported architecture"
#endif