On Thu, 19 Oct 2000 01:46:26 +0200, 
Jamie Lokier <[EMAIL PROTECTED]> wrote:
>John Levon wrote:
>> should get_module_symbol() die ?
>
>Please no.  I use it for a situation where two drivers can be used
>independently.  However, when they're loaded at the same time they
>communicate.  Having a third module _just_ to work out how the devices
>are related (based on PCI bus topology) and transfer the right words
>seems ugly.

What we really need is a weak external reference which is supported by
the linker for built in objects and by modutils at load time.  Then we
can get rid of run time symbol lookups, get_module_symbol() is an
abomination, especially with versioned symbols.

WEAK_EXTERN(agp_free_memory);
void (*free_memory)(agp_memory *) = &agp_free_memory;

if (free_memory)
        (free_memory)(some_memory);

Nice and clean.  WEAK_EXTERN does some magic to create a NULL pointer
at link time or load time if the symbol is not resolved.

Linus, do you want a patch for this?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to