xref: /linux/arch/alpha/kernel/err_impl.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 /*
2  *	linux/arch/alpha/kernel/err_impl.h
3  *
4  *	Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
5  *
6  *	Contains declarations and macros to support Alpha error handling
7  * 	implementations.
8  */
9 
10 #include <asm/mce.h>
11 
12 union el_timestamp;
13 struct el_subpacket;
14 struct ev7_lf_subpackets;
15 
16 struct el_subpacket_annotation {
17 	struct el_subpacket_annotation *next;
18 	u16 class;
19 	u16 type;
20 	u16 revision;
21 	char *description;
22 	char **annotation;
23 };
24 #define SUBPACKET_ANNOTATION(c, t, r, d, a) {NULL, (c), (t), (r), (d), (a)}
25 
26 struct el_subpacket_handler {
27 	struct el_subpacket_handler *next;
28 	u16 class;
29 	struct el_subpacket *(*handler)(struct el_subpacket *);
30 };
31 #define SUBPACKET_HANDLER_INIT(c, h) {NULL, (c), (h)}
32 
33 /*
34  * Manipulate a field from a register given it's name. defines
35  * for the LSB (__S - shift count) and bitmask (__M) are required
36  *
37  * EXTRACT(u, f) - extracts the field and places it at bit position 0
38  * GEN_MASK(f) - creates an in-position mask for the field
39  */
40 #define EXTRACT(u, f) (((u) >> f##__S) & f##__M)
41 #define GEN_MASK(f) ((u64)f##__M << f##__S)
42 
43 /*
44  * err_common.c
45  */
46 extern char *err_print_prefix;
47 
48 extern void mchk_dump_mem(void *, size_t, char **);
49 extern void mchk_dump_logout_frame(struct el_common *);
50 extern void el_print_timestamp(union el_timestamp *);
51 extern void el_process_subpackets(struct el_subpacket *, int);
52 extern struct el_subpacket *el_process_subpacket(struct el_subpacket *);
53 extern void el_annotate_subpacket(struct el_subpacket *);
54 extern void cdl_check_console_data_log(void);
55 extern int cdl_register_subpacket_annotation(struct el_subpacket_annotation *);
56 extern int cdl_register_subpacket_handler(struct el_subpacket_handler *);
57 
58 /*
59  * err_ev7.c
60  */
61 extern struct ev7_lf_subpackets *
62 ev7_collect_logout_frame_subpackets(struct el_subpacket *,
63 				    struct ev7_lf_subpackets *);
64 extern void ev7_register_error_handlers(void);
65 extern void ev7_machine_check(unsigned long, unsigned long);
66 
67 /*
68  * err_ev6.c
69  */
70 extern void ev6_register_error_handlers(void);
71 extern int ev6_process_logout_frame(struct el_common *, int);
72 extern void ev6_machine_check(unsigned long, unsigned long);
73 
74 /*
75  * err_marvel.c
76  */
77 extern void marvel_machine_check(unsigned long, unsigned long);
78 extern void marvel_register_error_handlers(void);
79 
80 /*
81  * err_titan.c
82  */
83 extern int titan_process_logout_frame(struct el_common *, int);
84 extern void titan_machine_check(unsigned long, unsigned long);
85 extern void titan_register_error_handlers(void);
86 extern int privateer_process_logout_frame(struct el_common *, int);
87 extern void privateer_machine_check(unsigned long, unsigned long);
88