/**
 * Describes functions for converting IA32/x64 CPER sections from binary and JSON format
 * into an intermediate format.
 * 
 * Author: Lawrence.Tang@arm.com
 **/

#include <stdio.h>
#include "json.h"
#include "b64.h"
#include "../edk/Cper.h"
#include "../cper-utils.h"
#include "cper-section-ia32x64.h"

//Private pre-definitions.
json_object* cper_ia32x64_processor_error_info_to_ir(EFI_IA32_X64_PROCESS_ERROR_INFO* error_info);
json_object* cper_ia32x64_cache_tlb_check_to_ir(EFI_IA32_X64_CACHE_CHECK_INFO* cache_tlb_check);
json_object* cper_ia32x64_bus_check_to_ir(EFI_IA32_X64_BUS_CHECK_INFO* bus_check);
json_object* cper_ia32x64_ms_check_to_ir(EFI_IA32_X64_MS_CHECK_INFO* ms_check);
json_object* cper_ia32x64_processor_context_info_to_ir(EFI_IA32_X64_PROCESSOR_CONTEXT_INFO* context_info, void** cur_pos);
json_object* cper_ia32x64_register_32bit_to_ir(EFI_CONTEXT_IA32_REGISTER_STATE* registers);
json_object* cper_ia32x64_register_64bit_to_ir(EFI_CONTEXT_X64_REGISTER_STATE* registers);
void ir_ia32x64_error_info_to_cper(json_object* error_info, FILE* out);
void ir_ia32x64_context_info_to_cper(json_object* context_info, FILE* out);
void ir_ia32x64_cache_tlb_check_error_to_cper(json_object* check_info, EFI_IA32_X64_CACHE_CHECK_INFO* check_info_cper);
void ir_ia32x64_bus_check_error_to_cper(json_object* check_info, EFI_IA32_X64_BUS_CHECK_INFO* check_info_cper);
void ir_ia32x64_ms_check_error_to_cper(json_object* check_info, EFI_IA32_X64_MS_CHECK_INFO* check_info_cper);
void ir_ia32x64_ia32_registers_to_cper(json_object* registers, FILE* out);
void ir_ia32x64_x64_registers_to_cper(json_object* registers, FILE* out);

//////////////////
/// CPER TO IR ///
//////////////////

//Converts the IA32/x64 error section described in the given descriptor into intermediate format.
json_object* cper_section_ia32x64_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
{
    EFI_IA32_X64_PROCESSOR_ERROR_RECORD* record = (EFI_IA32_X64_PROCESSOR_ERROR_RECORD*)section;
    json_object* record_ir = json_object_new_object();

    //Validation bits.
    json_object* validationBits = json_object_new_object();
    json_object_object_add(validationBits, "localAPICIDValid", json_object_new_boolean(record->ValidFields & 0b1));
    json_object_object_add(validationBits, "cpuIDInfoValid", json_object_new_boolean((record->ValidFields >> 1) & 0b1));
    int processor_error_info_num = (record->ValidFields >> 2) & 0b111111;
    json_object_object_add(validationBits, "processorErrorInfoNum", json_object_new_int(processor_error_info_num));
    int processor_context_info_num = (record->ValidFields >> 8) & 0b111111;
    json_object_object_add(validationBits, "processorContextInfoNum", json_object_new_int(processor_context_info_num));
    json_object_object_add(record_ir, "validationBits", validationBits);

    //APIC ID.
    json_object_object_add(record_ir, "localAPICID", json_object_new_uint64(record->ApicId));

    //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);
    json_object* error_info_array = json_object_new_array();
    for (int i=0; i<processor_error_info_num; i++) 
    {
        json_object_array_add(error_info_array, cper_ia32x64_processor_error_info_to_ir(current_error_info));
        current_error_info++;
    }
    json_object_object_add(record_ir, "processorErrorInfo", error_info_array);

    //Processor context information, of the amount described above.
    EFI_IA32_X64_PROCESSOR_CONTEXT_INFO* current_context_info = (EFI_IA32_X64_PROCESSOR_CONTEXT_INFO*)current_error_info;
    void* cur_pos = (void*)current_context_info;
    json_object* context_info_array = json_object_new_array();
    for (int i=0; i<processor_context_info_num; i++) 
    {
        json_object_array_add(context_info_array, cper_ia32x64_processor_context_info_to_ir(current_context_info, &cur_pos));
        current_context_info = (EFI_IA32_X64_PROCESSOR_CONTEXT_INFO*)cur_pos;
        //The context array is a non-fixed size, pointer is shifted within the above function.
    }
    json_object_object_add(record_ir, "processorContextInfo", context_info_array);

    return record_ir;
}

