Change include style to use system includes
The libcper header files in `libcper` are installed to
`usr/include/libcper`. Use that system includes in `libcper` source
instead of using the project includes.
Change-Id: I596edc2c754dae4829844f535a1e34caa246fb43
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
diff --git a/generator/cper-generate-cli.c b/generator/cper-generate-cli.c
index b0bf14d..c9882c2 100644
--- a/generator/cper-generate-cli.c
+++ b/generator/cper-generate-cli.c
@@ -7,9 +7,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "Cper.h"
-#include "cper-generate.h"
-#include "sections/gen-section.h"
+#include <libcper/Cper.h>
+#include <libcper/generator/cper-generate.h>
+#include <libcper/generator/sections/gen-section.h>
void print_help();
diff --git a/generator/cper-generate.c b/generator/cper-generate.c
index 58f14a3..91eaf41 100644
--- a/generator/cper-generate.c
+++ b/generator/cper-generate.c
@@ -7,10 +7,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "Cper.h"
-#include "gen-utils.h"
-#include "sections/gen-section.h"
-#include "cper-generate.h"
+#include <libcper/Cper.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
+#include <libcper/generator/cper-generate.h>
EFI_ERROR_SECTION_DESCRIPTOR *generate_section_descriptor(char *type,
const size_t *lengths,
diff --git a/generator/cper-generate.h b/generator/cper-generate.h
deleted file mode 100644
index ad196bd..0000000
--- a/generator/cper-generate.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef CPER_GENERATE_H
-#define CPER_GENERATE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include "BaseTypes.h"
-
-void generate_cper_record(char **types, UINT16 num_sections, FILE *out);
-void generate_single_section_record(char *type, FILE *out);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/generator/gen-utils.c b/generator/gen-utils.c
index e69f0b5..03f6b8d 100644
--- a/generator/gen-utils.c
+++ b/generator/gen-utils.c
@@ -5,8 +5,8 @@
**/
#include <stdlib.h>
#include <time.h>
-#include "BaseTypes.h"
-#include "gen-utils.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
//Generates a random section of the given byte size, saving the result to the given location.
//Returns the length of the section as passed in.
diff --git a/generator/gen-utils.h b/generator/gen-utils.h
deleted file mode 100644
index 5a19d85..0000000
--- a/generator/gen-utils.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef CPER_GEN_UTILS_H
-#define CPER_GEN_UTILS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include "BaseTypes.h"
-#include "../common-utils.h"
-
-#define CPER_ERROR_TYPES_KEYS \
- (int[]) \
- { \
- 1, 16, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, \
- 26 \
- }
-
-size_t generate_random_section(void **location, size_t size);
-UINT8 *generate_random_bytes(size_t size);
-void init_random();
-void create_valid_error_section(UINT8 *start);
-UINT8 int_to_bcd(int value);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/generator/sections/gen-section-ampere.c b/generator/sections/gen-section-ampere.c
index 90c521c..3ffe2f5 100644
--- a/generator/sections/gen-section-ampere.c
+++ b/generator/sections/gen-section-ampere.c
@@ -6,9 +6,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random Ampere error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-arm.c b/generator/sections/gen-section-arm.c
index c98bf84..5043741 100644
--- a/generator/sections/gen-section-arm.c
+++ b/generator/sections/gen-section-arm.c
@@ -6,9 +6,9 @@
#include <stdlib.h>
#include <string.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
#define ARM_ERROR_INFO_SIZE 32
void *generate_arm_error_info();
diff --git a/generator/sections/gen-section-ccix-per.c b/generator/sections/gen-section-ccix-per.c
index 7323427..0784d34 100644
--- a/generator/sections/gen-section-ccix-per.c
+++ b/generator/sections/gen-section-ccix-per.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random CCIX PER error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-cxl-component.c b/generator/sections/gen-section-cxl-component.c
index 6d702b4..395defb 100644
--- a/generator/sections/gen-section-cxl-component.c
+++ b/generator/sections/gen-section-cxl-component.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random CXL component error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-cxl-protocol.c b/generator/sections/gen-section-cxl-protocol.c
index 424366d..5139005 100644
--- a/generator/sections/gen-section-cxl-protocol.c
+++ b/generator/sections/gen-section-cxl-protocol.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random CXL protocol error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-dmar.c b/generator/sections/gen-section-dmar.c
index e0ac603..dc34696 100644
--- a/generator/sections/gen-section-dmar.c
+++ b/generator/sections/gen-section-dmar.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random generic DMAr error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-firmware.c b/generator/sections/gen-section-firmware.c
index dd2d69d..e482a6b 100644
--- a/generator/sections/gen-section-firmware.c
+++ b/generator/sections/gen-section-firmware.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random firmware error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-generic.c b/generator/sections/gen-section-generic.c
index 02e2ee5..41c315f 100644
--- a/generator/sections/gen-section-generic.c
+++ b/generator/sections/gen-section-generic.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random generic processor section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-ia32x64.c b/generator/sections/gen-section-ia32x64.c
index e1fb60d..5415f02 100644
--- a/generator/sections/gen-section-ia32x64.c
+++ b/generator/sections/gen-section-ia32x64.c
@@ -6,9 +6,9 @@
#include <stdlib.h>
#include <string.h>
-#include "../../Cper.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/Cper.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
#define IA32X64_ERROR_STRUCTURE_SIZE 64
void *generate_ia32x64_error_structure();
diff --git a/generator/sections/gen-section-memory.c b/generator/sections/gen-section-memory.c
index b573dbd..475d6d0 100644
--- a/generator/sections/gen-section-memory.c
+++ b/generator/sections/gen-section-memory.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random platform memory error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-nvidia.c b/generator/sections/gen-section-nvidia.c
index a505089..3d2b706 100644
--- a/generator/sections/gen-section-nvidia.c
+++ b/generator/sections/gen-section-nvidia.c
@@ -7,9 +7,9 @@
#include <stddef.h>
#include <string.h>
#include <stdio.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random NVIDIA error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-pci-bus.c b/generator/sections/gen-section-pci-bus.c
index decfb53..1e424bf 100644
--- a/generator/sections/gen-section-pci-bus.c
+++ b/generator/sections/gen-section-pci-bus.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random PCI/PCI-X bus error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-pci-dev.c b/generator/sections/gen-section-pci-dev.c
index 58ae95e..999739a 100644
--- a/generator/sections/gen-section-pci-dev.c
+++ b/generator/sections/gen-section-pci-dev.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
//Generates a single pseudo-random PCI component error section, saving the resulting address to the given
//location. Returns the size of the newly created section.
diff --git a/generator/sections/gen-section-pcie.c b/generator/sections/gen-section-pcie.c
index 611ef62..1e1beb7 100644
--- a/generator/sections/gen-section-pcie.c
+++ b/generator/sections/gen-section-pcie.c
@@ -5,9 +5,9 @@
**/
#include <stdlib.h>
-#include "../../BaseTypes.h"
-#include "../gen-utils.h"
-#include "gen-section.h"
+#include <libcper/BaseTypes.h>
+#include <libcper/generator/gen-utils.h>
+#include <libcper/generator/sections/gen-section.h>
#define PCIE_PORT_TYPES \
(int[]) \
diff --git a/generator/sections/gen-section.c b/generator/sections/gen-section.c
index 56b6d84..a5ae40b 100644
--- a/generator/sections/gen-section.c
+++ b/generator/sections/gen-section.c
@@ -3,7 +3,7 @@
*
* Author: Lawrence.Tang@arm.com
**/
-#include "gen-section.h"
+#include <libcper/generator/sections/gen-section.h>
CPER_GENERATOR_DEFINITION generator_definitions[] = {
{ &gEfiProcessorGenericErrorSectionGuid, "generic",
diff --git a/generator/sections/gen-section.h b/generator/sections/gen-section.h
deleted file mode 100644
index 6ce5a88..0000000
--- a/generator/sections/gen-section.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef GEN_SECTIONS_H
-#define GEN_SECTIONS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include "../../Cper.h"
-
-//Section generator function predefinitions.
-size_t generate_section_generic(void **location);
-size_t generate_section_ia32x64(void **location);
-size_t generate_section_arm(void **location);
-size_t generate_section_memory(void **location);
-size_t generate_section_memory2(void **location);
-size_t generate_section_pcie(void **location);
-size_t generate_section_pci_bus(void **location);
-size_t generate_section_pci_dev(void **location);
-size_t generate_section_firmware(void **location);
-size_t generate_section_dmar_generic(void **location);
-size_t generate_section_dmar_vtd(void **location);
-size_t generate_section_dmar_iommu(void **location);
-size_t generate_section_ccix_per(void **location);
-size_t generate_section_cxl_protocol(void **location);
-size_t generate_section_cxl_component(void **location);
-size_t generate_section_nvidia(void **location);
-size_t generate_section_ampere(void **location);
-
-//Definition structure for a single CPER section generator.
-typedef struct {
- EFI_GUID *Guid;
- const char *ShortName;
- size_t (*Generate)(void **);
-} CPER_GENERATOR_DEFINITION;
-
-extern CPER_GENERATOR_DEFINITION generator_definitions[];
-extern const size_t generator_definitions_len;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif