blob: 2c5f7861d373c4233cd6eb75b81c17c3b2cc6d3f [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_IA32_H
3#define _ASM_X86_IA32_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6#ifdef CONFIG_IA32_EMULATION
7
8#include <linux/compat.h>
9
10/*
11 * 32 bit structures for IA32 support.
12 */
13
Ingo Molnardecb4c42015-09-05 09:32:43 +020014#include <uapi/asm/sigcontext.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16/* signal.h */
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018struct ucontext_ia32 {
19 unsigned int uc_flags;
20 unsigned int uc_link;
Al Viro90268432012-12-14 14:47:53 -050021 compat_stack_t uc_stack;
Ingo Molnar8fcb3462015-09-05 09:32:41 +020022 struct sigcontext_32 uc_mcontext;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 compat_sigset_t uc_sigmask; /* mask last for extensibility */
24};
25
26/* This matches struct stat64 in glibc2.2, hence the absolutely
27 * insane amounts of padding around dev_t's.
28 */
29struct stat64 {
30 unsigned long long st_dev;
31 unsigned char __pad0[4];
32
33#define STAT64_HAS_BROKEN_ST_INO 1
34 unsigned int __st_ino;
35
36 unsigned int st_mode;
37 unsigned int st_nlink;
38
39 unsigned int st_uid;
40 unsigned int st_gid;
41
42 unsigned long long st_rdev;
43 unsigned char __pad3[4];
44
45 long long st_size;
46 unsigned int st_blksize;
47
Joe Perches9bd73422008-03-23 01:02:20 -070048 long long st_blocks;/* Number 512-byte blocks allocated */
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50 unsigned st_atime;
51 unsigned st_atime_nsec;
52 unsigned st_mtime;
53 unsigned st_mtime_nsec;
54 unsigned st_ctime;
55 unsigned st_ctime_nsec;
56
57 unsigned long long st_ino;
58} __attribute__((packed));
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#define IA32_STACK_TOP IA32_PAGE_OFFSET
61
62#ifdef __KERNEL__
Andi Kleenea0be472005-11-05 17:25:54 +010063struct linux_binprm;
64extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
65 unsigned long stack_top, int exec_stack);
Andi Kleen88172102006-01-17 07:03:38 +010066struct mm_struct;
67extern void ia32_pick_mmap_layout(struct mm_struct *mm);
Andi Kleenea0be472005-11-05 17:25:54 +010068
Linus Torvalds1da177e2005-04-16 15:20:36 -070069#endif
70
71#endif /* !CONFIG_IA32_SUPPORT */
Joe Perches9bd73422008-03-23 01:02:20 -070072
H. Peter Anvin1965aae2008-10-22 22:26:29 -070073#endif /* _ASM_X86_IA32_H */