2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Display an alert.
8 #include <exec/execbase.h>
9 #include <aros/libcall.h>
12 #include <exec/alerts.h>
13 #include <proto/exec.h>
15 /*****************************************************************************
22 AROS_LHA(ULONG
, alertNum
, D7
),
25 struct ExecBase
*, SysBase
, 18, Exec
)
28 Alerts the user of a serious system problem.
31 alertNum - This is a number which contains information about
32 the reason for the call.
35 This routine may return, if the alert is not a dead-end one.
38 You should not call this routine because it halts the machine,
39 displays the message and then may reboot it.
42 // Dead-End alert: 680x0 Access To Odd Address
52 26-08-95 digulla created after EXEC-Routine
54 ******************************************************************************/
57 static const char * CPUStrings
[] =
59 "Hardware bus fault/access error",
60 "Illegal address access (ie: odd)",
61 "Illegal instruction",
63 "Check instruction error",
64 "TrapV instruction error",
65 "Privilege violation error",
67 "Line 1010 Emulator error",
68 "Line 1111 Emulator error",
69 "Stack frame format error",
70 "Spurious interrupt error",
71 "AutoVector Level 1 interrupt error",
72 "AutoVector Level 2 interrupt error",
73 "AutoVector Level 3 interrupt error",
74 "AutoVector Level 4 interrupt error",
75 "AutoVector Level 5 interrupt error",
76 "AutoVector Level 6 interrupt error",
77 "AutoVector Level 7 interrupt error",
79 * GenPurposeStrings
[] =
164 "68000 exception vector checksum",
166 "Library checksum failure",
169 "Corrupt memory list detected in FreeMem",
170 "No memory for interrupt servers",
171 "InitStruct() of an APTR source",
172 "A semaphore is in an illegal state at ReleaseSemaphore",
174 "Freeing memory already freed",
175 "Illegal 68k exception taken",
176 "Attempt to reuse active IORequest",
177 "Sanity check on memory list failed",
179 "IO attempted on closed IORequest",
180 "Stack appears to extend out of range",
181 "Memory header not located. (Usually an invalid address passed to FreeMem())",
182 "An attempt was made to use the old message semaphores",
188 # define GetSubSysId(a) (((a) >> 24) & 0x7F)
189 # define GetGenError(a) (((a) >> 16) & 0xFF)
190 # define GetSpecError(a) ((a) & 0xFFFF)
192 task
= FindTask (NULL
);
194 /* since this is an emulation, we just show the bug in the console */
196 , "\x07" "GURU Meditation %04lx %04lx\n"
201 if (alertNum
& 0x80000000)
210 switch (GetSubSysId (alertNum
))
212 case 0: /* CPU/OS/App */
213 if (GetGenError (alertNum
) == 0)
219 if (GetSpecError (alertNum
) >= 2 && GetSpecError (alertNum
) <= 0x1F)
222 , CPUStrings
[GetSpecError (alertNum
) - 2]
229 else if (GetGenError (alertNum
) <= 0x0B)
233 , GenPurposeStrings
[GetGenError (alertNum
) - 1]
236 if (GetSpecError (alertNum
) >= 0x8001
237 && GetSpecError (alertNum
) <= 0x8035)
241 , AlertObjects
[GetSpecError (alertNum
) - 0x8001]
257 if (!GetGenError (alertNum
)
258 && GetSpecError (alertNum
) >= 0x0001
259 && GetSpecError (alertNum
) <= 0x0010)
263 , ExecStrings
[GetSpecError (alertNum
) - 0x0001]
275 case 2: /* Graphics */
277 , "Graphics/*unknown*"
284 , "*unknown*/*unknown*"
289 , "\nTask: %p (%s)\n"
291 , (task
&& task
->tc_Node
.ln_Name
) ?
292 task
->tc_Node
.ln_Name
293 : "-- unknown task --"
297 if (alertNum
& AT_DeadEnd
)