]> git.pld-linux.org Git - packages/valgrind.git/blob - valgrind-kernel-headers.patch
- added kernel headers that valgrind requires
[packages/valgrind.git] / valgrind-kernel-headers.patch
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
4 @@ -0,0 +1,23 @@
5 +/* Never include this file directly.  Include <linux/compiler.h> instead.  */
6 +
7 +/* These definitions are for GCC v2.x.  */
8 +
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>
14 +
15 +#if __GNUC_MINOR__ < 96
16 +# define __builtin_expect(x, expected_value) (x)
17 +#endif
18 +
19 +#define __attribute_used__     __attribute__((__unused__))
20 +
21 +/*
22 + * The attribute `pure' is not implemented in GCC versions earlier
23 + * than 2.96.
24 + */
25 +#if __GNUC_MINOR__ >= 96
26 +# define __attribute_pure__    __attribute__((pure))
27 +#endif
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
31 @@ -0,0 +1,22 @@
32 +/* Never include this file directly.  Include <linux/compiler.h> instead.  */
33 +
34 +/* These definitions are for GCC v3.x.  */
35 +#include <linux/compiler-gcc.h>
36 +
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))
41 +#endif
42 +
43 +#if __GNUC_MINOR__ > 0
44 +# define __deprecated  __attribute__((deprecated))
45 +#endif
46 +
47 +#if __GNUC_MINOR__ >= 3
48 +# define __attribute_used__    __attribute__((__used__))
49 +#else
50 +# define __attribute_used__    __attribute__((__unused__))
51 +#endif
52 +
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
57 @@ -0,0 +1,17 @@
58 +/* Never include this file directly.  Include <linux/compiler.h> instead.  */
59 +
60 +/*
61 + * Common definitions for all gcc versions go here.
62 + */
63 +
64 +
65 +/* Optimization barrier */
66 +/* The "volatile" is due to gcc bugs */
67 +#define barrier() __asm__ __volatile__("": : :"memory")
68 +
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
78 @@ -0,0 +1,14 @@
79 +/* Never include this file directly.  Include <linux/compiler.h> instead.  */
80 +
81 +/*
82 + * These definitions are for Ueber-GCC: always newer than the latest
83 + * version and hence sporting everything plus a kitchen-sink.
84 + */
85 +#include <linux/compiler-gcc.h>
86 +
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
96 @@ -0,0 +1,91 @@
97 +#ifndef __LINUX_COMPILER_H
98 +#define __LINUX_COMPILER_H
99 +
100 +#ifdef __CHECKER__
101 +# define __user                __attribute__((noderef, address_space(1)))
102 +# define __kernel      /* default address space */
103 +#else
104 +# define __user
105 +# define __kernel
106 +#endif
107 +
108 +#ifndef __ASSEMBLY__
109 +#if __GNUC__ > 3
110 +# include <linux/compiler-gcc+.h>      /* catch-all for GCC 4, 5, etc. */
111 +#elif __GNUC__ == 3
112 +# include <linux/compiler-gcc3.h>
113 +#elif __GNUC__ == 2
114 +# include <linux/compiler-gcc2.h>
115 +#else
116 +# error Sorry, your compiler is too old/not recognized.
117 +#endif
118 +#endif
119 +
120 +/* Intel compiler defines __GNUC__. So we will overwrite implementations
121 + * coming from above header files here
122 + */
123 +#ifdef __INTEL_COMPILER
124 +# include <linux/compiler-intel.h>
125 +#endif
126 +
127 +/*
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
131 + */
132 +
133 +#define likely(x)      __builtin_expect(!!(x), 1)
134 +#define unlikely(x)    __builtin_expect(!!(x), 0)
135 +
136 +/*
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.
139 + * Usage is:
140 + *             int __deprecated foo(void)
141 + */
142 +#ifndef __deprecated
143 +# define __deprecated          /* unimplemented */
144 +#endif
145 +
146 +/*
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.
149 + *
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.
153 + *
154 + * In prior versions of gcc, such functions and data would be emitted, but
155 + * would be warned about except with attribute((unused)).
156 + */
157 +#ifndef __attribute_used__
158 +# define __attribute_used__    /* unimplemented */
159 +#endif
160 +
161 +/*
162 + * From the GCC manual:
163 + *
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
168 + * would be.
169 + * [...]
170 + */
171 +#ifndef __attribute_pure__
172 +# define __attribute_pure__    /* unimplemented */
173 +#endif
174 +
175 +/* Optimization barrier */
176 +#ifndef barrier
177 +# define barrier() __memory_barrier()
178 +#endif
179 +
180 +#ifndef RELOC_HIDE
181 +# define RELOC_HIDE(ptr, off)                                  \
182 +  ({ unsigned long __ptr;                                      \
183 +     __ptr = (unsigned long) (ptr);                            \
184 +    (typeof(ptr)) (__ptr + (off)); })
185 +#endif
186 +
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
191 @@ -0,0 +1,24 @@
192 +/* Never include this file directly.  Include <linux/compiler.h> instead.  */
193 +
194 +#ifdef __ECC
195 +
196 +/* Some compiler specific definitions are overwritten here
197 + * for Intel ECC compiler
198 + */
199 +
200 +#include <asm/intrinsics.h>
201 +
202 +/* Intel ECC compiler doesn't support gcc specific asm stmts.
203 + * It uses intrinsics to do the equivalent things.
204 + */
205 +#undef barrier
206 +#undef RELOC_HIDE
207 +
208 +#define barrier() __memory_barrier()
209 +
210 +#define RELOC_HIDE(ptr, off)                                   \
211 +  ({ unsigned long __ptr;                                      \
212 +     __ptr = (unsigned long) (ptr);                            \
213 +    (typeof(ptr)) (__ptr + (off)); })
214 +
215 +#endif
This page took 0.05246 seconds and 3 git commands to generate.