]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/acpi/ghes.h
68f088a92398eb8303945732ca3a141796e02520
[mirror_ubuntu-zesty-kernel.git] / include / acpi / ghes.h
1 #include <acpi/apei.h>
2 #include <acpi/hed.h>
3
4 /*
5 * One struct ghes is created for each generic hardware error source.
6 * It provides the context for APEI hardware error timer/IRQ/SCI/NMI
7 * handler.
8 *
9 * estatus: memory buffer for error status block, allocated during
10 * HEST parsing.
11 */
12 #define GHES_TO_CLEAR 0x0001
13 #define GHES_EXITING 0x0002
14
15 struct ghes {
16 union {
17 struct acpi_hest_generic *generic;
18 struct acpi_hest_generic_v2 *generic_v2;
19 };
20 struct acpi_hest_generic_status *estatus;
21 u64 buffer_paddr;
22 unsigned long flags;
23 union {
24 struct list_head list;
25 struct timer_list timer;
26 unsigned int irq;
27 };
28 };
29
30 struct ghes_estatus_node {
31 struct llist_node llnode;
32 struct acpi_hest_generic *generic;
33 struct ghes *ghes;
34 };
35
36 struct ghes_estatus_cache {
37 u32 estatus_len;
38 atomic_t count;
39 struct acpi_hest_generic *generic;
40 unsigned long long time_in;
41 struct rcu_head rcu;
42 };
43
44 enum {
45 GHES_SEV_NO = 0x0,
46 GHES_SEV_CORRECTED = 0x1,
47 GHES_SEV_RECOVERABLE = 0x2,
48 GHES_SEV_PANIC = 0x3,
49 };
50
51 /* From drivers/edac/ghes_edac.c */
52
53 #ifdef CONFIG_EDAC_GHES
54 void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
55 struct cper_sec_mem_err *mem_err);
56
57 int ghes_edac_register(struct ghes *ghes, struct device *dev);
58
59 void ghes_edac_unregister(struct ghes *ghes);
60
61 #else
62 static inline void ghes_edac_report_mem_error(struct ghes *ghes, int sev,
63 struct cper_sec_mem_err *mem_err)
64 {
65 }
66
67 static inline int ghes_edac_register(struct ghes *ghes, struct device *dev)
68 {
69 return 0;
70 }
71
72 static inline void ghes_edac_unregister(struct ghes *ghes)
73 {
74 }
75 #endif