summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/ddi_dev_regsize.9f
blob: c43b5ec48c5a436daab3639885b3c0a26e68a53a (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
'\" 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_DEV_REGSIZE 9F "Jan 16, 2006"
.SH NAME
ddi_dev_regsize \- return the size of a device's register
.SH SYNOPSIS
.nf
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>



\fBint\fR \fBddi_dev_regsize\fR(\fBdev_info_t *\fR\fIdip\fR, \fBuint_t\fR \fIrnumber\fR, \fBoff_t *\fR\fIresultp\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 11n
A pointer to the device's \fBdev_info\fR structure.
.RE

.sp
.ne 2
.na
\fB\fIrnumber\fR\fR
.ad
.RS 11n
The ordinal register number. Device registers are associated with a
\fBdev_info\fR and are enumerated in arbitrary sets from \fB0\fR on up. The
number of registers a device has can be determined from a call to
\fBddi_dev_nregs\fR(9F).
.RE

.sp
.ne 2
.na
\fB\fIresultp\fR\fR
.ad
.RS 11n
Pointer to an integer that holds the size, in bytes, of the described register
(if it exists).
.RE

.SH DESCRIPTION
The \fBddi_dev_regsize()\fR function returns the size, in bytes, of the device
register specified by \fIdip\fR and \fIrnumber\fR. This is useful when, for
example, one of the registers is a frame buffer with a varying size known only
to its proms.
.SH RETURN VALUES
The \fBddi_dev_regsize()\fR function returns:
.sp
.ne 2
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 15n
A successful return. The size, in bytes, of the specified register, is set in
\fIresultp\fR.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FAILURE\fR\fR
.ad
.RS 15n
An invalid (nonexistent) register number was specified.
.RE

.SH CONTEXT
The \fBddi_dev_regsize()\fR function can be called from user, interrupt, or
kernel context.
.SH SEE ALSO
.BR ddi_dev_nintrs (9F),
.BR ddi_dev_nregs (9F)
.sp
.LP
\fIWriting Device Drivers\fR