X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Flinux%2Fcompiler.h;h=8287a72bb6a913d01f7ca1def252880317dda297;hb=759448f459234bfcf34b82471f0dba77a9aca498;hp=538423d4a865de29981ff7a2208fb1afc77ccd43;hpb=946b92437e550d6ed80213bf54a1f383e141aede;p=mv-sheeva.git diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 538423d4a86..8287a72bb6a 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -15,8 +15,8 @@ # define __acquire(x) __context__(x,1) # define __release(x) __context__(x,-1) # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) -extern void __chk_user_ptr(void __user *); -extern void __chk_io_ptr(void __iomem *); +extern void __chk_user_ptr(const void __user *); +extern void __chk_io_ptr(const void __iomem *); #else # define __user # define __kernel @@ -36,11 +36,9 @@ extern void __chk_io_ptr(void __iomem *); #ifdef __KERNEL__ -#if __GNUC__ > 4 -#error no compiler-gcc.h file for this gcc version -#elif __GNUC__ == 4 +#if __GNUC__ >= 4 # include -#elif __GNUC__ == 3 +#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2 # include #else # error Sorry, your compiler is too old/not recognized. @@ -108,15 +106,30 @@ extern void __chk_io_ptr(void __iomem *); * Allow us to avoid 'defined but not used' warnings on functions and data, * as well as force them to be emitted to the assembly file. * - * As of gcc 3.3, static functions that are not marked with attribute((used)) - * may be elided from the assembly file. As of gcc 3.3, static data not so + * As of gcc 3.4, static functions that are not marked with attribute((used)) + * may be elided from the assembly file. As of gcc 3.4, static data not so * marked will not be elided, but this may change in a future gcc version. * + * NOTE: Because distributions shipped with a backported unit-at-a-time + * compiler in gcc 3.3, we must define __used to be __attribute__((used)) + * for gcc >=3.3 instead of 3.4. + * * In prior versions of gcc, such functions and data would be emitted, but * would be warned about except with attribute((unused)). + * + * Mark functions that are referenced only in inline assembly as __used so + * the code is emitted even though it appears to be unreferenced. */ #ifndef __attribute_used__ -# define __attribute_used__ /* unimplemented */ +# define __attribute_used__ /* deprecated */ +#endif + +#ifndef __used +# define __used /* unimplemented */ +#endif + +#ifndef __maybe_unused +# define __maybe_unused /* unimplemented */ #endif /*