2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Remove a device from the public list of devices.
8 #include <aros/config.h>
9 #include <exec/devices.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
13 #include <proto/exec.h>
15 #include "exec_debug.h"
16 #ifndef DEBUG_RemDevice
17 # define DEBUG_RemDevice 0
23 #include <aros/debug.h>
26 /*****************************************************************************
30 AROS_LH1(void, RemDevice
,
33 AROS_LHA(struct Device
*, device
,A1
),
36 struct ExecBase
*, SysBase
, 73, Exec
)
39 Calls the given device's expunge vector, thus trying to delete it.
40 The device may refuse to do so and still be open after this call.
43 device - Pointer to the device structure.
54 AddDevice(), OpenDevice(), CloseDevice()
58 ******************************************************************************/
63 D(bug("RemDevice $%lx (\"%s\") by \"%s\"\n", device
,
64 device
? device
->dd_Library
.lib_Node
.ln_Name
: "(null)",
65 GET_THIS_TASK
->tc_Node
.ln_Name
));
67 /* Arbitrate for the device list */
70 /* Call expunge vector */
71 seglist
= AROS_LVO_CALL1(BPTR
,
72 AROS_LCA(struct Device
*,device
, D0
),
73 struct Device
*,device
,3,
76 Normally you'd expect the device to be expunged if this returns
77 non-zero, but this is only exec which doesn't know anything about
78 seglists - therefore dos.library has to SetFunction() into this
79 vector for the additional functionality.
85 AROS_COMPAT_SETD0(seglist
); /* For m68k compatibility */