1 diff -ruN valgrind-2.1.0./include/linux/compiler-gcc2.h valgrind-2.1.0/include/linux/compiler-gcc2.h
2 --- valgrind-2.1.0./include/linux/compiler-gcc2.h 1970-01-01 01:00:00.000000000 +0100
3 +++ valgrind-2.1.0/include/linux/compiler-gcc2.h 2004-01-09 08:00:12.000000000 +0100
5 +/* Never include this file directly. Include <linux/compiler.h> instead. */
7 +/* These definitions are for GCC v2.x. */
9 +/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
10 + a mechanism by which the user can annotate likely branch directions and
11 + expect the blocks to be reordered appropriately. Define __builtin_expect
12 + to nothing for earlier compilers. */
13 +#include <linux/compiler-gcc.h>
15 +#if __GNUC_MINOR__ < 96
16 +# define __builtin_expect(x, expected_value) (x)
19 +#define __attribute_used__ __attribute__((__unused__))
22 + * The attribute `pure' is not implemented in GCC versions earlier
25 +#if __GNUC_MINOR__ >= 96
26 +# define __attribute_pure__ __attribute__((pure))
28 diff -ruN valgrind-2.1.0./include/linux/compiler-gcc3.h valgrind-2.1.0/include/linux/compiler-gcc3.h
29 --- valgrind-2.1.0./include/linux/compiler-gcc3.h 1970-01-01 01:00:00.000000000 +0100
30 +++ valgrind-2.1.0/include/linux/compiler-gcc3.h 2004-01-09 07:59:03.000000000 +0100
32 +/* Never include this file directly. Include <linux/compiler.h> instead. */
34 +/* These definitions are for GCC v3.x. */
35 +#include <linux/compiler-gcc.h>
37 +#if __GNUC_MINOR__ >= 1
38 +# define inline __inline__ __attribute__((always_inline))
39 +# define __inline__ __inline__ __attribute__((always_inline))
40 +# define __inline __inline__ __attribute__((always_inline))
43 +#if __GNUC_MINOR__ > 0
44 +# define __deprecated __attribute__((deprecated))
47 +#if __GNUC_MINOR__ >= 3
48 +# define __attribute_used__ __attribute__((__used__))
50 +# define __attribute_used__ __attribute__((__unused__))
53 +#define __attribute_pure__ __attribute__((pure))
54 diff -ruN valgrind-2.1.0./include/linux/compiler-gcc.h valgrind-2.1.0/include/linux/compiler-gcc.h
55 --- valgrind-2.1.0./include/linux/compiler-gcc.h 1970-01-01 01:00:00.000000000 +0100
56 +++ valgrind-2.1.0/include/linux/compiler-gcc.h 2004-01-09 08:00:05.000000000 +0100
58 +/* Never include this file directly. Include <linux/compiler.h> instead. */
61 + * Common definitions for all gcc versions go here.
65 +/* Optimization barrier */
66 +/* The "volatile" is due to gcc bugs */
67 +#define barrier() __asm__ __volatile__("": : :"memory")
69 +/* This macro obfuscates arithmetic on a variable address so that gcc
70 + shouldn't recognize the original var, and make assumptions about it */
71 +#define RELOC_HIDE(ptr, off) \
72 + ({ unsigned long __ptr; \
73 + __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
74 + (typeof(ptr)) (__ptr + (off)); })
75 diff -ruN valgrind-2.1.0./include/linux/compiler-gcc+.h valgrind-2.1.0/include/linux/compiler-gcc+.h
76 --- valgrind-2.1.0./include/linux/compiler-gcc+.h 1970-01-01 01:00:00.000000000 +0100
77 +++ valgrind-2.1.0/include/linux/compiler-gcc+.h 2004-01-09 08:00:04.000000000 +0100
79 +/* Never include this file directly. Include <linux/compiler.h> instead. */
82 + * These definitions are for Ueber-GCC: always newer than the latest
83 + * version and hence sporting everything plus a kitchen-sink.
85 +#include <linux/compiler-gcc.h>
87 +#define inline __inline__ __attribute__((always_inline))
88 +#define __inline__ __inline__ __attribute__((always_inline))
89 +#define __inline __inline__ __attribute__((always_inline))
90 +#define __deprecated __attribute__((deprecated))
91 +#define __attribute_used__ __attribute__((__used__))
92 +#define __attribute_pure__ __attribute__((pure))
93 diff -ruN valgrind-2.1.0./include/linux/compiler.h valgrind-2.1.0/include/linux/compiler.h
94 --- valgrind-2.1.0./include/linux/compiler.h 1970-01-01 01:00:00.000000000 +0100
95 +++ valgrind-2.1.0/include/linux/compiler.h 2004-01-09 07:59:45.000000000 +0100
97 +#ifndef __LINUX_COMPILER_H
98 +#define __LINUX_COMPILER_H
101 +# define __user __attribute__((noderef, address_space(1)))
102 +# define __kernel /* default address space */
108 +#ifndef __ASSEMBLY__
110 +# include <linux/compiler-gcc+.h> /* catch-all for GCC 4, 5, etc. */
112 +# include <linux/compiler-gcc3.h>
114 +# include <linux/compiler-gcc2.h>
116 +# error Sorry, your compiler is too old/not recognized.
120 +/* Intel compiler defines __GNUC__. So we will overwrite implementations
121 + * coming from above header files here
123 +#ifdef __INTEL_COMPILER
124 +# include <linux/compiler-intel.h>
128 + * Generic compiler-dependent macros required for kernel
129 + * build go below this comment. Actual compiler/compiler version
130 + * specific implementations come from the above header files
133 +#define likely(x) __builtin_expect(!!(x), 1)
134 +#define unlikely(x) __builtin_expect(!!(x), 0)
137 + * Allow us to mark functions as 'deprecated' and have gcc emit a nice
138 + * warning for each use, in hopes of speeding the functions removal.
140 + * int __deprecated foo(void)
142 +#ifndef __deprecated
143 +# define __deprecated /* unimplemented */
147 + * Allow us to avoid 'defined but not used' warnings on functions and data,
148 + * as well as force them to be emitted to the assembly file.
150 + * As of gcc 3.3, static functions that are not marked with attribute((used))
151 + * may be elided from the assembly file. As of gcc 3.3, static data not so
152 + * marked will not be elided, but this may change in a future gcc version.
154 + * In prior versions of gcc, such functions and data would be emitted, but
155 + * would be warned about except with attribute((unused)).
157 +#ifndef __attribute_used__
158 +# define __attribute_used__ /* unimplemented */
162 + * From the GCC manual:
164 + * Many functions have no effects except the return value and their
165 + * return value depends only on the parameters and/or global
166 + * variables. Such a function can be subject to common subexpression
167 + * elimination and loop optimization just as an arithmetic operator
171 +#ifndef __attribute_pure__
172 +# define __attribute_pure__ /* unimplemented */
175 +/* Optimization barrier */
177 +# define barrier() __memory_barrier()
181 +# define RELOC_HIDE(ptr, off) \
182 + ({ unsigned long __ptr; \
183 + __ptr = (unsigned long) (ptr); \
184 + (typeof(ptr)) (__ptr + (off)); })
187 +#endif /* __LINUX_COMPILER_H */
188 diff -ruN valgrind-2.1.0./include/linux/compiler-intel.h valgrind-2.1.0/include/linux/compiler-intel.h
189 --- valgrind-2.1.0./include/linux/compiler-intel.h 1970-01-01 01:00:00.000000000 +0100
190 +++ valgrind-2.1.0/include/linux/compiler-intel.h 2004-01-09 07:59:26.000000000 +0100
192 +/* Never include this file directly. Include <linux/compiler.h> instead. */
196 +/* Some compiler specific definitions are overwritten here
197 + * for Intel ECC compiler
200 +#include <asm/intrinsics.h>
202 +/* Intel ECC compiler doesn't support gcc specific asm stmts.
203 + * It uses intrinsics to do the equivalent things.
208 +#define barrier() __memory_barrier()
210 +#define RELOC_HIDE(ptr, off) \
211 + ({ unsigned long __ptr; \
212 + __ptr = (unsigned long) (ptr); \
213 + (typeof(ptr)) (__ptr + (off)); })