An array of structures describing different sections of the system memory map (e.g.,
RAM, SRAM, flash, I/O ranges).
The asinfo (Address Space Information) section consists of an
array of the asinfo structure:
- start
- The first physical address of the range being described.
- end
- The last physical address of the range being described. Note that this is
the actual last byte, not one beyond the end.
- owner
- An offset from the start of the section giving the owner of this entry (its
parent in the tree). It's set to AS_NULL_OFF if
the entry doesn't have an owner (it's at the root of the address
space tree).
- name
- An offset from the start of the strings section of the
system page giving the string name of this entry.
- attr
- A bitfield describing attributes of the address range (see
attr below).
- priority
- Indicates the speed of the memory in the address range. A smaller numbers
mean slower memory. The macro AS_PRIORITY_DEFAULT is defined
to use a default value for this field (currently defined as 100).
- alloc_checker
- Not currently used.
Each entry in the array describes the attributes of one section of address space on
the machine. The memory map has a tree format; that is, an address range can have a
parent. The information in the asinfo structures can be
hard-coded from the system memory map, or read in from the memory controller.
When procnto is managing virtual memory for process address
spaces, it uses the information in asinfo to know from where in
RAM it can allocate memory.
attr
The attr field can have the following bits:
- AS_ATTR_READABLE 0x0001
- Address range is readable.
- AS_ATTR_WRITABLE 0x0002
- Address range is writable.
- AS_ATTR_CACHABLE 0x0004
- Address range can be cached (this bit should be off if you're using device
memory).
- AS_ATTR_VISIBLE 0x0008u
- Other entries can know this entry exists, but not read its contents.
- AS_ATTR_KIDS 0x0010
- Other entries use this entry as their owner.
- Note that the library turns on this bit automatically; you shouldn't specify
it when creating the section.
- AS_ATTR_CONTINUED 0x0020
- There are multiple entries being used to describe one logical address
range. This bit will be on in all but the last entry.
- Note that the library turns on this bit and uses it internally; you
shouldn't specify it when creating the section.
Address space trees
The asinfo section contains trees describing address spaces (where
RAM, ROM, flash, etc. are located).
The general hierarchy for address spaces is:
/memory/memclass/....
or:
/io/memclass/....
or:
/memory/io/memclass/....
The memory or io indicates if this entry describes
something in the memory or in the I/O address space. The third form
(/memory/io/memclass/....) is used on a
machine without separate in/out instructions, and where everything is
memory-mapped.
The memclass is something like ram,
rom, flash, etc. Below
memclass are further classifications, allowing the process
manager to provide typed memory support.