summaryrefslogtreecommitdiffstats
path: root/src/usr/trace
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-09-02 23:23:23 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-09-12 10:43:19 -0500
commit2900cb906ec96134dba7c57c23b18e98cec215a7 (patch)
treef14f5a2d502d6a7e2626e50d91164437da5be5cd /src/usr/trace
parent5365f3466347fbc5a05643df4d3302bf6bb89d94 (diff)
downloadblackbird-hostboot-2900cb906ec96134dba7c57c23b18e98cec215a7.tar.gz
blackbird-hostboot-2900cb906ec96134dba7c57c23b18e98cec215a7.zip
Floating point support.
Change-Id: I859cac1c01bf631d12223702d68813b45339b65f Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/295 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/trace')
-rw-r--r--src/usr/trace/trace.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/usr/trace/trace.C b/src/usr/trace/trace.C
index b37940300..8a8456bb7 100644
--- a/src/usr/trace/trace.C
+++ b/src/usr/trace/trace.C
@@ -329,6 +329,7 @@ void Trace::_trace_adal_write_all(trace_desc_t *io_td,
trace_bin_entry_t l_entry;
uint64_t l_str_map = 0;
uint64_t l_char_map = 0;
+ uint64_t l_double_map = 0;
/*------------------------------------------------------------------------*/
@@ -390,6 +391,21 @@ void Trace::_trace_adal_write_all(trace_desc_t *io_td,
// Add to total size; data is word aligned
l_data_size += sizeof(l_tmpData);
}
+ else if (('e' == _fmt[i]) || ('f' == _fmt[i]) || ('g' == _fmt[i]))
+ {
+ // Set flag to indicate argument is a double
+ l_double_map = l_double_map | (1 << num_args);
+
+ // Numbers count as two 4-byte arg
+ num_args++;
+ num_4byte_args += 2;
+
+ // Retrieve the argument to increment to next one
+ double l_tmpData = va_arg(i_args,double);
+
+ // Add to total size; data is word aligned
+ l_data_size += sizeof(l_tmpData);
+ }
else
{
// Numbers count as two 4-byte arg
@@ -470,6 +486,13 @@ void Trace::_trace_adal_write_all(trace_desc_t *io_td,
l_ptr += sizeof(uint32_t);
}
+ else if (l_double_map & (1 << i))
+ {
+ // Save number to buffer & increment pointer (no need to align)
+ *(reinterpret_cast<double *>(l_ptr)) = va_arg(l_args, double);
+
+ l_ptr += sizeof(double);
+ }
else
{
// Save number to buffer & increment pointer (no need to align)
OpenPOWER on IntegriCloud