diff options
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 76 |
1 files changed, 3 insertions, 73 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 60353f5acc48..e00e5f6e7fdd 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -161,60 +161,6 @@ out: | |||
161 | return error; | 161 | return error; |
162 | } | 162 | } |
163 | 163 | ||
164 | struct dirent32 { | ||
165 | unsigned int d_ino; | ||
166 | unsigned int d_off; | ||
167 | unsigned short d_reclen; | ||
168 | char d_name[NAME_MAX + 1]; | ||
169 | }; | ||
170 | |||
171 | static void | ||
172 | xlate_dirent(void *dirent64, void *dirent32, long n) | ||
173 | { | ||
174 | long off; | ||
175 | struct dirent *dirp; | ||
176 | struct dirent32 *dirp32; | ||
177 | |||
178 | off = 0; | ||
179 | while (off < n) { | ||
180 | dirp = (struct dirent *)(dirent64 + off); | ||
181 | dirp32 = (struct dirent32 *)(dirent32 + off); | ||
182 | off += dirp->d_reclen; | ||
183 | dirp32->d_ino = dirp->d_ino; | ||
184 | dirp32->d_off = (unsigned int)dirp->d_off; | ||
185 | dirp32->d_reclen = dirp->d_reclen; | ||
186 | strncpy(dirp32->d_name, dirp->d_name, dirp->d_reclen - ((3 * 4) + 2)); | ||
187 | } | ||
188 | return; | ||
189 | } | ||
190 | |||
191 | asmlinkage long | ||
192 | sys32_getdents(unsigned int fd, void * dirent32, unsigned int count) | ||
193 | { | ||
194 | long n; | ||
195 | void *dirent64; | ||
196 | |||
197 | dirent64 = (void *)((unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1)); | ||
198 | if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0) | ||
199 | return(n); | ||
200 | xlate_dirent(dirent64, dirent32, n); | ||
201 | return(n); | ||
202 | } | ||
203 | |||
204 | asmlinkage int old_readdir(unsigned int fd, void * dirent, unsigned int count); | ||
205 | |||
206 | asmlinkage int | ||
207 | sys32_readdir(unsigned int fd, void * dirent32, unsigned int count) | ||
208 | { | ||
209 | int n; | ||
210 | struct dirent dirent64; | ||
211 | |||
212 | if ((n = old_readdir(fd, &dirent64, count)) < 0) | ||
213 | return(n); | ||
214 | xlate_dirent(&dirent64, dirent32, dirent64.d_reclen); | ||
215 | return(n); | ||
216 | } | ||
217 | |||
218 | asmlinkage int | 164 | asmlinkage int |
219 | sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) | 165 | sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options) |
220 | { | 166 | { |
@@ -230,6 +176,9 @@ sysn32_waitid(int which, compat_pid_t pid, | |||
230 | long ret; | 176 | long ret; |
231 | mm_segment_t old_fs = get_fs(); | 177 | mm_segment_t old_fs = get_fs(); |
232 | 178 | ||
179 | if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo))) | ||
180 | return -EFAULT; | ||
181 | |||
233 | set_fs (KERNEL_DS); | 182 | set_fs (KERNEL_DS); |
234 | ret = sys_waitid(which, pid, uinfo, options, | 183 | ret = sys_waitid(which, pid, uinfo, options, |
235 | uru ? (struct rusage __user *) &ru : NULL); | 184 | uru ? (struct rusage __user *) &ru : NULL); |
@@ -1450,25 +1399,6 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *ti | |||
1450 | return sys_timer_create(clock, p, timer_id); | 1399 | return sys_timer_create(clock, p, timer_id); |
1451 | } | 1400 | } |
1452 | 1401 | ||
1453 | asmlinkage long | ||
1454 | sysn32_rt_sigtimedwait(const sigset_t __user *uthese, | ||
1455 | siginfo_t __user *uinfo, | ||
1456 | const struct compat_timespec __user *uts32, | ||
1457 | size_t sigsetsize) | ||
1458 | { | ||
1459 | struct timespec __user *uts = NULL; | ||
1460 | |||
1461 | if (uts32) { | ||
1462 | struct timespec ts; | ||
1463 | uts = compat_alloc_user_space(sizeof(struct timespec)); | ||
1464 | if (get_user(ts.tv_sec, &uts32->tv_sec) || | ||
1465 | get_user(ts.tv_nsec, &uts32->tv_nsec) || | ||
1466 | copy_to_user (uts, &ts, sizeof (ts))) | ||
1467 | return -EFAULT; | ||
1468 | } | ||
1469 | return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize); | ||
1470 | } | ||
1471 | |||
1472 | save_static_function(sys32_clone); | 1402 | save_static_function(sys32_clone); |
1473 | __attribute_used__ noinline static int | 1403 | __attribute_used__ noinline static int |
1474 | _sys32_clone(nabi_no_regargs struct pt_regs regs) | 1404 | _sys32_clone(nabi_no_regargs struct pt_regs regs) |