MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                    hatgetkpfnum(9F)



NAME
     hatgetkpfnum - get page frame number for kernel address

SYNOPSIS
     #include 
     #include 
     #include 

     pfnt hatgetkpfnum(caddrt addr);


INTERFACE LEVEL
     This interface is obsolete. A driver devmap(9E) entry  point
     should be provided instead.

PARAMETERS
     addr     The kernel virtual address for which the page frame
              number is to be returned.


DESCRIPTION
     hatgetkpfnum() returns the page frame number  corresponding
     to the kernel virtual address, addr.


     addr must be a kernel virtual address which maps  to  device
     memory. ddimapregs(9F) can be used to obtain this address.
     For example, ddimapregs(9F) can be called in the  driver's
     attach(9E) routine. The resulting kernel virtual address can
     be saved by the driver (see ddisoftstate(9F)) and used  in
     mmap(9E).  The  corresponding ddiunmapregs(9F) call can be
     made in the driver's detach(9E) routine. Refer  to  mmap(9E)
     for more information.

RETURN VALUES
     The page frame number corresponding to  the  valid,  device-
     mapped  virtual  address addr. Otherwise the return value is
     undefined.

CONTEXT
     hatgetkpfnum() can be called only from user or kernel  con-
     text.

ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:









SunOS 5.11          Last change: 13 June 2004                   1






Kernel Functions for Drivers                    hatgetkpfnum(9F)



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface stability          Obsolete                    
    


SEE ALSO
     attach(9E),      detach(9E),      devmap(9E),      mmap(9E),
     ddimapregs(9F), ddisoftstate(9F), ddiunmapregs(9F)


     Writing Device Drivers

NOTES
     For some devices, mapping  device  memory  in  the  driver's
     attach(9E)  routine  and  unmapping  device  memory  in  the
     driver's detach(9E) routine is a sizeable  drain  on  system
     resources.  This is especially true for devices with a large
     amount of physical address  space.  Refer  to  mmap(9E)  for
     alternative methods.


































SunOS 5.11          Last change: 13 June 2004                   2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™