| Current File : //usr/share/man/man9f/ddi_dev_regsize.9f |
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.TH ddi_dev_regsize 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
ddi_dev_regsize \- return the size of a device's register
.SH SYNOPSIS
.LP
.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
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIdip\fR\fR
.ad
.RS 11n
.rt
A pointer to the device's \fBdev_info\fR structure.
.RE
.sp
.ne 2
.mk
.na
\fB\fIrnumber\fR\fR
.ad
.RS 11n
.rt
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
.mk
.na
\fB\fIresultp\fR\fR
.ad
.RS 11n
.rt
Pointer to an integer that holds the size, in bytes, of the described register (if it exists).
.RE
.SH DESCRIPTION
.sp
.LP
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
.sp
.LP
The \fBddi_dev_regsize()\fR function returns:
.sp
.ne 2
.mk
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 15n
.rt
A successful return. The size, in bytes, of the specified register, is set in \fIresultp\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fBDDI_FAILURE\fR\fR
.ad
.RS 15n
.rt
An invalid (nonexistent) register number was specified.
.RE
.SH CONTEXT
.sp
.LP
The \fBddi_dev_regsize()\fR function can be called from user, interrupt, or kernel context.
.SH SEE ALSO
.sp
.LP
\fBddi_dev_nintrs\fR(9F), \fBddi_dev_nregs\fR(9F)
.sp
.LP
\fIWriting Device Drivers for Oracle Solaris 11.2\fR