signal32.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 ARM Ltd.
  4. */
  5. #ifndef __ASM_SIGNAL32_H
  6. #define __ASM_SIGNAL32_H
  7. #ifdef CONFIG_COMPAT
  8. #include <linux/compat.h>
  9. struct compat_sigcontext {
  10. /* We always set these two fields to 0 */
  11. compat_ulong_t trap_no;
  12. compat_ulong_t error_code;
  13. compat_ulong_t oldmask;
  14. compat_ulong_t arm_r0;
  15. compat_ulong_t arm_r1;
  16. compat_ulong_t arm_r2;
  17. compat_ulong_t arm_r3;
  18. compat_ulong_t arm_r4;
  19. compat_ulong_t arm_r5;
  20. compat_ulong_t arm_r6;
  21. compat_ulong_t arm_r7;
  22. compat_ulong_t arm_r8;
  23. compat_ulong_t arm_r9;
  24. compat_ulong_t arm_r10;
  25. compat_ulong_t arm_fp;
  26. compat_ulong_t arm_ip;
  27. compat_ulong_t arm_sp;
  28. compat_ulong_t arm_lr;
  29. compat_ulong_t arm_pc;
  30. compat_ulong_t arm_cpsr;
  31. compat_ulong_t fault_address;
  32. };
  33. struct compat_ucontext {
  34. compat_ulong_t uc_flags;
  35. compat_uptr_t uc_link;
  36. compat_stack_t uc_stack;
  37. struct compat_sigcontext uc_mcontext;
  38. compat_sigset_t uc_sigmask;
  39. int __unused[32 - (sizeof(compat_sigset_t) / sizeof(int))];
  40. compat_ulong_t uc_regspace[128] __attribute__((__aligned__(8)));
  41. };
  42. struct compat_sigframe {
  43. struct compat_ucontext uc;
  44. compat_ulong_t retcode[2];
  45. };
  46. struct compat_rt_sigframe {
  47. struct compat_siginfo info;
  48. struct compat_sigframe sig;
  49. };
  50. int compat_setup_frame(int usig, struct ksignal *ksig, sigset_t *set,
  51. struct pt_regs *regs);
  52. int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
  53. struct pt_regs *regs);
  54. void compat_setup_restart_syscall(struct pt_regs *regs);
  55. #else
  56. static inline int compat_setup_frame(int usid, struct ksignal *ksig,
  57. sigset_t *set, struct pt_regs *regs)
  58. {
  59. return -ENOSYS;
  60. }
  61. static inline int compat_setup_rt_frame(int usig, struct ksignal *ksig, sigset_t *set,
  62. struct pt_regs *regs)
  63. {
  64. return -ENOSYS;
  65. }
  66. static inline void compat_setup_restart_syscall(struct pt_regs *regs)
  67. {
  68. }
  69. #endif /* CONFIG_COMPAT */
  70. #endif /* __ASM_SIGNAL32_H */