Writing Device Drivers

User Space Access Functions

Table B-18 User Space Access Functions

Function Name 

Description 

ddi_copyin 

copy data to a driver buffer 

ddi_copyout 

copy data from a driver 

uiomove 

copy kernel data using uio structure  

ureadc 

add character to a uio structure 

uwritec 

remove a character from a uio structure 

ddi_getiminor 

get kernel internal minor number from an external dev_t  

  

ddi_model_convert_from 

determine data model type mismatch 

IOC_CONVERT_FROM 

determine if there is a need to translate M_IOCTL contents 

STRUCT_DECL 

establish handle to application data in possibly differing data model 

STRUCT_HANDLE 

establish handle to application data in possibly differing data model 

STRUCT_INIT 

establish handle to application data in possibly differing data model 

STRUCT_SET_HANDLE 

establish handle to application data in possibly differing data model 

SIZEOF_PTR 

return size of pointer in specified data model 

SIZEOF_STRUCT 

return size of structure in specified data model 

STRUCT_SIZE 

return size of structure in application data model 

STRUCT_BUF 

return a pointer to the native mode instance of the structure 

STRUCT_FADDR 

return a pointer to the specified field of a structure 

STRUCT_FGET 

return specified field of a structure in application data model 

STRUCT_FGETP 

return specified pointer field of a structure in application data model 

STRUCT_FSET 

set specified field of a structure in application data model 

STRUCT_FSETP 

set specified pointer field of a structure in application data model 

Table B-19 Deprecated User Space Access Functions

Deprecated Functions 

Replacement 

copyin 

ddi_copyin 

copyout 

ddi_copyout