I was hoping someone could explain the nuances of the __user macro used in the linux kernel source.
First of all, the macro:
# define __user __attribute__((noderef, address_space(1)))
Now, after some searching on Google, I read that this macro allows you to designate a pointer as belonging to the user's address space and that it should not be dereferenced.
Perhaps I am missing some obvious facts, but can someone explain the consequences of such a macro? For example, what is a good example of where this macro will be useful? Again, forgive me if I missed something obvious.
To add this to some context, I came across a macro, studying some USB code (linux / usbdevice_fs.h). I am only looking for a general understanding of these macros (or other similar ones) in the kernel.
Thanks for watching!
c macros linux-kernel kernel
Mr. Shickadance Dec 23 '10 at 18:46 2010-12-23 18:46
source share