FreeNOS
MemoryMap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIBARCH_MEMORYMAP_H
19 #define __LIBARCH_MEMORYMAP_H
20 
21 #include "Memory.h"
22 
31 #define MEMORYMAP_MAX_REGIONS 8
32 
38 class MemoryMap
39 {
40  public:
41 
52  typedef enum Region
53  {
62  }
63  Region;
64 
68  MemoryMap();
69 
73  MemoryMap(const MemoryMap &map);
74 
82  Memory::Range range(Region region) const;
83 
90  void setRange(Region region, Memory::Range range);
91 
92  protected:
93 
96 };
97 
103 #endif /* __LIBARCH_MEMORYMAP_H */
Memory::Range
Memory range.
Definition: Memory.h:55
MemoryMap::UserStack
@ UserStack
< User stack
Definition: MemoryMap.h:58
MEMORYMAP_MAX_REGIONS
#define MEMORYMAP_MAX_REGIONS
Definition: MemoryMap.h:31
MemoryMap::UserShare
@ UserShare
< User shared dynamic memory mappings
Definition: MemoryMap.h:60
MemoryMap::UserData
@ UserData
< User program data from libexec, e.g.
Definition: MemoryMap.h:56
MemoryMap::range
Memory::Range range(Region region) const
Get memory range for the given region.
Definition: MemoryMap.cpp:36
MemoryMap
Describes virtual memory map layout.
Definition: MemoryMap.h:38
MemoryMap::UserPrivate
@ UserPrivate
< User private dynamic memory mappings
Definition: MemoryMap.h:59
MemoryMap::Region
Region
Memory regions.
Definition: MemoryMap.h:52
MemoryMap::KernelPrivate
@ KernelPrivate
< Kernel dynamic memory mappings
Definition: MemoryMap.h:55
Memory.h
MemoryMap::UserArgs
@ UserArgs
< Used for copying program arguments and file descriptors
Definition: MemoryMap.h:61
MemoryMap::setRange
void setRange(Region region, Memory::Range range)
Set memory range for the given region.
Definition: MemoryMap.cpp:41
MemoryMap::UserHeap
@ UserHeap
< User heap
Definition: MemoryMap.h:57
MemoryMap::MemoryMap
MemoryMap()
Constructor.
Definition: MemoryMap.cpp:20
MemoryMap::KernelData
@ KernelData
< Kernel program data from libexec, e.g.
Definition: MemoryMap.h:54
MemoryMap::m_regions
Memory::Range m_regions[MEMORYMAP_MAX_REGIONS]
Memory ranges.
Definition: MemoryMap.h:95