Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / btopr.9f
blob048b579ab85b230adb52aa02e87426c7bd144ae8
1 '\" te
2 .\"  Copyright 1989 AT&T
3 .\"  Copyright (c) 2006, Sun Microsystems, Inc.  All Rights Reserved
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH BTOPR 9F "Jan 16, 2006"
8 .SH NAME
9 btopr \- convert size in bytes to size in pages (round up)
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/ddi.h>
17 \fBunsigned long\fR \fBbtopr\fR(\fBunsigned long\fR \fInumbytes\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Architecture independent level 1 (DDI/DKI).
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fInumbytes\fR\fR
29 .ad
30 .RS 12n
31 Number of bytes.
32 .RE
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBbtopr()\fR function returns the number of memory pages contained in the
38 specified number of bytes memory, rounded up to the next whole page. For
39 example, if the page size is 2048, then \fBbtopr(4096)\fR returns \fB2\fR, and
40 \fBbtopr(4097)\fR returns \fB3\fR.
41 .SH RETURN VALUES
42 .sp
43 .LP
44 The return value is always the number of pages. There are no invalid input
45 values, and therefore no error return values.
46 .SH CONTEXT
47 .sp
48 .LP
49 The \fBbtopr()\fR function can be called from user, interrupt, or kernel
50 context.
51 .SH SEE ALSO
52 .sp
53 .LP
54 \fBbtop\fR(9F), \fBddi_btopr\fR(9F), \fBptob\fR(9F)
55 .sp
56 .LP
57 \fIWriting Device Drivers\fR