aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/linux32.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-04 16:15:00 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-04 16:15:00 -0500
commit2c89a8d09f03bc569d3237d97e2293d67c36d75d (patch)
treede7527695c28e89d5e1c6f679e086b6a182bdc0e /arch/mips/kernel/linux32.c
parente9cdb1e330d805f4453c1359cebe2bd6a06ce692 (diff)
parent8b4ac6f316b493fae511921e25c72119f7b03170 (diff)
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [MIPS] MTX1: clear PCI errors [MIPS] MTX1: add idsel cardbus ressources [MIPS] MTX1: remove unneeded settings [MIPS] dma_sync_sg_for_cpu is a no-op except for non-coherent R10000s. [MIPS] Cobalt: update reserved resources [MIPS] SN: PCI fixup needs to include <irq.h>. [MIPS] DMA: Fix a bunch of warnings due to missing inline keywords. [MIPS] RM: It should be #ifdef CONFIG_FOO not #if CONFIG_FOO ... [MIPS] Fix and cleanup the mess that a dozen prom_printf variants are. [MIPS] DEC: Remove redeclarations of mips_machgroup and mips_machtype. [MIPS] No need to write c0_compare in plat_timer_setup [MIPS] Convert to RTC-class ds1742 driver [MIPS] Oprofile: Add missing break statements. [MIPS] jmr3927: build fix [MIPS] SNI: Fix mc146818_decode_year [MIPS] Replace sys32_timer_create with the generic compat_sys_timer_create. [MIPS] Replace sys32_socketcall with the generic compat_sys_socketcall. [MIPS] N32 waitid is the same as o32.
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r--arch/mips/kernel/linux32.c173
1 files changed, 0 insertions, 173 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index fc4dd6c9dd80..30d433f14f93 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -166,34 +166,6 @@ out:
166 return error; 166 return error;
167} 167}
168 168
169asmlinkage long
170sysn32_waitid(int which, compat_pid_t pid,
171 siginfo_t __user *uinfo, int options,
172 struct compat_rusage __user *uru)
173{
174 struct rusage ru;
175 long ret;
176 mm_segment_t old_fs = get_fs();
177 int si_signo;
178
179 if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo)))
180 return -EFAULT;
181
182 set_fs (KERNEL_DS);
183 ret = sys_waitid(which, pid, uinfo, options,
184 uru ? (struct rusage __user *) &ru : NULL);
185 set_fs (old_fs);
186
187 if (__get_user(si_signo, &uinfo->si_signo))
188 return -EFAULT;
189 if (ret < 0 || si_signo == 0)
190 return ret;
191
192 if (uru)
193 ret = put_compat_rusage(&ru, uru);
194 return ret;
195}
196
197#define RLIM_INFINITY32 0x7fffffff 169#define RLIM_INFINITY32 0x7fffffff
198#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x) 170#define RESOURCE32(x) ((x > RLIM_INFINITY32) ? RLIM_INFINITY32 : x)
199 171
@@ -572,151 +544,6 @@ asmlinkage long sys32_sync_file_range(int fd, int __pad,
572 flags); 544 flags);
573} 545}
574 546
575/* Argument list sizes for sys_socketcall */
576#define AL(x) ((x) * sizeof(unsigned int))
577static unsigned char socketcall_nargs[18]={AL(0),AL(3),AL(3),AL(3),AL(2),AL(3),
578 AL(3),AL(3),AL(4),AL(4),AL(4),AL(6),
579 AL(6),AL(2),AL(5),AL(5),AL(3),AL(3)};
580#undef AL
581
582/*
583 * System call vectors.
584 *
585 * Argument checking cleaned up. Saved 20% in size.
586 * This function doesn't need to set the kernel lock because
587 * it is set by the callees.
588 */
589
590asmlinkage long sys32_socketcall(int call, unsigned int __user *args32)
591{
592 unsigned int a[6];
593 unsigned int a0,a1;
594 int err;
595
596 extern asmlinkage long sys_socket(int family, int type, int protocol);
597 extern asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen);
598 extern asmlinkage long sys_connect(int fd, struct sockaddr __user *uservaddr, int addrlen);
599 extern asmlinkage long sys_listen(int fd, int backlog);
600 extern asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, int __user *upeer_addrlen);
601 extern asmlinkage long sys_getsockname(int fd, struct sockaddr __user *usockaddr, int __user *usockaddr_len);
602 extern asmlinkage long sys_getpeername(int fd, struct sockaddr __user *usockaddr, int __user *usockaddr_len);
603 extern asmlinkage long sys_socketpair(int family, int type, int protocol, int __user *usockvec);
604 extern asmlinkage long sys_send(int fd, void __user * buff, size_t len, unsigned flags);
605 extern asmlinkage long sys_sendto(int fd, void __user * buff, size_t len, unsigned flags,
606 struct sockaddr __user *addr, int addr_len);
607 extern asmlinkage long sys_recv(int fd, void __user * ubuf, size_t size, unsigned flags);
608 extern asmlinkage long sys_recvfrom(int fd, void __user * ubuf, size_t size, unsigned flags,
609 struct sockaddr __user *addr, int __user *addr_len);
610 extern asmlinkage long sys_shutdown(int fd, int how);
611 extern asmlinkage long sys_setsockopt(int fd, int level, int optname, char __user *optval, int optlen);
612 extern asmlinkage long sys_getsockopt(int fd, int level, int optname, char __user *optval, int __user *optlen);
613 extern asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags);
614 extern asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned int flags);
615
616
617 if(call<1||call>SYS_RECVMSG)
618 return -EINVAL;
619
620 /* copy_from_user should be SMP safe. */
621 if (copy_from_user(a, args32, socketcall_nargs[call]))
622 return -EFAULT;
623
624 a0=a[0];
625 a1=a[1];
626
627 switch(call)
628 {
629 case SYS_SOCKET:
630 err = sys_socket(a0,a1,a[2]);
631 break;
632 case SYS_BIND:
633 err = sys_bind(a0,(struct sockaddr __user *)A(a1), a[2]);
634 break;
635 case SYS_CONNECT:
636 err = sys_connect(a0, (struct sockaddr __user *)A(a1), a[2]);
637 break;
638 case SYS_LISTEN:
639 err = sys_listen(a0,a1);
640 break;
641 case SYS_ACCEPT:
642 err = sys_accept(a0,(struct sockaddr __user *)A(a1), (int __user *)A(a[2]));
643 break;
644 case SYS_GETSOCKNAME:
645 err = sys_getsockname(a0,(struct sockaddr __user *)A(a1), (int __user *)A(a[2]));
646 break;
647 case SYS_GETPEERNAME:
648 err = sys_getpeername(a0, (struct sockaddr __user *)A(a1), (int __user *)A(a[2]));
649 break;
650 case SYS_SOCKETPAIR:
651 err = sys_socketpair(a0,a1, a[2], (int __user *)A(a[3]));
652 break;
653 case SYS_SEND:
654 err = sys_send(a0, (void __user *)A(a1), a[2], a[3]);
655 break;
656 case SYS_SENDTO:
657 err = sys_sendto(a0,(void __user *)A(a1), a[2], a[3],
658 (struct sockaddr __user *)A(a[4]), a[5]);
659 break;
660 case SYS_RECV:
661 err = sys_recv(a0, (void __user *)A(a1), a[2], a[3]);
662 break;
663 case SYS_RECVFROM:
664 err = sys_recvfrom(a0, (void __user *)A(a1), a[2], a[3],
665 (struct sockaddr __user *)A(a[4]), (int __user *)A(a[5]));
666 break;
667 case SYS_SHUTDOWN:
668 err = sys_shutdown(a0,a1);
669 break;
670 case SYS_SETSOCKOPT:
671 err = sys_setsockopt(a0, a1, a[2], (char __user *)A(a[3]), a[4]);
672 break;
673 case SYS_GETSOCKOPT:
674 err = sys_getsockopt(a0, a1, a[2], (char __user *)A(a[3]), (int __user *)A(a[4]));
675 break;
676 case SYS_SENDMSG:
677 err = sys_sendmsg(a0, (struct msghdr __user *) A(a1), a[2]);
678 break;
679 case SYS_RECVMSG:
680 err = sys_recvmsg(a0, (struct msghdr __user *) A(a1), a[2]);
681 break;
682 default:
683 err = -EINVAL;
684 break;
685 }
686 return err;
687}
688
689struct sigevent32 {
690 u32 sigev_value;
691 u32 sigev_signo;
692 u32 sigev_notify;
693 u32 payload[(64 / 4) - 3];
694};
695
696extern asmlinkage long
697sys_timer_create(clockid_t which_clock,
698 struct sigevent __user *timer_event_spec,
699 timer_t __user * created_timer_id);
700
701long
702sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
703{
704 struct sigevent __user *p = NULL;
705 if (se32) {
706 struct sigevent se;
707 p = compat_alloc_user_space(sizeof(struct sigevent));
708 memset(&se, 0, sizeof(struct sigevent));
709 if (get_user(se.sigev_value.sival_int, &se32->sigev_value) ||
710 __get_user(se.sigev_signo, &se32->sigev_signo) ||
711 __get_user(se.sigev_notify, &se32->sigev_notify) ||
712 __copy_from_user(&se._sigev_un._pad, &se32->payload,
713 sizeof(se32->payload)) ||
714 copy_to_user(p, &se, sizeof(se)))
715 return -EFAULT;
716 }
717 return sys_timer_create(clock, p, timer_id);
718}
719
720save_static_function(sys32_clone); 547save_static_function(sys32_clone);
721__attribute_used__ noinline static int 548__attribute_used__ noinline static int
722_sys32_clone(nabi_no_regargs struct pt_regs regs) 549_sys32_clone(nabi_no_regargs struct pt_regs regs)