X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Flinux%2Fcompiler.h;h=c811c8b979ac29643669b7e3788b089df9fc5331;hb=1212663fba7c5e003e05d24f043d5ed57eb18b24;hp=498c35920762e2e4a10ff61b1e01f9d27298e7dc;hpb=38cb162b7585d837083b8365da1eb32687c5164c;p=linux-2.6 diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 498c359207..c811c8b979 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(const void __user *); -extern void __chk_io_ptr(const void __iomem *); +extern void __chk_user_ptr(const volatile void __user *); +extern void __chk_io_ptr(const volatile void __iomem *); #else # define __user # define __kernel @@ -36,9 +36,7 @@ extern void __chk_io_ptr(const 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 && __GNUC_MINOR__ >= 2 # include @@ -134,20 +132,6 @@ extern void __chk_io_ptr(const void __iomem *); # define __maybe_unused /* unimplemented */ #endif -/* - * From the GCC manual: - * - * Many functions have no effects except the return value and their - * return value depends only on the parameters and/or global - * variables. Such a function can be subject to common subexpression - * elimination and loop optimization just as an arithmetic operator - * would be. - * [...] - */ -#ifndef __attribute_pure__ -# define __attribute_pure__ /* unimplemented */ -#endif - #ifndef noinline #define noinline #endif @@ -176,4 +160,13 @@ extern void __chk_io_ptr(const void __iomem *); # define __attribute_const__ /* unimplemented */ #endif +/* + * Tell gcc if a function is cold. The compiler will assume any path + * directly leading to the call is unlikely. + */ + +#ifndef __cold +#define __cold +#endif + #endif /* __LINUX_COMPILER_H */