Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
MMU Virtual Address to Physical Address

Description

                              Translation

This section providees functions to support the translation from the virtual address to physical address.

Functions

uintptr_t alt_mmu_va_to_pa (const void *va, uint32_t *seglength, uint32_t *dfsr)
 

Function Documentation

uintptr_t alt_mmu_va_to_pa ( const void *  va,
uint32_t *  seglength,
uint32_t *  dfsr 
)

Given a virtual address, this API attempts to determine the corresponding physical address and segment length. There are no alignment restrictions on the incoming virtual address.

If the translation succeeds, the corresponding physical address will be returned, seglength will be populated with the physical memory segment length, and dfsr will be populated with 0.

If the translation is not possible, dfsr will contain the reason for the translation failure and returned value will be undefined. dfsr is the short-descriptor translation table format of the Data Fault Status Register equivalent value for the translation fault.

For a complete understanding of the DFSR bit field assignments, consult the following reference(s):

  • ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition (ARM DDI 0406C), section B4.1.52 "DFSR, Data Fault Status Register, VMSA"
Parameters
vaThe virtual address to query.
seglength[out] A pointer to the length of the physical address segment corresponding to the given virtual address.
dfsr[out] A pointer to the DFSR value.
Returns
The physical address of the translation if it is successful.