2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include "dos_intern.h"
9 #include <proto/exec.h>
10 #include <aros/libcall.h>
11 #include <aros/asmcall.h>
12 #include <exec/libraries.h>
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(BOOL
, InternalUnLoadSeg
,
22 AROS_LHA(BPTR
, seglist
, D1
),
23 AROS_LHA(VOID_FUNC
, freefunc
, A1
),
26 struct DosLibrary
*, DOSBase
, 127, Dos
)
44 *****************************************************************************/
52 #if AROS_MODULES_DEBUG
53 extern struct MinList debug_seglist
;
54 extern struct MinList free_debug_segnodes
;
55 struct debug_segnode
*segnode
;
58 ForeachNode(&debug_seglist
, segnode
)
60 if (segnode
->seglist
== seglist
)
62 /* use the same free function as loadseg ! */
64 while ((si
= (struct seginfo
*)REMHEAD(&segnode
->seginfos
)))
66 AROS_CALL2NR(void, freefunc
,
67 AROS_LCA(APTR
, (APTR
)si
, A1
),
68 AROS_LCA(ULONG
, (ULONG
)sizeof(struct seginfo
), D0
),
69 struct Library
*, (struct Library
*)SysBase
74 ADDHEAD(&free_debug_segnodes
, segnode
);
83 next
= *(BPTR
*)BADDR(seglist
);
85 AROS_CALL2NR(void, freefunc
,
86 AROS_LCA(APTR
, (BPTR
*)((LONG
)BADDR(seglist
) - sizeof(ULONG
)), A1
),
87 AROS_LCA(ULONG
, *(LONG
*)((LONG
)BADDR(seglist
) - sizeof(ULONG
)), D0
),
88 struct Library
*, (struct Library
*)SysBase
99 } /* InternalUnLoadSeg */