ia32.h 3.7 KB

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