Question about external variable in kernel.
I want to use a external variable announced by myself in kernel in difference situation.One is evaluating it with the function(copy_from_user)in user space,the other is check it in my loadable module.for example:
file.h
struct some_struct variable;
struct some_struct* variableptr = &variable;
linux_kernel/kernel/sys.c
#include file.h
unsigned int som_function()
{
copy_from_user(...);
do something;
}
EXPORT_SYMBOL(variable);
EXPORT_SYMBOL(variableptr);
my_module.c
some_module_function()
{
struct some_struct ptr;
ptr = variableptr;
do something;
}
Here is the question.
I found the variableptr's value were difference between two situation.I couldnt use this external variable correctly.Why?Does anyone know it?
thanks a lot.
|