[CRIU] [PATCH 4/4] parasite: add macro for getting IP register
Alexander Kartashov
alekskartashov at parallels.com
Thu May 30 05:35:21 EDT 2013
On 05/30/2013 01:18 PM, Chanho Park wrote:
> 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);
Acked-by: Alexander Kartashov <alekskartashov at parallels.com>
--
Sincerely yours,
Alexander Kartashov
Intern
Core team
www.parallels.com
Skype: aleksandr.kartashov
Email: alekskartashov at parallels.com
More information about the CRIU
mailing list