2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 Desc: Utility Resident and initialization.
9 #include <aros/symbolsets.h>
12 #include LC_LIBDEFS_FILE
14 extern ULONG
AROS_SLIB_ENTRY(SMult32_020
,Utility
)();
15 extern ULONG
AROS_SLIB_ENTRY(UMult32_020
,Utility
)();
16 extern ULONG
AROS_SLIB_ENTRY(SMult64_020
,Utility
)();
17 extern ULONG
AROS_SLIB_ENTRY(UMult64_020
,Utility
)();
18 extern ULONG
AROS_SLIB_ENTRY(SDivMod32_020
,Utility
)();
19 extern ULONG
AROS_SLIB_ENTRY(UDivMod32_020
,Utility
)();
21 #define SetFunc(a,b) SetFunction((struct Library *)LIBBASETYPE, a * -LIB_VECTSIZE, AROS_SLIB_ENTRY(b,Utility))
23 static int UtilityInit(LIBBASETYPEPTR LIBBASE
)
25 GetIntUtilityBase(LIBBASE
)->ub_LastID
= 0;
28 I no longer allocate memory here for the global namespace, since
29 that is not quite legal. (AllocMem is not Forbid() protected).
31 Also makes this a little bit shorter. (In time and length).
33 InitSemaphore(&GetIntUtilityBase(LIBBASE
)->ub_NameSpace
.ns_Lock
);
34 NEWLIST((struct List
*)&GetIntUtilityBase(LIBBASE
)->ub_NameSpace
.ns_List
);
35 GetIntUtilityBase(LIBBASE
)->ub_NameSpace
.ns_Flags
= NSF_NODUPS
;
37 #if defined(__mc68000__)
38 /* Are we running on a m68020 or higher?
39 If so we should setfunction all the relevant functions to use
42 if(SysBase
->AttnFlags
& AFF_68020
)
45 SetFunc(23, SMult32_020);
46 SetFunc(24, UMult32_020);
47 SetFunc(25, SDivMod32_020);
48 SetFunc(26, UDivMod32_020);
52 /* The 060 doesn't have some of the instructions I use... */
53 if((SysBase
->AttnFlags
& AFF_68060
) == 0)
55 SetFunc(33, SMult64_020
);
56 SetFunc(34, UMult64_020
);
65 ADD2INITLIB(UtilityInit
, 0);