[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180731145020.14009-8-muriloo@linux.ibm.com>
Date: Tue, 31 Jul 2018 11:50:18 -0300
From: Murilo Opsfelder Araujo <muriloo@...ux.ibm.com>
To: linux-kernel@...r.kernel.org
Cc: "Alastair D'Silva" <alastair@...ilva.org>,
Andrew Donnellan <andrew.donnellan@....ibm.com>,
Balbir Singh <bsingharora@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Christophe Leroy <christophe.leroy@....fr>,
Cyril Bur <cyrilbur@...il.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Joe Perches <joe@...ches.com>,
Michael Ellerman <mpe@...erman.id.au>,
Michael Neuling <mikey@...ling.org>,
Murilo Opsfelder Araujo <muriloo@...ux.ibm.com>,
Nicholas Piggin <npiggin@...il.com>,
Paul Mackerras <paulus@...ba.org>,
Simon Guo <wei.guo.simon@...il.com>,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
"Tobin C . Harding" <me@...in.cc>, linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH v3 7/9] powerpc: Add stacktrace.h header
Move show_instructions() declaration to
arch/powerpc/include/asm/stacktrace.h and include asm/stracktrace.h in
arch/powerpc/kernel/process.c, which contains the implementation.
This allows show_instructions() to be called on, for example,
show_signal_msg().
Signed-off-by: Murilo Opsfelder Araujo <muriloo@...ux.ibm.com>
---
arch/powerpc/include/asm/stacktrace.h | 13 +++++++++++++
arch/powerpc/kernel/process.c | 3 ++-
2 files changed, 15 insertions(+), 1 deletion(-)
create mode 100644 arch/powerpc/include/asm/stacktrace.h
diff --git a/arch/powerpc/include/asm/stacktrace.h b/arch/powerpc/include/asm/stacktrace.h
new file mode 100644
index 000000000000..217ebc52ff97
--- /dev/null
+++ b/arch/powerpc/include/asm/stacktrace.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Stack trace functions.
+ *
+ * Copyright 2018, Murilo Opsfelder Araujo, IBM Corporation.
+ */
+
+#ifndef _ASM_POWERPC_STACKTRACE_H
+#define _ASM_POWERPC_STACKTRACE_H
+
+void show_instructions(struct pt_regs *regs);
+
+#endif /* _ASM_POWERPC_STACKTRACE_H */
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 50094c44bf79..e78799a8855a 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -52,6 +52,7 @@
#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/runlatch.h>
+#include <asm/stacktrace.h>
#include <asm/syscalls.h>
#include <asm/switch_to.h>
#include <asm/tm.h>
@@ -1261,7 +1262,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
static int instructions_to_print = 16;
-static void show_instructions(struct pt_regs *regs)
+void show_instructions(struct pt_regs *regs)
{
int i;
unsigned long pc = regs->nip - (instructions_to_print * 3 / 4 *
--
2.17.1
Powered by blists - more mailing lists