[CRIU] [PATCH 3/4] parasite: add macro for getting arch-dependent orig_ax regisister
Chanho Park
chanho61.park at samsung.com
Thu May 30 05:18:07 EDT 2013
The orig_ax register is only for x86/x64. ARM has an alternative name for it.
Signed-off-by: Chanho Park <chanho61.park at samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham at samsung.com>
---
arch/arm/include/asm/types.h | 1 +
arch/x86/include/asm/types.h | 1 +
parasite-syscall.c | 5 +++--
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 2e5fa9c..c28921f 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -209,6 +209,7 @@ typedef struct {
#define REG_RES(regs) ((regs).ARM_r0)
#define REG_IP(regs) ((regs).ARM_pc)
+#define REG_ORIG_RES(regs) ((regs).ARM_ORIG_r0)
#define TASK_SIZE 0xbf000000
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index e7b0e2d..9e66d87 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -237,6 +237,7 @@ typedef uint64_t auxv_t;
#define REG_RES(regs) ((regs).ax)
#define REG_IP(regs) ((regs).ip)
+#define REG_ORIG_RES(regs) ((regs).orig_ax)
#define CORE_ENTRY__MARCH CORE_ENTRY__MARCH__X86_64
diff --git a/parasite-syscall.c b/parasite-syscall.c
index 61d159f..c19c5dc 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -872,8 +872,9 @@ static int parasite_fini_seized(struct parasite_ctl *ctl)
return -1;
}
- pr_debug("%d is going to execute the syscall %lx\n", pid, regs.orig_ax);
- if (regs.orig_ax == __NR_rt_sigreturn) {
+ pr_debug("%d is going to execute the syscall %lx\n", pid,
+ REG_ORIG_RES(regs));
+ if (REG_ORIG_RES(regs) == __NR_rt_sigreturn) {
pr_debug("%d was stopped\n", pid);
break;
}
--
1.7.9.5
More information about the CRIU
mailing list