Commit 5d1c20bc authored by Will Deacon's avatar Will Deacon Committed by Russell King

ARM: 7637/1: memory: use SZ_ constants for defining the virtual memory layout

Parts of the virtual memory layout (mainly the modules area) are
described using open-coded immediate values.

Use the SZ_ definitions from linux/sizes.h instead to make the code
clearer.
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e3e92a7b
...@@ -36,23 +36,23 @@ ...@@ -36,23 +36,23 @@
* TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area
*/ */
#define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET)
#define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(0x01000000)) #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M))
#define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3) #define TASK_UNMAPPED_BASE (UL(CONFIG_PAGE_OFFSET) / 3)
/* /*
* The maximum size of a 26-bit user space task. * The maximum size of a 26-bit user space task.
*/ */
#define TASK_SIZE_26 UL(0x04000000) #define TASK_SIZE_26 (UL(1) << 26)
/* /*
* The module space lives between the addresses given by TASK_SIZE * The module space lives between the addresses given by TASK_SIZE
* and PAGE_OFFSET - it must be within 32MB of the kernel text. * and PAGE_OFFSET - it must be within 32MB of the kernel text.
*/ */
#ifndef CONFIG_THUMB2_KERNEL #ifndef CONFIG_THUMB2_KERNEL
#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024) #define MODULES_VADDR (PAGE_OFFSET - SZ_16M)
#else #else
/* smaller range for Thumb-2 symbols relocation (2^24)*/ /* smaller range for Thumb-2 symbols relocation (2^24)*/
#define MODULES_VADDR (PAGE_OFFSET - 8*1024*1024) #define MODULES_VADDR (PAGE_OFFSET - SZ_8M)
#endif #endif
#if TASK_SIZE > MODULES_VADDR #if TASK_SIZE > MODULES_VADDR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment