Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Kernel Functions for Driversbtopr(9F)


NAME

 btopr - convert size in bytes to size in pages (round up)

SYNOPSIS

 
#include <sys/ddi.h>
unsigned long btopr(unsigned long numbytes);

INTERFACE LEVEL

 

Architecture independent level 1 (DDI/DKI).

PARAMETERS

 
numbytes
Number of bytes.

DESCRIPTION

 

btopr() returns the number of memory pages contained in the specified number of bytes memory, rounded up to the next whole page. For example, if the page size is 2048, then btopr(4096) returns 2, and btopr(4097) returns 3.

RETURN VALUES

 

The return value is always the number of pages. There are no invalid input values, and therefore no error return values.

CONTEXT

 

btopr() can be called from user or interrupt context.

SEE ALSO

 

btop(9F), ddi_btopr(9F), ptob(9F)

Writing Device Drivers


SunOS 5.9Go To TopLast Changed 11 Apr 1991

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.