2 Copyright © 1995-2013, 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>
13 #include <proto/kernel.h>
15 #include <proto/dos.h>
17 /* See rom/dos/internalunloadseg.c for documentation */
19 AROS_LH2(BOOL
, InternalUnLoadSeg
,
20 AROS_LHA(BPTR
, seglist
, D1
),
21 AROS_LHA(VOID_FUNC
, freefunc
, A1
),
22 struct DosLibrary
*, DOSBase
, 127, Dos
)
30 APTR KernelBase
= OpenResource("kernel.resource");
34 next
= *(BPTR
*)BADDR(seglist
);
36 char *seg
= (ULONG
)seglist
;
37 seg
+= (*(LONG
*)((LONG
)BADDR(seglist
) - sizeof(ULONG
))) / 2;
39 KrnUnregisterModule(seg
);
41 AROS_CALL2NR(void, freefunc
,
42 AROS_LCA(APTR
, (BPTR
*)((LONG
)BADDR(seglist
) - sizeof(ULONG
)), A1
),
43 AROS_LCA(ULONG
, *(LONG
*)((LONG
)BADDR(seglist
) - sizeof(ULONG
)), D0
),
44 struct Library
*, (struct Library
*)SysBase
55 } /* InternalUnLoadSeg */