Re: extern functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 15, 2007 at 04:55:47PM +0200, Devvrat Tripathi wrote:
> On 6/15/07, Adrian Bunk <bunk@xxxxxxxxx> wrote:
>>
>> On Fri, Jun 15, 2007 at 03:50:48PM +0200, Devvrat Tripathi wrote:
>> > can we declare an extern function(or say variable) inside the kernel and
>> > then later define it using a kernel module.
>>
>> No, it would be an unresolved symbol at link time.
>
>
> What exactly is the problem you are trying to solve?
>
>
> I want the data available to some functions inside the kernel  to be
> available to my modules also. I thought i will generally call some extern
> funct from inside and then define it later from my modules which doesnt
> work. Now i am trying to do it through fucntion pointers which are exported
> so that i can change it in my module. still dont have the exact idea to
> accomplish the task .

If your module should be able to access data inside the kernel available 
to modules simply EXPORT_SYMBOL the variables you use to access this 
data.

Otherwise function pointers are a possible solution.

Or the simple solution:
Don't put the function into a module, compile it into the kernel.

> regards
>
> devvrat

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux