git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
sparc64
/
kernel
/
sys_sparc.c
diff --git
a/arch/sparc64/kernel/sys_sparc.c
b/arch/sparc64/kernel/sys_sparc.c
index
a6b29c9
..
04177d8
100644
(file)
--- a/
arch/sparc64/kernel/sys_sparc.c
+++ b/
arch/sparc64/kernel/sys_sparc.c
@@
-25,6
+25,7
@@
#include <linux/syscalls.h>
#include <linux/ipc.h>
#include <linux/personality.h>
#include <linux/syscalls.h>
#include <linux/ipc.h>
#include <linux/personality.h>
+#include <linux/vs_cvirt.h>
#include <asm/uaccess.h>
#include <asm/ipc.h>
#include <asm/uaccess.h>
#include <asm/ipc.h>
@@
-179,7
+180,7
@@
asmlinkage unsigned long sparc_brk(unsigned long brk)
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though.
*/
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though.
*/
-asmlinkage
int
sparc_pipe(struct pt_regs *regs)
+asmlinkage
long
sparc_pipe(struct pt_regs *regs)
{
int fd[2];
int error;
{
int fd[2];
int error;
@@
-199,22
+200,24
@@
out:
* This is really horribly ugly.
*/
* This is really horribly ugly.
*/
-asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long third, void *ptr, long fifth)
+asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
+ unsigned long third, void __user *ptr, long fifth)
{
int err;
/* No need for backward compatibility. We can start fresh... */
{
int err;
/* No need for backward compatibility. We can start fresh... */
-
- if (call <= SEMCTL)
+ if (call <= SEMCTL) {
switch (call) {
case SEMOP:
switch (call) {
case SEMOP:
- err = sys_semtimedop (first, (struct sembuf *)ptr, second, NULL);
+ err = sys_semtimedop(first, ptr,
+ (unsigned)second, NULL);
goto out;
case SEMTIMEDOP:
goto out;
case SEMTIMEDOP:
- err = sys_semtimedop (first, (struct sembuf *)ptr, second, (const struct timespec *) fifth);
+ err = sys_semtimedop(first, ptr, (unsigned)second,
+ (const struct timespec __user *) fifth);
goto out;
case SEMGET:
goto out;
case SEMGET:
- err = sys_semget
(first,
second, (int)third);
+ err = sys_semget
(first, (int)
second, (int)third);
goto out;
case SEMCTL: {
union semun fourth;
goto out;
case SEMCTL: {
union semun fourth;
@@
-222,79
+225,88
@@
asmlinkage int sys_ipc (unsigned call, int first, int second, unsigned long thir
if (!ptr)
goto out;
err = -EFAULT;
if (!ptr)
goto out;
err = -EFAULT;
- if(get_user(fourth.__pad, (void **)ptr))
+ if (get_user(fourth.__pad,
+ (void __user * __user *) ptr))
goto out;
goto out;
- err = sys_semctl (first, second | IPC_64, (int)third, fourth);
+ err = sys_semctl(first, (int)second | IPC_64,
+ (int)third, fourth);
goto out;
goto out;
-
}
+ }
default:
err = -ENOSYS;
goto out;
default:
err = -ENOSYS;
goto out;
- }
- if (call <= MSGCTL)
+ };
+ }
+ if (call <= MSGCTL) {
switch (call) {
case MSGSND:
switch (call) {
case MSGSND:
- err = sys_msgsnd
(first, (struct msgbuf *) ptr,
-
second,
(int)third);
+ err = sys_msgsnd
(first, ptr, (size_t)second,
+ (int)third);
goto out;
case MSGRCV:
goto out;
case MSGRCV:
- err = sys_msgrcv (first, (struct msgbuf *) ptr, second, fifth, (int)third);
+ err = sys_msgrcv(first, ptr, (size_t)second, fifth,
+ (int)third);
goto out;
case MSGGET:
goto out;
case MSGGET:
- err = sys_msgget
((key_t) first,
second);
+ err = sys_msgget
((key_t)first, (int)
second);
goto out;
case MSGCTL:
goto out;
case MSGCTL:
- err = sys_msgctl
(first, second | IPC_64, (struct msqid_ds *)
ptr);
+ err = sys_msgctl
(first, (int)second | IPC_64,
ptr);
goto out;
default:
err = -ENOSYS;
goto out;
goto out;
default:
err = -ENOSYS;
goto out;
- }
- if (call <= SHMCTL)
+ };
+ }
+ if (call <= SHMCTL) {
switch (call) {
case SHMAT: {
ulong raddr;
switch (call) {
case SHMAT: {
ulong raddr;
- err = do_shmat
(first, (char *) ptr,
second, &raddr);
+ err = do_shmat
(first, ptr, (int)
second, &raddr);
if (!err) {
if (!err) {
- if (put_user(raddr, (ulong __user *) third))
+ if (put_user(raddr,
+ (ulong __user *) third))
err = -EFAULT;
}
goto out;
}
case SHMDT:
err = -EFAULT;
}
goto out;
}
case SHMDT:
- err = sys_shmdt
((char *)
ptr);
+ err = sys_shmdt
(
ptr);
goto out;
case SHMGET:
goto out;
case SHMGET:
- err = sys_shmget
(first,
second, (int)third);
+ err = sys_shmget
(first, (size_t)
second, (int)third);
goto out;
case SHMCTL:
goto out;
case SHMCTL:
- err = sys_shmctl
(first, second | IPC_64, (struct shmid_ds *)
ptr);
+ err = sys_shmctl
(first, (int)second | IPC_64,
ptr);
goto out;
default:
err = -ENOSYS;
goto out;
goto out;
default:
err = -ENOSYS;
goto out;
- }
- else
+ }
;
+ } else {
err = -ENOSYS;
err = -ENOSYS;
+ }
out:
return err;
}
out:
return err;
}
-asmlinkage
int
sparc64_newuname(struct new_utsname __user *name)
+asmlinkage
long
sparc64_newuname(struct new_utsname __user *name)
{
int ret = sys_newuname(name);
if (current->personality == PER_LINUX32 && !ret) {
{
int ret = sys_newuname(name);
if (current->personality == PER_LINUX32 && !ret) {
- ret = copy_to_user(name->machine, "sparc\0\0", 8) ? -EFAULT : 0;
+ ret = (copy_to_user(name->machine, "sparc\0\0", 8)
+ ? -EFAULT : 0);
}
return ret;
}
}
return ret;
}
-asmlinkage
int
sparc64_personality(unsigned long personality)
+asmlinkage
long
sparc64_personality(unsigned long personality)
{
int ret;
{
int ret;
- if (current->personality == PER_LINUX32 && personality == PER_LINUX)
+ if (current->personality == PER_LINUX32 &&
+ personality == PER_LINUX)
personality = PER_LINUX32;
ret = sys_personality(personality);
if (ret == PER_LINUX32)
personality = PER_LINUX32;
ret = sys_personality(personality);
if (ret == PER_LINUX32)
@@
-408,8
+420,7
@@
out:
}
/* we come to here via sys_nis_syscall so it can setup the regs argument */
}
/* we come to here via sys_nis_syscall so it can setup the regs argument */
-asmlinkage unsigned long
-c_sys_nis_syscall (struct pt_regs *regs)
+asmlinkage unsigned long c_sys_nis_syscall(struct pt_regs *regs)
{
static int count;
{
static int count;
@@
-427,8
+438,7
@@
c_sys_nis_syscall (struct pt_regs *regs)
/* #define DEBUG_SPARC_BREAKPOINT */
/* #define DEBUG_SPARC_BREAKPOINT */
-asmlinkage void
-sparc_breakpoint (struct pt_regs *regs)
+asmlinkage void sparc_breakpoint(struct pt_regs *regs)
{
siginfo_t info;
{
siginfo_t info;
@@
-442,7
+452,7
@@
sparc_breakpoint (struct pt_regs *regs)
info.si_signo = SIGTRAP;
info.si_errno = 0;
info.si_code = TRAP_BRKPT;
info.si_signo = SIGTRAP;
info.si_errno = 0;
info.si_code = TRAP_BRKPT;
- info.si_addr = (void *)regs->tpc;
+ info.si_addr = (void
__user
*)regs->tpc;
info.si_trapno = 0;
force_sig_info(SIGTRAP, &info, current);
#ifdef DEBUG_SPARC_BREAKPOINT
info.si_trapno = 0;
force_sig_info(SIGTRAP, &info, current);
#ifdef DEBUG_SPARC_BREAKPOINT
@@
-452,7
+462,7
@@
sparc_breakpoint (struct pt_regs *regs)
extern void check_pending(int signum);
extern void check_pending(int signum);
-asmlinkage
int
sys_getdomainname(char __user *name, int len)
+asmlinkage
long
sys_getdomainname(char __user *name, int len)
{
int nlen;
int err = -EFAULT;
{
int nlen;
int err = -EFAULT;
@@
-473,7
+483,7
@@
done:
return err;
}
return err;
}
-asmlinkage
int
solaris_syscall(struct pt_regs *regs)
+asmlinkage
long
solaris_syscall(struct pt_regs *regs)
{
static int count;
{
static int count;
@@
-493,7
+503,7
@@
asmlinkage int solaris_syscall(struct pt_regs *regs)
}
#ifndef CONFIG_SUNOS_EMUL
}
#ifndef CONFIG_SUNOS_EMUL
-asmlinkage
int
sunos_syscall(struct pt_regs *regs)
+asmlinkage
long
sunos_syscall(struct pt_regs *regs)
{
static int count;
{
static int count;
@@
-511,11
+521,11
@@
asmlinkage int sunos_syscall(struct pt_regs *regs)
}
#endif
}
#endif
-asmlinkage
int
sys_utrap_install(utrap_entry_t type,
- utrap_handler_t new_p,
- utrap_handler_t new_d,
- utrap_handler_t __user *old_p,
- utrap_handler_t __user *old_d)
+asmlinkage
long
sys_utrap_install(utrap_entry_t type,
+
utrap_handler_t new_p,
+
utrap_handler_t new_d,
+
utrap_handler_t __user *old_p,
+
utrap_handler_t __user *old_d)
{
if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31)
return -EINVAL;
{
if (type < UT_INSTRUCTION_EXCEPTION || type > UT_TRAP_INSTRUCTION_31)
return -EINVAL;
@@
-582,12
+592,11
@@
long sparc_memory_ordering(unsigned long model, struct pt_regs *regs)
return 0;
}
return 0;
}
-asmlinkage long
-sys_rt_sigaction(int sig,
- const struct sigaction __user *act,
- struct sigaction __user *oact,
- void __user *restorer,
- size_t sigsetsize)
+asmlinkage long sys_rt_sigaction(int sig,
+ const struct sigaction __user *act,
+ struct sigaction __user *oact,
+ void __user *restorer,
+ size_t sigsetsize)
{
struct k_sigaction new_ka, old_ka;
int ret;
{
struct k_sigaction new_ka, old_ka;
int ret;
@@
-615,8
+624,7
@@
sys_rt_sigaction(int sig,
/* Invoked by rtrap code to update performance counters in
* user space.
*/
/* Invoked by rtrap code to update performance counters in
* user space.
*/
-asmlinkage void
-update_perfctrs(void)
+asmlinkage void update_perfctrs(void)
{
unsigned long pic, tmp;
{
unsigned long pic, tmp;
@@
-628,16
+636,15
@@
update_perfctrs(void)
reset_pic();
}
reset_pic();
}
-asmlinkage int
-sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2)
+asmlinkage long sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long arg2)
{
int err = 0;
switch(opcode) {
case PERFCTR_ON:
current_thread_info()->pcr_reg = arg2;
{
int err = 0;
switch(opcode) {
case PERFCTR_ON:
current_thread_info()->pcr_reg = arg2;
- current_thread_info()->user_cntd0 = (u64 *) arg0;
- current_thread_info()->user_cntd1 = (u64 *) arg1;
+ current_thread_info()->user_cntd0 = (u64
__user
*) arg0;
+ current_thread_info()->user_cntd1 = (u64
__user
*) arg1;
current_thread_info()->kernel_cntd0 =
current_thread_info()->kernel_cntd1 = 0;
write_pcr(arg2);
current_thread_info()->kernel_cntd0 =
current_thread_info()->kernel_cntd1 = 0;
write_pcr(arg2);
@@
-684,7
+691,8
@@
sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
break;
case PERFCTR_SETPCR: {
break;
case PERFCTR_SETPCR: {
- u64 *user_pcr = (u64 *)arg0;
+ u64 __user *user_pcr = (u64 __user *)arg0;
+
if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL;
break;
if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL;
break;
@@
-698,7
+706,8
@@
sys_perfctr(int opcode, unsigned long arg0, unsigned long arg1, unsigned long ar
}
case PERFCTR_GETPCR: {
}
case PERFCTR_GETPCR: {
- u64 *user_pcr = (u64 *)arg0;
+ u64 __user *user_pcr = (u64 __user *)arg0;
+
if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL;
break;
if (!test_thread_flag(TIF_PERFCTR)) {
err = -EINVAL;
break;