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(
diff --git a/specification/document/cper-json-specification.tex b/specification/document/cper-json-specification.tex
index 5176e72..ac54dc9 100644
--- a/specification/document/cper-json-specification.tex
+++ b/specification/document/cper-json-specification.tex
@@ -371,7 +371,8 @@
\label{subsection:ia32x64processorerrorinfostructure}
This structure describes a single IA32/x64 Processor Error Info sub-section, which is part of the larger IA32/x64 record (\ref{section:ia32x64errorsection}).
\jsontable{table:ia32x64processorerrorinfostructure}
-type & string & A GUID indicating the type of processor error defined in this structure. See \texttt{edk/Cper.h} in the library repository for the defined GUID values.\\
+type.guid & string & A GUID indicating the type of processor error defined in this structure. See \texttt{edk/Cper.h} in the library repository for the defined GUID values.\\
+type.name & string & The human readable name, if available, of the type of processor error defined in this structure.\\
\hline
validationBits & object & An IA32/x64 Processor Error Info Validation structure, as defined in Subsection \ref{subsection:ia32x64processorerrorinfovalidationstructure}.\\
\hline
diff --git a/specification/json/sections/cper-ia32x64-processor.json b/specification/json/sections/cper-ia32x64-processor.json
index 11aa819..08a9d96 100644
--- a/specification/json/sections/cper-ia32x64-processor.json
+++ b/specification/json/sections/cper-ia32x64-processor.json
@@ -54,7 +54,16 @@
"additionalProperties": false,
"properties": {
"type": {
- "type": "string"
+ "type": "object",
+ "required": ["guid", "name"],
+ "properties": {
+ "guid": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
},
"validationBits": {
"type": "object",