lkml.org 
[lkml]   [2000]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Make agpsupport work with modversions
Date
On Thu, 19 Oct 2000 01:46:26 +0200, 
Jamie Lokier <lk@tantalophile.demon.co.uk> 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.307 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site