#include <sys/types.h> #include <sys/ddi.h>
#define _KERNEL #define _DDI 8The _DDI line gives the ``major'' version number, such as 7 or 8; it does not use full version numbers such as 8.1 or 8mp. These definitions can instead be given as arguments to the -D option of the cc line to compile the driver:
cc -D_KERNEL -D_DDI=8
The _DDI=version definition is optional for DDI versions prior to version 8.
Drivers and STREAMS modules must not call any kernel functions other than the ones described in this section, or corresponding sections Section D3mdi manual pages in Section D3mdi manual pages, Section D3sdi manual pages in Section D3sdi manual pages, and Section D3str manual pages in Section D3str manual pages. Only functions with "Version applicability" that includes the interface version(s) used by the driver or module may be called.
Each function manual page also identifies the ``Context of a driver'' in HDK Technical Referencecontext in which the function can run. The entry point routine manual pages in Section D2mdi manual pages in Section D2mdi manual pages, Section D2sdi manual pages in Section D2sdi manual pages, and Section D2str manual pages in Section D2str manual pages identify the context of each routine. Only functions that are valid for the context of an entry point routine can be used in that routine. This list references articles in ``HDK Technical Reference'' in HDK Technical Reference.