ppc32.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. typedef struct compat_siginfo {
  16. int si_signo;
  17. int si_errno;
  18. int si_code;
  19. union {
  20. int _pad[SI_PAD_SIZE32];
  21. /* kill() */
  22. struct {
  23. compat_pid_t _pid; /* sender's pid */
  24. compat_uid_t _uid; /* sender's uid */
  25. } _kill;
  26. /* POSIX.1b timers */
  27. struct {
  28. compat_timer_t _tid; /* timer id */
  29. int _overrun; /* overrun count */
  30. compat_sigval_t _sigval; /* same as below */
  31. int _sys_private; /* not to be passed to user */
  32. } _timer;
  33. /* POSIX.1b signals */
  34. struct {
  35. compat_pid_t _pid; /* sender's pid */
  36. compat_uid_t _uid; /* sender's uid */
  37. compat_sigval_t _sigval;
  38. } _rt;
  39. /* SIGCHLD */
  40. struct {
  41. compat_pid_t _pid; /* which child */
  42. compat_uid_t _uid; /* sender's uid */
  43. int _status; /* exit code */
  44. compat_clock_t _utime;
  45. compat_clock_t _stime;
  46. } _sigchld;
  47. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
  48. struct {
  49. unsigned int _addr; /* faulting insn/memory ref. */
  50. } _sigfault;
  51. /* SIGPOLL */
  52. struct {
  53. int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  54. int _fd;
  55. } _sigpoll;
  56. } _sifields;
  57. } compat_siginfo_t;
  58. #define __old_sigaction32 old_sigaction32
  59. struct __old_sigaction32 {
  60. compat_uptr_t sa_handler;
  61. compat_old_sigset_t sa_mask;
  62. unsigned int sa_flags;
  63. compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */
  64. };
  65. struct sigaction32 {
  66. compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */
  67. unsigned int sa_flags;
  68. compat_uptr_t sa_restorer; /* Another 32 bit pointer */
  69. compat_sigset_t sa_mask; /* A 32 bit mask */
  70. };
  71. typedef struct sigaltstack_32 {
  72. unsigned int ss_sp;
  73. int ss_flags;
  74. compat_size_t ss_size;
  75. } stack_32_t;
  76. struct pt_regs32 {
  77. unsigned int gpr[32];
  78. unsigned int nip;
  79. unsigned int msr;
  80. unsigned int orig_gpr3; /* Used for restarting system calls */
  81. unsigned int ctr;
  82. unsigned int link;
  83. unsigned int xer;
  84. unsigned int ccr;
  85. unsigned int mq; /* 601 only (not used at present) */
  86. unsigned int trap; /* Reason for being here */
  87. unsigned int dar; /* Fault registers */
  88. unsigned int dsisr;
  89. unsigned int result; /* Result of a system call */
  90. };
  91. struct sigcontext32 {
  92. unsigned int _unused[4];
  93. int signal;
  94. compat_uptr_t handler;
  95. unsigned int oldmask;
  96. compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */
  97. };
  98. struct mcontext32 {
  99. elf_gregset_t32 mc_gregs;
  100. elf_fpregset_t mc_fregs;
  101. unsigned int mc_pad[2];
  102. elf_vrregset_t32 mc_vregs __attribute__((__aligned__(16)));
  103. elf_vsrreghalf_t32 mc_vsregs __attribute__((__aligned__(16)));
  104. };
  105. struct ucontext32 {
  106. unsigned int uc_flags;
  107. unsigned int uc_link;
  108. stack_32_t uc_stack;
  109. int uc_pad[7];
  110. compat_uptr_t uc_regs; /* points to uc_mcontext field */
  111. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  112. /* glibc has 1024-bit signal masks, ours are 64-bit */
  113. int uc_maskext[30];
  114. int uc_pad2[3];
  115. struct mcontext32 uc_mcontext;
  116. };
  117. #endif /* _PPC64_PPC32_H */