#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/kdebug.h>
#include <linux/highmem.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <acpi/apei.h>
#include <acpi/ghes.h>
#include "apei-internal.h"
#define HEST_PFX …
int hest_disable;
EXPORT_SYMBOL_GPL(…);
static struct acpi_table_hest *__read_mostly hest_tab;
static struct { … } mces;
static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = …;
static inline bool is_generic_error(struct acpi_hest_header *hest_hdr)
{ … }
static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
{
u16 hest_type = hest_hdr->type;
int len;
if (hest_type >= ACPI_HEST_TYPE_RESERVED)
return 0;
len = hest_esrc_len_tab[hest_type];
if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
struct acpi_hest_ia_corrected *cmc;
cmc = (struct acpi_hest_ia_corrected *)hest_hdr;
len = sizeof(*cmc) + cmc->num_hardware_banks *
sizeof(struct acpi_hest_ia_error_bank);
mces.cmc = cmc;
} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
struct acpi_hest_ia_machine_check *mc;
mc = (struct acpi_hest_ia_machine_check *)hest_hdr;
len = sizeof(*mc) + mc->num_hardware_banks *
sizeof(struct acpi_hest_ia_error_bank);
mces.mc = mc;
} else if (hest_type == ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) {
struct acpi_hest_ia_deferred_check *mc;
mc = (struct acpi_hest_ia_deferred_check *)hest_hdr;
len = sizeof(*mc) + mc->num_hardware_banks *
sizeof(struct acpi_hest_ia_error_bank);
mces.dmc = mc;
}
BUG_ON(len == -1);
return len;
};
static bool is_ghes_assist_struct(struct acpi_hest_header *hest_hdr)
{ … }
apei_hest_func_t;
static int apei_hest_parse(apei_hest_func_t func, void *data)
{ … }
static int __init hest_parse_cmc(struct acpi_hest_header *hest_hdr, void *data)
{ … }
struct ghes_arr { … };
static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
{ … }
static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
{ … }
static int __init hest_ghes_dev_register(unsigned int ghes_count)
{ … }
static int __init setup_hest_disable(char *str)
{ … }
__setup(…);
void __init acpi_hest_init(void)
{ … }