Blame sysdeps/powerpc/novmxsetjmp.h

Packit Service 82fcde
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
/* Copied from setjmp/setjmp.h, powerpc/bits/setjmp.h and modified
Packit Service 82fcde
   appropriately to keep backward compatible with setjmp without
Packit Service 82fcde
   AltiVec/VMX support.
Packit Service 82fcde
Packit Service 82fcde
   This file is not exported and the interfaces are private to libc.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef	__NOVMX_SETJMP_H
Packit Service 82fcde
#define	__NOVMX_SETJMP_H	1
Packit Service 82fcde
Packit Service 82fcde
#include <bits/wordsize.h>
Packit Service 82fcde
Packit Service 82fcde
/* The following definitions are needed by ASM implementations of the old
Packit Service 82fcde
   (novmx) __longjmp/__setjmp functions.  */
Packit Service 82fcde
Packit Service 82fcde
# define JB_GPR1   0  /* Also known as the stack pointer */
Packit Service 82fcde
# define JB_GPR2   1
Packit Service 82fcde
# define JB_LR     2  /* The address we will return to */
Packit Service 82fcde
# if __WORDSIZE == 64
Packit Service 82fcde
#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18*2 words total.  */
Packit Service 82fcde
#  define JB_CR     21 /* Condition code registers. */
Packit Service 82fcde
#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
Packit Service 82fcde
#  define JB_SIZE   (40 * 8)
Packit Service 82fcde
# else
Packit Service 82fcde
#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total.  */
Packit Service 82fcde
#  define JB_CR     21 /* Condition code registers.  */
Packit Service 82fcde
#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
Packit Service 82fcde
#  define JB_SIZE   (58 * 4)
Packit Service 82fcde
# endif
Packit Service 82fcde
Packit Service 82fcde
#ifndef	_ASM
Packit Service 82fcde
/* The following definitions are needed by the novmx* implementations of
Packit Service 82fcde
   setjmp/longjmp/sigsetjmp/etc that wrapper __setjmp/__longjmp.  */
Packit Service 82fcde
Packit Service 82fcde
# if __WORDSIZE == 64
Packit Service 82fcde
typedef long int __jmp_buf[40];
Packit Service 82fcde
# else
Packit Service 82fcde
typedef long int __jmp_buf[58];
Packit Service 82fcde
# endif
Packit Service 82fcde
Packit Service 82fcde
# include <bits/types/__sigset_t.h>
Packit Service 82fcde
Packit Service 82fcde
/* Calling environment, plus possibly a saved signal mask.  */
Packit Service 82fcde
typedef struct __novmx__jmp_buf_tag
Packit Service 82fcde
  {
Packit Service 82fcde
    /* NOTE: The machine-dependent definitions of `__sigsetjmp'
Packit Service 82fcde
       assume that a `jmp_buf' begins with a `__jmp_buf' and that
Packit Service 82fcde
       `__mask_was_saved' follows it.  Do not move these members
Packit Service 82fcde
       or add others before it.  */
Packit Service 82fcde
    __jmp_buf __jmpbuf;		/* Calling environment.  */
Packit Service 82fcde
    int __mask_was_saved;	/* Saved the signal mask?  */
Packit Service 82fcde
    __sigset_t __saved_mask;	/* Saved signal mask.  */
Packit Service 82fcde
  } __novmx__jmp_buf[1];
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Store the calling environment in ENV, also saving the signal mask.
Packit Service 82fcde
   Return 0.  */
Packit Service 82fcde
extern int __novmxsetjmp (__novmx__jmp_buf __env);
Packit Service 82fcde
Packit Service 82fcde
/* Store the calling environment in ENV, also saving the
Packit Service 82fcde
   signal mask if SAVEMASK is nonzero.  Return 0.
Packit Service 82fcde
   This is the internal name for `sigsetjmp'.  */
