[CRIU] [PATCH 38/38] compel: types -- Move into ARCH_SI_TRAP and __NR helpers

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


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 compel/arch/aarch64/src/lib/include/compel/asm/types.h |  4 ++++
 compel/arch/arm/src/lib/include/compel/asm/types.h     |  4 ++++
 compel/arch/ppc64/src/lib/include/compel/asm/types.h   |  4 ++++
 compel/arch/x86/src/lib/include/compel/asm/types.h     | 12 ++++++++++++
 criu/arch/aarch64/include/asm/parasite-syscall.h       |  4 ----
 criu/arch/arm/include/asm/parasite-syscall.h           |  4 ----
 criu/arch/ppc64/include/asm/parasite-syscall.h         |  4 ----
 criu/arch/x86/include/asm/parasite-syscall.h           | 13 -------------
 8 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/compel/arch/aarch64/src/lib/include/compel/asm/types.h b/compel/arch/aarch64/src/lib/include/compel/asm/types.h
index 31011f26187d..ed00c68d6c9d 100644
--- a/compel/arch/aarch64/src/lib/include/compel/asm/types.h
+++ b/compel/arch/aarch64/src/lib/include/compel/asm/types.h
@@ -52,4 +52,8 @@ static inline unsigned long task_size(void)
 typedef uint64_t auxv_t;
 typedef uint64_t tls_t;
 
+#define ARCH_SI_TRAP		TRAP_BRKPT
+
+#define __NR(syscall, compat)	__NR_##syscall
+
 #endif /* COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/arm/src/lib/include/compel/asm/types.h b/compel/arch/arm/src/lib/include/compel/asm/types.h
index e02cd89f20ff..0f16e77a967a 100644
--- a/compel/arch/arm/src/lib/include/compel/asm/types.h
+++ b/compel/arch/arm/src/lib/include/compel/asm/types.h
@@ -85,4 +85,8 @@ static inline unsigned long task_size(void)
 typedef uint32_t auxv_t;
 typedef uint32_t tls_t;
 
+#define ARCH_SI_TRAP		TRAP_BRKPT
+
+#define __NR(syscall, compat)	__NR_##syscall
+
 #endif /* COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/ppc64/src/lib/include/compel/asm/types.h b/compel/arch/ppc64/src/lib/include/compel/asm/types.h
index ae8e0b440aae..04503141b927 100644
--- a/compel/arch/ppc64/src/lib/include/compel/asm/types.h
+++ b/compel/arch/ppc64/src/lib/include/compel/asm/types.h
@@ -92,4 +92,8 @@ typedef uint64_t tls_t;
 
 static inline unsigned long task_size(void) { return TASK_SIZE; }
 
+#define ARCH_SI_TRAP TRAP_BRKPT
+
+#define __NR(syscall, compat)	__NR_##syscall
+
 #endif /* COMPEL_ASM_TYPES_H__ */
diff --git a/compel/arch/x86/src/lib/include/compel/asm/types.h b/compel/arch/x86/src/lib/include/compel/asm/types.h
index 2d25eef1ae2d..94e0b8250b2b 100644
--- a/compel/arch/x86/src/lib/include/compel/asm/types.h
+++ b/compel/arch/x86/src/lib/include/compel/asm/types.h
@@ -146,4 +146,16 @@ typedef struct {
 
 #define AT_VECTOR_SIZE 44
 
+#define __NR(syscall, compat)	((compat) ? __NR32_##syscall : __NR_##syscall)
+
+/*
+ * For x86_32 __NR_mmap inside the kernel represents old_mmap system
+ * call, but since we didn't use it yet lets go further and simply
+ * define own alias for __NR_mmap2 which would allow us to unify code
+ * between 32 and 64 bits version.
+ */
+#define __NR32_mmap __NR32_mmap2
+
+#define ARCH_SI_TRAP SI_KERNEL
+
 #endif /* COMPEL_ASM_TYPES_H__ */
diff --git a/criu/arch/aarch64/include/asm/parasite-syscall.h b/criu/arch/aarch64/include/asm/parasite-syscall.h
index 7a5591ad5c7c..c60cbae72ce5 100644
--- a/criu/arch/aarch64/include/asm/parasite-syscall.h
+++ b/criu/arch/aarch64/include/asm/parasite-syscall.h
@@ -3,10 +3,6 @@
 
 struct parasite_ctl;
 
-#define ARCH_SI_TRAP TRAP_BRKPT
-
-#define __NR(syscall, compat)	__NR_##syscall
-
 void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs);
 
 void *mmap_seized(struct parasite_ctl *ctl,
diff --git a/criu/arch/arm/include/asm/parasite-syscall.h b/criu/arch/arm/include/asm/parasite-syscall.h
index a9defef14107..717f4fa8b265 100644
--- a/criu/arch/arm/include/asm/parasite-syscall.h
+++ b/criu/arch/arm/include/asm/parasite-syscall.h
@@ -2,10 +2,6 @@
 #define __CR_ASM_PARASITE_SYSCALL_H__
 
 
-#define ARCH_SI_TRAP TRAP_BRKPT
-
-#define __NR(syscall, compat)	__NR_##syscall
-
 void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs);
 
 void *mmap_seized(struct parasite_ctl *ctl,
diff --git a/criu/arch/ppc64/include/asm/parasite-syscall.h b/criu/arch/ppc64/include/asm/parasite-syscall.h
index 7a5591ad5c7c..c60cbae72ce5 100644
--- a/criu/arch/ppc64/include/asm/parasite-syscall.h
+++ b/criu/arch/ppc64/include/asm/parasite-syscall.h
@@ -3,10 +3,6 @@
 
 struct parasite_ctl;
 
-#define ARCH_SI_TRAP TRAP_BRKPT
-
-#define __NR(syscall, compat)	__NR_##syscall
-
 void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs);
 
 void *mmap_seized(struct parasite_ctl *ctl,
diff --git a/criu/arch/x86/include/asm/parasite-syscall.h b/criu/arch/x86/include/asm/parasite-syscall.h
index cbc0442dd722..75fa49736309 100644
--- a/criu/arch/x86/include/asm/parasite-syscall.h
+++ b/criu/arch/x86/include/asm/parasite-syscall.h
@@ -5,19 +5,6 @@
 
 struct parasite_ctl;
 
-#define ARCH_SI_TRAP SI_KERNEL
-
-#define __NR(syscall, compat)	((compat) ? __NR32_##syscall : __NR_##syscall)
-
-/*
- * For x86_32 __NR_mmap inside the kernel represents old_mmap system
- * call, but since we didn't use it yet lets go further and simply
- * define own alias for __NR_mmap2 which would allow us to unify code
- * between 32 and 64 bits version.
- */
-#define __NR32_mmap __NR32_mmap2
-
-
 void parasite_setup_regs(unsigned long new_ip, void *stack, user_regs_struct_t *regs);
 
 void *mmap_seized(struct parasite_ctl *ctl,
-- 
2.7.4



More information about the CRIU mailing list