aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v10')
-rw-r--r--arch/cris/arch-v10/kernel/signal.c65
-rw-r--r--arch/cris/arch-v10/kernel/time.c10
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 @@
42void do_signal(int canrestart, struct pt_regs *regs); 42void do_signal(int canrestart, struct pt_regs *regs);
43 43
44/* 44/*
45 * Atomically swap in the new signal mask, and wait for a signal. Define
46 * dummy arguments to be able to reach the regs argument. (Note that this
47 * arrangement relies on old_sigset_t occupying one register.)
48 */
49int sys_sigsuspend(old_sigset_t mask)
50{
51 sigset_t blocked;
52 siginitset(&blocked, mask);
53 return sigsuspend(&blocked);
54}
55
56int sys_sigaction(int sig, const struct old_sigaction __user *act,
57 struct old_sigaction *oact)
58{
59 struct k_sigaction new_ka, old_ka;
60 int ret;
61
62 if (act) {
63 old_sigset_t mask;
64 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
65 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
66 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
67 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
68 __get_user(mask, &act->sa_mask))
69 return -EFAULT;
70 siginitset(&new_ka.sa.sa_mask, mask);
71 }
72
73 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
74
75 if (!ret && oact) {
76 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
77 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
78 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
79 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
80 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
81 return -EFAULT;
82 }
83
84 return ret;
85}
86
87int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
88{
89 return do_sigaltstack(uss, uoss, rdusp());
90}
91
92
93/*
94 * Do a signal return; undo the signal stack. 45 * Do a signal return; undo the signal stack.
95 */ 46 */
96 47
@@ -150,11 +101,9 @@ badframe:
150 return 1; 101 return 1;
151} 102}
152 103
153/* Define dummy arguments to be able to reach the regs argument. */ 104asmlinkage int sys_sigreturn(void)
154
155asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
156 long srp, struct pt_regs *regs)
157{ 105{
106 struct pt_regs *regs = current_pt_regs();
158 struct sigframe __user *frame = (struct sigframe *)rdusp(); 107 struct sigframe __user *frame = (struct sigframe *)rdusp();
159 sigset_t set; 108 sigset_t set;
160 109
@@ -188,11 +137,9 @@ badframe:
188 return 0; 137 return 0;
189} 138}
190 139
191/* Define dummy arguments to be able to reach the regs argument. */ 140asmlinkage int sys_rt_sigreturn(void)
192
193asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
194 long mof, long srp, struct pt_regs *regs)
195{ 141{
142 struct pt_regs *regs = current_pt_regs();
196 struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); 143 struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
197 sigset_t set; 144 sigset_t set;
198 145
@@ -214,7 +161,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
214 if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) 161 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
215 goto badframe; 162 goto badframe;
216 163
217 if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) 164 if (restore_altstack(&frame->uc.uc_stack))
218 goto badframe; 165 goto badframe;
219 166
220 return regs->r10; 167 return regs->r10;
@@ -362,6 +309,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
362 309
363 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 310 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
364 311
312 err |= __save_altstack(&frame->uc.uc_stack, rdusp());
313
365 if (err) 314 if (err)
366 goto give_sigsegv; 315 goto give_sigsegv;
367 316
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)
55 return ns; 55 return ns;
56} 56}
57 57
58unsigned long do_slow_gettimeoffset(void) 58static u32 cris_v10_gettimeoffset(void)
59{ 59{
60 unsigned long count; 60 u32 count;
61 61
62 /* The timer interrupt comes from Etrax timer 0. In order to get 62 /* The timer interrupt comes from Etrax timer 0. In order to get
63 * better precision, we check the current value. It might have 63 * better precision, we check the current value. It might have
@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void)
65 */ 65 */
66 count = *R_TIMER0_DATA; 66 count = *R_TIMER0_DATA;
67 67
68 /* Convert timer value to usec */ 68 /* Convert timer value to nsec */
69 return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV; 69 return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV;
70} 70}
71 71
72/* Excerpt from the Etrax100 HSDD about the built-in watchdog: 72/* Excerpt from the Etrax100 HSDD about the built-in watchdog:
@@ -191,6 +191,8 @@ static struct irqaction irq2 = {
191void __init 191void __init
192time_init(void) 192time_init(void)
193{ 193{
194 arch_gettimeoffset = cris_v10_gettimeoffset;
195
194 /* probe for the RTC and read it if it exists 196 /* probe for the RTC and read it if it exists
195 * Before the RTC can be probed the loops_per_usec variable needs 197 * Before the RTC can be probed the loops_per_usec variable needs
196 * to be initialized to make usleep work. A better value for 198 * to be initialized to make usleep work. A better value for