'\"macro stdmacro
.if n .pH ddi_dki.hat_getkpfn @(#)hat_getkpfn	40.6 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} hat_getkpfnum D3K "" "DKI" "\&"
.if \nX=1 .ds x} hat_getkpfnum D3K "" "DKI"
.if \nX=2 .ds x} hat_getkpfnum D3K "" "\&"
.if \nX=3 .ds x} hat_getkpfnum "" "" "\&"
.TH \*(x}
.IX "\f4hat_getkpfnum\fP(D3K)"
.SH NAME
\f4hat_getkpfnum\f1 \- get page frame number for kernel address
.SH SYNOPSIS
.nf
.na
\f4#include <sys/vm.h>
#include <sys/types.h>
.sp 0.5
u_int hat_getkpfnum(caddr_t \f2addr\f4);\f1
.ad
.fi
.SH ARGUMENT
.RS 0n 10
.IP "\f2addr\f1" 10n
The kernel virtual address for which the page frame number is
to be returned.
.RE
.SH DESCRIPTION
Drivers implementing the \f4mmap\f1(D2K) entry point must return
\f4-1\f1 (for error) or the page frame number corresponding to the
virtual address of the device memory \f2addr\f1.  This frame 
number can be obtained by a call to \f4hat_getkpfnum\f1.
.SH RETURN VALUE
The page frame number corresponding to virtual address \f2addr\f1.
There is no special error return value; invalid addresses
will produce meaningless return values.
.SH LEVEL
Base or interrupt.  Although there is no reason why
\f4hat_getkpfnum\f1 cannot be called at interrupt level, there is no
need since it only needs to be called from \f4mmap\f1(D2K).
.SH SEE ALSO
.na
\f4mmap\f1(D2K),
\f4page_numtopp\f1(D2DK),
\f4page_pptonum\f1(D2DK)
.ad
