*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> KSEG_TO_PHYS (9r)              
Title
Content
Arch
Section
 

KSEG_TO_PHYS(9r)

Contents


NAME    [Toc]    [Back]

       KSEG_TO_PHYS - General: Converts a kernel-unmapped virtual
       address to a physical address

SYNOPSIS    [Toc]    [Back]

       vm_offset_t KSEG_TO_PHYS(
               vm_offset_t addr );

ARGUMENTS    [Toc]    [Back]

       Specifies the buffer virtual address to convert to a physical
 address.

DESCRIPTION    [Toc]    [Back]

       The  KSEG_TO_PHYS  routine converts a kernel-unmapped virtual
 address to a kernel physical address. Device  drivers
       can  use this physical address in DMA operations. Prior to
       calling KSEG_TO_PHYS, device driver writers often call one
       of the following routines to determine whether the address
       passed is a virtual address in the addressed  kernel  segment:
 IS_KSEG_VA

              Determines  if  the specified address is located in
              the kernel-unmapped address space.  IS_SEG0_VA

              Determines if the specified address is  located  in
              the user-mapped address space.  IS_SEG1_VA

              Determines  if  the specified address is located in
              the kernel-mapped address space.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion, KSEG_TO_PHYS returns the physical
 address.

EXAMPLE    [Toc]    [Back]

       The following code fragment shows a call to KSEG_TO_PHYS:

       .  .  .

       caddr_t virt_addr;  [1] unsigned phys_addr; [2]

       .  .  .

           if(IS_KSEG_VA(virt_addr)) { [3]
               phys_addr = KSEG_TO_PHYS(virt_addr); [4]

       .  .  .


       Declares  a  variable  to  store the user buffer's virtual
       address.   Declares  a  variable  to  store  the  physical
       address   returned   by   KSEG_TO_PHYS.    Before  calling
       KSEG_TO_PHYS, calls IS_KSEG_VA to determine if the virtual
       address is from the kernel-unmapped address space.  If the
       virtual address is from the kernel-unmapped address space,
       then calls KSEG_TO_PHYS to convert the address to a corresponding
 physical address.





SEE ALSO    [Toc]    [Back]

      
      
       Routines: IS_KSEG_VA(9r), PHYS_TO_KSEG(9r)



                                                 KSEG_TO_PHYS(9r)
[ Back ]
 Similar pages
Name OS Title
svatophys Tru64 General: Converts a system virtual address to a physical address
vtop Tru64 General: Converts any virtual address to a physical address
copy_to_phys Tru64 General: Copies data from a virtual address to a physical address
PHYS_TO_KSEG Tru64 General: Converts a physical address to a
pmap_map FreeBSD map a physical memory range into kernel virtual address (KVA) space
pmap_extract FreeBSD map a virtual address to a physical page
pmap_extract_and_hold FreeBSD map a virtual address to a physical page
pmap_change_wiring FreeBSD change physical wiring for a map or virtual address pair
pmap_mincore FreeBSD determine if a virtual address is resident in physical memory
copyoutstr Tru64 General: Copies a null-terminated string from a kernel address space to a user address space
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service