Trust uboot's device list only if it does not look suspicious.
[AROS.git] / test / dos / exit.c
blob2062cacdf21dbbc7c8c94dfda12671cca59513e3
1 #include <proto/exec.h>
2 #include <proto/dos.h>
4 struct DosLibrary *DOSBase;
5 static unsigned int level = 0;
7 void test()
9 Printf("Nest level: %lu\n", ++level);
11 if (level < 20)
12 test();
14 Exit(0);
15 Printf("Exit() did not work!\n");
18 __startup static AROS_PROCH(Start, argstr, argsize, SysBase)
20 AROS_PROCFUNC_INIT
22 struct Process *me;
23 IPTR *stackbase;
25 DOSBase = (struct DosLibrary *)OpenLibrary("dos.library", 36);
26 if (!DOSBase)
27 return RETURN_FAIL;
29 /* Let's check correctness of stack size passing */
30 me = (struct Process *)FindTask(NULL);
31 stackbase = me->pr_ReturnAddr;
32 Printf("Launch stack size is %ld, total size is %ld\n", stackbase[0], me->pr_Task.tc_SPUpper - me->pr_Task.tc_SPLower);
34 test();
36 CloseLibrary(&DOSBase->dl_lib);
37 return RETURN_OK;
39 AROS_PROCFUNC_EXIT