Hardware Libraries
20.1
Arria 10 SoC Hardware Manager
|
Translation
This section providees functions to support the translation from the virtual address to physical address.
Data Structures | |
struct | ALT_MMU_VA_TO_PA_COALESCE_s |
Typedefs | |
typedef struct ALT_MMU_VA_TO_PA_COALESCE_s | ALT_MMU_VA_TO_PA_COALESCE_t |
Functions | |
uintptr_t | alt_mmu_va_to_pa (const void *va, uint32_t *seglength, uint32_t *dfsr) |
ALT_STATUS_CODE | alt_mmu_va_to_pa_coalesce_begin (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce, const void *va, size_t size) |
ALT_STATUS_CODE | alt_mmu_va_to_pa_coalesce_next (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce, uintptr_t *segpa, uint32_t *segsize) |
ALT_STATUS_CODE | alt_mmu_va_to_pa_coalesce_end (ALT_MMU_VA_TO_PA_COALESCE_t *coalesce) |
struct ALT_MMU_VA_TO_PA_COALESCE_s |
This type defines the structure used by the VA to PA coalescing API. The fields are internal to the coalescing API and thus not documented.
typedef struct ALT_MMU_VA_TO_PA_COALESCE_s ALT_MMU_VA_TO_PA_COALESCE_t |
This type defines the structure used by the VA to PA coalescing API. The fields are internal to the coalescing API and thus not documented.
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):
va | The 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. |
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_begin | ( | ALT_MMU_VA_TO_PA_COALESCE_t * | coalesce, |
const void * | va, | ||
size_t | size | ||
) |
Starts a translation of a Virtual address segment to phyisical segments. This API attemps to coalesce multiple contiguous physical segments and report them back in as few segments as possible.
coalesce | Pointer to the coalescing tracking structure. |
va | Virtual address of the memory to be translated into physical segments and coalesced. |
size | Size of the virtual address segment. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Error in virtual to physical translation. |
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_next | ( | ALT_MMU_VA_TO_PA_COALESCE_t * | coalesce, |
uintptr_t * | segpa, | ||
uint32_t * | segsize | ||
) |
Reports the next coalesced physical segment in the virtual to physical address translation.
coalesce | Pointer to the coalescing tracking structure. |
segpa | [out] The next coalesced physical segment address. |
segsize | [out] The next coalesced physical segment size. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Error in virtual to physical translation. |
ALT_STATUS_CODE alt_mmu_va_to_pa_coalesce_end | ( | ALT_MMU_VA_TO_PA_COALESCE_t * | coalesce | ) |
Completes the coalescing operation. This is used for error detection.
coalesce | Pointer to the coalescing tracking structure. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Incomplete virtual address segment translation. |