[CRIU] [PATCH 01/11] x86: Use uint_x types in rt_sigcontext

Cyrill Gorcunov gorcunov at gmail.com
Thu Jun 14 20:27:20 MSK 2018


To be close to the kernel code.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 .../arch/x86/src/lib/include/uapi/asm/sigframe.h   | 56 +++++++++++-----------
 compel/arch/x86/src/lib/infect.c                   |  2 +-
 criu/arch/x86/sigframe.c                           |  2 +-
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
index 3260d9c162ae..0ad45a539bf7 100644
--- a/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
+++ b/compel/arch/x86/src/lib/include/uapi/asm/sigframe.h
@@ -10,34 +10,34 @@
 #define SIGFRAME_MAX_OFFSET 8
 
 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];
+	uint64_t			r8;
+	uint64_t			r9;
+	uint64_t			r10;
+	uint64_t			r11;
+	uint64_t			r12;
+	uint64_t			r13;
+	uint64_t			r14;
+	uint64_t			r15;
+	uint64_t			rdi;
+	uint64_t			rsi;
+	uint64_t			rbp;
+	uint64_t			rbx;
+	uint64_t			rdx;
+	uint64_t			rax;
+	uint64_t			rcx;
+	uint64_t			rsp;
+	uint64_t			rip;
+	uint64_t			eflags;
+	uint16_t			cs;
+	uint16_t			gs;
+	uint16_t			fs;
+	uint16_t			ss;
+	uint64_t			err;
+	uint64_t			trapno;
+	uint64_t			oldmask;
+	uint64_t			cr2;
+	uint64_t			fpstate;
+	uint64_t			reserved1[8];
 };
 
 struct rt_sigcontext_32 {
diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index 85c93ad8aeee..9cb5d82eb4d2 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -212,7 +212,7 @@ int sigreturn_prep_fpu_frame_plain(struct rt_sigframe *sigframe,
 			return -1;
 		}
 
-		sigframe->native.uc.uc_mcontext.fpstate = (void *)addr;
+		sigframe->native.uc.uc_mcontext.fpstate = (uint64_t)addr;
 	} else if (!sigframe->is_native) {
 		sigframe->compat.uc.uc_mcontext.fpstate =
 			(uint32_t)(unsigned long)(void *)&fpu_state->fpu_state_ia32;
diff --git a/criu/arch/x86/sigframe.c b/criu/arch/x86/sigframe.c
index 89bfa4a0b7a8..11b0d640de2d 100644
--- a/criu/arch/x86/sigframe.c
+++ b/criu/arch/x86/sigframe.c
@@ -26,7 +26,7 @@ int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
 			return -1;
 		}
 
-		sigframe->native.uc.uc_mcontext.fpstate = (void *)addr;
+		sigframe->native.uc.uc_mcontext.fpstate = (uint64_t)addr;
 	} else if (!sigframe->is_native) {
 		sigframe->compat.uc.uc_mcontext.fpstate =
 			(uint32_t)(unsigned long)(void *)&fpu_state->fpu_state_ia32;
-- 
2.14.4



More information about the CRIU mailing list