aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>2019-03-18 15:28:54 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-03-28 15:24:12 +1100
commitc9bc52a250a0f15e75b10670165f8e518a845b68 (patch)
tree3080aa146c17586b7ca13461c154b07f331c465d
parent2c71d7032484f4267ca425b5a58c5a6f06a2eaf3 (diff)
downloadskiboot-c9bc52a250a0f15e75b10670165f8e518a845b68.zip
skiboot-c9bc52a250a0f15e75b10670165f8e518a845b68.tar.gz
skiboot-c9bc52a250a0f15e75b10670165f8e518a845b68.tar.bz2
core/stack: Remove r1 argument from ___backtrace()
___backtrace() is always called with r1 = __builtin_frame_address(0), and it's unlikely we're going to need it to do something else any time soon, so simplify the API by removing the parameter. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--core/stack.c6
-rw-r--r--include/stack.h5
2 files changed, 3 insertions, 8 deletions
diff --git a/core/stack.c b/core/stack.c
index 3a86a37..5e4cf4b 100644
--- a/core/stack.c
+++ b/core/stack.c
@@ -28,11 +28,10 @@ static struct bt_entry bt_buf[STACK_BUF_ENTRIES];
/* Dumps backtrace to buffer */
void __nomcount ___backtrace(struct bt_entry *entries, unsigned int *count,
- unsigned long r1,
unsigned long *token, unsigned long *r1_caller)
{
unsigned int room = *count;
- unsigned long *fp = (unsigned long *)r1;
+ unsigned long *fp = __builtin_frame_address(0);
unsigned long top_adj = top_of_ram;
struct stack_frame *eframe = (struct stack_frame *)fp;
@@ -128,8 +127,7 @@ void backtrace(void)
lock(&bt_lock);
- ___backtrace(bt_buf, &ents, (unsigned long)__builtin_frame_address(0),
- &token, &r1_caller);
+ ___backtrace(bt_buf, &ents, &token, &r1_caller);
___print_backtrace(mfspr(SPR_PIR), bt_buf, ents, token, r1_caller,
NULL, NULL, true);
diff --git a/include/stack.h b/include/stack.h
index 7578cc3..ae910a3 100644
--- a/include/stack.h
+++ b/include/stack.h
@@ -118,15 +118,12 @@ extern void *boot_stack_top;
/* Create a backtrace */
void ___backtrace(struct bt_entry *entries, unsigned int *count,
- unsigned long r1,
unsigned long *token, unsigned long *r1_caller);
static inline void __backtrace(struct bt_entry *entries, unsigned int *count)
{
unsigned long token, r1_caller;
- ___backtrace(entries, count,
- (unsigned long)__builtin_frame_address(0),
- &token, &r1_caller);
+ ___backtrace(entries, count, &token, &r1_caller);
}
/* Convert a backtrace to ASCII */