lkml.org 
[lkml]   [2011]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 14/19] OpenRISC: Module support
    Date
    On Friday 24 June 2011, Jonas Bonn wrote:
    > On Wed, 2011-06-22 at 16:26 +0200, Arnd Bergmann wrote:
    > > I think that an easy way to do that would be to add to kernel/module.c
    > > code like:
    > >
    > > #ifndef module_alloc
    > > void *module_alloc(unsigned long size)
    > > {
    > > return vmalloc(size);
    > > }
    > > #endif
    > >
    >
    > I noticed that kernel/module.c already has this:
    >
    > unsigned int __weak arch_mod_section_prepend(struct module *mod,
    > unsigned int section)
    >
    >
    > Is using a __weak attribute on the default (generic) implementations a
    > better approach?

    I normally don't like using __weak, because it more easily confuses
    readers about which version is actually used.

    > > Then each architecture that needs a special version can do
    > > #define module_alloc(size) module_alloc(size)
    > > in their respective asm/module.h
    >
    > With the __weak variant this wouldn't be necessary...

    Correct. I certainly wouldn't want to see both methods mixed in the
    same file. Rusty is maintaining the module loader, maybe he has
    a preference.

    Rusty, we were discussing the fact that most module loader files
    are providing very similar (mostly empty) functions, and that it would
    be nice if the new openrisc architecture would only have to provide
    apply_relocate_add(), which is actually arch specific, while it could
    be changed to use the defaults for everything else.

    Arnd


    \
     
     \ /
      Last update: 2011-06-24 12:07    [W:0.032 / U:29.424 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site