Include hex decode for human readable fields
Hexadecimal decode for some fields like deviceAddress
make sense to be represented in hex over decimal to make
scripting and human-usability easier.
Change-Id: I7d0d100162bc681c3c6885ca01ed23020c3b5063
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/sections/cper-section-memory.c b/sections/cper-section-memory.c
index 68e63af..4aeae43 100644
--- a/sections/cper-section-memory.c
+++ b/sections/cper-section-memory.c
@@ -70,6 +70,13 @@
json_object_object_add(
section_ir, "physicalAddress",
json_object_new_uint64(memory_error->PhysicalAddress));
+
+ char hexstring_buf[EFI_UINT64_HEX_STRING_LEN];
+ snprintf(hexstring_buf, EFI_UINT64_HEX_STRING_LEN, "0x%016llX",
+ memory_error->PhysicalAddress);
+ json_object_object_add(section_ir, "physicalAddressHex",
+ json_object_new_string(hexstring_buf));
+
json_object_object_add(
section_ir, "physicalAddressMask",
json_object_new_uint64(memory_error->PhysicalAddressMask));
@@ -167,6 +174,13 @@
json_object_object_add(
section_ir, "physicalAddress",
json_object_new_uint64(memory_error->PhysicalAddress));
+
+ char hexstring_buf[EFI_UINT64_HEX_STRING_LEN];
+ snprintf(hexstring_buf, EFI_UINT64_HEX_STRING_LEN, "0x%016llX",
+ memory_error->PhysicalAddress);
+ json_object_object_add(section_ir, "physicalAddressHex",
+ json_object_new_string(hexstring_buf));
+
json_object_object_add(
section_ir, "physicalAddressMask",
json_object_new_uint64(memory_error->PhysicalAddressMask));