1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
## BEGIN ##
Copyright 2003 Tim Yamin <plasmaroo@gentoo.org>
Martin Schlemmer <azarah@gentoo.org>
This file may freely be distributed under the conditions of the
GPLv2 as long as this header, and the following disclaimer is preserved.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## END ##
diff -ur linux-2.6.0/include/linux/bitmap.h linux-2.6.0/include/linux.gentoo/bitmap.h
--- linux-2.6.0/include/linux/bitmap.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/bitmap.h 2003-12-27 19:19:31.000000000 +0000
@@ -1,6 +1,7 @@
#ifndef __LINUX_BITMAP_H
#define __LINUX_BITMAP_H
+#ifdef __KERNEL__
#ifndef __ASSEMBLY__
#include <linux/config.h>
@@ -155,5 +156,5 @@
#endif
#endif /* __ASSEMBLY__ */
-
+#endif /* __KERNEL__ */
#endif /* __LINUX_BITMAP_H */
diff -ur linux-2.6.0/include/linux/buffer_head.h linux-2.6.0/include/linux.gentoo/buffer_head.h
--- linux-2.6.0/include/linux/buffer_head.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/buffer_head.h 2003-12-27 19:19:31.000000000 +0000
@@ -34,6 +34,8 @@
#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
+#ifdef __KERNEL__
+
struct page;
struct buffer_head;
struct address_space;
@@ -283,6 +285,8 @@
__wait_on_buffer(bh);
}
+#endif /* __KERNEL__ */
+
static inline void lock_buffer(struct buffer_head *bh)
{
while (test_set_buffer_locked(bh))
diff -ur linux-2.6.0/include/linux/compiler-gcc2.h linux-2.6.0/include/linux.gentoo/compiler-gcc2.h
--- linux-2.6.0/include/linux/compiler-gcc2.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/compiler-gcc2.h 2003-12-27 19:19:31.000000000 +0000
@@ -12,7 +12,9 @@
# define __builtin_expect(x, expected_value) (x)
#endif
+#ifndef __attribute_used__
#define __attribute_used__ __attribute__((__unused__))
+#endif
/*
* The attribute `pure' is not implemented in GCC versions earlier
diff -ur linux-2.6.0/include/linux/compiler-gcc3.h linux-2.6.0/include/linux.gentoo/compiler-gcc3.h
--- linux-2.6.0/include/linux/compiler-gcc3.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/compiler-gcc3.h 2003-12-30 23:34:55.000000000 +0000
@@ -3,6 +3,8 @@
/* These definitions are for GCC v3.x. */
#include <linux/compiler-gcc.h>
+#ifdef __KERNEL__
+
#if __GNUC_MINOR__ >= 1
# define inline __inline__ __attribute__((always_inline))
# define __inline__ __inline__ __attribute__((always_inline))
@@ -20,3 +22,5 @@
#endif
#define __attribute_pure__ __attribute__((pure))
+
+#endif /* __KERNEL__ */
diff -ur linux-2.6.0/include/linux/cpumask.h linux-2.6.0/include/linux.gentoo/cpumask.h
--- linux-2.6.0/include/linux/cpumask.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/cpumask.h 2003-12-27 19:19:31.000000000 +0000
@@ -1,6 +1,8 @@
#ifndef __LINUX_CPUMASK_H
#define __LINUX_CPUMASK_H
+#ifdef __KERNEL__
+
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/threads.h>
@@ -68,4 +70,5 @@
cpu < NR_CPUS; \
cpu = next_online_cpu(cpu,map))
+#endif /* __KERNEL__ */
#endif /* __LINUX_CPUMASK_H */
diff -ur linux-2.6.0/include/linux/ext2_fs_sb.h linux-2.6.0/include/linux.gentoo/ext2_fs_sb.h
--- linux-2.6.0/include/linux/ext2_fs_sb.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/ext2_fs_sb.h 2003-12-27 19:19:31.000000000 +0000
@@ -45,9 +45,9 @@
int s_desc_per_block_bits;
int s_inode_size;
int s_first_ino;
- u32 s_next_generation;
+ __u32 s_next_generation;
unsigned long s_dir_count;
- u8 *s_debts;
+ __u8 *s_debts;
struct percpu_counter s_freeblocks_counter;
struct percpu_counter s_freeinodes_counter;
struct percpu_counter s_dirs_counter;
diff -ur linux-2.6.0/include/linux/fb.h linux-2.6.0/include/linux.gentoo/fb.h
--- linux-2.6.0/include/linux/fb.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/fb.h 2003-12-27 19:19:31.000000000 +0000
@@ -3,8 +3,8 @@
#include <linux/tty.h>
#include <linux/workqueue.h>
+#include <linux/spinlock.h>
#include <asm/types.h>
-#include <asm/io.h>
/* Definitions of frame buffers */
@@ -339,8 +339,8 @@
__u32 scan_align; /* alignment per scanline */
__u32 flags; /* see FB_PIXMAP_* */
/* access methods */
- void (*outbuf)(u8 *dst, u8 *addr, unsigned int size);
- u8 (*inbuf) (u8 *addr);
+ void (*outbuf)(__u8 *dst, __u8 *addr, unsigned int size);
+ __u8 (*inbuf) (__u8 *addr);
spinlock_t lock; /* spinlock */
atomic_t count;
};
@@ -348,6 +348,7 @@
#include <linux/fs.h>
#include <linux/init.h>
+#include <asm/io.h>
struct fb_info;
struct vm_area_struct;
diff -ur linux-2.6.0/include/linux/isdn.h linux-2.6.0/include/linux.gentoo/isdn.h
--- linux-2.6.0/include/linux/isdn.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/isdn.h 2003-12-27 19:19:31.000000000 +0000
@@ -14,7 +14,10 @@
#define __ISDN_H__
#include <linux/ioctl.h>
+
+#ifdef __KERNEL__
#include <linux/isdn/fsm.h>
+#endif
#ifdef CONFIG_COBALT_MICRO_SERVER
/* Save memory */
diff -ur linux-2.6.0/include/linux/list.h linux-2.6.0/include/linux.gentoo/list.h
--- linux-2.6.0/include/linux/list.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/list.h 2003-12-27 19:19:31.000000000 +0000
@@ -584,7 +584,6 @@
pos && ({ n = pos->next; 1; }) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = n)
-#else
-#warning "don't include kernel headers in userspace"
+
#endif /* __KERNEL__ */
#endif
diff -ur linux-2.6.0/include/linux/mod_devicetable.h linux-2.6.0/include/linux.gentoo/mod_devicetable.h
--- linux-2.6.0/include/linux/mod_devicetable.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/mod_devicetable.h 2003-12-27 19:19:31.000000000 +0000
@@ -10,7 +10,6 @@
#ifdef __KERNEL__
#include <linux/types.h>
typedef unsigned long kernel_ulong_t;
-#endif
#define PCI_ANY_ID (~0)
@@ -147,5 +146,5 @@
#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04
#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08
-
+#endif /* __KERNEL__ */
#endif /* LINUX_MOD_DEVICETABLE_H */
diff -ur linux-2.6.0/include/linux/radix-tree.h linux-2.6.0/include/linux.gentoo/radix-tree.h
--- linux-2.6.0/include/linux/radix-tree.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/radix-tree.h 2003-12-27 19:19:31.000000000 +0000
@@ -41,6 +41,8 @@
(root)->rnode = NULL; \
} while (0)
+#ifdef __KERNEL__
+
extern int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
extern void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
extern void *radix_tree_delete(struct radix_tree_root *, unsigned long);
@@ -54,4 +56,5 @@
preempt_enable();
}
+#endif /* __KERNEL__ */
#endif /* _LINUX_RADIX_TREE_H */
diff -ur linux-2.6.0/include/linux/smp.h linux-2.6.0/include/linux.gentoo/smp.h
--- linux-2.6.0/include/linux/smp.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/smp.h 2003-12-27 19:19:31.000000000 +0000
@@ -6,6 +6,8 @@
* Alan Cox. <alan@redhat.com>
*/
+
+#ifdef __KERNEL__
#include <linux/config.h>
#ifdef CONFIG_SMP
@@ -112,4 +114,5 @@
#define put_cpu() preempt_enable()
#define put_cpu_no_resched() preempt_enable_no_resched()
+#endif /* __KERNEL__ */
#endif /* __LINUX_SMP_H */
diff -ur linux-2.6.0/include/linux/spinlock.h linux-2.6.0/include/linux.gentoo/spinlock.h
--- linux-2.6.0/include/linux/spinlock.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/spinlock.h 2003-12-27 19:19:31.000000000 +0000
@@ -183,6 +183,7 @@
#define _raw_write_trylock(lock) ({ (void)(lock); (1); })
#endif /* !SMP */
+#ifdef __KERNEL__
/*
* Define the various spin_lock and rw_lock methods. Note we define these
@@ -465,4 +466,5 @@
#endif
}
+#endif /* __KERNEL__ */
#endif /* __LINUX_SPINLOCK_H */
diff -ur linux-2.6.0/include/linux/time.h linux-2.6.0/include/linux.gentoo/time.h
--- linux-2.6.0/include/linux/time.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/time.h 2003-12-27 19:19:31.000000000 +0000
@@ -4,24 +4,31 @@
#include <asm/param.h>
#include <linux/types.h>
+#ifndef _SYS_TIME_H
#ifndef _STRUCT_TIMESPEC
+#ifndef __timespec_defined
#define _STRUCT_TIMESPEC
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
+#endif /* __timespec_defined */
#endif /* _STRUCT_TIMESPEC */
+#ifndef _STRUCT_TIMEVAL
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
+#endif /* _STRUCT_TIMEVAL */
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
+#endif /* _SYS_TIME_H */
+
#ifdef __KERNEL__
#include <linux/spinlock.h>
@@ -351,15 +358,19 @@
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
+#ifndef _TIME_H
struct itimerspec {
struct timespec it_interval; /* timer period */
struct timespec it_value; /* timer expiration */
};
+#endif /* _TIME_H */
+#ifndef _SYS_TIME_H
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
+#endif /* _SYS_TIME_H */
/*
diff -ur linux-2.6.0/include/linux/videodev.h linux-2.6.0/include/linux.gentoo/videodev.h
--- linux-2.6.0/include/linux/videodev.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/videodev.h 2003-12-27 19:19:31.000000000 +0000
@@ -3,13 +3,13 @@
#include <linux/types.h>
#include <linux/version.h>
-#include <linux/device.h>
#define HAVE_V4L2 1
#include <linux/videodev2.h>
#ifdef __KERNEL__
+#include <linux/device.h>
#include <linux/poll.h>
#include <linux/mm.h>
diff -ur linux-2.6.0/include/linux/workqueue.h linux-2.6.0/include/linux.gentoo/workqueue.h
--- linux-2.6.0/include/linux/workqueue.h 2003-12-27 19:22:38.000000000 +0000
+++ linux-2.6.0/include/linux.gentoo/workqueue.h 2003-12-27 19:19:31.000000000 +0000
@@ -5,6 +5,8 @@
#ifndef _LINUX_WORKQUEUE_H
#define _LINUX_WORKQUEUE_H
+#ifdef __KERNEL__
+
#include <linux/timer.h>
#include <linux/linkage.h>
@@ -73,5 +75,7 @@
return del_timer_sync(&work->timer);
}
+#endif /* __KERNEL__ */
+
#endif
|