linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/tile: Fix syscall return value passed to tracepoint
@ 2013-04-17 15:01 Simon Marchi
  2013-04-24 20:45 ` Chris Metcalf
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Marchi @ 2013-04-17 15:01 UTC (permalink / raw)
  To: cmetcalf; +Cc: linux-kernel, Simon Marchi

Currently the syscall number is passed, but it should be the return
value, which is kept in r0.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
---
This patch applies on Chris Metcalf's tree:
  http://git.kernel.org/cgit/linux/kernel/git/cmetcalf/linux-tile.git

arch/tile/include/uapi/arch/abi.h |    2 ++
 arch/tile/kernel/ptrace.c         |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/tile/include/uapi/arch/abi.h b/arch/tile/include/uapi/arch/abi.h
index c55a3d4..400401b 100644
--- a/arch/tile/include/uapi/arch/abi.h
+++ b/arch/tile/include/uapi/arch/abi.h
@@ -119,6 +119,8 @@ typedef __int_reg_t int_reg_t;
 /** Name of register that holds the syscall number, for use in assembly. */
 #define TREG_SYSCALL_NR_NAME r10
 
+/** Register that holds the return value for system calls. */
+#define TREG_SYSCALL_RET_NR  0
 
 /**
  * The ABI requires callers to allocate a caller state save area of
diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c
index 363b2dd..91fd3af 100644
--- a/arch/tile/kernel/ptrace.c
+++ b/arch/tile/kernel/ptrace.c
@@ -269,7 +269,7 @@ void do_syscall_trace_exit(struct pt_regs *regs)
 		tracehook_report_syscall_exit(regs, 0);
 
 	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
-		trace_sys_exit(regs, regs->regs[TREG_SYSCALL_NR]);
+		trace_sys_exit(regs, regs->regs[TREG_SYSCALL_RET_NR]);
 }
 
 void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arch/tile: Fix syscall return value passed to tracepoint
  2013-04-17 15:01 [PATCH] arch/tile: Fix syscall return value passed to tracepoint Simon Marchi
@ 2013-04-24 20:45 ` Chris Metcalf
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Metcalf @ 2013-04-24 20:45 UTC (permalink / raw)
  To: Simon Marchi; +Cc: linux-kernel

On 4/17/2013 11:01 AM, Simon Marchi wrote:
> Currently the syscall number is passed, but it should be the return
> value, which is kept in r0.
>
> Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
> ---
> This patch applies on Chris Metcalf's tree:
>   http://git.kernel.org/cgit/linux/kernel/git/cmetcalf/linux-tile.git
>
> arch/tile/include/uapi/arch/abi.h |    2 ++
>  arch/tile/kernel/ptrace.c         |    2 +-
>  2 files changed, 3 insertions(+), 1 deletions(-)

Accepted into the tile tree, but just using [0] instead of adding a new <arch/abi.h> #define.  The reason is that the compiler actually uses r0..r9 inclusive for return values, e.g. returning small structs, so I'm reluctant to call out r0 for a special name.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-24 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-17 15:01 [PATCH] arch/tile: Fix syscall return value passed to tracepoint Simon Marchi
2013-04-24 20:45 ` Chris Metcalf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).