Add human readable name to IA32x64 error info GUIDs.
diff --git a/sections/cper-section-ia32x64.c b/sections/cper-section-ia32x64.c
index 35c5a2e..0657b82 100644
--- a/sections/cper-section-ia32x64.c
+++ b/sections/cper-section-ia32x64.c
@@ -126,9 +126,27 @@
//Error structure type (as GUID).
char error_type[GUID_STRING_LENGTH];
guid_to_string(error_type, &error_info->ErrorType);
- json_object_object_add(error_info_ir, "type",
+ json_object *type = json_object_new_object();
+ json_object_object_add(type, "guid",
json_object_new_string(error_type));
+ //Get the error structure type as a readable string.
+ const char *readable_type = "Unknown";
+ if (guid_equal(&error_info->ErrorType,
+ &gEfiIa32x64ErrorTypeCacheCheckGuid))
+ readable_type = "Cache Check Error";
+ else if (guid_equal(&error_info->ErrorType,
+ &gEfiIa32x64ErrorTypeTlbCheckGuid))
+ readable_type = "TLB Check Error";
+ else if (guid_equal(&error_info->ErrorType,
+ &gEfiIa32x64ErrorTypeBusCheckGuid))
+ readable_type = "Bus Check Error";
+ else if (guid_equal(&error_info->ErrorType,
+ &gEfiIa32x64ErrorTypeMsCheckGuid))
+ readable_type = "MS Check Error";
+ json_object_object_add(type, "name", json_object_new_string(readable_type));
+ json_object_object_add(error_info_ir, "type", type);
+
//Validation bits.
json_object *validation =
bitfield_to_ir(error_info->ValidFields, 5,
@@ -609,9 +627,10 @@
1, sizeof(EFI_IA32_X64_PROCESS_ERROR_INFO));
//Error structure type.
- string_to_guid(&error_info_cper->ErrorType,
- json_object_get_string(
- json_object_object_get(error_info, "type")));
+ json_object *type = json_object_object_get(error_info, "type");
+ string_to_guid(
+ &error_info_cper->ErrorType,
+ json_object_get_string(json_object_object_get(type, "guid")));
//Validation bits.
error_info_cper->ValidFields = ir_to_bitfield(