Add CPU information to generic/IA32/x64 sections.
diff --git a/sections/cper-section-arm.c b/sections/cper-section-arm.c
index 8590414..4c5ce36 100644
--- a/sections/cper-section-arm.c
+++ b/sections/cper-section-arm.c
@@ -99,7 +99,6 @@
json_object_object_add(error_info_ir, "validationBits", validation);
//The type of error information in this log.
- //todo: The UEFI spec is ambiguous, what are the values for these??
json_object* error_type = integer_to_readable_pair(error_info->Type, 4,
ARM_ERROR_INFO_ENTRY_INFO_TYPES_KEYS,
ARM_ERROR_INFO_ENTRY_INFO_TYPES_VALUES,
@@ -155,7 +154,6 @@
json_object_object_add(cache_tlb_error_ir, "transactionType", transaction_type);
//Operation.
- //todo: What are the types' numeric values? UEFI spec is ambiguous
json_object* operation;
if (error_info->Type == 0)
{
diff --git a/sections/cper-section-generic.c b/sections/cper-section-generic.c
index 04a5493..20f14c2 100644
--- a/sections/cper-section-generic.c
+++ b/sections/cper-section-generic.c
@@ -60,8 +60,8 @@
//The level of the error.
json_object_object_add(section_ir, "level", json_object_new_int(section_generic->Level));
- //CPU version information (todo)
- //...
+ //CPU version information.
+ json_object_object_add(section_ir, "cpuVersionInfo", json_object_new_uint64(section_generic->VersionInfo));
//CPU brand string. May not exist if on ARM.
json_object_object_add(section_ir, "cpuBrandString", json_object_new_string(section_generic->BrandString));
diff --git a/sections/cper-section-ia32x64.c b/sections/cper-section-ia32x64.c
index 5dbad18..9b38341 100644
--- a/sections/cper-section-ia32x64.c
+++ b/sections/cper-section-ia32x64.c
@@ -40,8 +40,14 @@
//APIC ID.
json_object_object_add(record_ir, "localAPICID", json_object_new_uint64(record->ApicId));
- //CPU ID information (todo, see generic).
- //...
+ //CPUID information.
+ json_object* cpuid_info_ir = json_object_new_object();
+ EFI_IA32_X64_CPU_ID* cpuid_info = (EFI_IA32_X64_CPU_ID*)record->CpuIdInfo;
+ json_object_object_add(cpuid_info_ir, "eax", json_object_new_uint64(cpuid_info->Eax));
+ json_object_object_add(cpuid_info_ir, "ebx", json_object_new_uint64(cpuid_info->Ebx));
+ json_object_object_add(cpuid_info_ir, "ecx", json_object_new_uint64(cpuid_info->Ecx));
+ json_object_object_add(cpuid_info_ir, "edx", json_object_new_uint64(cpuid_info->Edx));
+ json_object_object_add(record_ir, "cpuidInfo", cpuid_info_ir);
//Processor error information, of the amount described above.
EFI_IA32_X64_PROCESS_ERROR_INFO* current_error_info = (EFI_IA32_X64_PROCESS_ERROR_INFO*)(record + 1);
diff --git a/sections/cper-section-ia32x64.h b/sections/cper-section-ia32x64.h
index 81076d0..51af428 100644
--- a/sections/cper-section-ia32x64.h
+++ b/sections/cper-section-ia32x64.h
@@ -30,6 +30,14 @@
"32-bit Mode Execution Context", "64-bit Mode Execution Context", "FXSave Context", \
"32-bit Mode Debug Registers", "64-bit Mode Debug Registers", "Memory Mapper Registers"}
+typedef struct {
+ UINT64 Eax;
+ UINT64 Ebx;
+ UINT64 Ecx;
+ UINT64 Edx;
+ UINT64 Reserved[2];
+} EFI_IA32_X64_CPU_ID;
+
json_object* cper_section_ia32x64_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
#endif
\ No newline at end of file