* Calling module symbols from inside the kernel !
@ 2000-11-06 19:24 forop066
2000-11-06 19:52 ` Brian Gerst
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: forop066 @ 2000-11-06 19:24 UTC (permalink / raw)
To: linux-kernel
Is it possible to access symbols exported by modules from inside the kernel ?
I put a funtion call inside the kernel code but this funtion must be implemented in a module. I tried export as a module symbol but when i tried to recompile the kernel.. :-(
Warning: implicit declaration of my_funtion
.
.
.
Error: Undefined reference to my_funtion.
How can i fix this mistake!????
Thanks in advance,
Cris Amon.
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Calling module symbols from inside the kernel !
2000-11-06 19:24 Calling module symbols from inside the kernel ! forop066
@ 2000-11-06 19:52 ` Brian Gerst
2000-11-07 3:11 ` Keith Owens
2000-11-07 14:41 ` David Woodhouse
2 siblings, 0 replies; 6+ messages in thread
From: Brian Gerst @ 2000-11-06 19:52 UTC (permalink / raw)
To: forop066; +Cc: linux-kernel
forop066@zaz.com.br wrote:
>
> Is it possible to access symbols exported by modules from inside the kernel ?
>
> I put a funtion call inside the kernel code but this funtion must be implemented in a module. I tried export as a module symbol but when i tried to recompile the kernel.. :-(
>
> Warning: implicit declaration of my_funtion
> .
> .
> .
> Error: Undefined reference to my_funtion.
>
> How can i fix this mistake!????
>
> Thanks in advance,
> Cris Amon.
You will need to use a function pointer hook that the module fills in
when it is loaded. For an example look at devpts_upcall_new and
devpts_upcall_kill in fs/devpts/inode.c. The hooks are resident in the
kernel and are exported so the module can see them. The caller then
needs to check if the hook is null and optionally request the module be
loaded.
--
Brian Gerst
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Calling module symbols from inside the kernel !
2000-11-06 19:24 Calling module symbols from inside the kernel ! forop066
2000-11-06 19:52 ` Brian Gerst
@ 2000-11-07 3:11 ` Keith Owens
2000-11-07 14:41 ` David Woodhouse
2 siblings, 0 replies; 6+ messages in thread
From: Keith Owens @ 2000-11-07 3:11 UTC (permalink / raw)
To: forop066; +Cc: linux-kernel
On Mon, 6 Nov 2000 16:24:13 -0300,
forop066@zaz.com.br wrote:
>Is it possible to access symbols exported by modules from inside the kernel ?
Not via symbol name, the linkage goes module => kernel, not the other
way round. Your module needs to register its data when it loads, then
any code can use the registration "get" function to access the data.
This works kernel <=> kernel, kernel <=> module, module <=> module. Be
careful that you lock the module down while you are using its data.
See ftp://ftp.ocs.com.au/pub/2.4.0-test10-pre6-module-symbol.gz for
sample registration code.
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Calling module symbols from inside the kernel !
@ 2000-11-07 7:52 richardj_moore
0 siblings, 0 replies; 6+ messages in thread
From: richardj_moore @ 2000-11-07 7:52 UTC (permalink / raw)
To: forop066; +Cc: linux-kernel
We have a generic way of doing this which we are about to release - called
GKHI (Generalised Kernel Hooks Interface) would you like a copy to test?
Richard Moore - RAS Project Lead - Linux Technology Centre (PISC).
http://oss.software.ibm.com/developerworks/opensource/linux
Office: (+44) (0)1962-817072, Mobile: (+44) (0)7768-298183
IBM UK Ltd, MP135 Galileo Centre, Hursley Park, Winchester, SO21 2JN, UK
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Calling module symbols from inside the kernel !
2000-11-06 19:24 Calling module symbols from inside the kernel ! forop066
2000-11-06 19:52 ` Brian Gerst
2000-11-07 3:11 ` Keith Owens
@ 2000-11-07 14:41 ` David Woodhouse
2000-11-08 11:52 ` Ingo Oeser
2 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2000-11-07 14:41 UTC (permalink / raw)
To: Brian Gerst; +Cc: forop066, linux-kernel
bgerst@didntduck.org said:
> You will need to use a function pointer hook that the module fills in
> when it is loaded. For an example look at devpts_upcall_new and
> devpts_upcall_kill in fs/devpts/inode.c. The hooks are resident in
> the kernel and are exported so the module can see them. The caller
> then needs to check if the hook is null and optionally request the
> module be loaded.
get_module_symbol() does this for you without having to use such a hook
/me runs
:)
--
dwmw2
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Calling module symbols from inside the kernel !
2000-11-07 14:41 ` David Woodhouse
@ 2000-11-08 11:52 ` Ingo Oeser
0 siblings, 0 replies; 6+ messages in thread
From: Ingo Oeser @ 2000-11-08 11:52 UTC (permalink / raw)
To: David Woodhouse; +Cc: Brian Gerst, forop066, linux-kernel
On Tue, Nov 07, 2000 at 02:41:42PM +0000, David Woodhouse wrote:
> get_module_symbol() does this for you without having to use such a hook
>
> /me runs
So I guess you know already, that it died in 2.4.0-test11-pre1
and you are suggesting dead code? ;-)
Regards
Ingo Oeser
--
To the systems programmer, users and applications
serve only to provide a test load.
<esc>:x
-
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2000-11-08 11:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-06 19:24 Calling module symbols from inside the kernel ! forop066
2000-11-06 19:52 ` Brian Gerst
2000-11-07 3:11 ` Keith Owens
2000-11-07 14:41 ` David Woodhouse
2000-11-08 11:52 ` Ingo Oeser
-- strict thread matches above, loose matches on Subject: below --
2000-11-07 7:52 richardj_moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox