Commit 021ba6a0 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds

[PATCH] Consolidate sys_pause

14 of our 17 architectures define sys_pause exactly the same
way.  The other three don't define it at all.  I assume glibc
translates pause() into sigsuspend() or something.
parent f72a32ff
......@@ -279,10 +279,3 @@ asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, struct pt_r
out:
return error;
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -167,12 +167,3 @@ asmlinkage int sys_ipc (uint call, int first, int second,
return -EINVAL;
}
}
/* apparently this is legacy - if we don't need this in Linux/CRIS we can remove it. */
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -246,11 +246,3 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
return error;
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -676,13 +676,3 @@ asmlinkage int sys_getpagesize(void)
{
return PAGE_SIZE;
}
/*
* Old cruft
*/
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -156,10 +156,3 @@ sys_cachectl(char *addr, int nbytes, int op)
{
return -ENOSYS;
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -275,10 +275,3 @@ asmlinkage void bad_stack(void)
{
do_exit(SIGSEGV);
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -37,13 +37,6 @@ int sys_pipe(int *fildes)
return error;
}
int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
int sys_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long fd,
unsigned long offset)
......
......@@ -257,13 +257,6 @@ ppc_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
return sys_select(n, inp, outp, exp, tvp);
}
int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
int sys_uname(struct old_utsname * name)
{
int err = -EFAULT;
......
......@@ -227,17 +227,6 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
return ret;
}
asmlinkage int sys_pause(void)
{
PPCDBG(PPCDBG_SYS64X, "sys_pause - entered - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
current->state = TASK_INTERRUPTIBLE;
schedule();
PPCDBG(PPCDBG_SYS64X, "sys_pause - exited - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
return -ERESTARTNOHAND;
}
static int __init set_fakeppc(char *str)
{
if (*str)
......
......@@ -241,13 +241,6 @@ asmlinkage int sys_olduname(struct oldold_utsname * name)
return error;
}
asmlinkage int sys_pause(void)
{
set_current_state(TASK_INTERRUPTIBLE);
schedule();
return -ERESTARTNOHAND;
}
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
{
return -ENOSYS;
......
......@@ -197,13 +197,6 @@ asmlinkage int sys_uname(struct old_utsname * name)
return err?-EFAULT:0;
}
asmlinkage int sys_pause(void)
{
set_current_state(TASK_INTERRUPTIBLE);
schedule();
return -ERESTARTNOHAND;
}
extern asmlinkage int sys_newuname(struct new_utsname * name);
asmlinkage int s390x_newuname(struct new_utsname * name)
......
......@@ -231,10 +231,3 @@ asmlinkage int sys_uname(struct old_utsname * name)
up_read(&uts_sem);
return err?-EFAULT:0;
}
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
......@@ -442,14 +442,6 @@ sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact,
return ret;
}
/* Just in case some old old binary calls this. */
asmlinkage int sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
asmlinkage int sys_getdomainname(char *name, int len)
{
int nlen;
......
......@@ -105,13 +105,6 @@ asmlinkage long sys_uname(struct new_utsname * name)
return err ? -EFAULT : 0;
}
asmlinkage long sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
asmlinkage long wrap_sys_shmat(int shmid, char *shmaddr, int shmflg)
{
unsigned long raddr;
......
......@@ -187,6 +187,7 @@ struct sigstack {
#include <asm/sigcontext.h>
#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER
#define HAVE_ARCH_SYS_PAUSE
#endif
......
......@@ -167,6 +167,7 @@ struct k_sigaction {
# include <asm/sigcontext.h>
#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER
#define HAVE_ARCH_SYS_PAUSE
#endif /* __KERNEL__ */
......
......@@ -254,6 +254,7 @@ typedef struct sigaltstack32 {
} stack_t32;
#define HAVE_ARCH_GET_SIGNAL_TO_DELIVER
#define HAVE_ARCH_SYS_PAUSE
#endif
......
......@@ -1488,3 +1488,15 @@ sys_signal(int sig, __sighandler_t handler)
return ret ? ret : (unsigned long)old_sa.sa.sa_handler;
}
#endif /* !alpha && !__ia64__ && !defined(__mips__) && !defined(__arm__) */
#ifndef HAVE_ARCH_SYS_PAUSE
asmlinkage int
sys_pause(void)
{
current->state = TASK_INTERRUPTIBLE;
schedule();
return -ERESTARTNOHAND;
}
#endif /* HAVE_ARCH_SYS_PAUSE */
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