ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

compiler.h
Go to the documentation of this file.
00001 #ifndef __LINUX_COMPILER_H
00002 #define __LINUX_COMPILER_H
00003 
00004 #ifndef __ASSEMBLY__
00005 
00006 #ifdef __CHECKER__
00007 # define __user     __attribute__((noderef, address_space(1)))
00008 # define __kernel   /* default address space */
00009 # define __safe     __attribute__((safe))
00010 # define __force    __attribute__((force))
00011 # define __nocast   __attribute__((nocast))
00012 # define __iomem    __attribute__((noderef, address_space(2)))
00013 # define __acquires(x)  __attribute__((context(0,1)))
00014 # define __releases(x)  __attribute__((context(1,0)))
00015 # define __acquire(x)   __context__(1)
00016 # define __release(x)   __context__(-1)
00017 # define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0)
00018 extern void __chk_user_ptr(void __user *);
00019 extern void __chk_io_ptr(void __iomem *);
00020 #else
00021 # define __user
00022 # define __kernel
00023 # define __safe
00024 # define __force
00025 # define __nocast
00026 # define __iomem
00027 # define __chk_user_ptr(x) (void)0
00028 # define __chk_io_ptr(x) (void)0
00029 //# define __builtin_warning(x, y...) (1)
00030 # define __acquires(x)
00031 # define __releases(x)
00032 # define __acquire(x) (void)0
00033 # define __release(x) (void)0
00034 # define __cond_lock(x) (x)
00035 #endif
00036 
00037 #ifdef __KERNEL__
00038 
00039 #if __GNUC__ > 4
00040 #error no compiler-gcc.h file for this gcc version
00041 #elif __GNUC__ == 4
00042 # include <linux/compiler-gcc4.h>
00043 #elif __GNUC__ == 3
00044 # include <linux/compiler-gcc3.h>
00045 #elif __GNUC__ == 2
00046 # include <linux/compiler-gcc2.h>
00047 #else
00048 # error Sorry, your compiler is too old/not recognized.
00049 #endif
00050 
00051 /* Intel compiler defines __GNUC__. So we will overwrite implementations
00052  * coming from above header files here
00053  */
00054 #ifdef __INTEL_COMPILER
00055 # include <linux/compiler-intel.h>
00056 #endif
00057 
00058 /*
00059  * Generic compiler-dependent macros required for kernel
00060  * build go below this comment. Actual compiler/compiler version
00061  * specific implementations come from the above header files
00062  */
00063 
00064 #define likely(x)   __builtin_expect(!!(x), 1)
00065 #define unlikely(x) __builtin_expect(!!(x), 0)
00066 
00067 /* Optimization barrier */
00068 #ifndef barrier
00069 # define barrier() __memory_barrier()
00070 #endif
00071 
00072 #ifndef RELOC_HIDE
00073 # define RELOC_HIDE(ptr, off)                   \
00074   ({ unsigned long __ptr;                   \
00075      __ptr = (unsigned long) (ptr);             \
00076     (typeof(ptr)) (__ptr + (off)); })
00077 #endif
00078 
00079 #endif /* __KERNEL__ */
00080 
00081 #endif /* __ASSEMBLY__ */
00082 
00083 /*
00084  * Allow us to mark functions as 'deprecated' and have gcc emit a nice
00085  * warning for each use, in hopes of speeding the functions removal.
00086  * Usage is:
00087  *      int __deprecated foo(void)
00088  */
00089 #ifndef __deprecated
00090 # define __deprecated       /* unimplemented */
00091 #endif
00092 
00093 #ifdef MODULE
00094 #define __deprecated_for_modules __deprecated
00095 #else
00096 #define __deprecated_for_modules
00097 #endif
00098 
00099 #ifndef __must_check
00100 #define __must_check
00101 #endif
00102 
00103 /*
00104  * Allow us to avoid 'defined but not used' warnings on functions and data,
00105  * as well as force them to be emitted to the assembly file.
00106  *
00107  * As of gcc 3.3, static functions that are not marked with attribute((used))
00108  * may be elided from the assembly file.  As of gcc 3.3, static data not so
00109  * marked will not be elided, but this may change in a future gcc version.
00110  *
00111  * In prior versions of gcc, such functions and data would be emitted, but
00112  * would be warned about except with attribute((unused)).
00113  */
00114 #ifndef __attribute_used__
00115 # define __attribute_used__ /* unimplemented */
00116 #endif
00117 
00118 /*
00119  * From the GCC manual:
00120  *
00121  * Many functions have no effects except the return value and their
00122  * return value depends only on the parameters and/or global
00123  * variables.  Such a function can be subject to common subexpression
00124  * elimination and loop optimization just as an arithmetic operator
00125  * would be.
00126  * [...]
00127  */
00128 #ifndef __attribute_pure__
00129 # define __attribute_pure__ /* unimplemented */
00130 #endif
00131 
00132 /*
00133  * From the GCC manual:
00134  *
00135  * Many functions do not examine any values except their arguments,
00136  * and have no effects except the return value.  Basically this is
00137  * just slightly more strict class than the `pure' attribute above,
00138  * since function is not allowed to read global memory.
00139  *
00140  * Note that a function that has pointer arguments and examines the
00141  * data pointed to must _not_ be declared `const'.  Likewise, a
00142  * function that calls a non-`const' function usually must not be
00143  * `const'.  It does not make sense for a `const' function to return
00144  * `void'.
00145  */
00146 #ifndef __attribute_const__
00147 # define __attribute_const__    /* unimplemented */
00148 #endif
00149 
00150 #ifndef noinline
00151 #define noinline
00152 #endif
00153 
00154 #ifndef __always_inline
00155 #define __always_inline inline
00156 #endif
00157 
00158 #endif /* __LINUX_COMPILER_H */

Generated on Sat May 26 2012 04:35:04 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.