PEL: Add BCD time helpers for PELs
A PEL stores time in BCD, with a byte each for:
* year MSB
* year LSB
* month
* day
* hour
* minutes
* seconds
* hundredths
This commit adds a structure to represent this, and functions to:
* Create a BCD structure from a std::chrono::time_point
* Convert any number to BCD
* Write the BCD structure into a Stream
* Extract a BCD structure from a Stream
Refresher: The BCD value of 32 is 0x32.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I09ea4098f3a3981931f595d11fb63aff31d9fb0d
diff --git a/test/openpower-pels/Makefile.include b/test/openpower-pels/Makefile.include
index 295069a..a68b229 100644
--- a/test/openpower-pels/Makefile.include
+++ b/test/openpower-pels/Makefile.include
@@ -2,6 +2,7 @@
check_PROGRAMS += \
additional_data_test \
+ bcd_time_test \
stream_test
additional_data_test_SOURCES = %reldir%/additional_data_test.cpp
@@ -14,4 +15,13 @@
stream_test_CPPFLAGS = $(test_cppflags)
stream_test_CXXFLAGS = $(test_cxxflags)
stream_test_LDADD = $(test_ldadd)
-stream_test_LDFLAGS = $(test_ldflags)
\ No newline at end of file
+stream_test_LDFLAGS = $(test_ldflags)
+
+bcd_time_test_SOURCES = \
+ %reldir%/bcd_time_test.cpp
+bcd_time_test_CPPFLAGS = $(test_cppflags)
+bcd_time_test_CXXFLAGS = $(test_cxxflags)
+bcd_time_test_LDADD = \
+ $(test_ldadd) \
+ $(top_builddir)/extensions/openpower-pels/bcd_time.o
+bcd_time_test_LDFLAGS = $(test_ldflags)
\ No newline at end of file