1 /*
2 * File: mca.h
3 * Purpose: Machine check handling specific defines
4 *
5 * Copyright (C) 1999 Silicon Graphics, Inc.
6 * Copyright (C) Vijay Chander (vijay@engr.sgi.com)
7 * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com)
8 */
9
10 /* XXX use this temporary define for MP systems trying to INIT */
11 #define SAL_MPINIT_WORKAROUND
12
13 #ifndef _ASM_IA64_MCA_H
14 #define _ASM_IA64_MCA_H
15
16 #if !defined(__ASSEMBLY__)
17 #include <linux/types.h>
18 #include <asm/param.h>
19 #include <asm/sal.h>
20 #include <asm/processor.h>
21 #include <asm/hw_irq.h>
22
23 /* These are the return codes from all the IA64_MCA specific interfaces */
24 typedef int ia64_mca_return_code_t;
25
26 enum {
27 IA64_MCA_SUCCESS = 0,
28 IA64_MCA_FAILURE = 1
29 };
30
31 #define IA64_MCA_RENDEZ_TIMEOUT (100 * HZ) /* 1000 milliseconds */
32
33 /* Interrupt vectors reserved for MC handling. */
34 #define IA64_MCA_RENDEZ_INT_VECTOR MCA_RENDEZ_IRQ /* Rendez interrupt */
35 #define IA64_MCA_WAKEUP_INT_VECTOR MCA_WAKEUP_IRQ /* Wakeup interrupt */
36 #define IA64_MCA_CMC_INT_VECTOR CMC_IRQ /* Correctable machine check interrupt */
37
38 #define IA64_CMC_INT_DISABLE 0
39 #define IA64_CMC_INT_ENABLE 1
40
41
42 typedef u32 int_vector_t;
43 typedef u64 millisec_t;
44
45 typedef union cmcv_reg_u {
46 u64 cmcv_regval;
47 struct {
48 u64 cmcr_vector : 8;
49 u64 cmcr_reserved1 : 4;
50 u64 cmcr_ignored1 : 1;
51 u64 cmcr_reserved2 : 3;
52 u64 cmcr_mask : 1;
53 u64 cmcr_ignored2 : 47;
54 } cmcv_reg_s;
55
56 } cmcv_reg_t;
57
58 #define cmcv_mask cmcv_reg_s.cmcr_mask
59 #define cmcv_vector cmcv_reg_s.cmcr_vector
60
61
62 #define IA64_MCA_UCMC_HANDLER_SIZE 0x10
63 #define IA64_INIT_HANDLER_SIZE 0x10
64
65 enum {
66 IA64_MCA_RENDEZ_CHECKIN_NOTDONE = 0x0,
67 IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1
68 };
69
70 #define IA64_MAXCPUS 64 /* Need to do something about this */
71
72 /* Information maintained by the MC infrastructure */
73 typedef struct ia64_mc_info_s {
74 u64 imi_mca_handler;
75 size_t imi_mca_handler_size;
76 u64 imi_monarch_init_handler;
77 size_t imi_monarch_init_handler_size;
78 u64 imi_slave_init_handler;
79 size_t imi_slave_init_handler_size;
80 u8 imi_rendez_checkin[IA64_MAXCPUS];
81
82 } ia64_mc_info_t;
83
84 /* Possible rendez states passed from SAL to OS during MCA
85 * handoff
86 */
87 enum {
88 IA64_MCA_RENDEZ_NOT_RQD = 0x0,
89 IA64_MCA_RENDEZ_DONE_WITHOUT_INIT = 0x1,
90 IA64_MCA_RENDEZ_DONE_WITH_INIT = 0x2,
91 IA64_MCA_RENDEZ_FAILURE = -1
92 };
93
94 typedef struct ia64_mca_sal_to_os_state_s {
95 u64 imsto_os_gp; /* GP of the os registered with the SAL */
96 u64 imsto_pal_proc; /* PAL_PROC entry point - physical addr */
97 u64 imsto_sal_proc; /* SAL_PROC entry point - physical addr */
98 u64 imsto_sal_gp; /* GP of the SAL - physical */
99 u64 imsto_rendez_state; /* Rendez state information */
100 u64 imsto_sal_check_ra; /* Return address in SAL_CHECK while going
101 * back to SAL from OS after MCA handling.
102 */
103 } ia64_mca_sal_to_os_state_t;
104
105 enum {
106 IA64_MCA_CORRECTED = 0x0, /* Error has been corrected by OS_MCA */
107 IA64_MCA_WARM_BOOT = -1, /* Warm boot of the system need from SAL */
108 IA64_MCA_COLD_BOOT = -2, /* Cold boot of the system need from SAL */
109 IA64_MCA_HALT = -3 /* System to be halted by SAL */
110 };
111
112 typedef struct ia64_mca_os_to_sal_state_s {
113 u64 imots_os_status; /* OS status to SAL as to what happened
114 * with the MCA handling.
115 */
116 u64 imots_sal_gp; /* GP of the SAL - physical */
117 u64 imots_new_min_state; /* Pointer to structure containing
118 * new values of registers in the min state
119 * save area.
120 */
121 u64 imots_sal_check_ra; /* Return address in SAL_CHECK while going
122 * back to SAL from OS after MCA handling.
123 */
124 } ia64_mca_os_to_sal_state_t;
125
126 typedef int (*prfunc_t)(const char * fmt, ...);
127
128 extern void ia64_mca_init(void);
129 extern void ia64_os_mca_dispatch(void);
130 extern void ia64_os_mca_dispatch_end(void);
131 extern void ia64_mca_ucmc_handler(void);
132 extern void ia64_monarch_init_handler(void);
133 extern void ia64_slave_init_handler(void);
134 extern void ia64_mca_rendez_int_handler(int,void *,struct pt_regs *);
135 extern void ia64_mca_wakeup_int_handler(int,void *,struct pt_regs *);
136 extern void ia64_mca_cmc_int_handler(int,void *,struct pt_regs *);
137 extern void ia64_log_print(int,int,prfunc_t);
138
139 #define PLATFORM_CALL(fn, args) printk("Platform call TBD\n")
140
141 #undef MCA_TEST
142
143 #define IA64_MCA_DEBUG_INFO 1
144
145 #if defined(IA64_MCA_DEBUG_INFO)
146 # define IA64_MCA_DEBUG printk
147 #else
148 # define IA64_MCA_DEBUG
149 #endif
150 #endif /* !__ASSEMBLY__ */
151 #endif /* _ASM_IA64_MCA_H */
152
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.