signal.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) signal.c (09f8a6db20e6ed8eab1b2b23d09d2458f6e15062)
1/*
2 * arch/xtensa/kernel/signal.c
3 *
4 * Default platform functions.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.

--- 321 unchanged lines hidden (view full) ---

330}
331
332
333static int setup_frame(struct ksignal *ksig, sigset_t *set,
334 struct pt_regs *regs)
335{
336 struct rt_sigframe *frame;
337 int err = 0, sig = ksig->sig;
1/*
2 * arch/xtensa/kernel/signal.c
3 *
4 * Default platform functions.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.

--- 321 unchanged lines hidden (view full) ---

330}
331
332
333static int setup_frame(struct ksignal *ksig, sigset_t *set,
334 struct pt_regs *regs)
335{
336 struct rt_sigframe *frame;
337 int err = 0, sig = ksig->sig;
338 unsigned long sp, ra, tp;
338 unsigned long sp, ra, tp, ps;
339 unsigned int base;
339
340 sp = regs->areg[1];
341
342 if ((ksig->ka.sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) {
343 sp = current->sas_ss_sp + current->sas_ss_size;
344 }
345
346 frame = (void *)((sp - sizeof(*frame)) & -16ul);

--- 33 unchanged lines hidden (view full) ---

380
381 /*
382 * Create signal handler execution context.
383 * Return context not modified until this point.
384 */
385
386 /* Set up registers for signal handler; preserve the threadptr */
387 tp = regs->threadptr;
340
341 sp = regs->areg[1];
342
343 if ((ksig->ka.sa.sa_flags & SA_ONSTACK) != 0 && sas_ss_flags(sp) == 0) {
344 sp = current->sas_ss_sp + current->sas_ss_size;
345 }
346
347 frame = (void *)((sp - sizeof(*frame)) & -16ul);

--- 33 unchanged lines hidden (view full) ---

381
382 /*
383 * Create signal handler execution context.
384 * Return context not modified until this point.
385 */
386
387 /* Set up registers for signal handler; preserve the threadptr */
388 tp = regs->threadptr;
389 ps = regs->ps;
388 start_thread(regs, (unsigned long) ksig->ka.sa.sa_handler,
389 (unsigned long) frame);
390
390 start_thread(regs, (unsigned long) ksig->ka.sa.sa_handler,
391 (unsigned long) frame);
392
391 /* Set up a stack frame for a call4
392 * Note: PS.CALLINC is set to one by start_thread
393 */
394 regs->areg[4] = (((unsigned long) ra) & 0x3fffffff) | 0x40000000;
395 regs->areg[6] = (unsigned long) sig;
396 regs->areg[7] = (unsigned long) &frame->info;
397 regs->areg[8] = (unsigned long) &frame->uc;
393 /* Set up a stack frame for a call4 if userspace uses windowed ABI */
394 if (ps & PS_WOE_MASK) {
395 base = 4;
396 regs->areg[base] =
397 (((unsigned long) ra) & 0x3fffffff) | 0x40000000;
398 ps = (ps & ~(PS_CALLINC_MASK | PS_OWB_MASK)) |
399 (1 << PS_CALLINC_SHIFT);
400 } else {
401 base = 0;
402 regs->areg[base] = (unsigned long) ra;
403 }
404 regs->areg[base + 2] = (unsigned long) sig;
405 regs->areg[base + 3] = (unsigned long) &frame->info;
406 regs->areg[base + 4] = (unsigned long) &frame->uc;
398 regs->threadptr = tp;
407 regs->threadptr = tp;
408 regs->ps = ps;
399
400 pr_debug("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08lx\n",
401 current->comm, current->pid, sig, frame, regs->pc);
402
403 return 0;
404}
405
406/*

--- 90 unchanged lines hidden ---
409
410 pr_debug("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08lx\n",
411 current->comm, current->pid, sig, frame, regs->pc);
412
413 return 0;
414}
415
416/*

--- 90 unchanged lines hidden ---