SVR5 and SCO OpenServer 5
prefix(D1)
prefix --
driver prefix
Synopsis
int prefixclose();
int prefixopen();
. . .
Description
All DDI 7 and earlier drivers on SVR5
and all &everest drivers;
must define a unique prefix for symbol names.
This enables the driver's named entry points
to be identified by configuration software
and decreases the possibility of global symbol collisions in the kernel.
Usage
A prefix should uniquely reference
the vendor, chip set, or device.
As a general rule, the prefix should closely resemble
the driver's name,
and should preface all error messages that the driver generates
to make it easier for the administrator
to determine the source of a message.
The driver prefix is specified in
the ``prefix'' field of the SVR5 driver's
Master(DSP/4dsp)
file
or the SCO OpenServer 5, driver's
mdevice(F)
file.
On SVR5 the prefix
is limited to 8 alpha-numeric characters.
For drivers that use a named entry point scheme,
the driver's prefix is specified
in a kernel module configuration file for the driver:
Symbol names for named
driver entry points are constructed
by concatenating the driver prefix with the name for the entry point.
DDI 8 drivers use the
drvops(D4)
structure in place of the named entry-point routine;
STREAMS drivers for both SVR5 and SCO OpenServer 5
use the
streamtab(D4str)
structure rather than named entry points.
Coding a driver with a prefix for all global resources
is still a good practice with these drivers.
Examples
A DDI 7 or a SCO OpenServer 5
character device driver
using a driver prefix of ``xyz''
might define the following global functions to be used as its
named entry points:
xyzinit, xyzdevinfo,
xyzopen, xyzclose,
xyzread, xyzwrite,
xyzioctl, and xyzintr.
It would also define the variable xyzdevflag.
Any other static and global symbols defined by this driver should also
begin with ``xyz.''
Hardware applicability
All
Version applicability
ddi: in HDK Technical Reference
1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp
oddi: in HDK Technical Reference
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
External dependencies
References
devflag(D1),
Intro(D2),
drvops(D4)
``Entry-point routines'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005