diff options
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r-- | arch/cris/arch-v10/kernel/signal.c | 65 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/time.c | 10 |
2 files changed, 13 insertions, 62 deletions
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c index 0bb477c13a4e..61ce6273a895 100644 --- a/arch/cris/arch-v10/kernel/signal.c +++ b/arch/cris/arch-v10/kernel/signal.c @@ -42,55 +42,6 @@ void do_signal(int canrestart, struct pt_regs *regs); /* - * Atomically swap in the new signal mask, and wait for a signal. Define - * dummy arguments to be able to reach the regs argument. (Note that this - * arrangement relies on old_sigset_t occupying one register.) - */ -int sys_sigsuspend(old_sigset_t mask) -{ - sigset_t blocked; - siginitset(&blocked, mask); - return sigsuspend(&blocked); -} - -int sys_sigaction(int sig, const struct old_sigaction __user *act, - struct old_sigaction *oact) -{ - struct k_sigaction new_ka, old_ka; - int ret; - - if (act) { - old_sigset_t mask; - if (!access_ok(VERIFY_READ, act, sizeof(*act)) || - __get_user(new_ka.sa.sa_handler, &act->sa_handler) || - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || - __get_user(new_ka.sa.sa_flags, &act->sa_flags) || - __get_user(mask, &act->sa_mask)) - return -EFAULT; - siginitset(&new_ka.sa.sa_mask, mask); - } - - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); - - if (!ret && oact) { - if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || - __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) - return -EFAULT; - } - - return ret; -} - -int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss) -{ - return do_sigaltstack(uss, uoss, rdusp()); -} - - -/* * Do a signal return; undo the signal stack. */ @@ -150,11 +101,9 @@ badframe: return 1; } -/* Define dummy arguments to be able to reach the regs argument. */ - -asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, - long srp, struct pt_regs *regs) +asmlinkage int sys_sigreturn(void) { + struct pt_regs *regs = current_pt_regs(); struct sigframe __user *frame = (struct sigframe *)rdusp(); sigset_t set; @@ -188,11 +137,9 @@ badframe: return 0; } -/* Define dummy arguments to be able to reach the regs argument. */ - -asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, - long mof, long srp, struct pt_regs *regs) +asmlinkage int sys_rt_sigreturn(void) { + struct pt_regs *regs = current_pt_regs(); struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); sigset_t set; @@ -214,7 +161,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) goto badframe; - if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) + if (restore_altstack(&frame->uc.uc_stack)) goto badframe; return regs->r10; @@ -362,6 +309,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); + err |= __save_altstack(&frame->uc.uc_stack, rdusp()); + if (err) goto give_sigsegv; diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c index bcffcb6a9415..fce7c541d70d 100644 --- a/arch/cris/arch-v10/kernel/time.c +++ b/arch/cris/arch-v10/kernel/time.c @@ -55,9 +55,9 @@ unsigned long get_ns_in_jiffie(void) return ns; } -unsigned long do_slow_gettimeoffset(void) +static u32 cris_v10_gettimeoffset(void) { - unsigned long count; + u32 count; /* The timer interrupt comes from Etrax timer 0. In order to get * better precision, we check the current value. It might have @@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void) */ count = *R_TIMER0_DATA; - /* Convert timer value to usec */ - return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV; + /* Convert timer value to nsec */ + return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV; } /* Excerpt from the Etrax100 HSDD about the built-in watchdog: @@ -191,6 +191,8 @@ static struct irqaction irq2 = { void __init time_init(void) { + arch_gettimeoffset = cris_v10_gettimeoffset; + /* probe for the RTC and read it if it exists * Before the RTC can be probed the loops_per_usec variable needs * to be initialized to make usleep work. A better value for |