11965aae3c98397aad957412413c07e97b1bd4e64H. Peter Anvin#ifndef _ASM_X86_IA32_H
21965aae3c98397aad957412413c07e97b1bd4e64H. Peter Anvin#define _ASM_X86_IA32_H
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef CONFIG_IA32_EMULATION
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <linux/compat.h>
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * 32 bit structures for IA32 support.
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <asm/sigcontext32.h>
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* signal.h */
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct ucontext_ia32 {
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int	  uc_flags;
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int 	  uc_link;
209026843952adac5b123c7b8dc961e5c15828d9e1Al Viro	compat_stack_t	  uc_stack;
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	struct sigcontext_ia32 uc_mcontext;
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
254048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lustruct ucontext_x32 {
264048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu	unsigned int	  uc_flags;
274048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu	unsigned int 	  uc_link;
289026843952adac5b123c7b8dc961e5c15828d9e1Al Viro	compat_stack_t	  uc_stack;
294048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu	unsigned int	  uc__pad0;     /* needed for alignment */
304048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu	struct sigcontext uc_mcontext;  /* the 64-bit sigcontext type */
314048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu	compat_sigset_t	  uc_sigmask;	/* mask last for extensibility */
324048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu};
334048e2a8d4b491a69bf47ceda12cc0c0b924f6b8H. J. Lu
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* This matches struct stat64 in glibc2.2, hence the absolutely
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * insane amounts of padding around dev_t's.
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct stat64 {
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned long long	st_dev;
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned char		__pad0[4];
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define STAT64_HAS_BROKEN_ST_INO	1
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		__st_ino;
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		st_mode;
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		st_nlink;
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		st_uid;
481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		st_gid;
491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned long long	st_rdev;
511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned char		__pad3[4];
521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	long long		st_size;
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		st_blksize;
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
569bd73425142a610ae72c5e2b89e036e5214bb6caJoe Perches	long long		st_blocks;/* Number 512-byte blocks allocated */
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_atime;
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_atime_nsec;
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_mtime;
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_mtime_nsec;
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_ctime;
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned 		st_ctime_nsec;
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned long long	st_ino;
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds} __attribute__((packed));
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define IA32_STACK_TOP IA32_PAGE_OFFSET
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifdef __KERNEL__
71ea0be473a1f0ee89024a24d8ea4b05fbf6efcee3Andi Kleenstruct linux_binprm;
72ea0be473a1f0ee89024a24d8ea4b05fbf6efcee3Andi Kleenextern int ia32_setup_arg_pages(struct linux_binprm *bprm,
73ea0be473a1f0ee89024a24d8ea4b05fbf6efcee3Andi Kleen				unsigned long stack_top, int exec_stack);
748817210d4d968e58f7d93db2eecd17b20dd03d40Andi Kleenstruct mm_struct;
758817210d4d968e58f7d93db2eecd17b20dd03d40Andi Kleenextern void ia32_pick_mmap_layout(struct mm_struct *mm);
76ea0be473a1f0ee89024a24d8ea4b05fbf6efcee3Andi Kleen
771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* !CONFIG_IA32_SUPPORT */
809bd73425142a610ae72c5e2b89e036e5214bb6caJoe Perches
811965aae3c98397aad957412413c07e97b1bd4e64H. Peter Anvin#endif /* _ASM_X86_IA32_H */
82