1btop(9F)                 Kernel Functions for Drivers                 btop(9F)
2
3
4

NAME

6       btop - convert size in bytes to size in pages (round down)
7

SYNOPSIS

9       #include <sys/ddi.h>
10
11
12
13       unsigned long btop(unsigned long numbytes);
14
15

INTERFACE LEVEL

17       Architecture independent level 1 (DDI/DKI).
18

PARAMETERS

20       numbytes    Number of bytes.
21
22

DESCRIPTION

24       The  btop()  function  returns the number of memory pages that are con‐
25       tained in the specified number of bytes, with downward rounding in  the
26       case  that  the  byte count is not a page multiple. For example, if the
27       page size is 2048, then btop(4096) returns 2, and btop(4097) returns  2
28       as well. btop(0) returns 0.
29

RETURN VALUES

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

CONTEXT

35       The btop() function can be called from user, interrupt, or kernel  con‐
36       text.
37

SEE ALSO

39       btopr(9F), ddi_btop(9F), ptob(9F)
40
41
42       Writing Device Drivers
43
44
45
46SunOS 5.11                        16 Jan 2006                         btop(9F)
Impressum