STREAMS/UX for the HP 9000 Reference Manual

84
STREAMS/UX Multiprocessor Support
Writing MP Scalable Modules and Drivers
drv_info_t structure. Specify a synchronization level in the inst_sync_level
field. The possible values are SQLVL_GLOBAL, SQLVL_ELSEWHERE,
SQLVL_MODULE, SQLVL_QUEUEPAIR and SQLVL_QUEUE. If the
module or driver is using the elsewhere synchronization level, add a sync
name to the inst_sync_info field. Note that a module or driver which uses an
install function for configuration needs an entry in the master file
$DRIVER_INSTALL table. (Do not put an entry in the $DEVICE table if an
install function is used.) The examples below show MP scalable module and
driver install functions.
STRLOG DRIVER
static drv_info_t strlog_drv_info = { /* driver information */
“strlog”, /* name */
“pseudo”, /* class */
DRV_CHAR | DRV_PSEUDO | /* *****NOTE***** DRV_MP_SAFE flag specified */
DRV_MP_SAFE,
-1, /* block major number */
73, /* character major number */
NULL, NULL, Null, /* cdio, gio_private, and cdio_private
structures
}
static drv_ops_t strlog_drv_ops = { /* driver entry points */
NULL, /* open */
NULL, /* close */
NULL, /* strategy */
NULL, /* dump */
NULL, /* psize */
NULL, /* mount */
NULL, /* read */
NULL, /* write */
NULL, /* ioctl */
NULL, /* select */
NULL, /* option1 */
NULL, NULL, NULL, NULL, /* reserved entry points */
0, /* device flags */
}
static streams_info_t strlog_str_info = { /* streams information */
“strlog”, /* name */
73, /* major number */
{&logrinit, &logwinit, NULL, NULL}, /* streamtab */
STR_IS_DEVICE | STR_SYSV4_OPEN | /* *****NOTE***** MGR_IS_MP flag specified */
MGR_IS_MP,
SQLVL_MODULE, /* *****NOTE***** synch level specified */
““, /* elsewhere sync name */
}
}