Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
at v2.6.18-rc7 163 lines 3.6 kB view raw
1#ifndef _ASM_PARISC_COMPAT_H 2#define _ASM_PARISC_COMPAT_H 3/* 4 * Architecture specific compatibility types 5 */ 6#include <linux/types.h> 7#include <linux/sched.h> 8#include <linux/personality.h> 9 10#define COMPAT_USER_HZ 100 11 12typedef 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; 31 32typedef s32 compat_int_t; 33typedef s32 compat_long_t; 34typedef u32 compat_uint_t; 35typedef u32 compat_ulong_t; 36 37struct compat_timespec { 38 compat_time_t tv_sec; 39 s32 tv_nsec; 40}; 41 42struct compat_timeval { 43 compat_time_t tv_sec; 44 s32 tv_usec; 45}; 46 47struct compat_stat { 48 compat_dev_t st_dev; /* dev_t is 32 bits on parisc */ 49 compat_ino_t st_ino; /* 32 bits */ 50 compat_mode_t st_mode; /* 16 bits */ 51 compat_nlink_t st_nlink; /* 16 bits */ 52 u16 st_reserved1; /* old st_uid */ 53 u16 st_reserved2; /* old st_gid */ 54 compat_dev_t st_rdev; 55 compat_off_t st_size; 56 compat_time_t st_atime; 57 u32 st_atime_nsec; 58 compat_time_t st_mtime; 59 u32 st_mtime_nsec; 60 compat_time_t st_ctime; 61 u32 st_ctime_nsec; 62 s32 st_blksize; 63 s32 st_blocks; 64 u32 __unused1; /* ACL stuff */ 65 compat_dev_t __unused2; /* network */ 66 compat_ino_t __unused3; /* network */ 67 u32 __unused4; /* cnodes */ 68 u16 __unused5; /* netsite */ 69 short st_fstype; 70 compat_dev_t st_realdev; 71 u16 st_basemode; 72 u16 st_spareshort; 73 __compat_uid32_t st_uid; 74 __compat_gid32_t st_gid; 75 u32 st_spare4[3]; 76}; 77 78struct compat_flock { 79 short l_type; 80 short l_whence; 81 compat_off_t l_start; 82 compat_off_t l_len; 83 compat_pid_t l_pid; 84}; 85 86struct compat_flock64 { 87 short l_type; 88 short l_whence; 89 compat_loff_t l_start; 90 compat_loff_t l_len; 91 compat_pid_t l_pid; 92}; 93 94struct compat_statfs { 95 s32 f_type; 96 s32 f_bsize; 97 s32 f_blocks; 98 s32 f_bfree; 99 s32 f_bavail; 100 s32 f_files; 101 s32 f_ffree; 102 __kernel_fsid_t f_fsid; 103 s32 f_namelen; 104 s32 f_frsize; 105 s32 f_spare[5]; 106}; 107 108struct compat_sigcontext { 109 compat_int_t sc_flags; 110 compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */ 111 u64 sc_fr[32]; 112 compat_int_t sc_iasq[2]; 113 compat_int_t sc_iaoq[2]; 114 compat_int_t sc_sar; /* cr11 */ 115}; 116 117#define COMPAT_RLIM_INFINITY 0xffffffff 118 119typedef u32 compat_old_sigset_t; /* at least 32 bits */ 120 121#define _COMPAT_NSIG 64 122#define _COMPAT_NSIG_BPW 32 123 124typedef u32 compat_sigset_word; 125 126#define COMPAT_OFF_T_MAX 0x7fffffff 127#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL 128 129/* 130 * A pointer passed in from user mode. This should not 131 * be used for syscall parameters, just declare them 132 * as pointers because the syscall entry code will have 133 * appropriately comverted them already. 134 */ 135typedef u32 compat_uptr_t; 136 137static inline void __user *compat_ptr(compat_uptr_t uptr) 138{ 139 return (void __user *)(unsigned long)uptr; 140} 141 142static inline compat_uptr_t ptr_to_compat(void __user *uptr) 143{ 144 return (u32)(unsigned long)uptr; 145} 146 147static __inline__ void __user *compat_alloc_user_space(long len) 148{ 149 struct pt_regs *regs = &current->thread.regs; 150 return (void __user *)regs->gr[30]; 151} 152 153static inline int __is_compat_task(struct task_struct *t) 154{ 155 return personality(t->personality) == PER_LINUX32; 156} 157 158static inline int is_compat_task(void) 159{ 160 return __is_compat_task(current); 161} 162 163#endif /* _ASM_PARISC_COMPAT_H */