[CRIU] [PATCH 07/22] include/restorer.h: moved machine-independent sigframe structs to the file include/sigframe.h

Pavel Emelyanov xemul at parallels.com
Fri Dec 28 03:51:26 EST 2012


On 12/27/2012 10:50 AM, Alexander Kartashov wrote:
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> ---
>  include/restorer.h |   30 ------------------------------
>  include/sigframe.h |   38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 38 insertions(+), 30 deletions(-)
>  create mode 100644 include/sigframe.h
> 
> diff --git a/include/restorer.h b/include/restorer.h
> index 97e9958..a603b4d 100644
> --- a/include/restorer.h
> +++ b/include/restorer.h
> @@ -188,36 +188,6 @@ struct rt_sigcontext {
>  	unsigned long			reserved1[8];
>  };

Not git-bisect safe, there should be the "#include <sigframe.h>" line added
somewhere in the code.

>  
> -#ifndef __ARCH_SI_PREAMBLE_SIZE
> -#define __ARCH_SI_PREAMBLE_SIZE	(3 * sizeof(int))
> -#endif
> -
> -#define SI_MAX_SIZE	128
> -#ifndef SI_PAD_SIZE
> -#define SI_PAD_SIZE	((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
> -#endif
> -
> -typedef struct rt_siginfo {
> -	int	si_signo;
> -	int	si_errno;
> -	int	si_code;
> -	int	_pad[SI_PAD_SIZE];
> -} rt_siginfo_t;
> -
> -typedef struct rt_sigaltstack {
> -	void	*ss_sp;
> -	int	ss_flags;
> -	size_t	ss_size;
> -} rt_stack_t;
> -
> -struct rt_ucontext {
> -	unsigned long		uc_flags;
> -	struct rt_ucontext	*uc_link;
> -	rt_stack_t		uc_stack;
> -	struct rt_sigcontext	uc_mcontext;
> -	rt_sigset_t		uc_sigmask;	/* mask last for extensibility */
> -};
> -
>  struct rt_sigframe {
>  	char			*pretcode;
>  	struct rt_ucontext	uc;
> diff --git a/include/sigframe.h b/include/sigframe.h
> new file mode 100644
> index 0000000..19c8d6f
> --- /dev/null
> +++ b/include/sigframe.h
> @@ -0,0 +1,38 @@
> +#ifndef __CR_SIGFRAME_H__
> +#define __CR_SIGFRAME_H__
> +
> +// Generic sigframe bits
> +
> +#ifndef __ARCH_SI_PREAMBLE_SIZE
> +#define __ARCH_SI_PREAMBLE_SIZE	(3 * sizeof(int))
> +#endif
> +
> +#define SI_MAX_SIZE	128
> +#ifndef SI_PAD_SIZE
> +#define SI_PAD_SIZE	((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
> +#endif
> +
> +typedef struct rt_siginfo {
> +	int	si_signo;
> +	int	si_errno;
> +	int	si_code;
> +	int	_pad[SI_PAD_SIZE];
> +} rt_siginfo_t;
> +
> +typedef struct rt_sigaltstack {
> +	void	*ss_sp;
> +	int	ss_flags;
> +	size_t	ss_size;
> +} rt_stack_t;
> +
> +struct rt_ucontext {
> +	unsigned long		uc_flags;
> +	struct rt_ucontext	*uc_link;
> +	rt_stack_t		uc_stack;
> +	struct rt_sigcontext	uc_mcontext;
> +	rt_sigset_t		uc_sigmask;	/* mask last for extensibility */
> +	int                     __unused[32 - (sizeof (rt_sigset_t) / sizeof (int))];
> +	unsigned long           uc_regspace[128] __attribute__((__aligned__(8)));
> +};
> +
> +#endif
> 




More information about the CRIU mailing list