[Skiboot] [PATCH 2/3] hdata_to_dt: fail "gracefully" on fatal op_display()

Stewart Smith stewart at linux.ibm.com
Mon Mar 18 16:52:18 AEDT 2019


Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 hdata/test/hdata_to_dt.c | 11 +++++++++++
 hdata/test/stubs.c       |  1 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c
index a5f152e86b63..b4a50740a4ce 100644
--- a/hdata/test/hdata_to_dt.c
+++ b/hdata/test/hdata_to_dt.c
@@ -168,6 +168,17 @@ static bool spira_check_ptr(const void *ptr, const char *file, unsigned int line
 
 #include <err.h>
 
+#include <op-panel.h>
+
+void op_display(enum op_severity s, enum op_module m, uint16_t code)
+{
+	fprintf(stderr, "op_panel Severity: 0x%x (%s), module %x, %x\n",
+		s, (s == OP_FATAL) ? "FATAL" : "non-fatal",
+		m, code);
+	if (s == OP_FATAL)
+		exit(EXIT_FAILURE);
+}
+
 char __rodata_start[1], __rodata_end[1];
 
 enum proc_gen proc_gen = proc_gen_p7;
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index ab6e2cec1344..363763365e22 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -140,7 +140,6 @@ static void stub_function(void)
 #define STUB(fnname) \
 	void fnname(void) __attribute__((weak, alias ("stub_function")))
 
-STUB(op_display);
 STUB(fsp_preload_lid);
 STUB(fsp_wait_lid_loaded);
 STUB(fsp_adjust_lid_side);
-- 
2.20.1



More information about the Skiboot mailing list