9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / ddi_device_zero.9f
blob45ba71be76b0e5480433527e69b4536dae52556f
1 '\" te
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"
7 .SH NAME
8 ddi_device_zero \- zero fill the device
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/ddi.h>
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);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Solaris DDI specific (Solaris DDI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIhandle\fR \fR
30 .ad
31 .RS 15n
32 The data access handle returned from setup calls, such as
33 \fBddi_regs_map_setup\fR(9F).
34 .RE
36 .sp
37 .ne 2
38 .na
39 \fB\fIdev_addr\fR \fR
40 .ad
41 .RS 15n
42 Beginning of the device address.
43 .RE
45 .sp
46 .ne 2
47 .na
48 \fB\fIbytecount\fR \fR
49 .ad
50 .RS 15n
51 Number of bytes to zero.
52 .RE
54 .sp
55 .ne 2
56 .na
57 \fB\fIdev_advcnt\fR \fR
58 .ad
59 .RS 15n
60 Number of  \fIdev_datasz\fR units to advance on every access.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fIdev_datasz\fR \fR
67 .ad
68 .RS 15n
69 The size of each data word. Possible values are defined as:
70 .sp
71 .ne 2
72 .na
73 \fB\fBDDI_DATA_SZ01_ACC\fR \fR
74 .ad
75 .RS 22n
76 1 byte data size
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBDDI_DATA_SZ02_ACC\fR \fR
83 .ad
84 .RS 22n
85 2 bytes data size
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fBDDI_DATA_SZ04_ACC\fR \fR
92 .ad
93 .RS 22n
94 4 bytes data size
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBDDI_DATA_SZ08_ACC\fR \fR
102 .RS 22n
103 8 bytes data size
108 .SH DESCRIPTION
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
120 units.
123 The \fIdev_datasz\fR argument determines the size of data word on each access.
124 .SH RETURN VALUES
127 \fBddi_device_zero()\fR returns:
129 .ne 2
131 \fB\fBDDI_SUCCESS\fR \fR
133 .RS 16n
134 Successfully zeroed the data.
138 .ne 2
140 \fB\fBDDI_FAILURE\fR \fR
142 .RS 16n
143 The byte count is not a multiple of  \fIdev_datasz\fR.
146 .SH CONTEXT
149 \fBddi_device_zero()\fR can be called from user, kernel, or interrupt context.
150 .SH SEE ALSO
153 \fBddi_regs_map_free\fR(9F), \fBddi_regs_map_setup\fR(9F)
156 \fIWriting Device Drivers\fR