mpiMapPtrToSymbol
Declaration
MPI_DECL1 MPI_RESULT MPI_DECL2 mpiMapPtrToSymbol(MPIMap mpiMap, const MPIMapPtr *info, MPIMapSymbol *data);
Required Header: map.h
Change History: Added in 04.00.
Description
mpiMapPtrToSymbol determines whether a particular controller memory address and associated mask are represent one of a predefined set of commonly referenced controller memory locations. If the address and mask represent a commonly referenced memory location, then a MPIMapSymbol structure is filled out with information describing that controller memory location.
mpiMapPtrToSymbol is most commonly used to decode memory locations and masks from configuration structures for validating configurations or for saving configurations to a file.
mpiMap | The MPIMap object used to translate addresses |
---|---|
info | A read-only pointer to the MPIMapPtr structure holding the mask and pointer to the controller memory which is interpreted. |
data | A pointer to the MPIMapSymbol where the data representing the memory location is written. |
Return Values |
---|
MPIMapMessageMAP_INVALID |
MPIMessageARG_INVALID |
MPIMapMessageLOCATION_NOT_FOUND |
Sample Code
MPIMap mpiMap; MFWData* firmware; MPIMapSymbol data; MPIMapPtr info; MPI_RESULT returnValue;
/* ... */
/* Obtain information about firmware->SystemData.SampleCounter assuming a mask of 0xFFFFFFFF*/ info.ptr.ul = &firmware->SystemData.SampleCounter; info.mask.ul = 0xFFFFFFFF;
returnValue = mpiMapPtrToSymbol(mpiMap, &info, &data);
/* data.location should be MPIMapSymbolTypeSAMPLE_COUNTER */
/* All elements of data.index should be equal to -1 indicating they are not */ /* needed when describing the sample counter. */
See Also
mpiMapSymbolToPtr | MPIMapSymbol | MPIMapPtr