^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _ASM_X86_IA32_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _ASM_X86_IA32_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifdef CONFIG_IA32_EMULATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/compat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * 32 bit structures for IA32 support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <uapi/asm/sigcontext.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /* signal.h */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct ucontext_ia32 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) unsigned int uc_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) unsigned int uc_link;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) compat_stack_t uc_stack;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct sigcontext_32 uc_mcontext;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) compat_sigset_t uc_sigmask; /* mask last for extensibility */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* This matches struct stat64 in glibc2.2, hence the absolutely
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * insane amounts of padding around dev_t's.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct stat64 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned long long st_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned char __pad0[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define STAT64_HAS_BROKEN_ST_INO 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned int __st_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned int st_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned int st_nlink;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) unsigned int st_uid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned int st_gid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned long long st_rdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) unsigned char __pad3[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) long long st_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned int st_blksize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) long long st_blocks;/* Number 512-byte blocks allocated */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned st_atime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) unsigned st_atime_nsec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned st_mtime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) unsigned st_mtime_nsec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unsigned st_ctime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) unsigned st_ctime_nsec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) unsigned long long st_ino;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) } __attribute__((packed));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define IA32_STACK_TOP IA32_PAGE_OFFSET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #ifdef __KERNEL__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct linux_binprm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) unsigned long stack_top, int exec_stack);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct mm_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) extern void ia32_pick_mmap_layout(struct mm_struct *mm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #endif /* !CONFIG_IA32_SUPPORT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #endif /* _ASM_X86_IA32_H */