[CRIU] [PATCH 13/44] include/restorer.h: moved machine-dependent sigframe structs to the file arch/x86/include/asm/restorer.h.

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 7 10:04:42 EST 2013


Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/x86/include/asm/restorer.h |   74 +++++++++++++++++++++++++++++++++++++++
 include/restorer.h              |   68 -----------------------------------
 pie/restorer.c                  |    2 ++
 3 files changed, 76 insertions(+), 68 deletions(-)
 create mode 100644 arch/x86/include/asm/restorer.h

diff --git a/arch/x86/include/asm/restorer.h b/arch/x86/include/asm/restorer.h
new file mode 100644
index 0000000..7d8c8aa
--- /dev/null
+++ b/arch/x86/include/asm/restorer.h
@@ -0,0 +1,74 @@
+#ifndef __CR_ASM_RESTORER_H__
+#define __CR_ASM_RESTORER_H__
+
+#include "asm/types.h"
+#include "../protobuf/core.pb-c.h"
+
+struct pt_regs {
+	unsigned long	r15;
+	unsigned long	r14;
+	unsigned long	r13;
+	unsigned long	r12;
+	unsigned long	bp;
+	unsigned long	bx;
+
+	unsigned long	r11;
+	unsigned long	r10;
+	unsigned long	r9;
+	unsigned long	r8;
+	unsigned long	ax;
+	unsigned long	cx;
+	unsigned long	dx;
+	unsigned long	si;
+	unsigned long	di;
+	unsigned long	orig_ax;
+
+	unsigned long	ip;
+	unsigned long	cs;
+	unsigned long	flags;
+	unsigned long	sp;
+	unsigned long	ss;
+};
+
+struct rt_sigcontext {
+	unsigned long			r8;
+	unsigned long			r9;
+	unsigned long			r10;
+	unsigned long			r11;
+	unsigned long			r12;
+	unsigned long			r13;
+	unsigned long			r14;
+	unsigned long			r15;
+	unsigned long			rdi;
+	unsigned long			rsi;
+	unsigned long			rbp;
+	unsigned long			rbx;
+	unsigned long			rdx;
+	unsigned long			rax;
+	unsigned long			rcx;
+	unsigned long			rsp;
+	unsigned long			rip;
+	unsigned long			eflags;
+	unsigned short			cs;
+	unsigned short			gs;
+	unsigned short			fs;
+	unsigned short			__pad0;
+	unsigned long			err;
+	unsigned long			trapno;
+	unsigned long			oldmask;
+	unsigned long			cr2;
+	void				*fpstate;
+	unsigned long			reserved1[8];
+};
+
+#include "sigframe.h"
+
+struct rt_sigframe {
+	char			*pretcode;
+	struct rt_ucontext	uc;
+	struct rt_siginfo	info;
+
+	/* fp state follows here */
+};
+
+#endif
diff --git a/include/restorer.h b/include/restorer.h
index 07742ba..0ded111 100644
--- a/include/restorer.h
+++ b/include/restorer.h
@@ -127,74 +127,6 @@ struct task_restore_core_args {
 	int				rst_tcp_socks_size;
 } __aligned(sizeof(long));
 
-struct pt_regs {
-	unsigned long	r15;
-	unsigned long	r14;
-	unsigned long	r13;
-	unsigned long	r12;
-	unsigned long	bp;
-	unsigned long	bx;
-
-	unsigned long	r11;
-	unsigned long	r10;
-	unsigned long	r9;
-	unsigned long	r8;
-	unsigned long	ax;
-	unsigned long	cx;
-	unsigned long	dx;
-	unsigned long	si;
-	unsigned long	di;
-	unsigned long	orig_ax;
-
-	unsigned long	ip;
-	unsigned long	cs;
-	unsigned long	flags;
-	unsigned long	sp;
-	unsigned long	ss;
-};
-
-struct rt_sigcontext {
-	unsigned long			r8;
-	unsigned long			r9;
-	unsigned long			r10;
-	unsigned long			r11;
-	unsigned long			r12;
-	unsigned long			r13;
-	unsigned long			r14;
-	unsigned long			r15;
-	unsigned long			rdi;
-	unsigned long			rsi;
-	unsigned long			rbp;
-	unsigned long			rbx;
-	unsigned long			rdx;
-	unsigned long			rax;
-	unsigned long			rcx;
-	unsigned long			rsp;
-	unsigned long			rip;
-	unsigned long			eflags;
-	unsigned short			cs;
-	unsigned short			gs;
-	unsigned short			fs;
-	unsigned short			__pad0;
-	unsigned long			err;
-	unsigned long			trapno;
-	unsigned long			oldmask;
-	unsigned long			cr2;
-	void				*fpstate;;
-	unsigned long			reserved1[8];
-};
-
-#include "sigframe.h"
-
-struct rt_sigframe {
-	char			*pretcode;
-	struct rt_ucontext	uc;
-	struct rt_siginfo	info;
-
-	/* fp state follows here */
-};
-
-
 #define SHMEMS_SIZE	4096
 
 /*
diff --git a/pie/restorer.c b/pie/restorer.c
index 337577a..8b011a8 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -27,6 +27,8 @@
 
 #include "creds.pb-c.h"
 
+#include "asm/restorer.h"
+
 #define sys_prctl_safe(opcode, val1, val2, val3)			\
 	({								\
 		long __ret = sys_prctl(opcode, val1, val2, val3, 0);	\
-- 
1.7.10.4



More information about the CRIU mailing list