ppc32.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef _PPC64_PPC32_H
  3. #define _PPC64_PPC32_H
  4. #include <linux/compat.h>
  5. #include <asm/siginfo.h>
  6. #include <asm/signal.h>
  7. /*
  8. * Data types and macros for providing 32b PowerPC support.
  9. */
  10. /* These are here to support 32-bit syscalls on a 64-bit kernel. */
  11. struct pt_regs32 {
  12. unsigned int gpr[32];
  13. unsigned int nip;
  14. unsigned int msr;
  15. unsigned int orig_gpr3; /* Used for restarting system calls */
  16. unsigned int ctr;
  17. unsigned int link;
  18. unsigned int xer;
  19. unsigned int ccr;
  20. unsigned int mq; /* 601 only (not used at present) */
  21. unsigned int trap; /* Reason for being here */
  22. unsigned int dar; /* Fault registers */
  23. unsigned int dsisr;
  24. unsigned int result; /* Result of a system call */
  25. };
  26. struct sigcontext32 {
  27. unsigned int _unused[4];
  28. int signal;
  29. compat_uptr_t handler;
  30. unsigned int oldmask;
  31. compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
  32. };
  33. struct mcontext32 {
  34. elf_gregset_t32 mc_gregs;
  35. elf_fpregset_t mc_fregs;
  36. unsigned int mc_pad[2];
  37. elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
  38. elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16)));
  39. };
  40. struct ucontext32 {
  41. unsigned int uc_flags;
  42. unsigned int uc_link;
  43. compat_stack_t uc_stack;
  44. int uc_pad[7];
  45. compat_uptr_t uc_regs; /* points to uc_mcontext field */
  46. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  47. /* glibc has 1024-bit signal masks, ours are 64-bit */
  48. int uc_maskext[30];
  49. int uc_pad2[3];
  50. struct mcontext32 uc_mcontext;
  51. };
  52. #endif /* _PPC64_PPC32_H */