LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 916|回复: 2

求linux早期版本中 /usr/include/linux目录下的compiler.h文件

[复制链接]
发表于 2007-1-20 14:59:44 | 显示全部楼层 |阅读模式
在FC6中找不到该文件,听说早期版本里有,谁有能发个给我么?
添加到附件里,多谢了!
发表于 2007-1-20 19:53:09 | 显示全部楼层
FC中去掉的东西还真不少呢

真有点不习惯了
特别是要编程序的时候
回复 支持 反对

使用道具 举报

发表于 2007-1-20 20:08:11 | 显示全部楼层
compiler.h
debian sid
  1. #ifndef __LINUX_COMPILER_H
  2. #define __LINUX_COMPILER_H
  3. #ifndef __ASSEMBLY__
  4. #ifdef __CHECKER__
  5. # define __user                __attribute__((noderef, address_space(1)))
  6. # define __kernel        /* default address space */
  7. # define __safe                __attribute__((safe))
  8. # define __force        __attribute__((force))
  9. # define __nocast        __attribute__((nocast))
  10. # define __iomem        __attribute__((noderef, address_space(2)))
  11. # define __acquires(x)        __attribute__((context(0,1)))
  12. # define __releases(x)        __attribute__((context(1,0)))
  13. # define __acquire(x)        __context__(1)
  14. # define __release(x)        __context__(-1)
  15. # define __cond_lock(x)        ((x) ? ({ __context__(1); 1; }) : 0)
  16. extern void __chk_user_ptr(void __user *);
  17. extern void __chk_io_ptr(void __iomem *);
  18. #else
  19. # define __user
  20. # define __kernel
  21. # define __safe
  22. # define __force
  23. # define __nocast
  24. # define __iomem
  25. # define __chk_user_ptr(x) (void)0
  26. # define __chk_io_ptr(x) (void)0
  27. # if !defined(__STRICT_ANSI__)
  28. #  define __builtin_warning(x, y...) (1)
  29. # endif
  30. # define __acquires(x)
  31. # define __releases(x)
  32. # define __acquire(x) (void)0
  33. # define __release(x) (void)0
  34. # define __cond_lock(x) (x)
  35. #endif
  36. #if !defined(__KERNEL__)
  37. /* Debian: Most of these are inappropriate for userspace.  */
  38. /* We don't define likely, unlikely, or barrier; they're namespace-intrusive
  39.    and should not be needed outside of __KERNEL__.  For __attribute_pure__
  40.    and __attribute_used__ we use glibc's definitions.  */
  41. # include <sys/cdefs.h>
  42. # define __deprecated
  43. #else
  44. #ifdef __KERNEL__
  45. #if __GNUC__ > 4
  46. #error no compiler-gcc.h file for this gcc version
  47. #elif __GNUC__ == 4
  48. # include <linux/compiler-gcc4.h>
  49. #elif __GNUC__ == 3
  50. # include <linux/compiler-gcc3.h>
  51. #else
  52. # error Sorry, your compiler is too old/not recognized.
  53. #endif
  54. /* Intel compiler defines __GNUC__. So we will overwrite implementations
  55. * coming from above header files here
  56. */
  57. #ifdef __INTEL_COMPILER
  58. # include <linux/compiler-intel.h>
  59. #endif
  60. /*
  61. * Generic compiler-dependent macros required for kernel
  62. * build go below this comment. Actual compiler/compiler version
  63. * specific implementations come from the above header files
  64. */
  65. #define likely(x)        __builtin_expect(!!(x), 1)
  66. #define unlikely(x)        __builtin_expect(!!(x), 0)
  67. /* Optimization barrier */
  68. #ifndef barrier
  69. # define barrier() __memory_barrier()
  70. #endif
  71. #ifndef RELOC_HIDE
  72. # define RELOC_HIDE(ptr, off)                                        \
  73.   ({ unsigned long __ptr;                                        \
  74.      __ptr = (unsigned long) (ptr);                                \
  75.     (typeof(ptr)) (__ptr + (off)); })
  76. #endif
  77. #endif /* __KERNEL__ */
  78. #endif /* __ASSEMBLY__ */
  79. #ifdef __KERNEL__
  80. /*
  81. * Allow us to mark functions as 'deprecated' and have gcc emit a nice
  82. * warning for each use, in hopes of speeding the functions removal.
  83. * Usage is:
  84. *                 int __deprecated foo(void)
  85. */
  86. #ifndef __deprecated
  87. # define __deprecated                /* unimplemented */
  88. #endif
  89. #ifdef MODULE
  90. #define __deprecated_for_modules __deprecated
  91. #else
  92. #define __deprecated_for_modules
  93. #endif
  94. #ifndef __must_check
  95. #define __must_check
  96. #endif
  97. /*
  98. * Allow us to avoid 'defined but not used' warnings on functions and data,
  99. * as well as force them to be emitted to the assembly file.
  100. *
  101. * As of gcc 3.3, static functions that are not marked with attribute((used))
  102. * may be elided from the assembly file.  As of gcc 3.3, static data not so
  103. * marked will not be elided, but this may change in a future gcc version.
  104. *
  105. * In prior versions of gcc, such functions and data would be emitted, but
  106. * would be warned about except with attribute((unused)).
  107. */
  108. #ifndef __attribute_used__
  109. # define __attribute_used__        /* unimplemented */
  110. #endif
  111. /*
  112. * From the GCC manual:
  113. *
  114. * Many functions have no effects except the return value and their
  115. * return value depends only on the parameters and/or global
  116. * variables.  Such a function can be subject to common subexpression
  117. * elimination and loop optimization just as an arithmetic operator
  118. * would be.
  119. * [...]
  120. */
  121. #ifndef __attribute_pure__
  122. # define __attribute_pure__        /* unimplemented */
  123. #endif
  124. #ifndef noinline
  125. #define noinline
  126. #endif
  127. #ifndef __always_inline
  128. #define __always_inline inline
  129. #endif
  130. #endif /* __KERNEL__ */
  131. /*
  132. * From the GCC manual:
  133. *
  134. * Many functions do not examine any values except their arguments,
  135. * and have no effects except the return value.  Basically this is
  136. * just slightly more strict class than the `pure' attribute above,
  137. * since function is not allowed to read global memory.
  138. *
  139. * Note that a function that has pointer arguments and examines the
  140. * data pointed to must _not_ be declared `const'.  Likewise, a
  141. * function that calls a non-`const' function usually must not be
  142. * `const'.  It does not make sense for a `const' function to return
  143. * `void'.
  144. */
  145. #ifndef __attribute_const__
  146. # define __attribute_const__        /* unimplemented */
  147. #endif
  148. #endif /* __KERNEL__ */
  149. #endif /* __LINUX_COMPILER_H */
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表