summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei/apei-internal.h
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2010-05-18 14:35:19 +0800
committerLen Brown <len.brown@intel.com>2010-05-19 22:41:05 -0400
commit06d65deade9aabba58e0518df86dcd324e86b832 (patch)
tree48214d97e8dc8f8b02f925e98293d041d5353f69 /drivers/acpi/apei/apei-internal.h
parentfab1c23242528771a955c475ef23d99156a71a7f (diff)
ACPI, APEI, UEFI Common Platform Error Record (CPER) header
CPER stands for Common Platform Error Record, it is the hardware error record format used to describe platform hardware error by various APEI tables, such as ERST, BERT and HEST etc. For more information about CPER, please refer to Appendix N of UEFI Specification version 2.3. This patch mainly includes the data structure difinition header file used by other files. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/apei/apei-internal.h')
-rw-r--r--drivers/acpi/apei/apei-internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
index 86e041a42c4..18df1e94027 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -6,6 +6,8 @@
#ifndef APEI_INTERNAL_H
#define APEI_INTERNAL_H
+#include <linux/cper.h>
+
struct apei_exec_context;
typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx,
@@ -92,4 +94,21 @@ int apei_exec_collect_resources(struct apei_exec_context *ctx,
struct dentry;
struct dentry *apei_get_debugfs_dir(void);
+
+#define apei_estatus_for_each_section(estatus, section) \
+ for (section = (struct acpi_hest_generic_data *)(estatus + 1); \
+ (void *)section - (void *)estatus < estatus->data_length; \
+ section = (void *)(section+1) + section->error_data_length)
+
+static inline u32 apei_estatus_len(struct acpi_hest_generic_status *estatus)
+{
+ if (estatus->raw_data_length)
+ return estatus->raw_data_offset + \
+ estatus->raw_data_length;
+ else
+ return sizeof(*estatus) + estatus->data_length;
+}
+
+int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus);
+int apei_estatus_check(const struct acpi_hest_generic_status *estatus);
#endif