summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2014-10-20 11:42:55 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-10-22 18:00:19 +1100
commitf84066fdeedffaac8a9113a4be1d8e17327eba64 (patch)
treece16d88032d8cd5bfe7d825229c22598b3ceba20 /core
parentcf6f4e8912d29fb89ce85c84834607065ad595a5 (diff)
downloadblackbird-skiboot-f84066fdeedffaac8a9113a4be1d8e17327eba64.tar.gz
blackbird-skiboot-f84066fdeedffaac8a9113a4be1d8e17327eba64.zip
fsp/elog: Make the logging backend platform specific
OpenPOWER boxes don't have an FSP and therefore implement their own method for passing log messages to a support processor. This patch makes the logging method platform specific. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/errorlog.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/errorlog.c b/core/errorlog.c
index 8867a8ea..dd34c3fe 100644
--- a/core/errorlog.c
+++ b/core/errorlog.c
@@ -41,10 +41,15 @@ static uint32_t sapphire_elog_id = 0xB0000000;
static struct pool elog_pool;
static struct lock elog_lock = LOCK_UNLOCKED;
+static bool elog_available = false;
+
static struct errorlog *get_write_buffer(int opal_event_severity)
{
struct errorlog *buf;
+ if (!elog_available)
+ return NULL;
+
lock(&elog_lock);
if (opal_event_severity == OPAL_ERROR_PANIC)
buf = pool_get(&elog_pool, POOL_HIGH);
@@ -137,7 +142,7 @@ void log_error(struct opal_err_info *e_info, void *data, uint16_t size,
/* Append any number of call out dumps */
if (e_info->call_out)
e_info->call_out(buf, data, size);
- if (elog_fsp_commit(buf))
+ if (platform.elog_commit(buf))
prerror("ELOG: Re-try error logging\n");
}
}
@@ -161,7 +166,7 @@ void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...)
prerror("ELOG: Error getting buffer to log error\n");
else {
opal_elog_update_user_dump(buf, err_msg, tag, strlen(err_msg));
- if (elog_fsp_commit(buf))
+ if (platform.elog_commit(buf))
prerror("ELOG: Re-try error logging\n");
}
}
@@ -172,5 +177,6 @@ int elog_init(void)
if (pool_init(&elog_pool, sizeof(struct errorlog), ELOG_WRITE_MAX_RECORD, 1))
return OPAL_RESOURCE;
+ elog_available = true;
return 0;
}
OpenPOWER on IntegriCloud