1794312c8SLawrence Tang #ifndef CPER_SECTION_IA32X64_H 2794312c8SLawrence Tang #define CPER_SECTION_IA32X64_H 3794312c8SLawrence Tang 45202bbb4SLawrence Tang #include <json.h> 5794312c8SLawrence Tang #include "../edk/Cper.h" 6794312c8SLawrence Tang 7f8fc7052SJohn Chung #define IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES \ 8f8fc7052SJohn Chung (const char *[]) \ 9f8fc7052SJohn Chung { \ 10f8fc7052SJohn Chung "checkInfoValid", "targetAddressIDValid", "requestorIDValid", \ 11f8fc7052SJohn Chung "responderIDValid", "instructionPointerValid" \ 12f8fc7052SJohn Chung } 13f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES \ 14f8fc7052SJohn Chung (const char *[]) \ 15f8fc7052SJohn Chung { \ 16f8fc7052SJohn Chung "transactionTypeValid", "operationValid", "levelValid", \ 17f8fc7052SJohn Chung "processorContextCorruptValid", "uncorrectedValid", \ 18f8fc7052SJohn Chung "preciseIPValid", "restartableIPValid", \ 19f8fc7052SJohn Chung "overflowValid", "participationTypeValid", \ 20f8fc7052SJohn Chung "timedOutValid", "addressSpaceValid" \ 21f8fc7052SJohn Chung } 22f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES \ 23f8fc7052SJohn Chung (const char *[]) \ 24f8fc7052SJohn Chung { \ 25f8fc7052SJohn Chung "errorTypeValid", "processorContextCorruptValid", \ 26f8fc7052SJohn Chung "uncorrectedValid", "preciseIPValid", \ 27f8fc7052SJohn Chung "restartableIPValid", "overflowValid" \ 28f8fc7052SJohn Chung } 29f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_TRANSACTION_TYPES_KEYS \ 30f8fc7052SJohn Chung (int[]) \ 31f8fc7052SJohn Chung { \ 32f8fc7052SJohn Chung 0, 1, 2 \ 33f8fc7052SJohn Chung } 34f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_TRANSACTION_TYPES_VALUES \ 35f8fc7052SJohn Chung (const char *[]) \ 36f8fc7052SJohn Chung { \ 37f8fc7052SJohn Chung "Instruction", "Data Access", "Generic" \ 38f8fc7052SJohn Chung } 39f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_OPERATION_TYPES_KEYS \ 40f8fc7052SJohn Chung (int[]) \ 41f8fc7052SJohn Chung { \ 42f8fc7052SJohn Chung 0, 1, 2, 3, 4, 5, 6, 7, 8 \ 43f8fc7052SJohn Chung } 44f8fc7052SJohn Chung #define IA32X64_CHECK_INFO_OPERATION_TYPES_VALUES \ 45f8fc7052SJohn Chung (const char *[]) \ 46f8fc7052SJohn Chung { \ 47*6981acbfSEd Tanous "Generic Error", "Generic Read", "Generic Write", "Data Read", \ 48f8fc7052SJohn Chung "Data Write", "Instruction Fetch", "Prefetch", \ 49f8fc7052SJohn Chung "Eviction", "Snoop" \ 50f8fc7052SJohn Chung } 51f8fc7052SJohn Chung #define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_KEYS \ 52f8fc7052SJohn Chung (int[]) \ 53f8fc7052SJohn Chung { \ 54f8fc7052SJohn Chung 0, 1, 2, 3 \ 55f8fc7052SJohn Chung } 56f8fc7052SJohn Chung #define IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_VALUES \ 57f8fc7052SJohn Chung (const char *[]) \ 58f8fc7052SJohn Chung { \ 59f8fc7052SJohn Chung "Local processor originated request", \ 60f8fc7052SJohn Chung "Local processor responded to request", \ 61f8fc7052SJohn Chung "Local processor observed", "Generic" \ 62f8fc7052SJohn Chung } 63f8fc7052SJohn Chung #define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_KEYS \ 64f8fc7052SJohn Chung (int[]) \ 65f8fc7052SJohn Chung { \ 66f8fc7052SJohn Chung 0, 1, 2, 3 \ 67f8fc7052SJohn Chung } 68f8fc7052SJohn Chung #define IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_VALUES \ 69f8fc7052SJohn Chung (const char *[]) \ 70f8fc7052SJohn Chung { \ 71f8fc7052SJohn Chung "Memory Access", "Reserved", "I/O", "Other Transaction" \ 72f8fc7052SJohn Chung } 73f8fc7052SJohn Chung #define IA32X64_MS_CHECK_INFO_ERROR_TYPES_KEYS \ 74f8fc7052SJohn Chung (int[]) \ 75f8fc7052SJohn Chung { \ 76f8fc7052SJohn Chung 0, 1, 2, 3, 4, 5 \ 77f8fc7052SJohn Chung } 78f8fc7052SJohn Chung #define IA32X64_MS_CHECK_INFO_ERROR_TYPES_VALUES \ 79f8fc7052SJohn Chung (const char *[]) \ 80f8fc7052SJohn Chung { \ 81f8fc7052SJohn Chung "No Error", "Unclassified", "Microcode ROM Parity Error", \ 82f8fc7052SJohn Chung "External Error", "FRC Error", "Internal Unclassified" \ 83f8fc7052SJohn Chung } 84f8fc7052SJohn Chung #define IA32X64_REGISTER_CONTEXT_TYPES_KEYS \ 85f8fc7052SJohn Chung (int[]) \ 86f8fc7052SJohn Chung { \ 87f8fc7052SJohn Chung 0, 1, 2, 3, 4, 5, 6, 7 \ 88f8fc7052SJohn Chung } 89f8fc7052SJohn Chung #define IA32X64_REGISTER_CONTEXT_TYPES_VALUES \ 90f8fc7052SJohn Chung (const char *[]) \ 91f8fc7052SJohn Chung { \ 92f8fc7052SJohn Chung "Unclassified Data", "MSR Registers", \ 93f8fc7052SJohn Chung "32-bit Mode Execution Context", \ 94f8fc7052SJohn Chung "64-bit Mode Execution Context", "FXSave Context", \ 95f8fc7052SJohn Chung "32-bit Mode Debug Registers", \ 96f8fc7052SJohn Chung "64-bit Mode Debug Registers", \ 97f8fc7052SJohn Chung "Memory Mapper Registers" \ 98f8fc7052SJohn Chung } 99794312c8SLawrence Tang 1009a785c2aSLawrence Tang typedef struct { 1019a785c2aSLawrence Tang UINT64 Eax; 1029a785c2aSLawrence Tang UINT64 Ebx; 1039a785c2aSLawrence Tang UINT64 Ecx; 1049a785c2aSLawrence Tang UINT64 Edx; 1059a785c2aSLawrence Tang UINT64 Reserved[2]; 1069a785c2aSLawrence Tang } EFI_IA32_X64_CPU_ID; 1079a785c2aSLawrence Tang 108f8fc7052SJohn Chung json_object *cper_section_ia32x64_to_ir(void *section); 109d0c88849SLawrence Tang void ir_section_ia32x64_to_cper(json_object *section, FILE *out); 110794312c8SLawrence Tang 111794312c8SLawrence Tang #endif 112