Signed-off-by: Artyom Tarasenko atar4qemu@gmail.com --- arch/sparc32/lib.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/sparc32/lib.c b/arch/sparc32/lib.c index 483069c..215ddcc 100644 --- a/arch/sparc32/lib.c +++ b/arch/sparc32/lib.c @@ -19,6 +19,8 @@
#define NCTX_SWIFT 0x100 #define LOWMEMSZ 32 * 1024 * 1024 +/* Avoid mapping the first page to make NULL-dereferencing more obvious */ +#define LOWMEM_START PAGE_SIZE
#ifdef CONFIG_DEBUG_MEM #define DPRINTF(fmt, args...) \ @@ -403,7 +405,8 @@ init_mmu_swift(void) ofmem_arch_map_pages(pa, va, size, ofmem_arch_default_translation_mode(pa));
// 1:1 mapping for RAM - ofmem_arch_map_pages(0, 0, LOWMEMSZ, ofmem_arch_default_translation_mode(0)); + ofmem_arch_map_pages(LOWMEM_START, LOWMEM_START, LOWMEMSZ, + ofmem_arch_default_translation_mode(LOWMEM_START));
/* * Flush cache