diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 1099af6d470ad619be8aa5eeecd64a11705c0282..64262bda8e54d97d4b3002b24b4024865fd12de6 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -434,9 +434,9 @@ static void __init devicemaps_init(struct machine_desc *mdesc) * It is always first in the modulearea. */ #ifdef CONFIG_XIP_KERNEL - map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK); + map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK); map.virtual = MODULE_START; - map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK; + map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK; map.type = MT_ROM; create_mapping(&map); #endif diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 8d3919c6458c6c9326ef35a35ee7c848d34ac467..38b2b55688e2b4542d7d9eefb9f3387435b8014e 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -135,6 +135,13 @@ extern void __pgd_error(const char *file, int line, unsigned long val); #define FIRST_USER_PGD_NR 1 #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) +/* + * section address mask and size definitions. + */ +#define SECTION_SHIFT 20 +#define SECTION_SIZE (1UL << SECTION_SHIFT) +#define SECTION_MASK (~(SECTION_SIZE-1)) + /* * ARMv6 supersection address mask and size definitions. */