-
Replace the _INKERNEL definition in the SCO OpenServer 5 driver
to the following:
#define _KERNEL
This must be done
before any header files are #included.
-
Remove #include lines for the
arch.h, bool.h, page.h,
and sys/devreg.h header files.
-
Add a #include <sys/ddi.h> line
after all other #include lines.
See
``Header files''.
-
Device structure allocation is more dynamic in DDI drivers
than it is in SCO OpenServer 5 drivers.
-
Interrupt handlers for DDI 8 drivers
are attached with the
cm_intr_attach(D3)
function rather than
idistributed(D3oddi)
or
add_intr_handler(D3oddi).
Use the
cm_intr_detach(D3)
function to detach interrupts in a DDI 8 driver.
See
``Interrupt handlers, attaching and registering''
for more information.
-
Information such as the I/O address
and the driver's IRQ can be read
using the
cm_getval(D3)
function and the parameters listed on the
cm_params(D5)
manual page.
This information is read from the
resource manager data base.
Note that, for DDI 8 drivers,
calls to
cm_getval( )
must be called as part of a read/write transaction
that is started with the
cm_begin_trans(D3)
function and ended with the
cm_end_trans(D3)
function.
-
The arch variable is not available.
Similar functionality can be coded as follows:
cm_args.cm_param = CM_BRDBUSTYPE ;
cm_args.cm_val = &bustype ;
cm_args.cm_vallen = sizeof(bustype) ;
if (cm_getval(&cm_args) == 0) {
switch (bustype) {
case CM_BUS_MCA :
/* MCA bus */
break ;
case CM_BUS_ISA :
/* ISA bus */
break ;
default :
cmn_err(CE_WARN, "XXinit() bus %x\n", bustype) ;
}
}
-
There are differences in bitfield manipulation
between the compilers on SVR5 and SCO OpenServer 5; see
``Bitfields''.
-
SVR5 drivers should never
access the lbolt parameter directly.
Instead, use the
TICKS(D3)
macros for DDI 8 drivers.
Note that the
TICKS(D3oddi)
macros are also provided for ODDI version 5 and later
for handling lbolt access.
-
drv_getparm(D3)
accesses parameters that define
the maximum possible I/O transfer size,
the value of the maximum STREAMS message size,
the current time,
and a pointer to the credential structure
for the current process.
-
SCO OpenServer 5 drivers that access the time variable
should be recoded to use the
drv_getparm(D3)
function with TIME specified as the first argument.
-
SVR5 uses different conventions for handling
driver errors.
Specifically, each entry-point routine returns
an errno to the calling process
rather than setting
u.u_error
.
The one exception is the
biostart(D2)
entry point routine,
which does not return anything,
but instead sets error information in the
b_error
member of the buf structure.
See
``Error handling''.
-
Several entry-point routines take a pointer to the
uio(D4)
structure which is not part of the SCO OpenServer 5 driver interface.
-
SVR5 uses the cred_t credential structure
rather than traditional UNIX concepts
of UID and GID
to control access to resources.
Calls to the
open( ),
close( ),
read( ),
write( ),
and
ioctl( )
entry point routines take this structure as an argument.
This structure is also pointed to by the
iocblk(D4str)
structure that is passed to the
M_IOCTL(D7str),
M_IOCACK(D7str),
and
M_IOCNAK(D7str)
message types.
Calls to
drv_priv(D3)
and
drv_getparm(D3),
should replace all calls to
suser(D3oddi)
and any explicit checks for effective user ID equal to zero
in driver code.
Note that the SCO OpenServer 5
suser( )
function sets EPERM in u.u_error
if the caller does not have superuser privileges
whereas the DDI functions do not do this.
Adjustments are required for applications
that depend on this behavior.