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