I have calculated the value of a parameter in user space and would like to pass the integer value to kernel space. I know that I have to use get_user(x, ptr)
, but I'm not sure how to provide the pointer to the kernel module.
I have an integer variable in my user space code and I can find the pointer to it. However, I should know the pointer beforehand so that I can use it in my kernel code. Do I need to allocate a specific memory location (i.e. 0x...) to the integer variable so that I can use it in both codes or there's another workaround?
I want this data transfer to have the minimum possible overhead.