ia32.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #ifndef _ASM_X86_IA32_H
  2. #define _ASM_X86_IA32_H
  3. #ifdef CONFIG_IA32_EMULATION
  4. #include <linux/compat.h>
  5. /*
  6. * 32 bit structures for IA32 support.
  7. */
  8. #include <asm/sigcontext32.h>
  9. /* signal.h */
  10. struct sigaction32 {
  11. unsigned int sa_handler; /* Really a pointer, but need to deal
  12. with 32 bits */
  13. unsigned int sa_flags;
  14. unsigned int sa_restorer; /* Another 32 bit pointer */
  15. compat_sigset_t sa_mask; /* A 32 bit mask */
  16. };
  17. struct old_sigaction32 {
  18. unsigned int sa_handler; /* Really a pointer, but need to deal
  19. with 32 bits */
  20. compat_old_sigset_t sa_mask; /* A 32 bit mask */
  21. unsigned int sa_flags;
  22. unsigned int sa_restorer; /* Another 32 bit pointer */
  23. };
  24. typedef struct sigaltstack_ia32 {
  25. unsigned int ss_sp;
  26. int ss_flags;
  27. unsigned int ss_size;
  28. } stack_ia32_t;
  29. struct ucontext_ia32 {
  30. unsigned int uc_flags;
  31. unsigned int uc_link;
  32. stack_ia32_t uc_stack;
  33. struct sigcontext_ia32 uc_mcontext;
  34. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  35. };
  36. struct ucontext_x32 {
  37. unsigned int uc_flags;
  38. unsigned int uc_link;
  39. stack_ia32_t uc_stack;
  40. unsigned int uc__pad0; /* needed for alignment */
  41. struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
  42. compat_sigset_t uc_sigmask; /* mask last for extensibility */
  43. };
  44. /* This matches struct stat64 in glibc2.2, hence the absolutely
  45. * insane amounts of padding around dev_t's.
  46. */
  47. struct stat64 {
  48. unsigned long long st_dev;
  49. unsigned char __pad0[4];
  50. #define STAT64_HAS_BROKEN_ST_INO 1
  51. unsigned int __st_ino;
  52. unsigned int st_mode;
  53. unsigned int st_nlink;
  54. unsigned int st_uid;
  55. unsigned int st_gid;
  56. unsigned long long st_rdev;
  57. unsigned char __pad3[4];
  58. long long st_size;
  59. unsigned int st_blksize;
  60. long long st_blocks;/* Number 512-byte blocks allocated */
  61. unsigned st_atime;
  62. unsigned st_atime_nsec;
  63. unsigned st_mtime;
  64. unsigned st_mtime_nsec;
  65. unsigned st_ctime;
  66. unsigned st_ctime_nsec;
  67. unsigned long long st_ino;
  68. } __attribute__((packed));
  69. typedef struct compat_siginfo {
  70. int si_signo;
  71. int si_errno;
  72. int si_code;
  73. union {
  74. int _pad[((128 / sizeof(int)) - 3)];
  75. /* kill() */
  76. struct {
  77. unsigned int _pid; /* sender's pid */
  78. unsigned int _uid; /* sender's uid */
  79. } _kill;
  80. /* POSIX.1b timers */
  81. struct {
  82. compat_timer_t _tid; /* timer id */
  83. int _overrun; /* overrun count */
  84. compat_sigval_t _sigval; /* same as below */
  85. int _sys_private; /* not to be passed to user */
  86. int _overrun_incr; /* amount to add to overrun */
  87. } _timer;
  88. /* POSIX.1b signals */
  89. struct {
  90. unsigned int _pid; /* sender's pid */
  91. unsigned int _uid; /* sender's uid */
  92. compat_sigval_t _sigval;
  93. } _rt;
  94. /* SIGCHLD */
  95. struct {
  96. unsigned int _pid; /* which child */
  97. unsigned int _uid; /* sender's uid */
  98. int _status; /* exit code */
  99. compat_clock_t _utime;
  100. compat_clock_t _stime;
  101. } _sigchld;
  102. /* SIGCHLD (x32 version) */
  103. struct {
  104. unsigned int _pid; /* which child */
  105. unsigned int _uid; /* sender's uid */
  106. int _status; /* exit code */
  107. compat_s64 _utime;
  108. compat_s64 _stime;
  109. } _sigchld_x32;
  110. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
  111. struct {
  112. unsigned int _addr; /* faulting insn/memory ref. */
  113. } _sigfault;
  114. /* SIGPOLL */
  115. struct {
  116. int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  117. int _fd;
  118. } _sigpoll;
  119. struct {
  120. unsigned int _call_addr; /* calling insn */
  121. int _syscall; /* triggering system call number */
  122. unsigned int _arch; /* AUDIT_ARCH_* of syscall */
  123. } _sigsys;
  124. } _sifields;
  125. } compat_siginfo_t;
  126. #define IA32_STACK_TOP IA32_PAGE_OFFSET
  127. #ifdef __KERNEL__
  128. struct linux_binprm;
  129. extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
  130. unsigned long stack_top, int exec_stack);
  131. struct mm_struct;
  132. extern void ia32_pick_mmap_layout(struct mm_struct *mm);
  133. #endif
  134. #endif /* !CONFIG_IA32_SUPPORT */
  135. #endif /* _ASM_X86_IA32_H */