On 6/15/07, Adrian Bunk <bunk@xxxxxxxxx> wrote:
I am sorry but i couldnt understand what you said.i want to log what data is passed to say readb function. so what i do is pass all this data to a function pointed by a function pointer. Now i export my function pointer so that i can get all this data into a module. Is there a better way to do it.
Yes i did that but thats very painful because everytime you want to make some changes with the way data is processed you have to recompile the whole kernel.
regards
devvrat
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.
I am sorry but i couldnt understand what you said.i want to log what data is passed to say readb function. so what i do is pass all this data to a function pointed by a function pointer. Now i export my function pointer so that i can get all this data into a module. Is there a better way to do it.
Otherwise function pointers are a possible solution.
Or the simple solution:
Don't put the function into a module, compile it into the kernel.
Yes i did that but thats very painful because everytime you want to make some changes with the way data is processed you have to recompile the whole kernel.
regards
devvrat