X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=arch%2Fmips%2Fkernel%2Fmodule.c;h=cb0801437b666a7769fedbb2e0a7a82651c44ab6;hb=e77c232cfc6e1250b2916a7c69225d6634d05a49;hp=d7bf0215bc1d28eb40160366afbdd59b41fea470;hpb=bbf70132db2767f66b411fa90488aacac72e06dd;p=powerpc.git diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index d7bf0215bc..cb0801437b 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c @@ -29,6 +29,7 @@ #include #include #include +#include /* MODULE_START */ struct mips_hi16 { struct mips_hi16 *next; @@ -43,9 +44,23 @@ static DEFINE_SPINLOCK(dbe_lock); void *module_alloc(unsigned long size) { +#ifdef MODULE_START + struct vm_struct *area; + + size = PAGE_ALIGN(size); + if (!size) + return NULL; + + area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END); + if (!area) + return NULL; + + return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL); +#else if (size == 0) return NULL; return vmalloc(size); +#endif } /* Free memory returned from module_alloc */