[CRIU] [PATCH] ppc64: Fix build regressions

Laurent Dufour ldufour at linux.vnet.ibm.com
Mon Mar 21 09:20:25 PDT 2016


The build on powerPC has been broken when doing some code cleanup
recently.

This patch fixes these regressions.

Fixes: f8a1a1d8d95e ("parasite-syscall: get rid of code_syscall{,size} globals")
Fixes: 69d88241584e ("sigframe: move setup_sas & make it inliner")
Cc: Dmitry Safonov <dsafonov at virtuozzo.com>
Signed-off-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>
---
 criu/arch/ppc64/crtools.c              |  2 +-
 criu/arch/ppc64/include/asm/restorer.h |  2 +-
 criu/sigframe.c                        | 11 ++++++-----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/criu/arch/ppc64/crtools.c b/criu/arch/ppc64/crtools.c
index 7d039a0b2ded..77e4146bc320 100644
--- a/criu/arch/ppc64/crtools.c
+++ b/criu/arch/ppc64/crtools.c
@@ -78,7 +78,7 @@ int syscall_seized(struct parasite_ctl *ctl, int nr, unsigned long *ret,
 	regs.gpr[7] = arg5;
 	regs.gpr[8] = arg6;
 
-	err = __parasite_execute_syscall(ctl, &regs, code_syscall);
+	err = __parasite_execute_syscall(ctl, &regs, (char*)code_syscall);
 
 	*ret = regs.gpr[3];
 	return err;
diff --git a/criu/arch/ppc64/include/asm/restorer.h b/criu/arch/ppc64/include/asm/restorer.h
index f6b9291c347d..1400ff3463ea 100644
--- a/criu/arch/ppc64/include/asm/restorer.h
+++ b/criu/arch/ppc64/include/asm/restorer.h
@@ -101,7 +101,7 @@ struct rt_sigframe {
 		  "r"(&thread_args[i])		/* %6 */		\
 		: "memory","0","3","4","5","6","7","14","15")
 
-#define RT_SIGFRAME_UC(rt_sigframe) (&rt_sigframe->uc)
+#define RT_SIGFRAME_UC(rt_sigframe) (&(rt_sigframe)->uc)
 #define RT_SIGFRAME_REGIP(rt_sigframe) ((long unsigned int)(rt_sigframe)->uc.uc_mcontext.gp_regs[PT_NIP])
 #define RT_SIGFRAME_HAS_FPU(rt_sigframe) (1)
 #define RT_SIGFRAME_FPU(rt_sigframe) ((rt_sigframe)->uc.uc_mcontext)
diff --git a/criu/sigframe.c b/criu/sigframe.c
index a99fb0b533cd..2a220ce5dfba 100644
--- a/criu/sigframe.c
+++ b/criu/sigframe.c
@@ -9,11 +9,12 @@
 static inline void setup_sas(struct rt_sigframe* sigframe, ThreadSasEntry *sas)
 {
 	if (sas) {
-		struct rt_ucontext *uc	= RT_SIGFRAME_UC(sigframe);
+#define UC	RT_SIGFRAME_UC(sigframe)
 
-		uc->uc_stack.ss_sp	= (void *)decode_pointer((sas)->ss_sp);
-		uc->uc_stack.ss_flags	= (int)(sas)->ss_flags;
-		uc->uc_stack.ss_size	= (size_t)(sas)->ss_size;
+		UC->uc_stack.ss_sp	= (void *)decode_pointer((sas)->ss_sp);
+		UC->uc_stack.ss_flags	= (int)(sas)->ss_flags;
+		UC->uc_stack.ss_size	= (size_t)(sas)->ss_size;
+#undef UC
 	}
 }
 
@@ -21,7 +22,7 @@ int construct_sigframe(struct rt_sigframe *sigframe,
 				     struct rt_sigframe *rsigframe,
 				     CoreEntry *core)
 {
-	k_rtsigset_t *blk_sigset = &RT_SIGFRAME_UC(sigframe)->uc_sigmask;
+	k_rtsigset_t *blk_sigset = (k_rtsigset_t*)&RT_SIGFRAME_UC(sigframe)->uc_sigmask;
 
 	if (core->tc)
 		memcpy(blk_sigset, &core->tc->blk_sigset, sizeof(k_rtsigset_t));
-- 
1.9.1



More information about the CRIU mailing list