[CRIU] [PATCH 10/19] compel: plugins,std -- Add prologue.S

Cyrill Gorcunov gorcunov at openvz.org
Wed Sep 21 13:54:25 PDT 2016


From: Dmitry Safonov <dsafonov at virtuozzo.com>

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 compel/arch/x86/plugins/std/prologue.S | 33 +++++++++++++++++++++++++++++++++
 compel/plugins/Makefile                |  2 ++
 2 files changed, 35 insertions(+)
 create mode 100644 compel/arch/x86/plugins/std/prologue.S

diff --git a/compel/arch/x86/plugins/std/prologue.S b/compel/arch/x86/plugins/std/prologue.S
new file mode 100644
index 000000000000..62e51c64dc43
--- /dev/null
+++ b/compel/arch/x86/plugins/std/prologue.S
@@ -0,0 +1,33 @@
+#include "asm/linkage.h"
+#include "asm/prologue.h"
+
+#include "uapi/std/syscall-codes.h"
+
+	.section .compel.prologue.text, "ax"
+ENTRY(__export_std_prologue_start)
+	push	%rsp
+
+	leaq	__export_std_prologue_init_args(%rip), %rdi
+	movq	__export_std_plugin_begin(%rip), %rsi
+	movq	__export_std_plugin_size(%rip), %rdx
+	call	__export_std_compel_start
+
+do_rt_sigreturn:
+	leaq	__export_std_prologue_sigframe(%rip), %rax
+	addq	$8, %rax
+	movq	%rax, %rsp			# we can't use sys_rt_sigreturn here
+	mov	$__NR_rt_sigreturn, %eax	# because we're adjusting stack
+	syscall
+
+GLOBAL(__export_std_prologue_init_args)
+	.space PROLOGUE_INIT_ARGS_SIZE, 0
+
+GLOBAL(__export_std_plugin_begin)
+	.space 8, 0
+GLOBAL(__export_std_plugin_size)
+	.space 8, 0
+
+	.align 64
+GLOBAL(__export_std_prologue_sigframe)
+	.space PROLOGUE_SGFRAME_SIZE, 0
+END(__export_std_prologue_start)
diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index d25829a90cf0..3743f3a9ca29 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -8,6 +8,7 @@ ccflags-y		+= -iquote $(SRC_DIR)/compel/include
 # General compel/plugins includes
 ccflags-y		+= -iquote $(obj)/include
 ccflags-y		+= -iquote $(obj)/include/uapi
+asflags-y		+= -iquote $(obj)/include
 asflags-y		+= -iquote $(obj)/include/uapi
 
 # Arch compel/plugins includes
@@ -27,6 +28,7 @@ std-obj-y		+= std/std.o
 std-obj-y		+= std/string.o
 std-obj-y		+= ./$(ARCH_DIR)/std/syscalls-64.o
 std-obj-y		+= ./$(ARCH_DIR)/std/call32.o
+std-obj-y		+= ./$(ARCH_DIR)/std/prologue.o
 
 sys-proto-generic	:= $(obj)/include/uapi/std/syscall.h
 sys-codes-generic	:= $(obj)/include/uapi/std/syscall-codes.h
-- 
2.7.4



More information about the CRIU mailing list