lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 24/29] nios2: Module support
On 2014-07-15 at 12:24:46 +0200, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 15 July 2014 16:45:51 Ley Foon Tan wrote:
> > +void *module_alloc(unsigned long size)
> > +{
> > + if (size == 0)
> > + return NULL;
> > + return kmalloc(size, GFP_KERNEL);
> > +}
> > +
> > +/* Free memory returned from module_alloc */
> > +void module_free(struct module *mod, void *module_region)
> > +{
> > + kfree(module_region);
> > +}
>
> Any particular reason for defining these to use kmalloc rather than
> the default vmalloc based functions?

AFAIR this is due to relocation issues, as the FIXME comment in the
"original" code [1] states. I don't know whether this still applies,
though (or what would be the proper fix for this to overcome the
relocation issues).

[1] https://github.com/tklauser/linux-nios2/blob/nios2/arch/nios2/kernel/module.c#L45

Cheers
Tobias


\
 
 \ /
  Last update: 2014-07-18 11:41    [W:1.733 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site