2 Copyright © 1995-2007, 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 *****************************************************************************/
55 /* Make sure segment is freeable */
56 #if AROS_FLAVOUR & AROS_FLAVOUR_BINCOMPAT
57 if (seg
->seg_UC
== 0 || seg
->seg_UC
== 1)
62 struct Segment
*next
, *prev
;
64 next
= BADDR(DOSBase
->dl_ResList
);
71 prev
->seg_Next
= next
->seg_Next
;
75 DOSBase
->dl_ResList
= MKBADDR(next
->seg_Next
);
82 next
= BADDR(next
->seg_Next
);