LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to declare a Global Variable in Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-declare-a-global-variable-in-kernel-719566/)

rheosiva 04-16-2009 08:13 AM

How to declare a Global Variable in Kernel
 
i want to declare a global variable in kernel.. and it should be accessed by all the modules. i will use this global variable to notify any error occurs while init_module of all device drivers.

i tried to declare the global variable in driver itself but i could not able to do it..

Can anyone tell me where i could declare the global variable in kernel,so that it could be accessed by all driver modules..

finally i can use an application to copy the status of all device drivers..

Please give me your suggestions

greplinux 04-17-2009 12:55 AM

Have you tried exporting symbols to kernel so that it can be accessed by all modules?

Try using EXPORT_SYMBOL/EXPORT_SYMBOL_GPL

Thanks,


All times are GMT -5. The time now is 01:00 PM.