mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
[ARM] fix naming of MODULE_START / MODULE_END
As of 73bdf0a60e
, the kernel needs
to know where modules are located in the virtual address space.
On ARM, we located this region between MODULE_START and MODULE_END.
Unfortunately, everyone else calls it MODULES_VADDR and MODULES_END.
Update ARM to use the same naming, so is_vmalloc_or_module_addr()
can work properly. Also update the comment on mm/vmalloc.c to
reflect that ARM also places modules in a separate region from the
vmalloc space.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
d2ed5cb80a
commit
ab4f2ee130
4 changed files with 13 additions and 13 deletions
|
@ -44,10 +44,10 @@
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
#define MODULE_END (PAGE_OFFSET)
|
#define MODULES_END (PAGE_OFFSET)
|
||||||
#define MODULE_START (MODULE_END - 16*1048576)
|
#define MODULES_VADDR (MODULES_END - 16*1048576)
|
||||||
|
|
||||||
#if TASK_SIZE > MODULE_START
|
#if TASK_SIZE > MODULES_VADDR
|
||||||
#error Top of user space clashes with start of module space
|
#error Top of user space clashes with start of module space
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
* Since we use sections to map it, this macro replaces the physical address
|
* Since we use sections to map it, this macro replaces the physical address
|
||||||
* with its virtual address while keeping offset from the base section.
|
* with its virtual address while keeping offset from the base section.
|
||||||
*/
|
*/
|
||||||
#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff))
|
#define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allow 16MB-aligned ioremap pages
|
* Allow 16MB-aligned ioremap pages
|
||||||
|
@ -94,8 +94,8 @@
|
||||||
/*
|
/*
|
||||||
* The module can be at any place in ram in nommu mode.
|
* The module can be at any place in ram in nommu mode.
|
||||||
*/
|
*/
|
||||||
#define MODULE_END (END_MEM)
|
#define MODULES_END (END_MEM)
|
||||||
#define MODULE_START (PHYS_OFFSET)
|
#define MODULES_VADDR (PHYS_OFFSET)
|
||||||
|
|
||||||
#endif /* !CONFIG_MMU */
|
#endif /* !CONFIG_MMU */
|
||||||
|
|
||||||
|
|
|
@ -26,12 +26,12 @@
|
||||||
/*
|
/*
|
||||||
* The XIP kernel text is mapped in the module area for modules and
|
* The XIP kernel text is mapped in the module area for modules and
|
||||||
* some other stuff to work without any indirect relocations.
|
* some other stuff to work without any indirect relocations.
|
||||||
* MODULE_START is redefined here and not in asm/memory.h to avoid
|
* MODULES_VADDR is redefined here and not in asm/memory.h to avoid
|
||||||
* recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off.
|
* recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off.
|
||||||
*/
|
*/
|
||||||
extern void _etext;
|
extern void _etext;
|
||||||
#undef MODULE_START
|
#undef MODULES_VADDR
|
||||||
#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
|
#define MODULES_VADDR (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
|
@ -43,7 +43,7 @@ void *module_alloc(unsigned long size)
|
||||||
if (!size)
|
if (!size)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END);
|
area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
|
||||||
if (!area)
|
if (!area)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -654,7 +654,7 @@ static inline void prepare_page_table(struct meminfo *mi)
|
||||||
/*
|
/*
|
||||||
* Clear out all the mappings below the kernel image.
|
* Clear out all the mappings below the kernel image.
|
||||||
*/
|
*/
|
||||||
for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
|
for (addr = 0; addr < MODULES_VADDR; addr += PGDIR_SIZE)
|
||||||
pmd_clear(pmd_off_k(addr));
|
pmd_clear(pmd_off_k(addr));
|
||||||
|
|
||||||
#ifdef CONFIG_XIP_KERNEL
|
#ifdef CONFIG_XIP_KERNEL
|
||||||
|
@ -766,7 +766,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_XIP_KERNEL
|
#ifdef CONFIG_XIP_KERNEL
|
||||||
map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK);
|
map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK);
|
||||||
map.virtual = MODULE_START;
|
map.virtual = MODULES_VADDR;
|
||||||
map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK;
|
map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK;
|
||||||
map.type = MT_ROM;
|
map.type = MT_ROM;
|
||||||
create_mapping(&map);
|
create_mapping(&map);
|
||||||
|
|
|
@ -178,7 +178,7 @@ static int vmap_page_range(unsigned long addr, unsigned long end,
|
||||||
static inline int is_vmalloc_or_module_addr(const void *x)
|
static inline int is_vmalloc_or_module_addr(const void *x)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* x86-64 and sparc64 put modules in a special place,
|
* ARM, x86-64 and sparc64 put modules in a special place,
|
||||||
* and fall back on vmalloc() if that fails. Others
|
* and fall back on vmalloc() if that fails. Others
|
||||||
* just put it in the vmalloc space.
|
* just put it in the vmalloc space.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue