18 #include <linux/signal.h>
19 #include <linux/errno.h>
20 #include <linux/ptrace.h>
21 #include <linux/personality.h>
24 #include <asm/ucontext.h>
25 #include <asm/uaccess.h>
26 #include <asm/cacheflush.h>
28 #include <asm/unistd.h>
41 #if XTENSA_HAVE_COPROCESSORS
42 xtregs_coprocessor_t
cp;
76 if ((regs->
wmask & 2) == 0)
94 ®s->
areg[(base + 1) * 4], 16))
100 ®s->
areg[(base + 1) * 4], 32))
113 sp = regs->
areg[base * 4 + 1];
141 #define COPY(x) err |= __put_user(regs->x, &sc->sc_##x)
157 #if XTENSA_HAVE_COPROCESSORS
158 coprocessor_flush_all(ti);
159 coprocessor_release_all(ti);
161 sizeof (frame->xtregs.cp));
178 unsigned int err = 0;
181 #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x)
222 #if XTENSA_HAVE_COPROCESSORS
223 coprocessor_release_all(ti);
225 sizeof (frame->xtregs.cp));
251 panic(
"rt_sigreturn in double exception!\n");
285 gen_return_code(
unsigned char *codemem)
296 #if __NR_rt_sigreturn > 255
297 # error Generating the MOVI instruction below breaks!
310 #elif defined __XTENSA_EL__
320 # error Must use compiler for Xtensa processors.
326 __invalidate_icache_range((
unsigned long)codemem, 6
UL);
327 __flush_invalidate_dcache_range((
unsigned long)codemem, 6
UL);
340 unsigned long sp,
ra;
344 if ((ka->
sa.sa_flags &
SA_ONSTACK) != 0 && ! on_sig_stack(sp)) {
348 frame = (
void *)((sp -
sizeof(*frame)) & -16ul);
351 panic (
"Double exception sys_sigreturn\n");
372 &frame->
uc.uc_stack.ss_sp);
374 &frame->
uc.uc_stack.ss_flags);
380 ra = (
unsigned long)ka->
sa.sa_restorer;
385 err |= gen_return_code(frame->
retcode);
400 (
unsigned long) frame);
405 regs->
areg[4] = (((
unsigned long) ra) & 0x3fffffff) | 0x40000000;
406 regs->
areg[6] = (
unsigned long) signal;
408 regs->
areg[8] = (
unsigned long) &frame->
uc;
416 printk(
"SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08x\n",
461 if ((
signed)regs->
syscall >= 0) {
465 switch (regs->
areg[2]) {
484 if (regs->
areg[2] != 0)
491 ret = setup_frame(signr, &ka, &info, sigmask_to_save(), regs);
503 if ((
signed) regs->
syscall >= 0) {
505 switch (regs->
areg[2]) {
520 restore_saved_sigmask();
533 tracehook_notify_resume(regs);