Skip to content

Commit

Permalink
arm64: Remove the aux_context structure
Browse files Browse the repository at this point in the history
This patch removes the aux_context structure (and the containing file)
to allow the placement of the _aarch64_ctx end magic based on the
context stored on the signal stack.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Catalin Marinas committed May 9, 2014
1 parent 9141300 commit 0e0276d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 41 deletions.
31 changes: 0 additions & 31 deletions arch/arm64/include/asm/sigcontext.h

This file was deleted.

27 changes: 17 additions & 10 deletions arch/arm64/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ static int restore_sigframe(struct pt_regs *regs,
{
sigset_t set;
int i, err;
struct aux_context __user *aux =
(struct aux_context __user *)sf->uc.uc_mcontext.__reserved;
void *aux = sf->uc.uc_mcontext.__reserved;

err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set));
if (err == 0)
Expand All @@ -121,8 +120,11 @@ static int restore_sigframe(struct pt_regs *regs,

err |= !valid_user_regs(&regs->user_regs);

if (err == 0)
err |= restore_fpsimd_context(&aux->fpsimd);
if (err == 0) {
struct fpsimd_context *fpsimd_ctx =
container_of(aux, struct fpsimd_context, head);
err |= restore_fpsimd_context(fpsimd_ctx);
}

return err;
}
Expand Down Expand Up @@ -167,8 +169,8 @@ static int setup_sigframe(struct rt_sigframe __user *sf,
struct pt_regs *regs, sigset_t *set)
{
int i, err = 0;
struct aux_context __user *aux =
(struct aux_context __user *)sf->uc.uc_mcontext.__reserved;
void *aux = sf->uc.uc_mcontext.__reserved;
struct _aarch64_ctx *end;

/* set up the stack frame for unwinding */
__put_user_error(regs->regs[29], &sf->fp, err);
Expand All @@ -185,12 +187,17 @@ static int setup_sigframe(struct rt_sigframe __user *sf,

err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(*set));

if (err == 0)
err |= preserve_fpsimd_context(&aux->fpsimd);
if (err == 0) {
struct fpsimd_context *fpsimd_ctx =
container_of(aux, struct fpsimd_context, head);
err |= preserve_fpsimd_context(fpsimd_ctx);
aux += sizeof(*fpsimd_ctx);
}

/* set the "end" magic */
__put_user_error(0, &aux->end.magic, err);
__put_user_error(0, &aux->end.size, err);
end = aux;
__put_user_error(0, &end->magic, err);
__put_user_error(0, &end->size, err);

return err;
}
Expand Down

0 comments on commit 0e0276d

Please sign in to comment.