|
|
When the Space.c component of a module's Driver Software Package (DSP) is installed, idinstall(1M) stores the module's Space.c file information in /etc/conf/pack.d/module-name/space.c, where module-name is the name of the module being installed.
Package scripts should never access space.c files directly; use the idinstall command instead.
For new modules with entry-type 1 (see Interface(4dsp)), such as DDI 8 drivers, the only parameter defined for the Space.c file is:
#define MODNAME Logical name for the moduleThe rest of this page applies only to entry-type 0 modules.
Entry-type 0 modules may #include the config.h header file, which is a temporary file created in the /etc/conf/cf.d directory during the system reconfiguration process. This file contains #define statements that can be used to specify the following information about the module:
Per module #defines:
--------------------------------------------------------------- #define PRFX Set to 1 if module is configured #define PRFX_MODNAME Logical name for the module #define PRFX_CNTLS Number of configured entries in System file #define PRFX_UNITS Number of subdevices (sum of unit fields) #define PRFX_BMAJORS Number of block major numbers supported #define PRFX_BMAJOR_0 Block major numbers supported; the first major is PRFX_BMAJOR_0, the second PRFX_BMAJOR_1, and so forth #define PRFX_CMAJORS Number of character major numbers supported #define PRFX_CMAJOR_0 Character major numbers supported; the first major is PRFX_CMAJOR_0, the second PRFX_CMAJOR_1, and so forth
PRFX_CNTLS is only generated for non-autoconfig hardware modules (h flag in Master file and autoconf field N in Drvmap file). PRFX_UNITS is not generated for autoconfig drivers (autoconf field Y in Drvmap file). PRFX_BMAJORS is only generated for block device drivers (b flag in Master file). PRFX_CMAJORS is only generated for character device drivers (c flag in Master file).
PRFX_MODNAME is the name from the $name line in the Master file, if any; otherwise, the module-name field is used.
Per instance #defines (PRFX_0 represents the first configured instance, followed by PRFX_1, and so on if more than one instance is configured) are generated for non-autoconfig hardware modules:
---------------------------------------------------------------- #define PRFX_0 Unit field value #define PRFX_0_VECT Interrupt vector used #define PRFX_0_TYPE Interrupt vector type #define PRFX_0_IPL Interrupt priority level #define PRFX_0_SIOA Starting input/output address #define PRFX_0_EIOA Ending input/output address #define PRFX_0_SCMA Starting controller memory address #define PRFX_0_ECMA Ending controller memory address #define PRFX_0_CHAN DMA channel used (-1 if none)
Because the module is installed as an object file, the module itself can not reference the #defines for the configurable device parameters in config.h. However, the module's Space.c is a C language source file, and as such, can define variables which can take on the values of the #defines in config.h. When the next system configuration is built, the idbuild(1M) command uses the list of arguments to cc(1) defined in /etc/conf/cf.d/deflist to compile the module's Space.c file before linking the module to the kernel.
#define PRFX_CHAN DMA channel used (-1 if none) #define PRFX_TYPE Interrupt vector type used #define PRFX_CPUBIND CPU binding for module; -1 if unbound