2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Add a library to the public list of libraries.
8 #include <aros/debug.h>
9 #include <exec/execbase.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 /*****************************************************************************
17 AROS_LH1(void, AddLibrary
,
20 AROS_LHA(struct Library
*, library
,A1
),
23 struct ExecBase
*, SysBase
, 66, Exec
)
26 Adds a given library to the system's library list after checksumming
27 the library vectors. This function is not for general use but
28 (of course) for building shared librarys that don't use exec's
29 MakeLibrary() mechanism.
32 library - Pointer to a ready for use library structure.
37 Some old Amiga software expects that AddLibrary returns the
38 library which was just added. When in binary compatibility mode
46 RemLibrary(), MakeLibrary(), MakeFunctions(), InitStruct(), SumLibrary().
50 ******************************************************************************/
54 ASSERT_VALID_PTR(library
);
56 /* Just in case the user forgot them */
57 library
->lib_Node
.ln_Type
=NT_LIBRARY
;
58 library
->lib_Flags
|=LIBF_CHANGED
;
60 /* Build checksum for library vectors */
63 /* Arbitrate for the library list */
66 /* And add the library */
67 Enqueue(&SysBase
->LibList
,&library
->lib_Node
);
71 #if (AROS_FLAVOUR & AROS_FLAVOUR_BINCOMPAT)
73 Kludge to force the library to register d0.
74 Some libraries seem to use this side effect in
78 /* Put the library base in register d0 */
79 register struct Library
*ret
__asm("d0") = library
;
81 /* Make sure the above assignment isn't optimized away */
82 __asm
__volatile("": : "r" (ret
));