summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/ppe/pk/ppe42/pk_panic_codes.h
blob: 0e0796576859a69e4609617a5bb7f16785f917b4 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: import/chips/p9/procedures/ppe/pk/ppe42/pk_panic_codes.h $    */
/*                                                                        */
/* OpenPOWER sbe Project                                                  */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef __PK_PANIC_CODES_H__
#define __PK_PANIC_CODES_H__

// On PPE42, PANIC codes are stored as part of the trap word instruction.
// tw 31, RA, RB  Where RA and RB would used to encode the trap code.
// There are 16 valid gprs on PP42, so this gives 256 possible trap codes.
// The trap code is defined as a two byte code defined as 0xYYZZ where YY
// is encoded into the RA field and ZZ is incoded into the RB field
// YY and ZZ are limited to the values:
//   00,01,02,03,04,05,06,07,08,09,0a,0d,1c,1d,1e,1f (valid gpr ids)
//
// To add a new panic code, select an unused values and rename it.
// This enum contains all the valid values that can be used. Using a
// panic code not in this list will result in a compiler/assembler error.
#ifndef __ASSEMBLER__

typedef enum
{
    PPE42_MACHINE_CHECK_PANIC           = 0x0001,
    PPE42_DATA_STORAGE_PANIC            = 0x0002,
    PPE42_INSTRUCTION_STORAGE_PANIC     = 0x0003,
    PPE42_DATA_ALIGNMENT_PANIC          = 0x0004,
    PK_BOOT_VECTORS_NOT_ALIGNED         = 0x0005,
    PK_DEFAULT_IRQ_HANDLER              = 0x0006,
    PK_DEFAULT_SPECIAL_HANDLER          = 0x0007,
    PPE42_PHANTOM_INTERRUPT             = 0x0008,
    PPE42_ILLEGAL_INSTRUCTION           = 0x0009,
    PK_UNUSED_000a                      = 0x000a,
    PK_UNUSED_000d                      = 0x000d,
    PK_UNUSED_001c                      = 0x001c,
    PK_UNUSED_001d                      = 0x001d,
    PK_UNUSED_001e                      = 0x001e,
    PK_UNUSED_001f                      = 0x001f,

    // API return codes
    PK_ILLEGAL_CONTEXT_THREAD_CONTEXT   = 0x0100,
    PK_ILLEGAL_CONTEXT_INTERRUPT_CONTEXT = 0x0101,
    PK_ILLEGAL_CONTEXT_THREAD           = 0x0102,
    PK_ILLEGAL_CONTEXT_TIMER            = 0x0103,
    PK_INVALID_THREAD_AT_RESUME1        = 0x0104,
    PK_INVALID_THREAD_AT_RESUME2        = 0x0105,
    PK_INVALID_THREAD_AT_SUSPEND1       = 0x0106,
    PK_INVALID_THREAD_AT_SUSPEND2       = 0x0107,
    PK_INVALID_THREAD_AT_DELETE         = 0x0108,
    PK_INVALID_THREAD_AT_INFO           = 0x0109,
    PK_INVALID_THREAD_AT_CHANGE         = 0x010a,
    PK_INVALID_THREAD_AT_SWAP1          = 0x010d,
    PK_INVALID_THREAD_AT_SWAP2          = 0x011c,
    PK_INVALID_THREAD_AT_CREATE         = 0x011d,
    PK_INVALID_SEMAPHORE_AT_POST        = 0x011e,
    PK_INVALID_SEMAPHORE_AT_PEND        = 0x011f,
    PK_INVALID_SEMAPHORE_AT_RELEASE     = 0x0200,
    PK_INVALID_SEMAPHORE_AT_INFO        = 0x0201,
    PK_INVALID_SEMAPHORE_AT_CREATE      = 0x0202,
    PK_INVALID_TIMER_AT_SCHEDULE        = 0x0203,
    PK_INVALID_TIMER_AT_CANCEL          = 0x0204,
    PK_INVALID_TIMER_AT_INFO            = 0x0205,
    PK_INVALID_TIMER_AT_CREATE          = 0x0206,
    PK_INVALID_ARGUMENT_IRQ_SETUP       = 0x0207,
    PK_INVALID_ARGUMENT_IRQ_HANDLER     = 0x0208,
    PK_INVALID_ARGUMENT_INTERRUPT       = 0x0209,
    PK_INVALID_ARGUMENT_CONTEXT_SET     = 0x020a,
    PK_INVALID_ARGUMENT_CONTEXT_GET     = 0x020d,
    PK_INVALID_ARGUMENT_FIT             = 0x021c,
    PK_INVALID_ARGUMENT_WATCHDOG        = 0x021d,
    PK_INVALID_ARGUMENT_INIT            = 0x021e,
    PK_INVALID_ARGUMENT_SEMAPHORE       = 0x021f,
    PK_INVALID_ARGUMENT_THREAD_CHANGE   = 0x0300,
    PK_INVALID_ARGUMENT_THREAD_PRIORITY = 0x0301,
    PK_INVALID_ARGUMENT_THREAD1         = 0x0302,
    PK_INVALID_ARGUMENT_THREAD2         = 0x0303,
    PK_INVALID_ARGUMENT_THREAD3         = 0x0304,
    PK_STACK_OVERFLOW                   = 0x0305,
    PK_TIMER_ACTIVE                     = 0x0306,
    PK_TIMER_NOT_ACTIVE                 = 0x0307,
    PK_PRIORITY_IN_USE_AT_RESUME        = 0x0308,
    PK_PRIORITY_IN_USE_AT_CHANGE        = 0x0309,
    PK_PRIORITY_IN_USE_AT_SWAP          = 0x030a,
    PK_SEMAPHORE_OVERFLOW               = 0x030d,
    PK_SEMAPHORE_PEND_NO_WAIT           = 0x031c,
    PK_SEMAPHORE_PEND_TIMED_OUT         = 0x031d,
    PK_SEMAPHORE_PEND_WOULD_BLOCK       = 0x031e,
    PK_INVALID_DEQUE_SENTINEL           = 0x031f,
    PK_INVALID_DEQUE_ELEMENT            = 0x0400,
    PK_INVALID_OBJECT                   = 0x0401,

    // PK Kernel panics
    PK_NO_TIMER_SUPPORT                 = 0x0402,
    PK_START_THREADS_RETURNED           = 0x0403,
    PK_UNIMPLEMENTED                    = 0x0404,
    PK_SCHEDULING_INVARIANT             = 0x0405,
    PK_TIMER_HANDLER_INVARIANT          = 0x0406,
    PK_THREAD_TIMEOUT_STATE             = 0x0407,

    // PK
    PK_UNUSED_0408                      = 0x0408,
    PK_UNUSED_0409                      = 0x0409,
    PK_UNUSED_040a                      = 0x040a,
    PK_UNUSED_040d                      = 0x040d,
    PK_UNUSED_041c                      = 0x041c,
    PK_UNUSED_041d                      = 0x041d,
    PK_UNUSED_041e                      = 0x041e,
    PK_UNUSED_041f                      = 0x041f,

    // Sync panic codes
    SYNC_INVALID_OBJECT                 = 0x0500,
    SYNC_INVALID_ARGUMENT               = 0x0501,
    SYNC_BARRIER_PEND_TIMED_OUT         = 0x0502,
    SYNC_BARRIER_OVERFLOW               = 0x0503,
    SYNC_BARRIER_UNDERFLOW              = 0x0504,
    SYNC_BARRIER_INVARIANT              = 0x0505,
    SYNC_SHARED_UNDERFLOW               = 0x0506,

    OCCHW_INSTANCE_MISMATCH             = 0x0507,
    OCCHW_IRQ_ROUTING_ERROR             = 0x0508,
    OCCHW_XIR_INVALID_POINTER           = 0x0509,
    OCCHW_XIR_INVALID_GPE               = 0x050a,

    PK_UNUSED_050d                      = 0x050d,
    PK_UNUSED_051c                      = 0x051c,
    PK_UNUSED_051d                      = 0x051d,
    PK_UNUSED_051e                      = 0x051e,
    PK_UNUSED_051f                      = 0x051f,

    PK_UNUSED_0600                      = 0x0600,
    PK_UNUSED_0601                      = 0x0601,
    PK_UNUSED_0602                      = 0x0602,
    PK_UNUSED_0603                      = 0x0603,
    PK_UNUSED_0604                      = 0x0604,
    PK_UNUSED_0605                      = 0x0605,
    PK_UNUSED_0606                      = 0x0606,
    PK_UNUSED_0607                      = 0x0607,
    PK_UNUSED_0608                      = 0x0608,
    PK_UNUSED_0609                      = 0x0609,
    PK_UNUSED_060a                      = 0x060a,
    PK_UNUSED_060d                      = 0x060d,
    PK_UNUSED_061c                      = 0x061c,
    PK_UNUSED_061d                      = 0x061d,
    PK_UNUSED_061e                      = 0x061e,
    PK_UNUSED_061f                      = 0x061f,

    PK_UNUSED_0700                      = 0x0700,
    PK_UNUSED_0701                      = 0x0701,
    PK_UNUSED_0702                      = 0x0702,
    PK_UNUSED_0703                      = 0x0703,
    PK_UNUSED_0704                      = 0x0704,
    PK_UNUSED_0705                      = 0x0705,
    PK_UNUSED_0706                      = 0x0706,
    PK_UNUSED_0707                      = 0x0707,
    PK_UNUSED_0708                      = 0x0708,
    PK_UNUSED_0709                      = 0x0709,
    PK_UNUSED_070a                      = 0x070a,
    PK_UNUSED_070d                      = 0x070d,
    PK_UNUSED_071c                      = 0x071c,
    PK_UNUSED_071d                      = 0x071d,
    PK_UNUSED_071e                      = 0x071e,
    PK_UNUSED_071f                      = 0x071f,

    PK_UNUSED_0800                      = 0x0800,
    PK_UNUSED_0801                      = 0x0801,
    PK_UNUSED_0802                      = 0x0802,
    PK_UNUSED_0803                      = 0x0803,
    PK_UNUSED_0804                      = 0x0804,
    PK_UNUSED_0805                      = 0x0805,
    PK_UNUSED_0806                      = 0x0806,
    PK_UNUSED_0807                      = 0x0807,
    PK_UNUSED_0808                      = 0x0808,
    PK_UNUSED_0809                      = 0x0809,
    PK_UNUSED_080a                      = 0x080a,
    PK_UNUSED_080d                      = 0x080d,
    PK_UNUSED_081c                      = 0x081c,
    PK_UNUSED_081d                      = 0x081d,
    PK_UNUSED_081e                      = 0x081e,
    PK_UNUSED_081f                      = 0x081f,

    PK_UNUSED_0900                      = 0x0900,
    PK_UNUSED_0901                      = 0x0901,
    PK_UNUSED_0902                      = 0x0902,
    PK_UNUSED_0903                      = 0x0903,
    PK_UNUSED_0904                      = 0x0904,
    PK_UNUSED_0905                      = 0x0905,
    PK_UNUSED_0906                      = 0x0906,
    PK_UNUSED_0907                      = 0x0907,
    PK_UNUSED_0908                      = 0x0908,
    PK_UNUSED_0909                      = 0x0909,
    PK_UNUSED_090a                      = 0x090a,
    PK_UNUSED_090d                      = 0x090d,
    PK_UNUSED_091c                      = 0x091c,
    PK_UNUSED_091d                      = 0x091d,
    PK_UNUSED_091e                      = 0x091e,
    PK_UNUSED_091f                      = 0x091f,

    PK_UNUSED_0a00                      = 0x0a00,
    PK_UNUSED_0a01                      = 0x0a01,
    PK_UNUSED_0a02                      = 0x0a02,
    PK_UNUSED_0a03                      = 0x0a03,
    PK_UNUSED_0a04                      = 0x0a04,
    PK_UNUSED_0a05                      = 0x0a05,
    PK_UNUSED_0a06                      = 0x0a06,
    PK_UNUSED_0a07                      = 0x0a07,
    PK_UNUSED_0a08                      = 0x0a08,
    PK_UNUSED_0a09                      = 0x0a09,
    PK_UNUSED_0a0a                      = 0x0a0a,
    PK_UNUSED_0a0d                      = 0x0a0d,
    PK_UNUSED_0a1c                      = 0x0a1c,
    PK_UNUSED_0a1d                      = 0x0a1d,
    PK_UNUSED_0a1e                      = 0x0a1e,
    PK_UNUSED_0a1f                      = 0x0a1f,

    PK_UNUSED_0d00                      = 0x0d00,
    PK_UNUSED_0d01                      = 0x0d01,
    PK_UNUSED_0d02                      = 0x0d02,
    PK_UNUSED_0d03                      = 0x0d03,
    PK_UNUSED_0d04                      = 0x0d04,
    PK_UNUSED_0d05                      = 0x0d05,
    PK_UNUSED_0d06                      = 0x0d06,
    PK_UNUSED_0d07                      = 0x0d07,
    PK_UNUSED_0d08                      = 0x0d08,
    PK_UNUSED_0d09                      = 0x0d09,
    PK_UNUSED_0d0a                      = 0x0d0a,
    PK_UNUSED_0d0d                      = 0x0d0d,
    PK_UNUSED_0d1c                      = 0x0d1c,
    PK_UNUSED_0d1d                      = 0x0d1d,
    PK_UNUSED_0d1e                      = 0x0d1e,
    PK_UNUSED_0d1f                      = 0x0d1f,

    // The following are reserved for instance specific use.
    // Each engine must define its own XXX_panic_codes.h
    // Where XXX = SBE, CME, GPE0, GPE1, PGPE, SGPE
    // They are listed here to show the valid trap values that
    // can be used.

    //_UNUSED_1c00                      = 0x1c00,
    //_UNUSED_1c01                      = 0x1c01,
    //_UNUSED_1c02                      = 0x1c02,
    //_UNUSED_1c03                      = 0x1c03,
    //_UNUSED_1c04                      = 0x1c04,
    //_UNUSED_1c05                      = 0x1c05,
    //_UNUSED_1c06                      = 0x1c06,
    //_UNUSED_1c07                      = 0x1c07,
    //_UNUSED_1c08                      = 0x1c08,
    //_UNUSED_1c09                      = 0x1c09,
    //_UNUSED_1c0a                      = 0x1c0a,
    //_UNUSED_1c0d                      = 0x1c0d,
    //_UNUSED_1c1c                      = 0x1c1c,
    //_UNUSED_1c1d                      = 0x1c1d,
    //_UNUSED_1c1e                      = 0x1c1e,
    //_UNUSED_1c1f                      = 0x1c1f,

    //_UNUSED_1d00                      = 0x1d00,
    //_UNUSED_1d01                      = 0x1d01,
    //_UNUSED_1d02                      = 0x1d02,
    //_UNUSED_1d03                      = 0x1d03,
    //_UNUSED_1d04                      = 0x1d04,
    //_UNUSED_1d05                      = 0x1d05,
    //_UNUSED_1d06                      = 0x1d06,
    //_UNUSED_1d07                      = 0x1d07,
    //_UNUSED_1d08                      = 0x1d08,
    //_UNUSED_1d09                      = 0x1d09,
    //_UNUSED_1d0a                      = 0x1d0a,
    //_UNUSED_1d0d                      = 0x1d0d,
    //_UNUSED_1d1c                      = 0x1d1c,
    //_UNUSED_1d1d                      = 0x1d1d,
    //_UNUSED_1d1e                      = 0x1d1e,
    //_UNUSED_1d1f                      = 0x1d1f,

    //_UNUSED_1e00                      = 0x1e00,
    //_UNUSED_1e01                      = 0x1e01,
    //_UNUSED_1e02                      = 0x1e02,
    //_UNUSED_1e03                      = 0x1e03,
    //_UNUSED_1e04                      = 0x1e04,
    //_UNUSED_1e05                      = 0x1e05,
    //_UNUSED_1e06                      = 0x1e06,
    //_UNUSED_1e07                      = 0x1e07,
    //_UNUSED_1e08                      = 0x1e08,
    //_UNUSED_1e09                      = 0x1e09,
    //_UNUSED_1e0a                      = 0x1e0a,
    //_UNUSED_1e0d                      = 0x1e0d,
    //_UNUSED_1e1c                      = 0x1e1c,
    //_UNUSED_1e1d                      = 0x1e1d,
    //_UNUSED_1e1e                      = 0x1e1e,
    //_UNUSED_1e1f                      = 0x1e1f,

    //_UNUSED_1f00                      = 0x1f00,
    //_UNUSED_1f01                      = 0x1f01,
    //_UNUSED_1f02                      = 0x1f02,
    //_UNUSED_1f03                      = 0x1f03,
    //_UNUSED_1f04                      = 0x1f04,
    //_UNUSED_1f05                      = 0x1f05,
    //_UNUSED_1f06                      = 0x1f06,
    //_UNUSED_1f07                      = 0x1f07,
    //_UNUSED_1f08                      = 0x1f08,
    //_UNUSED_1f09                      = 0x1f09,
    //_UNUSED_1f0a                      = 0x1f0a,
    //_UNUSED_1f0d                      = 0x1f0d,
    //_UNUSED_1f1c                      = 0x1f1c,
    //_UNUSED_1f1d                      = 0x1f1d,
    //_UNUSED_1f1e                      = 0x1f1e,
    //_UNUSED_1f1f                      = 0x1f1f
} pkPanicCode_t;

#else

/// Assembler specific panic codes
#define PPE42_MACHINE_CHECK_PANIC           0x0001
#define PPE42_DATA_STORAGE_PANIC            0x0002
#define PPE42_INSTRUCTION_STORAGE_PANIC     0x0003
#define PPE42_DATA_ALIGNMENT_PANIC          0x0004

#define PK_BOOT_VECTORS_NOT_ALIGNED         0x0005
#define PPE42_ILLEGAL_INSTRUCTION           0x001c



#endif  // __ASSEMBLER__
#endif
OpenPOWER on IntegriCloud