Naming of typed memory regions

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.

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. POSIX allows an implementation to define what happens when the name doesn't start with a leading slash (/). The resolution rules on opening are as follows:

  1. If the name starts with a leading /, an exact match is done.
  2. The name may contain intermediate / characters. These are considered as path component separators. If multiple path components are specified, they're matched from the bottom up (the opposite of the way filenames are resolved).
  3. If the name doesn't start with a leading /, 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: See:
/memory /memory Rule 1
/memory/ram /memory/ram Rule 2
/sysram Fails  
sysram /memory/ram/sysram Rule 3