2 .\" Copyright (c) 1996, Sun Microsystems, Inc All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DDI_DEVICE_ZERO 9F "Sep 25, 1996"
8 ddi_device_zero \- zero fill the device
13 #include <sys/sunddi.h>
17 \fBint\fR \fBddi_device_zero\fR(\fBddi_acc_handle_t\fR \fIhandle\fR, \fBcaddr_t\fR \fIdev_addr\fR,
18 \fBsize_t\fR \fIbytecount\fR, \fBssize_t\fR \fIdev_advcnt\fR, \fBuint_t\fR \fIdev_datasz\fR);
24 Solaris DDI specific (Solaris DDI).
32 The data access handle returned from setup calls, such as
33 \fBddi_regs_map_setup\fR(9F).
42 Beginning of the device address.
48 \fB\fIbytecount\fR \fR
51 Number of bytes to zero.
57 \fB\fIdev_advcnt\fR \fR
60 Number of \fIdev_datasz\fR units to advance on every access.
66 \fB\fIdev_datasz\fR \fR
69 The size of each data word. Possible values are defined as:
73 \fB\fBDDI_DATA_SZ01_ACC\fR \fR
82 \fB\fBDDI_DATA_SZ02_ACC\fR \fR
91 \fB\fBDDI_DATA_SZ04_ACC\fR \fR
100 \fB\fBDDI_DATA_SZ08_ACC\fR \fR
111 \fBddi_device_zero()\fR function fills the given, \fIbytecount\fR, number of
112 byte of zeroes to the device register or memory.
115 The \fIdev_advcnt\fR argument determines the value of the device address,
116 \fIdev_addr\fR, on each access. A value of \fB0\fR will use the same device
117 address, \fIdev_addr\fR, on every access. A positive value increments the
118 device address in the next access while a negative value decrements the
119 address. The device address is incremented and decremented in \fIdev_datasz\fR
123 The \fIdev_datasz\fR argument determines the size of data word on each access.
127 \fBddi_device_zero()\fR returns:
131 \fB\fBDDI_SUCCESS\fR \fR
134 Successfully zeroed the data.
140 \fB\fBDDI_FAILURE\fR \fR
143 The byte count is not a multiple of \fIdev_datasz\fR.
149 \fBddi_device_zero()\fR can be called from user, kernel, or interrupt context.
153 \fBddi_regs_map_free\fR(9F), \fBddi_regs_map_setup\fR(9F)
156 \fIWriting Device Drivers\fR