| 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 |  | 
| H. J. Lu | 4048e2a | 2012-02-19 07:46:08 -0800 | [diff] [blame] | 46 | struct ucontext_x32 { | 
 | 47 | 	unsigned int	  uc_flags; | 
 | 48 | 	unsigned int 	  uc_link; | 
 | 49 | 	stack_ia32_t	  uc_stack; | 
 | 50 | 	unsigned int	  uc__pad0;     /* needed for alignment */ | 
 | 51 | 	struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */ | 
 | 52 | 	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */ | 
 | 53 | }; | 
 | 54 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | /* This matches struct stat64 in glibc2.2, hence the absolutely | 
 | 56 |  * insane amounts of padding around dev_t's. | 
 | 57 |  */ | 
 | 58 | struct stat64 { | 
 | 59 | 	unsigned long long	st_dev; | 
 | 60 | 	unsigned char		__pad0[4]; | 
 | 61 |  | 
 | 62 | #define STAT64_HAS_BROKEN_ST_INO	1 | 
 | 63 | 	unsigned int		__st_ino; | 
 | 64 |  | 
 | 65 | 	unsigned int		st_mode; | 
 | 66 | 	unsigned int		st_nlink; | 
 | 67 |  | 
 | 68 | 	unsigned int		st_uid; | 
 | 69 | 	unsigned int		st_gid; | 
 | 70 |  | 
 | 71 | 	unsigned long long	st_rdev; | 
 | 72 | 	unsigned char		__pad3[4]; | 
 | 73 |  | 
 | 74 | 	long long		st_size; | 
 | 75 | 	unsigned int		st_blksize; | 
 | 76 |  | 
| Joe Perches | 9bd7342 | 2008-03-23 01:02:20 -0700 | [diff] [blame] | 77 | 	long long		st_blocks;/* Number 512-byte blocks allocated */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 |  | 
 | 79 | 	unsigned 		st_atime; | 
 | 80 | 	unsigned 		st_atime_nsec; | 
 | 81 | 	unsigned 		st_mtime; | 
 | 82 | 	unsigned 		st_mtime_nsec; | 
 | 83 | 	unsigned 		st_ctime; | 
 | 84 | 	unsigned 		st_ctime_nsec; | 
 | 85 |  | 
 | 86 | 	unsigned long long	st_ino; | 
 | 87 | } __attribute__((packed)); | 
 | 88 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | #define IA32_STACK_TOP IA32_PAGE_OFFSET | 
 | 90 |  | 
 | 91 | #ifdef __KERNEL__ | 
| Andi Kleen | ea0be47 | 2005-11-05 17:25:54 +0100 | [diff] [blame] | 92 | struct linux_binprm; | 
 | 93 | extern int ia32_setup_arg_pages(struct linux_binprm *bprm, | 
 | 94 | 				unsigned long stack_top, int exec_stack); | 
| Andi Kleen | 8817210 | 2006-01-17 07:03:38 +0100 | [diff] [blame] | 95 | struct mm_struct; | 
 | 96 | extern void ia32_pick_mmap_layout(struct mm_struct *mm); | 
| Andi Kleen | ea0be47 | 2005-11-05 17:25:54 +0100 | [diff] [blame] | 97 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | #endif | 
 | 99 |  | 
 | 100 | #endif /* !CONFIG_IA32_SUPPORT */ | 
| Joe Perches | 9bd7342 | 2008-03-23 01:02:20 -0700 | [diff] [blame] | 101 |  | 
| H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 102 | #endif /* _ASM_X86_IA32_H */ |