blob: 4c6da2e4bb1d3e843c057ca40158d39035150273 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_IA32_H
2#define _ASM_X86_IA32_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
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 */
16struct sigaction32 {
Joe Perches9bd73422008-03-23 01:02:20 -070017 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 Torvalds1da177e2005-04-16 15:20:36 -070022};
23
24struct old_sigaction32 {
Joe Perches9bd73422008-03-23 01:02:20 -070025 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 Torvalds1da177e2005-04-16 15:20:36 -070030};
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032struct ucontext_ia32 {
33 unsigned int uc_flags;
34 unsigned int uc_link;
Al Viro90268432012-12-14 14:47:53 -050035 compat_stack_t uc_stack;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 struct sigcontext_ia32 uc_mcontext;
37 compat_sigset_t uc_sigmask; /* mask last for extensibility */
38};
39
H. J. Lu4048e2a2012-02-19 07:46:08 -080040struct ucontext_x32 {
41 unsigned int uc_flags;
42 unsigned int uc_link;
Al Viro90268432012-12-14 14:47:53 -050043 compat_stack_t uc_stack;
H. J. Lu4048e2a2012-02-19 07:46:08 -080044 unsigned int uc__pad0; /* needed for alignment */
45 struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
46 compat_sigset_t uc_sigmask; /* mask last for extensibility */
47};
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/* This matches struct stat64 in glibc2.2, hence the absolutely
50 * insane amounts of padding around dev_t's.
51 */
52struct stat64 {
53 unsigned long long st_dev;
54 unsigned char __pad0[4];
55
56#define STAT64_HAS_BROKEN_ST_INO 1
57 unsigned int __st_ino;
58
59 unsigned int st_mode;
60 unsigned int st_nlink;
61
62 unsigned int st_uid;
63 unsigned int st_gid;
64
65 unsigned long long st_rdev;
66 unsigned char __pad3[4];
67
68 long long st_size;
69 unsigned int st_blksize;
70
Joe Perches9bd73422008-03-23 01:02:20 -070071 long long st_blocks;/* Number 512-byte blocks allocated */
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
73 unsigned st_atime;
74 unsigned st_atime_nsec;
75 unsigned st_mtime;
76 unsigned st_mtime_nsec;
77 unsigned st_ctime;
78 unsigned st_ctime_nsec;
79
80 unsigned long long st_ino;
81} __attribute__((packed));
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083#define IA32_STACK_TOP IA32_PAGE_OFFSET
84
85#ifdef __KERNEL__
Andi Kleenea0be472005-11-05 17:25:54 +010086struct linux_binprm;
87extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
88 unsigned long stack_top, int exec_stack);
Andi Kleen88172102006-01-17 07:03:38 +010089struct mm_struct;
90extern void ia32_pick_mmap_layout(struct mm_struct *mm);
Andi Kleenea0be472005-11-05 17:25:54 +010091
Linus Torvalds1da177e2005-04-16 15:20:36 -070092#endif
93
94#endif /* !CONFIG_IA32_SUPPORT */
Joe Perches9bd73422008-03-23 01:02:20 -070095
H. Peter Anvin1965aae2008-10-22 22:26:29 -070096#endif /* _ASM_X86_IA32_H */