]> rtime.felk.cvut.cz Git - hercules2020/jailhouse-build.git/commitdiff
Add skeleton of prem_guard_set {sys,hyper}call and a testing program
authorMichal Sojka <michal.sojka@cvut.cz>
Sat, 26 May 2018 11:09:10 +0000 (13:09 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Sat, 26 May 2018 11:09:10 +0000 (13:09 +0200)
jailhouse
nv-tegra/kernel/kernel-4.4
test/Makefile [new file with mode: 0644]
test/prem-test.c [new file with mode: 0644]

index 6fe1d7007a2d5bc75cc0fa8c574e13aa309e1211..7d1df051567a5f945f0e80514c579e46e4b93496 160000 (submodule)
--- a/jailhouse
+++ b/jailhouse
@@ -1 +1 @@
-Subproject commit 6fe1d7007a2d5bc75cc0fa8c574e13aa309e1211
+Subproject commit 7d1df051567a5f945f0e80514c579e46e4b93496
index d259faa6df3f513591e4246a782f51bb940d09ad..f74e90edb90286aed5cabe9eeef00cac091358ae 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d259faa6df3f513591e4246a782f51bb940d09ad
+Subproject commit f74e90edb90286aed5cabe9eeef00cac091358ae
diff --git a/test/Makefile b/test/Makefile
new file mode 100644 (file)
index 0000000..fa4a17b
--- /dev/null
@@ -0,0 +1,4 @@
+CC = /opt/OSELAS.Toolchain-2014.12.2/aarch64-v8a-linux-gnu/gcc-4.9.2-glibc-2.20-binutils-2.24-kernel-3.16-sanitized/bin/aarch64-v8a-linux-gnu-gcc
+CFLAGS = -Wall -O2 -g
+
+all: prem-test
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;
+}