8 * One struct ghes is created for each generic hardware error source.
9 * It provides the context for APEI hardware error timer/IRQ/SCI/NMI
12 * estatus: memory buffer for error status block, allocated during
15 #define GHES_TO_CLEAR 0x0001
16 #define GHES_EXITING 0x0002
20 struct acpi_hest_generic
*generic
;
21 struct acpi_hest_generic_v2
*generic_v2
;
23 struct acpi_hest_generic_status
*estatus
;
27 struct list_head list
;
28 struct timer_list timer
;
33 struct ghes_estatus_node
{
34 struct llist_node llnode
;
35 struct acpi_hest_generic
*generic
;
39 struct ghes_estatus_cache
{
42 struct acpi_hest_generic
*generic
;
43 unsigned long long time_in
;
49 GHES_SEV_CORRECTED
= 0x1,
50 GHES_SEV_RECOVERABLE
= 0x2,
54 /* From drivers/edac/ghes_edac.c */
56 #ifdef CONFIG_EDAC_GHES
57 void ghes_edac_report_mem_error(struct ghes
*ghes
, int sev
,
58 struct cper_sec_mem_err
*mem_err
);
60 int ghes_edac_register(struct ghes
*ghes
, struct device
*dev
);
62 void ghes_edac_unregister(struct ghes
*ghes
);
65 static inline void ghes_edac_report_mem_error(struct ghes
*ghes
, int sev
,
66 struct cper_sec_mem_err
*mem_err
)
70 static inline int ghes_edac_register(struct ghes
*ghes
, struct device
*dev
)
75 static inline void ghes_edac_unregister(struct ghes
*ghes
)
80 static inline int acpi_hest_get_version(struct acpi_hest_generic_data
*gdata
)
82 return gdata
->revision
>> 8;
85 static inline void *acpi_hest_get_payload(struct acpi_hest_generic_data
*gdata
)
87 if (acpi_hest_get_version(gdata
) >= 3)
88 return (void *)(((struct acpi_hest_generic_data_v300
*)(gdata
)) + 1);
93 static inline int acpi_hest_get_error_length(struct acpi_hest_generic_data
*gdata
)
95 return ((struct acpi_hest_generic_data
*)(gdata
))->error_data_length
;
98 static inline int acpi_hest_get_size(struct acpi_hest_generic_data
*gdata
)
100 if (acpi_hest_get_version(gdata
) >= 3)
101 return sizeof(struct acpi_hest_generic_data_v300
);
103 return sizeof(struct acpi_hest_generic_data
);
106 static inline int acpi_hest_get_record_size(struct acpi_hest_generic_data
*gdata
)
108 return (acpi_hest_get_size(gdata
) + acpi_hest_get_error_length(gdata
));
111 static inline void *acpi_hest_get_next(struct acpi_hest_generic_data
*gdata
)
113 return (void *)(gdata
) + acpi_hest_get_record_size(gdata
);
116 int ghes_notify_sea(void);