Path: blob/master/arch/parisc/include/asm/compat.h
10819 views
#ifndef _ASM_PARISC_COMPAT_H1#define _ASM_PARISC_COMPAT_H2/*3* Architecture specific compatibility types4*/5#include <linux/types.h>6#include <linux/sched.h>7#include <linux/thread_info.h>89#define COMPAT_USER_HZ 10010#define COMPAT_UTS_MACHINE "parisc\0\0"1112typedef u32 compat_size_t;13typedef s32 compat_ssize_t;14typedef s32 compat_time_t;15typedef s32 compat_clock_t;16typedef s32 compat_pid_t;17typedef u32 __compat_uid_t;18typedef u32 __compat_gid_t;19typedef u32 __compat_uid32_t;20typedef u32 __compat_gid32_t;21typedef u16 compat_mode_t;22typedef u32 compat_ino_t;23typedef u32 compat_dev_t;24typedef s32 compat_off_t;25typedef s64 compat_loff_t;26typedef u16 compat_nlink_t;27typedef u16 compat_ipc_pid_t;28typedef s32 compat_daddr_t;29typedef u32 compat_caddr_t;30typedef s32 compat_timer_t;3132typedef s32 compat_int_t;33typedef s32 compat_long_t;34typedef s64 compat_s64;35typedef u32 compat_uint_t;36typedef u32 compat_ulong_t;37typedef u64 compat_u64;3839struct compat_timespec {40compat_time_t tv_sec;41s32 tv_nsec;42};4344struct compat_timeval {45compat_time_t tv_sec;46s32 tv_usec;47};4849struct compat_stat {50compat_dev_t st_dev; /* dev_t is 32 bits on parisc */51compat_ino_t st_ino; /* 32 bits */52compat_mode_t st_mode; /* 16 bits */53compat_nlink_t st_nlink; /* 16 bits */54u16 st_reserved1; /* old st_uid */55u16 st_reserved2; /* old st_gid */56compat_dev_t st_rdev;57compat_off_t st_size;58compat_time_t st_atime;59u32 st_atime_nsec;60compat_time_t st_mtime;61u32 st_mtime_nsec;62compat_time_t st_ctime;63u32 st_ctime_nsec;64s32 st_blksize;65s32 st_blocks;66u32 __unused1; /* ACL stuff */67compat_dev_t __unused2; /* network */68compat_ino_t __unused3; /* network */69u32 __unused4; /* cnodes */70u16 __unused5; /* netsite */71short st_fstype;72compat_dev_t st_realdev;73u16 st_basemode;74u16 st_spareshort;75__compat_uid32_t st_uid;76__compat_gid32_t st_gid;77u32 st_spare4[3];78};7980struct compat_flock {81short l_type;82short l_whence;83compat_off_t l_start;84compat_off_t l_len;85compat_pid_t l_pid;86};8788struct compat_flock64 {89short l_type;90short l_whence;91compat_loff_t l_start;92compat_loff_t l_len;93compat_pid_t l_pid;94};9596struct compat_statfs {97s32 f_type;98s32 f_bsize;99s32 f_blocks;100s32 f_bfree;101s32 f_bavail;102s32 f_files;103s32 f_ffree;104__kernel_fsid_t f_fsid;105s32 f_namelen;106s32 f_frsize;107s32 f_spare[5];108};109110struct compat_sigcontext {111compat_int_t sc_flags;112compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */113u64 sc_fr[32];114compat_int_t sc_iasq[2];115compat_int_t sc_iaoq[2];116compat_int_t sc_sar; /* cr11 */117};118119#define COMPAT_RLIM_INFINITY 0xffffffff120121typedef u32 compat_old_sigset_t; /* at least 32 bits */122123#define _COMPAT_NSIG 64124#define _COMPAT_NSIG_BPW 32125126typedef u32 compat_sigset_word;127128#define COMPAT_OFF_T_MAX 0x7fffffff129#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL130131/*132* A pointer passed in from user mode. This should not133* be used for syscall parameters, just declare them134* as pointers because the syscall entry code will have135* appropriately converted them already.136*/137typedef u32 compat_uptr_t;138139static inline void __user *compat_ptr(compat_uptr_t uptr)140{141return (void __user *)(unsigned long)uptr;142}143144static inline compat_uptr_t ptr_to_compat(void __user *uptr)145{146return (u32)(unsigned long)uptr;147}148149static __inline__ void __user *arch_compat_alloc_user_space(long len)150{151struct pt_regs *regs = ¤t->thread.regs;152return (void __user *)regs->gr[30];153}154155static inline int __is_compat_task(struct task_struct *t)156{157return test_ti_thread_flag(task_thread_info(t), TIF_32BIT);158}159160static inline int is_compat_task(void)161{162return __is_compat_task(current);163}164165#endif /* _ASM_PARISC_COMPAT_H */166167168