Xenomai
3.0.5
|
Data Fields | |
const char * | name |
Name of the region (informational but required) | |
unsigned long | addr |
Start address of the region. More... | |
size_t | len |
Length (in bytes) of the region. More... | |
int | type |
Type of the region. More... | |
This descriptor defines the characteristics of a memory region declared to the UDD core by the mini-driver. All valid regions should be declared in the udd_device.mem_regions[] array, invalid/unassigned ones should bear the UDD_MEM_NONE type.
The UDD core exposes each region via the mmap(2) interface to the application. To this end, a companion mapper device is created automatically when registering the mini-driver.
The mapper device creates special files in the RTDM namespace for reaching the individual regions, which the application can open then map to its address space via the mmap(2) system call.
For instance, declaring a region of physical memory at index #2 of the memory region array could be done as follows:
This will make such region accessible via the mapper device using the following sequence of code, via the default ->mmap() handler from the UDD core:
unsigned long udd_memregion::addr |
Start address of the region.
This may be a physical or virtual address, depending on the memory type.
size_t udd_memregion::len |
Length (in bytes) of the region.
This value must be PAGE_SIZE aligned.
int udd_memregion::type |
Type of the region.
See the discussion about UDD memory types for possible values.