FreeNOS
lib
libarch
arm
ARMMap.cpp
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
#include <FreeNOS/System.h>
19
#include <
MemoryBlock.h
>
20
#include <
Memory.h
>
21
#include "
ARMMap.h
"
22
23
ARMMap::ARMMap
()
24
{
25
MemoryBlock::set
(
m_regions
, 0,
sizeof
(
m_regions
));
26
27
m_regions
[
KernelData
].
virt
= RAM_ADDR;
28
m_regions
[
KernelData
].
phys
= RAM_ADDR;
29
m_regions
[
KernelData
].
size
=
GigaByte
(1) -
MegaByte
(128);
30
m_regions
[
KernelData
].
access
=
Memory::Readable
|
Memory::Writable
|
Memory::Executable
;
31
32
m_regions
[
KernelPrivate
].
virt
=
GigaByte
(1) -
MegaByte
(128);
33
m_regions
[
KernelPrivate
].
phys
=
GigaByte
(1) -
MegaByte
(128);
34
m_regions
[
KernelPrivate
].
size
=
MegaByte
(128);
35
m_regions
[
KernelPrivate
].
access
=
Memory::Readable
|
Memory::Writable
;
36
37
m_regions
[
UserData
].
virt
= 0x80000000;
38
m_regions
[
UserData
].
size
=
MegaByte
(256);
39
40
m_regions
[
UserHeap
].
virt
= 0xb0000000;
41
m_regions
[
UserHeap
].
size
=
MegaByte
(256);
42
43
m_regions
[
UserStack
].
virt
= 0xc0000000;
44
m_regions
[
UserStack
].
size
=
KiloByte
(16);
45
46
m_regions
[
UserPrivate
].
virt
= 0xa0000000;
47
m_regions
[
UserPrivate
].
size
=
MegaByte
(256);
48
49
m_regions
[
UserShare
].
virt
= 0xd0000000;
50
m_regions
[
UserShare
].
size
=
MegaByte
(256);
51
52
m_regions
[
UserArgs
].
virt
= 0xe0000000;
53
m_regions
[
UserArgs
].
size
=
KiloByte
(128);
54
}
Memory::Executable
@ Executable
Definition:
Memory.h:43
MemoryBlock::set
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Definition:
MemoryBlock.cpp:25
MemoryMap::UserStack
@ UserStack
< User stack
Definition:
MemoryMap.h:58
Memory::Writable
@ Writable
Definition:
Memory.h:42
MemoryMap::UserShare
@ UserShare
< User shared dynamic memory mappings
Definition:
MemoryMap.h:60
MemoryBlock.h
MemoryMap::UserData
@ UserData
< User program data from libexec, e.g.
Definition:
MemoryMap.h:56
Memory::Readable
@ Readable
Definition:
Memory.h:41
MegaByte
#define MegaByte(v)
Convert megabytes to bytes.
Definition:
Macros.h:57
ARMMap::ARMMap
ARMMap()
Constructor.
Definition:
ARMMap.cpp:23
KiloByte
#define KiloByte(v)
Convert kilobytes to bytes.
Definition:
Macros.h:54
Memory::Range::phys
Address phys
Physical address.
Definition:
Memory.h:58
ARMMap.h
MemoryMap::UserPrivate
@ UserPrivate
< User private dynamic memory mappings
Definition:
MemoryMap.h:59
MemoryMap::KernelPrivate
@ KernelPrivate
< Kernel dynamic memory mappings
Definition:
MemoryMap.h:55
Memory.h
Memory::Range::virt
Address virt
Virtual address.
Definition:
Memory.h:57
MemoryMap::UserArgs
@ UserArgs
< Used for copying program arguments and file descriptors
Definition:
MemoryMap.h:61
GigaByte
#define GigaByte(v)
Convert gigabytes to bytes.
Definition:
Macros.h:60
MemoryMap::UserHeap
@ UserHeap
< User heap
Definition:
MemoryMap.h:57
Memory::Range::size
Size size
Size in number of bytes.
Definition:
Memory.h:59
Memory::Range::access
Access access
Page access flags.
Definition:
Memory.h:60
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
Generated by
1.8.17