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