initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / x86_64 / ia32 / sys_ia32.c
blob50465345140add226e376839046c4dfdd8436a81
1 /*
2 * sys_ia32.c: Conversion between 32bit and 64bit native syscalls. Based on
3 * sys_sparc32
5 * Copyright (C) 2000 VA Linux Co
6 * Copyright (C) 2000 Don Dugger <n0ano@valinux.com>
7 * Copyright (C) 1999 Arun Sharma <arun.sharma@intel.com>
8 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
9 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
10 * Copyright (C) 2000 Hewlett-Packard Co.
11 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
12 * Copyright (C) 2000,2001,2002 Andi Kleen, SuSE Labs (x86-64 port)
14 * These routines maintain argument size conversion between 32bit and 64bit
15 * environment. In 2.5 most of this should be moved to a generic directory.
17 * This file assumes that there is a hole at the end of user address space.
19 * Some of the functions are LE specific currently. These are hopefully all marked.
20 * This should be fixed.
23 #include <linux/config.h>
24 #include <linux/kernel.h>
25 #include <linux/sched.h>
26 #include <linux/fs.h>
27 #include <linux/file.h>
28 #include <linux/signal.h>
29 #include <linux/syscalls.h>
30 #include <linux/resource.h>
31 #include <linux/times.h>
32 #include <linux/utsname.h>
33 #include <linux/timex.h>
34 #include <linux/smp.h>
35 #include <linux/smp_lock.h>
36 #include <linux/sem.h>
37 #include <linux/msg.h>
38 #include <linux/mm.h>
39 #include <linux/shm.h>
40 #include <linux/slab.h>
41 #include <linux/uio.h>
42 #include <linux/nfs_fs.h>
43 #include <linux/quota.h>
44 #include <linux/module.h>
45 #include <linux/sunrpc/svc.h>
46 #include <linux/nfsd/nfsd.h>
47 #include <linux/nfsd/cache.h>
48 #include <linux/nfsd/xdr.h>
49 #include <linux/nfsd/syscall.h>
50 #include <linux/poll.h>
51 #include <linux/personality.h>
52 #include <linux/stat.h>
53 #include <linux/ipc.h>
54 #include <linux/rwsem.h>
55 #include <linux/binfmts.h>
56 #include <linux/init.h>
57 #include <linux/aio_abi.h>
58 #include <linux/aio.h>
59 #include <linux/compat.h>
60 #include <linux/vfs.h>
61 #include <linux/ptrace.h>
62 #include <linux/highuid.h>
63 #include <linux/vmalloc.h>
64 #include <asm/mman.h>
65 #include <asm/types.h>
66 #include <asm/uaccess.h>
67 #include <asm/semaphore.h>
68 #include <asm/ipc.h>
69 #include <asm/atomic.h>
70 #include <asm/ldt.h>
72 #include <net/scm.h>
73 #include <net/sock.h>
74 #include <asm/ia32.h>
76 #define A(__x) ((unsigned long)(__x))
77 #define AA(__x) ((unsigned long)(__x))
78 #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1)))
79 #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
81 int cp_compat_stat(struct kstat *kbuf, struct compat_stat __user *ubuf)
83 typeof(ubuf->st_uid) uid = 0;
84 typeof(ubuf->st_gid) gid = 0;
85 SET_UID(uid, kbuf->uid);
86 SET_GID(gid, kbuf->gid);
87 if (!old_valid_dev(kbuf->dev) || !old_valid_dev(kbuf->rdev))
88 return -EOVERFLOW;
89 if (kbuf->size >= 0x7fffffff)
90 return -EOVERFLOW;
91 if (verify_area(VERIFY_WRITE, ubuf, sizeof(struct compat_stat)) ||
92 __put_user (old_encode_dev(kbuf->dev), &ubuf->st_dev) ||
93 __put_user (kbuf->ino, &ubuf->st_ino) ||
94 __put_user (kbuf->mode, &ubuf->st_mode) ||
95 __put_user (kbuf->nlink, &ubuf->st_nlink) ||
96 __put_user (uid, &ubuf->st_uid) ||
97 __put_user (gid, &ubuf->st_gid) ||
98 __put_user (old_encode_dev(kbuf->rdev), &ubuf->st_rdev) ||
99 __put_user (kbuf->size, &ubuf->st_size) ||
100 __put_user (kbuf->atime.tv_sec, &ubuf->st_atime) ||
101 __put_user (kbuf->atime.tv_nsec, &ubuf->st_atime_nsec) ||
102 __put_user (kbuf->mtime.tv_sec, &ubuf->st_mtime) ||
103 __put_user (kbuf->mtime.tv_nsec, &ubuf->st_mtime_nsec) ||
104 __put_user (kbuf->ctime.tv_sec, &ubuf->st_ctime) ||
105 __put_user (kbuf->ctime.tv_nsec, &ubuf->st_ctime_nsec) ||
106 __put_user (kbuf->blksize, &ubuf->st_blksize) ||
107 __put_user (kbuf->blocks, &ubuf->st_blocks))
108 return -EFAULT;
109 return 0;
112 asmlinkage long
113 sys32_truncate64(char __user * filename, unsigned long offset_low, unsigned long offset_high)
115 return sys_truncate(filename, ((loff_t) offset_high << 32) | offset_low);
118 asmlinkage long
119 sys32_ftruncate64(unsigned int fd, unsigned long offset_low, unsigned long offset_high)
121 return sys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low);
124 /* Another set for IA32/LFS -- x86_64 struct stat is different due to
125 support for 64bit inode numbers. */
127 static int
128 cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
130 typeof(ubuf->st_uid) uid = 0;
131 typeof(ubuf->st_gid) gid = 0;
132 SET_UID(uid, stat->uid);
133 SET_GID(gid, stat->gid);
134 if (verify_area(VERIFY_WRITE, ubuf, sizeof(struct stat64)) ||
135 __put_user(huge_encode_dev(stat->dev), &ubuf->st_dev) ||
136 __put_user (stat->ino, &ubuf->__st_ino) ||
137 __put_user (stat->ino, &ubuf->st_ino) ||
138 __put_user (stat->mode, &ubuf->st_mode) ||
139 __put_user (stat->nlink, &ubuf->st_nlink) ||
140 __put_user (uid, &ubuf->st_uid) ||
141 __put_user (gid, &ubuf->st_gid) ||
142 __put_user (huge_encode_dev(stat->rdev), &ubuf->st_rdev) ||
143 __put_user (stat->size, &ubuf->st_size) ||
144 __put_user (stat->atime.tv_sec, &ubuf->st_atime) ||
145 __put_user (stat->atime.tv_nsec, &ubuf->st_atime_nsec) ||
146 __put_user (stat->mtime.tv_sec, &ubuf->st_mtime) ||
147 __put_user (stat->mtime.tv_nsec, &ubuf->st_mtime_nsec) ||
148 __put_user (stat->ctime.tv_sec, &ubuf->st_ctime) ||
149 __put_user (stat->ctime.tv_nsec, &ubuf->st_ctime_nsec) ||
150 __put_user (stat->blksize, &ubuf->st_blksize) ||
151 __put_user (stat->blocks, &ubuf->st_blocks))
152 return -EFAULT;
153 return 0;
156 asmlinkage long
157 sys32_stat64(char __user * filename, struct stat64 __user *statbuf)
159 struct kstat stat;
160 int ret = vfs_stat(filename, &stat);
161 if (!ret)
162 ret = cp_stat64(statbuf, &stat);
163 return ret;
166 asmlinkage long
167 sys32_lstat64(char __user * filename, struct stat64 __user *statbuf)
169 struct kstat stat;
170 int ret = vfs_lstat(filename, &stat);
171 if (!ret)
172 ret = cp_stat64(statbuf, &stat);
173 return ret;
176 asmlinkage long
177 sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
179 struct kstat stat;
180 int ret = vfs_fstat(fd, &stat);
181 if (!ret)
182 ret = cp_stat64(statbuf, &stat);
183 return ret;
187 * Linux/i386 didn't use to be able to handle more than
188 * 4 system call parameters, so these system calls used a memory
189 * block for parameter passing..
192 struct mmap_arg_struct {
193 unsigned int addr;
194 unsigned int len;
195 unsigned int prot;
196 unsigned int flags;
197 unsigned int fd;
198 unsigned int offset;
201 asmlinkage long
202 sys32_mmap(struct mmap_arg_struct __user *arg)
204 struct mmap_arg_struct a;
205 struct file *file = NULL;
206 unsigned long retval;
207 struct mm_struct *mm ;
209 if (copy_from_user(&a, arg, sizeof(a)))
210 return -EFAULT;
212 if (a.offset & ~PAGE_MASK)
213 return -EINVAL;
215 if (!(a.flags & MAP_ANONYMOUS)) {
216 file = fget(a.fd);
217 if (!file)
218 return -EBADF;
221 if (a.prot & PROT_READ)
222 a.prot |= vm_force_exec32;
224 mm = current->mm;
225 down_write(&mm->mmap_sem);
226 retval = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, a.offset>>PAGE_SHIFT);
227 if (file)
228 fput(file);
230 up_write(&mm->mmap_sem);
232 return retval;
235 asmlinkage long
236 sys32_mprotect(unsigned long start, size_t len, unsigned long prot)
238 if (prot & PROT_READ)
239 prot |= vm_force_exec32;
240 return sys_mprotect(start,len,prot);
243 asmlinkage long
244 sys32_pipe(int __user *fd)
246 int retval;
247 int fds[2];
249 retval = do_pipe(fds);
250 if (retval)
251 goto out;
252 if (copy_to_user(fd, fds, sizeof(fds)))
253 retval = -EFAULT;
254 out:
255 return retval;
258 asmlinkage long
259 sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
260 struct sigaction32 __user *oact, unsigned int sigsetsize)
262 struct k_sigaction new_ka, old_ka;
263 int ret;
264 compat_sigset_t set32;
266 /* XXX: Don't preclude handling different sized sigset_t's. */
267 if (sigsetsize != sizeof(compat_sigset_t))
268 return -EINVAL;
270 if (act) {
271 compat_uptr_t handler, restorer;
273 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
274 __get_user(handler, &act->sa_handler) ||
275 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
276 __get_user(restorer, &act->sa_restorer)||
277 __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t)))
278 return -EFAULT;
279 new_ka.sa.sa_handler = compat_ptr(handler);
280 new_ka.sa.sa_restorer = compat_ptr(restorer);
281 /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
282 switch (_NSIG_WORDS) {
283 case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
284 | (((long)set32.sig[7]) << 32);
285 case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4]
286 | (((long)set32.sig[5]) << 32);
287 case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2]
288 | (((long)set32.sig[3]) << 32);
289 case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0]
290 | (((long)set32.sig[1]) << 32);
294 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
296 if (!ret && oact) {
297 /* FIXME: here we rely on _COMPAT_NSIG_WORS to be >= than _NSIG_WORDS << 1 */
298 switch (_NSIG_WORDS) {
299 case 4:
300 set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32);
301 set32.sig[6] = old_ka.sa.sa_mask.sig[3];
302 case 3:
303 set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32);
304 set32.sig[4] = old_ka.sa.sa_mask.sig[2];
305 case 2:
306 set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32);
307 set32.sig[2] = old_ka.sa.sa_mask.sig[1];
308 case 1:
309 set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
310 set32.sig[0] = old_ka.sa.sa_mask.sig[0];
312 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
313 __put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) ||
314 __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) ||
315 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
316 __copy_to_user(&oact->sa_mask, &set32, sizeof(compat_sigset_t)))
317 return -EFAULT;
320 return ret;
323 asmlinkage long
324 sys32_sigaction (int sig, struct old_sigaction32 __user *act, struct old_sigaction32 __user *oact)
326 struct k_sigaction new_ka, old_ka;
327 int ret;
329 if (act) {
330 compat_old_sigset_t mask;
331 compat_uptr_t handler, restorer;
333 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
334 __get_user(handler, &act->sa_handler) ||
335 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
336 __get_user(restorer, &act->sa_restorer) ||
337 __get_user(mask, &act->sa_mask))
338 return -EFAULT;
340 new_ka.sa.sa_handler = compat_ptr(handler);
341 new_ka.sa.sa_restorer = compat_ptr(restorer);
343 siginitset(&new_ka.sa.sa_mask, mask);
346 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
348 if (!ret && oact) {
349 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
350 __put_user((long)old_ka.sa.sa_handler, &oact->sa_handler) ||
351 __put_user((long)old_ka.sa.sa_restorer, &oact->sa_restorer) ||
352 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
353 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
354 return -EFAULT;
357 return ret;
360 asmlinkage long
361 sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
362 compat_sigset_t __user *oset, unsigned int sigsetsize)
364 sigset_t s;
365 compat_sigset_t s32;
366 int ret;
367 mm_segment_t old_fs = get_fs();
369 if (set) {
370 if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
371 return -EFAULT;
372 switch (_NSIG_WORDS) {
373 case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
374 case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
375 case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
376 case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
379 set_fs (KERNEL_DS);
380 ret = sys_rt_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL,
381 sigsetsize);
382 set_fs (old_fs);
383 if (ret) return ret;
384 if (oset) {
385 switch (_NSIG_WORDS) {
386 case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
387 case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
388 case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
389 case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
391 if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
392 return -EFAULT;
394 return 0;
397 static inline long
398 get_tv32(struct timeval *o, struct compat_timeval __user *i)
400 int err = -EFAULT;
401 if (access_ok(VERIFY_READ, i, sizeof(*i))) {
402 err = __get_user(o->tv_sec, &i->tv_sec);
403 err |= __get_user(o->tv_usec, &i->tv_usec);
405 return err;
408 static inline long
409 put_tv32(struct compat_timeval __user *o, struct timeval *i)
411 int err = -EFAULT;
412 if (access_ok(VERIFY_WRITE, o, sizeof(*o))) {
413 err = __put_user(i->tv_sec, &o->tv_sec);
414 err |= __put_user(i->tv_usec, &o->tv_usec);
416 return err;
419 extern int do_setitimer(int which, struct itimerval *, struct itimerval *);
421 asmlinkage long
422 sys32_alarm(unsigned int seconds)
424 struct itimerval it_new, it_old;
425 unsigned int oldalarm;
427 it_new.it_interval.tv_sec = it_new.it_interval.tv_usec = 0;
428 it_new.it_value.tv_sec = seconds;
429 it_new.it_value.tv_usec = 0;
430 do_setitimer(ITIMER_REAL, &it_new, &it_old);
431 oldalarm = it_old.it_value.tv_sec;
432 /* ehhh.. We can't return 0 if we have an alarm pending.. */
433 /* And we'd better return too much than too little anyway */
434 if (it_old.it_value.tv_usec)
435 oldalarm++;
436 return oldalarm;
439 /* Translations due to time_t size differences. Which affects all
440 sorts of things, like timeval and itimerval. */
442 extern struct timezone sys_tz;
444 asmlinkage long
445 sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
447 if (tv) {
448 struct timeval ktv;
449 do_gettimeofday(&ktv);
450 if (put_tv32(tv, &ktv))
451 return -EFAULT;
453 if (tz) {
454 if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
455 return -EFAULT;
457 return 0;
460 asmlinkage long
461 sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
463 struct timeval ktv;
464 struct timespec kts;
465 struct timezone ktz;
467 if (tv) {
468 if (get_tv32(&ktv, tv))
469 return -EFAULT;
470 kts.tv_sec = ktv.tv_sec;
471 kts.tv_nsec = ktv.tv_usec * NSEC_PER_USEC;
473 if (tz) {
474 if (copy_from_user(&ktz, tz, sizeof(ktz)))
475 return -EFAULT;
478 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
481 struct linux32_dirent {
482 u32 d_ino;
483 u32 d_off;
484 u16 d_reclen;
485 char d_name[1];
488 struct old_linux32_dirent {
489 u32 d_ino;
490 u32 d_offset;
491 u16 d_namlen;
492 char d_name[1];
495 struct getdents32_callback {
496 struct linux32_dirent __user * current_dir;
497 struct linux32_dirent __user * previous;
498 int count;
499 int error;
502 struct readdir32_callback {
503 struct old_linux32_dirent __user * dirent;
504 int count;
507 static int
508 filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
509 unsigned int d_type)
511 struct linux32_dirent __user * dirent;
512 struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
513 int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2, 4);
515 buf->error = -EINVAL; /* only used if we fail.. */
516 if (reclen > buf->count)
517 return -EINVAL;
518 dirent = buf->previous;
519 if (dirent)
520 put_user(offset, &dirent->d_off);
521 dirent = buf->current_dir;
522 buf->previous = dirent;
523 put_user(ino, &dirent->d_ino);
524 put_user(reclen, &dirent->d_reclen);
525 copy_to_user(dirent->d_name, name, namlen);
526 put_user(0, dirent->d_name + namlen);
527 put_user(d_type, (char __user *)dirent + reclen - 1);
528 dirent = ((void __user *)dirent) + reclen;
529 buf->current_dir = dirent;
530 buf->count -= reclen;
531 return 0;
534 asmlinkage long
535 sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
537 struct file * file;
538 struct linux32_dirent __user * lastdirent;
539 struct getdents32_callback buf;
540 int error;
542 error = -EBADF;
543 file = fget(fd);
544 if (!file)
545 goto out;
547 buf.current_dir = (struct linux32_dirent __user *) dirent;
548 buf.previous = NULL;
549 buf.count = count;
550 buf.error = 0;
552 error = vfs_readdir(file, filldir32, &buf);
553 if (error < 0)
554 goto out_putf;
555 error = buf.error;
556 lastdirent = buf.previous;
557 if (lastdirent) {
558 put_user(file->f_pos, &lastdirent->d_off);
559 error = count - buf.count;
562 out_putf:
563 fput(file);
564 out:
565 return error;
568 static int
569 fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, unsigned d_type)
571 struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
572 struct old_linux32_dirent __user * dirent;
574 if (buf->count)
575 return -EINVAL;
576 buf->count++;
577 dirent = buf->dirent;
578 put_user(ino, &dirent->d_ino);
579 put_user(offset, &dirent->d_offset);
580 put_user(namlen, &dirent->d_namlen);
581 copy_to_user(dirent->d_name, name, namlen);
582 put_user(0, dirent->d_name + namlen);
583 return 0;
586 asmlinkage long
587 sys32_oldreaddir (unsigned int fd, void __user * dirent, unsigned int count)
589 int error;
590 struct file * file;
591 struct readdir32_callback buf;
593 error = -EBADF;
594 file = fget(fd);
595 if (!file)
596 goto out;
598 buf.count = 0;
599 buf.dirent = dirent;
601 error = vfs_readdir(file, fillonedir32, &buf);
602 if (error >= 0)
603 error = buf.count;
604 fput(file);
605 out:
606 return error;
609 struct sel_arg_struct {
610 unsigned int n;
611 unsigned int inp;
612 unsigned int outp;
613 unsigned int exp;
614 unsigned int tvp;
617 asmlinkage long
618 sys32_old_select(struct sel_arg_struct __user *arg)
620 struct sel_arg_struct a;
622 if (copy_from_user(&a, arg, sizeof(a)))
623 return -EFAULT;
624 return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
625 compat_ptr(a.exp), compat_ptr(a.tvp));
629 * sys_time() can be implemented in user-level using
630 * sys_gettimeofday(). x86-64 did this but i386 Linux did not
631 * so we have to implement this system call here.
633 asmlinkage long sys32_time(int __user * tloc)
635 int i;
636 struct timeval tv;
638 do_gettimeofday(&tv);
639 i = tv.tv_sec;
641 if (tloc) {
642 if (put_user(i,tloc))
643 i = -EFAULT;
645 return i;
648 extern asmlinkage long
649 compat_sys_wait4(compat_pid_t pid, compat_uint_t * stat_addr, int options,
650 struct compat_rusage *ru);
652 asmlinkage long
653 sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
655 return compat_sys_wait4(pid, stat_addr, options, NULL);
658 int sys32_ni_syscall(int call)
660 struct task_struct *me = current;
661 static char lastcomm[8];
662 if (strcmp(lastcomm, me->comm)) {
663 printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
664 current->comm);
665 strcpy(lastcomm, me->comm);
667 return -ENOSYS;
670 /* 32-bit timeval and related flotsam. */
672 asmlinkage long
673 sys32_sysfs(int option, u32 arg1, u32 arg2)
675 return sys_sysfs(option, arg1, arg2);
678 struct sysinfo32 {
679 s32 uptime;
680 u32 loads[3];
681 u32 totalram;
682 u32 freeram;
683 u32 sharedram;
684 u32 bufferram;
685 u32 totalswap;
686 u32 freeswap;
687 unsigned short procs;
688 unsigned short pad;
689 u32 totalhigh;
690 u32 freehigh;
691 u32 mem_unit;
692 char _f[20-2*sizeof(u32)-sizeof(int)];
695 asmlinkage long
696 sys32_sysinfo(struct sysinfo32 __user *info)
698 struct sysinfo s;
699 int ret;
700 mm_segment_t old_fs = get_fs ();
701 int bitcount = 0;
703 set_fs (KERNEL_DS);
704 ret = sys_sysinfo(&s);
705 set_fs (old_fs);
707 /* Check to see if any memory value is too large for 32-bit and scale
708 * down if needed
710 if ((s.totalram >> 32) || (s.totalswap >> 32)) {
711 while (s.mem_unit < PAGE_SIZE) {
712 s.mem_unit <<= 1;
713 bitcount++;
715 s.totalram >>= bitcount;
716 s.freeram >>= bitcount;
717 s.sharedram >>= bitcount;
718 s.bufferram >>= bitcount;
719 s.totalswap >>= bitcount;
720 s.freeswap >>= bitcount;
721 s.totalhigh >>= bitcount;
722 s.freehigh >>= bitcount;
725 if (verify_area(VERIFY_WRITE, info, sizeof(struct sysinfo32)) ||
726 __put_user (s.uptime, &info->uptime) ||
727 __put_user (s.loads[0], &info->loads[0]) ||
728 __put_user (s.loads[1], &info->loads[1]) ||
729 __put_user (s.loads[2], &info->loads[2]) ||
730 __put_user (s.totalram, &info->totalram) ||
731 __put_user (s.freeram, &info->freeram) ||
732 __put_user (s.sharedram, &info->sharedram) ||
733 __put_user (s.bufferram, &info->bufferram) ||
734 __put_user (s.totalswap, &info->totalswap) ||
735 __put_user (s.freeswap, &info->freeswap) ||
736 __put_user (s.procs, &info->procs) ||
737 __put_user (s.totalhigh, &info->totalhigh) ||
738 __put_user (s.freehigh, &info->freehigh) ||
739 __put_user (s.mem_unit, &info->mem_unit))
740 return -EFAULT;
741 return 0;
744 asmlinkage long
745 sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval)
747 struct timespec t;
748 int ret;
749 mm_segment_t old_fs = get_fs ();
751 set_fs (KERNEL_DS);
752 ret = sys_sched_rr_get_interval(pid, &t);
753 set_fs (old_fs);
754 if (put_compat_timespec(&t, interval))
755 return -EFAULT;
756 return ret;
759 asmlinkage long
760 sys32_rt_sigpending(compat_sigset_t __user *set, compat_size_t sigsetsize)
762 sigset_t s;
763 compat_sigset_t s32;
764 int ret;
765 mm_segment_t old_fs = get_fs();
767 set_fs (KERNEL_DS);
768 ret = sys_rt_sigpending(&s, sigsetsize);
769 set_fs (old_fs);
770 if (!ret) {
771 switch (_NSIG_WORDS) {
772 case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
773 case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
774 case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
775 case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
777 if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
778 return -EFAULT;
780 return ret;
784 asmlinkage long
785 sys32_rt_sigtimedwait(compat_sigset_t __user *uthese, siginfo_t32 __user *uinfo,
786 struct compat_timespec __user *uts, compat_size_t sigsetsize)
788 sigset_t s;
789 compat_sigset_t s32;
790 struct timespec t;
791 int ret;
792 mm_segment_t old_fs = get_fs();
793 siginfo_t info;
795 if (copy_from_user (&s32, uthese, sizeof(compat_sigset_t)))
796 return -EFAULT;
797 switch (_NSIG_WORDS) {
798 case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
799 case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
800 case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
801 case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
803 if (uts && get_compat_timespec(&t, uts))
804 return -EFAULT;
805 if (uinfo) {
806 /* stop data leak to user space in case of structure fill mismatch
807 * between sys_rt_sigtimedwait & ia32_copy_siginfo_to_user.
809 memset(&info, 0, sizeof(info));
811 set_fs (KERNEL_DS);
812 ret = sys_rt_sigtimedwait(&s, uinfo ? &info : NULL, uts ? &t : NULL,
813 sigsetsize);
814 set_fs (old_fs);
815 if (ret >= 0 && uinfo) {
816 if (ia32_copy_siginfo_to_user(uinfo, &info))
817 return -EFAULT;
819 return ret;
822 asmlinkage long
823 sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo)
825 siginfo_t info;
826 int ret;
827 mm_segment_t old_fs = get_fs();
829 if (ia32_copy_siginfo_from_user(&info, uinfo))
830 return -EFAULT;
831 set_fs (KERNEL_DS);
832 ret = sys_rt_sigqueueinfo(pid, sig, &info);
833 set_fs (old_fs);
834 return ret;
837 /* These are here just in case some old ia32 binary calls it. */
838 asmlinkage long
839 sys32_pause(void)
841 current->state = TASK_INTERRUPTIBLE;
842 schedule();
843 return -ERESTARTNOHAND;
847 struct sysctl_ia32 {
848 unsigned int name;
849 int nlen;
850 unsigned int oldval;
851 unsigned int oldlenp;
852 unsigned int newval;
853 unsigned int newlen;
854 unsigned int __unused[4];
858 asmlinkage long
859 sys32_sysctl(struct sysctl_ia32 __user *args32)
861 #ifndef CONFIG_SYSCTL
862 return -ENOSYS;
863 #else
864 struct sysctl_ia32 a32;
865 mm_segment_t old_fs = get_fs ();
866 void *oldvalp, *newvalp;
867 size_t oldlen;
868 int *namep;
869 long ret;
870 extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
871 void *newval, size_t newlen);
874 if (copy_from_user(&a32, args32, sizeof (a32)))
875 return -EFAULT;
878 * We need to pre-validate these because we have to disable address checking
879 * before calling do_sysctl() because of OLDLEN but we can't run the risk of the
880 * user specifying bad addresses here. Well, since we're dealing with 32 bit
881 * addresses, we KNOW that access_ok() will always succeed, so this is an
882 * expensive NOP, but so what...
884 namep = (int *) A(a32.name);
885 oldvalp = (void *) A(a32.oldval);
886 newvalp = (void *) A(a32.newval);
888 if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
889 || !access_ok(VERIFY_WRITE, namep, 0)
890 || !access_ok(VERIFY_WRITE, oldvalp, 0)
891 || !access_ok(VERIFY_WRITE, newvalp, 0))
892 return -EFAULT;
894 set_fs(KERNEL_DS);
895 lock_kernel();
896 ret = do_sysctl(namep, a32.nlen, oldvalp, &oldlen, newvalp, (size_t) a32.newlen);
897 unlock_kernel();
898 set_fs(old_fs);
900 if (oldvalp && put_user (oldlen, (int __user *)compat_ptr(a32.oldlenp)))
901 return -EFAULT;
903 return ret;
904 #endif
907 /* warning: next two assume little endian */
908 asmlinkage long
909 sys32_pread(unsigned int fd, char __user *ubuf, u32 count, u32 poslo, u32 poshi)
911 return sys_pread64(fd, ubuf, count,
912 ((loff_t)AA(poshi) << 32) | AA(poslo));
915 asmlinkage long
916 sys32_pwrite(unsigned int fd, char __user *ubuf, u32 count, u32 poslo, u32 poshi)
918 return sys_pwrite64(fd, ubuf, count,
919 ((loff_t)AA(poshi) << 32) | AA(poslo));
923 asmlinkage long
924 sys32_personality(unsigned long personality)
926 int ret;
927 if (personality(current->personality) == PER_LINUX32 &&
928 personality == PER_LINUX)
929 personality = PER_LINUX32;
930 ret = sys_personality(personality);
931 if (ret == PER_LINUX32)
932 ret = PER_LINUX;
933 return ret;
936 asmlinkage long
937 sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count)
939 mm_segment_t old_fs = get_fs();
940 int ret;
941 off_t of;
943 if (offset && get_user(of, offset))
944 return -EFAULT;
946 set_fs(KERNEL_DS);
947 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
948 set_fs(old_fs);
950 if (!ret && offset && put_user(of, offset))
951 return -EFAULT;
953 return ret;
956 /* Handle adjtimex compatibility. */
958 struct timex32 {
959 u32 modes;
960 s32 offset, freq, maxerror, esterror;
961 s32 status, constant, precision, tolerance;
962 struct compat_timeval time;
963 s32 tick;
964 s32 ppsfreq, jitter, shift, stabil;
965 s32 jitcnt, calcnt, errcnt, stbcnt;
966 s32 :32; s32 :32; s32 :32; s32 :32;
967 s32 :32; s32 :32; s32 :32; s32 :32;
968 s32 :32; s32 :32; s32 :32; s32 :32;
971 extern int do_adjtimex(struct timex *);
973 asmlinkage long
974 sys32_adjtimex(struct timex32 __user *utp)
976 struct timex txc;
977 int ret;
979 memset(&txc, 0, sizeof(struct timex));
981 if(verify_area(VERIFY_READ, utp, sizeof(struct timex32)) ||
982 __get_user(txc.modes, &utp->modes) ||
983 __get_user(txc.offset, &utp->offset) ||
984 __get_user(txc.freq, &utp->freq) ||
985 __get_user(txc.maxerror, &utp->maxerror) ||
986 __get_user(txc.esterror, &utp->esterror) ||
987 __get_user(txc.status, &utp->status) ||
988 __get_user(txc.constant, &utp->constant) ||
989 __get_user(txc.precision, &utp->precision) ||
990 __get_user(txc.tolerance, &utp->tolerance) ||
991 __get_user(txc.time.tv_sec, &utp->time.tv_sec) ||
992 __get_user(txc.time.tv_usec, &utp->time.tv_usec) ||
993 __get_user(txc.tick, &utp->tick) ||
994 __get_user(txc.ppsfreq, &utp->ppsfreq) ||
995 __get_user(txc.jitter, &utp->jitter) ||
996 __get_user(txc.shift, &utp->shift) ||
997 __get_user(txc.stabil, &utp->stabil) ||
998 __get_user(txc.jitcnt, &utp->jitcnt) ||
999 __get_user(txc.calcnt, &utp->calcnt) ||
1000 __get_user(txc.errcnt, &utp->errcnt) ||
1001 __get_user(txc.stbcnt, &utp->stbcnt))
1002 return -EFAULT;
1004 ret = do_adjtimex(&txc);
1006 if(verify_area(VERIFY_WRITE, utp, sizeof(struct timex32)) ||
1007 __put_user(txc.modes, &utp->modes) ||
1008 __put_user(txc.offset, &utp->offset) ||
1009 __put_user(txc.freq, &utp->freq) ||
1010 __put_user(txc.maxerror, &utp->maxerror) ||
1011 __put_user(txc.esterror, &utp->esterror) ||
1012 __put_user(txc.status, &utp->status) ||
1013 __put_user(txc.constant, &utp->constant) ||
1014 __put_user(txc.precision, &utp->precision) ||
1015 __put_user(txc.tolerance, &utp->tolerance) ||
1016 __put_user(txc.time.tv_sec, &utp->time.tv_sec) ||
1017 __put_user(txc.time.tv_usec, &utp->time.tv_usec) ||
1018 __put_user(txc.tick, &utp->tick) ||
1019 __put_user(txc.ppsfreq, &utp->ppsfreq) ||
1020 __put_user(txc.jitter, &utp->jitter) ||
1021 __put_user(txc.shift, &utp->shift) ||
1022 __put_user(txc.stabil, &utp->stabil) ||
1023 __put_user(txc.jitcnt, &utp->jitcnt) ||
1024 __put_user(txc.calcnt, &utp->calcnt) ||
1025 __put_user(txc.errcnt, &utp->errcnt) ||
1026 __put_user(txc.stbcnt, &utp->stbcnt))
1027 ret = -EFAULT;
1029 return ret;
1032 asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
1033 unsigned long prot, unsigned long flags,
1034 unsigned long fd, unsigned long pgoff)
1036 struct mm_struct *mm = current->mm;
1037 unsigned long error;
1038 struct file * file = NULL;
1040 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
1041 if (!(flags & MAP_ANONYMOUS)) {
1042 file = fget(fd);
1043 if (!file)
1044 return -EBADF;
1047 if (prot & PROT_READ)
1048 prot |= vm_force_exec32;
1050 down_write(&mm->mmap_sem);
1051 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
1052 up_write(&mm->mmap_sem);
1054 if (file)
1055 fput(file);
1056 return error;
1059 asmlinkage long sys32_olduname(struct oldold_utsname __user * name)
1061 int error;
1063 if (!name)
1064 return -EFAULT;
1065 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
1066 return -EFAULT;
1068 down_read(&uts_sem);
1070 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN);
1071 __put_user(0,name->sysname+__OLD_UTS_LEN);
1072 __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN);
1073 __put_user(0,name->nodename+__OLD_UTS_LEN);
1074 __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN);
1075 __put_user(0,name->release+__OLD_UTS_LEN);
1076 __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN);
1077 __put_user(0,name->version+__OLD_UTS_LEN);
1079 char *arch = "x86_64";
1080 if (personality(current->personality) == PER_LINUX32)
1081 arch = "i686";
1083 __copy_to_user(&name->machine,arch,strlen(arch)+1);
1086 up_read(&uts_sem);
1088 error = error ? -EFAULT : 0;
1090 return error;
1093 long sys32_uname(struct old_utsname __user * name)
1095 int err;
1096 if (!name)
1097 return -EFAULT;
1098 down_read(&uts_sem);
1099 err=copy_to_user(name, &system_utsname, sizeof (*name));
1100 up_read(&uts_sem);
1101 if (personality(current->personality) == PER_LINUX32)
1102 err |= copy_to_user(&name->machine, "i686", 5);
1103 return err?-EFAULT:0;
1106 long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
1108 struct ustat u;
1109 mm_segment_t seg;
1110 int ret;
1112 seg = get_fs();
1113 set_fs(KERNEL_DS);
1114 ret = sys_ustat(dev,&u);
1115 set_fs(seg);
1116 if (ret >= 0) {
1117 if (!access_ok(VERIFY_WRITE,u32p,sizeof(struct ustat32)) ||
1118 __put_user((__u32) u.f_tfree, &u32p->f_tfree) ||
1119 __put_user((__u32) u.f_tinode, &u32p->f_tfree) ||
1120 __copy_to_user(&u32p->f_fname, u.f_fname, sizeof(u.f_fname)) ||
1121 __copy_to_user(&u32p->f_fpack, u.f_fpack, sizeof(u.f_fpack)))
1122 ret = -EFAULT;
1124 return ret;
1127 asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
1128 compat_uptr_t __user *envp, struct pt_regs *regs)
1130 long error;
1131 char * filename;
1133 filename = getname(name);
1134 error = PTR_ERR(filename);
1135 if (IS_ERR(filename))
1136 return error;
1137 error = compat_do_execve(filename, argv, envp, regs);
1138 if (error == 0)
1139 current->ptrace &= ~PT_DTRACE;
1140 putname(filename);
1141 return error;
1144 asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
1145 struct pt_regs *regs)
1147 void __user *parent_tid = (void __user *)regs->rdx;
1148 void __user *child_tid = (void __user *)regs->rdi;
1149 if (!newsp)
1150 newsp = regs->rsp;
1151 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
1154 asmlinkage long sys32_waitid(int which, compat_pid_t pid,
1155 siginfo_t32 __user *uinfo, int options,
1156 struct compat_rusage __user *uru)
1158 siginfo_t info;
1159 struct rusage ru;
1160 long ret;
1161 mm_segment_t old_fs = get_fs();
1163 info.si_signo = 0;
1164 set_fs (KERNEL_DS);
1165 ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
1166 uru ? &ru : NULL);
1167 set_fs (old_fs);
1169 if (ret < 0 || info.si_signo == 0)
1170 return ret;
1172 if (uru && (ret = put_compat_rusage(&ru, uru)))
1173 return ret;
1175 BUG_ON(info.si_code & __SI_MASK);
1176 info.si_code |= __SI_CHLD;
1177 return ia32_copy_siginfo_to_user(uinfo, &info);
1181 * Some system calls that need sign extended arguments. This could be done by a generic wrapper.
1184 long sys32_lseek (unsigned int fd, int offset, unsigned int whence)
1186 return sys_lseek(fd, offset, whence);
1189 long sys32_kill(int pid, int sig)
1191 return sys_kill(pid, sig);
1195 long sys32_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
1197 long ret;
1198 aio_context_t ctx64;
1199 mm_segment_t oldfs = get_fs();
1200 set_fs(KERNEL_DS);
1201 ret = sys_io_setup(nr_reqs, &ctx64);
1202 set_fs(oldfs);
1203 /* truncating is ok because it's a user address */
1204 if (!ret)
1205 ret = put_user((u32)ctx64, ctx32p);
1206 return ret;
1209 asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr,
1210 compat_uptr_t __user *iocbpp)
1212 struct kioctx *ctx;
1213 long ret = 0;
1214 int i;
1216 if (unlikely(nr < 0))
1217 return -EINVAL;
1219 if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbpp)))))
1220 return -EFAULT;
1222 ctx = lookup_ioctx(ctx_id);
1223 if (unlikely(!ctx)) {
1224 pr_debug("EINVAL: io_submit: invalid context id\n");
1225 return -EINVAL;
1228 for (i=0; i<nr; i++) {
1229 compat_uptr_t p32;
1230 struct iocb __user *user_iocb;
1231 struct iocb tmp;
1233 if (unlikely(__get_user(p32, iocbpp + i))) {
1234 ret = -EFAULT;
1235 break;
1237 user_iocb = compat_ptr(p32);
1239 if (unlikely(copy_from_user(&tmp, user_iocb, sizeof(tmp)))) {
1240 ret = -EFAULT;
1241 break;
1244 ret = io_submit_one(ctx, user_iocb, &tmp);
1245 if (ret)
1246 break;
1249 put_ioctx(ctx);
1250 return i ? i : ret;
1254 asmlinkage long sys32_io_getevents(aio_context_t ctx_id,
1255 unsigned long min_nr,
1256 unsigned long nr,
1257 struct io_event __user *events,
1258 struct compat_timespec __user *timeout)
1260 long ret;
1261 mm_segment_t oldfs;
1262 struct timespec t;
1263 /* Harden against bogus ptrace */
1264 if (nr >= 0xffffffff ||
1265 !access_ok(VERIFY_WRITE, events, nr * sizeof(struct io_event)))
1266 return -EFAULT;
1267 if (timeout && get_compat_timespec(&t, timeout))
1268 return -EFAULT;
1269 oldfs = get_fs();
1270 set_fs(KERNEL_DS);
1271 ret = sys_io_getevents(ctx_id,min_nr,nr,events,timeout ? &t : NULL);
1272 set_fs(oldfs);
1273 if (!ret && timeout && put_compat_timespec(&t, timeout))
1274 return -EFAULT;
1275 return ret;
1278 asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
1280 char * tmp;
1281 int fd, error;
1283 /* don't force O_LARGEFILE */
1284 tmp = getname(filename);
1285 fd = PTR_ERR(tmp);
1286 if (!IS_ERR(tmp)) {
1287 fd = get_unused_fd();
1288 if (fd >= 0) {
1289 struct file *f = filp_open(tmp, flags, mode);
1290 error = PTR_ERR(f);
1291 if (IS_ERR(f)) {
1292 put_unused_fd(fd);
1293 fd = error;
1294 } else
1295 fd_install(fd, f);
1297 putname(tmp);
1299 return fd;
1302 struct sigevent32 {
1303 u32 sigev_value;
1304 u32 sigev_signo;
1305 u32 sigev_notify;
1306 u32 payload[(64 / 4) - 3];
1309 extern asmlinkage long
1310 sys_timer_create(clockid_t which_clock,
1311 struct sigevent __user *timer_event_spec,
1312 timer_t __user * created_timer_id);
1314 long
1315 sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
1317 struct sigevent __user *p = NULL;
1318 if (se32) {
1319 struct sigevent se;
1320 p = compat_alloc_user_space(sizeof(struct sigevent));
1321 memset(&se, 0, sizeof(struct sigevent));
1322 if (get_user(se.sigev_value.sival_int, &se32->sigev_value) ||
1323 __get_user(se.sigev_signo, &se32->sigev_signo) ||
1324 __get_user(se.sigev_notify, &se32->sigev_notify) ||
1325 __copy_from_user(&se._sigev_un._pad, &se32->payload,
1326 sizeof(se32->payload)) ||
1327 copy_to_user(p, &se, sizeof(se)))
1328 return -EFAULT;
1330 return sys_timer_create(clock, p, timer_id);
1333 long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high,
1334 __u32 len_low, __u32 len_high, int advice)
1336 return sys_fadvise64_64(fd,
1337 (((u64)offset_high)<<32) | offset_low,
1338 (((u64)len_high)<<32) | len_low,
1339 advice);
1342 long sys32_vm86_warning(void)
1344 struct task_struct *me = current;
1345 static char lastcomm[8];
1346 if (strcmp(lastcomm, me->comm)) {
1347 printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
1348 me->comm);
1349 strcpy(lastcomm, me->comm);
1351 return -ENOSYS;
1354 long sys32_quotactl(void)
1356 struct task_struct *me = current;
1357 static char lastcomm[8];
1358 if (strcmp(lastcomm, me->comm)) {
1359 printk(KERN_INFO "%s: 32bit quotactl not supported on 64 bit kernel\n",
1360 me->comm);
1361 strcpy(lastcomm, me->comm);
1363 return -ENOSYS;
1366 long sys32_lookup_dcookie(u32 addr_low, u32 addr_high,
1367 char __user * buf, size_t len)
1369 return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len);
1372 cond_syscall(sys32_ipc)
1374 static int __init ia32_init (void)
1376 printk("IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $\n");
1377 return 0;
1380 __initcall(ia32_init);
1382 extern unsigned long ia32_sys_call_table[];
1383 EXPORT_SYMBOL(ia32_sys_call_table);