blob: 168b6958e2b8b9d3464ee4333a7308de1d8aafd2 [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));
368
369 if (err)
370 goto give_sigsegv;
371
372 /*
373 * Set up to return from user-space. If provided, use a stub
374 * already located in user-space.
375 */
376 if (ka->sa.sa_flags & SA_RESTORER) {
377 return_ip = (unsigned long) ka->sa.sa_restorer;
378 } else {
379 /* Trampoline - the desired return ip is in the signal return page. */
380 return_ip = cris_signal_return_page + 6;
381
382 /*
383 * This is movu.w __NR_rt_sigreturn, r9; break 13;
384 *
385 * WE DO NOT USE IT ANY MORE! It's only left here for historical
386 * reasons and because gdb uses it as a signature to notice
387 * signal handler stack frames.
388 */
389 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
390
391 err |= __put_user(__NR_rt_sigreturn,
392 (short __user*)(frame->retcode+2));
393
394 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
395 }
396
397 if (err)
398 goto give_sigsegv;
399
400 /*
401 * Set up registers for signal handler.
402 *
403 * Where the code enters now.
404 * Where the code enters later.
405 * First argument is signo.
406 * Second argument is (siginfo_t *).
407 * Third argument is unused.
408 */
409 regs->erp = (unsigned long) ka->sa.sa_handler;
410 regs->srp = return_ip;
411 regs->r10 = sig;
412 regs->r11 = (unsigned long) &frame->info;
413 regs->r12 = 0;
414
415 /* Actually move the usp to reflect the stacked frame. */
416 wrusp((unsigned long)frame);
417
Jesper Nilsson574852a2008-01-25 16:10:02 +0100418 return 0;
Mikael Starvik51533b62005-07-27 11:44:44 -0700419
420give_sigsegv:
Al Viro6eef0192012-04-21 21:35:56 -0400421 force_sigsegv(sig, current);
Jesper Nilsson574852a2008-01-25 16:10:02 +0100422 return -EFAULT;
Mikael Starvik51533b62005-07-27 11:44:44 -0700423}
424
Frederik Schwarzerc03264a2008-12-23 00:54:00 +0100425/* Invoke a signal handler to, well, handle the signal. */
Al Viroa610d6e2012-05-21 23:42:15 -0400426static inline void
Mikael Starvik51533b62005-07-27 11:44:44 -0700427handle_signal(int canrestart, unsigned long sig,
428 siginfo_t *info, struct k_sigaction *ka,
Al Virob7f9a112012-05-02 09:59:21 -0400429 struct pt_regs * regs)
Mikael Starvik51533b62005-07-27 11:44:44 -0700430{
Al Virob7f9a112012-05-02 09:59:21 -0400431 sigset_t *oldset = sigmask_to_save();
Jesper Nilsson574852a2008-01-25 16:10:02 +0100432 int ret;
433
Mikael Starvik51533b62005-07-27 11:44:44 -0700434 /* Check if this got called from a system call. */
435 if (canrestart) {
436 /* If so, check system call restarting. */
437 switch (regs->r10) {
438 case -ERESTART_RESTARTBLOCK:
439 case -ERESTARTNOHAND:
440 /*
441 * This means that the syscall should
442 * only be restarted if there was no
443 * handler for the signal, and since
444 * this point isn't reached unless
445 * there is a handler, there's no need
446 * to restart.
447 */
448 regs->r10 = -EINTR;
449 break;
450
451 case -ERESTARTSYS:
452 /*
453 * This means restart the syscall if
454 * there is no handler, or the handler
455 * was registered with SA_RESTART.
456 */
457 if (!(ka->sa.sa_flags & SA_RESTART)) {
458 regs->r10 = -EINTR;
459 break;
460 }
461
462 /* Fall through. */
463
464 case -ERESTARTNOINTR:
465 /*
466 * This means that the syscall should
467 * be called again after the signal
468 * handler returns.
469 */
470 RESTART_CRIS_SYS(regs);
471 break;
472 }
473 }
474
475 /* Set up the stack frame. */
476 if (ka->sa.sa_flags & SA_SIGINFO)
Jesper Nilsson574852a2008-01-25 16:10:02 +0100477 ret = setup_rt_frame(sig, ka, info, oldset, regs);
Mikael Starvik51533b62005-07-27 11:44:44 -0700478 else
Jesper Nilsson574852a2008-01-25 16:10:02 +0100479 ret = setup_frame(sig, ka, oldset, regs);
Mikael Starvik51533b62005-07-27 11:44:44 -0700480
Matt Flemingf3b5e822012-05-11 10:58:00 +1000481 if (ret == 0)
Al Viroefee9842012-04-28 02:04:15 -0400482 signal_delivered(sig, info, ka, regs, 0);
Mikael Starvik51533b62005-07-27 11:44:44 -0700483}
484
485/*
486 * Note that 'init' is a special process: it doesn't get signals it doesn't
487 * want to handle. Thus you cannot kill init even with a SIGKILL even by
488 * mistake.
489 *
490 * Also note that the regs structure given here as an argument, is the latest
491 * pushed pt_regs. It may or may not be the same as the first pushed registers
492 * when the initial usermode->kernelmode transition took place. Therefore
493 * we can use user_mode(regs) to see if we came directly from kernel or user
494 * mode below.
495 */
Jesper Nilsson574852a2008-01-25 16:10:02 +0100496void
497do_signal(int canrestart, struct pt_regs *regs)
Mikael Starvik51533b62005-07-27 11:44:44 -0700498{
499 int signr;
500 siginfo_t info;
501 struct k_sigaction ka;
502
503 /*
504 * The common case should go fast, which is why this point is
505 * reached from kernel-mode. If that's the case, just return
506 * without doing anything.
507 */
508 if (!user_mode(regs))
Jesper Nilsson574852a2008-01-25 16:10:02 +0100509 return;
Mikael Starvik51533b62005-07-27 11:44:44 -0700510
Mikael Starvik51533b62005-07-27 11:44:44 -0700511 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
512
513 if (signr > 0) {
Jesper Nilsson574852a2008-01-25 16:10:02 +0100514 /* Whee! Actually deliver the signal. */
Al Viroa610d6e2012-05-21 23:42:15 -0400515 handle_signal(canrestart, signr, &info, &ka, regs);
Jesper Nilsson574852a2008-01-25 16:10:02 +0100516 return;
Mikael Starvik51533b62005-07-27 11:44:44 -0700517 }
518
519 /* Got here from a system call? */
520 if (canrestart) {
521 /* Restart the system call - no handlers present. */
522 if (regs->r10 == -ERESTARTNOHAND ||
523 regs->r10 == -ERESTARTSYS ||
524 regs->r10 == -ERESTARTNOINTR) {
525 RESTART_CRIS_SYS(regs);
526 }
527
528 if (regs->r10 == -ERESTART_RESTARTBLOCK){
Jesper Nilsson39923322010-08-03 15:55:48 +0200529 regs->r9 = __NR_restart_syscall;
Mikael Starvik51533b62005-07-27 11:44:44 -0700530 regs->erp -= 2;
531 }
532 }
533
Jesper Nilsson574852a2008-01-25 16:10:02 +0100534 /* if there's no signal to deliver, we just put the saved sigmask
535 * back */
Al Viro51a7b442012-05-21 23:33:55 -0400536 restore_saved_sigmask();
Mikael Starvik51533b62005-07-27 11:44:44 -0700537}
538
539asmlinkage void
540ugdb_trap_user(struct thread_info *ti, int sig)
541{
542 if (((user_regs(ti)->exs & 0xff00) >> 8) != SINGLE_STEP_INTR_VECT) {
543 /* Zero single-step PC if the reason we stopped wasn't a single
544 step exception. This is to avoid relying on it when it isn't
545 reliable. */
546 user_regs(ti)->spc = 0;
547 }
548 /* FIXME: Filter out false h/w breakpoint hits (i.e. EDA
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300549 not within any configured h/w breakpoint range). Synchronize with
Mikael Starvik51533b62005-07-27 11:44:44 -0700550 what already exists for kernel debugging. */
551 if (((user_regs(ti)->exs & 0xff00) >> 8) == BREAK_8_INTR_VECT) {
552 /* Break 8: subtract 2 from ERP unless in a delay slot. */
553 if (!(user_regs(ti)->erp & 0x1))
554 user_regs(ti)->erp -= 2;
555 }
556 sys_kill(ti->task->pid, sig);
557}
558
559void
560keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
561 struct pt_regs *regs)
562{
563 if (oldccs & (1 << Q_CCS_BITNR)) {
564 /* Pending single step due to single-stepping the break 13
565 in the signal trampoline: keep the Q flag. */
566 regs->ccs |= (1 << Q_CCS_BITNR);
567 /* S flag should be set - complain if it's not. */
568 if (!(oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT)))) {
569 printk("Q flag but no S flag?");
570 }
571 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
572 /* Assume the SPC is valid and interesting. */
573 regs->spc = oldspc;
574
575 } else if (oldccs & (1 << (S_CCS_BITNR + CCS_SHIFT))) {
576 /* If a h/w bp was set in the signal handler we need
577 to keep the S flag. */
578 regs->ccs |= (1 << (S_CCS_BITNR + CCS_SHIFT));
579 /* Don't keep the old SPC though; if we got here due to
580 a single-step, the Q flag should have been set. */
581 } else if (regs->spc) {
582 /* If we were single-stepping *before* the signal was taken,
583 we don't want to restore that state now, because GDB will
584 have forgotten all about it. */
585 regs->spc = 0;
586 regs->ccs &= ~(1 << (S_CCS_BITNR + CCS_SHIFT));
587 }
588}
589
590/* Set up the trampolines on the signal return page. */
591int __init
592cris_init_signal(void)
593{
Robert P. J. Day5cbded52006-12-13 00:35:56 -0800594 u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);
Mikael Starvik51533b62005-07-27 11:44:44 -0700595
596 /* This is movu.w __NR_sigreturn, r9; break 13; */
597 data[0] = 0x9c5f;
598 data[1] = __NR_sigreturn;
599 data[2] = 0xe93d;
600 /* This is movu.w __NR_rt_sigreturn, r9; break 13; */
601 data[3] = 0x9c5f;
602 data[4] = __NR_rt_sigreturn;
603 data[5] = 0xe93d;
604
605 /* Map to userspace with appropriate permissions (no write access...) */
606 cris_signal_return_page = (unsigned long)
607 __ioremap_prot(virt_to_phys(data), PAGE_SIZE, PAGE_SIGNAL_TRAMPOLINE);
608
609 return 0;
610}
611
612__initcall(cris_init_signal);