//Converts a single IA32/x64 processor error info block into JSON IR format.
json_object* cper_ia32x64_processor_error_info_to_ir(EFI_IA32_X64_PROCESS_ERROR_INFO* error_info)
{
    json_object* error_info_ir = json_object_new_object();

    //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_new_string(error_type));

    //Validation bits.
    json_object* validation = bitfield_to_ir(error_info->ValidFields, 5, IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES);
    json_object_object_add(error_info_ir, "validationBits", validation);

    //Add the check information on a per-structure basis.
    //Cache and TLB check information are identical, so can be equated.
    json_object* check_information = NULL;
    if (guid_equal(&error_info->ErrorType, &gEfiIa32x64ErrorTypeCacheCheckGuid)
        || guid_equal(&error_info->ErrorType, &gEfiIa32x64ErrorTypeTlbCheckGuid))
    {
        check_information = cper_ia32x64_cache_tlb_check_to_ir((EFI_IA32_X64_CACHE_CHECK_INFO*)&error_info->CheckInfo);
    }
    else if (guid_equal(&error_info->ErrorType, &gEfiIa32x64ErrorTypeBusCheckGuid))
    {
        check_information = cper_ia32x64_bus_check_to_ir((EFI_IA32_X64_BUS_CHECK_INFO*)&error_info->CheckInfo);
    }
    else if (guid_equal(&error_info->ErrorType, &gEfiIa32x64ErrorTypeMsCheckGuid))
    {
        check_information = cper_ia32x64_ms_check_to_ir((EFI_IA32_X64_MS_CHECK_INFO*)&error_info->CheckInfo);
    }
    else 
    {
        //Unknown check information.
        printf("WARN: Invalid/unknown check information GUID found in IA32/x64 CPER section. Ignoring.\n");
    }
    json_object_object_add(error_info_ir, "checkInfo", check_information);

    //Target, requestor, and responder identifiers.
    json_object_object_add(error_info_ir, "targetAddressID", json_object_new_uint64(error_info->TargetId));
    json_object_object_add(error_info_ir, "requestorID", json_object_new_uint64(error_info->RequestorId));
    json_object_object_add(error_info_ir, "responderID", json_object_new_uint64(error_info->ResponderId));
    json_object_object_add(error_info_ir, "instructionPointer", json_object_new_uint64(error_info->InstructionIP));

    return error_info_ir;
}

//Converts a single IA32/x64 cache or TLB check check info block into JSON IR format.
json_object* cper_ia32x64_cache_tlb_check_to_ir(EFI_IA32_X64_CACHE_CHECK_INFO* cache_tlb_check)
{
    json_object* cache_tlb_check_ir = json_object_new_object();

    //Validation bits.
    json_object* validation = bitfield_to_ir(cache_tlb_check->ValidFields, 8, IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES);
    json_object_object_add(cache_tlb_check_ir, "validationBits", validation);

    //Transaction type.
    json_object* transaction_type = integer_to_readable_pair(cache_tlb_check->TransactionType, 3,
        IA32X64_CHECK_INFO_TRANSACTION_TYPES_KEYS,
        IA32X64_CHECK_INFO_TRANSACTION_TYPES_VALUES,
        "Unknown (Reserved)");
    json_object_object_add(cache_tlb_check_ir, "transactionType", transaction_type);

    //Operation.
    json_object* operation = integer_to_readable_pair(cache_tlb_check->Operation, 9,
        IA32X64_CHECK_INFO_OPERATION_TYPES_KEYS,
        IA32X64_CHECK_INFO_OPERATION_TYPES_VALUES,
        "Unknown (Reserved)");
    json_object_object_add(cache_tlb_check_ir, "operation", operation);

    //Affected cache/TLB level.
    json_object_object_add(cache_tlb_check_ir, "level", json_object_new_uint64(cache_tlb_check->Level));

    //Miscellaneous boolean fields.
    json_object_object_add(cache_tlb_check_ir, "processorContextCorrupt", json_object_new_boolean(cache_tlb_check->ContextCorrupt));
    json_object_object_add(cache_tlb_check_ir, "uncorrected", json_object_new_boolean(cache_tlb_check->ErrorUncorrected));
    json_object_object_add(cache_tlb_check_ir, "preciseIP", json_object_new_boolean(cache_tlb_check->PreciseIp));
    json_object_object_add(cache_tlb_check_ir, "restartableIP", json_object_new_boolean(cache_tlb_check->RestartableIp));
    json_object_object_add(cache_tlb_check_ir, "overflow", json_object_new_boolean(cache_tlb_check->Overflow));

    return cache_tlb_check_ir;
}

