|
@@ -24,6 +24,8 @@
|
|
|
#include "hw/acpi/ghes.h"
|
|
|
#include "hw/acpi/aml-build.h"
|
|
|
#include "qemu/error-report.h"
|
|
|
+#include "hw/acpi/generic_event_device.h"
|
|
|
+#include "hw/nvram/fw_cfg.h"
|
|
|
|
|
|
#define ACPI_GHES_ERRORS_FW_CFG_FILE "etc/hardware_errors"
|
|
|
#define ACPI_GHES_DATA_ADDR_FW_CFG_FILE "etc/hardware_errors_addr"
|
|
@@ -213,3 +215,15 @@ void acpi_build_hest(GArray *table_data, BIOSLinker *linker)
|
|
|
build_header(linker, table_data, (void *)(table_data->data + hest_start),
|
|
|
"HEST", table_data->len - hest_start, 1, NULL, NULL);
|
|
|
}
|
|
|
+
|
|
|
+void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,
|
|
|
+ GArray *hardware_error)
|
|
|
+{
|
|
|
+ /* Create a read-only fw_cfg file for GHES */
|
|
|
+ fw_cfg_add_file(s, ACPI_GHES_ERRORS_FW_CFG_FILE, hardware_error->data,
|
|
|
+ hardware_error->len);
|
|
|
+
|
|
|
+ /* Create a read-write fw_cfg file for Address */
|
|
|
+ fw_cfg_add_file_callback(s, ACPI_GHES_DATA_ADDR_FW_CFG_FILE, NULL, NULL,
|
|
|
+ NULL, &(ags->ghes_addr_le), sizeof(ags->ghes_addr_le), false);
|
|
|
+}
|