[Skiboot] [PATCH 3/7] core/stack: Store PIR in ___backtrace()

Andrew Donnellan andrew.donnellan at au1.ibm.com
Mon Mar 18 15:28:56 AEDT 2019


In ___backtrace(), store the current PIR in the metadata struct, rather
than relying on the caller to do it.

Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
---
 core/stack.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/stack.c b/core/stack.c
index 773d91e34eea..f7eca1ffb0ff 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -57,6 +57,8 @@ void __nomcount ___backtrace(struct bt_entry *entries, unsigned int max_ents,
 		metadata->token = eframe->gpr[0];
 	else
 		metadata->token = -1UL;
+
+	metadata->pir = mfspr(SPR_PIR);
 }
 
 void ___print_backtrace(struct bt_entry *entries, struct bt_metadata *metadata,
@@ -121,9 +123,7 @@ struct lock bt_lock = LOCK_UNLOCKED;
 
 void backtrace(void)
 {
-	struct bt_metadata metadata = {
-		.pir = mfspr(SPR_PIR),
-	};
+	struct bt_metadata metadata;
 
 	lock(&bt_lock);
 
-- 
2.11.0



More information about the Skiboot mailing list