ppc32.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef _PPC64_PPC32_H
  2. #define _PPC64_PPC32_H
  3. #include <linux/compat.h>
  4. #include <asm/siginfo.h>
  5. #include <asm/signal.h>
  6. /*
  7. * Data types and macros for providing 32b PowerPC support.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. /* These are here to support 32-bit syscalls on a 64-bit kernel. */
  15. #define __old_sigaction32 old_sigaction32
  16. struct __old_sigaction32 {
  17. compat_uptr_t sa_handler;
  18. compat_old_sigset_t sa_mask;
  19. unsigned int sa_flags;
  20. compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
  21. };
  22. struct sigaction32 {
  23. compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */
  24. unsigned int sa_flags;
  25. compat_uptr_t sa_restorer; /* Another 32 bit pointer */
  26. compat_sigset_t sa_mask; /* A 32 bit mask */
  27. };
  28. typedef struct sigaltstack_32 {
  29. unsigned int ss_sp;
  30. int ss_flags;
  31. compat_size_t ss_size;
  32. } stack_32_t;
  33. struct pt_regs32 {
  34. unsigned int gpr[32];
  35. unsigned int nip;
  36. unsigned int msr;
  37. unsigned int orig_gpr3; /* Used for restarting system calls */
  38. unsigned int ctr;
  39. unsigned int link;
  40. unsigned int xer;
  41. unsigned int ccr;
  42. unsigned int mq; /* 601 only (not used at present) */
  43. unsigned int trap; /* Reason for being here */
  44. unsigned int dar; /* Fault registers */
  45. unsigned int dsisr;
  46. unsigned int result; /* Result of a system call */
  47. };
  48. struct sigcontext32 {
  49. unsigned int _unused[4];
  50. int signal;
  51. compat_uptr_t handler;
  52. unsigned int oldmask;
  53. compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
  54. };
  55. struct mcontext32 {
  56. elf_gregset_t32 mc_gregs;
  57. elf_fpregset_t mc_fregs;
  58. unsigned int mc_pad[2];
  59. elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
  60. elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16)));
  61. };
  62. struct ucontext32 {
  63. unsigned int uc_flags;
  64. unsigned int uc_link;
  65. stack_32_t uc_stack;
  66. int uc_pad[7];
  67. compat_uptr_t uc_regs; /* points to uc_mcontext field */
  68. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  69. /* glibc has 1024-bit signal masks, ours are 64-bit */
  70. int uc_maskext[30];
  71. int uc_pad2[3];
  72. struct mcontext32 uc_mcontext;
  73. };
  74. #endif /* _PPC64_PPC32_H */