summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-07-03 12:34:44 -0700
committerAndy Lutomirski <luto@amacapital.net>2014-07-03 12:34:44 -0700
commit2cb30ed696bae0d4bdd882b5be3e05d07beb166e (patch)
tree37c0277443059a48d0b103b591f4b948e6eec842
parent30d35d95f576fb266fc7537fa8c59c04755f7fa0 (diff)
downloadmisc-tests-2cb30ed696bae0d4bdd882b5be3e05d07beb166e.tar.gz
Add highsys to test syscall high bits
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--highsys.c18
3 files changed, 20 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 13a1dfb..c77a446 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ evil-clock-test
context_switch_latency
kernel_pf
user_visible_state
+highpid
*~
*_32
*_64
diff --git a/Makefile b/Makefile
index cf97ede..0cd9eb3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
.PHONY: all clean
-SIMPLE_C_TARGETS := dump-vdso dump-vvar dump-vsyscall context_switch_latency kernel_pf user_visible_state null_seccomp
+SIMPLE_C_TARGETS := dump-vdso dump-vvar dump-vsyscall context_switch_latency kernel_pf user_visible_state null_seccomp highsys
SIMPLE_CC_TARGETS := evil-clock-test
diff --git a/highsys.c b/highsys.c
new file mode 100644
index 0000000..93eb45e
--- /dev/null
+++ b/highsys.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <sys/syscall.h>
+
+static long high_getpid(void)
+{
+ long ret;
+ asm volatile ("syscall" :
+ "=a" (ret) :
+ "a" (SYS_getpid | 0xbaadf00d00000000ULL) :
+ "memory", "cc", "rcx", "r11");
+ return ret;
+}
+
+int main()
+{
+ printf("high_getpid says %ld\n", high_getpid());
+ return 0;
+}