Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apei-internal.h
Go to the documentation of this file.
1 /*
2  * apei-internal.h - ACPI Platform Error Interface internal
3  * definations.
4  */
5 
6 #ifndef APEI_INTERNAL_H
7 #define APEI_INTERNAL_H
8 
9 #include <linux/cper.h>
10 #include <linux/acpi.h>
11 #include <linux/acpi_io.h>
12 
13 struct apei_exec_context;
14 
16  struct acpi_whea_header *entry);
17 
18 #define APEI_EXEC_INS_ACCESS_REGISTER 0x0001
19 
23 };
24 
36 };
37 
38 void apei_exec_ctx_init(struct apei_exec_context *ctx,
39  struct apei_exec_ins_type *ins_table,
40  u32 instructions,
41  struct acpi_whea_header *action_table,
42  u32 entries);
43 
44 static inline void apei_exec_ctx_set_input(struct apei_exec_context *ctx,
45  u64 input)
46 {
47  ctx->value = input;
48 }
49 
50 static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
51 {
52  return ctx->value;
53 }
54 
55 int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool optional);
56 
57 static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
58 {
59  return __apei_exec_run(ctx, action, 0);
60 }
61 
62 /* It is optional whether the firmware provides the action */
63 static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
64 {
65  return __apei_exec_run(ctx, action, 1);
66 }
67 
68 /* Common instruction implementation */
69 
70 /* IP has been set in instruction function */
71 #define APEI_EXEC_SET_IP 1
72 
74 
75 static inline void apei_unmap_generic_address(struct acpi_generic_address *reg)
76 {
78 }
79 
82 
86  struct acpi_whea_header *entry);
88  struct acpi_whea_header *entry);
90  struct acpi_whea_header *entry);
92  struct acpi_whea_header *entry);
93 int apei_exec_noop(struct apei_exec_context *ctx,
94  struct acpi_whea_header *entry);
97 
99  struct list_head iomem;
101 };
102 
103 static inline void apei_resources_init(struct apei_resources *resources)
104 {
105  INIT_LIST_HEAD(&resources->iomem);
106  INIT_LIST_HEAD(&resources->ioport);
107 }
108 
111  unsigned long start, unsigned long size,
112  bool iomem);
113 int apei_resources_sub(struct apei_resources *resources1,
114  struct apei_resources *resources2);
116  const char *desc);
119  struct apei_resources *resources);
120 
121 struct dentry;
122 struct dentry *apei_get_debugfs_dir(void);
123 
124 #define apei_estatus_for_each_section(estatus, section) \
125  for (section = (struct acpi_hest_generic_data *)(estatus + 1); \
126  (void *)section - (void *)estatus < estatus->data_length; \
127  section = (void *)(section+1) + section->error_data_length)
128 
129 static inline u32 apei_estatus_len(struct acpi_hest_generic_status *estatus)
130 {
131  if (estatus->raw_data_length)
132  return estatus->raw_data_offset + \
133  estatus->raw_data_length;
134  else
135  return sizeof(*estatus) + estatus->data_length;
136 }
137 
138 void apei_estatus_print(const char *pfx,
139  const struct acpi_hest_generic_status *estatus);
140 int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus);
141 int apei_estatus_check(const struct acpi_hest_generic_status *estatus);
142 
143 int apei_osc_setup(void);
144 #endif