1ptob(9F) Kernel Functions for Drivers ptob(9F)
2
3
4
6 ptob - convert size in pages to size in bytes
7
9 #include <sys/ddi.h>
10
11
12
13 unsigned long ptob(unsigned long numpages);
14
15
17 Architecture independent level 1 (DDI/DKI).
18
20 numpages Size in number of pages to convert to size in bytes.
21
22
24 This function returns the number of bytes that are contained in the
25 specified number of pages. For example, if the page size is 2048, then
26 ptob(2) returns 4096. ptob(0) returns 0.
27
29 The return value is always the number of bytes in the specified number
30 of pages. There are no invalid input values, and no checking will be
31 performed for overflow in the case of a page count whose corresponding
32 byte count cannot be represented by an unsigned long. Rather, the
33 higher order bits will be ignored.
34
36 The ptob() function can be called from user, interrupt, or kernel con‐
37 text.
38
40 btop(9F), btopr(9F), ddi_ptob(9F)
41
42
43 Writing Device Drivers
44
45
46
47SunOS 5.11 16 Jan 2006 ptob(9F)