//Converts a single IA32/x64 bus check check info block into JSON IR format.
json_object* cper_ia32x64_bus_check_to_ir(EFI_IA32_X64_BUS_CHECK_INFO* bus_check)
{ 
    json_object* bus_check_ir = json_object_new_object();

    //Validation bits.
    json_object* validation = bitfield_to_ir(bus_check->ValidFields, 11, IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES);
    json_object_object_add(bus_check_ir, "validationBits", validation);

    //Transaction type.
    json_object* transaction_type = integer_to_readable_pair(bus_check->TransactionType, 3,
        IA32X64_CHECK_INFO_TRANSACTION_TYPES_KEYS,
        IA32X64_CHECK_INFO_TRANSACTION_TYPES_VALUES,
        "Unknown (Reserved)");
    json_object_object_add(bus_check_ir, "transactionType", transaction_type);

    //Operation.
    json_object* operation = integer_to_readable_pair(bus_check->Operation, 9,
        IA32X64_CHECK_INFO_OPERATION_TYPES_KEYS,
        IA32X64_CHECK_INFO_OPERATION_TYPES_VALUES,
        "Unknown (Reserved)");
    json_object_object_add(bus_check_ir, "operation", operation);

    //Affected bus level.
    json_object_object_add(bus_check_ir, "level", json_object_new_uint64(bus_check->Level));

    //Miscellaneous boolean fields.
    json_object_object_add(bus_check_ir, "processorContextCorrupt", json_object_new_boolean(bus_check->ContextCorrupt));
    json_object_object_add(bus_check_ir, "uncorrected", json_object_new_boolean(bus_check->ErrorUncorrected));
    json_object_object_add(bus_check_ir, "preciseIP", json_object_new_boolean(bus_check->PreciseIp));
    json_object_object_add(bus_check_ir, "restartableIP", json_object_new_boolean(bus_check->RestartableIp));
    json_object_object_add(bus_check_ir, "overflow", json_object_new_boolean(bus_check->Overflow));
    json_object_object_add(bus_check_ir, "timedOut", json_object_new_boolean(bus_check->TimeOut));

    //Participation type.
    json_object* participation_type = integer_to_readable_pair(bus_check->ParticipationType, 4,
        IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_KEYS,
        IA32X64_BUS_CHECK_INFO_PARTICIPATION_TYPES_VALUES,
        "Unknown");
    json_object_object_add(bus_check_ir, "participationType", participation_type);

    //Address space.
    json_object* address_space = integer_to_readable_pair(bus_check->AddressSpace, 4,
        IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_KEYS,
        IA32X64_BUS_CHECK_INFO_ADDRESS_SPACE_TYPES_VALUES,
        "Unknown");
    json_object_object_add(bus_check_ir, "addressSpace", address_space);
    
    return bus_check_ir;
}

//Converts a single IA32/x64 MS check check info block into JSON IR format.
json_object* cper_ia32x64_ms_check_to_ir(EFI_IA32_X64_MS_CHECK_INFO* ms_check)
{
    json_object* ms_check_ir = json_object_new_object();

    //Validation bits.
    json_object* validation = bitfield_to_ir(ms_check->ValidFields, 6, IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES);
    json_object_object_add(ms_check_ir, "validationBits", validation);

    //Error type (operation that caused the error).
    json_object* error_type = integer_to_readable_pair(ms_check->ErrorType, 4,
        IA32X64_MS_CHECK_INFO_ERROR_TYPES_KEYS,
        IA32X64_MS_CHECK_INFO_ERROR_TYPES_VALUES,
        "Unknown (Processor Specific)");
    json_object_object_add(ms_check_ir, "errorType", error_type);
    
    //Miscellaneous fields.
    json_object_object_add(ms_check_ir, "processorContextCorrupt", json_object_new_boolean(ms_check->ContextCorrupt));
    json_object_object_add(ms_check_ir, "uncorrected", json_object_new_boolean(ms_check->ErrorUncorrected));
    json_object_object_add(ms_check_ir, "preciseIP", json_object_new_boolean(ms_check->PreciseIp));
    json_object_object_add(ms_check_ir, "restartableIP", json_object_new_boolean(ms_check->RestartableIp));
    json_object_object_add(ms_check_ir, "overflow", json_object_new_boolean(ms_check->Overflow));

    return ms_check_ir;
}

//Converts a single IA32/x64 processor context info entry into JSON IR format.
json_object* cper_ia32x64_processor_context_info_to_ir(EFI_IA32_X64_PROCESSOR_CONTEXT_INFO* context_info, void** cur_pos)
{
    json_object* context_info_ir = json_object_new_object();

    //Register context type.
    json_object* context_type = integer_to_readable_pair(context_info->RegisterType, 8,
        IA32X64_REGISTER_CONTEXT_TYPES_KEYS,
        IA32X64_REGISTER_CONTEXT_TYPES_VALUES,
        "Unknown (Reserved)");
    json_object_object_add(context_info_ir, "registerContextType", context_type);

    //Register array size, MSR and MM address.
    json_object_object_add(context_info_ir, "registerArraySize", json_object_new_uint64(context_info->ArraySize));
    json_object_object_add(context_info_ir, "msrAddress", json_object_new_uint64(context_info->MsrAddress));
    json_object_object_add(context_info_ir, "mmRegisterAddress", json_object_new_uint64(context_info->MmRegisterAddress));

    //Register array.
    json_object* register_array = NULL;
    if (context_info->RegisterType == EFI_REG_CONTEXT_TYPE_IA32) 
    {
        EFI_CONTEXT_IA32_REGISTER_STATE* register_state = (EFI_CONTEXT_IA32_REGISTER_STATE*)(context_info + 1);
        register_array = cper_ia32x64_register_32bit_to_ir(register_state);
        *cur_pos = (void*)(register_state + 1);
    }
    else if (context_info->RegisterType == EFI_REG_CONTEXT_TYPE_X64) 
    {
        EFI_CONTEXT_X64_REGISTER_STATE* register_state = (EFI_CONTEXT_X64_REGISTER_STATE*)(context_info + 1);
        register_array = cper_ia32x64_register_64bit_to_ir(register_state);
        *cur_pos = (void*)(register_state + 1);
    }
    else 
    {
        //No parseable data, just dump as base64 and shift the head to the next item.
        *cur_pos = (void*)(context_info + 1);

        char* encoded = b64_encode((unsigned char*)*cur_pos, context_info->ArraySize);
        register_array = json_object_new_object();
        json_object_object_add(register_array, "data", json_object_new_string(encoded));
        free(encoded);

        *cur_pos = (void*)(((char*)*cur_pos) + context_info->ArraySize);
    }
    json_object_object_add(context_info_ir, "registerArray", register_array);

    return context_info_ir;
}

