blob: 1f29c692b7effcdcaad0b376481cc379225e09c9 [file] [log] [blame]
Mikael Starvik51533b62005-07-27 11:44:44 -07001/*
2 * Copyright (C) 2003, Axis Communications AB.
3 */
4
5#include <linux/sched.h>
6#include <linux/mm.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +09007#include <linux/slab.h>
Mikael Starvik51533b62005-07-27 11:44:44 -07008#include <linux/kernel.h>
9#include <linux/signal.h>
10#include <linux/errno.h>
11#include <linux/wait.h>
12#include <linux/ptrace.h>
13#include <linux/unistd.h>
14#include <linux/stddef.h>
15#include <linux/syscalls.h>
16#include <linux/vmalloc.h>
17
18#include <asm/io.h>
19#include <asm/processor.h>
20#include <asm/ucontext.h>
21#include <asm/uaccess.h>
Jesper Nilsson556dcee2008-10-21 17:45:58 +020022#include <arch/ptrace.h>
23#include <arch/hwregs/cpu_vect.h>
Mikael Starvik51533b62005-07-27 11:44:44 -070024
25extern unsigned long cris_signal_return_page;
26
Mikael Starvik51533b62005-07-27 11:44:44 -070027/*
28 * A syscall in CRIS is really a "break 13" instruction, which is 2
29 * bytes. The registers is manipulated so upon return the instruction
30 * will be executed again.
31 *
32 * This relies on that PC points to the instruction after the break call.
33 */
34#define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->erp -= 2;
35
36/* Signal frames. */
37struct signal_frame {
38 struct sigcontext sc;
39 unsigned long extramask[_NSIG_WORDS - 1];
40 unsigned char retcode[8]; /* Trampoline code. */
41};
42
43struct rt_signal_frame {
44 struct siginfo *pinfo;
45 void *puc;
46 struct siginfo info;
47 struct ucontext uc;
48 unsigned char retcode[8]; /* Trampoline code. */
49};
50
Jesper Nilsson574852a2008-01-25 16:10:02 +010051void do_signal(int restart, struct pt_regs *regs);
Mikael Starvik51533b62005-07-27 11:44:44 -070052void keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
53 struct pt_regs *regs);
54/*
55 * Swap in the new signal mask, and wait for a signal. Define some
56 * dummy arguments to be able to reach the regs argument.
57 */
58int
Al Viro68f3f162012-05-21 21:42:32 -040059sys_sigsuspend(old_sigset_t mask)
Mikael Starvik51533b62005-07-27 11:44:44 -070060{
Al Viro68f3f162012-05-21 21:42:32 -040061 sigset_t blocked;
62 siginitset(&blocked, mask);
63 return sigsuspend(&blocked);
Mikael Starvik51533b62005-07-27 11:44:44 -070064}
65
66int
67sys_sigaction(int signal, const struct old_sigaction *act,
68 struct old_sigaction *oact)
69{
70 int retval;
71 struct k_sigaction newk;
72 struct k_sigaction oldk;
73
74 if (act) {
75 old_sigset_t mask;
76
77 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
78 __get_user(newk.sa.sa_handler, &act->sa_handler) ||
Al Viro24d696a2012-04-22 17:18:10 -040079 __get_user(newk.sa.sa_restorer, &act->sa_restorer) ||
80 __get_user(newk.sa.sa_flags, &act->sa_flags) ||
81 __get_user(mask, &act->sa_mask))
Mikael Starvik51533b62005-07-27 11:44:44 -070082 return -EFAULT;
83
Mikael Starvik51533b62005-07-27 11:44:44 -070084 siginitset(&newk.sa.sa_mask, mask);
85 }
86
87 retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL);
88
89 if (!retval && oact) {
90 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
91 __put_user(oldk.sa.sa_handler, &oact->sa_handler) ||
Al Viro24d696a2012-04-22 17:18:10 -040092 __put_user(oldk.sa.sa_restorer, &oact->sa_restorer) ||
93 __put_user(oldk.sa.sa_flags, &oact->sa_flags) ||
94 __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask))
Mikael Starvik51533b62005-07-27 11:44:44 -070095 return -EFAULT;
96
Mikael Starvik51533b62005-07-27 11:44:44 -070097 }
98
99 return retval;
100}
101
Mikael Starvik51533b62005-07-27 11:44:44 -0700102static int
103restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
104{
105 unsigned int err = 0;
106 unsigned long old_usp;
107
108 /* Always make any pending restarted system calls return -EINTR */
109 current_thread_info()->restart_block.fn = do_no_restart_syscall;
110
111 /*
112 * Restore the registers from &sc->regs. sc is already checked
113 * for VERIFY_READ since the signal_frame was previously
114 * checked in sys_sigreturn().
115 */
116 if (__copy_from_user(regs, sc, sizeof(struct pt_regs)))
117 goto badframe;
118
119 /* Make that the user-mode flag is set. */
120 regs->ccs |= (1 << (U_CCS_BITNR + CCS_SHIFT));
121
122 /* Restore the old USP. */
123 err |= __get_user(old_usp, &sc->usp);
124 wrusp(old_usp);
125
126 return err;
127
128badframe:
129 return 1;
130}
131
132/* Define some dummy arguments to be able to reach the regs argument. */
133asmlinkage int
134sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
135 struct pt_regs *regs)
136{
137 sigset_t set;
138 struct signal_frame __user *frame;
139 unsigned long oldspc = regs->spc;
140 unsigned long oldccs = regs->ccs;
141
142 frame = (struct signal_frame *) rdusp();
143
144 /*
145 * Since the signal is stacked on a dword boundary, the frame
146 * should be dword aligned here as well. It it's not, then the
147 * user is trying some funny business.
148 */
149 if (((long)frame) & 3)
150 goto badframe;
151
152 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
153 goto badframe;
154
155 if (__get_user(set.sig[0], &frame->sc.oldmask) ||
156 (_NSIG_WORDS > 1 && __copy_from_user(&set.sig[1],
157 frame->extramask,
158 sizeof(frame->extramask))))
159 goto badframe;
160
Matt Flemingf3b5e822012-05-11 10:58:00 +1000161 set_current_blocked(&set);
Mikael Starvik51533b62005-07-27 11:44:44 -0700162
163 if (restore_sigcontext(regs, &frame->sc))
164 goto badframe;
165
166 keep_debug_flags(oldccs, oldspc, regs);
167
168 return regs->r10;
169
170badframe:
171 force_sig(SIGSEGV, current);
172 return 0;
173}
174
175/* Define some dummy variables to be able to reach the regs argument. */
176asmlinkage int
177sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
178 struct pt_regs *regs)
179{
180 sigset_t set;
181 struct rt_signal_frame __user *frame;
182 unsigned long oldspc = regs->spc;
183 unsigned long oldccs = regs->ccs;
184
185 frame = (struct rt_signal_frame *) rdusp();
186
187 /*
188 * Since the signal is stacked on a dword boundary, the frame
189 * should be dword aligned here as well. It it's not, then the
190 * user is trying some funny business.
191 */
192 if (((long)frame) & 3)
193 goto badframe;
194
195 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
196 goto badframe;
197
198 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
199 goto badframe;
200
Matt Flemingf3b5e822012-05-11 10:58:00 +1000201 set_current_blocked(&set);
Mikael Starvik51533b62005-07-27 11:44:44 -0700202
203 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
204 goto badframe;
205
Al Virod970e422012-12-23 02:07:30 -0500206 if (restore_altstack(&frame->uc.uc_stack))
Jesper Nilsson574852a2008-01-25 16:10:02 +0100207 goto badframe;
Mikael Starvik51533b62005-07-27 11:44:44 -0700208
209 keep_debug_flags(oldccs, oldspc, regs);
210
211 return regs->r10;
212
213badframe:
214 force_sig(SIGSEGV, current);
215 return 0;
216}
217
218/* Setup a signal frame. */
219static int
220setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
221 unsigned long mask)
222{
223 int err;
224 unsigned long usp;
225
226 err = 0;
227 usp = rdusp();
228
229 /*
230 * Copy the registers. They are located first in sc, so it's
231 * possible to use sc directly.
232 */
233 err |= __copy_to_user(sc, regs, sizeof(struct pt_regs));
234
235 err |= __put_user(mask, &sc->oldmask);
236 err |= __put_user(usp, &sc->usp);
237
238 return err;
239}
240
241/* Figure out where to put the new signal frame - usually on the stack. */
242static inline void __user *
243get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
244{
245 unsigned long sp;
246
247 sp = rdusp();
248
249 /* This is the X/Open sanctioned signal stack switching. */
250 if (ka->sa.sa_flags & SA_ONSTACK) {
251 if (!on_sig_stack(sp))
252 sp = current->sas_ss_sp + current->sas_ss_size;
253 }
254
255 /* Make sure the frame is dword-aligned. */
256 sp &= ~3;
257
258 return (void __user *)(sp - frame_size);
259}
260
261/* Grab and setup a signal frame.
262 *
263 * Basically a lot of state-info is stacked, and arranged for the
Jesper Nilsson574852a2008-01-25 16:10:02 +0100264 * user-mode program to return to the kernel using either a trampiline
Mikael Starvik51533b62005-07-27 11:44:44 -0700265 * which performs the syscall sigreturn(), or a provided user-mode
266 * trampoline.
267 */
Jesper Nilsson574852a2008-01-25 16:10:02 +0100268static int
Mikael Starvik51533b62005-07-27 11:44:44 -0700269setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
270 struct pt_regs * regs)
271{
272 int err;
273 unsigned long return_ip;
274 struct signal_frame __user *frame;
275
276 err = 0;
277 frame = get_sigframe(ka, regs, sizeof(*frame));
278
279 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
280 goto give_sigsegv;
281
282 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
283
284 if (err)
285 goto give_sigsegv;
286
287 if (_NSIG_WORDS > 1) {
288 err |= __copy_to_user(frame->extramask, &set->sig[1],
289 sizeof(frame->extramask));
290 }
291
292 if (err)
293 goto give_sigsegv;
294
295 /*
296 * Set up to return from user-space. If provided, use a stub
297 * already located in user-space.
298 */
299 if (ka->sa.sa_flags & SA_RESTORER) {
300 return_ip = (unsigned long)ka->sa.sa_restorer;
301 } else {
302 /* Trampoline - the desired return ip is in the signal return page. */
303 return_ip = cris_signal_return_page;
304
305 /*
306 * This is movu.w __NR_sigreturn, r9; break 13;
307 *
308 * WE DO NOT USE IT ANY MORE! It's only left here for historical
309 * reasons and because gdb uses it as a signature to notice
310 * signal handler stack frames.
311 */
312 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
313 err |= __put_user(__NR_sigreturn, (short __user*)(frame->retcode+2));
314 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
315 }
316
317 if (err)
318 goto give_sigsegv;
319
320 /*
321 * Set up registers for signal handler.
322 *
323 * Where the code enters now.
324 * Where the code enter later.
325 * First argument, signo.
326 */
327 regs->erp = (unsigned long) ka->sa.sa_handler;
328 regs->srp = return_ip;
329 regs->r10 = sig;
330
331 /* Actually move the USP to reflect the stacked frame. */
332 wrusp((unsigned long)frame);
333
Jesper Nilsson574852a2008-01-25 16:10:02 +0100334 return 0;
Mikael Starvik51533b62005-07-27 11:44:44 -0700335
336give_sigsegv:
Al Viro6eef0192012-04-21 21:35:56 -0400337 force_sigsegv(sig, current);
Jesper Nilsson574852a2008-01-25 16:10:02 +0100338 return -EFAULT;
Mikael Starvik51533b62005-07-27 11:44:44 -0700339}
340
Jesper Nilsson574852a2008-01-25 16:10:02 +0100341static int
Mikael Starvik51533b62005-07-27 11:44:44 -0700342setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
343 sigset_t *set, struct pt_regs * regs)
344{
345 int err;
346 unsigned long return_ip;
347 struct rt_signal_frame __user *frame;
348
349 err = 0;
350 frame = get_sigframe(ka, regs, sizeof(*frame));
351
352 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
353 goto give_sigsegv;
354
355 /* TODO: what is the current->exec_domain stuff and invmap ? */
356
357 err |= __put_user(&frame->info, &frame->pinfo);
358 err |= __put_user(&frame->uc, &frame->puc);
359 err |= copy_siginfo_to_user(&frame->info, info);
360
361 if (err)
362 goto give_sigsegv;
363
364 /* Clear all the bits of the ucontext we don't use. */
365 err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
366 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
367 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
Al Viro9df794d2012-12-23 02:11:49 -0500368 err |= __save_altstack(&frame->uc.uc_stack, rdusp());
Mikael Starvik51533b62005-07-27 11:44:44 -0700369
370 if (err)
371 goto give_sigsegv;
372
373 /*
374 * Set up to return from user-space. If provided, use a stub
375 * already located in user-space.
376 */
377 if (ka->sa.sa_flags & SA_RESTORER) {
378 return_ip = (unsigned long) ka->sa.sa_restorer;
379 } else {
380 /* Trampoline - the desired return ip is in the signal return page. */
381 return_ip = cris_signal_return_page + 6;
382
383 /*
384 * This is movu.w __NR_rt_sigreturn, r9; break 13;
385 *
386 * WE DO NOT USE IT ANY MORE! It's only left here for historical
387 * reasons and because gdb uses it as a signature to notice
388 * signal handler stack frames.
389 */
390 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
391
392 err |= __put_user(__NR_rt_sigreturn,
393 (short __user*)(frame->retcode+2));
394
395 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
396 }
397
398 if (err)
399 goto give_sigsegv;
400
401 /*
402 * Set up registers for signal handler.
403 *
404 * Where the code enters now.
405 * Where the code enters later.
406 * First argument is signo.
407 * Second argument is (siginfo_t *).
408 * Third argument is unused.
409 */
410 regs->erp = (unsigned long) ka->sa.sa_handler;
411 regs->srp = return_ip;
412 regs->r10 = sig;
413 regs->r11 = (unsigned long) &frame->info;
414 regs->r12 = 0;
415
416 /* Actually move the usp to reflect the stacked frame. */
417 wrusp((unsigned long)frame);
418
Jesper Nilsson574852a2008-01-25 16:10:02 +0100419 return 0;
Mikael Starvik51533b62005-07-27 11:44:44 -0700420
421give_sigsegv:
Al Viro6eef0192012-04-21 21:35:56 -0400422 force_sigsegv(sig, current);
Jesper Nilsson574852a2008-01-25 16:10:02 +0100423 return -EFAULT;
Mikael Starvik51533b62005-07-27 11:44:44 -0700424}
425
Frederik Schwarzerc03264a2008-12-23 00:54:00 +0100426/* Invoke a signal handler to, well, handle the signal. */
Al Viroa610d6e2012-05-21 23:42:15 -0400427static inline void
Mikael Starvik51533b62005-07-27 11:44:44 -0700428handle_signal(int canrestart, unsigned long sig,
429 siginfo_t *info, struct k_sigaction *ka,
Al Virob7f9a112012-05-02 09:59:21 -0400430 struct pt_regs * regs)
Mikael Starvik51533b62005-07-27 11:44:44 -0700431{
Al Virob7f9a112012-05-02 09:59:21 -0400432 sigset_t *oldset = sigmask_to_save();
Jesper Nilsson574852a2008-01-25 16:10:02 +0100433 int ret;
434
Mikael Starvik51533b62005-07-27 11:44:44 -0700435 /* Check if this got called from a system call. */
436 if (canrestart) {
437 /* If so, check system call restarting. */
438 switch (regs->r10) {
439 case -ERESTART_RESTARTBLOCK:
440 case -ERESTARTNOHAND:
441 /*
442 * This means that the syscall should
443 * only be restarted if there was no
444 * handler for the signal, and since
445 * this point isn't reached unless
446 * there is a handler, there's no need
447 * to restart.
448 */
449 regs->r10 = -EINTR;
450 break;
451
452 case -ERESTARTSYS:
453 /*
454 * This means restart the syscall if
455 * there is no handler, or the handler
456 * was registered with SA_RESTART.
457 */
458 if (!(ka->sa.sa_flags & SA_RESTART)) {
459 regs->r10 = -EINTR;
460 break;
461 }
462
463 /* Fall through. */
464
465 case -ERESTARTNOINTR:
466 /*
467 * This means that the syscall should
468 * be called again after the signal
469 * handler returns.
470 */
471 RESTART_CRIS_SYS(regs);
472 break;
473 }
474 }
475
476 /* Set up the stack frame. */
477 if (ka->sa.sa_flags & SA_SIGINFO)
Jesper Nilsson574852a2008-01-25 16:10:02 +0100478 ret = setup_rt_frame(sig, ka, info, oldset, regs);
Mikael Starvik51533b62005-07-27 11:44:44 -0700479 else
Jesper Nilsson574852a2008-01-25 16:10:02 +0100480 ret = setup_frame(sig, ka, oldset, regs);
Mikael Starvik51533b62005-07-27 11:44:44 -0700481
Matt Flemingf3b5e822012-05-11 10:58:00 +1000482 if (ret == 0)
Al Viroefee9842012-04-28 02:04:15 -0400483 signal_delivered(sig, info, ka, regs, 0);
Mikael Starvik51533b62005-07-27 11:44:44 -0700484}
485
486/*
487 * Note that 'init' is a special process: it doesn't get signals it doesn't
488 * want to handle. Thus you cannot kill init even with a SIGKILL even by
489 * mistake.
490 *
491 * Also note that the regs structure given here as an argument, is the latest
492 * pushed pt_regs. It may or may not be the same as the first pushed registers
493 * when the initial usermode->kernelmode transition took place. Therefore
494 * we can use user_mode(regs) to see if we came directly from kernel or user
495 * mode below.
496 */
Jesper Nilsson574852a2008-01-25 16:10:02 +0100497void
498do_signal(int canrestart, struct pt_regs *regs)
Mikael Starvik51533b62005-07-27 11:44:44 -0700499{
500 int signr;
501 siginfo_t info;
502 struct k_sigaction ka;
503
504 /*
505 * The common case should go fast, which is why this point is
506 * reached from kernel-mode. If that's the case, just return
507 * without doing anything.
508 */
509 if (!user_mode(regs))
Jesper Nilsson574852a2008-01-25 16:10:02 +0100510 return;
Mikael Starvik51533b62005-07-27 11:44:44 -0700511
Mikael Starvik51533b62005-07-27 11:44:44 -0700512 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
513
514 if (signr > 0) {
Jesper Nilsson574852a2008-01-25 16:10:02 +0100515 /* Whee! Actually deliver the signal. */
Al Viroa610d6e2012-05-21 23:42:15 -0400516 handle_signal(canrestart, signr, &info, &ka, regs);
Jesper Nilsson574852a2008-01-25 16:10:02 +0100517 return;
Mikael Starvik51533b62005-07-27 11:44:44 -0700518 }
519
520 /* Got here from a system call? */
521 if (canrestart) {
522 /* Restart the system call - no handlers present. */
523 if (regs->r10 == -ERESTARTNOHAND ||
524 regs->r10 == -ERESTARTSYS ||
525 regs->r10 == -ERESTARTNOINTR) {
526 RESTART_CRIS_SYS(regs);
527 }
528
529 if (regs->r10 == -ERESTART_RESTARTBLOCK){
Jesper Nilsson39923322010-08-03 15:55:48 +0200530 regs->r9 = __NR_restart_syscall;
Mikael Starvik51533b62005-07-27 11:44:44 -0700531 regs->erp -= 2;
532 }
533 }
534
Jesper Nilsson574852a2008-01-25 16:10:02 +0100535 /* if there's no signal to deliver, we just put the saved sigmask
536 * back */
Al Viro51a7b442012-05-21 23:33:55 -0400537 restore_saved_sigmask();
Mikael Starvik51533b62005-07-27 11:44:44 -0700538}
539
540asmlinkage void
541ugdb_trap_user(struct thread_info *ti, int sig)
542{
543 if (((user_regs(ti)->exs & 0xff00) >> 8) != SINGLE_STEP_INTR_VECT) {
544 /* Zero single-step PC if the reason we stopped wasn't a single
545 step exception. This is to avoid relying on it when it isn't
546 reliable. */
547 user_regs(ti)->spc = 0;
548 }
549 /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300550 not within any configured h/w breakpoint range). Synchronize with
Mikael Starvik51533b62005-07-27 11:44:44 -0700551 what already exists for kernel debugging. */
552 if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) {
553 /* Break 8: subtract 2 from ERP unless in a delay slot. */
554 if (!(user_regs(ti)->erp & 0x1))
555 user_regs(ti)->erp -= 2;
556 }
557 sys_kill(ti->task->pid, sig);
558}
559
560void
561keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
562 struct pt_regs *regs)
563{
564 if (oldccs & (1 << Q_CCS_BITNR)) {
565 /* Pending single step due to single-stepping the break 13
566 in the signal trampoline: keep the Q flag. */
567 regs->ccs |= (1 << Q_CCS_BITNR);
568 /* S flag should be set - complain if it's not. */
569 if (!(oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT)))) {
570 printk("Q flag but no S flag?");
571 }
572 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
573 /* Assume the SPC is valid and interesting. */
574 regs->spc = oldspc;
575
576 } else if (oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT))) {
577 /* If a h/w bp was set in the signal handler we need
578 to keep the S flag. */
579 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
580 /* Don't keep the old SPC though; if we got here due to
581 a single-step, the Q flag should have been set. */
582 } else if (regs->spc) {
583 /* If we were single-stepping *before* the signal was taken,
584 we don't want to restore that state now, because GDB will
585 have forgotten all about it. */
586 regs->spc = 0;
587 regs->ccs &= ~(1 << (S_CCS_BITNR + CCS_SHIFT));
588 }
589}
590
591/* Set up the trampolines on the signal return page. */
592int __init
593cris_init_signal(void)
594{
Robert P. J. Day5cbded52006-12-13 00:35:56 -0800595 u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);
Mikael Starvik51533b62005-07-27 11:44:44 -0700596
597 /* This is movu.w __NR_sigreturn, r9; break 13; */
598 data[0] = 0x9c5f;
599 data[1] = __NR_sigreturn;
600 data[2] = 0xe93d;
601 /* This is movu.w __NR_rt_sigreturn, r9; break 13; */
602 data[3] = 0x9c5f;
603 data[4] = __NR_rt_sigreturn;
604 data[5] = 0xe93d;
605
606 /* Map to userspace with appropriate permissions (no write access...) */
607 cris_signal_return_page = (unsigned long)
608 __ioremap_prot(virt_to_phys(data), PAGE_SIZE, PAGE_SIGNAL_TRAMPOLINE);
609
610 return 0;
611}
612
613__initcall(cris_init_signal);