mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
e7084fd52e
clock_t is used mainly to give the number of jiffies a certain process has burned. It is entirely feasible for a long-running process to consume more than 2^32 jiffies especially in a multiprocess system. As such, switch to a 64-bit clock_t for x32, just as we already switched to a 64-bit time_t. clock_t is only used in a handful of places, and as such it is really not a very significant change. The one that has the biggest impact is in struct siginfo, but since the *size* of struct siginfo doesn't change (it is padded to the hilt) it is fairly easy to make this a localized change. This also gets rid of sys_x32_times, however since this is a pretty late change don't compactify the system call numbers; we can reuse system call slot 521 next time we need an x32 system call. Reported-by: Gregory M. Lueck <gregory.m.lueck@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: H. J. Lu <hjl.tools@gmail.com> Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
164 lines
3.6 KiB
C
164 lines
3.6 KiB
C
#ifndef _ASM_X86_IA32_H
|
|
#define _ASM_X86_IA32_H
|
|
|
|
|
|
#ifdef CONFIG_IA32_EMULATION
|
|
|
|
#include <linux/compat.h>
|
|
|
|
/*
|
|
* 32 bit structures for IA32 support.
|
|
*/
|
|
|
|
#include <asm/sigcontext32.h>
|
|
|
|
/* signal.h */
|
|
struct sigaction32 {
|
|
unsigned int sa_handler; /* Really a pointer, but need to deal
|
|
with 32 bits */
|
|
unsigned int sa_flags;
|
|
unsigned int sa_restorer; /* Another 32 bit pointer */
|
|
compat_sigset_t sa_mask; /* A 32 bit mask */
|
|
};
|
|
|
|
struct old_sigaction32 {
|
|
unsigned int sa_handler; /* Really a pointer, but need to deal
|
|
with 32 bits */
|
|
compat_old_sigset_t sa_mask; /* A 32 bit mask */
|
|
unsigned int sa_flags;
|
|
unsigned int sa_restorer; /* Another 32 bit pointer */
|
|
};
|
|
|
|
typedef struct sigaltstack_ia32 {
|
|
unsigned int ss_sp;
|
|
int ss_flags;
|
|
unsigned int ss_size;
|
|
} stack_ia32_t;
|
|
|
|
struct ucontext_ia32 {
|
|
unsigned int uc_flags;
|
|
unsigned int uc_link;
|
|
stack_ia32_t uc_stack;
|
|
struct sigcontext_ia32 uc_mcontext;
|
|
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
|
};
|
|
|
|
struct ucontext_x32 {
|
|
unsigned int uc_flags;
|
|
unsigned int uc_link;
|
|
stack_ia32_t uc_stack;
|
|
unsigned int uc__pad0; /* needed for alignment */
|
|
struct sigcontext uc_mcontext; /* the 64-bit sigcontext type */
|
|
compat_sigset_t uc_sigmask; /* mask last for extensibility */
|
|
};
|
|
|
|
/* This matches struct stat64 in glibc2.2, hence the absolutely
|
|
* insane amounts of padding around dev_t's.
|
|
*/
|
|
struct stat64 {
|
|
unsigned long long st_dev;
|
|
unsigned char __pad0[4];
|
|
|
|
#define STAT64_HAS_BROKEN_ST_INO 1
|
|
unsigned int __st_ino;
|
|
|
|
unsigned int st_mode;
|
|
unsigned int st_nlink;
|
|
|
|
unsigned int st_uid;
|
|
unsigned int st_gid;
|
|
|
|
unsigned long long st_rdev;
|
|
unsigned char __pad3[4];
|
|
|
|
long long st_size;
|
|
unsigned int st_blksize;
|
|
|
|
long long st_blocks;/* Number 512-byte blocks allocated */
|
|
|
|
unsigned st_atime;
|
|
unsigned st_atime_nsec;
|
|
unsigned st_mtime;
|
|
unsigned st_mtime_nsec;
|
|
unsigned st_ctime;
|
|
unsigned st_ctime_nsec;
|
|
|
|
unsigned long long st_ino;
|
|
} __attribute__((packed));
|
|
|
|
typedef struct compat_siginfo {
|
|
int si_signo;
|
|
int si_errno;
|
|
int si_code;
|
|
|
|
union {
|
|
int _pad[((128 / sizeof(int)) - 3)];
|
|
|
|
/* kill() */
|
|
struct {
|
|
unsigned int _pid; /* sender's pid */
|
|
unsigned int _uid; /* sender's uid */
|
|
} _kill;
|
|
|
|
/* POSIX.1b timers */
|
|
struct {
|
|
compat_timer_t _tid; /* timer id */
|
|
int _overrun; /* overrun count */
|
|
compat_sigval_t _sigval; /* same as below */
|
|
int _sys_private; /* not to be passed to user */
|
|
int _overrun_incr; /* amount to add to overrun */
|
|
} _timer;
|
|
|
|
/* POSIX.1b signals */
|
|
struct {
|
|
unsigned int _pid; /* sender's pid */
|
|
unsigned int _uid; /* sender's uid */
|
|
compat_sigval_t _sigval;
|
|
} _rt;
|
|
|
|
/* SIGCHLD */
|
|
struct {
|
|
unsigned int _pid; /* which child */
|
|
unsigned int _uid; /* sender's uid */
|
|
int _status; /* exit code */
|
|
compat_clock_t _utime;
|
|
compat_clock_t _stime;
|
|
} _sigchld;
|
|
|
|
/* SIGCHLD (x32 version) */
|
|
struct {
|
|
unsigned int _pid; /* which child */
|
|
unsigned int _uid; /* sender's uid */
|
|
int _status; /* exit code */
|
|
s64 _utime;
|
|
s64 _stime;
|
|
} _sigchld_x32;
|
|
|
|
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
|
|
struct {
|
|
unsigned int _addr; /* faulting insn/memory ref. */
|
|
} _sigfault;
|
|
|
|
/* SIGPOLL */
|
|
struct {
|
|
int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
|
|
int _fd;
|
|
} _sigpoll;
|
|
} _sifields;
|
|
} compat_siginfo_t;
|
|
|
|
#define IA32_STACK_TOP IA32_PAGE_OFFSET
|
|
|
|
#ifdef __KERNEL__
|
|
struct linux_binprm;
|
|
extern int ia32_setup_arg_pages(struct linux_binprm *bprm,
|
|
unsigned long stack_top, int exec_stack);
|
|
struct mm_struct;
|
|
extern void ia32_pick_mmap_layout(struct mm_struct *mm);
|
|
|
|
#endif
|
|
|
|
#endif /* !CONFIG_IA32_SUPPORT */
|
|
|
|
#endif /* _ASM_X86_IA32_H */
|