Skip to content

Commit 6a570b2

Browse files
hyoksungRussell King
authored andcommitted
[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>
1 parent e5beac3 commit 6a570b2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎arch/arm/kernel/module.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* linux/arch/arm/kernel/module.c
33
*
44
* Copyright (C) 2002 Russell King.
5+
* Modified for nommu by Hyok S. Choi
56
*
67
* This program is free software; you can redistribute it and/or modify
78
* it under the terms of the GNU General Public License version 2 as
@@ -32,6 +33,7 @@ extern void _etext;
3233
#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
3334
#endif
3435

36+
#ifdef CONFIG_MMU
3537
void *module_alloc(unsigned long size)
3638
{
3739
struct vm_struct *area;
@@ -46,6 +48,12 @@ void *module_alloc(unsigned long size)
4648

4749
return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL);
4850
}
51+
#else /* CONFIG_MMU */
52+
void *module_alloc(unsigned long size)
53+
{
54+
return size == 0 ? NULL : vmalloc(size);
55+
}
56+
#endif /* !CONFIG_MMU */
4957

5058
void module_free(struct module *module, void *region)
5159
{

0 commit comments

Comments
 (0)