Commit 96ee7da2 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: compat_sys_fcntl from Stephen Rothwell, remove socketcall emulation

parent ae81f068
...@@ -557,7 +557,7 @@ _GLOBAL(sys_call_table32) ...@@ -557,7 +557,7 @@ _GLOBAL(sys_call_table32)
.llong .sys32_umount .llong .sys32_umount
.llong .sys_ni_syscall /* old lock syscall */ .llong .sys_ni_syscall /* old lock syscall */
.llong .sys32_ioctl .llong .sys32_ioctl
.llong .sys32_fcntl /* 55 */ .llong .compat_sys_fcntl /* 55 */
.llong .sys_ni_syscall /* old mpx syscall */ .llong .sys_ni_syscall /* old mpx syscall */
.llong .sys32_setpgid .llong .sys32_setpgid
.llong .sys_ni_syscall /* old ulimit syscall */ .llong .sys_ni_syscall /* old ulimit syscall */
...@@ -706,7 +706,7 @@ _GLOBAL(sys_call_table32) ...@@ -706,7 +706,7 @@ _GLOBAL(sys_call_table32)
.llong .sys_ni_syscall /* reserved for MacOnLinux */ .llong .sys_ni_syscall /* reserved for MacOnLinux */
.llong .sys_getdents64 .llong .sys_getdents64
.llong .sys_pivot_root .llong .sys_pivot_root
.llong .sys32_fcntl64 .llong .compat_sys_fcntl64
.llong .sys_madvise /* 205 */ .llong .sys_madvise /* 205 */
.llong .sys_mincore .llong .sys_mincore
.llong .sys_gettid .llong .sys_gettid
......
...@@ -25,287 +25,3 @@ _GLOBAL(ppc32_lseek) ...@@ -25,287 +25,3 @@ _GLOBAL(ppc32_lseek)
extsw r4,r4 /* sign extend off_t offset parm */ extsw r4,r4 /* sign extend off_t offset parm */
b .sys_lseek b .sys_lseek
_GLOBAL(compat_sys_socketcall) /* r3=call, r4=args */
cmpwi r3, 1
blt- .do_einval
cmpwi r3, 17
bgt- .do_einval
subi r3, r3, 1 /* index into socketcall_table vectors and jmp */
sldi r3, r3, 3 /* each entry is 8 bytes */
LOADADDR(r10,.socketcall_table_begin)
ldx r10, r10, r3
mtctr r10
bctr
/* Socket function vectored fix ups for 32 bit */
_STATIC(do_sys_socket) /* sys_socket(int, int, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
3: lwa r5,8(r10)
b .sys_socket
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_bind) /* sys_bind(int fd, struct sockaddr *, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwa r5,8(r10)
b .sys_bind
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_connect) /* sys_connect(int, struct sockaddr *, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwa r5,8(r10)
b .sys_connect
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_listen) /* sys_listen(int, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
b .sys_listen
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.previous
_STATIC(do_sys_accept) /* sys_accept(int, struct sockaddr *, int *) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
b .sys_accept
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_getsockname) /* sys_getsockname(int, struct sockaddr *, int *) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
b .sys_getsockname
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_getpeername) /* sys_getpeername(int, struct sockaddr *, int *) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
b .sys_getpeername
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_socketpair) /* sys_socketpair(int, int, int, int *) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
3: lwa r5,8(r10)
4: lwz r6,12(r10)
b .sys_socketpair
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.previous
_STATIC(do_sys_send) /* sys_send(int, void *, size_t, unsigned int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
4: lwz r6,12(r10)
b .sys_send
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.previous
_STATIC(do_sys_recv) /* sys_recv(int, void *, size_t, unsigned int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
4: lwz r6,12(r10)
b .sys_recv
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.previous
_STATIC(do_sys_sendto) /* sys32_sendto(int, u32, compat_size_t, unsigned int, u32, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
4: lwz r6,12(r10)
5: lwz r7,16(r10)
6: lwz r8,20(r10)
b .sys_sendto
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.llong 5b,.do_efault
.llong 6b,.do_efault
.previous
_STATIC(do_sys_recvfrom) /* sys32_recvfrom(int, u32, compat_size_t, unsigned int, u32, u32) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwz r5,8(r10)
4: lwz r6,12(r10)
5: lwz r7,16(r10)
6: lwz r8,20(r10)
b .sys_recvfrom
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.llong 5b,.do_efault
.llong 6b,.do_efault
.previous
_STATIC(do_sys_shutdown) /* sys_shutdown(int, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
b .sys_shutdown
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.previous
_STATIC(do_sys_setsockopt) /* compat_sys_setsockopt(int, int, int, char *, int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
3: lwa r5,8(r10)
4: lwz r6,12(r10)
5: lwa r7,16(r10)
b .compat_sys_setsockopt
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.llong 5b,.do_efault
.previous
_STATIC(do_sys_getsockopt) /* compat_sys_getsockopt(int, int, int, u32, u32) */
mr r10,r4
1: lwa r3,0(r10)
2: lwa r4,4(r10)
3: lwa r5,8(r10)
4: lwz r6,12(r10)
5: lwz r7,16(r10)
b .compat_sys_getsockopt
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.llong 4b,.do_efault
.llong 5b,.do_efault
.previous
_STATIC(do_sys_sendmsg) /* compat_sys_sendmsg(int, struct compat_msghdr *, unsigned int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwa r5,8(r10)
b .compat_sys_sendmsg
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_sys_recvmsg) /* compat_sys_recvmsg(int, struct compat_msghdr *, unsigned int) */
mr r10,r4
1: lwa r3,0(r10)
2: lwz r4,4(r10)
3: lwa r5,8(r10)
b .compat_sys_recvmsg
.section __ex_table,"a"
.align 3
.llong 1b,.do_efault
.llong 2b,.do_efault
.llong 3b,.do_efault
.previous
_STATIC(do_einval)
li r3,-EINVAL
blr
_STATIC(do_efault)
li r3,-EFAULT
blr
.balign 8
_GLOBAL(socketcall_table_begin)
.llong .do_sys_socket
.llong .do_sys_bind
.llong .do_sys_connect
.llong .do_sys_listen
.llong .do_sys_accept
.llong .do_sys_getsockname
.llong .do_sys_getpeername
.llong .do_sys_socketpair
.llong .do_sys_send
.llong .do_sys_recv
.llong .do_sys_sendto
.llong .do_sys_recvfrom
.llong .do_sys_shutdown
.llong .do_sys_setsockopt
.llong .do_sys_getsockopt
.llong .do_sys_sendmsg
.llong .do_sys_recvmsg
_GLOBAL(socketcall_table_end)
...@@ -246,32 +246,6 @@ asmlinkage long sys32_writev(int fd, struct compat_iovec *vector, u32 count) ...@@ -246,32 +246,6 @@ asmlinkage long sys32_writev(int fd, struct compat_iovec *vector, u32 count)
return ret; return ret;
} }
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case F_GETLK:
case F_SETLK:
case F_SETLKW:
{
struct flock f;
mm_segment_t old_fs;
long ret;
if(get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
if(put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return ret;
}
default:
return sys_fcntl(fd, cmd, (unsigned long)arg);
}
}
struct ncp_mount_data32_v3 { struct ncp_mount_data32_v3 {
int version; int version;
unsigned int ncp_fd; unsigned int ncp_fd;
...@@ -2848,13 +2822,6 @@ asmlinkage long sys32_umount(char * name, u32 flags) ...@@ -2848,13 +2822,6 @@ asmlinkage long sys32_umount(char * name, u32 flags)
return sys_umount(name, (int)flags); return sys_umount(name, (int)flags);
} }
asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
{
if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
return sys32_fcntl(fd, cmd, arg);
}
struct __sysctl_args32 { struct __sysctl_args32 {
u32 name; u32 name;
int nlen; int nlen;
......
...@@ -61,7 +61,18 @@ struct compat_flock { ...@@ -61,7 +61,18 @@ struct compat_flock {
compat_off_t l_start; compat_off_t l_start;
compat_off_t l_len; compat_off_t l_len;
compat_pid_t l_pid; compat_pid_t l_pid;
short __unused; };
#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14
struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
}; };
struct compat_statfs { struct compat_statfs {
...@@ -84,4 +95,7 @@ typedef u32 compat_old_sigset_t; ...@@ -84,4 +95,7 @@ typedef u32 compat_old_sigset_t;
typedef u32 compat_sigset_word; typedef u32 compat_sigset_word;
#define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
#endif /* _ASM_PPC64_COMPAT_H */ #endif /* _ASM_PPC64_COMPAT_H */
...@@ -42,10 +42,6 @@ ...@@ -42,10 +42,6 @@
#define F_SETSIG 10 /* for sockets. */ #define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */
#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14
/* for F_[GET|SET]FL */ /* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */
...@@ -87,13 +83,6 @@ struct flock { ...@@ -87,13 +83,6 @@ struct flock {
pid_t l_pid; pid_t l_pid;
}; };
struct flock64 {
short l_type;
short l_whence;
loff_t l_start;
loff_t l_len;
pid_t l_pid;
};
#define F_LINUX_SPECIFIC_BASE 1024 #define F_LINUX_SPECIFIC_BASE 1024
#endif /* _PPC64_FCNTL_H */ #endif /* _PPC64_FCNTL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment