From: Simon Marchi <simon.marchi@polymtl.ca>
To: cmetcalf@tilera.com
Cc: linux-kernel@vger.kernel.org, Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH v3 2/3] arch/tile: implement arch_ptrace using user_regset on tile
Date: Mon, 17 Dec 2012 20:08:10 -0500 [thread overview]
Message-ID: <1355792891-16145-2-git-send-email-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <1355792891-16145-1-git-send-email-simon.marchi@polymtl.ca>
This patch changes arch_ptrace on tile so that it uses user_regset
to implement the PTRACE_GETREGS and PTRACE_SETREGS operations.
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
---
arch/tile/kernel/ptrace.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c
index 882e381..9835312 100644
--- a/arch/tile/kernel/ptrace.c
+++ b/arch/tile/kernel/ptrace.c
@@ -193,18 +193,15 @@ long arch_ptrace(struct task_struct *child, long request,
break;
case PTRACE_GETREGS: /* Get all registers from the child. */
- if (copy_to_user(datap, getregs(child, ©regs),
- sizeof(struct pt_regs)) == 0) {
- ret = 0;
- }
+ ret = copy_regset_to_user(child, &tile_user_regset_view,
+ REGSET_GPR, 0,
+ sizeof(struct pt_regs), datap);
break;
case PTRACE_SETREGS: /* Set all registers in the child. */
- if (copy_from_user(©regs, datap,
- sizeof(struct pt_regs)) == 0) {
- putregs(child, ©regs);
- ret = 0;
- }
+ ret = copy_regset_from_user(child, &tile_user_regset_view,
+ REGSET_GPR, 0,
+ sizeof(struct pt_regs), datap);
break;
case PTRACE_GETFPREGS: /* Get the child FPU state. */
--
1.7.1
next prev parent reply other threads:[~2012-12-18 1:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 1:08 [PATCH v3 1/3] arch/tile: implement user_regset interface " Simon Marchi
2012-12-18 1:08 ` Simon Marchi [this message]
2012-12-18 1:08 ` [PATCH v3 3/3] arch/tile: set CORE_DUMP_USE_REGSET " Simon Marchi
2012-12-18 1:19 ` [PATCH v3 1/3] arch/tile: implement user_regset interface " Chris Metcalf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1355792891-16145-2-git-send-email-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=cmetcalf@tilera.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®