SCO OpenServer
init(D2oddi)
init, pminit --
initialize a device during system initialization
Synopsis
void prefixinit(void);
void prefixpminit(void);
Description
The
init( )
entry point routine is executed when the system is initialized,
before system services are available.
It is used to do any required device initialization
as well as to dynamically register the driver.
The
pminit( )
entry point routine is provided for debuggers
so that they are initialized
before other initialization code executes
and can be used to analyze the initialization.
Arguments
None
Return values
None
Usage
The
init( )
routine should do the following:
-
Do bus-specific registration.
PCI buses must be searched first
because it is possible that a device on a PCI bus
may have an IO base address
that is in the EISA/ISA range.
-
Preallocate contiguous memory segments
that will be required by the driver
for operations such as DMA transfers.
-
Initialize data structures required for the driver.
-
If appropriate, register the driver's base level as multithreaded
using the
bdistributed(D3oddi),
cdistributed(D3oddi),
iopolldistributed(D3oddi),
scsi_distributed(D3osdi),
or
sdistributed(D3oddi)
function.
-
If appropriate, call the
idistributed(D3oddi)
or
Sharegister(D3osdi)
function to dynamically register the interrupt vector(s)
and register the driver's interrupt level as multithreaded.
-
Call the
printcfg(D3oddi)
function to display a message on the console
when the device is successfully initialized.
pminit( )
should be used only in debuggers and similar software.
Context and synchronization
Initialization
context.
Most system facilities are not available
and interrupts are turned off.
Hardware applicability
All
Version applicability
oddi:
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
Differences between versions
ODDI version 2 drivers use the
add_intr_handler(D3oddi)
routine to dynamically register interrupts.
ODDI version 3 and later drivers
should use
idistributed( )
or
Sharegister( )
even if the driver's
intr(D2oddi)
routine is not multithreaded.
SVR5 DDI compatibility
When porting drivers to DDI,
the initialization functionality is coded as follows:
DDI 8 and later drivers-
Driver initialization functionality
is coded in the
_load(D2)
entry point routine
and hardware initialization is coded in
the CFG_ADD subfunction to the
config(D2)
entry point routine.
Configuration verification for ISA devices
is coded in the CFG_VERIFY subfunction to the
config(D2)
entry point routine.
DDI 7 and earlier loadable drivers-
Most initialization functionality
for the driver and the hardware is coded in the
_load(D2)
entry point routine.
Configuration verification functionality
for ISA devices is coded in the
_verify(D2)
entry point routine.
Note that all MDI and SDI drivers on SVR5
must be loadable.
See
``Dynamically-loadable kernel modules (DLKM)'' in HDK Technical Reference.
DDI 7 and earlier static (non-loadable) drivers-
Code initialization functionality in the
init(D2)
entry point routine,
which has the same syntax as the ODDI
init( )
routine.
Much of the configuration functionality in the
init( )
routine must be recoded to conform to
DDI functions and conventions for autoconfiguration;
see
``Autoconfiguration''.
External dependencies
Drivers that contain an
init( )
routine must have an I in the function list of the
mdevice(F)
file.
Drivers that contain a
pminit( )
routine must have an P in the function list of the
mdevice(F)
file.
The idtools create an array of
init( )
routines that identify the routines to be called.
References
add_intr_handler(D3oddi),
bdistributed(D3oddi),
cdistributed(D3oddi),
idistributed(D3oddi),
iopolldistributed(D3oddi),
scsi_distributed(D3osdi),
printcfg(D3oddi),
sdistributed(D3oddi),
Sdevregister(D3osdi),
Sharegister(D3osdi),
start(D2oddi)
init(D2mdi),
init(D2osdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005