//Converts a single CPER IA32 register state into JSON IR format.
json_object* cper_ia32x64_register_32bit_to_ir(EFI_CONTEXT_IA32_REGISTER_STATE* registers)
{
    json_object* ia32_registers = json_object_new_object();
    json_object_object_add(ia32_registers, "eax", json_object_new_uint64(registers->Eax));
    json_object_object_add(ia32_registers, "ebx", json_object_new_uint64(registers->Ebx));
    json_object_object_add(ia32_registers, "ecx", json_object_new_uint64(registers->Ecx));
    json_object_object_add(ia32_registers, "edx", json_object_new_uint64(registers->Edx));
    json_object_object_add(ia32_registers, "esi", json_object_new_uint64(registers->Esi));
    json_object_object_add(ia32_registers, "edi", json_object_new_uint64(registers->Edi));
    json_object_object_add(ia32_registers, "ebp", json_object_new_uint64(registers->Ebp));
    json_object_object_add(ia32_registers, "esp", json_object_new_uint64(registers->Esp));
    json_object_object_add(ia32_registers, "cs", json_object_new_uint64(registers->Cs));
    json_object_object_add(ia32_registers, "ds", json_object_new_uint64(registers->Ds));
    json_object_object_add(ia32_registers, "ss", json_object_new_uint64(registers->Ss));
    json_object_object_add(ia32_registers, "es", json_object_new_uint64(registers->Es));
    json_object_object_add(ia32_registers, "fs", json_object_new_uint64(registers->Fs));
    json_object_object_add(ia32_registers, "gs", json_object_new_uint64(registers->Gs));
    json_object_object_add(ia32_registers, "eflags", json_object_new_uint64(registers->Eflags));
    json_object_object_add(ia32_registers, "eip", json_object_new_uint64(registers->Eip));
    json_object_object_add(ia32_registers, "cr0", json_object_new_uint64(registers->Cr0));
    json_object_object_add(ia32_registers, "cr1", json_object_new_uint64(registers->Cr1));
    json_object_object_add(ia32_registers, "cr2", json_object_new_uint64(registers->Cr2));
    json_object_object_add(ia32_registers, "cr3", json_object_new_uint64(registers->Cr3));
    json_object_object_add(ia32_registers, "cr4", json_object_new_uint64(registers->Cr4));
    json_object_object_add(ia32_registers, "gdtr", json_object_new_uint64(registers->Gdtr[0] + ((UINT64)registers->Gdtr[1] << 32)));
    json_object_object_add(ia32_registers, "idtr", json_object_new_uint64(registers->Idtr[0] + ((UINT64)registers->Idtr[1] << 32)));
    json_object_object_add(ia32_registers, "ldtr", json_object_new_uint64(registers->Ldtr));
    json_object_object_add(ia32_registers, "tr", json_object_new_uint64(registers->Tr));

    return ia32_registers;
}

//Converts a single CPER x64 register state into JSON IR format.
json_object* cper_ia32x64_register_64bit_to_ir(EFI_CONTEXT_X64_REGISTER_STATE* registers)
{
    json_object* x64_registers = json_object_new_object();
    json_object_object_add(x64_registers, "rax", json_object_new_uint64(registers->Rax));
    json_object_object_add(x64_registers, "rbx", json_object_new_uint64(registers->Rbx));
    json_object_object_add(x64_registers, "rcx", json_object_new_uint64(registers->Rcx));
    json_object_object_add(x64_registers, "rdx", json_object_new_uint64(registers->Rdx));
    json_object_object_add(x64_registers, "rsi", json_object_new_uint64(registers->Rsi));
    json_object_object_add(x64_registers, "rdi", json_object_new_uint64(registers->Rdi));
    json_object_object_add(x64_registers, "rbp", json_object_new_uint64(registers->Rbp));
    json_object_object_add(x64_registers, "rsp", json_object_new_uint64(registers->Rsp));
    json_object_object_add(x64_registers, "r8", json_object_new_uint64(registers->R8));
    json_object_object_add(x64_registers, "r9", json_object_new_uint64(registers->R9));
    json_object_object_add(x64_registers, "r10", json_object_new_uint64(registers->R10));
    json_object_object_add(x64_registers, "r11", json_object_new_uint64(registers->R11));
    json_object_object_add(x64_registers, "r12", json_object_new_uint64(registers->R12));
    json_object_object_add(x64_registers, "r13", json_object_new_uint64(registers->R13));
    json_object_object_add(x64_registers, "r14", json_object_new_uint64(registers->R14));
    json_object_object_add(x64_registers, "r15", json_object_new_uint64(registers->R15));
    json_object_object_add(x64_registers, "cs", json_object_new_int(registers->Cs));
    json_object_object_add(x64_registers, "ds", json_object_new_int(registers->Ds));
    json_object_object_add(x64_registers, "ss", json_object_new_int(registers->Ss));
    json_object_object_add(x64_registers, "es", json_object_new_int(registers->Es));
    json_object_object_add(x64_registers, "fs", json_object_new_int(registers->Fs));
    json_object_object_add(x64_registers, "gs", json_object_new_int(registers->Gs));
    json_object_object_add(x64_registers, "rflags", json_object_new_uint64(registers->Rflags));
    json_object_object_add(x64_registers, "eip", json_object_new_uint64(registers->Rip));
    json_object_object_add(x64_registers, "cr0", json_object_new_uint64(registers->Cr0));
    json_object_object_add(x64_registers, "cr1", json_object_new_uint64(registers->Cr1));
    json_object_object_add(x64_registers, "cr2", json_object_new_uint64(registers->Cr2));
    json_object_object_add(x64_registers, "cr3", json_object_new_uint64(registers->Cr3));
    json_object_object_add(x64_registers, "cr4", json_object_new_uint64(registers->Cr4));
    json_object_object_add(x64_registers, "cr8", json_object_new_uint64(registers->Cr8));
    json_object_object_add(x64_registers, "gdtr_0", json_object_new_uint64(registers->Gdtr[0]));
    json_object_object_add(x64_registers, "gdtr_1", json_object_new_uint64(registers->Gdtr[1]));
    json_object_object_add(x64_registers, "idtr_0", json_object_new_uint64(registers->Idtr[0]));
    json_object_object_add(x64_registers, "idtr_1", json_object_new_uint64(registers->Idtr[1]));
    json_object_object_add(x64_registers, "ldtr", json_object_new_int(registers->Ldtr));
    json_object_object_add(x64_registers, "tr", json_object_new_int(registers->Tr));

    return x64_registers;
}

