2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Initialize resident modules
8 #include "exec_intern.h"
9 #include <exec/resident.h>
10 #include <proto/exec.h>
12 #include <aros/debug.h>
14 /*****************************************************************************
18 AROS_LH2(void, InitCode
,
21 AROS_LHA(ULONG
, startClass
, D0
),
22 AROS_LHA(ULONG
, version
, D1
),
25 struct ExecBase
*, SysBase
, 12, Exec
)
28 Traverse the ResModules array and InitResident() all modules with
29 versions greater than or equal to version, and of a class equal to
33 startClass - which type of module to start
34 version - a version number
48 *****************************************************************************/
52 IPTR
*list
= SysBase
->ResModules
;
54 D(bug("enter InitCode(0x%x, %d)\n", startClass
, version
));
61 If bit 31 is set, this doesn't point to a Resident module, but
62 to another list of modules.
64 if(*list
& 0x80000000) list
= (IPTR
*)(*list
& 0x7fffffff);
66 if( (((struct Resident
*)*list
)->rt_Version
>= (UBYTE
)version
)
67 && (((struct Resident
*)*list
)->rt_Flags
& (UBYTE
)startClass
) )
69 D(bug("calling InitResident(\"%s\", NULL)\n",
70 ((struct Resident
*)(*list
))->rt_Name
));
71 InitResident((struct Resident
*)*list
, NULL
);
74 D(bug("NOT calling InitResident(\"%s\", NULL)\n",
75 ((struct Resident
*)(*list
))->rt_Name
)
81 D(bug("leave InitCode(0x%x, %d)\n", startClass
, version
));