/** * Functions for generating pseudo-random CPER IA32/x64 sections. * * Author: Lawrence.Tang@arm.com **/ #include #include #include "../../edk/Cper.h" #include "../gen-utils.h" #include "gen-section.h" #define IA32X64_ERROR_STRUCTURE_SIZE 64 void* generate_ia32x64_error_structure(); size_t generate_ia32x64_context_structure(void** location); //Generates a single pseudo-random IA32/x64 section, saving the resulting address to the given //location. Returns the size of the newly created section. size_t generate_section_ia32x64(void** location) { //Set up for generation of error/context structures. UINT16 error_structure_num = rand() % 5; UINT16 context_structure_num = rand() % 5; void* error_structures[error_structure_num]; void* context_structures[context_structure_num]; size_t context_structure_lengths[context_structure_num]; //Generate the structures. for (int i=0; i