c - what is the purpose of pre-processor macros defined in files linux/compiler.h? -
I'm very new to the Linux kernel and I'm using the Sparse tool to clean the noise in the code. . I am experiencing these macros:
# define __user __attribute __ ((Nodif, Pta_spes (1))) #define __krnl __tttw __ ((Address_space (0))) #define __saf __detait __ ((secure)) #define __force __attribute __ ((emphasis added)) #define __nocast __attribute __ ((Nocast)) #define __iomem __attribute __ ((Noderef, Address_space (2))) #define __must_hold (x) __attribute __ ((reference (x, 1,1))) # define __acquires (x) __attribute __ ((reference (x, 0,1)) # define __releases (x) __attribute __ ((reference (x, 1,0)) #define __acquire (x) __context__ (x, 1) #define __release (x) __context __ (x, -1) #define __cond_lock (x, c) ((c)? ({__acquire (x); 1;}): 0) # define __prkyu __detait __ ((noderef, address_space) My question:
- I Description want to alert report to the compiler and how sparse help.
- wha these address_space (x) References (X, X, X) and there is no purpose there?
- __nocast , __force , __username , __Secure is the purpose of ?
I think it means in the meaning of all these macros (manpage - You can find all these features and details of rare warnings). If you have taken a look in the source file you wrote above, then there is a large __ checker __
used to enable the macro.
also something with no sure their GCC at this point - I think it refers to the silence about them ... in 2004 in his e-mail Linus Torwalds One was saying this:
It is important to remember: For GCC, sparse annotations are meaningless, they can still tell programmer that "hey, That pointer was not a normal pointer to you "in a fairly readable way, but the end In the meantime, if you do not use sparse, they do not
P>
Comments
Post a Comment