FreeNOS
Memory.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_MEMORY_H
19 #define __LIBARCH_MEMORY_H
20 
21 #include <Types.h>
22 #include <Macros.h>
23 #include <BitOperations.h>
24 
33 namespace Memory
34 {
38  typedef enum Access
39  {
40  None = 0,
41  Readable = 1 << 0,
42  Writable = 1 << 1,
43  Executable = 1 << 2,
44  User = 1 << 3,
45  Uncached = 1 << 4,
46  InnerCached = 1 << 5,
47  OuterCached = 1 << 6,
48  Device = 1 << 7
49  }
50  Access;
51 
55  typedef struct Range
56  {
61  }
62  Range;
63 };
64 
68 extern C void clearBSS();
69 
75 #endif /* __LIBARCH_MEMORY_H */
Memory::InnerCached
@ InnerCached
Definition: Memory.h:46
Memory::Range
Memory range.
Definition: Memory.h:55
Macros.h
Memory::Executable
@ Executable
Definition: Memory.h:43
Types.h
Memory::Writable
@ Writable
Definition: Memory.h:42
Memory::User
@ User
Definition: Memory.h:44
Device
Abstract device class interface.
Definition: Device.h:35
Memory::OuterCached
@ OuterCached
Definition: Memory.h:47
Address
unsigned long Address
A memory address.
Definition: Types.h:131
BitOperations.h
Memory::Readable
@ Readable
Definition: Memory.h:41
Memory::Range
struct Memory::Range Range
Memory range.
C
#define C
Used to define external C functions.
Definition: Macros.h:134
Memory::Range::phys
Address phys
Physical address.
Definition: Memory.h:58
Memory::Uncached
@ Uncached
Definition: Memory.h:45
Memory::None
@ None
Definition: Memory.h:40
Memory
Definition: Memory.h:33
Size
unsigned int Size
Any sane size indicator cannot go negative.
Definition: Types.h:128
Memory::Access
Access
Memory access flags.
Definition: Memory.h:38
Memory::Range::virt
Address virt
Virtual address.
Definition: Memory.h:57
clearBSS
C void clearBSS()
Generic function to clear the BSS memory section to zero.
Definition: Memory.cpp:21
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