Coverage Report

Created: 2017-10-25 09:10

/root/src/xen/xen/drivers/acpi/apei/apei-internal.h
Line
Count
Source (jump to first uncovered line)
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
struct apei_exec_context;
10
11
typedef int (*apei_exec_ins_func_t)(struct apei_exec_context *ctx,
12
            struct acpi_whea_header *entry);
13
14
16
#define APEI_EXEC_INS_ACCESS_REGISTER 0x0001
15
16
struct apei_exec_ins_type {
17
  u32 flags;
18
  apei_exec_ins_func_t run;
19
};
20
21
struct apei_exec_context {
22
  u32 ip;
23
  u64 value;
24
  u64 var1;
25
  u64 var2;
26
  u64 src_base;
27
  u64 dst_base;
28
  struct apei_exec_ins_type *ins_table;
29
  u32 instructions;
30
  struct acpi_whea_header *action_table;
31
  u32 entries;
32
};
33
34
int apei_exec_ctx_init(struct apei_exec_context *ctx,
35
      struct apei_exec_ins_type *ins_table,
36
      u32 instructions,
37
      struct acpi_whea_header *action_table,
38
      u32 entries);
39
40
static inline void apei_exec_ctx_set_input(struct apei_exec_context *ctx,
41
             u64 input)
42
0
{
43
0
  ctx->value = input;
44
0
}
Unexecuted instantiation: erst.c:apei_exec_ctx_set_input
Unexecuted instantiation: hest.c:apei_exec_ctx_set_input
Unexecuted instantiation: apei-base.c:apei_exec_ctx_set_input
45
46
static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
47
3
{
48
3
  return ctx->value;
49
3
}
erst.c:apei_exec_ctx_get_output
Line
Count
Source
47
3
{
48
3
  return ctx->value;
49
3
}
Unexecuted instantiation: hest.c:apei_exec_ctx_get_output
Unexecuted instantiation: apei-base.c:apei_exec_ctx_get_output
50
51
int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
52
53
static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
54
3
{
55
3
  return __apei_exec_run(ctx, action, 0);
56
3
}
erst.c:apei_exec_run
Line
Count
Source
54
3
{
55
3
  return __apei_exec_run(ctx, action, 0);
56
3
}
Unexecuted instantiation: hest.c:apei_exec_run
Unexecuted instantiation: apei-base.c:apei_exec_run
57
58
/* It is optional whether the firmware provides the action */
59
static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
60
0
{
61
0
  return __apei_exec_run(ctx, action, 1);
62
0
}
Unexecuted instantiation: erst.c:apei_exec_run_optional
Unexecuted instantiation: hest.c:apei_exec_run_optional
Unexecuted instantiation: apei-base.c:apei_exec_run_optional
63
64
/* Common instruction implementation */
65
66
/* IP has been set in instruction function */
67
3
#define APEI_EXEC_SET_IP  1
68
69
int __apei_exec_read_register(struct acpi_whea_header *entry, u64 *val);
70
int __apei_exec_write_register(struct acpi_whea_header *entry, u64 val);
71
int apei_exec_read_register(struct apei_exec_context *ctx,
72
          struct acpi_whea_header *entry);
73
int apei_exec_read_register_value(struct apei_exec_context *ctx,
74
          struct acpi_whea_header *entry);
75
int apei_exec_write_register(struct apei_exec_context *ctx,
76
           struct acpi_whea_header *entry);
77
int apei_exec_write_register_value(struct apei_exec_context *ctx,
78
           struct acpi_whea_header *entry);
79
int apei_exec_noop(struct apei_exec_context *ctx,
80
       struct acpi_whea_header *entry);
81
int apei_exec_pre_map_gars(struct apei_exec_context *ctx);
82
int apei_exec_post_unmap_gars(struct apei_exec_context *ctx);
83
84
#endif