PHYS_TO_KSEG(9r)PHYS_TO_KSEG(9r)NAMEPHYS_TO_KSEG - General: Converts a physical address to a kernel-
unmapped virtual address
SYNOPSIS
vm_offset_t PHYS_TO_KSEG(
vm_offset_t addr );
ARGUMENTS
Specifies the physical address to convert to a kernel-unmapped virtual
address.
DESCRIPTION
The PHYS_TO_KSEG routine converts a kernel physical address to a ker‐
nel-unmapped virtual address.
EXAMPLE
The following code fragment shows a call to PHYS_TO_KSEG:
. . .
caddr_t virt_addr; [1] unsigned phys_addr; [2]
. . .
virt_addr = PHYS_TO_KSEG(phys_addr); [3]
. . .
Declares a variable to store the virtual address returned by
PHYS_TO_KSEG. Declares a variable to store the physical address. This
address might have been obtained from a call to KSEG_TO_PHYS. Calls
PHYS_TO_KSEG to convert the physical address to a corresponding virtual
address.
RETURN VALUES
Upon successful completion, PHYS_TO_KSEG returns the virtual address
associated with the specified physical address.
SEE ALSO
Routines: IS_KSEG_VA(9r), KSEG_TO_PHYS(9r)PHYS_TO_KSEG(9r)