ia32.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #ifndef _ASM_X86_64_IA32_H
  2. #define _ASM_X86_64_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. /* This matches struct stat64 in glibc2.2, hence the absolutely
  37. * insane amounts of padding around dev_t's.
  38. */
  39. struct stat64 {
  40. unsigned long long st_dev;
  41. unsigned char __pad0[4];
  42. #define STAT64_HAS_BROKEN_ST_INO 1
  43. unsigned int __st_ino;
  44. unsigned int st_mode;
  45. unsigned int st_nlink;
  46. unsigned int st_uid;
  47. unsigned int st_gid;
  48. unsigned long long st_rdev;
  49. unsigned char __pad3[4];
  50. long long st_size;
  51. unsigned int st_blksize;
  52. long long st_blocks;/* Number 512-byte blocks allocated. */
  53. unsigned st_atime;
  54. unsigned st_atime_nsec;
  55. unsigned st_mtime;
  56. unsigned st_mtime_nsec;
  57. unsigned st_ctime;
  58. unsigned st_ctime_nsec;
  59. unsigned long long st_ino;
  60. } __attribute__((packed));
  61. typedef struct compat_siginfo{
  62. int si_signo;
  63. int si_errno;
  64. int si_code;
  65. union {
  66. int _pad[((128/sizeof(int)) - 3)];
  67. /* kill() */
  68. struct {
  69. unsigned int _pid; /* sender's pid */
  70. unsigned int _uid; /* sender's uid */
  71. } _kill;
  72. /* POSIX.1b timers */
  73. struct {
  74. compat_timer_t _tid; /* timer id */
  75. int _overrun; /* overrun count */
  76. compat_sigval_t _sigval; /* same as below */
  77. int _sys_private; /* not to be passed to user */
  78. int _overrun_incr; /* amount to add to overrun */
  79. } _timer;
  80. /* POSIX.1b signals */
  81. struct {
  82. unsigned int _pid; /* sender's pid */
  83. unsigned int _uid; /* sender's uid */
  84. compat_sigval_t _sigval;
  85. } _rt;
  86. /* SIGCHLD */
  87. struct {
  88. unsigned int _pid; /* which child */
  89. unsigned int _uid; /* sender's uid */
  90. int _status; /* exit code */
  91. compat_clock_t _utime;
  92. compat_clock_t _stime;
  93. } _sigchld;
  94. /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
  95. struct {
  96. unsigned int _addr; /* faulting insn/memory ref. */
  97. } _sigfault;
  98. /* SIGPOLL */
  99. struct {
  100. int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
  101. int _fd;
  102. } _sigpoll;
  103. } _sifields;
  104. } compat_siginfo_t;
  105. struct sigframe32
  106. {
  107. u32 pretcode;
  108. int sig;
  109. struct sigcontext_ia32 sc;
  110. struct _fpstate_ia32 fpstate;
  111. unsigned int extramask[_COMPAT_NSIG_WORDS-1];
  112. };
  113. struct rt_sigframe32
  114. {
  115. u32 pretcode;
  116. int sig;
  117. u32 pinfo;
  118. u32 puc;
  119. compat_siginfo_t info;
  120. struct ucontext_ia32 uc;
  121. struct _fpstate_ia32 fpstate;
  122. };
  123. struct ustat32 {
  124. __u32 f_tfree;
  125. compat_ino_t f_tinode;
  126. char f_fname[6];
  127. char f_fpack[6];
  128. };
  129. #define IA32_STACK_TOP IA32_PAGE_OFFSET
  130. #ifdef __KERNEL__
  131. struct user_desc;
  132. struct siginfo_t;
  133. int do_get_thread_area(struct thread_struct *t, struct user_desc __user *info);
  134. int do_set_thread_area(struct thread_struct *t, struct user_desc __user *info);
  135. int ia32_child_tls(struct task_struct *p, struct pt_regs *childregs);
  136. struct linux_binprm;
  137. extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
  138. unsigned long stack_top, int exec_stack);
  139. struct mm_struct;
  140. extern void ia32_pick_mmap_layout(struct mm_struct *mm);
  141. #endif
  142. #endif /* !CONFIG_IA32_SUPPORT */
  143. #endif