From c4d644e0244ff77159115b31f13ebddbeda93953 Mon Sep 17 00:00:00 2001 From: Roland Veloz Date: Tue, 2 Jul 2019 04:00:24 -0500 Subject: Temporary fix: skipping over printing doubles to avoid a crash The printing of double, for the trace FAPI_INF, was never implemented and thus when a double is encountered via open power, a crash would happen. This fix just simply skips over the double, printing nothing, to avoid the crash. An implementation of the double will follow later. This fix is done because Romulus is blocked on this issue. Change-Id: I48804de3cfecc966ba9541e1981aca342d7cbb83 CQ: SW464805 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/79885 Reviewed-by: Christian R. Geddes Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Matt Derksen Reviewed-by: Nicholas E. Bofferding --- src/lib/sprintf.C | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/sprintf.C b/src/lib/sprintf.C index c50ed3966..2cac40421 100644 --- a/src/lib/sprintf.C +++ b/src/lib/sprintf.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -70,6 +72,7 @@ struct format_options TYPE_CHAR, TYPE_STRING, TYPE_PTR, + TYPE_DOUBLE, }; types type; @@ -253,6 +256,10 @@ void parse_format_options(format_options& opt, const char*& fmt) opt.type = opt.TYPE_PTR; break; + case 'f': + opt.type = opt.TYPE_DOUBLE; + break; + default: opt.type = opt.TYPE_PERCENT; } @@ -312,6 +319,16 @@ size_t display_string(ConsoleBufferInterface& func, return count; } +size_t display_double(ConsoleBufferInterface& func, + const format_options& f, double number) +{ + // TODO: CQ SW464805 Put in an implementation for double + + size_t count(0); + + return count; +} + size_t display_number(ConsoleBufferInterface& func, const format_options& f, uint64_t number) { @@ -492,6 +509,10 @@ size_t vasprintf(ConsoleBufferInterface& func, const char* fmt, va_list& args) count += display_string(func, f, va_arg(args,const char*)); break; + case format_options::TYPE_DOUBLE: + count += display_double(func, f, va_arg(args,double)); + break; + // All the number cases. default: { -- cgit v1.2.1