//////////////////
/// IR TO CPER ///
//////////////////

//Converts a single IA32/x64 CPER-JSON section into CPER binary, outputting to the provided stream.
void ir_section_ia32x64_to_cper(json_object* section, FILE* out)
{
    EFI_IA32_X64_PROCESSOR_ERROR_RECORD* section_cper = 
        (EFI_IA32_X64_PROCESSOR_ERROR_RECORD*)calloc(1, sizeof(EFI_IA32_X64_PROCESSOR_ERROR_RECORD));

    //Validation bits.
    json_object* validation = json_object_object_get(section, "validationBits");
    section_cper->ValidFields = 0x0;
    section_cper->ValidFields |= json_object_get_boolean(json_object_object_get(validation, "localAPICIDValid"));
    section_cper->ValidFields |= json_object_get_boolean(json_object_object_get(validation, "cpuIDInfoValid")) << 1;
    int proc_error_info_num = json_object_get_int(json_object_object_get(validation, "processorErrorInfoNum")) & 0b111111;
    int proc_ctx_info_num = json_object_get_int(json_object_object_get(validation, "processorContextInfoNum")) & 0b111111;
    section_cper->ValidFields |= proc_error_info_num << 2;
    section_cper->ValidFields |= proc_ctx_info_num << 8;

    //Local APIC ID.
    section_cper->ApicId = json_object_get_uint64(json_object_object_get(section, "localAPICID"));
    
    //CPUID info.
    json_object* cpuid_info = json_object_object_get(section, "cpuidInfo");
    EFI_IA32_X64_CPU_ID* cpuid_info_cper = (EFI_IA32_X64_CPU_ID*)section_cper->CpuIdInfo;
    cpuid_info_cper->Eax = json_object_get_uint64(json_object_object_get(cpuid_info, "eax"));
    cpuid_info_cper->Ebx = json_object_get_uint64(json_object_object_get(cpuid_info, "ebx"));
    cpuid_info_cper->Ecx = json_object_get_uint64(json_object_object_get(cpuid_info, "ecx"));
    cpuid_info_cper->Edx = json_object_get_uint64(json_object_object_get(cpuid_info, "edx"));

    //Flush the header to file before dealing w/ info sections.
    fwrite(section_cper, sizeof(EFI_IA32_X64_PROCESSOR_ERROR_RECORD), 1, out);
    fflush(out);
    free(section_cper);

    //Iterate and deal with sections.
    json_object* error_info = json_object_object_get(section, "processorErrorInfo");
    json_object* context_info = json_object_object_get(section, "processorContextInfo");
    for (int i=0; i<proc_error_info_num; i++)
        ir_ia32x64_error_info_to_cper(json_object_array_get_idx(error_info, i), out);
    for (int i=0; i<proc_ctx_info_num; i++)
        ir_ia32x64_context_info_to_cper(json_object_array_get_idx(context_info, i), out);
}

