/**
 * Functions for generating pseudo-random CPER PCIe error sections.
 *
 * Author: Lawrence.Tang@arm.com
 **/

#include <stdlib.h>
#include <libcper/BaseTypes.h>
#include <libcper/generator/gen-utils.h>
#include <libcper/generator/sections/gen-section.h>

#define PCIE_PORT_TYPES                                                        \
	(int[])                                                                \
	{                                                                      \
		0, 1, 4, 5, 6, 7, 8, 9, 10                                     \
	}

//Generates a single pseudo-random PCIe error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
size_t generate_section_pcie(void **location)
{
	//Create random bytes.
	int size = 208;
	UINT8 *bytes = generate_random_bytes(size);

	//Set reserved areas to zero.
	UINT64 *validation = (UINT64 *)bytes;
	*validation &= 0xFF;   //Validation 8-63
	UINT32 *version = (UINT32 *)(bytes + 12);
	*version &= 0xFFFF;    //Version bytes 2-3
	UINT32 *reserved = (UINT32 *)(bytes + 20);
	*reserved = 0;	       //Reserved bytes 20-24
	*(bytes + 37) &= ~0x7; //Device ID byte 13 bits 0-3
	*(bytes + 39) = 0;     //Device ID byte 15

	//Set expected values.
	int minor = rand() % 128;
	int major = rand() % 128;
	*version = int_to_bcd(minor);
	*version |= int_to_bcd(major) << 8;

	//Fix values that could be above range.
	UINT32 *port_type = (UINT32 *)(bytes + 8);
	*port_type = PCIE_PORT_TYPES[rand() %
				     (sizeof(PCIE_PORT_TYPES) / sizeof(int))];

	//Set return values, exit.
	*location = bytes;
	return size;
}
