Skip to content

Commit

Permalink
hw/fsp, hw/ipmi: Convert attn code to not use backtrace wrappers
Browse files Browse the repository at this point in the history
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@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Mar 28, 2019
1 parent 80a49c7 commit 8dddd75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions hw/fsp/fsp-attn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 +
Expand Down
9 changes: 5 additions & 4 deletions hw/ipmi/ipmi-attn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 8dddd75

Please sign in to comment.