Packit Service 82fcde
extern int __novmx__sigsetjmp (struct __novmx__jmp_buf_tag __env[1],
Packit Service 82fcde
			       int __savemask);
Packit Service 82fcde
Packit Service 82fcde
/* Store the calling environment in ENV, not saving the signal mask.
Packit Service 82fcde
   Return 0.  */
Packit Service 82fcde
extern int __novmx_setjmp (struct __novmx__jmp_buf_tag __env[1]);
Packit Service 82fcde
Packit Service 82fcde
/* Jump to the environment saved in ENV, making the
Packit Service 82fcde
   `setjmp' call there return VAL, or 1 if VAL is 0.  */
Packit Service 82fcde
extern void __novmxlongjmp (struct __novmx__jmp_buf_tag __env[1], int __val)
Packit Service 82fcde
     __attribute__ ((__noreturn__));
Packit Service 82fcde
Packit Service 82fcde
/* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
Packit Service 82fcde
   the signal mask.  But it is how ENV was saved that determines whether
Packit Service 82fcde
   `longjmp' restores the mask; `_longjmp' is just an alias.  */
Packit Service 82fcde
extern void __novmx_longjmp (struct __novmx__jmp_buf_tag __env[1], int __val)
Packit Service 82fcde
     __attribute__ ((__noreturn__));
Packit Service 82fcde
Packit Service 82fcde
/* Use the same type for `jmp_buf' and `sigjmp_buf'.
Packit Service 82fcde
   The `__mask_was_saved' flag determines whether
Packit Service 82fcde
   or not `longjmp' will restore the signal mask.  */
Packit Service 82fcde
typedef struct __novmx__jmp_buf_tag __novmx__sigjmp_buf[1];
Packit Service 82fcde
Packit Service 82fcde
/* Jump to the environment saved in ENV, making the
Packit Service 82fcde
   sigsetjmp call there return VAL, or 1 if VAL is 0.
Packit Service 82fcde
   Restore the signal mask if that sigsetjmp call saved it.
Packit Service 82fcde
   This is just an alias `longjmp'.  */
Packit Service 82fcde
extern void __novmxsiglongjmp (__novmx__sigjmp_buf __env, int __val)
Packit Service 82fcde
     __attribute__ ((__noreturn__));
Packit Service 82fcde
Packit Service 82fcde
/* Internal machine-dependent function to restore context sans signal mask.  */
Packit Service 82fcde
extern void __novmx__longjmp (__jmp_buf __env, int __val)
Packit Service 82fcde
     __attribute__ ((__noreturn__));
Packit Service 82fcde
Packit Service 82fcde
/* Internal function to possibly save the current mask of blocked signals
Packit Service 82fcde
   in ENV, and always set the flag saying whether or not it was saved.
Packit Service 82fcde
   This is used by the machine-dependent definition of `__sigsetjmp'.
Packit Service 82fcde
   Always returns zero, for convenience.  */
Packit Service 82fcde
extern int __novmx__sigjmp_save (__novmx__jmp_buf __env, int __savemask);
Packit Service 82fcde
Packit Service 82fcde
extern void _longjmp_unwind (__novmx__jmp_buf env, int val);
Packit Service 82fcde
Packit Service 82fcde
extern void __novmx__libc_siglongjmp (__novmx__sigjmp_buf env, int val)
Packit Service 82fcde
          __attribute__ ((noreturn));
Packit Service 82fcde
Packit Service 82fcde
extern void __novmx__libc_longjmp (__novmx__sigjmp_buf env, int val)
Packit Service 82fcde
     __attribute__ ((noreturn));
Packit Service 82fcde
Packit Service 82fcde
libc_hidden_proto (__novmx__libc_longjmp)
Packit Service 82fcde
libc_hidden_proto (__novmx_setjmp)
Packit Service 82fcde
libc_hidden_proto (__novmx__sigsetjmp)
Packit Service 82fcde
#endif /* !_ASM */
Packit Service 82fcde
Packit Service 82fcde
#endif