Query: hat_getkpfnum
OS: opensolaris
Section: 9f
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
hat_getkpfnum(9F) Kernel Functions for Drivers hat_getkpfnum(9F)NAMEhat_getkpfnum - get page frame number for kernel addressSYNOPSIS#include <sys/types.h> #include <sys/ddi.h> #include <sys/sunddi.h> pfn_t hat_getkpfnum(caddr_t addr);INTERFACE LEVELThis interface is obsolete. A driver devmap(9E) entry point should be provided instead.PARAMETERSaddr The kernel virtual address for which the page frame number is to be returned.DESCRIPTIONhat_getkpfnum() returns the page frame number corresponding to the kernel virtual address, addr. addr must be a kernel virtual address which maps to device memory. ddi_map_regs(9F) can be used to obtain this address. For example, ddi_map_regs(9F) can be called in the driver's attach(9E) routine. The resulting kernel virtual address can be saved by the driver (see ddi_soft_state(9F)) and used in mmap(9E). The corresponding ddi_unmap_regs(9F) call can be made in the driver's detach(9E) routine. Refer to mmap(9E) for more information.RETURN VALUESThe page frame number corresponding to the valid, device-mapped virtual address addr. Otherwise the return value is undefined.CONTEXThat_getkpfnum() can be called only from user or kernel context.ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface stability |Obsolete | +-----------------------------+-----------------------------+SEE ALSOattach(9E), detach(9E), devmap(9E), mmap(9E), ddi_map_regs(9F), ddi_soft_state(9F), ddi_unmap_regs(9F) Writing Device DriversNOTESFor 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 13 June 2004 hat_getkpfnum(9F)
Related Man Pages |
---|
mmap(9e) - opensolaris |
ddi_unmap_regs(9f) - opensolaris |
hat_getkpfnum(9f) - opensolaris |
hat_getkpfnum(9f) - sunos |
ddi_unmap_regs(9f) - centos |
Similar Topics in the Unix Linux Community |
---|
How to drive a LCD on ARM based linux System |
page fault handle |