aboutsummaryrefslogtreecommitdiff
path: root/memory.h
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2019-12-10 15:47:05 +0100
committervetch <vetch97@gmail.com>2019-12-10 15:47:05 +0100
commitf87b0105a0ac411b0d64d89a9ea92e9b07087aa2 (patch)
tree234ce93b208a9bbc199120b6aba69b479202783a /memory.h
parent899a5c14aa3737f04f5cd95e97dca3ee14ad1b43 (diff)
downloadrpi-MMU-example-f87b0105a0ac411b0d64d89a9ea92e9b07087aa2.tar.gz
rpi-MMU-example-f87b0105a0ac411b0d64d89a9ea92e9b07087aa2.zip
Revert "Merge branch 'bob' of https://repo.or.cz/RPi-MMU-example into alice"
This reverts commit 5662aacc5688bba4873367ed9ab51fb83fbd1feb, reversing changes made to b0a6351d52af8bdf6fa9cca0d313df323249a520.
Diffstat (limited to 'memory.h')
-rw-r--r--memory.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/memory.h b/memory.h
index 1c9ae35..1472a8b 100644
--- a/memory.h
+++ b/memory.h
@@ -1,17 +1,13 @@
#ifndef MEMORY_H
#define MEMORY_H
-#include "paging.h"
-
-#define SECTION_SIZE (((uint32_t) 1) << 20)
-
#define INTERRUPT_VECTOR_TABLE_START ((uint32_t) 0x0)
#define STACK_START ((uint32_t) 0x4000)
#define STACK_END ((uint32_t) 0x8000)
-extern const char __end;
-extern const char __start;
+extern char __end;
+extern char __start;
#define KERNEL_START ((uint32_t) &__start)
#define KERNEL_END ((uint32_t) &__end)
@@ -24,21 +20,11 @@ extern const char __start;
#define TRANSLATION_TABLE_END \
(TRANSLATION_TABLE_BASE + (uint32_t) (4096 * 4))
-#define LIBKERNEL_SECTION_START \
- (((TRANSLATION_TABLE_END - (uint32_t) 1) & ~((uint32_t) 0xfffff)) \
- + SECTION_SIZE)
-
-#define LIBKERNEL_SECTION_END \
- (LIBKERNEL_SECTION_START + SECTION_SIZE)
+#define PRIVILEGED_MEMORY_END TRANSLATION_TABLE_END
-// section for libkernel is flat-mapped
-#define LIBKERNEL_SECTION_NUMBER (LIBKERNEL_SECTION_START >> 20)
-
-#define PRIVILEGED_MEMORY_END LIBKERNEL_SECTION_END
-
-#define UNPRIVILEGED_MEMORY_START PRIVILEGED_MEMORY_END
-#define UNPRIVILEGED_MEMORY_END \
- (UNPRIVILEGED_MEMORY_START + SECTION_SIZE)
+#define UNPRIVILEGED_MEMORY_START \
+ (((PRIVILEGED_MEMORY_END - (uint32_t) 1) & ~((uint32_t) 0xfffff)) \
+ + (uint32_t) 0x100000)
#define PL0_SECTION_NUMBER ((uint32_t) 0b101010101010)
#define PL0_SECTION_NUMBER_STR "0b101010101010"
@@ -46,4 +32,4 @@ extern const char __start;
#define VIRTUAL_PL0_MEMORY_START (PL0_SECTION_NUMBER << 20)
#endif // MEMORY_H
-
+