]> rtime.felk.cvut.cz Git - hercules2020/jailhouse-build.git/blobdiff - test/prem-test.c
Add skeleton of prem_guard_set {sys,hyper}call and a testing program
[hercules2020/jailhouse-build.git] / test / prem-test.c
diff --git a/test/prem-test.c b/test/prem-test.c
new file mode 100644 (file)
index 0000000..d90c95c
--- /dev/null
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdint.h>
+#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#include <unistd.h>
+#include <sys/syscall.h>   /* For SYS_xxx definitions */
+
+#ifndef SYS_prem_guard_set
+#define SYS_prem_guard_set 792
+#endif
+
+
+unsigned long prem_guard_set(unsigned long arg1,
+                            unsigned long arg2,
+                            unsigned long arg3)
+{
+       return syscall(SYS_prem_guard_set, arg1, arg2, arg3);
+}
+
+int main(int argc, char *argv[])
+{
+       printf("hvc result: %lu\n", prem_guard_set(11, 22, 33));
+       return 0;
+}