1ddi_device_zero(9F)      Kernel Functions for Drivers      ddi_device_zero(9F)
2
3
4

NAME

6       ddi_device_zero - zero fill the device
7

SYNOPSIS

9       #include <sys/ddi.h>
10       #include <sys/sunddi.h>
11
12
13
14       int ddi_device_zero(ddi_acc_handle_t handle, caddr_t dev_addr,
15            size_t bytecount, ssize_t dev_advcnt, uint_t dev_datasz);
16
17

INTERFACE LEVEL

19       Solaris DDI specific (Solaris DDI).
20

PARAMETERS

22       handle         The  data  access handle returned from setup calls, such
23                      as ddi_regs_map_setup(9F).
24
25
26       dev_addr       Beginning of the device address.
27
28
29       bytecount      Number of bytes to zero.
30
31
32       dev_advcnt     Number of  dev_datasz units to advance on every access.
33
34
35       dev_datasz     The size of each data word. Possible values are  defined
36                      as:
37
38                      DDI_DATA_SZ01_ACC     1 byte data size
39
40
41                      DDI_DATA_SZ02_ACC     2 bytes data size
42
43
44                      DDI_DATA_SZ04_ACC     4 bytes data size
45
46
47                      DDI_DATA_SZ08_ACC     8 bytes data size
48
49
50

DESCRIPTION

52       ddi_device_zero()  function  fills the given, bytecount, number of byte
53       of zeroes to the device register or memory.
54
55
56       The  dev_advcnt argument determines the value of  the  device  address,
57       dev_addr,  on  each  access.   A  value  of  0 will use the same device
58       address,  dev_addr, on every  access. A positive value  increments  the
59       device address in the next access while a negative value decrements the
60       address.  The  device  address  is  incremented  and   decremented   in
61       dev_datasz units.
62
63
64       The  dev_datasz  argument  determines  the  size  of  data word on each
65       access.
66

RETURN VALUES

68       ddi_device_zero() returns:
69
70       DDI_SUCCESS     Successfully zeroed the data.
71
72
73       DDI_FAILURE     The byte count is not a multiple of  dev_datasz.
74
75

CONTEXT

77       ddi_device_zero() can be called from user, kernel,  or  interrupt  con‐
78       text.
79

SEE ALSO

81       ddi_regs_map_free(9F), ddi_regs_map_setup(9F)
82
83
84       Writing Device Drivers
85
86
87
88SunOS 5.11                        25 Sep 1996              ddi_device_zero(9F)
Impressum