'\"macro stdmacro
.if n .pH ddi_dki.btop @(#)btop	40.5 of 10/10/89
.\" Copyright 1989 AT&T
.de IX
.ie '\\n(.z'' .tm .Index: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9	\\n%
.el \\!.IX \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
..
.nr X
.if \nX=0 .ds x} btop D3DK "" "DDI/DKI" "\&"
.if \nX=1 .ds x} btop D3DK "" "DDI/DKI"
.if \nX=2 .ds x} btop D3DK "" "\&"
.if \nX=3 .ds x} btop "" "" "\&"
.TH \*(x}
.IX "\f4btop\fP(D3DK)"
.SH NAME
\f4btop\f1 \- convert size in bytes to size in pages (round down)
.SH SYNOPSIS
.nf
.na
\f4#include <sys/ddi.h>
.sp 0.5
unsigned long btop(\f4unsigned long \f2numbytes\f4);\f1
.ad
.fi
.SH ARGUMENT
.RS 0n 15
.IP "\f2numbytes\f1" 10n
Number of bytes.
.RE
.SH DESCRIPTION
The \f4btop\f1 function returns the number of memory pages that are contained
in the specified number of bytes, with downward rounding in the case
that the byte count is not a page multiple.  For example, if the
page size is 2048, then \f4btop(4096)\f1 returns \f42\f1, 
and \f4btop(4097)\f1 returns \f42\f1 as
well.  \f4btop(0)\f1 returns \f40\f1.
.SH RETURN VALUE
The return value is always the number of pages.
There are no invalid input values, and therefore no error return values.
.SH LEVEL
Base or Interrupt
.SH SEE ALSO
.na
\f4btopr\f1(D3DK),
\f4ptob\f1(D3DK)
.ad
