[Skiboot] [PATCH 4/7] hw/fsp, hw/ipmi: Convert attn code to not use backtrace wrappers
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Mon Mar 18 15:28:57 AEDT 2019
We're about to get rid of __backtrace() and __print_backtrace(), convert
the FSP/IPMI attn code to not use them.
Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
---
hw/fsp/fsp-attn.c | 10 +++++-----
hw/ipmi/ipmi-attn.c | 9 +++++----
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/hw/fsp/fsp-attn.c b/hw/fsp/fsp-attn.c
index ff702ab2602c..6774dd84cee7 100644
--- a/hw/fsp/fsp-attn.c
+++ b/hw/fsp/fsp-attn.c
@@ -92,7 +92,8 @@ static void update_sp_attn_area(const char *msg)
{
#define STACK_BUF_ENTRIES 20
struct bt_entry bt_buf[STACK_BUF_ENTRIES];
- unsigned int ent_cnt, len;
+ struct bt_metadata metadata;
+ unsigned int len;
if (!fsp_present())
return;
@@ -105,11 +106,10 @@ static void update_sp_attn_area(const char *msg)
cpu_to_be32((uint32_t)((uint64_t)__builtin_return_address(0) & 0xffffffff));
snprintf(ti_attn->msg.version, VERSION_LEN, "%s", version);
- ent_cnt = STACK_BUF_ENTRIES;
- __backtrace(bt_buf, &ent_cnt);
+ ___backtrace(bt_buf, STACK_BUF_ENTRIES, &metadata);
+ metadata.token = OPAL_LAST + 1;
len = BT_FRAME_LEN;
- __print_backtrace(mfspr(SPR_PIR), bt_buf, ent_cnt,
- ti_attn->msg.bt_buf, &len, false);
+ ___print_backtrace(bt_buf, &metadata, ti_attn->msg.bt_buf, &len, false);
snprintf(ti_attn->msg.file_info, FILE_INFO_LEN, "%s", msg);
ti_attn->msg_len = VERSION_LEN + BT_FRAME_LEN +
diff --git a/hw/ipmi/ipmi-attn.c b/hw/ipmi/ipmi-attn.c
index 8ff872c62669..8407188401a3 100644
--- a/hw/ipmi/ipmi-attn.c
+++ b/hw/ipmi/ipmi-attn.c
@@ -38,7 +38,7 @@ static struct bt_entry bt_buf[STACK_BUF_ENTRIES];
/* Log eSEL event with OPAL backtrace */
static void ipmi_log_terminate_event(const char *msg)
{
- unsigned int bt_entry_cnt = STACK_BUF_ENTRIES;
+ struct bt_metadata metadata;
unsigned int ti_len;
unsigned int ti_size;
struct errorlog *elog_buf;
@@ -53,9 +53,10 @@ static void ipmi_log_terminate_event(const char *msg)
ti_size = IPMI_TI_BUFFER_SIZE - ti_len;
/* Backtrace */
- __backtrace(bt_buf, &bt_entry_cnt);
- __print_backtrace(mfspr(SPR_PIR), bt_buf, bt_entry_cnt,
- ti_buffer + ti_len, &ti_size, true);
+ ___backtrace(bt_buf, STACK_BUF_ENTRIES, &metadata);
+ metadata.token = OPAL_LAST + 1;
+ ___print_backtrace(bt_buf, &metadata, ti_buffer + ti_len, &ti_size,
+ true);
/* Create eSEL event and commit */
elog_buf = opal_elog_create(&e_info(OPAL_RC_ATTN), 0);
--
2.11.0
More information about the Skiboot
mailing list