Improve Nvidia CPER decode
Add decoding of registers to the structure. Note, this requires
COUNTED_BY support which is borrowed from LIBPLDM.
Also add unit-tests for NVIDIA section, and update schema to match
existing register decoding.
Change-Id: If1c9cae97de35ba6a5dad1f462d3989ec6ac6a90
Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/common-utils.h b/common-utils.h
index c6b9b60..6cdccb6 100644
--- a/common-utils.h
+++ b/common-utils.h
@@ -6,4 +6,14 @@
int bcd_to_int(UINT8 bcd);
UINT8 int_to_bcd(int value);
+#if defined __has_attribute
+#if __has_attribute(counted_by)
+#define LIBCPER_CC_COUNTED_BY(x) __attribute__((counted_by(x)))
+#endif
+#endif
+
+#ifndef LIBCPER_CC_COUNTED_BY
+#define LIBCPER_CC_COUNTED_BY(x)
+#endif
+
#endif