mirror of
https://github.com/adulau/aha.git
synced 2025-01-03 14:43:17 +00:00
[ARM] nommu: allows to support module in nommu
A simple patch to support module in nommu mode. The vmalloc is used instead of __vmalloc_area which depends on CONFIG_MMU. Signed-off-by: Hyok S. Choi <hyok.choi@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
e5beac371a
commit
6a570b28b5
1 changed files with 8 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
* linux/arch/arm/kernel/module.c
|
* linux/arch/arm/kernel/module.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 Russell King.
|
* Copyright (C) 2002 Russell King.
|
||||||
|
* Modified for nommu by Hyok S. Choi
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
@ -32,6 +33,7 @@ extern void _etext;
|
||||||
#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
|
#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_MMU
|
||||||
void *module_alloc(unsigned long size)
|
void *module_alloc(unsigned long size)
|
||||||
{
|
{
|
||||||
struct vm_struct *area;
|
struct vm_struct *area;
|
||||||
|
@ -46,6 +48,12 @@ void *module_alloc(unsigned long size)
|
||||||
|
|
||||||
return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
|
return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
|
||||||
}
|
}
|
||||||
|
#else /* CONFIG_MMU */
|
||||||
|
void *module_alloc(unsigned long size)
|
||||||
|
{
|
||||||
|
return size == 0 ? NULL : vmalloc(size);
|
||||||
|
}
|
||||||
|
#endif /* !CONFIG_MMU */
|
||||||
|
|
||||||
void module_free(struct module *module, void *region)
|
void module_free(struct module *module, void *region)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue