blob: ca0eac647a05bd96dec5385b3c043a8f1bcc1375 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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
9#define COMPAT_USER_HZ 100
10
11typedef u32 compat_size_t;
12typedef s32 compat_ssize_t;
13typedef s32 compat_time_t;
14typedef s32 compat_clock_t;
15typedef s32 compat_pid_t;
16typedef u32 compat_uid_t;
17typedef u32 compat_gid_t;
18typedef u16 compat_mode_t;
19typedef u32 compat_ino_t;
20typedef u32 compat_dev_t;
21typedef s32 compat_off_t;
22typedef s64 compat_loff_t;
23typedef u16 compat_nlink_t;
24typedef u16 compat_ipc_pid_t;
25typedef s32 compat_daddr_t;
26typedef u32 compat_caddr_t;
27typedef u32 compat_timer_t;
28
29typedef s32 compat_int_t;
30typedef s32 compat_long_t;
31typedef u32 compat_uint_t;
32typedef u32 compat_ulong_t;
33
34struct compat_timespec {
35 compat_time_t tv_sec;
36 s32 tv_nsec;
37};
38
39struct compat_timeval {
40 compat_time_t tv_sec;
41 s32 tv_usec;
42};
43
44struct compat_stat {
45 compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
46 compat_ino_t st_ino; /* 32 bits */
47 compat_mode_t st_mode; /* 16 bits */
48 compat_nlink_t st_nlink; /* 16 bits */
49 u16 st_reserved1; /* old st_uid */
50 u16 st_reserved2; /* old st_gid */
51 compat_dev_t st_rdev;
52 compat_off_t st_size;
53 compat_time_t st_atime;
54 u32 st_atime_nsec;
55 compat_time_t st_mtime;
56 u32 st_mtime_nsec;
57 compat_time_t st_ctime;
58 u32 st_ctime_nsec;
59 s32 st_blksize;
60 s32 st_blocks;
61 u32 __unused1; /* ACL stuff */
62 compat_dev_t __unused2; /* network */
63 compat_ino_t __unused3; /* network */
64 u32 __unused4; /* cnodes */
65 u16 __unused5; /* netsite */
66 short st_fstype;
67 compat_dev_t st_realdev;
68 u16 st_basemode;
69 u16 st_spareshort;
70 compat_uid_t st_uid;
71 compat_gid_t st_gid;
72 u32 st_spare4[3];
73};
74
75struct compat_flock {
76 short l_type;
77 short l_whence;
78 compat_off_t l_start;
79 compat_off_t l_len;
80 compat_pid_t l_pid;
81};
82
83struct compat_flock64 {
84 short l_type;
85 short l_whence;
86 compat_loff_t l_start;
87 compat_loff_t l_len;
88 compat_pid_t l_pid;
89};
90
91struct compat_statfs {
92 s32 f_type;
93 s32 f_bsize;
94 s32 f_blocks;
95 s32 f_bfree;
96 s32 f_bavail;
97 s32 f_files;
98 s32 f_ffree;
99 __kernel_fsid_t f_fsid;
100 s32 f_namelen;
101 s32 f_frsize;
102 s32 f_spare[5];
103};
104
105struct compat_sigcontext {
106 compat_int_t sc_flags;
107 compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */
108 u64 sc_fr[32];
109 compat_int_t sc_iasq[2];
110 compat_int_t sc_iaoq[2];
111 compat_int_t sc_sar; /* cr11 */
112};
113
114#define COMPAT_RLIM_INFINITY 0xffffffff
115
116typedef u32 compat_old_sigset_t; /* at least 32 bits */
117
118#define _COMPAT_NSIG 64
119#define _COMPAT_NSIG_BPW 32
120
121typedef u32 compat_sigset_word;
122
123#define COMPAT_OFF_T_MAX 0x7fffffff
124#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
125
126/*
127 * A pointer passed in from user mode. This should not
128 * be used for syscall parameters, just declare them
129 * as pointers because the syscall entry code will have
130 * appropriately comverted them already.
131 */
132typedef u32 compat_uptr_t;
133
134static inline void __user *compat_ptr(compat_uptr_t uptr)
135{
136 return (void __user *)(unsigned long)uptr;
137}
138
139static __inline__ void __user *compat_alloc_user_space(long len)
140{
141 struct pt_regs *regs = &current->thread.regs;
142 return (void __user *)regs->gr[30];
143}
144
145#endif /* _ASM_PARISC_COMPAT_H */