//Converts a single CPER-JSON IA32/x64 error information structure into CPER binary, outputting to the
//provided stream.
void ir_ia32x64_error_info_to_cper(json_object* error_info, FILE* out)
{
    EFI_IA32_X64_PROCESS_ERROR_INFO* error_info_cper = 
        (EFI_IA32_X64_PROCESS_ERROR_INFO*)calloc(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")));

    //Validation bits.
    error_info_cper->ValidFields = ir_to_bitfield(json_object_object_get(error_info, "validationBits"), 
        5, IA32X64_PROCESSOR_ERROR_VALID_BITFIELD_NAMES);

    //Check information, parsed based on the error type.
    json_object* check_info = json_object_object_get(error_info, "checkInfo");
    if (guid_equal(&error_info_cper->ErrorType, &gEfiIa32x64ErrorTypeCacheCheckGuid)
        || guid_equal(&error_info_cper->ErrorType, &gEfiIa32x64ErrorTypeTlbCheckGuid))
    {
        ir_ia32x64_cache_tlb_check_error_to_cper(check_info, (EFI_IA32_X64_CACHE_CHECK_INFO*)&error_info_cper->CheckInfo);
    }
    else if (guid_equal(&error_info_cper->ErrorType, &gEfiIa32x64ErrorTypeBusCheckGuid))
        ir_ia32x64_bus_check_error_to_cper(check_info, (EFI_IA32_X64_BUS_CHECK_INFO*)&error_info_cper->CheckInfo);
    else if (guid_equal(&error_info_cper->ErrorType, &gEfiIa32x64ErrorTypeMsCheckGuid))
        ir_ia32x64_ms_check_error_to_cper(check_info, (EFI_IA32_X64_MS_CHECK_INFO*)&error_info_cper->CheckInfo);

    //Miscellaneous numeric fields.
    error_info_cper->TargetId = json_object_get_uint64(json_object_object_get(error_info, "targetAddressID"));
    error_info_cper->RequestorId = json_object_get_uint64(json_object_object_get(error_info, "requestorID"));
    error_info_cper->ResponderId = json_object_get_uint64(json_object_object_get(error_info, "responderID"));
    error_info_cper->InstructionIP = json_object_get_uint64(json_object_object_get(error_info, "instructionPointer"));

    //Write out to stream, then free resources.
    fwrite(error_info_cper, sizeof(EFI_IA32_X64_PROCESS_ERROR_INFO), 1, out);
    fflush(out);
    free(error_info_cper);
}

//Converts a single CPER-JSON IA32/x64 cache/TLB check error info structure to CPER binary.
void ir_ia32x64_cache_tlb_check_error_to_cper(json_object* check_info, EFI_IA32_X64_CACHE_CHECK_INFO* check_info_cper)
{
    //Validation bits.
    check_info_cper->ValidFields = ir_to_bitfield(json_object_object_get(check_info, "validationBits"), 
        8, IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES);

    //Transaction type, operation.
    check_info_cper->TransactionType = readable_pair_to_integer(json_object_object_get(check_info, "transactionType"));
    check_info_cper->Operation = readable_pair_to_integer(json_object_object_get(check_info, "operation"));

    //Miscellaneous raw value fields.
    check_info_cper->Level = json_object_get_uint64(json_object_object_get(check_info, "level"));
    check_info_cper->ContextCorrupt = json_object_get_boolean(json_object_object_get(check_info, "processorContextCorrupt"));
    check_info_cper->ErrorUncorrected = json_object_get_boolean(json_object_object_get(check_info, "uncorrected"));
    check_info_cper->PreciseIp = json_object_get_boolean(json_object_object_get(check_info, "preciseIP"));
    check_info_cper->RestartableIp = json_object_get_boolean(json_object_object_get(check_info, "restartableIP"));
    check_info_cper->Overflow = json_object_get_boolean(json_object_object_get(check_info, "overflow"));
}

//Converts a single CPER-JSON IA32/x64 bus error info structure to CPER binary.
void ir_ia32x64_bus_check_error_to_cper(json_object* check_info, EFI_IA32_X64_BUS_CHECK_INFO* check_info_cper)
{
    //Validation bits.
    check_info_cper->ValidFields = ir_to_bitfield(json_object_object_get(check_info, "validationBits"), 
        11, IA32X64_CHECK_INFO_VALID_BITFIELD_NAMES);

    //Readable pair fields.
    check_info_cper->TransactionType = readable_pair_to_integer(json_object_object_get(check_info, "transactionType"));
    check_info_cper->Operation = readable_pair_to_integer(json_object_object_get(check_info, "operation"));
    check_info_cper->ParticipationType = readable_pair_to_integer(json_object_object_get(check_info, "participationType"));
    check_info_cper->AddressSpace = readable_pair_to_integer(json_object_object_get(check_info, "addressSpace"));

    //Miscellaneous raw value fields.
    check_info_cper->Level = json_object_get_uint64(json_object_object_get(check_info, "level"));
    check_info_cper->ContextCorrupt = json_object_get_boolean(json_object_object_get(check_info, "processorContextCorrupt"));
    check_info_cper->ErrorUncorrected = json_object_get_boolean(json_object_object_get(check_info, "uncorrected"));
    check_info_cper->PreciseIp = json_object_get_boolean(json_object_object_get(check_info, "preciseIP"));
    check_info_cper->RestartableIp = json_object_get_boolean(json_object_object_get(check_info, "restartableIP"));
    check_info_cper->Overflow = json_object_get_boolean(json_object_object_get(check_info, "overflow"));
    check_info_cper->TimeOut = json_object_get_boolean(json_object_object_get(check_info, "timedOut"));
}

//Converts a single CPER-JSON IA32/x64 MS error info structure to CPER binary.
void ir_ia32x64_ms_check_error_to_cper(json_object* check_info, EFI_IA32_X64_MS_CHECK_INFO* check_info_cper)
{
    //Validation bits.
    check_info_cper->ValidFields = ir_to_bitfield(json_object_object_get(check_info, "validationBits"), 
        6, IA32X64_CHECK_INFO_MS_CHECK_VALID_BITFIELD_NAMES);

    //Type of MS check error.
    check_info_cper->ErrorType = readable_pair_to_integer(json_object_object_get(check_info, "errorType"));

    //Miscellaneous raw value fields.
    check_info_cper->ContextCorrupt = json_object_get_boolean(json_object_object_get(check_info, "processorContextCorrupt"));
    check_info_cper->ErrorUncorrected = json_object_get_boolean(json_object_object_get(check_info, "uncorrected"));
    check_info_cper->PreciseIp = json_object_get_boolean(json_object_object_get(check_info, "preciseIP"));
    check_info_cper->RestartableIp = json_object_get_boolean(json_object_object_get(check_info, "restartableIP"));
    check_info_cper->Overflow = json_object_get_boolean(json_object_object_get(check_info, "overflow"));
}

//Converts a single CPER-JSON IA32/x64 context information structure into CPER binary, outputting to the
//provided stream.
void ir_ia32x64_context_info_to_cper(json_object* context_info, FILE* out)
{
    EFI_IA32_X64_PROCESSOR_CONTEXT_INFO* context_info_cper = 
        (EFI_IA32_X64_PROCESSOR_CONTEXT_INFO*)calloc(1, sizeof(EFI_IA32_X64_PROCESSOR_CONTEXT_INFO));

    //Register context type.
    context_info_cper->RegisterType = (UINT16)readable_pair_to_integer(json_object_object_get(context_info, "registerContextType"));

    //Miscellaneous numeric fields.
    context_info_cper->ArraySize = (UINT16)json_object_get_uint64(json_object_object_get(context_info, "registerArraySize"));
    context_info_cper->MsrAddress = (UINT32)json_object_get_uint64(json_object_object_get(context_info, "msrAddress"));
    context_info_cper->MmRegisterAddress = json_object_get_uint64(json_object_object_get(context_info, "mmRegisterAddress"));

    //Flush header to stream.
    fwrite(context_info_cper, sizeof(EFI_IA32_X64_PROCESSOR_CONTEXT_INFO), 1, out);
    fflush(out);

    //Handle the register array, depending on type provided.
    json_object* register_array = json_object_object_get(context_info, "registerArray");
    if (context_info_cper->RegisterType == EFI_REG_CONTEXT_TYPE_IA32)
    {
        ir_ia32x64_ia32_registers_to_cper(register_array, out);
    }
    else if (context_info_cper->RegisterType == EFI_REG_CONTEXT_TYPE_X64)
    {
        ir_ia32x64_x64_registers_to_cper(register_array, out);
    }
    else 
    {
        //Unknown/structure is not defined.
        json_object* encoded = json_object_object_get(register_array, "data");
        char* decoded = b64_decode(json_object_get_string(encoded), json_object_get_string_len(encoded));
        fwrite(decoded, context_info_cper->ArraySize, 1, out);
        fflush(out);
    }

    //Free remaining resources.
    free(context_info_cper);
}

//Converts a single CPER-JSON IA32 register array into CPER binary, outputting to the given stream.
void ir_ia32x64_ia32_registers_to_cper(json_object* registers, FILE* out)
{
    EFI_CONTEXT_IA32_REGISTER_STATE register_state;
    register_state.Eax = (UINT32)json_object_get_uint64(json_object_object_get(registers, "eax"));
    register_state.Ebx = (UINT32)json_object_get_uint64(json_object_object_get(registers, "ebx"));
    register_state.Ecx = (UINT32)json_object_get_uint64(json_object_object_get(registers, "ecx"));
    register_state.Edx = (UINT32)json_object_get_uint64(json_object_object_get(registers, "edx"));
    register_state.Esi = (UINT32)json_object_get_uint64(json_object_object_get(registers, "esi"));
    register_state.Edi = (UINT32)json_object_get_uint64(json_object_object_get(registers, "edi"));
    register_state.Ebp = (UINT32)json_object_get_uint64(json_object_object_get(registers, "ebp"));
    register_state.Esp = (UINT32)json_object_get_uint64(json_object_object_get(registers, "esp"));
    register_state.Cs = (UINT16)json_object_get_uint64(json_object_object_get(registers, "cs"));
    register_state.Ds = (UINT32)json_object_get_uint64(json_object_object_get(registers, "ds"));
    register_state.Ss = (UINT16)json_object_get_uint64(json_object_object_get(registers, "ss"));
    register_state.Es = (UINT16)json_object_get_uint64(json_object_object_get(registers, "es"));
    register_state.Fs = (UINT16)json_object_get_uint64(json_object_object_get(registers, "fs"));
    register_state.Gs = (UINT16)json_object_get_uint64(json_object_object_get(registers, "gs"));
    register_state.Eflags = (UINT32)json_object_get_uint64(json_object_object_get(registers, "eflags"));
    register_state.Eip = (UINT32)json_object_get_uint64(json_object_object_get(registers, "eip"));
    register_state.Cr0 = (UINT32)json_object_get_uint64(json_object_object_get(registers, "cr0"));
    register_state.Cr1 = (UINT32)json_object_get_uint64(json_object_object_get(registers, "cr1"));
    register_state.Cr2 = (UINT32)json_object_get_uint64(json_object_object_get(registers, "cr2"));
    register_state.Cr3 = (UINT32)json_object_get_uint64(json_object_object_get(registers, "cr3"));
    register_state.Cr4 = (UINT32)json_object_get_uint64(json_object_object_get(registers, "cr4"));

    //64-bit registers are split into two 32-bit parts.
    UINT64 gdtr = json_object_get_uint64(json_object_object_get(registers, "gdtr"));
    register_state.Gdtr[0] = gdtr & 0xFFFFFFFF;
    register_state.Gdtr[1] = gdtr >> 32;
    UINT64 idtr = json_object_get_uint64(json_object_object_get(registers, "idtr"));
    register_state.Idtr[0] = idtr & 0xFFFFFFFF;
    register_state.Idtr[1] = idtr >> 32;

    //16-bit registers.
    register_state.Ldtr = (UINT16)json_object_get_uint64(json_object_object_get(registers, "ldtr"));
    register_state.Tr = (UINT16)json_object_get_uint64(json_object_object_get(registers, "tr"));

    //Write out to stream.
    fwrite(&register_state, sizeof(EFI_CONTEXT_IA32_REGISTER_STATE), 1, out);
    fflush(out);
}

//Converts a single CPER-JSON x64 register array into CPER binary, outputting to the given stream.
void ir_ia32x64_x64_registers_to_cper(json_object* registers, FILE* out)
{
    EFI_CONTEXT_X64_REGISTER_STATE register_state;
    register_state.Rax = json_object_get_uint64(json_object_object_get(registers, "rax"));
    register_state.Rbx = json_object_get_uint64(json_object_object_get(registers, "rbx"));
    register_state.Rcx = json_object_get_uint64(json_object_object_get(registers, "rcx"));
    register_state.Rdx = json_object_get_uint64(json_object_object_get(registers, "rdx"));
    register_state.Rsi = json_object_get_uint64(json_object_object_get(registers, "rsi"));
    register_state.Rdi = json_object_get_uint64(json_object_object_get(registers, "rdi"));
    register_state.Rbp = json_object_get_uint64(json_object_object_get(registers, "rbp"));
    register_state.Rsp = json_object_get_uint64(json_object_object_get(registers, "rsp"));
    register_state.R8 = json_object_get_uint64(json_object_object_get(registers, "r8"));
    register_state.R9 = json_object_get_uint64(json_object_object_get(registers, "r9"));
    register_state.R10 = json_object_get_uint64(json_object_object_get(registers, "r10"));
    register_state.R11 = json_object_get_uint64(json_object_object_get(registers, "r11"));
    register_state.R12 = json_object_get_uint64(json_object_object_get(registers, "r12"));
    register_state.R13 = json_object_get_uint64(json_object_object_get(registers, "r13"));
    register_state.R14 = json_object_get_uint64(json_object_object_get(registers, "r14"));
    register_state.R15 = json_object_get_uint64(json_object_object_get(registers, "r15"));
    register_state.Cs = (UINT16)json_object_get_int(json_object_object_get(registers, "cs"));
    register_state.Ds = (UINT16)json_object_get_int(json_object_object_get(registers, "ds"));
    register_state.Ss = (UINT16)json_object_get_int(json_object_object_get(registers, "ss"));
    register_state.Es = (UINT16)json_object_get_int(json_object_object_get(registers, "es"));
    register_state.Fs = (UINT16)json_object_get_int(json_object_object_get(registers, "fs"));
    register_state.Gs = (UINT16)json_object_get_int(json_object_object_get(registers, "gs"));
    register_state.Resv1 = 0;
    register_state.Rflags = json_object_get_uint64(json_object_object_get(registers, "rflags"));
    register_state.Rip = json_object_get_uint64(json_object_object_get(registers, "eip"));
    register_state.Cr0 = json_object_get_uint64(json_object_object_get(registers, "cr0"));
    register_state.Cr1 = json_object_get_uint64(json_object_object_get(registers, "cr1"));
    register_state.Cr2 = json_object_get_uint64(json_object_object_get(registers, "cr2"));
    register_state.Cr3 = json_object_get_uint64(json_object_object_get(registers, "cr3"));
    register_state.Cr4 = json_object_get_uint64(json_object_object_get(registers, "cr4"));
    register_state.Cr8 = json_object_get_uint64(json_object_object_get(registers, "cr8"));
    register_state.Gdtr[0] = json_object_get_uint64(json_object_object_get(registers, "gdtr_0"));
    register_state.Gdtr[1] = json_object_get_uint64(json_object_object_get(registers, "gdtr_1"));
    register_state.Idtr[0] = json_object_get_uint64(json_object_object_get(registers, "idtr_0"));
    register_state.Idtr[1] = json_object_get_uint64(json_object_object_get(registers, "idtr_1"));
    register_state.Ldtr = (UINT16)json_object_get_int(json_object_object_get(registers, "ldtr"));
    register_state.Tr = (UINT16)json_object_get_int(json_object_object_get(registers, "tr"));

    //Write out to stream.
    fwrite(&register_state, sizeof(EFI_CONTEXT_X64_REGISTER_STATE), 1, out);
    fflush(out);
}