[CRIU] [PATCH 4/4] parasite: add macro for getting IP register

Chanho Park chanho61.park at samsung.com
Thu May 30 05:18:08 EDT 2013


This patch adds macro for getting IP register which differs according to
architecture.

Signed-off-by: Chanho Park <chanho61.park at samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham at samsung.com>
---
 arch/arm/include/asm/restorer.h |    1 +
 arch/x86/include/asm/restorer.h |    1 +
 pie/parasite.c                  |    2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/restorer.h b/arch/arm/include/asm/restorer.h
index 11377e0..92db831 100644
--- a/arch/arm/include/asm/restorer.h
+++ b/arch/arm/include/asm/restorer.h
@@ -124,6 +124,7 @@ struct rt_sigframe {
 
 
 #define RT_SIGFRAME_UC(rt_sigframe) rt_sigframe->sig.uc
+#define RT_SIGFRAME_REGIP(rt_sigframe) (rt_sigframe)->sig.uc.uc_mcontext.arm_ip
 
 #define SIGFRAME_OFFSET 0
 
diff --git a/arch/x86/include/asm/restorer.h b/arch/x86/include/asm/restorer.h
index 253cc39..70bdf0a 100644
--- a/arch/x86/include/asm/restorer.h
+++ b/arch/x86/include/asm/restorer.h
@@ -131,6 +131,7 @@ struct rt_sigframe {
 		     : "memory")
 
 #define RT_SIGFRAME_UC(rt_sigframe) rt_sigframe->uc
+#define RT_SIGFRAME_REGIP(rt_sigframe) (rt_sigframe)->uc.uc_mcontext.rip
 
 #define SIGFRAME_OFFSET 8
 
diff --git a/pie/parasite.c b/pie/parasite.c
index 513a851..d6c6706 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -441,7 +441,7 @@ static int fini()
 
 	new_sp = (long)sigframe + SIGFRAME_OFFSET;
 	pr_debug("%ld: new_sp=%lx ip %lx\n", sys_gettid(),
-		  new_sp, sigframe->uc.uc_mcontext.rip);
+		  new_sp, RT_SIGFRAME_REGIP(sigframe));
 
 	sys_close(tsock);
 	log_set_fd(-1);
-- 
1.7.9.5



More information about the CRIU mailing list