Microchip Technology SW006023-2N Data Sheet
MPLAB
®
XC32 C/C++ Compiler User’s Guide
DS51686E-page 90
2012 Microchip Technology Inc.
4.5.4
Address Translation Macros
System code may need to translate between virtual and physical addresses, as well as
between kernel segment addresses. Macros are provided to make these translations
easier and to determine the segment an address is in.
between kernel segment addresses. Macros are provided to make these translations
easier and to determine the segment an address is in.
KVA_TO_PA(v)
Translate a kernel virtual address to a physical address.
PA_TO_KVA0(pa)
Translate a physical address to a KSEG0 virtual address.
PA_TO_KVA1(pa)
Translate a physical address to a KSEG1 virtual address.
KVA0_TO_KVA1(v)
Translate a KSEG0 virtual address to a KSEG1 virtual address.
KVA1_TO_KVA0(v)
Translate a KSEG1 virtual address to a KSEG0 virtual address.
IS_KVA(v)
Evaluates to 1 if the address is a kernel segment virtual address, zero
otherwise.
otherwise.
IS_KVA0(v)
Evaluate to 1 if the address is a KSEG0 virtual address, zero otherwise.
IS_KVA1(v)
Evaluate to 1 if the address is a KSEG1 virtual address, zero otherwise.
IS_KVA01(v)
Evaluate to 1 if the address is either a KSEG0 or a KSEG1 virtual
address, zero otherwise.
address, zero otherwise.