1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 typedef struct peidx_table {
38 sal_log_processor_info_t *info;
39 struct sal_cpuid_info *id;
40 sal_processor_static_info_t *regs;
41 } peidx_table_t;
42
43 #define peidx_head(p) (((p)->info))
44 #define peidx_mid(p) (((p)->id))
45 #define peidx_bottom(p) (((p)->regs))
46
47 #define peidx_psp(p) (&(peidx_head(p)->proc_state_parameter))
48 #define peidx_field_valid(p) (&(peidx_head(p)->valid))
49 #define peidx_minstate_area(p) (&(peidx_bottom(p)->min_state_area))
50
51 #define peidx_cache_check_num(p) (peidx_head(p)->valid.num_cache_check)
52 #define peidx_tlb_check_num(p) (peidx_head(p)->valid.num_tlb_check)
53 #define peidx_bus_check_num(p) (peidx_head(p)->valid.num_bus_check)
54 #define peidx_reg_file_check_num(p) (peidx_head(p)->valid.num_reg_file_check)
55 #define peidx_ms_check_num(p) (peidx_head(p)->valid.num_ms_check)
56
57 #define peidx_cache_check_idx(p, n) (n)
58 #define peidx_tlb_check_idx(p, n) (peidx_cache_check_idx(p, peidx_cache_check_num(p)) + n)
59 #define peidx_bus_check_idx(p, n) (peidx_tlb_check_idx(p, peidx_tlb_check_num(p)) + n)
60 #define peidx_reg_file_check_idx(p, n) (peidx_bus_check_idx(p, peidx_bus_check_num(p)) + n)
61 #define peidx_ms_check_idx(p, n) (peidx_reg_file_check_idx(p, peidx_reg_file_check_num(p)) + n)
62
63 #define peidx_mod_error_info(p, name, n) \
64 ({ int __idx = peidx_##name##_idx(p, n); \
65 sal_log_mod_error_info_t *__ret = NULL; \
66 if (peidx_##name##_num(p) > n) \
67 __ret = &(peidx_head(p)->info[__idx]); \
68 __ret; })
69
70 #define peidx_cache_check(p, n) peidx_mod_error_info(p, cache_check, n)
71 #define peidx_tlb_check(p, n) peidx_mod_error_info(p, tlb_check, n)
72 #define peidx_bus_check(p, n) peidx_mod_error_info(p, bus_check, n)
73 #define peidx_reg_file_check(p, n) peidx_mod_error_info(p, reg_file_check, n)
74 #define peidx_ms_check(p, n) peidx_mod_error_info(p, ms_check, n)
75
76 #define peidx_check_info(proc, name, n) \
77 ({ \
78 sal_log_mod_error_info_t *__info = peidx_mod_error_info(proc, name, n);\
79 u64 __temp = __info && __info->valid.check_info \
80 ? __info->check_info : 0; \
81 __temp; })
82
83
84
85 typedef struct slidx_list {
86 struct list_head list;
87 sal_log_section_hdr_t *hdr;
88 } slidx_list_t;
89
90 typedef struct slidx_table {
91 sal_log_record_header_t *header;
92 int n_sections;
93 struct list_head proc_err;
94 struct list_head mem_dev_err;
95 struct list_head sel_dev_err;
96 struct list_head pci_bus_err;
97 struct list_head smbios_dev_err;
98 struct list_head pci_comp_err;
99 struct list_head plat_specific_err;
100 struct list_head host_ctlr_err;
101 struct list_head plat_bus_err;
102 struct list_head unsupported;
103 } slidx_table_t;
104
105 #define slidx_foreach_entry(pos, head) \
106 list_for_each_entry(pos, head, list)
107 #define slidx_first_entry(head) \
108 (((head)->next != (head)) ? list_entry((head)->next, typeof(slidx_list_t), list) : NULL)
109 #define slidx_count(slidx, sec) \
110 ({ int __count = 0; \
111 slidx_list_t *__pos; \
112 slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\
113 __count; })
114
115 struct mca_table_entry {
116 int start_addr;
117 int end_addr;
118 };
119
120 extern const struct mca_table_entry *search_mca_tables (unsigned long addr);
121 extern int mca_recover_range(unsigned long);
122 extern void ia64_mlogbuf_dump(void);
123