Commit 8e91cf85 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/signal32: Rename local pointers in handle_rt_signal32()

Rename pointers in handle_rt_signal32() to make it more similar to
handle_signal32()

tm_frame becomes tm_mctx
frame becomes mctx
rt_sf becomes frame
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/be77477b0f05397876015b218e36548ee8f5e10b.1597770847.git.christophe.leroy@csgroup.eu
parent 3eea688b
...@@ -751,9 +751,9 @@ static long restore_tm_user_regs(struct pt_regs *regs, ...@@ -751,9 +751,9 @@ static long restore_tm_user_regs(struct pt_regs *regs,
int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
struct task_struct *tsk) struct task_struct *tsk)
{ {
struct rt_sigframe __user *rt_sf; struct rt_sigframe __user *frame;
struct mcontext __user *frame; struct mcontext __user *mctx;
struct mcontext __user *tm_frame = NULL; struct mcontext __user *tm_mctx = NULL;
unsigned long newsp = 0; unsigned long newsp = 0;
int sigret; int sigret;
unsigned long tramp; unsigned long tramp;
...@@ -765,46 +765,45 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -765,46 +765,45 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
/* Set up Signal Frame */ /* Set up Signal Frame */
/* Put a Real Time Context onto stack */ /* Put a Real Time Context onto stack */
rt_sf = get_sigframe(ksig, tsk, sizeof(*rt_sf), 1); frame = get_sigframe(ksig, tsk, sizeof(*frame), 1);
if (!access_ok(rt_sf, sizeof(*rt_sf))) if (!access_ok(frame, sizeof(*frame)))
goto badframe; goto badframe;
/* Put the siginfo & fill in most of the ucontext */ /* Put the siginfo & fill in most of the ucontext */
if (copy_siginfo_to_user(&rt_sf->info, &ksig->info) if (copy_siginfo_to_user(&frame->info, &ksig->info) ||
|| __put_user(0, &rt_sf->uc.uc_flags) __put_user(0, &frame->uc.uc_flags) ||
|| __save_altstack(&rt_sf->uc.uc_stack, regs->gpr[1]) __save_altstack(&frame->uc.uc_stack, regs->gpr[1]) ||
|| __put_user(to_user_ptr(&rt_sf->uc.uc_mcontext), __put_user(to_user_ptr(&frame->uc.uc_mcontext), &frame->uc.uc_regs) ||
&rt_sf->uc.uc_regs) put_sigset_t(&frame->uc.uc_sigmask, oldset))
|| put_sigset_t(&rt_sf->uc.uc_sigmask, oldset))
goto badframe; goto badframe;
/* Save user registers on the stack */ /* Save user registers on the stack */
frame = &rt_sf->uc.uc_mcontext; mctx = &frame->uc.uc_mcontext;
if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) { if (vdso32_rt_sigtramp && tsk->mm->context.vdso_base) {
sigret = 0; sigret = 0;
tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp; tramp = tsk->mm->context.vdso_base + vdso32_rt_sigtramp;
} else { } else {
sigret = __NR_rt_sigreturn; sigret = __NR_rt_sigreturn;
tramp = (unsigned long) frame->tramp; tramp = (unsigned long)mctx->tramp;
} }
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
tm_frame = &rt_sf->uc_transact.uc_mcontext; tm_mctx = &frame->uc_transact.uc_mcontext;
if (MSR_TM_ACTIVE(msr)) { if (MSR_TM_ACTIVE(msr)) {
if (__put_user((unsigned long)&rt_sf->uc_transact, if (__put_user((unsigned long)&frame->uc_transact,
&rt_sf->uc.uc_link) || &frame->uc.uc_link) ||
__put_user((unsigned long)tm_frame, __put_user((unsigned long)tm_mctx,
&rt_sf->uc_transact.uc_regs)) &frame->uc_transact.uc_regs))
goto badframe; goto badframe;
if (save_tm_user_regs(regs, frame, tm_frame, sigret, msr)) if (save_tm_user_regs(regs, mctx, tm_mctx, sigret, msr))
goto badframe; goto badframe;
} }
else else
#endif #endif
{ {
if (__put_user(0, &rt_sf->uc.uc_link)) if (__put_user(0, &frame->uc.uc_link))
goto badframe; goto badframe;
if (save_user_regs(regs, frame, tm_frame, sigret, 1)) if (save_user_regs(regs, mctx, tm_mctx, sigret, 1))
goto badframe; goto badframe;
} }
regs->link = tramp; regs->link = tramp;
...@@ -814,16 +813,16 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -814,16 +813,16 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
#endif #endif
/* create a stack frame for the caller of the handler */ /* create a stack frame for the caller of the handler */
newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16); newsp = ((unsigned long)frame) - (__SIGNAL_FRAMESIZE + 16);
if (put_user(regs->gpr[1], (u32 __user *)newsp)) if (put_user(regs->gpr[1], (u32 __user *)newsp))
goto badframe; goto badframe;
/* Fill registers for signal handler */ /* Fill registers for signal handler */
regs->gpr[1] = newsp; regs->gpr[1] = newsp;
regs->gpr[3] = ksig->sig; regs->gpr[3] = ksig->sig;
regs->gpr[4] = (unsigned long) &rt_sf->info; regs->gpr[4] = (unsigned long)&frame->info;
regs->gpr[5] = (unsigned long) &rt_sf->uc; regs->gpr[5] = (unsigned long)&frame->uc;
regs->gpr[6] = (unsigned long) rt_sf; regs->gpr[6] = (unsigned long)frame;
regs->nip = (unsigned long) ksig->ka.sa.sa_handler; regs->nip = (unsigned long) ksig->ka.sa.sa_handler;
/* enter the signal handler in native-endian mode */ /* enter the signal handler in native-endian mode */
regs->msr &= ~MSR_LE; regs->msr &= ~MSR_LE;
...@@ -831,7 +830,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, ...@@ -831,7 +830,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset,
return 0; return 0;
badframe: badframe:
signal_fault(tsk, regs, "handle_rt_signal32", rt_sf); signal_fault(tsk, regs, "handle_rt_signal32", frame);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment