Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_poke.9f
blob2809917ced445fd541e6d684e9100de9848c1905
1 '\" te
2 .\"  Copyright (c) 2006, 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_POKE 9F "Jan 16, 2006"
7 .SH NAME
8 ddi_poke, ddi_poke8, ddi_poke16, ddi_poke32, ddi_poke64, ddi_pokec, ddi_pokes,
9 ddi_pokel, ddi_poked \- write a value to a location
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/ddi.h>
14 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_poke8\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint8_t\fR \fI*addr\fR, \fBint8_t\fR \fIvalue\fR);
19 .fi
21 .LP
22 .nf
23 \fBint\fR \fBddi_poke16\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint16_t\fR \fI*addr\fR, \fBint16_t\fR \fIvalue\fR);
24 .fi
26 .LP
27 .nf
28 \fBint\fR \fBddi_poke32\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint32_t\fR \fI*addr\fR, \fBint32_t\fR \fIvalue\fR);
29 .fi
31 .LP
32 .nf
33 \fBint\fR \fBddi_poke64\fR(\fBdev_info_t\fR \fI*dip\fR, \fBint64_t\fR \fI*addr\fR, \fBint64_t\fR \fIvalue\fR);
34 .fi
36 .SH INTERFACE LEVEL
37 .sp
38 .LP
39 Solaris DDI specific (Solaris DDI). The \fBddi_pokec()\fR, \fBddi_pokes()\fR,
40 \fBddi_pokel()\fR, and \fBddi_poked()\fR functions are obsolete. Use,
41 respectively, \fBddi_poke8()\fR, \fBddi_poke16()\fR, \fBddi_poke32()\fR, and
42 \fBddi_poke64()\fR, instead.
43 .SH PARAMETERS
44 .sp
45 .ne 2
46 .na
47 \fB\fIdip\fR\fR
48 .ad
49 .RS 9n
50 A pointer to the device's \fBdev_info\fR structure.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fIaddr\fR\fR
57 .ad
58 .RS 9n
59 Virtual address of the location to be written to.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fIvalue\fR\fR
66 .ad
67 .RS 9n
68 Value to be written to the location.
69 .RE
71 .SH DESCRIPTION
72 .sp
73 .LP
74 These routines cautiously attempt to write a value to a specified virtual
75 address, using the parent nexus driver to assist in the process where
76 necessary.
77 .sp
78 .LP
79 If the address is not valid, or the value cannot be written without an error
80 occurring, an error code is returned.
81 .sp
82 .LP
83 These routines are most useful when first trying to establish the presence of a
84 given device on the system in a driver's \fBprobe\fR(9E) or \fBattach\fR(9E)
85 routines.
86 .sp
87 .LP
88 On multiprocessing machines these routines can be extremely heavy-weight, so
89 use the \fBddi_peek\fR(9F) routines instead if possible.
90 .SH RETURN VALUES
91 .sp
92 .ne 2
93 .na
94 \fB\fBDDI_SUCCESS\fR\fR
95 .ad
96 .RS 15n
97 The value was successfully written to the given virtual address.
98 .RE
101 .ne 2
103 \fB\fBDDI_FAILURE\fR\fR
105 .RS 15n
106 An error occurred while trying to write to the location.
109 .SH CONTEXT
112 These functions can be called from user, interrupt, or kernel context.
113 .SH SEE ALSO
116 \fBattach\fR(9E), \fBprobe\fR(9E), \fBddi_peek\fR(9F)
119 \fIWriting Device Drivers\fR
120 .SH NOTES
123 The functions described in this manual page previously used symbolic names
124 which specified their data access size; the function names have been changed so
125 they now specify a fixed-width data size. See the following table for the new
126 name equivalents:
131 box;
132 l l
133 l l .
134 \fBPrevious Name\fR     \fBNew Name\fR
135 \fBddi_pokec\fR \fBddi_poke8\fR
136 \fBddi_pokes\fR \fBddi_poke16\fR
137 \fBddi_pokel\fR \fBddi_poke32\fR
138 \fBddi_poked\fR \fBddi_poke64\fR