|
libdrmconf 0.14.1
A library to program DMR radios.
|
Implements a memory map between physical and virtual codeplug addresses. More...
#include <dm32uv.hh>
Public Member Functions | |
| AddressMap () | |
| Default constructor. | |
| AddressMap (const AddressMap &other)=default | |
| Default copy constructor. | |
| void | map (uint32_t phys, uint32_t virt) |
| Adds an address mapping. | |
| bool | virtualIsMapped (uint32_t virt) const |
Returns true, if the virtual address is mapped. | |
| bool | physicalIsMapped (uint32_t virt) const |
Returns true, if the physical address is mapped. | |
| uint32_t | toVirtual (uint32_t phys) const |
| Maps the given physical address to a virtual codeplug address. | |
| uint32_t | toPhysical (uint32_t virt) const |
| Maps the given virtual codeplug address to a physical memory address. | |
| QList< uint32_t > | mappedPhysical () const |
| Returns the map from physical to virtual addresses, sorted by physical addresses. | |
| QList< uint32_t > | mappedVirtual () const |
| Returns the map from virtual to physical addresses, sorted by virtual addresses. | |
Protected Attributes | |
| QMap< uint32_t, uint32_t > | _toVirtual |
| Holds only the prefix address mapping from physical to virtual addresses. | |
| QMap< uint32_t, uint32_t > | _toPhysical |
| Holds only the prefix address mapping from virtual to physical addresses. | |
Implements a memory map between physical and virtual codeplug addresses.
The addresses, the codeplug is encoded in, are virtual. These codeplug blocks are then written to different physical addresses.
| uint32_t DM32UV::AddressMap::toPhysical | ( | uint32_t | virt | ) | const |
Maps the given virtual codeplug address to a physical memory address.
If virtual address is unknown – that is, not mapped – std::numeric_limits<uint32_t>::max() gets returned.
| uint32_t DM32UV::AddressMap::toVirtual | ( | uint32_t | phys | ) | const |
Maps the given physical address to a virtual codeplug address.
If physical address is unknown – that is, not mapped – std::numeric_limits<uint32_t>::max() gets returned.
|
protected |
Holds only the prefix address mapping from virtual to physical addresses.
That is addr>>12.
|
protected |
Holds only the prefix address mapping from physical to virtual addresses.
That is addr>>12.