diff mbox series

[V3,3/5] arm64: mm: Define arch_get_mmap_end, arch_get_mmap_base

Message ID 20181114133920.7134-4-steve.capper@arm.com (mailing list archive)
State New, archived
Headers show
Series 52-bit userspace VAs | expand

Commit Message

Steve Capper Nov. 14, 2018, 1:39 p.m. UTC
Now that we have DEFAULT_MAP_WINDOW defined, we can arch_get_mmap_end
and arch_get_mmap_base helpers to allow for high addresses in mmap.

Signed-off-by: Steve Capper <steve.capper@arm.com>
---
 arch/arm64/include/asm/processor.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Catalin Marinas Nov. 27, 2018, 5:10 p.m. UTC | #1
On Wed, Nov 14, 2018 at 01:39:18PM +0000, Steve Capper wrote:
> Now that we have DEFAULT_MAP_WINDOW defined, we can arch_get_mmap_end
> and arch_get_mmap_base helpers to allow for high addresses in mmap.
> 
> Signed-off-by: Steve Capper <steve.capper@arm.com>

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Steve Capper Nov. 28, 2018, 4:31 p.m. UTC | #2
On Tue, Nov 27, 2018 at 05:10:18PM +0000, Catalin Marinas wrote:
> On Wed, Nov 14, 2018 at 01:39:18PM +0000, Steve Capper wrote:
> > Now that we have DEFAULT_MAP_WINDOW defined, we can arch_get_mmap_end
> > and arch_get_mmap_base helpers to allow for high addresses in mmap.
> > 
> > Signed-off-by: Steve Capper <steve.capper@arm.com>
> 
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

Thanks!
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index da41a2655b69..bbe602cb8fd3 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -72,6 +72,13 @@ 
 #define STACK_TOP		STACK_TOP_MAX
 #endif /* CONFIG_COMPAT */
 
+#define arch_get_mmap_end(addr) ((addr > DEFAULT_MAP_WINDOW) ? TASK_SIZE :\
+				DEFAULT_MAP_WINDOW)
+
+#define arch_get_mmap_base(addr, base) ((addr > DEFAULT_MAP_WINDOW) ? \
+					base + TASK_SIZE - DEFAULT_MAP_WINDOW :\
+					base)
+
 extern phys_addr_t arm64_dma_phys_limit;
 #define ARCH_LOW_ADDRESS_LIMIT	(arm64_dma_phys_limit - 1)