2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Remove a segment from the system list.
9 #include "dos_intern.h"
10 #include <proto/exec.h>
12 /*****************************************************************************
15 #include <dos/dosextens.h>
16 #include <proto/dos.h>
18 AROS_LH1(LONG
, RemSegment
,
21 AROS_LHA(struct Segment
*, seg
, D1
),
24 struct DosLibrary
*, DOSBase
, 131, Dos
)
27 Remove the segment seg from the DOS resident command list.
29 The segment to be removed should be in the list, and should
30 have a usercount of 0. System or internal segment cannot be
31 removed (although they can be replaced).
34 seg - Segment to remove.
37 != 0 Segment was removed
38 == 0 Segment was not removed (not in list, or not free).
47 AddSegment(), FindSegment()
51 *****************************************************************************/
54 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
56 /* Make sure segment is freeable */
57 #if AROS_FLAVOUR & AROS_FLAVOUR_BINCOMPAT
58 if (seg
->seg_UC
== 0 || seg
->seg_UC
== 1)
63 struct Segment
*next
, *prev
;
65 next
= BADDR(DOSBase
->dl_ResList
);
72 prev
->seg_Next
= next
->seg_Next
;
76 DOSBase
->dl_ResList
= MKBADDR(next
->seg_Next
);
83 next
= BADDR(next
->seg_Next
);