diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-ia64/compat.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-ia64/compat.h')
-rw-r--r-- | include/asm-ia64/compat.h | 198 |
1 files changed, 198 insertions, 0 deletions
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h new file mode 100644 index 000000000000..cc0ff0a4bdd0 --- /dev/null +++ b/include/asm-ia64/compat.h | |||
@@ -0,0 +1,198 @@ | |||
1 | #ifndef _ASM_IA64_COMPAT_H | ||
2 | #define _ASM_IA64_COMPAT_H | ||
3 | /* | ||
4 | * Architecture specific compatibility types | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | |||
8 | #define COMPAT_USER_HZ 100 | ||
9 | |||
10 | typedef u32 compat_size_t; | ||
11 | typedef s32 compat_ssize_t; | ||
12 | typedef s32 compat_time_t; | ||
13 | typedef s32 compat_clock_t; | ||
14 | typedef s32 compat_key_t; | ||
15 | typedef s32 compat_pid_t; | ||
16 | typedef u16 compat_uid_t; | ||
17 | typedef u16 compat_gid_t; | ||
18 | typedef u32 compat_uid32_t; | ||
19 | typedef u32 compat_gid32_t; | ||
20 | typedef u16 compat_mode_t; | ||
21 | typedef u32 compat_ino_t; | ||
22 | typedef u16 compat_dev_t; | ||
23 | typedef s32 compat_off_t; | ||
24 | typedef s64 compat_loff_t; | ||
25 | typedef u16 compat_nlink_t; | ||
26 | typedef u16 compat_ipc_pid_t; | ||
27 | typedef s32 compat_daddr_t; | ||
28 | typedef u32 compat_caddr_t; | ||
29 | typedef __kernel_fsid_t compat_fsid_t; | ||
30 | |||
31 | typedef s32 compat_int_t; | ||
32 | typedef s32 compat_long_t; | ||
33 | typedef u32 compat_uint_t; | ||
34 | typedef u32 compat_ulong_t; | ||
35 | |||
36 | struct compat_timespec { | ||
37 | compat_time_t tv_sec; | ||
38 | s32 tv_nsec; | ||
39 | }; | ||
40 | |||
41 | struct compat_timeval { | ||
42 | compat_time_t tv_sec; | ||
43 | s32 tv_usec; | ||
44 | }; | ||
45 | |||
46 | struct compat_stat { | ||
47 | compat_dev_t st_dev; | ||
48 | u16 __pad1; | ||
49 | compat_ino_t st_ino; | ||
50 | compat_mode_t st_mode; | ||
51 | compat_nlink_t st_nlink; | ||
52 | compat_uid_t st_uid; | ||
53 | compat_gid_t st_gid; | ||
54 | compat_dev_t st_rdev; | ||
55 | u16 __pad2; | ||
56 | u32 st_size; | ||
57 | u32 st_blksize; | ||
58 | u32 st_blocks; | ||
59 | u32 st_atime; | ||
60 | u32 st_atime_nsec; | ||
61 | u32 st_mtime; | ||
62 | u32 st_mtime_nsec; | ||
63 | u32 st_ctime; | ||
64 | u32 st_ctime_nsec; | ||
65 | u32 __unused4; | ||
66 | u32 __unused5; | ||
67 | }; | ||
68 | |||
69 | struct compat_flock { | ||
70 | short l_type; | ||
71 | short l_whence; | ||
72 | compat_off_t l_start; | ||
73 | compat_off_t l_len; | ||
74 | compat_pid_t l_pid; | ||
75 | }; | ||
76 | |||
77 | #define F_GETLK64 12 | ||
78 | #define F_SETLK64 13 | ||
79 | #define F_SETLKW64 14 | ||
80 | |||
81 | /* | ||
82 | * IA32 uses 4 byte alignment for 64 bit quantities, | ||
83 | * so we need to pack this structure. | ||
84 | */ | ||
85 | struct 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 | } __attribute__((packed)); | ||
92 | |||
93 | struct compat_statfs { | ||
94 | int f_type; | ||
95 | int f_bsize; | ||
96 | int f_blocks; | ||
97 | int f_bfree; | ||
98 | int f_bavail; | ||
99 | int f_files; | ||
100 | int f_ffree; | ||
101 | compat_fsid_t f_fsid; | ||
102 | int f_namelen; /* SunOS ignores this field. */ | ||
103 | int f_frsize; | ||
104 | int f_spare[5]; | ||
105 | }; | ||
106 | |||
107 | #define COMPAT_RLIM_OLD_INFINITY 0x7fffffff | ||
108 | #define COMPAT_RLIM_INFINITY 0xffffffff | ||
109 | |||
110 | typedef u32 compat_old_sigset_t; /* at least 32 bits */ | ||
111 | |||
112 | #define _COMPAT_NSIG 64 | ||
113 | #define _COMPAT_NSIG_BPW 32 | ||
114 | |||
115 | typedef u32 compat_sigset_word; | ||
116 | |||
117 | #define COMPAT_OFF_T_MAX 0x7fffffff | ||
118 | #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL | ||
119 | |||
120 | struct compat_ipc64_perm { | ||
121 | compat_key_t key; | ||
122 | compat_uid32_t uid; | ||
123 | compat_gid32_t gid; | ||
124 | compat_uid32_t cuid; | ||
125 | compat_gid32_t cgid; | ||
126 | unsigned short mode; | ||
127 | unsigned short __pad1; | ||
128 | unsigned short seq; | ||
129 | unsigned short __pad2; | ||
130 | compat_ulong_t unused1; | ||
131 | compat_ulong_t unused2; | ||
132 | }; | ||
133 | |||
134 | struct compat_semid64_ds { | ||
135 | struct compat_ipc64_perm sem_perm; | ||
136 | compat_time_t sem_otime; | ||
137 | compat_ulong_t __unused1; | ||
138 | compat_time_t sem_ctime; | ||
139 | compat_ulong_t __unused2; | ||
140 | compat_ulong_t sem_nsems; | ||
141 | compat_ulong_t __unused3; | ||
142 | compat_ulong_t __unused4; | ||
143 | }; | ||
144 | |||
145 | struct compat_msqid64_ds { | ||
146 | struct compat_ipc64_perm msg_perm; | ||
147 | compat_time_t msg_stime; | ||
148 | compat_ulong_t __unused1; | ||
149 | compat_time_t msg_rtime; | ||
150 | compat_ulong_t __unused2; | ||
151 | compat_time_t msg_ctime; | ||
152 | compat_ulong_t __unused3; | ||
153 | compat_ulong_t msg_cbytes; | ||
154 | compat_ulong_t msg_qnum; | ||
155 | compat_ulong_t msg_qbytes; | ||
156 | compat_pid_t msg_lspid; | ||
157 | compat_pid_t msg_lrpid; | ||
158 | compat_ulong_t __unused4; | ||
159 | compat_ulong_t __unused5; | ||
160 | }; | ||
161 | |||
162 | struct compat_shmid64_ds { | ||
163 | struct compat_ipc64_perm shm_perm; | ||
164 | compat_size_t shm_segsz; | ||
165 | compat_time_t shm_atime; | ||
166 | compat_ulong_t __unused1; | ||
167 | compat_time_t shm_dtime; | ||
168 | compat_ulong_t __unused2; | ||
169 | compat_time_t shm_ctime; | ||
170 | compat_ulong_t __unused3; | ||
171 | compat_pid_t shm_cpid; | ||
172 | compat_pid_t shm_lpid; | ||
173 | compat_ulong_t shm_nattch; | ||
174 | compat_ulong_t __unused4; | ||
175 | compat_ulong_t __unused5; | ||
176 | }; | ||
177 | |||
178 | /* | ||
179 | * A pointer passed in from user mode. This should not be used for syscall parameters, | ||
180 | * just declare them as pointers because the syscall entry code will have appropriately | ||
181 | * comverted them already. | ||
182 | */ | ||
183 | typedef u32 compat_uptr_t; | ||
184 | |||
185 | static inline void __user * | ||
186 | compat_ptr (compat_uptr_t uptr) | ||
187 | { | ||
188 | return (void __user *) (unsigned long) uptr; | ||
189 | } | ||
190 | |||
191 | static __inline__ void __user * | ||
192 | compat_alloc_user_space (long len) | ||
193 | { | ||
194 | struct pt_regs *regs = ia64_task_regs(current); | ||
195 | return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len); | ||
196 | } | ||
197 | |||
198 | #endif /* _ASM_IA64_COMPAT_H */ | ||