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
33namespace 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 }
51
63};
64
68extern C void clearBSS();
69
75#endif /* __LIBARCH_MEMORY_H */
Abstract device class interface.
Definition Device.h:36
C void clearBSS()
Generic function to clear the BSS memory section to zero.
Definition Memory.cpp:21
unsigned long Address
A memory address.
Definition Types.h:131
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
#define C
Used to define external C functions.
Definition Macros.h:134
Access
Memory access flags.
Definition Memory.h:39
@ Executable
Definition Memory.h:43
@ InnerCached
Definition Memory.h:46
@ User
Definition Memory.h:44
@ Readable
Definition Memory.h:41
@ None
Definition Memory.h:40
@ OuterCached
Definition Memory.h:47
@ Uncached
Definition Memory.h:45
@ Writable
Definition Memory.h:42
Memory range.
Definition Memory.h:56
Size size
Size in number of bytes.
Definition Memory.h:59
Address phys
Physical address.
Definition Memory.h:58
Address virt
Virtual address.
Definition Memory.h:57
Access access
Page access flags.
Definition Memory.h:60