Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / test / exec / alert.c
blob72cb3d81f6aa897462029bf04997e790343bb0fc
1 /* The main purpose is to test alert address detection and stack trace */
3 #include <aros/asmcall.h>
4 #include <aros/debug.h>
5 #include <exec/alerts.h>
6 #include <exec/interrupts.h>
7 #include <proto/dos.h>
8 #include <proto/exec.h>
10 #include <string.h>
13 * SoftInt is the only way to simulate supervisor mode on hosted AROS.
14 * Of course there's no real privilege level difference, however interrupts
15 * in hosted AROS are running on a simulated supervisor level for internal
16 * purposes (in order to avoid nesting interrupts).
18 AROS_UFH3(void, superAlert,
19 AROS_UFHA(APTR, interruptData, A1),
20 AROS_UFHA(APTR, interruptCode, A5),
21 AROS_UFHA(struct ExecBase *, SysBase, A6))
23 AROS_USERFUNC_INIT
25 D(bug("Supervisor code called\n"));
27 Alert((IPTR)interruptData);
29 AROS_USERFUNC_EXIT
32 struct Interrupt MyInt;
34 int main(int argc, char **argv)
36 IPTR n = AN_InitAPtr;
37 BOOL super = FALSE;
38 int i;
40 for (i = 1; i < argc; i++)
42 if (!stricmp(argv[i], "deadend"))
43 n = AN_BogusExcpt;
44 else if (!stricmp(argv[i], "supervisor"))
45 super = TRUE;
48 if (super)
51 D(bug("Calling supervisor alert...\n"));
53 MyInt.is_Data = (APTR)n;
54 MyInt.is_Code = superAlert;
56 Cause(&MyInt);
58 else
60 Alert(n);
63 return 0;