sigcontext.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _ASM_IA64_SIGCONTEXT_H
  3. #define _ASM_IA64_SIGCONTEXT_H
  4. /*
  5. * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
  6. * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <[email protected]>
  7. */
  8. #include <asm/fpu.h>
  9. #define IA64_SC_FLAG_ONSTACK_BIT 0 /* is handler running on signal stack? */
  10. #define IA64_SC_FLAG_IN_SYSCALL_BIT 1 /* did signal interrupt a syscall? */
  11. #define IA64_SC_FLAG_FPH_VALID_BIT 2 /* is state in f[32]-f[127] valid? */
  12. #define IA64_SC_FLAG_ONSTACK (1 << IA64_SC_FLAG_ONSTACK_BIT)
  13. #define IA64_SC_FLAG_IN_SYSCALL (1 << IA64_SC_FLAG_IN_SYSCALL_BIT)
  14. #define IA64_SC_FLAG_FPH_VALID (1 << IA64_SC_FLAG_FPH_VALID_BIT)
  15. # ifndef __ASSEMBLY__
  16. /*
  17. * Note on handling of register backing store: sc_ar_bsp contains the address that would
  18. * be found in ar.bsp after executing a "cover" instruction the context in which the
  19. * signal was raised. If signal delivery required switching to an alternate signal stack
  20. * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
  21. * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
  22. * original one. In this case, sc_rbs_base contains the base address of the new register
  23. * backing store. The number of registers in the dirty partition can be calculated as:
  24. *
  25. * ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
  26. *
  27. */
  28. struct sigcontext {
  29. unsigned long sc_flags; /* see manifest constants above */
  30. unsigned long sc_nat; /* bit i == 1 iff scratch reg gr[i] is a NaT */
  31. stack_t sc_stack; /* previously active stack */
  32. unsigned long sc_ip; /* instruction pointer */
  33. unsigned long sc_cfm; /* current frame marker */
  34. unsigned long sc_um; /* user mask bits */
  35. unsigned long sc_ar_rsc; /* register stack configuration register */
  36. unsigned long sc_ar_bsp; /* backing store pointer */
  37. unsigned long sc_ar_rnat; /* RSE NaT collection register */
  38. unsigned long sc_ar_ccv; /* compare and exchange compare value register */
  39. unsigned long sc_ar_unat; /* ar.unat of interrupted context */
  40. unsigned long sc_ar_fpsr; /* floating-point status register */
  41. unsigned long sc_ar_pfs; /* previous function state */
  42. unsigned long sc_ar_lc; /* loop count register */
  43. unsigned long sc_pr; /* predicate registers */
  44. unsigned long sc_br[8]; /* branch registers */
  45. /* Note: sc_gr[0] is used as the "uc_link" member of ucontext_t */
  46. unsigned long sc_gr[32]; /* general registers (static partition) */
  47. struct ia64_fpreg sc_fr[128]; /* floating-point registers */
  48. unsigned long sc_rbs_base; /* NULL or new base of sighandler's rbs */
  49. unsigned long sc_loadrs; /* see description above */
  50. unsigned long sc_ar25; /* cmp8xchg16 uses this */
  51. unsigned long sc_ar26; /* rsvd for scratch use */
  52. unsigned long sc_rsvd[12]; /* reserved for future use */
  53. /*
  54. * The mask must come last so we can increase _NSIG_WORDS
  55. * without breaking binary compatibility.
  56. */
  57. sigset_t sc_mask; /* signal mask to restore after handler returns */
  58. };
  59. # endif /* __ASSEMBLY__ */
  60. #endif /* _ASM_IA64_SIGCONTEXT_H */