Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2016-09-26 22:36:39 +0300
committerAndrei Vagin <avagin@virtuozzo.com>2017-03-14 23:58:20 +0300
commit19fadee9d909bef2a3418c86c06bed52eeb90445 (patch)
tree9b8f2977b48223c9c0e088afe49fa29b9143d05a /compel/arch/aarch64
parent35726a766798fec0ab2bb9d3ee7504fb3736738d (diff)
compel: plugins,std -- Implement syscalls in std plugin
And use it in CRIU directly instead: - move syscalls into compel/arch/ARCH/plugins/std/syscalls - drop old symlinks - no build for 32bit on x86 as expected - use std.built-in.o inside criu directly (compel_main stub) - drop syscalls on x86 criu directory, I copied them already in first compel commist, so we can't move them now, but delete in place Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'compel/arch/aarch64')
l---------compel/arch/aarch64/plugins/std/syscalls/Makefile.syscalls1
l---------compel/arch/aarch64/plugins/std/syscalls/gen-sys-exec-tbl.pl1
l---------compel/arch/aarch64/plugins/std/syscalls/gen-syscalls.pl1
-rw-r--r--compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S37
-rw-r--r--compel/arch/aarch64/plugins/std/syscalls/syscall-aux.h3
-rw-r--r--compel/arch/aarch64/plugins/std/syscalls/syscall-common.S19
l---------compel/arch/aarch64/plugins/std/syscalls/syscall.def1
7 files changed, 63 insertions, 0 deletions
diff --git a/compel/arch/aarch64/plugins/std/syscalls/Makefile.syscalls b/compel/arch/aarch64/plugins/std/syscalls/Makefile.syscalls
new file mode 120000
index 000000000..eba4d986c
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/Makefile.syscalls
@@ -0,0 +1 @@
+../../../../arm/plugins/std/syscalls/Makefile.syscalls \ No newline at end of file
diff --git a/compel/arch/aarch64/plugins/std/syscalls/gen-sys-exec-tbl.pl b/compel/arch/aarch64/plugins/std/syscalls/gen-sys-exec-tbl.pl
new file mode 120000
index 000000000..8d7e897ae
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/gen-sys-exec-tbl.pl
@@ -0,0 +1 @@
+../../../../arm/plugins/std/syscalls/gen-sys-exec-tbl.pl \ No newline at end of file
diff --git a/compel/arch/aarch64/plugins/std/syscalls/gen-syscalls.pl b/compel/arch/aarch64/plugins/std/syscalls/gen-syscalls.pl
new file mode 120000
index 000000000..5c9563611
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/gen-syscalls.pl
@@ -0,0 +1 @@
+../../../../arm/plugins/std/syscalls/gen-syscalls.pl \ No newline at end of file
diff --git a/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S b/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S
new file mode 100644
index 000000000..00ccf79c3
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S
@@ -0,0 +1,37 @@
+/**
+ * This source contains emulation of syscalls
+ * that are not implemented in the AArch64 Linux kernel
+ */
+
+ENTRY(sys_open)
+ mov x3, x2
+ mov x2, x1
+ mov x1, x0
+ mov x0, #-100
+ b sys_openat
+END(sys_open)
+
+
+ENTRY(sys_mkdir)
+ mov x3, x2
+ mov x2, x1
+ mov x1, x0
+ mov x0, #-100
+ b sys_mkdirat
+END(sys_mkdir)
+
+
+ENTRY(sys_rmdir)
+ mov x2, #0x200 // flags = AT_REMOVEDIR
+ mov x1, x0
+ mov x0, #-100
+ b sys_unlinkat
+END(sys_rmdir)
+
+
+ENTRY(sys_unlink)
+ mov x2, #0 // flags = 0
+ mov x1, x0
+ mov x0, #-100
+ b sys_unlinkat
+END(sys_unlink)
diff --git a/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.h b/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.h
new file mode 100644
index 000000000..6272bf3a8
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.h
@@ -0,0 +1,3 @@
+#ifndef __NR_openat
+# define __NR_openat 56
+#endif
diff --git a/compel/arch/aarch64/plugins/std/syscalls/syscall-common.S b/compel/arch/aarch64/plugins/std/syscalls/syscall-common.S
new file mode 100644
index 000000000..aeb89ea88
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/syscall-common.S
@@ -0,0 +1,19 @@
+#include "common/asm/linkage.h"
+
+syscall_common:
+ svc #0
+ ret
+
+
+.macro syscall name, nr
+ ENTRY(\name)
+ mov x8, \nr
+ b syscall_common
+ END(\name)
+.endm
+
+
+ENTRY(__cr_restore_rt)
+ mov x8, __NR_rt_sigreturn
+ svc #0
+END(__cr_restore_rt)
diff --git a/compel/arch/aarch64/plugins/std/syscalls/syscall.def b/compel/arch/aarch64/plugins/std/syscalls/syscall.def
new file mode 120000
index 000000000..ebecde3cb
--- /dev/null
+++ b/compel/arch/aarch64/plugins/std/syscalls/syscall.def
@@ -0,0 +1 @@
+../../../../arm/plugins/std/syscalls/syscall.def \ No newline at end of file