summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/page.h
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2012-07-22 19:40:38 +0200
committerWill Deacon <will.deacon@arm.com>2013-05-30 17:01:30 +0200
commit926edcc747e2efb3c9add7ed4dbc4e7a3a959d02 (patch)
treea9426efbb842722c589c452c56c46fc2ab1545da /arch/arm/include/asm/page.h
parentLinux 3.10-rc3 (diff)
downloadlinux-926edcc747e2efb3c9add7ed4dbc4e7a3a959d02.tar.xz
linux-926edcc747e2efb3c9add7ed4dbc4e7a3a959d02.zip
ARM: LPAE: use signed arithmetic for mask definitions
This patch applies to PAGE_MASK, PMD_MASK, and PGDIR_MASK, where forcing unsigned long math truncates the mask at the 32-bits. This clearly does bad things on PAE systems. This patch fixes this problem by defining these masks as signed quantities. We then rely on sign extension to do the right thing. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Signed-off-by: Vitaly Andrianov <vitalya@ti.com> Reviewed-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Subash Patel <subash.rp@samsung.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/include/asm/page.h')
-rw-r--r--arch/arm/include/asm/page.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index 812a4944e783..6363f3d1d505 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -13,7 +13,7 @@
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK (~(PAGE_SIZE-1))
+#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
#ifndef __ASSEMBLY__