[CRIU] [PATCH 29/38] compel: Move fpu.h into compel

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 11 09:04:19 PDT 2016


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 .../arch/aarch64/src/lib/include/compel}/asm/fpu.h |   0
 .../arch/arm/src/lib/include/compel}/asm/fpu.h     |   0
 .../arch/ppc64/src/lib/include/compel}/asm/fpu.h   |   0
 .../arch/x86/src/lib/include/compel}/asm/fpu.h     |   2 -
 criu/arch/aarch64/restorer.c                       |   2 +-
 criu/arch/arm/restorer.c                           |   2 +-
 criu/arch/ppc64/crtools.c                          |   2 +-
 criu/arch/ppc64/restorer.c                         |   2 +-
 criu/arch/x86/cpu.c                                |   2 +-
 criu/arch/x86/crtools.c                            |   2 +-
 criu/arch/x86/include/asm/restorer.h               | 103 +--------------------
 criu/arch/x86/restorer.c                           |   2 +-
 criu/arch/x86/sigaction_compat.c                   |   2 +-
 criu/include/restorer.h                            |   2 +-
 14 files changed, 10 insertions(+), 113 deletions(-)
 rename {criu/arch/ppc64/include => compel/arch/aarch64/src/lib/include/compel}/asm/fpu.h (100%)
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/compel}/asm/fpu.h (100%)
 rename {criu/arch/aarch64/include => compel/arch/ppc64/src/lib/include/compel}/asm/fpu.h (100%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/compel}/asm/fpu.h (97%)

diff --git a/criu/arch/ppc64/include/asm/fpu.h b/compel/arch/aarch64/src/lib/include/compel/asm/fpu.h
similarity index 100%
rename from criu/arch/ppc64/include/asm/fpu.h
rename to compel/arch/aarch64/src/lib/include/compel/asm/fpu.h
diff --git a/criu/arch/arm/include/asm/fpu.h b/compel/arch/arm/src/lib/include/compel/asm/fpu.h
similarity index 100%
rename from criu/arch/arm/include/asm/fpu.h
rename to compel/arch/arm/src/lib/include/compel/asm/fpu.h
diff --git a/criu/arch/aarch64/include/asm/fpu.h b/compel/arch/ppc64/src/lib/include/compel/asm/fpu.h
similarity index 100%
rename from criu/arch/aarch64/include/asm/fpu.h
rename to compel/arch/ppc64/src/lib/include/compel/asm/fpu.h
diff --git a/criu/arch/x86/include/asm/fpu.h b/compel/arch/x86/src/lib/include/compel/asm/fpu.h
similarity index 97%
rename from criu/arch/x86/include/asm/fpu.h
rename to compel/arch/x86/src/lib/include/compel/asm/fpu.h
index c9337d00b59a..dbfa739a1e2c 100644
--- a/criu/arch/x86/include/asm/fpu.h
+++ b/compel/arch/x86/src/lib/include/compel/asm/fpu.h
@@ -1,8 +1,6 @@
 #ifndef __CR_ASM_FPU_H__
 #define __CR_ASM_FPU_H__
 
-#include <sys/types.h>
-#include <stdbool.h>
 #include <stdint.h>
 
 #include "compiler.h"
diff --git a/criu/arch/aarch64/restorer.c b/criu/arch/aarch64/restorer.c
index 8a206315ddc0..481faa20fb08 100644
--- a/criu/arch/aarch64/restorer.c
+++ b/criu/arch/aarch64/restorer.c
@@ -6,7 +6,7 @@
 
 #include "uapi/std/syscall.h"
 #include "log.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "cpu.h"
 
 int restore_nonsigframe_gpregs(UserRegsEntry *r)
diff --git a/criu/arch/arm/restorer.c b/criu/arch/arm/restorer.c
index ea9ae680547a..2241d9cfc09d 100644
--- a/criu/arch/arm/restorer.c
+++ b/criu/arch/arm/restorer.c
@@ -6,7 +6,7 @@
 
 #include "uapi/std/syscall.h"
 #include "log.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "cpu.h"
 
 int restore_nonsigframe_gpregs(UserArmRegsEntry *r)
diff --git a/criu/arch/ppc64/crtools.c b/criu/arch/ppc64/crtools.c
index 967817b7db8f..ef0e6be19990 100644
--- a/criu/arch/ppc64/crtools.c
+++ b/criu/arch/ppc64/crtools.c
@@ -6,7 +6,7 @@
 #include <sys/uio.h>
 
 #include "asm/types.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "asm/restorer.h"
 #include "asm/dump.h"
 
diff --git a/criu/arch/ppc64/restorer.c b/criu/arch/ppc64/restorer.c
index 3f0aff87a5d4..70be38476f65 100644
--- a/criu/arch/ppc64/restorer.c
+++ b/criu/arch/ppc64/restorer.c
@@ -2,7 +2,7 @@
 
 #include "restorer.h"
 #include "asm/restorer.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 
 #include "uapi/std/syscall.h"
 #include "log.h"
