FreeNOS
Public Types | Public Member Functions | Protected Attributes
MemoryMap Class Reference

Describes virtual memory map layout. More...

#include <MemoryMap.h>

Inheritance diagram for MemoryMap:
ARMMap IntelMap

Public Types

enum  Region {
  KernelData, KernelPrivate, UserData, UserHeap,
  UserStack, UserPrivate, UserShare, UserArgs
}
 Memory regions. More...
 
typedef enum MemoryMap::Region Region
 Memory regions. More...
 

Public Member Functions

 MemoryMap ()
 Constructor. More...
 
 MemoryMap (const MemoryMap &map)
 Copy Constructor. More...
 
Memory::Range range (Region region) const
 Get memory range for the given region. More...
 
void setRange (Region region, Memory::Range range)
 Set memory range for the given region. More...
 

Protected Attributes

Memory::Range m_regions [MEMORYMAP_MAX_REGIONS]
 Memory ranges. More...
 

Detailed Description

Describes virtual memory map layout.

Todo:
Currently the total supported system memory is limited to 1GiB

Definition at line 38 of file MemoryMap.h.

Member Typedef Documentation

◆ Region

Memory regions.

Various memory regions which are available on the system. Memory regions are labels which refer to predefined virtual memory ranges. The virtual memory address range of each region depends on the architecture implementation and can be obtained with region().

See also
region

Member Enumeration Documentation

◆ Region

Memory regions.

Various memory regions which are available on the system. Memory regions are labels which refer to predefined virtual memory ranges. The virtual memory address range of each region depends on the architecture implementation and can be obtained with region().

See also
region
Enumerator
KernelData 

< Kernel program data from libexec, e.g.

code, bss, (ro)data

KernelPrivate 

< Kernel dynamic memory mappings

UserData 

< User program data from libexec, e.g.

code, bss, (ro)data

UserHeap 

< User heap

UserStack 

< User stack

UserPrivate 

< User private dynamic memory mappings

UserShare 

< User shared dynamic memory mappings

UserArgs 

< Used for copying program arguments and file descriptors

Definition at line 52 of file MemoryMap.h.

Constructor & Destructor Documentation

◆ MemoryMap() [1/2]

MemoryMap::MemoryMap ( )

Constructor.

Definition at line 20 of file MemoryMap.cpp.

◆ MemoryMap() [2/2]

MemoryMap::MemoryMap ( const MemoryMap map)

Copy Constructor.

Definition at line 24 of file MemoryMap.cpp.

References KernelData, KernelPrivate, m_regions, setRange(), UserArgs, UserData, UserHeap, UserPrivate, UserShare, and UserStack.

Member Function Documentation

◆ range()

Memory::Range MemoryMap::range ( MemoryMap::Region  region) const

◆ setRange()

void MemoryMap::setRange ( Region  region,
Memory::Range  range 
)

Set memory range for the given region.

Parameters
regionIdentifier of the memory region to set
rangeNew memory range value for the memory region

Definition at line 41 of file MemoryMap.cpp.

References m_regions, and range().

Referenced by MemoryMap().

Field Documentation

◆ m_regions

Memory::Range MemoryMap::m_regions[MEMORYMAP_MAX_REGIONS]
protected

Memory ranges.

Definition at line 95 of file MemoryMap.h.

Referenced by ARMMap::ARMMap(), IntelMap::IntelMap(), MemoryMap(), range(), and setRange().


The documentation for this class was generated from the following files: