Commit a52ab562 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: remove some unnecessary sign extensions

parent 3c3080ab
......@@ -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 */
......@@ -591,8 +591,8 @@ _GLOBAL(sys_call_table32)
.llong .sys32_lstat
.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
......@@ -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,7 +693,7 @@ _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 */
......
......@@ -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,8 +283,8 @@ 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,
struct pt_regs *regs)
int sys_vfork(u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
struct pt_regs *regs)
{
struct task_struct *p;
......
......@@ -44,10 +44,6 @@ _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)
clrldi r7, r7, 32 /* unsigned long fd parm */
extsw r8, r8 /* off_t offset */
......
......@@ -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;
......@@ -3766,19 +3746,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 +3759,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 +3801,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,
......@@ -4004,20 +3945,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 +4101,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 +4140,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);
......
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