summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/ddi_map_regs.9f
blob: fb8905d51cc74c278eacfa27975c62c072f4158c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.\" 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.
.\" 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.
.\" 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]
.TH DDI_MAP_REGS 9F "Jan 16, 2006"
.SH NAME
ddi_map_regs, ddi_unmap_regs \- map or unmap registers
.SH SYNOPSIS
.LP
.nf
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>



\fBint\fR \fBddi_map_regs\fR(\fBdev_info_t *\fR\fIdip\fR, \fBuint_t\fR \fIrnumber\fR, \fBcaddr_t *\fR\fIkaddrp\fR,
     \fBoff_t\fR \fIoffset\fR, \fBoff_t\fR \fIlen\fR);
.fi

.LP
.nf
\fBvoid\fR \fBddi_unmap_regs\fR(\fBdev_info_t *\fR\fIdip\fR, \fBuint_t\fR \fIrnumber\fR, \fBcaddr_t *\fR\fIkaddrp\fR,
     \fBoff_t\fR \fIoffset\fR, \fBoff_t\fR \fIlen\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
These interfaces are obsolete. Use \fBddi_regs_map_setup\fR(9F) instead of
\fBddi_map_regs()\fR. Use \fBddi_regs_map_free\fR(9F) instead of
\fBddi_unmap_regs()\fR.
.SH PARAMETERS
.SS "\fBddi_map_regs()\fR"
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 11n
Pointer to the device's dev_info structure.
.RE

.sp
.ne 2
.na
\fB\fIrnumber\fR\fR
.ad
.RS 11n
Register set number.
.RE

.sp
.ne 2
.na
\fB\fIkaddrp\fR\fR
.ad
.RS 11n
Pointer to the base kernel address of the mapped region (set on return).
.RE

.sp
.ne 2
.na
\fB\fIoffset\fR\fR
.ad
.RS 11n
Offset into register space.
.RE

.sp
.ne 2
.na
\fB\fIlen\fR\fR
.ad
.RS 11n
Length to be mapped.
.RE

.SS "\fBddi_unmap_regs()\fR"
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 11n
Pointer to the device's dev_info structure.
.RE

.sp
.ne 2
.na
\fB\fIrnumber\fR\fR
.ad
.RS 11n
Register set number.
.RE

.sp
.ne 2
.na
\fB\fIkaddrp\fR\fR
.ad
.RS 11n
Pointer to the base kernel address of the region to be unmapped.
.RE

.sp
.ne 2
.na
\fB\fIoffset\fR\fR
.ad
.RS 11n
Offset into register space.
.RE

.sp
.ne 2
.na
\fB\fIlen\fR\fR
.ad
.RS 11n
Length to be unmapped.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBddi_map_regs()\fR function maps in the register set given by
\fIrnumber\fR. The register number determines which register set will be mapped
if more than one exists. The base kernel virtual address of the mapped register
set is returned in \fIkaddrp\fR. \fIoffset\fR specifies an offset into the
register space to start from and \fIlen\fR indicates the size of the area to be
mapped. If \fIlen\fR is non-zero, it overrides the length given in the register
set description. See the discussion of the \fBreg\fR property in \fBsbus\fR(5)
and for more information on register set descriptions. If \fIlen\fR and
\fIoffset\fR are 0, the entire space is mapped.
.sp
.LP
The \fBddi_unmap_regs()\fR function undoes mappings set up by
\fBddi_map_regs()\fR. This is provided for drivers preparing to detach
themselves from the system, allowing them to release allocated mappings.
Mappings must be released in the same way they were mapped (a call to
\fBddi_unmap_regs()\fR must correspond to a previous call to
\fBddi_map_regs()\fR). Releasing portions of previous mappings is not allowed.
\fIrnumber\fR determines which register set will be unmapped if more than one
exists. The \fIkaddrp\fR, \fIoffset\fR and \fIlen\fR specify the area to be
unmapped. \fIkaddrp\fR is a pointer to the address returned from
\fBddi_map_regs()\fR; \fIoffset\fR and \fIlen\fR should match what
\fBddi_map_regs()\fR was called with.
.SH RETURN VALUES
.sp
.LP
The \fBddi_map_regs()\fR function returns:
.sp
.ne 2
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 15n
on success.
.RE

.SH CONTEXT
.sp
.LP
These functions can be called from user, interrupt, or kernel context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability 	Obsolete
.TE

.SH SEE ALSO
.sp
.LP
.BR sbus (5),
.BR attributes (7),
.BR ddi_regs_map_free (9F),
.BR ddi_regs_map_setup (9F)
.sp
.LP
\fIWriting Device Drivers\fR