0001
0002
0003
0004
0005
0006 #ifndef ACPI_APEI_H
0007 #define ACPI_APEI_H
0008
0009 #include <linux/acpi.h>
0010 #include <linux/cper.h>
0011 #include <asm/ioctls.h>
0012
0013 #define APEI_ERST_INVALID_RECORD_ID 0xffffffffffffffffULL
0014
0015 #define APEI_ERST_CLEAR_RECORD _IOW('E', 1, u64)
0016 #define APEI_ERST_GET_RECORD_COUNT _IOR('E', 2, u32)
0017
0018 #ifdef __KERNEL__
0019
0020 enum hest_status {
0021 HEST_ENABLED,
0022 HEST_DISABLED,
0023 HEST_NOT_FOUND,
0024 };
0025
0026 extern int hest_disable;
0027 extern int erst_disable;
0028 #ifdef CONFIG_ACPI_APEI_GHES
0029 extern bool ghes_disable;
0030 void __init acpi_ghes_init(void);
0031 #else
0032 #define ghes_disable 1
0033 static inline void acpi_ghes_init(void) { }
0034 #endif
0035
0036 #ifdef CONFIG_ACPI_APEI
0037 void __init acpi_hest_init(void);
0038 #else
0039 static inline void acpi_hest_init(void) { }
0040 #endif
0041
0042 int erst_write(const struct cper_record_header *record);
0043 ssize_t erst_get_record_count(void);
0044 int erst_get_record_id_begin(int *pos);
0045 int erst_get_record_id_next(int *pos, u64 *record_id);
0046 void erst_get_record_id_end(void);
0047 ssize_t erst_read(u64 record_id, struct cper_record_header *record,
0048 size_t buflen);
0049 ssize_t erst_read_record(u64 record_id, struct cper_record_header *record,
0050 size_t buflen, size_t recordlen, const guid_t *creatorid);
0051 int erst_clear(u64 record_id);
0052
0053 int arch_apei_enable_cmcff(struct acpi_hest_header *hest_hdr, void *data);
0054 void arch_apei_report_mem_error(int sev, struct cper_sec_mem_err *mem_err);
0055
0056 #endif
0057 #endif