Commit 6c5ace44 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5_work

into samba.org:/scratch/anton/linux-2.5_syscall_cleanup_clean
parents 273cbb5a 7c992e1c
......@@ -113,10 +113,6 @@ _GLOBAL(DoSyscall)
clrldi r4,r4,32
clrldi r5,r5,32
clrldi r6,r6,32
#if 0 /* XXX Why not ??? - Anton */
clrldi r7,r7,32
clrldi r8,r8,32
#endif
b 17f
15:
#endif
......@@ -187,10 +183,6 @@ _GLOBAL(ret_from_syscall_1)
clrldi r4,r4,32
clrldi r5,r5,32
clrldi r6,r6,32
#if 0 /* XXX Why not ??? - Anton */
clrldi r7,r7,32
clrldi r8,r8,32
#endif
b 57f
55:
#endif
......
......@@ -505,8 +505,8 @@ _GLOBAL(kernel_thread)
.balign 8
_GLOBAL(sys_call_table32)
.llong .sys_ni_syscall /* 0 - old "setup()" system call */
.llong .sys32_exit
.llong .sys32_fork
.llong .sys_exit
.llong .sys_fork
.llong .sys_read
.llong .sys_write
.llong .sys32_open /* 5 */
......@@ -522,7 +522,7 @@ _GLOBAL(sys_call_table32)
.llong .sys_chmod /* 15 */
.llong .sys_lchown
.llong .sys_ni_syscall /* old break syscall holder */
.llong .sys32_stat
.llong .sys_ni_syscall /* old stat syscall holder */
.llong .sys32_lseek
.llong .sys_getpid /* 20 */
.llong .sys32_mount
......@@ -532,7 +532,7 @@ _GLOBAL(sys_call_table32)
.llong .ppc64_sys32_stime /* 25 */
.llong .sys32_ptrace
.llong .sys_alarm
.llong .sys32_fstat
.llong .sys_ni_syscall /* old fstat syscall holder */
.llong .sys32_pause
.llong .sys32_utime /* 30 */
.llong .sys_ni_syscall /* old stty syscall holder */
......@@ -588,11 +588,11 @@ _GLOBAL(sys_call_table32)
.llong .sys32_setgroups
.llong .ppc32_select
.llong .sys_symlink
.llong .sys32_lstat
.llong .sys_ni_syscall /* old sys_lstat syscall holder */
.llong .sys32_readlink /* 85 */
.llong .sys_uselib
.llong .sys32_swapon
.llong .sys32_reboot
.llong .sys_swapon
.llong .sys_reboot
.llong .old32_readdir
.llong .sys32_mmap /* 90 */
.llong .sys_munmap
......@@ -605,7 +605,7 @@ _GLOBAL(sys_call_table32)
.llong .sys_ni_syscall /* old profil syscall holder */
.llong .sys32_statfs
.llong .sys32_fstatfs /* 100 */
.llong .sys_ni_syscall /* old ioperm syscall holder */
.llong .sys_ioperm
.llong .sys32_socketcall
.llong .sys32_syslog
.llong .sys32_setitimer
......@@ -624,7 +624,7 @@ _GLOBAL(sys_call_table32)
.llong .sys32_ipc
.llong .sys_fsync
.llong .ppc32_sigreturn
.llong .sys32_clone /* 120 */
.llong .sys_clone /* 120 */
.llong .sys32_setdomainname
.llong .ppc64_newuname
.llong .sys_ni_syscall /* old modify_ldt syscall holder */
......@@ -638,7 +638,7 @@ _GLOBAL(sys_call_table32)
.llong .sys_quotactl
.llong .sys32_getpgid
.llong .sys_fchdir
.llong .sys32_bdflush
.llong .sys_bdflush
.llong .sys32_sysfs /* 135 */
.llong .sys32_personality
.llong .sys_ni_syscall /* for afs_syscall */
......@@ -693,10 +693,10 @@ _GLOBAL(sys_call_table32)
.llong .sys32_sendfile
.llong .sys_ni_syscall /* streams1 */
.llong .sys_ni_syscall /* streams2 */
.llong .sys32_vfork
.llong .sys_vfork
.llong .sys32_getrlimit /* 190 */
.llong .sys32_readahead
.llong .sys_ni_syscall /* 192 - reserved - mmap2 */
.llong .ppc32_mmap2
.llong .sys32_truncate64 /* 193 - truncate64 */
.llong .sys32_ftruncate64 /* 194 - ftruncate64 */
.llong .sys_stat64 /* 195 - stat64 */
......@@ -730,8 +730,9 @@ _GLOBAL(sys_call_table32)
.llong .sys32_sched_getaffinity
.llong .sys_ni_syscall /* reserved for security */
.llong .sys_ni_syscall /* 225 - reserved for tux */
.llong .sys32_sendfile64
.rept NR_syscalls-225
.rept NR_syscalls-226
.llong .sys_ni_syscall
.endr
#endif
......@@ -756,7 +757,7 @@ _GLOBAL(sys_call_table)
.llong .sys_chmod /* 15 */
.llong .sys_lchown
.llong .sys_ni_syscall /* old break syscall holder */
.llong .sys_stat
.llong .sys_ni_syscall /* old stat syscall holder */
.llong .sys_lseek
.llong .sys_getpid /* 20 */
.llong .sys_mount
......@@ -766,7 +767,7 @@ _GLOBAL(sys_call_table)
.llong .ppc64_sys_stime /* 25 */
.llong .sys_ptrace
.llong .sys_alarm
.llong .sys_fstat
.llong .sys_ni_syscall /* old sys_fstat syscall holder */
.llong .sys_pause
.llong .sys_utime /* 30 */
.llong .sys_ni_syscall /* old stty syscall holder */
......@@ -822,7 +823,7 @@ _GLOBAL(sys_call_table)
.llong .sys_setgroups
.llong .sys_select
.llong .sys_symlink
.llong .sys_lstat
.llong .sys_ni_syscall /* old sys_lstat syscall holder */
.llong .sys_readlink /* 85 */
.llong .sys_uselib
.llong .sys_swapon
......@@ -839,7 +840,7 @@ _GLOBAL(sys_call_table)
.llong .sys_ni_syscall /* old profil syscall holder */
.llong .sys_statfs
.llong .sys_fstatfs /* 100 */
.llong .sys_ni_syscall /* old ioperm syscall holder */
.llong .sys_ioperm
.llong .sys_socketcall
.llong .sys_syslog
.llong .sys_setitimer
......@@ -964,7 +965,8 @@ _GLOBAL(sys_call_table)
.llong .sys_sched_getaffinity
.llong .sys_ni_syscall /* reserved for security */
.llong .sys_ni_syscall /* reserved for tux */
.llong .sys_ni_syscall /* reserved for sendfile64 */
.rept NR_syscalls-225
.rept NR_syscalls-226
.llong .sys_ni_syscall
.endr
......@@ -259,19 +259,19 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
return put_user(val, (unsigned int *) adr);
}
int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6,
struct pt_regs *regs)
int sys_clone(unsigned long clone_flags, u32 p2, u32 p3, u32 p4, u32 p5,
u32 p6, struct pt_regs *regs)
{
struct task_struct *p;
if (regs->msr & MSR_FP)
giveup_fpu(current);
p = do_fork(p1 & ~CLONE_IDLETASK, regs->gpr[1], regs, 0);
p = do_fork(clone_flags & ~CLONE_IDLETASK, regs->gpr[1], regs, 0);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
int sys_fork(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
struct pt_regs *regs)
{
struct task_struct *p;
......@@ -283,7 +283,7 @@ int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6,
int sys_vfork(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
struct pt_regs *regs)
{
struct task_struct *p;
......
......@@ -44,14 +44,10 @@ _GLOBAL(sys32_getsockopt)
clrldi r7, r7, 32 /* int *optlen parm */
b .sys_getsockopt
_GLOBAL(sys32_bdflush)
extsw r4,r4 /* sign extend long data parm */
b .sys_bdflush
_GLOBAL(sys32_mmap2)
_GLOBAL(ppc32_mmap2)
clrldi r7, r7, 32 /* unsigned long fd parm */
extsw r8, r8 /* off_t offset */
b .sys_mmap
clrldi r8, r8, 32 /* unsigned long pgoff */
b .sys32_mmap2
_GLOBAL(sys32_socketcall) /* r3=call, r4=args */
cmpwi r3, 1
......
......@@ -67,21 +67,6 @@
#include <asm/ppc32.h>
#include <asm/mmu_context.h>
extern unsigned long wall_jiffies;
#define USEC_PER_SEC (1000000)
/*
* These are the flags in the MSR that the user is allowed to change
* by modifying the saved value of the MSR on the stack. SE and BE
* should not be in this list since gdb may want to change these. I.e,
* you should be able to step out of a signal handler to see what
* instruction executes next after the signal handler completes.
* Alternately, if you stepped into a signal handler, you should be
* able to continue 'til the next breakpoint from within the signal
* handler, even if the handler returns.
*/
#define MSR_USERCHANGE (MSR_FE0 | MSR_FE1)
extern asmlinkage long sys_utime(char * filename, struct utimbuf * times);
struct utimbuf32 {
......@@ -1432,15 +1417,10 @@ asmlinkage long sys32_delete_module(const char *name_user)
return -ENOSYS;
}
/* Note: it is necessary to treat which as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage long sys32_query_module(const char *name_user, u32 which, char *buf, size_t bufsize, size_t *ret)
asmlinkage long sys32_query_module(const char *name_user, int which, char *buf, size_t bufsize, size_t *ret)
{
/* Let the program know about the new interface. Not that it'll do them much good. */
if ((int)which == 0)
if (which == 0)
return 0;
return -ENOSYS;
......@@ -2779,69 +2759,6 @@ asmlinkage long sys32_ipc(u32 call, u32 first_parm, u32 second_parm, u32 third_p
return err;
}
/* stat syscall methods. */
extern asmlinkage int sys_stat(char* filename, struct __old_kernel_stat* statbuf);
static int cp_old_stat32(struct kstat *stat, struct __old_kernel_stat32* statbuf)
{
static int warncount = 5;
struct __old_kernel_stat32 tmp;
if (warncount) {
warncount--;
printk("VFS: Warning: %s using old stat() call. Recompile your binary.\n",
current->comm);
}
tmp.st_dev = stat->dev;
tmp.st_ino = stat->ino;
tmp.st_mode = stat->mode;
tmp.st_nlink = stat->nlink;
SET_OLDSTAT_UID(tmp, stat->uid);
SET_OLDSTAT_GID(tmp, stat->gid);
tmp.st_rdev = stat->rdev;
if (stat->size > MAX_NON_LFS)
return -EOVERFLOW;
tmp.st_size = stat->size;
tmp.st_atime = stat->atime;
tmp.st_mtime = stat->mtime;
tmp.st_ctime = stat->ctime;
return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0;
}
asmlinkage long sys32_stat(char* filename, struct __old_kernel_stat32* statbuf)
{
struct kstat stat;
int error = vfs_stat(filename, &stat);
if (!error)
error = cp_old_stat32(&stat, statbuf);
return error;
}
asmlinkage long sys32_fstat(unsigned int fd, struct __old_kernel_stat32* statbuf)
{
struct kstat stat;
int error = vfs_fstat(fd, &stat);
if (!error)
error = cp_old_stat32(&stat, statbuf);
return error;
}
asmlinkage long sys32_lstat(char* filename, struct __old_kernel_stat32* statbuf)
{
struct kstat stat;
int error = vfs_lstat(filename, &stat);
if (!error)
error = cp_old_stat32(&stat, statbuf);
return error;
}
extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
/* Note: it is necessary to treat out_fd and in_fd as unsigned ints,
......@@ -2868,6 +2785,27 @@ asmlinkage long sys32_sendfile(u32 out_fd, u32 in_fd, __kernel_off_t32* offset,
return ret;
}
extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
asmlinkage int sys32_sendfile64(int out_fd, int in_fd, __kernel_loff_t32 *offset, s32 count)
{
mm_segment_t old_fs = get_fs();
int ret;
loff_t lof;
if (offset && get_user(lof, offset))
return -EFAULT;
set_fs(KERNEL_DS);
ret = sys_sendfile64(out_fd, in_fd, offset ? &lof : NULL, count);
set_fs(old_fs);
if (offset && put_user(lof, offset))
return -EFAULT;
return ret;
}
extern asmlinkage int sys_setsockopt(int fd, int level, int optname, char *optval, int optlen);
asmlinkage long sys32_setsockopt(int fd, int level, int optname, char* optval, int optlen)
......@@ -3766,19 +3704,6 @@ asmlinkage long sys32_access(const char * filename, u32 mode)
}
extern asmlinkage int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs);
/* Note: it is necessary to treat p1, p2, p3, p4, p5, p7, and regs as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage int sys32_clone(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, struct pt_regs *regs)
{
return sys_clone((int)p1, (int)p2, (int)p3, (int)p4, (int)p5, (int)p6, regs);
}
extern asmlinkage long sys_creat(const char * pathname, int mode);
/* Note: it is necessary to treat mode as an unsigned int,
......@@ -3792,19 +3717,6 @@ asmlinkage long sys32_creat(const char * pathname, u32 mode)
}
extern asmlinkage long sys_exit(int error_code);
/* Note: it is necessary to treat error_code as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage long sys32_exit(u32 error_code)
{
return sys_exit((int)error_code);
}
extern asmlinkage long sys_wait4(pid_t pid, unsigned int * stat_addr, int options, struct rusage * ru);
/* Note: it is necessary to treat pid and options as unsigned ints,
......@@ -3847,19 +3759,6 @@ asmlinkage long sys32_waitpid(u32 pid, unsigned int * stat_addr, u32 options)
}
extern asmlinkage int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs);
/* Note: it is necessary to treat p1, p2, p3, p4, p5, and p6 as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage int sys32_fork(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, struct pt_regs *regs)
{
return sys_fork((int)p1, (int)p2, (int)p3, (int)p4, (int)p5, (int)p6, regs);
}
extern asmlinkage long sys_getgroups(int gidsetsize, gid_t *grouplist);
/* Note: it is necessary to treat gidsetsize as an unsigned int,
......@@ -3978,19 +3877,36 @@ asmlinkage long sys32_nice(u32 increment)
return sys_nice((int)increment);
}
extern asmlinkage long sys_open(const char * filename, int flags, int mode);
/* Note: it is necessary to treat flags and mode as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
/*
* This is just a version for 32-bit applications which does
* not force O_LARGEFILE on.
*/
asmlinkage long sys32_open(const char * filename, int flags, int mode)
{
return sys_open(filename, (int)flags, (int)mode);
}
long sys32_open(const char * filename, int flags, int mode)
{
char * tmp;
int fd, error;
tmp = getname(filename);
fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd();
if (fd >= 0) {
struct file * f = filp_open(tmp, flags, mode);
error = PTR_ERR(f);
if (IS_ERR(f))
goto out_error;
fd_install(fd, f);
}
out:
putname(tmp);
}
return fd;
out_error:
put_unused_fd(fd);
fd = error;
goto out;
}
extern asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz);
......@@ -4004,20 +3920,6 @@ asmlinkage long sys32_readlink(const char * path, char * buf, u32 bufsiz)
return sys_readlink(path, buf, (int)bufsiz);
}
extern asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg);
/* Note: it is necessary to treat magic1 and magic2 as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage long sys32_reboot(u32 magic1, u32 magic2, unsigned int cmd, void * arg)
{
return sys_reboot((int)magic1, (int)magic2, cmd, arg);
}
extern asmlinkage long sys_sched_get_priority_max(int policy);
/* Note: it is necessary to treat option as an unsigned int,
......@@ -4174,19 +4076,6 @@ asmlinkage long sys32_ssetmask(u32 newmask)
}
extern asmlinkage long sys_swapon(const char * specialfile, int swap_flags);
/* Note: it is necessary to treat swap_flags as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage long sys32_swapon(const char * specialfile, u32 swap_flags)
{
return sys_swapon(specialfile, (int)swap_flags);
}
extern asmlinkage long sys_syslog(int type, char * buf, int len);
/* Note: it is necessary to treat type and len as an unsigned int,
......@@ -4226,19 +4115,6 @@ asmlinkage long sys32_umount(char * name, u32 flags)
}
extern asmlinkage int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6, struct pt_regs *regs);
/* Note: it is necessary to treat p1, p2, p3, p4, p5, and p6 as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
*/
asmlinkage int sys32_vfork(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6, struct pt_regs *regs)
{
return sys_vfork((int)p1, (int)p2, (int)p3, (int)p4, (int)p5, (int)p6, regs);
}
extern ssize_t sys_pread64(unsigned int fd, char *buf, size_t count,
loff_t pos);
......@@ -4411,3 +4287,15 @@ asmlinkage int sys32_sched_getaffinity(__kernel_pid_t32 pid, unsigned int len,
return ret;
}
extern unsigned long sys_mmap(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, off_t offset);
unsigned long sys32_mmap2(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
/* This should remain 12 even if PAGE_SIZE changes */
return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
}
......@@ -235,6 +235,7 @@
#define __NR_sched_getaffinity 223
#define __NR_security 224
#define __NR_tuxcall 225
#define __NR_sendfile64 226
#define __NR(n) #n
......
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