The names of typed memory regions are derived directly from the names of the asinfo segments. The asinfo section itself describes a hierarchy, and so the naming of typed memory object is a hierarchy. The name may contain intermediate / characters that are considered as path component separators.
Here's a sample system configuration:
Name | Range (start, end) |
---|---|
/memory | 0, 0xFFFFFFFF |
/memory/ram | 0, 0x1FFFFFF |
/memory/ram/sysram | 0x1000, 0x1FFFFFF |
/memory/isa/ram/dma | 0x1000, 0xFFFFFF |
/memory/ram/dma | 0x1000, 0x1FFFFFF |
The name you pass to posix_typed_mem_open() follows the above naming convention. If the name starts with a leading /, an exact match is done. POSIX allows an implementation to define what happens when the name doesn't start with a leading slash; in QNX Neutrino, a tail match is done on the pathname components specified.
Here are some examples of how posix_typed_mem_open() resolves names, using the above sample configuration:
This name: | Resolves to: |
---|---|
/memory | /memory |
/memory/ram | /memory/ram |
/sysram | Fails |
sysram | /memory/ram/sysram |
You can also use ampersands and vertical bars (& and |) between segments to specify intersections and unions, respectively. You can specify an arbitrary number of them; they're evaluated from left to right, but parentheses aren't supported. For example, below4G&sysram gives you the intersection of all physical address ranges for below4G with all physical address ranges for sysram. If you have two memory regions, one being /ram/below4G with addresses from 0 to 4 GB, and the other being /ram/sysram with addresses from 1 GB to 6 GB, then below4G&sysram gives pages in the range 1 GB to 4 GB.