[CRIU] [PATCH 07/23] restorer: introduced the macro SIGFRAME_OFFSET

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 14 02:20:01 EST 2013


The macro is designated to tune the beginning of a sigframe on different architectures.
---
 arch/x86/include/asm/restorer.h |    2 ++
 pie/restorer.c                  |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/restorer.h b/arch/x86/include/asm/restorer.h
index d6349f4..08b53ca 100644
--- a/arch/x86/include/asm/restorer.h
+++ b/arch/x86/include/asm/restorer.h
@@ -131,6 +131,8 @@ struct rt_sigframe {
 
 #define RT_SIGFRAME_UC(rt_sigframe) rt_sigframe->uc
 
+#define SIGFRAME_OFFSET 8
+
 
 int restore_gpregs(struct rt_sigframe *f, UserX86RegsEntry *r);
 
diff --git a/pie/restorer.c b/pie/restorer.c
index 73fa0ef..4320f27 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -210,7 +210,7 @@ long __export_restore_thread(struct thread_restore_args *args)
 
 	futex_dec_and_wake(&thread_inprogress);
 
-	new_sp = (long)rt_sigframe + 8;
+	new_sp = (long)rt_sigframe + SIGFRAME_OFFSET;
 	ARCH_RT_SIGRETURN(new_sp);
 
 core_restore_end:
@@ -715,7 +715,7 @@ long __export_restore_task(struct task_restore_core_args *args)
 	/*
 	 * Sigframe stack.
 	 */
-	new_sp = (long)rt_sigframe + 8;
+	new_sp = (long)rt_sigframe + SIGFRAME_OFFSET;
 
 	/*
 	 * Prepare the stack and call for sigreturn,
-- 
1.7.10.4



More information about the CRIU mailing list