summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/module.c
diff options
context:
space:
mode:
authorHyok S. Choi <hyok.choi@samsung.com>2006-09-26 17:37:07 +0900
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-09-27 17:02:50 +0100
commit6a570b28b5948e7bf54ea42ec3161bded0a1c460 (patch)
tree3756b17a3ec66f2e84c7f7bc28d58b991cd2c4f2 /arch/arm/kernel/module.c
parente5beac371af0af47bcbd6819f4c2a0a2721a1735 (diff)
downloadop-kernel-dev-6a570b28b5948e7bf54ea42ec3161bded0a1c460.zip
op-kernel-dev-6a570b28b5948e7bf54ea42ec3161bded0a1c460.tar.gz
[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>
Diffstat (limited to 'arch/arm/kernel/module.c')
-rw-r--r--arch/arm/kernel/module.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 298363d..1b06158 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -2,6 +2,7 @@
* linux/arch/arm/kernel/module.c
*
* Copyright (C) 2002 Russell King.
+ * Modified for nommu by Hyok S. Choi
*
* 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
@@ -32,6 +33,7 @@ extern void _etext;
#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
#endif
+#ifdef CONFIG_MMU
void *module_alloc(unsigned long size)
{
struct vm_struct *area;
@@ -46,6 +48,12 @@ void *module_alloc(unsigned long size)
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)
{
OpenPOWER on IntegriCloud