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