2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Add a device to the public list of devices.
8 #include <aros/debug.h>
9 #include <exec/execbase.h>
10 #include <exec/devices.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
18 AROS_LH1(void, AddDevice
,
21 AROS_LHA(struct Device
*, device
,A1
),
24 struct ExecBase
*, SysBase
, 72, Exec
)
27 Adds a given device to the system's device list after checksumming
28 the device vectors. This function is not for general use but
29 (of course) for building devices that don't use exec's MakeLibrary()
33 device - Pointer to a ready for use device structure.
44 RemDevice(), OpenDevice(), CloseDevice()
48 ******************************************************************************/
51 ASSERT_VALID_PTR(device
);
53 /* Just in case the user forgot them */
54 device
->dd_Library
.lib_Node
.ln_Type
=NT_DEVICE
;
55 device
->dd_Library
.lib_Flags
|=LIBF_CHANGED
;
57 /* Build checksum for device vectors */
58 SumLibrary(&device
->dd_Library
);
60 /* Arbitrate for the device list */
63 /* And add the device */
64 Enqueue(&SysBase
->DeviceList
,&device
->dd_Library
.lib_Node
);