diff --git a/criu/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index c60d3c2581c0..ac96888daa3e 100644
--- a/criu/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
@@ -9,7 +9,7 @@
 #include "asm/bitops.h"
 #include "asm/types.h"
 #include "asm/cpu.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 
 #include "compiler.h"
 
diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index 08ada7f665eb..60b1e09cd7fa 100644
--- a/criu/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
@@ -10,7 +10,7 @@
 #include "asm/parasite-syscall.h"
 #include "asm/restorer.h"
 #include "asm/types.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "asm/dump.h"
 
 #include "cr_options.h"
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index a10f3c9d9c88..944c54751ed9 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -2,95 +2,12 @@
 #define __CR_ASM_RESTORER_H__
 
 #include "asm/types.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "images/core.pb-c.h"
 #include "uapi/std/syscall-codes.h"
 
-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			ss;
-	unsigned long			err;
-	unsigned long			trapno;
-	unsigned long			oldmask;
-	unsigned long			cr2;
-	void				*fpstate;
-	unsigned long			reserved1[8];
-};
-
-struct rt_sigcontext_32 {
-	u32				gs;
-	u32				fs;
-	u32				es;
-	u32				ds;
-	u32				di;
-	u32				si;
-	u32				bp;
-	u32				sp;
-	u32				bx;
-	u32				dx;
-	u32				cx;
-	u32				ax;
-	u32				trapno;
-	u32				err;
-	u32				ip;
-	u32				cs;
-	u32				flags;
-	u32				sp_at_signal;
-	u32				ss;
-
-	u32				fpstate;
-	u32				oldmask;
-	u32				cr2;
-};
-
-#define SIGFRAME_MAX_OFFSET 8
-
 #include "sigframe.h"
 
-/*
- * XXX: move declarations to generic sigframe.h or sigframe-compat.h
- *      when (if) other architectures will support compatible C/R
- */
-
-typedef u32			compat_uptr_t;
-typedef u32			compat_size_t;
-typedef u32			compat_sigset_word;
-
-#define _COMPAT_NSIG		64
-#define _COMPAT_NSIG_BPW	32
-#define _COMPAT_NSIG_WORDS	(_COMPAT_NSIG / _COMPAT_NSIG_BPW)
-
-typedef struct {
-	compat_sigset_word	sig[_COMPAT_NSIG_WORDS];
-} compat_sigset_t;
-
-typedef struct compat_siginfo {
-	int	si_signo;
-	int	si_errno;
-	int	si_code;
-	int	_pad[128/sizeof(int) - 3];
-} compat_siginfo_t;
-
 #ifdef CONFIG_COMPAT
 static inline void __always_unused __check_compat_sigset_t(void)
 {
@@ -112,24 +29,6 @@ static inline int
 arch_compat_rt_sigaction(void *stack, int sig, void *act) { return -1; }
 #endif
 
-#ifdef CONFIG_X86_32
-# define rt_sigframe_ia32	rt_sigframe
-#endif
-
-typedef struct compat_sigaltstack {
-	compat_uptr_t		ss_sp;
-	int			ss_flags;
-	compat_size_t		ss_size;
-} compat_stack_t;
-
-struct ucontext_ia32 {
-	unsigned int		uc_flags;
-	unsigned int		uc_link;
-	compat_stack_t		uc_stack;
-	struct rt_sigcontext_32	uc_mcontext;
-	k_rtsigset_t		uc_sigmask; /* mask last for extensibility */
-};
-
 struct rt_sigframe_ia32 {
 	u32			pretcode;
 	s32			sig;
diff --git a/criu/arch/x86/restorer.c b/criu/arch/x86/restorer.c
index 0c0725147250..e5978d331d1c 100644
--- a/criu/arch/x86/restorer.c
+++ b/criu/arch/x86/restorer.c
@@ -3,7 +3,7 @@
 
 #include "restorer.h"
 #include "asm/restorer.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "asm/string.h"
 
 #include "uapi/std/syscall.h"
diff --git a/criu/arch/x86/sigaction_compat.c b/criu/arch/x86/sigaction_compat.c
index 214b2058bf63..e38a7aebd8d1 100644
--- a/criu/arch/x86/sigaction_compat.c
+++ b/criu/arch/x86/sigaction_compat.c
@@ -1,5 +1,5 @@
 #include "asm/restorer.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "asm/string.h"
 
 #include <sys/mman.h>
diff --git a/criu/include/restorer.h b/criu/include/restorer.h
index c74d25fdd908..f1a94f67a4af 100644
--- a/criu/include/restorer.h
+++ b/criu/include/restorer.h
@@ -7,7 +7,7 @@
 
 #include "compiler.h"
 #include "asm/types.h"
-#include "asm/fpu.h"
+#include "compel/asm/fpu.h"
 #include "lock.h"
 #include "util.h"
 #include "asm/restorer.h"
-- 
2.7.4



More information about the CRIU mailing list