DEV_createDevice
2-66
DEV_createDevice returns one of the following status values:
DEV_createDevice calls SYS_error if mdBindDev returns a failure
condition. The device is not created if mdBindDev fails, and
DEV_createDevice returns the IOM error returned by the mdBindDev
failure.
Constraints and
Calling Context
❏
This function cannot be called from a SWI or HWI.
❏
This function can only be used if dynamic memory allocation is
enabled.
❏
The device function table must be consistent with the type specified
in the attrs structure. DSP/BIOS does not check to ensure that the
types are consistent.
Example
Int status;
/* Device attributes of device "/pipe0" */
DEV_Attrs dpiAttrs = {
NULL,
NULL,
DEV_SIOTYPE,
0
};
status = DEV_createDevice("/pipe0", &DPI_FXNS,
(Fxn)DPI_init, &dpiAttrs);
if (status != SYS_OK) {
SYS_abort("Unable to create device");
}
See Also
Constant
Description
SYS_OK
Success.
SYS_EINVAL
A device with the specified name already exists.
SYS_EALLOC
The heap is not large enough to allocate the device.