* All arch maintainers: 'make headers_check' fails on most architectures.
@ 2006-09-12 16:44 David Woodhouse
2006-09-14 22:34 ` [PATCH] [1/5] Fix 'make headers_check' on biarch architectures for 2.6.18 David Woodhouse
` (15 more replies)
0 siblings, 16 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-12 16:44 UTC (permalink / raw)
To: linux-arch
Basically all but PowerPC and i386 have problems; and the latter works
only if you apply the patches I sent to Linus a few days ago.
This is just a basic check that the headers which _are_ exported don't
try to include other headers which aren't. This can happen either
because the former should not, or the latter _should_ be exported.
Mostly, however, the solution is just to make sure the latter is
included only within #ifdef __KERNEL__, because it's only needed within
that ifdef anyway.
Admittedly, much of the time this is only seen in files like asm/page.h
or asm/elf.h which we really don't expect anyone in userspace to be
using anyway -- but it would be good to fix them anyway.
Omitting the headers for which I've already sent patches to Linus, these
are the remaining problems found by running the scripts/hdrcheck.sh over
the exported kernel headers (automatically exported from Linus' current
tree, and available from
git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/kernel-headers.git )
$ for ARCH in `ls -d asm* | cut -c5- | grep -v generic`; do rm -f asm ; ln -sf asm-$ARCH asm ; for FILE in asm-$ARCH/*.h ; do ../linux-2.6/scripts/hdrcheck.sh . $FILE ; done ; done
asm-alpha/byteorder.h requires asm/compiler.h, which does not exist
asm-alpha/page.h requires asm-generic/memory_model.h, which does not exist
asm-arm/elf.h requires asm/procinfo.h, which does not exist
asm-arm/page.h requires asm-generic/page.h, which does not exist
asm-arm26/elf.h requires asm/procinfo.h, which does not exist
asm-arm26/page.h requires asm-generic/page.h, which does not exist
asm-cris/byteorder.h requires asm/arch/byteorder.h, which does not exist
asm-cris/elf.h requires asm/arch/elf.h, which does not exist
asm-cris/page.h requires asm/arch/page.h, which does not exist
asm-cris/posix_types.h requires asm/bitops.h, which does not exist
asm-cris/ptrace.h requires asm/arch/ptrace.h, which does not exist
asm-cris/termios.h requires asm/rs485.h, which does not exist
asm-cris/unistd.h requires asm/arch/unistd.h, which does not exist
asm-cris/user.h requires asm/arch/user.h, which does not exist
asm-frv/page.h requires asm-generic/memory_model.h, which does not exist
asm-frv/ptrace.h requires asm/registers.h, which does not exist
asm-frv/sigcontext.h requires asm/registers.h, which does not exist
asm-frv/termios.h requires asm-generic/termios.h, which does not exist
asm-frv/user.h requires asm/registers.h, which does not exist
asm-h8300/page.h requires asm-generic/memory_model.h, which does not exist
asm-ia64/ptrace.h requires asm/asm-offsets.h, which does not exist
asm-ia64/resource.h requires asm/ustack.h, which does not exist
asm-m32r/page.h requires asm-generic/memory_model.h, which does not exist
asm-m32r/ptrace.h requires asm/m32r.h, which does not exist
asm-m32r/signal.h requires linux/linkage.h, which does not exist
asm-m32r/unistd.h requires asm/syscall.h, which does not exist
asm-m32r/user.h requires asm/processor.h, which does not exist
asm-m68k/page.h requires asm-generic/page.h, which does not exist
asm-m68knommu/page.h requires asm-generic/page.h, which does not exist
asm-mips/page.h requires asm-generic/memory_model.h, which does not exist
asm-mips/posix_types.h requires asm/sgidefs.h, which does not exist
asm-mips/ptrace.h requires asm/isadep.h, which does not exist
asm-mips/sigcontext.h requires asm/sgidefs.h, which does not exist
asm-mips/statfs.h requires asm/sgidefs.h, which does not exist
asm-mips/stat.h requires asm/sgidefs.h, which does not exist
asm-mips/unistd.h requires asm/sgidefs.h, which does not exist
asm-mips/user.h requires asm/reg.h, which does not exist
asm-parisc/page.h requires asm-generic/memory_model.h, which does not exist
asm-s390/debug.h requires linux/string.h, which does not exist
asm-s390/elf.h requires asm/system.h, which does not exist
asm-sh/page.h requires asm-generic/memory_model.h, which does not exist
asm-sh/ptrace.h requires asm/ubc.h, which does not exist
asm-sh64/page.h requires asm-generic/memory_model.h, which does not exist
asm-sh64/shmparam.h requires asm/cache.h, which does not exist
asm-sh64/signal.h requires asm/processor.h, which does not exist
asm-sh64/user.h requires asm/processor.h, which does not exist
asm-sparc/auxio.h requires asm/system.h, which does not exist
asm-sparc/page.h requires asm-generic/memory_model.h, which does not exist
asm-sparc/pbm.h requires asm/oplib.h, which does not exist
asm-sparc/pgtsun4.h requires asm/contregs.h, which does not exist
asm-sparc/turbosparc.h requires asm/pgtsrmmu.h, which does not exist
asm-sparc64/floppy.h requires linux/init.h, which does not exist
asm-sparc64/kdebug.h requires linux/notifier.h, which does not exist
asm-sparc64/mostek.h requires asm/idprom.h, which does not exist
asm-sparc64/page.h requires asm/const.h, which does not exist
asm-sparc64/parport.h requires asm/ebus.h, which does not exist
asm-sparc64/pstate.h requires asm/const.h, which does not exist
asm-sparc64/shmparam.h requires asm/spitfire.h, which does not exist
asm-um/page.h requires asm/vm-flags.h, which does not exist
asm-um/unistd.h requires linux/syscalls.h, which does not exist
asm-v850/page.h requires asm/machdep.h, which does not exist
asm-v850/param.h requires asm/machdep.h, which does not exist
asm-x86_64/elf.h requires asm/processor.h, which does not exist
asm-x86_64/signal.h requires linux/linkage.h, which does not exist
asm-x86_64/unistd.h requires linux/linkage.h, which does not exist
asm-x86_64/vsyscall.h requires linux/seqlock.h, which does not exist
asm-xtensa/byteorder.h requires asm/processor.h, which does not exist
asm-xtensa/elf.h requires asm/coprocessor.h, which does not exist
asm-xtensa/page.h requires asm-generic/memory_model.h, which does not exist
asm-xtensa/shmparam.h requires asm/processor.h, which does not exist
asm-xtensa/sigcontext.h requires asm/processor.h, which does not exist
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH] [1/5] Fix 'make headers_check' on biarch architectures for 2.6.18
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
@ 2006-09-14 22:34 ` David Woodhouse
2006-09-14 22:35 ` [PATCH] [2/5] Fix 'make headers_check' on s390 " David Woodhouse
` (14 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-14 22:34 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-arch
We generate an <asm/foo.h> which includes either <asm-$ARCH/foo.h> or
<asm-$ALTARCH/foo.h> as appropriate. But we were doing this dependent on
whether the file in question existed in the _unexported_ tree, not the
exported tree. So if a file was exported to userspace in one asm-
directory but not the other, the generated file in asm/ was incorrect.
This only changed the failure mode if it _was_ included from a nice
#error to a less explicable #include failure -- but it also gave false
errors in 'make headers_check' output. Fix it by looking in the right
place instead.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index aa9990a..12e1daf 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -93,14 +93,14 @@ (echo "/* File autogenerated by 'make he
echo "\#ifndef $$STUBDEF" ; \
echo "\#define $$STUBDEF" ; \
echo "\# if $(ARCHDEF)" ; \
-if [ -r $(srctree)/include/$(archasm)/$@ ]; then \
+if [ -r $(INSTALL_HDR_PATH)/include/$(archasm)/$@ ]; then \
echo "\# include <$(archasm)/$@>" ; \
else \
echo "\# error $(archasm)/$@ does not exist in" \
"the $(ARCH) architecture" ; \
fi ; \
echo "\# elif $(ALTARCHDEF)" ; \
-if [ -r $(srctree)/include/$(altarchasm)/$@ ]; then \
+if [ -r $(INSTALL_HDR_PATH)/include/$(altarchasm)/$@ ]; then \
echo "\# include <$(altarchasm)/$@>" ; \
else \
echo "\# error $(altarchasm)/$@ does not exist in" \
@@ -149,7 +149,9 @@ endif
hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
.PHONY: altarch-dir
-altarch-dir:
+# All the files in the normal arch dir must be created first, since we test
+# for their existence.
+altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y)
$(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
$(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH] [2/5] Fix 'make headers_check' on s390 for 2.6.18
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-14 22:34 ` [PATCH] [1/5] Fix 'make headers_check' on biarch architectures for 2.6.18 David Woodhouse
@ 2006-09-14 22:35 ` David Woodhouse
2006-09-15 8:25 ` Martin Schwidefsky
2006-09-14 22:36 ` [PATCH] [3/5] Fix 'make headers_check' on ia64 " David Woodhouse
` (13 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: David Woodhouse @ 2006-09-14 22:35 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-arch
On Tue, 2006-09-12 at 17:44 +0100, David Woodhouse wrote:
> asm-s390/debug.h requires linux/string.h, which does not exist
> asm-s390/elf.h requires asm/system.h, which does not exist
Move things around slightly so the right things end up within
#ifdef __KERNEL__ and thus don't pollute the exported headers.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 7f1ef99..c00dd2b 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -10,7 +10,6 @@ #ifndef DEBUG_H
#define DEBUG_H
#include <linux/fs.h>
-#include <linux/string.h>
/* Note:
* struct __debug_entry must be defined outside of #ifdef __KERNEL__
@@ -35,6 +34,7 @@ struct __debug_entry{
#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
#ifdef __KERNEL__
+#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/time.h>
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h
index 710646e..c0d629d 100644
--- a/include/asm-s390/elf.h
+++ b/include/asm-s390/elf.h
@@ -93,19 +93,6 @@ #define R_390_TLS_GOTIE20 60 /* 20 bit G
#define R_390_NUM 61
/*
- * ELF register definitions..
- */
-
-#include <linux/sched.h> /* for task_struct */
-#include <asm/ptrace.h>
-#include <asm/user.h>
-#include <asm/system.h> /* for save_access_regs */
-
-
-typedef s390_fp_regs elf_fpregset_t;
-typedef s390_regs elf_gregset_t;
-
-/*
* These are used to set parameters in the core dumps.
*/
#ifndef __s390x__
@@ -117,6 +104,20 @@ #define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_S390
/*
+ * ELF register definitions..
+ */
+
+#include <asm/ptrace.h>
+#include <asm/user.h>
+
+typedef s390_fp_regs elf_fpregset_t;
+typedef s390_regs elf_gregset_t;
+
+#ifdef __KERNEL__
+#include <linux/sched.h> /* for task_struct */
+#include <asm/system.h> /* for save_access_regs */
+
+/*
* This is used to ensure we don't load something for the wrong architecture.
*/
#define elf_check_arch(x) \
@@ -198,7 +199,6 @@ #define ELF_HWCAP (0)
#define ELF_PLATFORM (NULL)
-#ifdef __KERNEL__
#ifndef __s390x__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
#else /* __s390x__ */
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH] [3/5] Fix 'make headers_check' on ia64 for 2.6.18
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-14 22:34 ` [PATCH] [1/5] Fix 'make headers_check' on biarch architectures for 2.6.18 David Woodhouse
2006-09-14 22:35 ` [PATCH] [2/5] Fix 'make headers_check' on s390 " David Woodhouse
@ 2006-09-14 22:36 ` David Woodhouse
2006-09-14 22:36 ` [PATCH] [4/5] Fix 'make headers_check' on x86_64 " David Woodhouse
` (12 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-14 22:36 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-arch
On Tue, 2006-09-12 at 17:44 +0100, David Woodhouse wrote:
> asm-ia64/ptrace.h requires asm/asm-offsets.h, which does not exist
> asm-ia64/resource.h requires asm/ustack.h, which does not exist
Hide parts which shouldn't be visible to userspace.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
index 85d6f80..f1cb00f 100644
--- a/include/asm-ia64/Kbuild
+++ b/include/asm-ia64/Kbuild
@@ -4,4 +4,4 @@ header-y += break.h fpu.h fpswa.h gcc_in
intel_intrin.h intrinsics.h perfmon_default_smpl.h \
ptrace_offsets.h rse.h setup.h ucontext.h
-unifdef-y += perfmon.h
+unifdef-y += perfmon.h ustack.h
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index f5a949e..947cb72 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -7,6 +7,7 @@ #define _ASM_IA64_PAGE_H
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
+# ifdef __KERNEL__
#include <asm/intrinsics.h>
#include <asm/types.h>
@@ -64,7 +65,6 @@ #ifdef __ASSEMBLY__
# define __pa(x) ((x) - PAGE_OFFSET)
# define __va(x) ((x) + PAGE_OFFSET)
#else /* !__ASSEMBLY */
-# ifdef __KERNEL__
# define STRICT_MM_TYPECHECKS
extern void clear_page (void *page);
@@ -174,7 +174,6 @@ get_order (unsigned long size)
return order;
}
-# endif /* __KERNEL__ */
#endif /* !__ASSEMBLY__ */
#ifdef STRICT_MM_TYPECHECKS
@@ -228,4 +227,5 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ
(((current->personality & READ_IMPLIES_EXEC) != 0) \
? VM_EXEC : 0))
+# endif /* __KERNEL__ */
#endif /* _ASM_IA64_PAGE_H */
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 415abb2..1414316 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -56,6 +56,8 @@ #define _ASM_IA64_PTRACE_H
#include <asm/fpu.h>
+
+#ifdef __KERNEL__
#ifndef ASM_OFFSETS_C
#include <asm/asm-offsets.h>
#endif
@@ -79,10 +81,9 @@ #define IA64_STK_OFFSET ((1 << KERNEL_
#define KERNEL_STACK_SIZE IA64_STK_OFFSET
-#ifndef __ASSEMBLY__
+#endif /* __KERNEL__ */
-#include <asm/current.h>
-#include <asm/page.h>
+#ifndef __ASSEMBLY__
/*
* This struct defines the way the registers are saved on system
@@ -229,6 +230,9 @@ struct switch_stack {
#ifdef __KERNEL__
+#include <asm/current.h>
+#include <asm/page.h>
+
#define __ARCH_SYS_PTRACE 1
/*
diff --git a/include/asm-ia64/ustack.h b/include/asm-ia64/ustack.h
index da55c91..a349467 100644
--- a/include/asm-ia64/ustack.h
+++ b/include/asm-ia64/ustack.h
@@ -5,12 +5,15 @@ #define _ASM_IA64_USTACK_H
* Constants for the user stack size
*/
+#ifdef __KERNEL__
#include <asm/page.h>
/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2)
-/* Make a default stack size of 2GB */
-#define DEFAULT_USER_STACK_SIZE (1UL << 31)
#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT)
+#endif
+
+/* Make a default stack size of 2GiB */
+#define DEFAULT_USER_STACK_SIZE (1UL << 31)
#endif /* _ASM_IA64_USTACK_H */
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH] [4/5] Fix 'make headers_check' on x86_64 for 2.6.18
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (2 preceding siblings ...)
2006-09-14 22:36 ` [PATCH] [3/5] Fix 'make headers_check' on ia64 " David Woodhouse
@ 2006-09-14 22:36 ` David Woodhouse
2006-09-14 22:37 ` [PATCH] [5/5] Fix 'make headers_check' on i386 " David Woodhouse
` (11 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-14 22:36 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-arch
On Tue, 2006-09-12 at 17:44 +0100, David Woodhouse wrote:
> asm-x86_64/elf.h requires asm/processor.h, which does not exist
> asm-x86_64/signal.h requires linux/linkage.h, which does not exist
> asm-x86_64/unistd.h requires linux/linkage.h, which does not exist
> asm-x86_64/vsyscall.h requires linux/seqlock.h, which does not exist
Again, move stuff which shouldn't be visible inside (mostly already
existing) #ifdef __KERNEL__.
This fixes a bunch of mislabelled and unlabelled #endifs in unistd.h and
also cleans that up to conform with what's visible on other
architectures, since the minimal fix for the error reported about would
have involved a more intrusive patch, renesting other ifdefs.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h
index b4f8f4a..a406fcb 100644
--- a/include/asm-x86_64/elf.h
+++ b/include/asm-x86_64/elf.h
@@ -7,8 +7,6 @@ #define __ASM_X86_64_ELF_H
#include <asm/ptrace.h>
#include <asm/user.h>
-#include <asm/processor.h>
-#include <asm/compat.h>
/* x86-64 relocation types */
#define R_X86_64_NONE 0 /* No reloc */
@@ -39,18 +37,23 @@ typedef elf_greg_t elf_gregset_t[ELF_NGR
typedef struct user_i387_struct elf_fpregset_t;
/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x) \
- ((x)->e_machine == EM_X86_64)
-
-/*
* These are used to set parameters in the core dumps.
*/
#define ELF_CLASS ELFCLASS64
#define ELF_DATA ELFDATA2LSB
#define ELF_ARCH EM_X86_64
+#ifdef __KERNEL__
+#include <asm/processor.h>
+#include <asm/compat.h>
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) \
+ ((x)->e_machine == EM_X86_64)
+
+
/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
contains a pointer to a function which might be registered using `atexit'.
This provides a mean for the dynamic linker to call DT_FINI functions for
@@ -141,7 +144,6 @@ #define ELF_HWCAP (boot_cpu_data.x86_cap
/* I'm not sure if we can use '-' here */
#define ELF_PLATFORM ("x86_64")
-#ifdef __KERNEL__
extern void set_personality_64bit(void);
#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit()
/*
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h
index cef7a7d..3ede2a6 100644
--- a/include/asm-x86_64/signal.h
+++ b/include/asm-x86_64/signal.h
@@ -3,13 +3,13 @@ #define _ASMx8664_SIGNAL_H
#ifndef __ASSEMBLY__
#include <linux/types.h>
-#include <linux/linkage.h>
#include <linux/time.h>
/* Avoid too many header ordering problems. */
struct siginfo;
#ifdef __KERNEL__
+#include <linux/linkage.h>
/* Most things should be clean enough to redefine this at will, if care
is taken to make libc match. */
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 2d89d30..80fd48e 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -620,6 +620,8 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice)
#define __NR_move_pages 279
__SYSCALL(__NR_move_pages, sys_move_pages)
+#ifdef __KERNEL__
+
#define __NR_syscall_max __NR_move_pages
#ifndef __NO_STUBS
@@ -744,8 +746,6 @@ __syscall_return(type,__res); \
#else /* __KERNEL_SYSCALLS__ */
-#ifdef __KERNEL__
-
#include <linux/syscalls.h>
#include <asm/ptrace.h>
@@ -821,8 +821,6 @@ asmlinkage long sys_fork(struct pt_regs
asmlinkage long sys_vfork(struct pt_regs regs);
asmlinkage long sys_pipe(int *fildes);
-#endif /* __KERNEL_SYSCALLS__ */
-
#ifndef __ASSEMBLY__
#include <linux/linkage.h>
@@ -838,9 +836,9 @@ asmlinkage long sys_rt_sigaction(int sig
struct sigaction __user *oact,
size_t sigsetsize);
-#endif
+#endif /* __ASSEMBLY__ */
-#endif
+#endif /* __KERNEL_SYSCALLS__ */
/*
* "Conditional" syscalls
@@ -850,6 +848,8 @@ #endif
*/
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
-#endif
+#endif /* __NO_STUBS */
-#endif
+#endif /* __KERNEL__ */
+
+#endif /* _ASM_X86_64_UNISTD_H_ */
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index a85e16f..146b244 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -1,8 +1,6 @@
#ifndef _ASM_X86_64_VSYSCALL_H_
#define _ASM_X86_64_VSYSCALL_H_
-#include <linux/seqlock.h>
-
enum vsyscall_num {
__NR_vgettimeofday,
__NR_vtime,
@@ -14,6 +12,7 @@ #define VSYSCALL_END (-2UL << 20)
#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
#ifdef __KERNEL__
+#include <linux/seqlock.h>
#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH] [5/5] Fix 'make headers_check' on i386 for 2.6.18
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (3 preceding siblings ...)
2006-09-14 22:36 ` [PATCH] [4/5] Fix 'make headers_check' on x86_64 " David Woodhouse
@ 2006-09-14 22:37 ` David Woodhouse
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (10 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-14 22:37 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-arch
This brings i386 asm/unistd.h into consistency with other architectures
by not exporting functionality which is not necessary.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index d983b74..fc1c8dd 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -324,6 +324,8 @@ #define __NR_tee 315
#define __NR_vmsplice 316
#define __NR_move_pages 317
+#ifdef __KERNEL__
+
#define NR_syscalls 318
/*
@@ -423,8 +425,6 @@ __asm__ volatile ("push %%ebp ; push %%e
__syscall_return(type,__res); \
}
-#ifdef __KERNEL__
-
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_OLD_STAT
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH] [2/5] Fix 'make headers_check' on s390 for 2.6.18
2006-09-14 22:35 ` [PATCH] [2/5] Fix 'make headers_check' on s390 " David Woodhouse
@ 2006-09-15 8:25 ` Martin Schwidefsky
0 siblings, 0 replies; 40+ messages in thread
From: Martin Schwidefsky @ 2006-09-15 8:25 UTC (permalink / raw)
To: David Woodhouse; +Cc: torvalds, akpm, linux-arch
On Thu, 2006-09-14 at 23:35 +0100, David Woodhouse wrote:
> > asm-s390/debug.h requires linux/string.h, which does not exist
> > asm-s390/elf.h requires asm/system.h, which does not exist
>
> Move things around slightly so the right things end up within
> #ifdef __KERNEL__ and thus don't pollute the exported headers.
Thanks David, looks good.
--
blue skies,
Martin.
Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (4 preceding siblings ...)
2006-09-14 22:37 ` [PATCH] [5/5] Fix 'make headers_check' on i386 " David Woodhouse
@ 2006-09-17 7:39 ` David Woodhouse
2006-09-17 11:51 ` Paul Mundt
` (5 more replies)
2006-09-17 9:52 ` Geert Uytterhoeven
` (9 subsequent siblings)
15 siblings, 6 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-17 7:39 UTC (permalink / raw)
To: linux-arch
Cc: spyro, starvik, ysato, takata, geert, lethal, davem, wli, jdike,
uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Tue, 2006-09-12 at 17:44 +0100, David Woodhouse wrote:
> Basically all but PowerPC and i386 have problems; and the latter works
> only if you apply the patches I sent to Linus a few days ago.
>
> This is just a basic check that the headers which _are_ exported don't
> try to include other headers which aren't. This can happen either
> because the former should not, or the latter _should_ be exported.
> Mostly, however, the solution is just to make sure the latter is
> included only within #ifdef __KERNEL__, because it's only needed within
> that ifdef anyway.
As of today, a number of other architectures are fixed and we're left
with a few stragglers whose headers may not be clean in the
linux-kernel-headers tarball I intend to make based on the 2.6.18
release.
These have been fixed in patches which the architecture maintainer has
already sent to Linus:
asm-mips/posix_types.h requires asm/sgidefs.h, which does not exist in exported headers
asm-mips/ptrace.h requires asm/isadep.h, which does not exist in exported headers
asm-mips/sigcontext.h requires asm/sgidefs.h, which does not exist in exported headers
asm-mips/statfs.h requires asm/sgidefs.h, which does not exist in exported headers
asm-mips/stat.h requires asm/sgidefs.h, which does not exist in exported headers
asm-mips/unistd.h requires asm/sgidefs.h, which does not exist in exported headers
asm-mips/user.h requires asm/reg.h, which does not exist in exported headers
asm-parisc/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-frv/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-frv/ptrace.h requires asm/registers.h, which does not exist in exported headers
asm-frv/sigcontext.h requires asm/registers.h, which does not exist in exported headers
asm-frv/termios.h requires asm-generic/termios.h, which does not exist in exported headers
asm-frv/user.h requires asm/registers.h, which does not exist in exported headers
These have patches which have been sent to the arch maintainer but which
I believe have not yet been forwarded to Linus:
asm-arm/elf.h requires asm/procinfo.h, which does not exist in exported headers
asm-arm/page.h requires asm-generic/page.h, which does not exist in exported headers
And these remain broken with no word from the maintainer. I've directly
Cc'd some arch maintainers this time in case they're not subscribed to
linux-arch:
asm-arm26/elf.h requires asm/procinfo.h, which does not exist in exported headers
asm-arm26/page.h requires asm-generic/page.h, which does not exist in exported headers
asm-cris/byteorder.h requires asm/arch/byteorder.h, which does not exist in exported headers
asm-cris/elf.h requires asm/arch/elf.h, which does not exist in exported headers
asm-cris/page.h requires asm/arch/page.h, which does not exist in exported headers
asm-cris/posix_types.h requires asm/bitops.h, which does not exist in exported headers
asm-cris/ptrace.h requires asm/arch/ptrace.h, which does not exist in exported headers
asm-cris/termios.h requires asm/rs485.h, which does not exist in exported headers
asm-cris/unistd.h requires asm/arch/unistd.h, which does not exist in exported headers
asm-cris/user.h requires asm/arch/user.h, which does not exist in exported headers
asm-h8300/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-m32r/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-m32r/ptrace.h requires asm/m32r.h, which does not exist in exported headers
asm-m32r/signal.h requires linux/linkage.h, which does not exist in exported headers
asm-m32r/unistd.h requires asm/syscall.h, which does not exist in exported headers
asm-m32r/user.h requires asm/processor.h, which does not exist in exported headers
asm-m68k/page.h requires asm-generic/page.h, which does not exist in exported headers
asm-m68knommu/page.h requires asm-generic/page.h, which does not exist in exported headers
asm-sh/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-sh/ptrace.h requires asm/ubc.h, which does not exist in exported headers
asm-sh64/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-sh64/shmparam.h requires asm/cache.h, which does not exist in exported headers
asm-sh64/signal.h requires asm/processor.h, which does not exist in exported headers
asm-sh64/user.h requires asm/processor.h, which does not exist in exported headers
asm-sparc/auxio.h requires asm/system.h, which does not exist in exported headers
asm-sparc/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-sparc/pbm.h requires asm/oplib.h, which does not exist in exported headers
asm-sparc/pgtsun4.h requires asm/contregs.h, which does not exist in exported headers
asm-sparc/turbosparc.h requires asm/pgtsrmmu.h, which does not exist in exported headers
asm-sparc64/floppy.h requires linux/init.h, which does not exist in exported headers
asm-sparc64/kdebug.h requires linux/notifier.h, which does not exist in exported headers
asm-sparc64/mostek.h requires asm/idprom.h, which does not exist in exported headers
asm-sparc64/page.h requires asm/const.h, which does not exist in exported headers
asm-sparc64/parport.h requires asm/ebus.h, which does not exist in exported headers
asm-sparc64/pstate.h requires asm/const.h, which does not exist in exported headers
asm-sparc64/shmparam.h requires asm/spitfire.h, which does not exist in exported headers
asm-um/page.h requires asm/vm-flags.h, which does not exist in exported headers
asm-um/unistd.h requires linux/syscalls.h, which does not exist in exported headers
asm-v850/page.h requires asm/machdep.h, which does not exist in exported headers
asm-v850/param.h requires asm/machdep.h, which does not exist in exported headers
asm-xtensa/byteorder.h requires asm/processor.h, which does not exist in exported headers
asm-xtensa/elf.h requires asm/coprocessor.h, which does not exist in exported headers
asm-xtensa/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
asm-xtensa/shmparam.h requires asm/processor.h, which does not exist in exported headers
asm-xtensa/sigcontext.h requires asm/processor.h, which does not exist in exported headers
It may be that UM and ARM26 don't need to be exporting headers, because
they can use headers from the host architecture and from ARM32,
respectively. If that's the case, we should just remove the Kbuild files
from those architectures' include directories.
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (5 preceding siblings ...)
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
@ 2006-09-17 9:52 ` Geert Uytterhoeven
2006-09-17 10:36 ` David Woodhouse
2006-09-18 1:27 ` [patch 0/8] " Arnd Bergmann
` (8 subsequent siblings)
15 siblings, 1 reply; 40+ messages in thread
From: Geert Uytterhoeven @ 2006-09-17 9:52 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, Geert Uytterhoeven
On Tue, 12 Sep 2006, David Woodhouse wrote:
> This is just a basic check that the headers which _are_ exported don't
> try to include other headers which aren't. This can happen either
> because the former should not, or the latter _should_ be exported.
> Mostly, however, the solution is just to make sure the latter is
> included only within #ifdef __KERNEL__, because it's only needed within
> that ifdef anyway.
>
> Admittedly, much of the time this is only seen in files like asm/page.h
> or asm/elf.h which we really don't expect anyone in userspace to be
> using anyway -- but it would be good to fix them anyway.
> asm-m68k/page.h requires asm-generic/page.h, which does not exist
Like this?
--- linux-2.6.18-rc7/include/asm-m68k/page.h.orig 2006-09-04 11:03:01.000000000 +0200
+++ linux-2.6.18-rc7/include/asm-m68k/page.h 2006-09-17 11:44:09.000000000 +0200
@@ -2,6 +2,8 @@
#define _M68K_PAGE_H
+#ifdef __KERNEL__
+
/* PAGE_SHIFT determines the page size */
#ifndef CONFIG_SUN3
#define PAGE_SHIFT (12)
@@ -15,8 +17,6 @@
#endif
#define PAGE_MASK (~(PAGE_SIZE-1))
-#ifdef __KERNEL__
-
#include <asm/setup.h>
#if PAGE_SHIFT < 13
@@ -175,8 +175,8 @@ static inline void *__va(unsigned long x
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-#endif /* __KERNEL__ */
-
#include <asm-generic/page.h>
+#endif /* __KERNEL__ */
+
#endif /* _M68K_PAGE_H */
BTW, what about adding headers_check to `make help'?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 9:52 ` Geert Uytterhoeven
@ 2006-09-17 10:36 ` David Woodhouse
0 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-17 10:36 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-arch, akpm, torvalds
On Sun, 2006-09-17 at 11:52 +0200, Geert Uytterhoeven wrote:
> > asm-m68k/page.h requires asm-generic/page.h, which does not exist
>
> Like this?
Looks sane to me, yes. Thanks. Care to add a Signed-off-by and send it
to Linus?
> BTW, what about adding headers_check to `make help'?
Yeah, good idea.
----
[PATCH] Add headers_check' target to output of 'make help'
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/Makefile b/Makefile
index eab5a8c..7646fc9 100644
--- a/Makefile
+++ b/Makefile
@@ -1082,6 +1082,7 @@ help:
@echo 'Static analysers'
@echo ' checkstack - Generate a list of stack hogs'
@echo ' namespacecheck - Name space analysis on compiled kernel'
+ @echo ' headers_check - Sanity check on exported headers'
@echo ''
@echo 'Kernel packaging:'
@$(MAKE) $(build)=$(package-dir) help
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
@ 2006-09-17 11:51 ` Paul Mundt
2006-09-17 12:10 ` David Woodhouse
2006-09-17 11:56 ` Paul Mundt
` (4 subsequent siblings)
5 siblings, 1 reply; 40+ messages in thread
From: Paul Mundt @ 2006-09-17 11:51 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, davem, wli,
jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Sun, Sep 17, 2006 at 08:39:39AM +0100, David Woodhouse wrote:
> asm-sh/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
> asm-sh/ptrace.h requires asm/ubc.h, which does not exist in exported headers
Ok, these are fixed, patch attached.
> asm-sh64/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
Fixed.
> asm-sh64/shmparam.h requires asm/cache.h, which does not exist in exported headers
This is going to need a little bit more work, but I've just bumped the
mask up for now. I just took care of the same issue on sh, so I'll carry
over the same fix for that later. SHMLBA at 0x4000 is "good enough" for
these caches for the time being, and fixes this issue.
> asm-sh64/signal.h requires asm/processor.h, which does not exist in exported headers
> asm-sh64/user.h requires asm/processor.h, which does not exist in exported headers
Dead headers, fixed.
Patches follow..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 22dc9c2..f203131 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -26,6 +26,7 @@ #include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
#include <asm/elf.h>
+#include <asm/ubc.h>
static int hlt_counter=0;
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 5a057b0..6f7eb8a 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -112,9 +112,8 @@ #define virt_addr_valid(kaddr) pfn_valid
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-#endif /* __KERNEL__ */
-
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
+#endif /* __KERNEL__ */
#endif /* __ASM_SH_PAGE_H */
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index 792fc35..ed358a3 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -1,8 +1,6 @@
#ifndef __ASM_SH_PTRACE_H
#define __ASM_SH_PTRACE_H
-#include <asm/ubc.h>
-
/*
* Copyright (C) 1999, 2000 Niibe Yutaka
*
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h
index 34fb347..472089a 100644
--- a/include/asm-sh64/page.h
+++ b/include/asm-sh64/page.h
@@ -112,9 +112,8 @@ #define virt_addr_valid(kaddr) pfn_valid
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-#endif /* __KERNEL__ */
-
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
+#endif /* __KERNEL__ */
#endif /* __ASM_SH64_PAGE_H */
diff --git a/include/asm-sh64/shmparam.h b/include/asm-sh64/shmparam.h
index d3a99a4..1bb820c 100644
--- a/include/asm-sh64/shmparam.h
+++ b/include/asm-sh64/shmparam.h
@@ -2,19 +2,11 @@ #ifndef __ASM_SH64_SHMPARAM_H
#define __ASM_SH64_SHMPARAM_H
/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * include/asm-sh64/shmparam.h
- *
- * Copyright (C) 2000, 2001 Paolo Alberelli
- *
+ * Set this to a sensible safe default, we'll work out the specifics for the
+ * align mask from the cache descriptor at run-time.
*/
+#define SHMLBA 0x4000
-#include <asm/cache.h>
-
-/* attach addr a multiple of this */
-#define SHMLBA (cpu_data->dcache.sets * L1_CACHE_BYTES)
+#define __ARCH_FORCE_SHMLBA
#endif /* __ASM_SH64_SHMPARAM_H */
diff --git a/include/asm-sh64/signal.h b/include/asm-sh64/signal.h
index a5a2820..244e134 100644
--- a/include/asm-sh64/signal.h
+++ b/include/asm-sh64/signal.h
@@ -13,7 +13,6 @@ #define __ASM_SH64_SIGNAL_H
*/
#include <linux/types.h>
-#include <asm/processor.h>
/* Avoid too many header ordering problems. */
struct siginfo;
diff --git a/include/asm-sh64/user.h b/include/asm-sh64/user.h
index 8f32f39..eb3b33e 100644
--- a/include/asm-sh64/user.h
+++ b/include/asm-sh64/user.h
@@ -13,7 +13,6 @@ #define __ASM_SH64_USER_H
*/
#include <linux/types.h>
-#include <asm/processor.h>
#include <asm/ptrace.h>
#include <asm/page.h>
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-17 11:51 ` Paul Mundt
@ 2006-09-17 11:56 ` Paul Mundt
2006-09-17 11:58 ` David Woodhouse
2006-09-17 12:27 ` Paul Mundt
` (3 subsequent siblings)
5 siblings, 1 reply; 40+ messages in thread
From: Paul Mundt @ 2006-09-17 11:56 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, davem, wli,
jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Sun, Sep 17, 2006 at 08:39:39AM +0100, David Woodhouse wrote:
> As of today, a number of other architectures are fixed and we're left
> with a few stragglers whose headers may not be clean in the
> linux-kernel-headers tarball I intend to make based on the 2.6.18
> release.
>
One minor nit, can we get unifdef shoved in to scripts/? Gentoo at least
didn't have it, and while Fedora and Debian both seem to, I suspect most
of the other distributions will not. It took at least a couple of
minutes to hunt down sensible source for it. It wouldn't be a bad idea
to include it until other distributions have a chance to integrate it..
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 11:56 ` Paul Mundt
@ 2006-09-17 11:58 ` David Woodhouse
0 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-17 11:58 UTC (permalink / raw)
To: Paul Mundt
Cc: linux-arch, spyro, starvik, ysato, takata, geert, davem, wli,
jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Sun, 2006-09-17 at 20:56 +0900, Paul Mundt wrote:
> One minor nit, can we get unifdef shoved in to scripts/? Gentoo at least
> didn't have it, and while Fedora and Debian both seem to, I suspect most
> of the other distributions will not. It took at least a couple of
> minutes to hunt down sensible source for it. It wouldn't be a bad idea
> to include it until other distributions have a chance to integrate it..
git-pull git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 11:51 ` Paul Mundt
@ 2006-09-17 12:10 ` David Woodhouse
2006-09-17 12:20 ` lethal
2006-09-17 12:51 ` Paul Mundt
0 siblings, 2 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-17 12:10 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-arch, drepper
On Sun, 2006-09-17 at 20:51 +0900, Paul Mundt wrote:
> This is going to need a little bit more work, but I've just bumped the
> mask up for now. I just took care of the same issue on sh, so I'll carry
> over the same fix for that later. SHMLBA at 0x4000 is "good enough" for
> these caches for the time being, and fixes this issue.
According to
http://git.kernel.org/git/?p=linux/kernel/git/dwmw2/kernel-headers.git;a=blob;h=2ff7b41d3f154ef8c44fce542929a6ac02bd6c67;hb=2c461ab5bc8d3334d4dc97412c974bf09412fccd;f=asm-sh/shmparam.h
you don't define SHMLBA in the exported headers at all for SH[34] -- the
equivalent would be just putting #ifdef __KERNEL__ around what you
currently have in include/asm-sh64/shmparam.h (before your patch).
That's probably not such an unreasonable response. If you're going to
make it depend on the CPU cache, then libc is going to have to either
work it out for itself or query the kernel somehow. Or just use the
maximum of all possible values.
I'm not averse to removing <asm/shmparam.h> from view on _all_
architectures. The less we have to export, the better :)
A bunch of architectures define it as PAGE_SIZE anyway, which is broken
when PAGE_SIZE gets killed off -- which we're doing either because it's
dynamic on the arch in question or just because we're killing it on a
bunch of architectures so we should kill it on all for consistency.
Userspace needs to learn to use getpagesize() or sysconf(_SC_PAGE_SIZE).
Hm, is there a sysconf(_SC_SHMLBA) ?
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 12:10 ` David Woodhouse
@ 2006-09-17 12:20 ` lethal
2006-09-17 12:51 ` Paul Mundt
1 sibling, 0 replies; 40+ messages in thread
From: lethal @ 2006-09-17 12:20 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, drepper
On Sun, Sep 17, 2006 at 01:10:04PM +0100, David Woodhouse wrote:
> On Sun, 2006-09-17 at 20:51 +0900, Paul Mundt wrote:
> > This is going to need a little bit more work, but I've just bumped the
> > mask up for now. I just took care of the same issue on sh, so I'll carry
> > over the same fix for that later. SHMLBA at 0x4000 is "good enough" for
> > these caches for the time being, and fixes this issue.
>
> According to
> http://git.kernel.org/git/?p=linux/kernel/git/dwmw2/kernel-headers.git;a=blob;h=2ff7b41d3f154ef8c44fce542929a6ac02bd6c67;hb=2c461ab5bc8d3334d4dc97412c974bf09412fccd;f=asm-sh/shmparam.h
> you don't define SHMLBA in the exported headers at all for SH[34] -- the
> equivalent would be just putting #ifdef __KERNEL__ around what you
> currently have in include/asm-sh64/shmparam.h (before your patch).
>
Yes, I've changed that for sh, it was broken.
> That's probably not such an unreasonable response. If you're going to
> make it depend on the CPU cache, then libc is going to have to either
> work it out for itself or query the kernel somehow. Or just use the
> maximum of all possible values.
>
I opted for the latter. The problem was that we can have varying
configurations where the aliases need to be handled differently (or not at
all), and rather than having shmparam.h turn in to ifdef hell, I opted for
run-time probing and setting up an shm_align_mask (as MIPS also does), and
then wrapping arch_get_unmapped_area() around it.
> Userspace needs to learn to use getpagesize() or sysconf(_SC_PAGE_SIZE).
>
uClibc does that now, so it's not an issue there. As an alternative solution,
I was playing with handing the cache desc through the ELF auxvt and doing
similar run-time setup for the mask there, since most architectures with an
aliasing dcache will have special hacks anyways.
It seems cleaner to simply use the "big enough to covering aliasing
constraints if they exist" case and let get_arch_unmapped_area() pack it a bit
tighter based off of run-time discovery in the cases where we really care
about it.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-17 11:51 ` Paul Mundt
2006-09-17 11:56 ` Paul Mundt
@ 2006-09-17 12:27 ` Paul Mundt
2006-09-19 7:04 ` Hirokazu Takata
` (2 subsequent siblings)
5 siblings, 0 replies; 40+ messages in thread
From: Paul Mundt @ 2006-09-17 12:27 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, davem, wli,
jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Sun, Sep 17, 2006 at 08:39:39AM +0100, David Woodhouse wrote:
> asm-sparc64/shmparam.h requires asm/spitfire.h, which does not exist in exported headers
> asm-xtensa/shmparam.h requires asm/processor.h, which does not exist in exported headers
For what it's worth, I suspect these two will have to do something
similar, as the dcache way size specifics won't be visible to userspace
under conventional means. This leaves the auxvt (alpha sets precedent
for this), or setting a value big enough to handle the aliasing
constraints.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 12:10 ` David Woodhouse
2006-09-17 12:20 ` lethal
@ 2006-09-17 12:51 ` Paul Mundt
1 sibling, 0 replies; 40+ messages in thread
From: Paul Mundt @ 2006-09-17 12:51 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, drepper
On Sun, Sep 17, 2006 at 01:10:04PM +0100, David Woodhouse wrote:
> A bunch of architectures define it as PAGE_SIZE anyway, which is broken
> when PAGE_SIZE gets killed off -- which we're doing either because it's
> dynamic on the arch in question or just because we're killing it on a
> bunch of architectures so we should kill it on all for consistency.
> Userspace needs to learn to use getpagesize() or sysconf(_SC_PAGE_SIZE).
>
The other thing I forgot to mention is that PAGE_SIZE is really the
wrong thing here anyways. On the systems with an aliasing dcache, it's
the 4k pages that are generally the problem. On those platforms you can
still switch to larger page sizes and then not have to worry about it.
So something like:
> Hm, is there a sysconf(_SC_SHMLBA) ?
would be much more useful. This would stop userspace libc's from doing
things like #define SHMLBA (getpagesize() * 4)..
In the 4k PAGE_SIZE case you still need the dcache specifics to figure
out whether to bump up SHMLBA or not. So you either go with the safe
route of using a "big enough" size that covers the worst-case aliasing
scenario, or find a way to do it at run-time (ie, via the auxvt or
_SC_SHMLBA).
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 0/8] Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (6 preceding siblings ...)
2006-09-17 9:52 ` Geert Uytterhoeven
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 1/8] extend make headers_check to detect more problems Arnd Bergmann
` (7 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
On Tuesday 12 September 2006 18:44, David Woodhouse wrote:
> Basically all but PowerPC and i386 have problems; and the latter works
> only if you apply the patches I sent to Linus a few days ago.
>
> This is just a basic check that the headers which _are_ exported don't
> try to include other headers which aren't. This can happen either
> because the former should not, or the latter _should_ be exported.
> Mostly, however, the solution is just to make sure the latter is
> included only within #ifdef __KERNEL__, because it's only needed within
> that ifdef anyway.
I have extended that script somewhat to check for more problems,
and fixed a number of problems in the process.
The bad news is that with this extended script, there will be even
more work for each architecture maintainer to make it check without
warnings.
Arnd <><
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 1/8] extend make headers_check to detect more problems
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (7 preceding siblings ...)
2006-09-18 1:27 ` [patch 0/8] " Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 6:21 ` Sam Ravnborg
2006-09-23 11:04 ` David Woodhouse
2006-09-18 1:27 ` [patch 2/8] fix byteorder headers for make headers_check Arnd Bergmann
` (6 subsequent siblings)
15 siblings, 2 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: headercheck-base.diff --]
[-- Type: text/plain, Size: 2088 bytes --]
In addition to the problem of including non-existant header
files, a number of other things can go wrong with header
files exported to user space. This adds checks for some
common problems:
- The header fails to include the files it needs, which
results in build errors when a program tries to include
it. Check this by doing a dummy compile.
- There is a declarations of a static variable or non-inline
function in the header, which results in object code
in every file including it. Check for symbols in the object
with 'nm'.
- Part of the header is subject to conditional compilation
based on CONFIG_*. Add a regex search for this.
I found many problems with this, which I then fixed for
powerpc, s390 and i386, in subsequent patches.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/scripts/hdrcheck.sh
===================================================================
--- linux-cg.orig/scripts/hdrcheck.sh 2006-09-18 02:04:44.000000000 +0200
+++ linux-cg/scripts/hdrcheck.sh 2006-09-18 02:04:45.000000000 +0200
@@ -1,8 +1,28 @@
#!/bin/sh
+# check if all included files exist
for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do
if [ ! -r $1/$FILE ]; then
echo $2 requires $FILE, which does not exist in exported headers
exit 1
fi
done
+
+# try to compile in order to see CC warnings, show only the first few
+CHECK_CFLAGS=`grep @headercheck: $2 | sed -e 's/^.*@headercheck:\([^@]*\)@.*$/\1/'`
+CFLAGS="-Wall -std=gnu99 -xc -O2 -I$1 ${CHECK_CFLAGS}"
+tmpfile=`mktemp`
+${CC:-gcc} ${CFLAGS} -c $2 -o $tmpfile 2>&1 | sed -e "s:$1:include:g" >&2
+
+# check if object file is empty
+if [ "`nm $tmpfile`" ] ; then
+ echo include${2#$1}: warning: non-empty output >&2
+fi
+rm $tmpfile
+
+# check if we use a CONFIG_ symbol, which is not allowed in installed headers
+grep '^[ \t]*#[ \t]*if.*\<CONFIG_[[:alnum:]_]*\>' -n $2 |
+while read i ; do
+ echo include${2#$1}:${i%%:*}: warning: invalid use of `echo $i |
+ sed -e 's/.*\(\<CONFIG_[[:alnum:]_]*\>\).*/\1/g'` >&2
+done
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 2/8] fix byteorder headers for make headers_check
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (8 preceding siblings ...)
2006-09-18 1:27 ` [patch 1/8] extend make headers_check to detect more problems Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 3/8] hide kernel-only parts of some installed headers Arnd Bergmann
` (5 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: check-byteorder.diff --]
[-- Type: text/plain, Size: 3354 bytes --]
This makes the header files for byteorder includeable
on 32 bit systems with gcc -ansi, where no 64 bit
integers are available.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/include/linux/byteorder/big_endian.h
===================================================================
--- linux-cg.orig/include/linux/byteorder/big_endian.h 2006-09-18 02:20:36.000000000 +0200
+++ linux-cg/include/linux/byteorder/big_endian.h 2006-09-18 02:20:51.000000000 +0200
@@ -40,6 +40,7 @@
#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
+#ifdef __BYTEORDER_HAS_U64__
static inline __le64 __cpu_to_le64p(const __u64 *p)
{
return (__force __le64)__swab64p(p);
@@ -48,6 +49,7 @@
{
return __swab64p((__u64 *)p);
}
+#endif
static inline __le32 __cpu_to_le32p(const __u32 *p)
{
return (__force __le32)__swab32p(p);
Index: linux-cg/include/linux/byteorder/little_endian.h
===================================================================
--- linux-cg.orig/include/linux/byteorder/little_endian.h 2006-09-18 02:20:36.000000000 +0200
+++ linux-cg/include/linux/byteorder/little_endian.h 2006-09-18 02:20:51.000000000 +0200
@@ -40,6 +40,7 @@
#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
+#ifdef __BYTEORDER_HAS_U64__
static inline __le64 __cpu_to_le64p(const __u64 *p)
{
return (__force __le64)*p;
@@ -48,6 +49,7 @@
{
return (__force __u64)*p;
}
+#endif
static inline __le32 __cpu_to_le32p(const __u32 *p)
{
return (__force __le32)*p;
@@ -64,6 +66,7 @@
{
return (__force __u16)*p;
}
+#ifdef __BYTEORDER_HAS_U64__
static inline __be64 __cpu_to_be64p(const __u64 *p)
{
return (__force __be64)__swab64p(p);
@@ -72,6 +75,7 @@
{
return __swab64p((__u64 *)p);
}
+#endif
static inline __be32 __cpu_to_be32p(const __u32 *p)
{
return (__force __be32)__swab32p(p);
Index: linux-cg/include/linux/byteorder/pdp_endian.h
===================================================================
--- linux-cg.orig/include/linux/byteorder/pdp_endian.h 2006-09-18 02:20:36.000000000 +0200
+++ linux-cg/include/linux/byteorder/pdp_endian.h 2006-09-18 02:20:51.000000000 +0200
@@ -27,6 +27,7 @@
#define __PDP_ENDIAN_BITFIELD
#endif
+#include <linux/types.h>
#include <linux/byteorder/swab.h>
#include <linux/byteorder/swabb.h>
Index: linux-cg/include/linux/byteorder/swab.h
===================================================================
--- linux-cg.orig/include/linux/byteorder/swab.h 2006-09-18 02:20:36.000000000 +0200
+++ linux-cg/include/linux/byteorder/swab.h 2006-09-18 02:20:51.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _LINUX_BYTEORDER_SWAB_H
#define _LINUX_BYTEORDER_SWAB_H
+/* @headercheck:-include linux/types.h@ */
/*
* linux/byteorder/swab.h
* Byte-swapping, independently from CPU endianness
Index: linux-cg/include/linux/byteorder/swabb.h
===================================================================
--- linux-cg.orig/include/linux/byteorder/swabb.h 2006-09-18 02:20:36.000000000 +0200
+++ linux-cg/include/linux/byteorder/swabb.h 2006-09-18 02:20:51.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _LINUX_BYTEORDER_SWABB_H
#define _LINUX_BYTEORDER_SWABB_H
+/* @headercheck:-include linux/types.h@ */
/*
* linux/byteorder/swabb.h
* SWAp Bytes Bizarrely
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 3/8] hide kernel-only parts of some installed headers
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (9 preceding siblings ...)
2006-09-18 1:27 ` [patch 2/8] fix byteorder headers for make headers_check Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 4/8] fix exported flock64 constants Arnd Bergmann
` (4 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: checkheader-__KERNEL__.diff --]
[-- Type: text/plain, Size: 30629 bytes --]
These header files all need additional parts hidden
inside if #ifdef __KERNEL__ so they become usable in
user space.
The most common reason is that they refer to a CONFIG_*
symbol. Since the contents of the header inside of
that #ifdef were undefined to start with, these parts
can usually be left out of the installed portion.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/include/asm-i386/setup.h
===================================================================
--- linux-cg.orig/include/asm-i386/setup.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/asm-i386/setup.h 2006-09-18 03:21:53.000000000 +0200
@@ -67,6 +67,7 @@
*/
#define LOWMEMSIZE() (0x9f000)
+#ifdef __KERNEL__
struct e820entry;
char * __init machine_specific_memory_setup(void);
@@ -75,6 +76,7 @@
int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
void __init add_memory_region(unsigned long long start,
unsigned long long size, int type);
+#endif
#endif /* __ASSEMBLY__ */
Index: linux-cg/include/linux/coda_psdev.h
===================================================================
--- linux-cg.orig/include/linux/coda_psdev.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/coda_psdev.h 2006-09-18 03:21:53.000000000 +0200
@@ -6,6 +6,7 @@
#define CODA_SUPER_MAGIC 0x73757245
+#ifdef __KERNEL__
struct kstatfs;
struct coda_sb_info
@@ -72,7 +73,6 @@
int venus_fsync(struct super_block *sb, struct CodaFid *fid);
int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
-
/* messages between coda filesystem in kernel and Venus */
extern int coda_hard;
extern unsigned long coda_timeout;
@@ -88,16 +88,16 @@
unsigned long uc_posttime;
};
-#define REQ_ASYNC 0x1
-#define REQ_READ 0x2
-#define REQ_WRITE 0x4
-#define REQ_ABORT 0x8
-
-
/*
* Statistics
*/
extern struct venus_comm coda_comms[];
+#endif
+
+#define REQ_ASYNC 0x1
+#define REQ_READ 0x2
+#define REQ_WRITE 0x4
+#define REQ_ABORT 0x8
#endif
Index: linux-cg/include/linux/dm-ioctl.h
===================================================================
--- linux-cg.orig/include/linux/dm-ioctl.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/dm-ioctl.h 2006-09-18 03:21:53.000000000 +0200
@@ -231,6 +231,7 @@
DM_DEV_SET_GEOMETRY_CMD
};
+#ifdef __KERNEL__
/*
* The dm_ioctl struct passed into the ioctl is just the header
* on a larger chunk of memory. On x86-64 and other
@@ -260,6 +261,7 @@
#define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct)
#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct)
#endif
+#endif
#define DM_IOCTL 0xfd
Index: linux-cg/include/linux/futex.h
===================================================================
--- linux-cg.orig/include/linux/futex.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/futex.h 2006-09-18 03:21:53.000000000 +0200
@@ -93,6 +93,7 @@
*/
#define ROBUST_LIST_LIMIT 2048
+#ifdef __KERNEL__
long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
u32 __user *uaddr2, u32 val2, u32 val3);
@@ -110,6 +111,7 @@
{
}
#endif
+#endif
#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
Index: linux-cg/include/linux/ipv6.h
===================================================================
--- linux-cg.orig/include/linux/ipv6.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/ipv6.h 2006-09-18 03:21:53.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPV6_H
#define _IPV6_H
+/* @headercheck: -include linux/types.h @ */
+
#include <linux/in6.h>
#include <asm/byteorder.h>
@@ -121,6 +123,7 @@
struct in6_addr daddr;
};
+#ifdef __KERNEL__
/*
* This structure contains configuration options per IPv6 link.
*/
@@ -155,6 +158,7 @@
#endif
void *sysctl;
};
+#endif
/* index values for the variables in ipv6_devconf */
enum {
Index: linux-cg/include/linux/isdn_divertif.h
===================================================================
--- linux-cg.orig/include/linux/isdn_divertif.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/isdn_divertif.h 2006-09-18 03:21:53.000000000 +0200
@@ -24,6 +24,7 @@
#define DIVERT_REL_ERR 0x04 /* module not registered */
#define DIVERT_REG_NAME isdn_register_divert
+#ifdef __KERNEL__
/***************************************************************/
/* structure exchanging data between isdn hl and divert module */
/***************************************************************/
@@ -40,3 +41,4 @@
/* function register */
/*********************/
extern int DIVERT_REG_NAME(isdn_divert_if *);
+#endif
Index: linux-cg/include/linux/ppp-comp.h
===================================================================
--- linux-cg.orig/include/linux/ppp-comp.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/ppp-comp.h 2006-09-18 03:21:53.000000000 +0200
@@ -42,6 +42,7 @@
#ifndef _NET_PPP_COMP_H
#define _NET_PPP_COMP_H
+#ifdef __KERNEL__
struct module;
/*
@@ -115,6 +116,9 @@
unsigned int comp_extra;
};
+extern int ppp_register_compressor(struct compressor *);
+extern void ppp_unregister_compressor(struct compressor *);
+
/*
* The return value from decompress routine is the length of the
* decompressed packet if successful, otherwise DECOMP_ERROR
@@ -130,6 +134,8 @@
#define DECOMP_ERROR -1 /* error detected before decomp. */
#define DECOMP_FATALERROR -2 /* error detected after decomp. */
+#endif /* __KERNEL__ */
+
/*
* CCP codes.
*/
@@ -208,9 +214,4 @@
#define CI_PREDICTOR_2 2 /* config option for Predictor-2 */
#define CILEN_PREDICTOR_2 2 /* length of its config option */
-#ifdef __KERNEL__
-extern int ppp_register_compressor(struct compressor *);
-extern void ppp_unregister_compressor(struct compressor *);
-#endif /* __KERNEL__ */
-
#endif /* _NET_PPP_COMP_H */
Index: linux-cg/include/linux/sound.h
===================================================================
--- linux-cg.orig/include/linux/sound.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/sound.h 2006-09-18 03:21:53.000000000 +0200
@@ -25,6 +25,7 @@
#define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
#define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
+#ifdef __KERNEL__
/*
* Sound core interface functions
*/
@@ -42,3 +43,4 @@
extern void unregister_sound_midi(int unit);
extern void unregister_sound_dsp(int unit);
extern void unregister_sound_synth(int unit);
+#endif
Index: linux-cg/include/linux/xattr.h
===================================================================
--- linux-cg.orig/include/linux/xattr.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/xattr.h 2006-09-18 03:21:53.000000000 +0200
@@ -29,7 +29,7 @@
#define XATTR_USER_PREFIX "user."
#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
-
+#ifdef __KERNEL__
struct xattr_handler {
char *prefix;
size_t (*list)(struct inode *inode, char *list, size_t list_size,
@@ -48,5 +48,6 @@
ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);
int generic_removexattr(struct dentry *dentry, const char *name);
+#endif
#endif /* _LINUX_XATTR_H */
Index: linux-cg/include/linux/netdevice.h
===================================================================
--- linux-cg.orig/include/linux/netdevice.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/netdevice.h 2006-09-18 03:21:53.000000000 +0200
@@ -69,10 +69,6 @@
#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
-#endif
-
-#define MAX_ADDR_LEN 32 /* Largest hardware address length */
-
/* Driver transmit return codes */
#define NETDEV_TX_OK 0 /* driver took care of packet */
#define NETDEV_TX_BUSY 1 /* driver tx path was busy*/
@@ -100,6 +96,10 @@
#define MAX_HEADER (LL_MAX_HEADER + 48)
#endif
+#endif
+
+#define MAX_ADDR_LEN 32 /* Largest hardware address length */
+
/*
* Network device statistics. Akin to the 2.0 ether stats but
* with byte counters.
Index: linux-cg/include/linux/quota.h
===================================================================
--- linux-cg.orig/include/linux/quota.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/quota.h 2006-09-18 03:21:53.000000000 +0200
@@ -41,11 +41,6 @@
#define __DQUOT_VERSION__ "dquot_6.5.1"
#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
-typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
-typedef __u64 qsize_t; /* Type in which we store sizes */
-
-extern spinlock_t dq_data_lock;
-
/* Size of blocks in which are counted size limits */
#define QUOTABLOCK_BITS 10
#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
@@ -138,6 +133,11 @@
#include <linux/dqblk_v1.h>
#include <linux/dqblk_v2.h>
+typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
+typedef __u64 qsize_t; /* Type in which we store sizes */
+
+extern spinlock_t dq_data_lock;
+
/* Maximal numbers of writes for quota operation (insert/delete/update)
* (over VFS all formats) */
#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC)
Index: linux-cg/include/asm-generic/atomic.h
===================================================================
--- linux-cg.orig/include/asm-generic/atomic.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/asm-generic/atomic.h 2006-09-18 03:21:53.000000000 +0200
@@ -18,7 +18,7 @@
* macros of a platform may have.
*/
-#if BITS_PER_LONG == 64
+#ifdef ATOMIC64_INIT /* assume this is only defined on 64 bit architectures */
typedef atomic64_t atomic_long_t;
Index: linux-cg/include/asm-i386/byteorder.h
===================================================================
--- linux-cg.orig/include/asm-i386/byteorder.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/asm-i386/byteorder.h 2006-09-18 03:21:53.000000000 +0200
@@ -8,11 +8,14 @@
/* For avoiding bswap on i386 */
#ifdef __KERNEL__
+#ifdef CONFIG_X86_BSWAP
+#define __X86_BSWAP
+#endif
#endif
static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
{
-#ifdef CONFIG_X86_BSWAP
+#ifdef __X86_BSWAP
__asm__("bswap %0" : "=r" (x) : "0" (x));
#else
__asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
@@ -31,7 +34,7 @@
__u64 u;
} v;
v.u = val;
-#ifdef CONFIG_X86_BSWAP
+#ifdef __X86_BSWAP
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
Index: linux-cg/include/asm-i386/vm86.h
===================================================================
--- linux-cg.orig/include/asm-i386/vm86.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/asm-i386/vm86.h 2006-09-18 03:21:53.000000000 +0200
@@ -16,11 +16,15 @@
#define IF_MASK 0x00000200
#define IOPL_MASK 0x00003000
#define NT_MASK 0x00004000
+#ifdef __KERNEL__
#ifdef CONFIG_VM86
#define VM_MASK 0x00020000
#else
#define VM_MASK 0 /* ignored */
-#endif
+#endif /* CONFIG_VM86 */
+#else
+#define VM_MASK 0x00020000
+#endif /* __KERNEL__ */
#define AC_MASK 0x00040000
#define VIF_MASK 0x00080000 /* virtual interrupt flag */
#define VIP_MASK 0x00100000 /* virtual interrupt pending */
Index: linux-cg/include/linux/Kbuild
===================================================================
--- linux-cg.orig/include/linux/Kbuild 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/Kbuild 2006-09-18 03:21:53.000000000 +0200
@@ -8,10 +8,10 @@
atmppp.h atmsap.h atmsvc.h atm_zatm.h auto_fs4.h auxvec.h \
awe_voice.h ax25.h b1lli.h baycom.h bfs_fs.h blkpg.h \
bpqether.h cdk.h chio.h coda_psdev.h coff.h comstats.h \
- consolemap.h cycx_cfm.h dm-ioctl.h dn.h dqblk_v1.h \
- dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf-fdpic.h elf.h elf-em.h \
+ consolemap.h cycx_cfm.h dn.h dqblk_v1.h \
+ dqblk_v2.h dqblk_xfs.h efs_fs_sb.h elf.h elf-em.h \
fadvise.h fd.h fdreg.h ftape-header-segment.h ftape-vendors.h \
- fuse.h futex.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \
+ fuse.h genetlink.h gen_stats.h gigaset_dev.h hdsmart.h \
hpfs_fs.h hysdn_if.h i2c-dev.h i8k.h icmp.h \
if_arcnet.h if_arp.h if_bonding.h if_cablemodem.h if_fc.h \
if_fddi.h if.h if_hippi.h if_infiniband.h if_packet.h \
@@ -34,15 +34,15 @@
atmarp.h atmdev.h atm.h atm_tcp.h audit.h auto_fs.h binfmts.h \
capability.h capi.h cciss_ioctl.h cdrom.h cm4000_cs.h \
cn_proc.h coda.h connector.h cramfs_fs.h cuda.h cyclades.h \
- dccp.h dirent.h divert.h elfcore.h errno.h errqueue.h \
- ethtool.h eventpoll.h ext2_fs.h ext3_fs.h fb.h fcntl.h \
- filter.h flat.h fs.h ftape.h gameport.h generic_serial.h \
- genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h hiddev.h hpet.h \
- i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \
+ dccp.h dirent.h divert.h dm-ioctl.h elf-fdpic.h elfcore.h \
+ errno.h errqueue.h ethtool.h eventpoll.h ext2_fs.h ext3_fs.h \
+ fb.h fcntl.h filter.h flat.h fs.h ftape.h futex.h gameport.h \
+ generic_serial.h genhd.h hayesesp.h hdlcdrv.h hdlc.h hdreg.h \
+ hiddev.h hpet.h i2c.h i2o-dev.h icmpv6.h if_bridge.h if_ec.h \
if_eql.h if_ether.h if_frad.h if_ltalk.h if_pppox.h \
if_shaper.h if_tr.h if_tun.h if_vlan.h if_wanpipe.h igmp.h \
inet_diag.h in.h inotify.h input.h ipc.h ipmi.h ipv6.h \
- ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h jbd.h \
+ ipv6_route.h isdn.h isdnif.h isdn_ppp.h isicom.h \
joystick.h kdev_t.h kd.h kernelcapi.h kernel.h keyboard.h \
llc.h loop.h lp.h mempolicy.h mii.h mman.h mroute.h msdos_fs.h \
msg.h nbd.h ncp_fs.h ncp.h ncp_mount.h netdevice.h \
Index: linux-cg/include/linux/acct.h
===================================================================
--- linux-cg.orig/include/linux/acct.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/acct.h 2006-09-18 03:21:53.000000000 +0200
@@ -59,7 +59,7 @@
comp_t ac_majflt; /* Major Pagefaults */
comp_t ac_swaps; /* Number of Swaps */
/* m68k had no padding here. */
-#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+#if !defined(__mc68000__) || !defined(__KERNEL__)
__u16 ac_ahz; /* AHZ */
#endif
__u32 ac_exitcode; /* Exitcode */
Index: linux-cg/include/linux/coda.h
===================================================================
--- linux-cg.orig/include/linux/coda.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/coda.h 2006-09-18 03:21:53.000000000 +0200
@@ -59,6 +59,20 @@
#ifndef _CODA_HEADER_
#define _CODA_HEADER_
+#if 0
+#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
+#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
+#define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */
+#endif
+#ifdef __KERNEL__
+#ifdef CONFIG_CODA_FS_OLD_API
+#define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */
+#endif
+#endif
+
+#ifndef CODA_KERNEL_VERSION
+#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
+#endif
/* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */
#if defined(__NetBSD__) || \
@@ -199,7 +213,7 @@
typedef u_int32_t vgid_t;
#endif /*_VUID_T_ */
-#ifdef CONFIG_CODA_FS_OLD_API
+#if CODA_KERNEL_VERSION == 2
struct CodaFid {
u_int32_t opaque[3];
};
@@ -219,7 +233,7 @@
vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */
};
-#else /* not defined(CONFIG_CODA_FS_OLD_API) */
+#else /* not CODA_KERNEL_VERSION == 2 */
struct CodaFid {
u_int32_t opaque[4];
@@ -313,23 +327,13 @@
#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
-#if 0
-#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */
-#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */
-#endif
-#ifdef CONFIG_CODA_FS_OLD_API
-#define CODA_KERNEL_VERSION 2 /* venus_lookup got an extra parameter */
-#else
-#define CODA_KERNEL_VERSION 3 /* 128-bit file identifiers */
-#endif
-
/*
* Venus <-> Coda RPC arguments
*/
struct coda_in_hdr {
u_int32_t opcode;
u_int32_t unique; /* Keep multiple outstanding msgs distinct */
-#ifdef CONFIG_CODA_FS_OLD_API
+#if CODA_KERNEL_VERSION == 2
u_int16_t pid; /* Common to all */
u_int16_t pgid; /* Common to all */
u_int16_t sid; /* Common to all */
@@ -613,7 +617,7 @@
/* CODA_PURGEUSER is a venus->kernel call */
struct coda_purgeuser_out {
struct coda_out_hdr oh;
-#ifdef CONFIG_CODA_FS_OLD_API
+#if CODA_KERNEL_VERSION == 2
struct coda_cred cred;
#else
vuid_t uid;
Index: linux-cg/include/linux/elf-fdpic.h
===================================================================
--- linux-cg.orig/include/linux/elf-fdpic.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/elf-fdpic.h 2006-09-18 03:21:53.000000000 +0200
@@ -58,11 +58,13 @@
#define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
};
+#ifdef __KERNEL__
#ifdef CONFIG_MMU
extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
struct elf_fdpic_params *interp_params,
unsigned long *start_stack,
unsigned long *start_brk);
#endif
+#endif
#endif /* _LINUX_ELF_FDPIC_H */
Index: linux-cg/include/linux/elfcore.h
===================================================================
--- linux-cg.orig/include/linux/elfcore.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/elfcore.h 2006-09-18 03:21:53.000000000 +0200
@@ -17,10 +17,14 @@
#include <asm/elf.h>
#ifndef __KERNEL__
+#if !defined(__s390__)
typedef elf_greg_t greg_t;
+#endif
typedef elf_gregset_t gregset_t;
typedef elf_fpregset_t fpregset_t;
+#if defined(__i386__) || defined(__ia64__)
typedef elf_fpxregset_t fpxregset_t;
+#endif
#define NGREG ELF_NGREG
#endif
@@ -60,6 +64,7 @@
long pr_instr; /* Current instruction */
#endif
elf_gregset_t pr_reg; /* GP registers */
+#ifdef __KERNEL__
#ifdef CONFIG_BINFMT_ELF_FDPIC
/* When using FDPIC, the loadmap addresses need to be communicated
* to GDB in order for GDB to do the necessary relocations. The
@@ -70,6 +75,7 @@
unsigned long pr_exec_fdpic_loadmap;
unsigned long pr_interp_fdpic_loadmap;
#endif
+#endif
int pr_fpvalid; /* True if math co-processor being used. */
};
Index: linux-cg/include/linux/ext3_fs.h
===================================================================
--- linux-cg.orig/include/linux/ext3_fs.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/ext3_fs.h 2006-09-18 03:21:53.000000000 +0200
@@ -228,12 +228,11 @@
#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
-#ifdef CONFIG_JBD_DEBUG
#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
-#endif
#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
+#ifdef __KERNEL__
/*
* Mount options
*/
@@ -247,6 +246,7 @@
char *s_qf_names[MAXQUOTAS];
#endif
};
+#endif
/*
* Structure of an inode on the disk
@@ -652,6 +652,7 @@
* (c) Daniel Phillips, 2001
*/
+#ifdef __KERNEL__
#ifdef CONFIG_EXT3_INDEX
#define is_dx(dir) (EXT3_HAS_COMPAT_FEATURE(dir->i_sb, \
EXT3_FEATURE_COMPAT_DIR_INDEX) && \
@@ -670,8 +671,6 @@
#define DX_HASH_HALF_MD4 1
#define DX_HASH_TEA 2
-#ifdef __KERNEL__
-
/* hash info structure used by the directory hash */
struct dx_hash_info
{
Index: linux-cg/include/linux/fb.h
===================================================================
--- linux-cg.orig/include/linux/fb.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/fb.h 2006-09-18 03:21:53.000000000 +0200
@@ -366,14 +366,14 @@
struct fb_image image; /* Cursor image */
};
+#ifdef __KERNEL__
+
#ifdef CONFIG_FB_BACKLIGHT
/* Settings for the generic backlight code */
#define FB_BACKLIGHT_LEVELS 128
#define FB_BACKLIGHT_MAX 0xFF
#endif
-#ifdef __KERNEL__
-
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/device.h>
Index: linux-cg/include/linux/flat.h
===================================================================
--- linux-cg.orig/include/linux/flat.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/flat.h 2006-09-18 03:21:53.000000000 +0200
@@ -12,9 +12,6 @@
#ifdef __KERNEL__
#include <asm/flat.h>
-#endif
-
-#define FLAT_VERSION 0x00000004L
#ifdef CONFIG_BINFMT_SHARED_FLAT
#define MAX_SHARED_LIBS (4)
@@ -22,6 +19,10 @@
#define MAX_SHARED_LIBS (1)
#endif
+#endif /* __KERNEL__ */
+
+#define FLAT_VERSION 0x00000004L
+
/*
* To make everything easier to port and manage cross platform
* development, all fields are in network byte order.
Index: linux-cg/include/linux/fs.h
===================================================================
--- linux-cg.orig/include/linux/fs.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/fs.h 2006-09-18 03:21:53.000000000 +0200
@@ -31,6 +31,7 @@
#define SEEK_CUR 1 /* seek relative to current file position */
#define SEEK_END 2 /* seek relative to end of file */
+#ifdef __KERNEL__
/* And dynamically-tunable limits and defaults: */
struct files_stat_struct {
int nr_files; /* read only */
@@ -52,6 +53,7 @@
#ifdef CONFIG_DNOTIFY
extern int dir_notify_enable;
#endif
+#endif
#define NR_FILE 8192 /* this can well be larger on a larger system */
Index: linux-cg/include/linux/genhd.h
===================================================================
--- linux-cg.orig/include/linux/genhd.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/genhd.h 2006-09-18 03:21:53.000000000 +0200
@@ -52,9 +52,8 @@
unsigned int nr_sects; /* nr of sectors in partition */
} __attribute__((packed));
-#endif
+#else /* __KERNEL__ */
-#ifdef __KERNEL__
#include <linux/major.h>
#include <linux/device.h>
#include <linux/smp.h>
@@ -247,8 +246,6 @@
disk->capacity = size;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_SOLARIS_X86_PARTITION
#define SOLARIS_X86_NUMSLICE 8
@@ -392,8 +389,6 @@
# define MINIX_NR_SUBPARTITIONS 4
#endif /* CONFIG_MINIX_SUBPARTITION */
-#ifdef __KERNEL__
-
char *disk_name (struct gendisk *hd, int part, char *buf);
extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
@@ -417,6 +412,6 @@
return bdget(MKDEV(disk->major, disk->first_minor) + index);
}
-#endif
+#endif /* __KERNEL__ */
#endif
Index: linux-cg/include/linux/if_frad.h
===================================================================
--- linux-cg.orig/include/linux/if_frad.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/if_frad.h 2006-09-18 03:21:53.000000000 +0200
@@ -26,8 +26,6 @@
#include <linux/if.h>
-#if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
-
/* Structures and constants associated with the DLCI device driver */
struct dlci_add
@@ -190,11 +188,6 @@
int buffer; /* current buffer for S508 firmware */
};
-#endif /* __KERNEL__ */
-
-#endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */
-
-#ifdef __KERNEL__
extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *));
#endif
Index: linux-cg/include/linux/isdn.h
===================================================================
--- linux-cg.orig/include/linux/isdn.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/isdn.h 2006-09-18 03:21:53.000000000 +0200
@@ -16,6 +16,7 @@
#include <linux/ioctl.h>
+#ifdef __KERNEL__
#ifdef CONFIG_COBALT_MICRO_SERVER
/* Save memory */
#define ISDN_MAX_DRIVERS 2
@@ -24,6 +25,7 @@
#define ISDN_MAX_DRIVERS 32
#define ISDN_MAX_CHANNELS 64
#endif
+#endif
/* New ioctl-codes */
#define IIOCNETAIF _IO('I',1)
Index: linux-cg/include/linux/nfsd/stats.h
===================================================================
--- linux-cg.orig/include/linux/nfsd/stats.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/nfsd/stats.h 2006-09-18 03:21:53.000000000 +0200
@@ -29,10 +29,11 @@
unsigned int ra_size; /* size of ra cache */
unsigned int ra_depth[11]; /* number of times ra entry was found that deep
* in the cache (10percentiles). [10] = not found */
+#ifdef __KERNEL__
#ifdef CONFIG_NFSD_V4
unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */
#endif
-
+#endif
};
/* thread usage wraps very million seconds (approx one fortnight) */
Index: linux-cg/include/linux/nfsd/syscall.h
===================================================================
--- linux-cg.orig/include/linux/nfsd/syscall.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/nfsd/syscall.h 2006-09-18 03:21:53.000000000 +0200
@@ -45,6 +45,7 @@
#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
+#ifdef __KERNEL__
#if defined(CONFIG_NFSD_V4)
#define NFSCTL_VERALL (0x1c /* 0b011100 */)
#elif defined(CONFIG_NFSD_V3)
@@ -52,6 +53,7 @@
#else
#define NFSCTL_VERALL (0x04 /* 0b000100 */)
#endif
+#endif
/* SVC */
struct nfsctl_svc {
Index: linux-cg/include/linux/pktcdvd.h
===================================================================
--- linux-cg.orig/include/linux/pktcdvd.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/pktcdvd.h 2006-09-18 03:21:53.000000000 +0200
@@ -29,17 +29,6 @@
#define PACKET_WAIT_TIME (HZ * 5 / 1000)
/*
- * use drive write caching -- we need deferred error handling to be
- * able to sucessfully recover with this option (drive will return good
- * status as soon as the cdb is validated).
- */
-#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
-#define USE_WCACHING 1
-#else
-#define USE_WCACHING 0
-#endif
-
-/*
* No user-servicable parts beyond this point ->
*/
@@ -112,6 +101,17 @@
#include <linux/completion.h>
#include <linux/cdrom.h>
+/*
+ * use drive write caching -- we need deferred error handling to be
+ * able to sucessfully recover with this option (drive will return good
+ * status as soon as the cdb is validated).
+ */
+#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
+#define USE_WCACHING 1
+#else
+#define USE_WCACHING 0
+#endif
+
struct packet_settings
{
__u32 size; /* packet size in (512 byte) sectors */
Index: linux-cg/include/linux/reiserfs_fs.h
===================================================================
--- linux-cg.orig/include/linux/reiserfs_fs.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/reiserfs_fs.h 2006-09-18 03:21:53.000000000 +0200
@@ -11,8 +11,8 @@
#ifndef _LINUX_REISER_FS_H
#define _LINUX_REISER_FS_H
-#include <linux/types.h>
#ifdef __KERNEL__
+#include <linux/types.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
@@ -24,7 +24,6 @@
#include <linux/buffer_head.h>
#include <linux/reiserfs_fs_i.h>
#include <linux/reiserfs_fs_sb.h>
-#endif
/*
* include/linux/reiser_fs.h
@@ -1532,7 +1531,6 @@
/* FUNCTION DECLARATIONS */
/***************************************************************************/
-/*#ifdef __KERNEL__*/
#define get_journal_desc_magic(bh) (bh->b_data + bh->b_size - 12)
#define journal_trans_half(blocksize) \
@@ -2169,6 +2167,16 @@
/* prototypes from ioctl.c */
int reiserfs_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+/* Locking primitives */
+/* Right now we are still falling back to (un)lock_kernel, but eventually that
+ would evolve into real per-fs locks */
+#define reiserfs_write_lock( sb ) lock_kernel()
+#define reiserfs_write_unlock( sb ) unlock_kernel()
+
+/* xattr stuff */
+#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
+
+#endif
/* ioctl's command */
#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
@@ -2179,13 +2187,4 @@
#define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION
#define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION
-/* Locking primitives */
-/* Right now we are still falling back to (un)lock_kernel, but eventually that
- would evolve into real per-fs locks */
-#define reiserfs_write_lock( sb ) lock_kernel()
-#define reiserfs_write_unlock( sb ) unlock_kernel()
-
-/* xattr stuff */
-#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
-
#endif /* _LINUX_REISER_FS_H */
Index: linux-cg/include/linux/socket.h
===================================================================
--- linux-cg.orig/include/linux/socket.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/socket.h 2006-09-18 03:21:53.000000000 +0200
@@ -24,11 +24,13 @@
#include <linux/types.h> /* pid_t */
#include <linux/compiler.h> /* __user */
+#ifdef __KERNEL__
extern int sysctl_somaxconn;
#ifdef CONFIG_PROC_FS
struct seq_file;
extern void socket_seq_show(struct seq_file *seq);
#endif
+#endif
typedef unsigned short sa_family_t;
@@ -249,13 +251,6 @@
#define MSG_EOF MSG_FIN
-#if defined(CONFIG_COMPAT)
-#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
-#else
-#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
-#endif
-
-
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */
@@ -286,6 +281,13 @@
#define IPX_TYPE 1
#ifdef __KERNEL__
+
+#if defined(CONFIG_COMPAT)
+#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
+#else
+#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
+#endif
+
extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
int offset, int len);
Index: linux-cg/include/linux/videodev.h
===================================================================
--- linux-cg.orig/include/linux/videodev.h 2006-09-18 03:21:47.000000000 +0200
+++ linux-cg/include/linux/videodev.h 2006-09-18 03:21:53.000000000 +0200
@@ -14,7 +14,19 @@
#include <linux/videodev2.h>
-#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
+/*
+ * A little hack to shut up 'make headers_check',
+ * don't reference CONFIG_* outside of __KERNEL__.
+ */
+#ifdef __KERNEL__
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
+#define __VIDEO_V4L1_COMPAT
+#endif
+#else
+#define __VIDEO_V4L1_COMPAT
+#endif
+
+#ifdef __VIDEO_V4L1_COMPAT
struct video_capability
{
@@ -336,7 +348,7 @@
#define VID_HARDWARE_SN9C102 38
#define VID_HARDWARE_ARV 39
-#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+#endif /* __VIDEO_V4L1_COMPAT */
#endif /* __LINUX_VIDEODEV_H */
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 4/8] fix exported flock64 constants
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (10 preceding siblings ...)
2006-09-18 1:27 ` [patch 3/8] hide kernel-only parts of some installed headers Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 5/8] add missing #includes in user space parts of headers Arnd Bergmann
` (3 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: headercheck-fcntl.diff --]
[-- Type: text/plain, Size: 6321 bytes --]
The asm-generic/fcntl.h header relied on CONFIG_64BIT
to determine if it should define some of its contents.
This does not work in user space where no CONFIG_ symbols
are available, so introduce a new __ARCH_FLOCK64 symbol
that is set by asm/fcntl.h before including asm-generic/fcntl.h
when an architecture wants these.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
--- a/include/asm-arm/fcntl.h
+++ b/include/asm-arm/fcntl.h
@@ -6,6 +6,8 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
#endif
diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h
index d85995e..23c5875 100644
--- a/include/asm-arm26/fcntl.h
+++ b/include/asm-arm26/fcntl.h
@@ -8,6 +8,8 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
#endif
diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h
index 46ab12d..a025b36 100644
--- a/include/asm-cris/fcntl.h
+++ b/include/asm-cris/fcntl.h
@@ -1 +1,3 @@
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h
index 46ab12d..a025b36 100644
--- a/include/asm-frv/fcntl.h
+++ b/include/asm-frv/fcntl.h
@@ -1 +1,3 @@
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index c154b9d..55e8eff 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -121,7 +121,7 @@ struct flock {
};
#endif
-#ifndef CONFIG_64BIT
+#ifdef __ARCH_FLOCK64
#ifndef F_GETLK64
#define F_GETLK64 12 /* using 'struct flock64' */
diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h
index 1952cb2..e0001cd 100644
--- a/include/asm-h8300/fcntl.h
+++ b/include/asm-h8300/fcntl.h
@@ -6,6 +6,8 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
#endif /* _H8300_FCNTL_H */
diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h
index 46ab12d..a025b36 100644
--- a/include/asm-i386/fcntl.h
+++ b/include/asm-i386/fcntl.h
@@ -1 +1,3 @@
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index 1dd275d..622d230 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -8,6 +8,8 @@
#define force_o_largefile() \
(personality(current->personality) != PER_LINUX32)
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
#endif /* _ASM_IA64_FCNTL_H */
diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h
index 46ab12d..a025b36 100644
--- a/include/asm-m32r/fcntl.h
+++ b/include/asm-m32r/fcntl.h
@@ -1 +1,3 @@
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h
index 1c369b2..d9070e4 100644
--- a/include/asm-m68k/fcntl.h
+++ b/include/asm-m68k/fcntl.h
@@ -6,6 +6,8 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000
+#define __ARCH_FLOCK64
+
#include <asm-generic/fcntl.h>
#endif /* _M68K_FCNTL_H */
diff --git a/include/asm-m68knommu/fcntl.h b/include/asm-m68knommu/fcntl.h
index f6a552c..237f6b8 100644
--- a/include/asm-m68knommu/fcntl.h
+++ b/include/asm-m68knommu/fcntl.h
@@ -1 +1,3 @@
+#define __ARCH_FLOCK64
+
#include <asm-m68k/fcntl.h>
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 787220e..bab60a4 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -55,6 +55,8 @@ struct flock {
#define HAVE_ARCH_STRUCT_FLOCK
+#define __ARCH_FLOCK64
+
#endif /* CONFIG_32BIT */
#include <asm-generic/fcntl.h>
diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h
index 317851f..df97fd4 100644
--- a/include/asm-parisc/fcntl.h
+++ b/include/asm-parisc/fcntl.h
@@ -33,6 +33,10 @@
#define F_WRLCK 02
#define F_UNLCK 03
+#ifndef __LP64__
+#define __ARCH_FLOCK64
+#endif
+
#include <asm-generic/fcntl.h>
#endif
diff --git a/include/asm-powerpc/fcntl.h b/include/asm-powerpc/fcntl.h
index ce5c451..a399283 100644
--- a/include/asm-powerpc/fcntl.h
+++ b/include/asm-powerpc/fcntl.h
@@ -6,6 +6,10 @@
#define O_LARGEFILE 0200000
#define O_DIRECT 0400000 /* direct disk access hint */
+#ifndef __powerpc64__
+#define __ARCH_FLOCK64
+#endif
+
#include <asm-generic/fcntl.h>
#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 46ab12d..1495a78 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -1 +1,4 @@
+#ifndef __s390x__
+#define __ARCH_FLOCK64
+#endif
#include <asm-generic/fcntl.h>
diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h
index 46ab12d..0128121 100644
--- a/include/asm-sh/fcntl.h
+++ b/include/asm-sh/fcntl.h
@@ -1 +1,2 @@
+#define __ARCH_FLOCK64
#include <asm-generic/fcntl.h>
diff --git a/include/asm-sh64/fcntl.h b/include/asm-sh64/fcntl.h
index 744dd79..f887490 100644
--- a/include/asm-sh64/fcntl.h
+++ b/include/asm-sh64/fcntl.h
@@ -1 +1,2 @@
+#define __ARCH_FLOCK64
#include <asm-sh/fcntl.h>
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index 5db60b5..ce3e074 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -30,6 +30,7 @@
#define __ARCH_FLOCK_PAD short __unused;
#define __ARCH_FLOCK64_PAD short __unused;
+#define __ARCH_FLOCK64
#include <asm-generic/fcntl.h>
diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h
index 3af4d56..ef49898 100644
--- a/include/asm-v850/fcntl.h
+++ b/include/asm-v850/fcntl.h
@@ -6,6 +6,7 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000
+#define __ARCH_FLOCK64
#include <asm-generic/fcntl.h>
#endif /* __V850_FCNTL_H__ */
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h
index ec066ae..b1f33a9 100644
--- a/include/asm-xtensa/fcntl.h
+++ b/include/asm-xtensa/fcntl.h
@@ -55,6 +55,7 @@ struct flock64 {
#define HAVE_ARCH_STRUCT_FLOCK
#define HAVE_ARCH_STRUCT_FLOCK64
+#define __ARCH_FLOCK64
#include <asm-generic/fcntl.h>
--
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [patch 5/8] add missing #includes in user space parts of headers
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (11 preceding siblings ...)
2006-09-18 1:27 ` [patch 4/8] fix exported flock64 constants Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 6/8] annotate header files for make headers_check Arnd Bergmann
` (2 subsequent siblings)
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: headercheck.diff --]
[-- Type: text/plain, Size: 10883 bytes --]
These files should include some other headers in order
to be included from user space.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/include/asm-s390/cmb.h
===================================================================
--- linux-cg.orig/include/asm-s390/cmb.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/asm-s390/cmb.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,5 +1,9 @@
#ifndef S390_CMB_H
#define S390_CMB_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
/**
* struct cmbdata -- channel measurement block data for user space
*
Index: linux-cg/include/asm-s390/dasd.h
===================================================================
--- linux-cg.orig/include/asm-s390/dasd.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/asm-s390/dasd.h 2006-09-18 02:36:00.000000000 +0200
@@ -13,6 +13,7 @@
#ifndef DASD_H
#define DASD_H
#include <linux/ioctl.h>
+#include <linux/types.h>
#define DASD_IOCTL_LETTER 'D'
Index: linux-cg/include/asm-s390/qeth.h
===================================================================
--- linux-cg.orig/include/asm-s390/qeth.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/asm-s390/qeth.h 2006-09-18 02:36:00.000000000 +0200
@@ -11,6 +11,7 @@
#ifndef __ASM_S390_QETH_IOCTL_H__
#define __ASM_S390_QETH_IOCTL_H__
#include <linux/ioctl.h>
+#include <linux/types.h>
#define SIOC_QETH_ARP_SET_NO_ENTRIES (SIOCDEVPRIVATE)
#define SIOC_QETH_ARP_QUERY_INFO (SIOCDEVPRIVATE + 1)
Index: linux-cg/include/linux/atm.h
===================================================================
--- linux-cg.orig/include/linux/atm.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/atm.h 2006-09-18 02:36:00.000000000 +0200
@@ -11,6 +11,7 @@
#ifndef _LINUX_ATM_H
#define _LINUX_ATM_H
+#include <linux/types.h>
/*
* BEGIN_xx and END_xx markers are used for automatic generation of
* documentation. Do not change them.
Index: linux-cg/include/linux/audit.h
===================================================================
--- linux-cg.orig/include/linux/audit.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/audit.h 2006-09-18 02:36:00.000000000 +0200
@@ -25,6 +25,7 @@
#define _LINUX_AUDIT_H_
#include <linux/elf-em.h>
+#include <linux/types.h>
/* The netlink messages for the audit system is divided into blocks:
* 1000 - 1099 are for commanding the audit system
Index: linux-cg/include/linux/cm4000_cs.h
===================================================================
--- linux-cg.orig/include/linux/cm4000_cs.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/cm4000_cs.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _CM4000_H_
#define _CM4000_H_
+#include <linux/types.h>
+
#define MAX_ATR 33
#define CM4000_MAX_DEV 4
Index: linux-cg/include/linux/cyclades.h
===================================================================
--- linux-cg.orig/include/linux/cyclades.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/cyclades.h 2006-09-18 02:36:00.000000000 +0200
@@ -67,6 +67,8 @@
#ifndef _LINUX_CYCLADES_H
#define _LINUX_CYCLADES_H
+#include <linux/types.h>
+
struct cyclades_monitor {
unsigned long int_count;
unsigned long char_count;
Index: linux-cg/include/linux/ftape-header-segment.h
===================================================================
--- linux-cg.orig/include/linux/ftape-header-segment.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/ftape-header-segment.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _FTAPE_HEADER_SEGMENT_H
#define _FTAPE_HEADER_SEGMENT_H
+#include <linux/types.h>
/*
* Copyright (C) 1996-1997 Claus-Justus Heine.
Index: linux-cg/include/linux/hiddev.h
===================================================================
--- linux-cg.orig/include/linux/hiddev.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/hiddev.h 2006-09-18 02:36:00.000000000 +0200
@@ -29,6 +29,8 @@
* Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
*/
+#include <linux/types.h>
+
/*
* The event structure itself
*/
Index: linux-cg/include/linux/i2o-dev.h
===================================================================
--- linux-cg.orig/include/linux/i2o-dev.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/i2o-dev.h 2006-09-18 02:36:00.000000000 +0200
@@ -24,6 +24,7 @@
#define MAX_I2O_CONTROLLERS 32
#include <linux/ioctl.h>
+#include <linux/types.h>
/*
* I2O Control IOCTLs and structures
Index: linux-cg/include/linux/ite_gpio.h
===================================================================
--- linux-cg.orig/include/linux/ite_gpio.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/ite_gpio.h 2006-09-18 02:36:00.000000000 +0200
@@ -33,6 +33,7 @@
#ifndef __ITE_GPIO_H
#define __ITE_GPIO_H
+#include <linux/types.h>
#include <linux/ioctl.h>
struct ite_gpio_ioctl_data {
Index: linux-cg/include/linux/loop.h
===================================================================
--- linux-cg.orig/include/linux/loop.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/loop.h 2006-09-18 02:36:00.000000000 +0200
@@ -77,8 +77,8 @@
LO_FLAGS_USE_AOPS = 2,
};
-#include <asm/posix_types.h> /* for __kernel_old_dev_t */
-#include <asm/types.h> /* for __u64 */
+#include <linux/posix_types.h> /* for __kernel_old_dev_t */
+#include <linux/types.h> /* for __u64 */
/* Backwards compatibility version */
struct loop_info {
Index: linux-cg/include/linux/nbd.h
===================================================================
--- linux-cg.orig/include/linux/nbd.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/nbd.h 2006-09-18 02:36:00.000000000 +0200
@@ -15,6 +15,8 @@
#ifndef LINUX_NBD_H
#define LINUX_NBD_H
+#include <linux/types.h>
+
#define NBD_SET_SOCK _IO( 0xab, 0 )
#define NBD_SET_BLKSIZE _IO( 0xab, 1 )
#define NBD_SET_SIZE _IO( 0xab, 2 )
Index: linux-cg/include/linux/pkt_sched.h
===================================================================
--- linux-cg.orig/include/linux/pkt_sched.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/pkt_sched.h 2006-09-18 02:45:05.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_PKT_SCHED_H
#define __LINUX_PKT_SCHED_H
+#include <linux/types.h>
+
/* Logical priority bands not depending on specific packet scheduler.
Every scheduler will map them to real traffic classes, if it has
no more precise mechanism to classify packets.
Index: linux-cg/include/linux/ppp_defs.h
===================================================================
--- linux-cg.orig/include/linux/ppp_defs.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/ppp_defs.h 2006-09-18 02:43:44.000000000 +0200
@@ -42,6 +42,8 @@
#ifndef _PPP_DEFS_H_
#define _PPP_DEFS_H_
+#include <linux/types.h>
+
/*
* The basic PPP frame.
*/
Index: linux-cg/include/linux/qic117.h
===================================================================
--- linux-cg.orig/include/linux/qic117.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/qic117.h 2006-09-18 02:36:00.000000000 +0200
@@ -53,6 +53,8 @@
* QIC-CRF3, Rev. B, 15 Jun 95.
* */
+#include <linux/types.h>
+
/*
* QIC-117 common command set rev. J.
* These commands are sent to the tape unit
Index: linux-cg/include/linux/qnxtypes.h
===================================================================
--- linux-cg.orig/include/linux/qnxtypes.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/qnxtypes.h 2006-09-18 02:36:00.000000000 +0200
@@ -12,6 +12,8 @@
#ifndef _QNX4TYPES_H
#define _QNX4TYPES_H
+#include <linux/types.h>
+
typedef __le16 qnx4_nxtnt_t;
typedef __u8 qnx4_ftype_t;
Index: linux-cg/include/linux/raid/md_p.h
===================================================================
--- linux-cg.orig/include/linux/raid/md_p.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/raid/md_p.h 2006-09-18 02:36:00.000000000 +0200
@@ -15,6 +15,7 @@
#ifndef _MD_P_H
#define _MD_P_H
+#include <linux/types.h>
/*
* RAID superblock.
*
Index: linux-cg/include/linux/random.h
===================================================================
--- linux-cg.orig/include/linux/random.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/random.h 2006-09-18 02:36:00.000000000 +0200
@@ -8,6 +8,7 @@
#define _LINUX_RANDOM_H
#include <linux/ioctl.h>
+#include <linux/types.h>
/* ioctl()'s for the random number generator */
Index: linux-cg/include/linux/reiserfs_xattr.h
===================================================================
--- linux-cg.orig/include/linux/reiserfs_xattr.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/reiserfs_xattr.h 2006-09-18 02:36:00.000000000 +0200
@@ -3,6 +3,7 @@
*/
#include <linux/xattr.h>
+#include <linux/types.h>
/* Magic value in header */
#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
Index: linux-cg/include/linux/video_decoder.h
===================================================================
--- linux-cg.orig/include/linux/video_decoder.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/video_decoder.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_VIDEO_DECODER_H
#define _LINUX_VIDEO_DECODER_H
+#include <linux/types.h>
+
#define HAVE_VIDEO_DECODER 1
struct video_decoder_capability { /* this name is too long */
Index: linux-cg/include/linux/video_encoder.h
===================================================================
--- linux-cg.orig/include/linux/video_encoder.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/video_encoder.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_VIDEO_ENCODER_H
#define _LINUX_VIDEO_ENCODER_H
+#include <linux/types.h>
+
struct video_encoder_capability { /* this name is too long */
__u32 flags;
#define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */
Index: linux-cg/include/linux/videodev2.h
===================================================================
--- linux-cg.orig/include/linux/videodev2.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/linux/videodev2.h 2006-09-18 02:36:00.000000000 +0200
@@ -19,6 +19,7 @@
#include <linux/compiler.h> /* need __user */
#else
#define __user
+#include <sys/time.h>
#endif
#include <linux/types.h>
Index: linux-cg/include/sound/hdsp.h
===================================================================
--- linux-cg.orig/include/sound/hdsp.h 2006-09-18 02:36:00.000000000 +0200
+++ linux-cg/include/sound/hdsp.h 2006-09-18 02:36:00.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __SOUND_HDSP_H
#define __SOUND_HDSP_H
+#include <linux/types.h>
+
/*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 6/8] annotate header files for make headers_check
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (12 preceding siblings ...)
2006-09-18 1:27 ` [patch 5/8] add missing #includes in user space parts of headers Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 8/8] annotate netfilter header " Arnd Bergmann
2006-09-18 1:37 ` [patch 7/8] annotate if_* " Arnd Bergmann
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: headercheck-annotate.diff --]
[-- Type: text/plain, Size: 29949 bytes --]
These files can only be included from user space if some
other header has been included first, and they don't look
like they should include that header themselves.
This uses a special '@headercheck: ... @' tag in a comment,
which is then turned into a gcc command line option that
will include the dependencies first.
All netfilter headers need something like this as well,
but I decided to make them a separate patch, because there
are so many of them.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/include/asm-generic/siginfo.h
===================================================================
--- linux-cg.orig/include/asm-generic/siginfo.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-generic/siginfo.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _ASM_GENERIC_SIGINFO_H
#define _ASM_GENERIC_SIGINFO_H
+/* @headercheck: -include linux/signal.h @ */
+
#include <linux/compiler.h>
#include <linux/types.h>
Index: linux-cg/include/asm-i386/ipcbuf.h
===================================================================
--- linux-cg.orig/include/asm-i386/ipcbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-i386/ipcbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -10,6 +10,7 @@
* - 32-bit mode_t and seq
* - 2 miscellaneous 32-bit values
*/
+/* @headercheck: -include linux/posix_types.h @ */
struct ipc64_perm
{
Index: linux-cg/include/asm-i386/msgbuf.h
===================================================================
--- linux-cg.orig/include/asm-i386/msgbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-i386/msgbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -10,6 +10,8 @@
* - 64-bit time_t to solve y2038 problem
* - 2 miscellaneous 32-bit values
*/
+/* @headercheck: -include linux/posix_types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
struct msqid64_ds {
struct ipc64_perm msg_perm;
Index: linux-cg/include/asm-i386/sembuf.h
===================================================================
--- linux-cg.orig/include/asm-i386/sembuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-i386/sembuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -10,6 +10,8 @@
* - 64-bit time_t to solve y2038 problem
* - 2 miscellaneous 32-bit values
*/
+/* @headercheck: -include linux/posix_types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
struct semid64_ds {
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
Index: linux-cg/include/asm-i386/shmbuf.h
===================================================================
--- linux-cg.orig/include/asm-i386/shmbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-i386/shmbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -10,6 +10,9 @@
* - 64-bit time_t to solve y2038 problem
* - 2 miscellaneous 32-bit values
*/
+/* @headercheck: -include linux/posix_types.h @ */
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
Index: linux-cg/include/asm-i386/ucontext.h
===================================================================
--- linux-cg.orig/include/asm-i386/ucontext.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-i386/ucontext.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _ASMi386_UCONTEXT_H
#define _ASMi386_UCONTEXT_H
+/* @headercheck: -include asm/signal.h @ */
+/* @headercheck: -include asm/sigcontext.h @ */
+
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
Index: linux-cg/include/asm-powerpc/msgbuf.h
===================================================================
--- linux-cg.orig/include/asm-powerpc/msgbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-powerpc/msgbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _ASM_POWERPC_MSGBUF_H
#define _ASM_POWERPC_MSGBUF_H
+/* @headercheck:-include asm/ipcbuf.h@ */
/*
* The msqid64_ds structure for the PowerPC architecture.
* Note extra padding because this structure is passed back and forth
Index: linux-cg/include/asm-powerpc/posix_types.h
===================================================================
--- linux-cg.orig/include/asm-powerpc/posix_types.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-powerpc/posix_types.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _ASM_POWERPC_POSIX_TYPES_H
#define _ASM_POWERPC_POSIX_TYPES_H
+/* @headercheck:-include linux/posix_types.h@ */
/*
* This file is generally used by user-level software, so you need to
* be a little careful about namespace pollution etc. Also, we cannot
Index: linux-cg/include/asm-powerpc/sembuf.h
===================================================================
--- linux-cg.orig/include/asm-powerpc/sembuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-powerpc/sembuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _ASM_POWERPC_SEMBUF_H
#define _ASM_POWERPC_SEMBUF_H
+/* @headercheck:-include asm/ipcbuf.h@ */
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Index: linux-cg/include/asm-powerpc/shmbuf.h
===================================================================
--- linux-cg.orig/include/asm-powerpc/shmbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-powerpc/shmbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _ASM_POWERPC_SHMBUF_H
#define _ASM_POWERPC_SHMBUF_H
+/* @headercheck:-include asm/ipcbuf.h@ */
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Index: linux-cg/include/asm-s390/ipcbuf.h
===================================================================
--- linux-cg.orig/include/asm-s390/ipcbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-s390/ipcbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __S390_IPCBUF_H__
#define __S390_IPCBUF_H__
+/* @headercheck: -include linux/types.h @ */
+
/*
* The user_ipc_perm structure for S/390 architecture.
* Note extra padding because this structure is passed back and forth
Index: linux-cg/include/asm-s390/msgbuf.h
===================================================================
--- linux-cg.orig/include/asm-s390/msgbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-s390/msgbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _S390_MSGBUF_H
#define _S390_MSGBUF_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
+
/*
* The msqid64_ds structure for S/390 architecture.
* Note extra padding because this structure is passed back and forth
Index: linux-cg/include/asm-s390/sembuf.h
===================================================================
--- linux-cg.orig/include/asm-s390/sembuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-s390/sembuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _S390_SEMBUF_H
#define _S390_SEMBUF_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
+
/*
* The semid64_ds structure for S/390 architecture.
* Note extra padding because this structure is passed back and forth
Index: linux-cg/include/asm-s390/shmbuf.h
===================================================================
--- linux-cg.orig/include/asm-s390/shmbuf.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-s390/shmbuf.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _S390_SHMBUF_H
#define _S390_SHMBUF_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include asm/ipcbuf.h @ */
+
/*
* The shmid64_ds structure for S/390 architecture.
* Note extra padding because this structure is passed back and forth
Index: linux-cg/include/asm-s390/ucontext.h
===================================================================
--- linux-cg.orig/include/asm-s390/ucontext.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-s390/ucontext.h 2006-09-18 02:54:10.000000000 +0200
@@ -9,6 +9,9 @@
#ifndef _ASM_S390_UCONTEXT_H
#define _ASM_S390_UCONTEXT_H
+/* @headercheck: -include asm/signal.h @ */
+/* @headercheck: -include asm/sigcontext.h @ */
+
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
Index: linux-cg/include/linux/atalk.h
===================================================================
--- linux-cg.orig/include/linux/atalk.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/atalk.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__
+/* @headercheck: -include linux/socket.h @ */
#include <asm/byteorder.h>
/*
Index: linux-cg/include/linux/atm_tcp.h
===================================================================
--- linux-cg.orig/include/linux/atm_tcp.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/atm_tcp.h 2006-09-18 02:54:10.000000000 +0200
@@ -12,6 +12,8 @@
#ifdef __KERNEL__
#include <linux/types.h>
#endif
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/atm.h @ */
#include <linux/atmioc.h>
Index: linux-cg/include/linux/atm_zatm.h
===================================================================
--- linux-cg.orig/include/linux/atm_zatm.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/atm_zatm.h 2006-09-18 02:54:10.000000000 +0200
@@ -11,6 +11,7 @@
* Note: non-kernel programs including this file must also include
* sys/types.h for struct timeval
*/
+/* @headercheck: -include sys/types.h@ */
#include <linux/atmapi.h>
#include <linux/atmioc.h>
Index: linux-cg/include/linux/atmarp.h
===================================================================
--- linux-cg.orig/include/linux/atmarp.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/atmarp.h 2006-09-18 02:54:10.000000000 +0200
@@ -9,6 +9,8 @@
#ifdef __KERNEL__
#include <linux/types.h>
#endif
+/* @headercheck: -include linux/types.h @ */
+
#include <linux/atmapi.h>
#include <linux/atmioc.h>
Index: linux-cg/include/linux/dirent.h
===================================================================
--- linux-cg.orig/include/linux/dirent.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/dirent.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_DIRENT_H
#define _LINUX_DIRENT_H
+/* @headercheck: -include linux/types.h @ */
+
struct dirent {
long d_ino;
__kernel_off_t d_off;
Index: linux-cg/include/linux/errqueue.h
===================================================================
--- linux-cg.orig/include/linux/errqueue.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/errqueue.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_ERRQUEUE_H
#define _LINUX_ERRQUEUE_H 1
+/* @headercheck: -include linux/types.h @ */
+
struct sock_extended_err
{
__u32 ee_errno;
Index: linux-cg/include/linux/hdlc/ioctl.h
===================================================================
--- linux-cg.orig/include/linux/hdlc/ioctl.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/hdlc/ioctl.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __HDLC_IOCTL_H__
#define __HDLC_IOCTL_H__
+/* @headercheck:-include linux/if.h@ */
+
typedef struct {
unsigned int clock_rate; /* bits per second */
unsigned int clock_type; /* internal, external, TX-internal etc. */
Index: linux-cg/include/linux/inet_diag.h
===================================================================
--- linux-cg.orig/include/linux/inet_diag.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/inet_diag.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _INET_DIAG_H_
#define _INET_DIAG_H_ 1
+/* @headercheck: -include linux/types.h @ */
+
/* Just some random number */
#define TCPDIAG_GETSOCK 18
#define DCCPDIAG_GETSOCK 19
Index: linux-cg/include/linux/ipv6_route.h
===================================================================
--- linux-cg.orig/include/linux/ipv6_route.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/ipv6_route.h 2006-09-18 02:54:10.000000000 +0200
@@ -13,6 +13,9 @@
#ifndef _LINUX_IPV6_ROUTE_H
#define _LINUX_IPV6_ROUTE_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/in6.h @ */
+
#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
#define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
fallback, no routers on link */
Index: linux-cg/include/linux/irda.h
===================================================================
--- linux-cg.orig/include/linux/irda.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/irda.h 2006-09-18 02:54:10.000000000 +0200
@@ -30,6 +30,7 @@
* Please fix the calling file to properly included needed files before
* this one, or preferably to include <net/irda/irda.h> instead.
* Jean II */
+/* @headercheck: -include linux/socket.h@ */
/* Hint bit positions for first hint byte */
#define HINT_PNP 0x01
Index: linux-cg/include/linux/llc.h
===================================================================
--- linux-cg.orig/include/linux/llc.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/llc.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,5 +1,9 @@
#ifndef __LINUX_LLC_H
#define __LINUX_LLC_H
+
+/* @headercheck: -include linux/socket.h @ */
+/* @headercheck: -include linux/if.h @ */
+
/*
* IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
*
Index: linux-cg/include/linux/netfilter_ipv4/ipt_physdev.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_physdev.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_physdev.h 2006-09-18 02:54:10.000000000 +0200
@@ -2,6 +2,7 @@
#define _IPT_PHYSDEV_H
/* Backwards compatibility for old userspace */
+/* @headercheck:-include linux/if.h@ */
#include <linux/netfilter/xt_physdev.h>
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_physdev.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_physdev.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_physdev.h 2006-09-18 02:54:10.000000000 +0200
@@ -2,6 +2,7 @@
#define _IP6T_PHYSDEV_H
/* Backwards compatibility for old userspace */
+/* @headercheck:-include linux/if.h@ */
#include <linux/netfilter/xt_physdev.h>
Index: linux-cg/include/linux/netrom.h
===================================================================
--- linux-cg.orig/include/linux/netrom.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/netrom.h 2006-09-18 02:54:10.000000000 +0200
@@ -3,6 +3,7 @@
* For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
* definition of the ax25_address structure.
*/
+/* @headercheck: -include linux/ax25.h@ */
#ifndef NETROM_KERNEL_H
#define NETROM_KERNEL_H
Index: linux-cg/include/linux/nfs_idmap.h
===================================================================
--- linux-cg.orig/include/linux/nfs_idmap.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/nfs_idmap.h 2006-09-18 02:54:10.000000000 +0200
@@ -37,6 +37,8 @@
#ifndef NFS_IDMAP_H
#define NFS_IDMAP_H
+/* @headercheck: -include linux/types.h @ */
+
/* XXX from bits/utmp.h */
#define IDMAP_NAMESZ 128
Index: linux-cg/include/linux/nubus.h
===================================================================
--- linux-cg.orig/include/linux/nubus.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/nubus.h 2006-09-18 02:54:10.000000000 +0200
@@ -12,6 +12,8 @@
#ifndef LINUX_NUBUS_H
#define LINUX_NUBUS_H
+/* @headercheck: -include linux/types.h @ */
+
#ifdef __KERNEL__
#include <asm/nubus.h>
#endif
Index: linux-cg/include/linux/patchkey.h
===================================================================
--- linux-cg.orig/include/linux/patchkey.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/patchkey.h 2006-09-18 02:54:10.000000000 +0200
@@ -9,14 +9,15 @@
* Do not include this file directly. Please use <sys/soundcard.h> instead.
* For kernel code, use <linux/soundcard.h>
*/
+#ifndef _LINUX_PATCHKEY_H
+#define _LINUX_PATCHKEY_H
+
+/* @headercheck: -include linux/soundcard.h @ */
#ifndef _LINUX_PATCHKEY_H_INDIRECT
#error "patchkey.h included directly"
#endif
-#ifndef _LINUX_PATCHKEY_H
-#define _LINUX_PATCHKEY_H
-
/* Endian macros. */
#ifdef __KERNEL__
# include <asm/byteorder.h>
Index: linux-cg/include/linux/romfs_fs.h
===================================================================
--- linux-cg.orig/include/linux/romfs_fs.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/romfs_fs.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_ROMFS_FS_H
#define __LINUX_ROMFS_FS_H
+/* @headercheck: -include linux/types.h @ */
+
/* The basic structures of the romfs filesystem */
#define ROMBSIZE BLOCK_SIZE
Index: linux-cg/include/linux/rose.h
===================================================================
--- linux-cg.orig/include/linux/rose.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/rose.h 2006-09-18 02:54:10.000000000 +0200
@@ -7,6 +7,9 @@
#ifndef ROSE_KERNEL_H
#define ROSE_KERNEL_H
+/* @headercheck: -include linux/socket.h @ */
+/* @headercheck: -include linux/ax25.h @ */
+
#define ROSE_MTU 251
#define ROSE_MAX_DIGIS 6
Index: linux-cg/include/linux/scc.h
===================================================================
--- linux-cg.orig/include/linux/scc.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/scc.h 2006-09-18 02:54:10.000000000 +0200
@@ -3,6 +3,7 @@
#ifndef _SCC_H
#define _SCC_H
+/* @headercheck: -include linux/sockios.h @ */
/* selection of hardware types */
Index: linux-cg/include/linux/sdla.h
===================================================================
--- linux-cg.orig/include/linux/sdla.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/sdla.h 2006-09-18 02:54:10.000000000 +0200
@@ -23,6 +23,8 @@
#ifndef SDLA_H
#define SDLA_H
+/* @headercheck: -include linux/if_frad.h @ */
+
/* adapter type */
#define SDLA_TYPES
#define SDLA_S502A 5020
Index: linux-cg/include/linux/selinux_netlink.h
===================================================================
--- linux-cg.orig/include/linux/selinux_netlink.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/selinux_netlink.h 2006-09-18 02:54:10.000000000 +0200
@@ -12,6 +12,8 @@
#ifndef _LINUX_SELINUX_NETLINK_H
#define _LINUX_SELINUX_NETLINK_H
+/* @headercheck: -include linux/types.h @ */
+
/* Message types. */
#define SELNL_MSG_BASE 0x10
enum {
Index: linux-cg/include/linux/uinput.h
===================================================================
--- linux-cg.orig/include/linux/uinput.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/uinput.h 2006-09-18 02:54:10.000000000 +0200
@@ -28,6 +28,8 @@
* 0.1 20/06/2002
* - first public version
*/
+/* @headercheck: -include linux/input.h @ */
+
#ifdef __KERNEL__
#define UINPUT_MINOR 223
#define UINPUT_NAME "uinput"
Index: linux-cg/include/linux/un.h
===================================================================
--- linux-cg.orig/include/linux/un.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/un.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _LINUX_UN_H
#define _LINUX_UN_H
+/* @headercheck: -include linux/socket.h @ */
#define UNIX_PATH_MAX 108
struct sockaddr_un {
Index: linux-cg/include/linux/utime.h
===================================================================
--- linux-cg.orig/include/linux/utime.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/utime.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,7 @@
#ifndef _LINUX_UTIME_H
#define _LINUX_UTIME_H
+/* @headercheck: -include linux/types.h @ */
struct utimbuf {
time_t actime;
time_t modtime;
Index: linux-cg/include/linux/x25.h
===================================================================
--- linux-cg.orig/include/linux/x25.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/x25.h 2006-09-18 02:54:10.000000000 +0200
@@ -12,6 +12,7 @@
#define X25_KERNEL_H
#include <linux/types.h>
+/* @headercheck: -include linux/socket.h @ */
#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
Index: linux-cg/include/mtd/inftl-user.h
===================================================================
--- linux-cg.orig/include/mtd/inftl-user.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/mtd/inftl-user.h 2006-09-18 02:54:10.000000000 +0200
@@ -8,6 +8,8 @@
#ifndef __MTD_INFTL_USER_H__
#define __MTD_INFTL_USER_H__
+/* @headercheck: -include linux/types.h @ */
+
#define OSAK_VERSION 0x5120
#define PERCENTUSED 98
Index: linux-cg/include/mtd/mtd-abi.h
===================================================================
--- linux-cg.orig/include/mtd/mtd-abi.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/mtd/mtd-abi.h 2006-09-18 02:54:10.000000000 +0200
@@ -7,11 +7,7 @@
#ifndef __MTD_ABI_H__
#define __MTD_ABI_H__
-#ifndef __KERNEL__
-/* Urgh. The whole point of splitting this out into
- separate files was to avoid #ifdef __KERNEL__ */
-#define __user
-#endif
+/* @headercheck: -include linux/types.h @ */
struct erase_info_user {
uint32_t start;
Index: linux-cg/include/mtd/nftl-user.h
===================================================================
--- linux-cg.orig/include/mtd/nftl-user.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/mtd/nftl-user.h 2006-09-18 02:54:10.000000000 +0200
@@ -8,6 +8,8 @@
#ifndef __MTD_NFTL_USER_H__
#define __MTD_NFTL_USER_H__
+/* @headercheck: -include linux/types.h @ */
+
/* Block Control Information */
struct nftl_bci {
Index: linux-cg/include/scsi/sg.h
===================================================================
--- linux-cg.orig/include/scsi/sg.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/scsi/sg.h 2006-09-18 02:54:10.000000000 +0200
@@ -2,6 +2,7 @@
#define _SCSI_GENERIC_H
#include <linux/compiler.h>
+/* @headercheck: -include linux/types.h @ */
/*
History:
Index: linux-cg/include/sound/asequencer.h
===================================================================
--- linux-cg.orig/include/sound/asequencer.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/sound/asequencer.h 2006-09-18 02:54:10.000000000 +0200
@@ -22,9 +22,11 @@
#ifndef __SOUND_ASEQUENCER_H
#define __SOUND_ASEQUENCER_H
-#ifdef __KERNEL__
-#include <linux/ioctl.h>
#include <sound/asound.h>
+/* @headercheck: -include linux/time.h @ */
+
+#ifndef __KERNEL__
+#define __bitwise
#endif
/** version of the sequencer */
Index: linux-cg/include/sound/asound.h
===================================================================
--- linux-cg.orig/include/sound/asound.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/sound/asound.h 2006-09-18 02:54:10.000000000 +0200
@@ -23,9 +23,12 @@
#ifndef __SOUND_ASOUND_H
#define __SOUND_ASOUND_H
-#ifdef __KERNEL__
-#include <linux/ioctl.h>
#include <linux/types.h>
+#include <linux/ioctl.h>
+
+/* @headercheck: -include linux/time.h @ */
+
+#ifdef __KERNEL__
#include <linux/time.h>
#include <asm/byteorder.h>
Index: linux-cg/include/sound/emu10k1.h
===================================================================
--- linux-cg.orig/include/sound/emu10k1.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/sound/emu10k1.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,10 @@
#ifndef __SOUND_EMU10K1_H
#define __SOUND_EMU10K1_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/time.h @ */
+/* @headercheck: -include sound/asound.h @ */
+
/*
* Copyright (c) by Jaroslav Kysela <perex@suse.cz>,
* Creative Labs, Inc.
@@ -1527,6 +1531,11 @@
unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
};
+#ifndef DECLARE_BITMAP
+#define DECLARE_BITMAP(name,bits) \
+ unsigned long name[(bits) / (8*sizeof(long))]
+#endif
+
struct snd_emu10k1_fx8010_code {
char name[128];
Index: linux-cg/include/sound/sfnt_info.h
===================================================================
--- linux-cg.orig/include/sound/sfnt_info.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/sound/sfnt_info.h 2006-09-18 02:54:10.000000000 +0200
@@ -22,6 +22,8 @@
*
*/
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include time.h @ */
#include <sound/asound.h>
/*
Index: linux-cg/include/asm-generic/atomic.h
===================================================================
--- linux-cg.orig/include/asm-generic/atomic.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/asm-generic/atomic.h 2006-09-18 02:54:10.000000000 +0200
@@ -8,6 +8,8 @@
* edit all arch specific atomic.h files.
*/
+/* @headercheck:-include asm/atomic.h@ */
+
#include <asm/types.h>
/*
Index: linux-cg/include/linux/nfsd/syscall.h
===================================================================
--- linux-cg.orig/include/linux/nfsd/syscall.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/nfsd/syscall.h 2006-09-18 02:54:10.000000000 +0200
@@ -9,6 +9,9 @@
#ifndef NFSD_SYSCALL_H
#define NFSD_SYSCALL_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/in.h@ */
+
#include <asm/types.h>
#ifdef __KERNEL__
# include <linux/types.h>
Index: linux-cg/include/linux/auto_fs4.h
===================================================================
--- linux-cg.orig/include/linux/auto_fs4.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/auto_fs4.h 2006-09-18 02:54:10.000000000 +0200
@@ -11,6 +11,9 @@
#ifndef _LINUX_AUTO_FS4_H
#define _LINUX_AUTO_FS4_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/limits.h @ */
+
/* Include common v3 definitions */
#include <linux/auto_fs.h>
Index: linux-cg/include/linux/bfs_fs.h
===================================================================
--- linux-cg.orig/include/linux/bfs_fs.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/bfs_fs.h 2006-09-18 02:54:10.000000000 +0200
@@ -6,6 +6,8 @@
#ifndef _LINUX_BFS_FS_H
#define _LINUX_BFS_FS_H
+/* @headercheck: -include linux/types.h @ */
+
#define BFS_BSIZE_BITS 9
#define BFS_BSIZE (1<<BFS_BSIZE_BITS)
Index: linux-cg/include/linux/efs_fs_sb.h
===================================================================
--- linux-cg.orig/include/linux/efs_fs_sb.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/efs_fs_sb.h 2006-09-18 02:54:10.000000000 +0200
@@ -9,6 +9,8 @@
#ifndef __EFS_FS_SB_H__
#define __EFS_FS_SB_H__
+/* @headercheck: -include linux/types.h @ */
+
/* statfs() magic number for EFS */
#define EFS_SUPER_MAGIC 0x414A53
Index: linux-cg/include/linux/jffs2.h
===================================================================
--- linux-cg.orig/include/linux/jffs2.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/jffs2.h 2006-09-18 02:54:10.000000000 +0200
@@ -15,6 +15,8 @@
#ifndef __LINUX_JFFS2_H__
#define __LINUX_JFFS2_H__
+/* @headercheck: -include linux/types.h @ */
+
/* You must include something which defines the C99 uintXX_t types.
We don't do it from here because this file is used in too many
different environments. */
Index: linux-cg/include/linux/minix_fs.h
===================================================================
--- linux-cg.orig/include/linux/minix_fs.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/minix_fs.h 2006-09-18 02:54:10.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_MINIX_FS_H
#define _LINUX_MINIX_FS_H
+/* @headercheck: -include linux/types.h @ */
+
/*
* The minix filesystem constants/structures
*/
Index: linux-cg/include/linux/auto_fs.h
===================================================================
--- linux-cg.orig/include/linux/auto_fs.h 2006-09-18 02:52:30.000000000 +0200
+++ linux-cg/include/linux/auto_fs.h 2006-09-18 02:54:10.000000000 +0200
@@ -14,6 +14,9 @@
#ifndef _LINUX_AUTO_FS_H
#define _LINUX_AUTO_FS_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/limits.h @ */
+
#ifdef __KERNEL__
#include <linux/fs.h>
#include <linux/limits.h>
Index: linux-cg/include/linux/dn.h
===================================================================
--- linux-cg.orig/include/linux/dn.h 2006-09-18 02:54:17.000000000 +0200
+++ linux-cg/include/linux/dn.h 2006-09-18 02:54:20.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _LINUX_DN_H
#define _LINUX_DN_H
+/* @headercheck: -include linux/types.h @ */
+
/*
DECnet Data Structures and Constants
Index: linux-cg/include/linux/ethtool.h
===================================================================
--- linux-cg.orig/include/linux/ethtool.h 2006-09-18 02:54:17.000000000 +0200
+++ linux-cg/include/linux/ethtool.h 2006-09-18 02:54:20.000000000 +0200
@@ -12,6 +12,7 @@
#ifndef _LINUX_ETHTOOL_H
#define _LINUX_ETHTOOL_H
+/* @headercheck: -include linux/types.h @ */
/* This should work for both 32 and 64 bit userland. */
struct ethtool_cmd {
Index: linux-cg/include/linux/synclink.h
===================================================================
--- linux-cg.orig/include/linux/synclink.h 2006-09-18 02:54:17.000000000 +0200
+++ linux-cg/include/linux/synclink.h 2006-09-18 02:54:20.000000000 +0200
@@ -13,6 +13,8 @@
#define _SYNCLINK_H_
#define SYNCLINK_H_VERSION 3.6
+/* @headercheck: -include linux/types.h @ */
+
#define BOOLEAN int
#define TRUE 1
#define FALSE 0
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 8/8] annotate netfilter header for make headers_check
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (13 preceding siblings ...)
2006-09-18 1:27 ` [patch 6/8] annotate header files for make headers_check Arnd Bergmann
@ 2006-09-18 1:27 ` Arnd Bergmann
2006-09-18 1:37 ` [patch 7/8] annotate if_* " Arnd Bergmann
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
[-- Attachment #1: headercheck-netfilter.diff --]
[-- Type: text/plain, Size: 55147 bytes --]
more warning to avoid from checking the user space exported
headers.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/include/linux/netfilter/nf_conntrack_sctp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/nf_conntrack_sctp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/nf_conntrack_sctp.h 2006-09-18 00:54:13.000000000 +0200
@@ -2,6 +2,8 @@
#define _NF_CONNTRACK_SCTP_H
/* SCTP tracking. */
+/* @headercheck: -include linux/types.h @ */
+
#include <linux/netfilter/nf_conntrack_tuple_common.h>
enum sctp_conntrack {
Index: linux-cg/include/linux/netfilter/x_tables.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/x_tables.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/x_tables.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _X_TABLES_H
#define _X_TABLES_H
+/* @headercheck:-include linux/types.h @ */
+
#define XT_FUNCTION_MAXNAMELEN 30
#define XT_TABLE_MAXNAMELEN 32
Index: linux-cg/include/linux/netfilter/xt_CLASSIFY.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_CLASSIFY.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_CLASSIFY.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_CLASSIFY_H
#define _XT_CLASSIFY_H
+/* @headercheck:-include linux/types.h @ */
+
struct xt_classify_target_info {
u_int32_t priority;
};
Index: linux-cg/include/linux/netfilter/xt_CONNMARK.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_CONNMARK.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_CONNMARK.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_CONNMARK_H_target
#define _XT_CONNMARK_H_target
+/* @headercheck:-include linux/types.h@ */
+
/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
* by Henrik Nordstrom <hno@marasystems.com>
*
Index: linux-cg/include/linux/netfilter/xt_MARK.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_MARK.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_MARK.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_MARK_H_target
#define _XT_MARK_H_target
+/* @headercheck:-include sys/types.h@ */
+
/* Version 0 */
struct xt_mark_target_info {
unsigned long mark;
Index: linux-cg/include/linux/netfilter/xt_NFQUEUE.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_NFQUEUE.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_NFQUEUE.h 2006-09-18 00:54:13.000000000 +0200
@@ -3,8 +3,9 @@
* (C) 2005 Harald Welte <laforge@netfilter.org>
*
* This software is distributed under GNU GPL v2, 1991
- *
-*/
+ *
+ */
+/* @headercheck:-include linux/types.h@ */
#ifndef _XT_NFQ_TARGET_H
#define _XT_NFQ_TARGET_H
Index: linux-cg/include/linux/netfilter/xt_connbytes.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_connbytes.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_connbytes.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_CONNBYTES_H
#define _XT_CONNBYTES_H
+/* @headercheck:-include linux/types.h@ */
+
enum xt_connbytes_what {
XT_CONNBYTES_PKTS,
XT_CONNBYTES_BYTES,
Index: linux-cg/include/linux/netfilter/xt_connmark.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_connmark.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_connmark.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_CONNMARK_H
#define _XT_CONNMARK_H
+/* @headercheck:-include linux/types.h@ */
+
/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
* by Henrik Nordstrom <hno@marasystems.com>
*
Index: linux-cg/include/linux/netfilter/xt_dccp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_dccp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_dccp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_DCCP_H_
#define _XT_DCCP_H_
+/* @headercheck:-include linux/types.h@ */
+
#define XT_DCCP_SRC_PORTS 0x01
#define XT_DCCP_DEST_PORTS 0x02
#define XT_DCCP_TYPE 0x04
Index: linux-cg/include/linux/netfilter/xt_esp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_esp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_esp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_ESP_H
#define _XT_ESP_H
+/* @headercheck:-include linux/types.h@ */
+
struct xt_esp
{
u_int32_t spis[2]; /* Security Parameter Index */
Index: linux-cg/include/linux/netfilter/xt_length.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_length.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_length.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_LENGTH_H
#define _XT_LENGTH_H
+/* @headercheck:-include linux/types.h@ */
+
struct xt_length_info {
u_int16_t min, max;
u_int8_t invert;
Index: linux-cg/include/linux/netfilter/xt_limit.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_limit.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_limit.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_RATE_H
#define _XT_RATE_H
+/* @headercheck:-include linux/types.h@ */
+
/* timings are in milliseconds. */
#define XT_LIMIT_SCALE 10000
Index: linux-cg/include/linux/netfilter/xt_mac.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_mac.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_mac.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _XT_MAC_H
#define _XT_MAC_H
+/* @headercheck:-include linux/types.h @ */
+/* @headercheck:-include linux/if_ether.h @ */
+
struct xt_mac_info {
unsigned char srcaddr[ETH_ALEN];
int invert;
Index: linux-cg/include/linux/netfilter/xt_mark.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_mark.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_mark.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_MARK_H
#define _XT_MARK_H
+/* @headercheck:-include linux/types.h@ */
+
struct xt_mark_info {
unsigned long mark, mask;
u_int8_t invert;
Index: linux-cg/include/linux/netfilter/xt_multiport.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_multiport.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_multiport.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_MULTIPORT_H
#define _XT_MULTIPORT_H
+/* @headercheck:-include linux/types.h@ */
+
enum xt_multiport_flags
{
XT_MULTIPORT_SOURCE,
Index: linux-cg/include/linux/netfilter/xt_physdev.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_physdev.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_physdev.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,7 +1,10 @@
#ifndef _XT_PHYSDEV_H
#define _XT_PHYSDEV_H
-#ifdef __KERNEL__
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if.h@ */
+
+#ifdef __KERNEL
#include <linux/if.h>
#endif
Index: linux-cg/include/linux/netfilter/xt_policy.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_policy.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_policy.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,10 @@
#ifndef _XT_POLICY_H
#define _XT_POLICY_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/in.h@ */
+/* @headercheck:-include linux/in6.h@ */
+
#define XT_POLICY_MAX_ELEM 4
enum xt_policy_flags
Index: linux-cg/include/linux/netfilter/xt_realm.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_realm.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_realm.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_REALM_H
#define _XT_REALM_H
+/* @headercheck:-include linux/types.h@ */
+
struct xt_realm_info {
u_int32_t id;
u_int32_t mask;
Index: linux-cg/include/linux/netfilter/xt_sctp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_sctp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_sctp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_SCTP_H_
#define _XT_SCTP_H_
+/* @headercheck:-include linux/types.h@ */
+
#define XT_SCTP_SRC_PORTS 0x01
#define XT_SCTP_DEST_PORTS 0x02
#define XT_SCTP_CHUNK_TYPES 0x04
Index: linux-cg/include/linux/netfilter/xt_string.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_string.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_string.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_STRING_H
#define _XT_STRING_H
+/* @headercheck:-include linux/types.h@ */
+
#define XT_STRING_MAX_PATTERN_SIZE 128
#define XT_STRING_MAX_ALGO_NAME_SIZE 16
Index: linux-cg/include/linux/netfilter/xt_tcpmss.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_tcpmss.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_tcpmss.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_TCPMSS_MATCH_H
#define _XT_TCPMSS_MATCH_H
+/* @headercheck:-include linux/types.h@ */
+
struct xt_tcpmss_match_info {
u_int16_t mss_min, mss_max;
u_int8_t invert;
Index: linux-cg/include/linux/netfilter/xt_tcpudp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter/xt_tcpudp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter/xt_tcpudp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _XT_TCPUDP_H
#define _XT_TCPUDP_H
+/* @headercheck:-include linux/types.h@ */
+
/* TCP matching stuff */
struct xt_tcp
{
Index: linux-cg/include/linux/netfilter_arp/arp_tables.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_arp/arp_tables.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_arp/arp_tables.h 2006-09-18 01:04:28.000000000 +0200
@@ -9,10 +9,14 @@
#ifndef _ARPTABLES_H
#define _ARPTABLES_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/if.h @ */
+/* @headercheck: -include linux/in.h @ */
+
#ifdef __KERNEL__
#include <linux/if.h>
-#include <linux/types.h>
#include <linux/in.h>
+#include <linux/types.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
#endif
Index: linux-cg/include/linux/netfilter_arp/arpt_mangle.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_arp/arpt_mangle.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_arp/arpt_mangle.h 2006-09-18 01:06:51.000000000 +0200
@@ -1,5 +1,10 @@
#ifndef _ARPT_MANGLE_H
#define _ARPT_MANGLE_H
+
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/in.h @ */
+/* @headercheck: -include linux/if.h @ */
+
#include <linux/netfilter_arp/arp_tables.h>
#define ARPT_MANGLE_ADDR_LEN_MAX sizeof(struct in_addr)
Index: linux-cg/include/linux/netfilter_bridge.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge.h 2006-09-18 00:54:13.000000000 +0200
@@ -5,9 +5,11 @@
*/
#include <linux/netfilter.h>
-#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
+#ifdef __KERNEL__
+#ifdef CONFIG_BRIDGE_NETFILTER
#include <linux/if_ether.h>
#endif
+#endif
/* Bridge Hooks */
/* After promisc drops, checksum checks. */
Index: linux-cg/include/linux/netfilter_bridge/ebt_802_3.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_802_3.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_802_3.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_802_3_H
#define __LINUX_BRIDGE_EBT_802_3_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_802_3_SAP 0x01
#define EBT_802_3_TYPE 0x02
Index: linux-cg/include/linux/netfilter_bridge/ebt_among.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_among.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_among.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_AMONG_H
#define __LINUX_BRIDGE_EBT_AMONG_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_AMONG_DST 0x01
#define EBT_AMONG_SRC 0x02
Index: linux-cg/include/linux/netfilter_bridge/ebt_arp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_arp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_arp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef __LINUX_BRIDGE_EBT_ARP_H
#define __LINUX_BRIDGE_EBT_ARP_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/if_ether.h @ */
+
#define EBT_ARP_OPCODE 0x01
#define EBT_ARP_HTYPE 0x02
#define EBT_ARP_PTYPE 0x04
Index: linux-cg/include/linux/netfilter_bridge/ebt_arpreply.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_arpreply.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_arpreply.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H
#define __LINUX_BRIDGE_EBT_ARPREPLY_H
+/* @headercheck:-include linux/if_ether.h@ */
+
struct ebt_arpreply_info
{
unsigned char mac[ETH_ALEN];
Index: linux-cg/include/linux/netfilter_bridge/ebt_ip.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_ip.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_ip.h 2006-09-18 00:54:13.000000000 +0200
@@ -11,6 +11,7 @@
* Innominate Security Technologies AG <mhopf@innominate.com>
* September, 2002
*/
+/* @headercheck:-include linux/if_ether.h@ */
#ifndef __LINUX_BRIDGE_EBT_IP_H
#define __LINUX_BRIDGE_EBT_IP_H
Index: linux-cg/include/linux/netfilter_bridge/ebt_limit.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_limit.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_limit.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_LIMIT_H
#define __LINUX_BRIDGE_EBT_LIMIT_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_LIMIT_MATCH "limit"
/* timings are in milliseconds. */
Index: linux-cg/include/linux/netfilter_bridge/ebt_log.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_log.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_log.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_LOG_H
#define __LINUX_BRIDGE_EBT_LOG_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
#define EBT_LOG_ARP 0x02
#define EBT_LOG_NFLOG 0x04
Index: linux-cg/include/linux/netfilter_bridge/ebt_mark_m.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_mark_m.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_mark_m.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_MARK_M_H
#define __LINUX_BRIDGE_EBT_MARK_M_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_MARK_AND 0x01
#define EBT_MARK_OR 0x02
#define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR)
Index: linux-cg/include/linux/netfilter_bridge/ebt_nat.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_nat.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_nat.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_NAT_H
#define __LINUX_BRIDGE_EBT_NAT_H
+/* @headercheck: -include linux/if_ether.h @ */
+
struct ebt_nat_info
{
unsigned char mac[ETH_ALEN];
Index: linux-cg/include/linux/netfilter_bridge/ebt_pkttype.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_pkttype.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_pkttype.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
#define __LINUX_BRIDGE_EBT_PKTTYPE_H
+/* @headercheck:-include linux/types.h@ */
+
struct ebt_pkttype_info
{
uint8_t pkt_type;
Index: linux-cg/include/linux/netfilter_bridge/ebt_stp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_stp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_stp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_STP_H
#define __LINUX_BRIDGE_EBT_STP_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_STP_TYPE 0x0001
#define EBT_STP_FLAGS 0x0002
Index: linux-cg/include/linux/netfilter_bridge/ebt_ulog.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_ulog.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_ulog.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,10 @@
#ifndef _EBT_ULOG_H
#define _EBT_ULOG_H
+/* @headercheck: -include linux/types.h @ */
+/* @headercheck: -include linux/if.h @ */
+/* @headercheck: -include linux/time.h @ */
+
#define EBT_ULOG_DEFAULT_NLGROUP 0
#define EBT_ULOG_DEFAULT_QTHRESHOLD 1
#define EBT_ULOG_MAXNLGROUPS 32 /* hardcoded netlink max */
Index: linux-cg/include/linux/netfilter_bridge/ebt_vlan.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_bridge/ebt_vlan.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_bridge/ebt_vlan.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_BRIDGE_EBT_VLAN_H
#define __LINUX_BRIDGE_EBT_VLAN_H
+/* @headercheck:-include linux/types.h@ */
+
#define EBT_VLAN_ID 0x01
#define EBT_VLAN_PRIO 0x02
#define EBT_VLAN_ENCAP 0x04
Index: linux-cg/include/linux/netfilter_decnet.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_decnet.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_decnet.h 2006-09-18 00:54:13.000000000 +0200
@@ -7,6 +7,7 @@
* (C)1998 Rusty Russell -- This code is GPL.
*/
+/* @headercheck: -include limits.h @ */
#include <linux/netfilter.h>
/* only for userspace compatibility */
Index: linux-cg/include/linux/netfilter_ipv4.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4.h 2006-09-18 00:54:13.000000000 +0200
@@ -9,6 +9,8 @@
/* only for userspace compatibility */
#ifndef __KERNEL__
+#include <limits.h>
+
/* IP Cache bits. */
/* Src IP address. */
#define NFC_IP_SRC 0x0001
Index: linux-cg/include/linux/netfilter_ipv4/Kbuild
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/Kbuild 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/Kbuild 2006-09-18 00:54:13.000000000 +0200
@@ -1,8 +1,7 @@
-header-y := ip_conntrack_helper.h ip_conntrack_helper_h323_asn1.h \
- ip_conntrack_helper_h323_types.h ip_conntrack_protocol.h \
+header-y := ip_conntrack_helper_h323_types.h \
ip_conntrack_sctp.h ip_conntrack_tcp.h ip_conntrack_tftp.h \
- ip_nat_pptp.h ipt_addrtype.h ipt_ah.h \
+ ip_nat_pptp.h ipt_addrtype.h ipt_ah.h \
ipt_CLASSIFY.h ipt_CLUSTERIP.h ipt_comment.h \
ipt_connbytes.h ipt_connmark.h ipt_CONNMARK.h \
ipt_conntrack.h ipt_dccp.h ipt_dscp.h ipt_DSCP.h ipt_ecn.h \
@@ -15,7 +14,8 @@
ipt_TCPMSS.h ipt_tos.h ipt_TOS.h ipt_ttl.h ipt_TTL.h \
ipt_ULOG.h
-unifdef-y := ip_conntrack.h ip_conntrack_h323.h ip_conntrack_irc.h \
+unifdef-y := ip_conntrack.h ip_conntrack_h323.h \
+ ip_conntrack_helper_h323_asn1.h ip_conntrack_irc.h \
ip_conntrack_pptp.h ip_conntrack_proto_gre.h \
ip_conntrack_tuple.h ip_nat.h ip_nat_rule.h ip_queue.h \
ip_tables.h
Index: linux-cg/include/linux/netfilter_ipv4/ip_conntrack_helper.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_conntrack_helper.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_conntrack_helper.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,4 +1,5 @@
/* IP connection tracking helpers. */
+
#ifndef _IP_CONNTRACK_HELPER_H
#define _IP_CONNTRACK_HELPER_H
#include <linux/netfilter_ipv4/ip_conntrack.h>
Index: linux-cg/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h 2006-09-18 00:54:13.000000000 +0200
@@ -85,6 +85,7 @@
#define H323_ERROR_RANGE -2
+#ifdef __KERNEL__
/*****************************************************************************
* Decode Functions
****************************************************************************/
@@ -94,5 +95,6 @@
int DecodeMultimediaSystemControlMessage(unsigned char *buf, size_t sz,
MultimediaSystemControlMessage *
mscm);
+#endif /* __KERNEL__ */
#endif
Index: linux-cg/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_conntrack_pptp.h 2006-09-18 00:54:13.000000000 +0200
@@ -2,6 +2,8 @@
#ifndef _CONNTRACK_PPTP_H
#define _CONNTRACK_PPTP_H
+/* @headercheck:-include linux/types.h@ */
+
/* state of the control session */
enum pptp_ctrlsess_state {
PPTP_SESSION_NONE, /* no session present */
Index: linux-cg/include/linux/netfilter_ipv4/ip_conntrack_sctp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_conntrack_sctp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_conntrack_sctp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP_CONNTRACK_SCTP_H
#define _IP_CONNTRACK_SCTP_H
+/* @headercheck:-include linux/types.h @ */
+
#include <linux/netfilter/nf_conntrack_sctp.h>
#endif /* _IP_CONNTRACK_SCTP_H */
Index: linux-cg/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP_CT_TFTP
#define _IP_CT_TFTP
+/* @headercheck:-include linux/types.h @ */
+
#define TFTP_PORT 69
struct tftphdr {
@@ -13,8 +15,10 @@
#define TFTP_OPCODE_ACK 4
#define TFTP_OPCODE_ERROR 5
+#ifdef __KERNEL__
extern unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb,
enum ip_conntrack_info ctinfo,
struct ip_conntrack_expect *exp);
+#endif
#endif /* _IP_CT_TFTP */
Index: linux-cg/include/linux/netfilter_ipv4/ip_nat.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_nat.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_nat.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,5 +1,8 @@
#ifndef _IP_NAT_H
#define _IP_NAT_H
+
+/* @headercheck: -include linux/types.h @ */
+
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
Index: linux-cg/include/linux/netfilter_ipv4/ip_nat_pptp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_nat_pptp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_nat_pptp.h 2006-09-18 00:54:13.000000000 +0200
@@ -2,6 +2,8 @@
#ifndef _NAT_PPTP_H
#define _NAT_PPTP_H
+/* @headercheck:-include linux/types.h @ */
+
/* conntrack private data */
struct ip_nat_pptp {
u_int16_t pns_call_id; /* NAT'ed PNS call id */
Index: linux-cg/include/linux/netfilter_ipv4/ip_nat_rule.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_nat_rule.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_nat_rule.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,5 +1,10 @@
#ifndef _IP_NAT_RULE_H
#define _IP_NAT_RULE_H
+
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if.h@ */
+/* @headercheck:-include linux/in.h@ */
+
#include <linux/netfilter_ipv4/ip_conntrack.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ip_nat.h>
Index: linux-cg/include/linux/netfilter_ipv4/ip_tables.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ip_tables.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ip_tables.h 2006-09-18 00:54:13.000000000 +0200
@@ -15,6 +15,10 @@
#ifndef _IPTABLES_H
#define _IPTABLES_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if.h@ */
+/* @headercheck:-include linux/in.h@ */
+
#ifdef __KERNEL__
#include <linux/if.h>
#include <linux/types.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_CLASSIFY.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_CLASSIFY.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_CLASSIFY_H
#define _IPT_CLASSIFY_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_CLASSIFY.h>
#define ipt_classify_target_info xt_classify_target_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_CLUSTERIP_H_target
#define _IPT_CLUSTERIP_H_target
+/* @headercheck:-include linux/types.h @ */
+
enum clusterip_hashmode {
CLUSTERIP_HASHMODE_SIP = 0,
CLUSTERIP_HASHMODE_SIP_SPT,
Index: linux-cg/include/linux/netfilter_ipv4/ipt_CONNMARK.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_CONNMARK.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_CONNMARK.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_CONNMARK_H_target
#define _IPT_CONNMARK_H_target
+/* @headercheck:-include linux/types.h@ */
+
/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
* by Henrik Nordstrom <hno@marasystems.com>
*
Index: linux-cg/include/linux/netfilter_ipv4/ipt_DSCP.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_DSCP.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_DSCP.h 2006-09-18 00:54:13.000000000 +0200
@@ -8,6 +8,9 @@
*
* ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
*/
+
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IPT_DSCP_TARGET_H
#define _IPT_DSCP_TARGET_H
#include <linux/netfilter_ipv4/ipt_dscp.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_ECN.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_ECN.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_ECN.h 2006-09-18 00:54:13.000000000 +0200
@@ -6,6 +6,9 @@
*
* ipt_ECN.h,v 1.3 2002/05/29 12:17:40 laforge Exp
*/
+
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IPT_ECN_TARGET_H
#define _IPT_ECN_TARGET_H
#include <linux/netfilter_ipv4/ipt_DSCP.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_MARK.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_MARK.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_MARK.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_MARK_H_target
#define _IPT_MARK_H_target
+/* @headercheck:-include linux/types.h@ */
+
/* Backwards compatibility for old userspace */
#include <linux/netfilter/xt_MARK.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_NFQUEUE.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_NFQUEUE.h 2006-09-18 00:54:13.000000000 +0200
@@ -3,8 +3,11 @@
* (C) 2005 Harald Welte <laforge@netfilter.org>
*
* This software is distributed under GNU GPL v2, 1991
- *
-*/
+ *
+ */
+
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IPT_NFQ_TARGET_H
#define _IPT_NFQ_TARGET_H
Index: linux-cg/include/linux/netfilter_ipv4/ipt_SAME.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_SAME.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_SAME.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _IPT_SAME_H
#define _IPT_SAME_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/netfilter_ipv4/ip_nat.h@ */
+
#define IPT_SAME_MAX_RANGE 10
#define IPT_SAME_NODST 0x01
Index: linux-cg/include/linux/netfilter_ipv4/ipt_TCPMSS.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_TCPMSS.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_TCPMSS.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_TCPMSS_H
#define _IPT_TCPMSS_H
+/* @headercheck:-include linux/types.h@ */
+
struct ipt_tcpmss_info {
u_int16_t mss;
};
Index: linux-cg/include/linux/netfilter_ipv4/ipt_TOS.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_TOS.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_TOS.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_TOS_H_target
#define _IPT_TOS_H_target
+/* @headercheck:-include linux/types.h@ */
+
#ifndef IPTOS_NORMALSVC
#define IPTOS_NORMALSVC 0
#endif
Index: linux-cg/include/linux/netfilter_ipv4/ipt_TTL.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_TTL.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_TTL.h 2006-09-18 00:54:13.000000000 +0200
@@ -4,6 +4,8 @@
#ifndef _IPT_TTL_H
#define _IPT_TTL_H
+/* @headercheck:-include linux/types.h@ */
+
enum {
IPT_TTL_SET = 0,
IPT_TTL_INC,
Index: linux-cg/include/linux/netfilter_ipv4/ipt_ULOG.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_ULOG.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_ULOG.h 2006-09-18 00:54:13.000000000 +0200
@@ -4,6 +4,9 @@
*
* Distributed under the terms of GNU GPL */
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if.h@ */
+
#ifndef _IPT_ULOG_H
#define _IPT_ULOG_H
Index: linux-cg/include/linux/netfilter_ipv4/ipt_addrtype.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_addrtype.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_addrtype.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_ADDRTYPE_H
#define _IPT_ADDRTYPE_H
+/* @headercheck:-include linux/types.h@ */
+
struct ipt_addrtype_info {
u_int16_t source; /* source-type mask */
u_int16_t dest; /* dest-type mask */
Index: linux-cg/include/linux/netfilter_ipv4/ipt_ah.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_ah.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_ah.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_AH_H
#define _IPT_AH_H
+/* @headercheck:-include linux/types.h@ */
+
struct ipt_ah
{
u_int32_t spis[2]; /* Security Parameter Index */
Index: linux-cg/include/linux/netfilter_ipv4/ipt_connbytes.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_connbytes.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_connbytes.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_CONNBYTES_H
#define _IPT_CONNBYTES_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_connbytes.h>
#define ipt_connbytes_what xt_connbytes_what
Index: linux-cg/include/linux/netfilter_ipv4/ipt_connmark.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_connmark.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_connmark.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_CONNMARK_H
#define _IPT_CONNMARK_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_connmark.h>
#define ipt_connmark_info xt_connmark_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_dccp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_dccp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_dccp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_DCCP_H_
#define _IPT_DCCP_H_
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_dccp.h>
#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS
#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS
Index: linux-cg/include/linux/netfilter_ipv4/ipt_dscp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_dscp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_dscp.h 2006-09-18 00:54:13.000000000 +0200
@@ -7,6 +7,9 @@
*
* ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
*/
+
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IPT_DSCP_H
#define _IPT_DSCP_H
Index: linux-cg/include/linux/netfilter_ipv4/ipt_ecn.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_ecn.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_ecn.h 2006-09-18 00:54:13.000000000 +0200
@@ -6,6 +6,8 @@
*
* ipt_ecn.h,v 1.4 2002/08/05 19:39:00 laforge Exp
*/
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IPT_ECN_H
#define _IPT_ECN_H
#include <linux/netfilter_ipv4/ipt_dscp.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_esp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_esp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_esp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_ESP_H
#define _IPT_ESP_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_esp.h>
#define ipt_esp xt_esp
Index: linux-cg/include/linux/netfilter_ipv4/ipt_hashlimit.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_hashlimit.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_hashlimit.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _IPT_HASHLIMIT_H
#define _IPT_HASHLIMIT_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if.h@ */
+
/* timings are in milliseconds. */
#define IPT_HASHLIMIT_SCALE 10000
/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
Index: linux-cg/include/linux/netfilter_ipv4/ipt_iprange.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_iprange.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_iprange.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_IPRANGE_H
#define _IPT_IPRANGE_H
+/* @headercheck:-include linux/types.h@ */
+
#define IPRANGE_SRC 0x01 /* Match source IP address */
#define IPRANGE_DST 0x02 /* Match destination IP address */
#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
Index: linux-cg/include/linux/netfilter_ipv4/ipt_length.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_length.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_length.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_LENGTH_H
#define _IPT_LENGTH_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_length.h>
#define ipt_length_info xt_length_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_limit.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_limit.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_limit.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_RATE_H
#define _IPT_RATE_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_limit.h>
#define IPT_LIMIT_SCALE XT_LIMIT_SCALE
#define ipt_rateinfo xt_rateinfo
Index: linux-cg/include/linux/netfilter_ipv4/ipt_mac.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_mac.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_mac.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _IPT_MAC_H
#define _IPT_MAC_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/if_ether.h@ */
+
#include <linux/netfilter/xt_mac.h>
#define ipt_mac_info xt_mac_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_mark.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_mark.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_mark.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_MARK_H
#define _IPT_MARK_H
+/* @headercheck:-include linux/types.h@ */
+
/* Backwards compatibility for old userspace */
#include <linux/netfilter/xt_mark.h>
Index: linux-cg/include/linux/netfilter_ipv4/ipt_multiport.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_multiport.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_multiport.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_MULTIPORT_H
#define _IPT_MULTIPORT_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_multiport.h>
#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
Index: linux-cg/include/linux/netfilter_ipv4/ipt_owner.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_owner.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_owner.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_OWNER_H
#define _IPT_OWNER_H
+/* @headercheck:-include linux/types.h@ */
+
/* match and invert flags */
#define IPT_OWNER_UID 0x01
#define IPT_OWNER_GID 0x02
Index: linux-cg/include/linux/netfilter_ipv4/ipt_realm.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_realm.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_realm.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_REALM_H
#define _IPT_REALM_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_realm.h>
#define ipt_realm_info xt_realm_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_recent.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_recent.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_recent.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_RECENT_H
#define _IPT_RECENT_H
+/* @headercheck:-include linux/types.h@ */
+
#define RECENT_NAME "ipt_recent"
#define RECENT_VER "v0.3.1"
Index: linux-cg/include/linux/netfilter_ipv4/ipt_sctp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_sctp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_sctp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_SCTP_H_
#define _IPT_SCTP_H_
+/* @headercheck:-include linux/types.h@ */
+
#define IPT_SCTP_SRC_PORTS 0x01
#define IPT_SCTP_DEST_PORTS 0x02
#define IPT_SCTP_CHUNK_TYPES 0x04
Index: linux-cg/include/linux/netfilter_ipv4/ipt_string.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_string.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_string.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_STRING_H
#define _IPT_STRING_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_string.h>
#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE
Index: linux-cg/include/linux/netfilter_ipv4/ipt_tcpmss.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_tcpmss.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_tcpmss.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_TCPMSS_MATCH_H
#define _IPT_TCPMSS_MATCH_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_tcpmss.h>
#define ipt_tcpmss_match_info xt_tcpmss_match_info
Index: linux-cg/include/linux/netfilter_ipv4/ipt_tos.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_tos.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_tos.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IPT_TOS_H
#define _IPT_TOS_H
+/* @headercheck:-include linux/types.h@ */
+
struct ipt_tos_info {
u_int8_t tos;
u_int8_t invert;
Index: linux-cg/include/linux/netfilter_ipv4/ipt_ttl.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv4/ipt_ttl.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv4/ipt_ttl.h 2006-09-18 00:54:13.000000000 +0200
@@ -4,6 +4,8 @@
#ifndef _IPT_TTL_H
#define _IPT_TTL_H
+/* @headercheck:-include linux/types.h@ */
+
enum {
IPT_TTL_EQ = 0, /* equals */
IPT_TTL_NE, /* not equals */
Index: linux-cg/include/linux/netfilter_ipv6.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6.h 2006-09-18 00:54:13.000000000 +0200
@@ -8,6 +8,7 @@
* it's amazing what adding a bunch of 6s can do =8^)
*/
+/* @headercheck: -include limits.h @ */
#include <linux/netfilter.h>
/* only for userspace compatibility */
@@ -72,6 +73,7 @@
NF_IP6_PRI_LAST = INT_MAX,
};
+#ifdef __KERNEL__
#ifdef CONFIG_NETFILTER
extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
unsigned int dataoff, u_int8_t protocol);
@@ -82,5 +84,6 @@
static inline int ipv6_netfilter_init(void) { return 0; }
static inline void ipv6_netfilter_fini(void) { return; }
#endif /* CONFIG_NETFILTER */
+#endif
#endif /*__LINUX_IP6_NETFILTER_H*/
Index: linux-cg/include/linux/netfilter_ipv6/ip6_tables.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6_tables.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6_tables.h 2006-09-18 00:54:13.000000000 +0200
@@ -15,6 +15,11 @@
#ifndef _IP6_TABLES_H
#define _IP6_TABLES_H
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/in6.h@ */
+/* @headercheck:-include linux/if.h@ */
+/* @headercheck:-include limits.h@ */
+
#ifdef __KERNEL__
#include <linux/if.h>
#include <linux/types.h>
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_HL.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_HL.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_HL.h 2006-09-18 00:54:13.000000000 +0200
@@ -2,6 +2,8 @@
* Maciej Soltysiak <solt@dns.toxicfilms.tv>
* Based on HW's TTL module */
+/* @headercheck:-include linux/types.h@ */
+
#ifndef _IP6T_HL_H
#define _IP6T_HL_H
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_MARK.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_MARK.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_MARK.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_MARK_H_target
#define _IP6T_MARK_H_target
+/* @headercheck:-include linux/types.h@ */
+
/* Backwards compatibility for old userspace */
#include <linux/netfilter/xt_MARK.h>
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_REJECT.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_REJECT.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_REJECT.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_REJECT_H
#define _IP6T_REJECT_H
+/* @headercheck:-include linux/types.h@ */
+
enum ip6t_reject_with {
IP6T_ICMP6_NO_ROUTE,
IP6T_ICMP6_ADM_PROHIBITED,
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_ah.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_ah.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_ah.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_AH_H
#define _IP6T_AH_H
+/* @headercheck:-include linux/types.h@ */
+
struct ip6t_ah
{
u_int32_t spis[2]; /* Security Parameter Index */
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_esp.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_esp.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_esp.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_ESP_H
#define _IP6T_ESP_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_esp.h>
#define ip6t_esp xt_esp
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_frag.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_frag.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_frag.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_FRAG_H
#define _IP6T_FRAG_H
+/* @headercheck:-include linux/types.h@ */
+
struct ip6t_frag
{
u_int32_t ids[2]; /* Security Parameter Index */
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_hl.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_hl.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_hl.h 2006-09-18 00:54:13.000000000 +0200
@@ -5,6 +5,8 @@
#ifndef _IP6T_HL_H
#define _IP6T_HL_H
+/* @headercheck:-include linux/types.h@ */
+
enum {
IP6T_HL_EQ = 0, /* equals */
IP6T_HL_NE, /* not equals */
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_ipv6header.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_ipv6header.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_ipv6header.h 2006-09-18 00:54:13.000000000 +0200
@@ -8,6 +8,8 @@
#ifndef __IPV6HEADER_H
#define __IPV6HEADER_H
+/* @headercheck:-include linux/types.h@ */
+
struct ip6t_ipv6header_info
{
u_int8_t matchflags;
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_length.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_length.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_length.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_LENGTH_H
#define _IP6T_LENGTH_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_length.h>
#define ip6t_length_info xt_length_info
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_limit.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_limit.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_limit.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_RATE_H
#define _IP6T_RATE_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_limit.h>
#define IP6T_LIMIT_SCALE XT_LIMIT_SCALE
#define ip6t_rateinfo xt_rateinfo
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_mac.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_mac.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_mac.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_MAC_H
#define _IP6T_MAC_H
+/* @headercheck:-include linux/if_ether.h@ */
+
#include <linux/netfilter/xt_mac.h>
#define ip6t_mac_info xt_mac_info
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_mark.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_mark.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_mark.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_MARK_H
#define _IP6T_MARK_H
+/* @headercheck:-include linux/types.h@ */
+
/* Backwards compatibility for old userspace */
#include <linux/netfilter/xt_mark.h>
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_multiport.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_multiport.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_multiport.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_MULTIPORT_H
#define _IP6T_MULTIPORT_H
+/* @headercheck:-include linux/types.h@ */
+
#include <linux/netfilter/xt_multiport.h>
#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_opts.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_opts.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_opts.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_OPTS_H
#define _IP6T_OPTS_H
+/* @headercheck:-include linux/types.h@ */
+
#define IP6T_OPTS_OPTSNR 16
struct ip6t_opts
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_owner.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_owner.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_owner.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef _IP6T_OWNER_H
#define _IP6T_OWNER_H
+/* @headercheck:-include linux/types.h@ */
+
/* match and invert flags */
#define IP6T_OWNER_UID 0x01
#define IP6T_OWNER_GID 0x02
Index: linux-cg/include/linux/netfilter_ipv6/ip6t_rt.h
===================================================================
--- linux-cg.orig/include/linux/netfilter_ipv6/ip6t_rt.h 2006-09-18 00:47:50.000000000 +0200
+++ linux-cg/include/linux/netfilter_ipv6/ip6t_rt.h 2006-09-18 00:54:13.000000000 +0200
@@ -1,7 +1,8 @@
#ifndef _IP6T_RT_H
#define _IP6T_RT_H
-/*#include <linux/in6.h>*/
+/* @headercheck:-include linux/types.h@ */
+/* @headercheck:-include linux/in6.h@ */
#define IP6T_RT_HOPS 16
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* [patch 7/8] annotate if_* header for make headers_check
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (14 preceding siblings ...)
2006-09-18 1:27 ` [patch 8/8] annotate netfilter header " Arnd Bergmann
@ 2006-09-18 1:37 ` Arnd Bergmann
15 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 1:37 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
stop headers_check from warning about include/linux/if_*.h
Signed-off-by: Arnd Bermann <arnd@arndb.de>
diff --git a/include/linux/if_fc.h b/include/linux/if_fc.h
index 376a34e..6ed7f1b 100644
Index: linux-cg/include/linux/if_fc.h
===================================================================
--- linux-cg.orig/include/linux/if_fc.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_fc.h 2006-09-18 03:16:27.000000000 +0200
@@ -20,6 +20,7 @@
#ifndef _LINUX_IF_FC_H
#define _LINUX_IF_FC_H
+/* @headercheck: -include linux/types.h @ */
#define FC_ALEN 6 /* Octets in one ethernet addr */
#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
Index: linux-cg/include/linux/if_fddi.h
===================================================================
--- linux-cg.orig/include/linux/if_fddi.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_fddi.h 2006-09-18 03:16:27.000000000 +0200
@@ -24,6 +24,8 @@
#ifndef _LINUX_IF_FDDI_H
#define _LINUX_IF_FDDI_H
+/* @headercheck: -include linux/types.h @ */
+
/*
* Define max and min legal sizes. The frame sizes do not include
* 4 byte FCS/CRC (frame check sequence).
Index: linux-cg/include/linux/if_ppp.h
===================================================================
--- linux-cg.orig/include/linux/if_ppp.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_ppp.h 2006-09-18 03:16:27.000000000 +0200
@@ -35,6 +35,8 @@
#ifndef _IF_PPP_H_
#define _IF_PPP_H_
+/* @headercheck: -include linux/ppp_defs.h @ */
+/* @headercheck: -include linux/if.h @ */
#include <linux/compiler.h>
/*
Index: linux-cg/include/linux/if_pppox.h
===================================================================
--- linux-cg.orig/include/linux/if_pppox.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_pppox.h 2006-09-18 03:16:27.000000000 +0200
@@ -20,6 +20,9 @@
#include <asm/types.h>
#include <asm/byteorder.h>
+/* @headercheck: -include linux/if_ether.h @ */
+/* @headercheck: -include linux/if.h @ */
+
#ifdef __KERNEL__
#include <linux/if_ether.h>
#include <linux/if.h>
Index: linux-cg/include/linux/if_shaper.h
===================================================================
--- linux-cg.orig/include/linux/if_shaper.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_shaper.h 2006-09-18 03:16:27.000000000 +0200
@@ -1,6 +1,8 @@
#ifndef __LINUX_SHAPER_H
#define __LINUX_SHAPER_H
+/* @headercheck: -include linux/types.h @ */
+
#ifdef __KERNEL__
#define SHAPER_QLEN 10
Index: linux-cg/include/linux/if_strip.h
===================================================================
--- linux-cg.orig/include/linux/if_strip.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_strip.h 2006-09-18 03:16:27.000000000 +0200
@@ -18,6 +18,8 @@
#ifndef __LINUX_STRIP_H
#define __LINUX_STRIP_H
+/* @headercheck: -include linux/types.h @ */
+
typedef struct {
__u8 c[6];
} MetricomAddress;
Index: linux-cg/include/linux/if_tunnel.h
===================================================================
--- linux-cg.orig/include/linux/if_tunnel.h 2006-09-18 03:16:11.000000000 +0200
+++ linux-cg/include/linux/if_tunnel.h 2006-09-18 03:16:27.000000000 +0200
@@ -1,6 +1,9 @@
#ifndef _IF_TUNNEL_H_
#define _IF_TUNNEL_H_
+/* @headercheck: -include linux/if.h @ */
+/* @headercheck: -include linux/ip.h @ */
+
#define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
#define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
#define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
--
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 1:27 ` [patch 1/8] extend make headers_check to detect more problems Arnd Bergmann
@ 2006-09-18 6:21 ` Sam Ravnborg
2006-09-18 6:45 ` David Woodhouse
2006-09-18 8:05 ` Arnd Bergmann
2006-09-23 11:04 ` David Woodhouse
1 sibling, 2 replies; 40+ messages in thread
From: Sam Ravnborg @ 2006-09-18 6:21 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: David Woodhouse, linux-arch, linux-kernel
> --- linux-cg.orig/scripts/hdrcheck.sh 2006-09-18 02:04:44.000000000 +0200
> +++ linux-cg/scripts/hdrcheck.sh 2006-09-18 02:04:45.000000000 +0200
> @@ -1,8 +1,28 @@
> #!/bin/sh
>
> +# check if all included files exist
> for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do
> if [ ! -r $1/$FILE ]; then
> echo $2 requires $FILE, which does not exist in exported headers
> exit 1
> fi
> done
> +
> +# try to compile in order to see CC warnings, show only the first few
> +CHECK_CFLAGS=`grep @headercheck: $2 | sed -e 's/^.*@headercheck:\([^@]*\)@.*$/\1/'`
The purpose of @headercheck: should be documented sonewhere.
A simple way to do so would be to paste the content of the changelog that
describe it in the top of this file.
> +CFLAGS="-Wall -std=gnu99 -xc -O2 -I$1 ${CHECK_CFLAGS}"
> +tmpfile=`mktemp`
Can't we do this with a hdrchk$$$ filename to avoid using
random entropy for each compile?
> +${CC:-gcc} ${CFLAGS} -c $2 -o $tmpfile 2>&1 | sed -e "s:$1:include:g" >&2
> +
> +# check if object file is empty
> +if [ "`nm $tmpfile`" ] ; then
Replace nm with {NM:-nm} to obtain correct NM when cross compiling.
> + echo include${2#$1}: warning: non-empty output >&2
Paste output of nm so one can see what is defined?
Sam
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 6:21 ` Sam Ravnborg
@ 2006-09-18 6:45 ` David Woodhouse
2006-09-21 15:13 ` David Woodhouse
2006-09-18 8:05 ` Arnd Bergmann
1 sibling, 1 reply; 40+ messages in thread
From: David Woodhouse @ 2006-09-18 6:45 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Arnd Bergmann, linux-arch, linux-kernel
On Mon, 2006-09-18 at 08:21 +0200, Sam Ravnborg wrote:
> Can't we do this with a hdrchk$$$ filename to avoid using
> random entropy for each compile?
I'd like to move to a scheme where we do headers_install and
headers_check _without_ starting with a rm -rf
$(HDR_INSTALL_PATH)/include.
We could probably do it by adding a rule along the lines of
$(filter-out $(unifdef-y) $(header-y),$(wildcard $(INSTALL_HDR_PATH)/$(dst)/*.h):
rm $@
... i.e. remove every .h file from the destination directory except the
ones we just created.
Then we can make $(INSTALL_HDR_PATH)/$(dst)/%.h depend on
$(srctree)/$(src)/%.h so that it doesn't get re-exported unless it's
changed. And we can keep a stamp file around (or the output of the test
compilation after Arnd's patch) which shows that the _check_ step has
been done too. Something like .checked.%.h
After we do that, a second invocation of 'make headers_check' should
have nothing to do, which will encourage people to keep using it.
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 6:21 ` Sam Ravnborg
2006-09-18 6:45 ` David Woodhouse
@ 2006-09-18 8:05 ` Arnd Bergmann
2006-09-18 8:10 ` David Woodhouse
1 sibling, 1 reply; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-18 8:05 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: David Woodhouse, linux-arch, linux-kernel
On Monday 18 September 2006 08:21, Sam Ravnborg wrote:
> > --- linux-cg.orig/scripts/hdrcheck.sh 2006-09-18 02:04:44.000000000 +0200
> > +++ linux-cg/scripts/hdrcheck.sh 2006-09-18 02:04:45.000000000 +0200
> > @@ -1,8 +1,28 @@
> > #!/bin/sh
> >
> > +# check if all included files exist
> > for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do
> > if [ ! -r $1/$FILE ]; then
> > echo $2 requires $FILE, which does not exist in exported headers
> > exit 1
> > fi
> > done
> > +
> > +# try to compile in order to see CC warnings, show only the first few
> > +CHECK_CFLAGS=`grep @headercheck: $2 | sed -e 's/^.*@headercheck:\([^@]*\)@.*$/\1/'`
>
> The purpose of @headercheck: should be documented sonewhere.
> A simple way to do so would be to paste the content of the changelog that
> describe it in the top of this file.
ok. I've ended up writing more than that now, since the headers_install
target also wasn't documented well.
> > +CFLAGS="-Wall -std=gnu99 -xc -O2 -I$1 ${CHECK_CFLAGS}"
> > +tmpfile=`mktemp`
> Can't we do this with a hdrchk$$$ filename to avoid using
> random entropy for each compile?
For now, I've hacked something up in the script below. I suppose
that can be improved with Dave's proposal by doing it from the
Makefile.
> > +${CC:-gcc} ${CFLAGS} -c $2 -o $tmpfile 2>&1 | sed -e "s:$1:include:g" >&2
> > +
> > +# check if object file is empty
> > +if [ "`nm $tmpfile`" ] ; then
> Replace nm with {NM:-nm} to obtain correct NM when cross compiling.
>
> > + echo include${2#$1}: warning: non-empty output >&2
> Paste output of nm so one can see what is defined?
>
ok
Arnd <><
---
In addition to the problem of including non-existant header
files, a number of other things can go wrong with header
files exported to user space. This adds checks for some
common problems:
- The header fails to include the files it needs, which
results in build errors when a program tries to include
it. Check this by doing a dummy compile.
- There is a declarations of a static variable or non-inline
function in the header, which results in object code
in every file including it. Check for symbols in the object
with 'nm'.
- Part of the header is subject to conditional compilation
based on CONFIG_*. Add a regex search for this.
I found many problems with this, which I then fixed for
powerpc, s390 and i386, in subsequent patches.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Index: linux-cg/scripts/hdrcheck.sh
===================================================================
--- linux-cg.orig/scripts/hdrcheck.sh 2006-09-18 08:44:08.000000000 +0200
+++ linux-cg/scripts/hdrcheck.sh 2006-09-18 09:59:13.000000000 +0200
@@ -1,8 +1,28 @@
#!/bin/sh
+# check if all included files exist
for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do
if [ ! -r $1/$FILE ]; then
echo $2 requires $FILE, which does not exist in exported headers
exit 1
fi
done
+
+# try to compile in order to see CC warnings, show only the first few
+CHECK_CFLAGS=`grep @headercheck: $2 | sed -e 's/^.*@headercheck:\([^@]*\)@.*$/\1/'`
+CFLAGS="-Wall -std=gnu99 -xc -O2 -I$1 ${CHECK_CFLAGS}"
+mkdir -p ${3%/*}
+${CC:-gcc} ${CFLAGS} -c $2 -o $3 2>&1 | sed -e "s:$1:include:g" >&2
+
+# check if object file is empty
+if [ "`${NM:-nm} $3`" ] ; then
+ echo include${2#$1}: warning: non-empty output >&2
+ ${NM:-nm} $3 >&2
+fi
+
+# check if we use a CONFIG_ symbol, which is not allowed in installed headers
+grep '^[ \t]*#[ \t]*if.*\<CONFIG_[[:alnum:]_]*\>' -n $2 |
+while read i ; do
+ echo include${2#$1}:${i%%:*}: warning: invalid use of `echo $i |
+ sed -e 's/.*\(\<CONFIG_[[:alnum:]_]*\>\).*/\1/g'` >&2
+done
Index: linux-cg/Documentation/headers.txt
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-cg/Documentation/headers.txt 2006-09-18 09:45:17.000000000 +0200
@@ -0,0 +1,96 @@
+ Exporting data structures to user space
+
+
+=== Background
+
+Traditionally, headers in include/asm and include/linux symlinked to
+/usr/include [1]. This has always been a bad idea and stopped working
+well a few years ago. The next step was that distributions shipped
+their own copy of sometimes heavily modified headers to have
+something usable. Mariusz Mazur was maintaining pre-packaged
+linux-libc-headers [2] that were picked up by some distros but
+in the end that turned out too much work to keep up with.
+
+In 2.6.18, the current mechanism was merged, which uses Makefile
+in the include directory to install a minimal set of user space
+headers that can be used in /usr/include.
+
+
+=== Installing headers
+
+The 'make headers_install' command is used to install headers
+into the location specified with the 'INSTALL_HDR_PATH' environment
+variable. The default location for this is ${OBJDIR}/usr/include.
+
+Which headers get installed is specified in the 'Kbuild' file in
+the source directory containing each headers. The variables used
+in Kbuild to designate these files are:
+
+headers-y Files that are installed verbatim from the source
+ directory, as well subdirectories that also contain
+ installable header files.
+objhdr-y Files that are installed from the object directory,
+ having been generated during the kernel build.
+unifdef-y Files that have both parts for installations and
+ parts that are private to the kernel. These files
+ are run through the 'unifdef'(1) program that will
+ strip all parts inside of '#ifdef __KERNEL__'.
+
+Apart from unifdef, all files are also run through a sed script
+that strips the usage of '#include <linux/compiler.h' [5].
+
+
+=== What should be in installed headers
+
+The contents of /usr/include/linux define the binary interface
+to the kernel. It should ideally only contain data structures
+and definitions of constants used on the kernel ABI. In particular,
+it is not a general helper library. While some applications
+are attempting to e.g. spinlocks or linked lists from the kernel
+in user space, such uses are usually subtly broken and should
+not be encouraged.
+
+The set of installed headers is supposed to be usable without
+dependencies on other files, so none of them can #include headers
+that are not also installed nor use types or macros defined
+elsewhere. Typically, this requires enclosing parts of the header
+inside of #ifdef __KERNEL__, or (preferred) splitting the header
+file into a file that can be included in user space and another
+one that contains the kernel-only parts and is not installed.
+
+
+=== Checking header files
+
+The 'make headers_check' target is used to perform a sanity
+check on the contents of the installed headers[6]. It checks for
+a number of common problems:
+
+- The header file includes another header that is not also
+ present in the set of installed headers.
+
+- The header fails to include the files it needs, which
+ results in build errors when a program tries to include
+ it. Check this by doing a dummy compile.
+
+- There is a declarations of a static variable or non-inline
+ function in the header, which results in object code
+ in every file including it. Check for symbols in the object
+ with 'nm'.
+
+- Part of the header is subject to conditional compilation
+ based on CONFIG_*. Add a regex search for this.
+
+Since the headers are different on each architectures, and
+at least the compile step of headers_check requires a compiler
+for the target architectures, only one architecture can be
+checked at a time.
+
+
+=== References
+
+[1] http://linuxmafia.com/faq/Kernel/usr-src-olinux-symlink.html
+[2] http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+[3] http://lkml.org/lkml/2006/3/14/144
+[4] http://kerneltrap.org/node/6536
+[5] file:../scripts/Makefile.headersinst
+[6] file:../scripts/hdrcheck.sh
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 8:05 ` Arnd Bergmann
@ 2006-09-18 8:10 ` David Woodhouse
0 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-18 8:10 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: Sam Ravnborg, linux-arch, linux-kernel
On Mon, 2006-09-18 at 10:05 +0200, Arnd Bergmann wrote:
>
> +headers-y Files that are installed verbatim from the source
> + directory, as well subdirectories that also contain
> + installable header files.
> +objhdr-y Files that are installed from the object directory,
> + having been generated during the kernel build.
> +unifdef-y Files that have both parts for installations and
> + parts that are private to the kernel. These files
> + are run through the 'unifdef'(1) program that will
> + strip all parts inside of '#ifdef __KERNEL__'.
objhdr-y Files that are generated automatically during the
build process (i.e. include/linux/version.h) and
are installed verbatim from the build directory.
Looks good, thanks for doing the documentation.
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (2 preceding siblings ...)
2006-09-17 12:27 ` Paul Mundt
@ 2006-09-19 7:04 ` Hirokazu Takata
2006-09-19 8:25 ` Ian Molton
2006-09-19 15:31 ` Jeff Dike
5 siblings, 0 replies; 40+ messages in thread
From: Hirokazu Takata @ 2006-09-19 7:04 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, lethal, davem,
wli, jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
From: David Woodhouse <dwmw2@infradead.org>
Subject: Re: All arch maintainers: 'make headers_check' fails on most architectures.
Date: Sun, 17 Sep 2006 08:39:39 +0100
> asm-m32r/page.h requires asm-generic/memory_model.h, which does not exist in exported headers
> asm-m32r/ptrace.h requires asm/m32r.h, which does not exist in exported headers
> asm-m32r/signal.h requires linux/linkage.h, which does not exist in exported headers
> asm-m32r/unistd.h requires asm/syscall.h, which does not exist in exported headers
> asm-m32r/user.h requires asm/processor.h, which does not exist in exported headers
OK, I've checked.
Here is a patch to fix them.
Thanks,
[PATCH] Fix 'make headers_check' on m32r
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
---
include/asm-m32r/page.h | 3 +--
include/asm-m32r/ptrace.h | 4 ++--
include/asm-m32r/signal.h | 1 -
include/asm-m32r/unistd.h | 4 ++--
include/asm-m32r/user.h | 1 -
5 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 9688be0..404a4c2 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -87,10 +87,9 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ |
#define devmem_is_allowed(x) 1
-#endif /* __KERNEL__ */
-
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
+#endif /* __KERNEL__ */
#endif /* _ASM_M32R_PAGE_H */
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h
index a07fa90..2d2a6c9 100644
--- a/include/asm-m32r/ptrace.h
+++ b/include/asm-m32r/ptrace.h
@@ -12,8 +12,6 @@ #define _ASM_M32R_PTRACE_H
* Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org>
*/
-#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
-
/* 0 - 13 are integer registers (general purpose registers). */
#define PT_R4 0
#define PT_R5 1
@@ -140,6 +138,8 @@ #define PTRACE_O_TRACESYSGOOD 0x00000001
#ifdef __KERNEL__
+#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
+
#define __ARCH_SYS_PTRACE 1
#if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
diff --git a/include/asm-m32r/signal.h b/include/asm-m32r/signal.h
index e750045..65423be 100644
--- a/include/asm-m32r/signal.h
+++ b/include/asm-m32r/signal.h
@@ -6,7 +6,6 @@ #define _ASM_M32R_SIGNAL_H
/* orig : i386 2.4.18 */
#include <linux/types.h>
-#include <linux/linkage.h>
#include <linux/time.h>
#include <linux/compiler.h>
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index cc31790..89f376e 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -3,8 +3,6 @@ #define _ASM_M32R_UNISTD_H
/* $Id$ */
-#include <asm/syscall.h> /* SYSCALL_* */
-
/*
* This file contains the system call numbers.
*/
@@ -303,6 +301,8 @@ #define NR_syscalls 285
* <asm-m32r/errno.h>
*/
+#include <asm/syscall.h> /* SYSCALL_* */
+
#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-(124 + 1))) { \
diff --git a/include/asm-m32r/user.h b/include/asm-m32r/user.h
index 2ffd0c6..1ad4ded 100644
--- a/include/asm-m32r/user.h
+++ b/include/asm-m32r/user.h
@@ -8,7 +8,6 @@ #define _ASM_M32R_USER_H
*/
#include <linux/types.h>
-#include <asm/processor.h>
#include <asm/ptrace.h>
#include <asm/page.h>
--
Hirokazu Takata <takata@linux-m32r.org>
Linux/M32R Project: http://www.linux-m32r.org/
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (3 preceding siblings ...)
2006-09-19 7:04 ` Hirokazu Takata
@ 2006-09-19 8:25 ` Ian Molton
2006-09-19 15:31 ` Jeff Dike
5 siblings, 0 replies; 40+ messages in thread
From: Ian Molton @ 2006-09-19 8:25 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, starvik, ysato, takata, geert, lethal, davem, wli,
jdike, uclinux-v850, chris, rmk, dhowells, ralf, kyle
>
> It may be that UM and ARM26 don't need to be exporting headers,
Hi.
This got lost among 6000 odd spams I received a while back. I'll take a
look.
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
` (4 preceding siblings ...)
2006-09-19 8:25 ` Ian Molton
@ 2006-09-19 15:31 ` Jeff Dike
2006-09-19 15:39 ` David Woodhouse
5 siblings, 1 reply; 40+ messages in thread
From: Jeff Dike @ 2006-09-19 15:31 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, lethal, davem,
wli, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Sun, Sep 17, 2006 at 08:39:39AM +0100, David Woodhouse wrote:
> It may be that UM and ARM26 don't need to be exporting headers, because
> they can use headers from the host architecture
Yup.
> If that's the case, we should just remove the Kbuild files
> from those architectures' include directories.
Is it OK that this happens when I do that:
/home/jdike/linux/2.6/linux-2.6.17/scripts/Makefile.headersinst:42: /home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild: No such file or directory
make[3]: *** No rule to make target `/home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild'. Stop.
Jeff
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-19 15:31 ` Jeff Dike
@ 2006-09-19 15:39 ` David Woodhouse
2006-09-19 22:03 ` Jeff Dike
0 siblings, 1 reply; 40+ messages in thread
From: David Woodhouse @ 2006-09-19 15:39 UTC (permalink / raw)
To: Jeff Dike
Cc: linux-arch, spyro, starvik, ysato, takata, geert, lethal, davem,
wli, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Tue, 2006-09-19 at 11:31 -0400, Jeff Dike wrote:
> Is it OK that this happens when I do that:
>
> /home/jdike/linux/2.6/linux-2.6.17/scripts/Makefile.headersinst:42: /home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild: No such file or directory
> make[3]: *** No rule to make target
> `/home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild'. Stop.
Er, yes. I don't think it makes any sense to export headers specifically
for UM. I wonder why my shadow git tree has them...
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-19 15:39 ` David Woodhouse
@ 2006-09-19 22:03 ` Jeff Dike
2006-09-20 6:18 ` Arnd Bergmann
0 siblings, 1 reply; 40+ messages in thread
From: Jeff Dike @ 2006-09-19 22:03 UTC (permalink / raw)
To: David Woodhouse
Cc: linux-arch, spyro, starvik, ysato, takata, geert, lethal, davem,
wli, uclinux-v850, chris, rmk, dhowells, ralf, kyle
On Tue, Sep 19, 2006 at 04:39:29PM +0100, David Woodhouse wrote:
> On Tue, 2006-09-19 at 11:31 -0400, Jeff Dike wrote:
> > Is it OK that this happens when I do that:
> >
> > /home/jdike/linux/2.6/linux-2.6.17/scripts/Makefile.headersinst:42: /home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild: No such file or directory
> > make[3]: *** No rule to make target
> > `/home/jdike/linux/2.6/linux-2.6.17/include/asm-um/Kbuild'. Stop.
>
> Er, yes. I don't think it makes any sense to export headers specifically
> for UM. I wonder why my shadow git tree has them...
Well, my question was, is it OK for make to explode when headers_check is
done for UML, or should it do nothing silently?
Jeff
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-19 22:03 ` Jeff Dike
@ 2006-09-20 6:18 ` Arnd Bergmann
2006-09-20 15:02 ` Jeff Dike
0 siblings, 1 reply; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-20 6:18 UTC (permalink / raw)
To: Jeff Dike
Cc: David Woodhouse, linux-arch, spyro, starvik, ysato, takata, geert,
lethal, davem, wli, uclinux-v850, chris, rmk, dhowells, ralf,
kyle
On Wednesday 20 September 2006 00:03, Jeff Dike wrote:
>
> > Er, yes. I don't think it makes any sense to export headers specifically
> > for UM. I wonder why my shadow git tree has them...
>
> Well, my question was, is it OK for make to explode when headers_check is
> done for UML, or should it do nothing silently?
headers_check should check whatever files are installed by headers_install.
I think the most sensible two choices there are:
1. install the headers for the actual underlying architecture (SUBARCH)
instead of the um headers.
2. if ARCH=um, don't provide headers_install or headers_check targets.
Arnd <><
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: All arch maintainers: 'make headers_check' fails on most architectures.
2006-09-20 6:18 ` Arnd Bergmann
@ 2006-09-20 15:02 ` Jeff Dike
0 siblings, 0 replies; 40+ messages in thread
From: Jeff Dike @ 2006-09-20 15:02 UTC (permalink / raw)
To: Arnd Bergmann
Cc: David Woodhouse, linux-arch, spyro, starvik, ysato, takata, geert,
lethal, davem, wli, uclinux-v850, chris, rmk, dhowells, ralf,
kyle
On Wed, Sep 20, 2006 at 08:18:50AM +0200, Arnd Bergmann wrote:
> headers_check should check whatever files are installed by headers_install.
> I think the most sensible two choices there are:
>
> 1. install the headers for the actual underlying architecture (SUBARCH)
> instead of the um headers.
I don't think UML should be installing i386 headers.
> 2. if ARCH=um, don't provide headers_install or headers_check targets.
Those are provided by the toplevel Makefile, so this would involve
wrapping an ifneq($ARCH, "um") around them, which doesn't seem too
palatable.
Jeff
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 6:45 ` David Woodhouse
@ 2006-09-21 15:13 ` David Woodhouse
0 siblings, 0 replies; 40+ messages in thread
From: David Woodhouse @ 2006-09-21 15:13 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Arnd Bergmann, linux-arch, linux-kernel
On Mon, 2006-09-18 at 07:45 +0100, David Woodhouse wrote:
> I'd like to move to a scheme where we do headers_install and
> headers_check _without_ starting with a rm -rf
> $(HDR_INSTALL_PATH)/include.
>
> We could probably do it by adding a rule along the lines of
> $(filter-out $(unifdef-y) $(header-y),$(wildcard
> $(INSTALL_HDR_PATH)/$(dst)/*.h):
> rm $@
> ... i.e. remove every .h file from the destination directory except
> the
> ones we just created.
>
> Then we can make $(INSTALL_HDR_PATH)/$(dst)/%.h depend on
> $(srctree)/$(src)/%.h so that it doesn't get re-exported unless it's
> changed. And we can keep a stamp file around (or the output of the
> test
> compilation after Arnd's patch) which shows that the _check_ step has
> been done too. Something like .checked.%.h
>
> After we do that, a second invocation of 'make headers_check' should
> have nothing to do, which will encourage people to keep using it.
How does this look? Need to sort out dependencies for the .check.$FOO.h
files, but it does 'headers_install' relatively sanely with
dependencies, and also implements 'headers_install_all' with which we
can make a release tarball of linux-kernel-headers.
Oh, and I buggered the autogenerated files for biarch, but I'll fix that
later this evening.
diff --git a/Makefile b/Makefile
index 33074e8..fa72626 100644
--- a/Makefile
+++ b/Makefile
@@ -892,18 +892,26 @@ # Kernel headers
INSTALL_HDR_PATH=$(objtree)/usr
export INSTALL_HDR_PATH
+HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild)))
+
+PHONY += headers_install_all
+headers_install_all: include/linux/version.h
+ $(Q)unifdef -Ux /dev/null
+ $(Q)for arch in $(HDRARCHES); do \
+ $(MAKE) ARCH=$$arch -rR -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch __headersinst ;\
+ done
+
PHONY += headers_install
headers_install: include/linux/version.h
@if [ ! -r include/asm-$(ARCH)/Kbuild ]; then \
echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \
exit 1 ; fi
$(Q)unifdef -Ux /dev/null
- $(Q)rm -rf $(INSTALL_HDR_PATH)/include
- $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include
+ $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include __headersinst
PHONY += headers_check
headers_check: headers_install
- $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1
+ $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include __headerscheck
# ---------------------------------------------------------------------------
# Modules
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
diff --git a/include/Kbuild b/include/Kbuild
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild
diff --git a/include/asm-powerpc/auxvec.h b/include/asm-powerpc/auxvec.h
diff --git a/include/asm-powerpc/signal.h b/include/asm-powerpc/signal.h
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 12e1daf..c47a9ec 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -24,8 +24,6 @@ HDRSED := sed -e "s/ inline / __inline
_dst := $(if $(dst),$(dst),$(obj))
.PHONY: __headersinst
-__headersinst:
-
ifeq (,$(patsubst include/asm/%,,$(obj)/))
# For producing the generated stuff in include/asm for biarch builds, include
@@ -36,17 +34,18 @@ # use '-include'.
GENASM := 1
archasm := $(subst include/asm,asm-$(ARCH),$(obj))
altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj))
--include $(srctree)/include/$(archasm)/Kbuild
--include $(srctree)/include/$(altarchasm)/Kbuild
+KBUILDFILES := $(srctree)/include/$(archasm)/Kbuild $(srctree)/include/$(altarchasm)/Kbuild
+-include $(KBUILDFILES)
else
-include $(srctree)/$(obj)/Kbuild
+KBUILDFILES := $(srctree)/$(obj)/Kbuild
+include $(KBUILDFILES)
endif
include scripts/Kbuild.include
# If this is include/asm-$(ARCH) and there's no $(ALTARCH), then
# override $(_dst) so that we install to include/asm directly.
-ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH))
+ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR))
_dst := include/asm
endif
@@ -56,6 +55,20 @@ subdir-y := $(patsubst %/,%,$(filter %/,
header-y := $(filter-out %/, $(header-y))
header-y := $(filter-out $(unifdef-y),$(header-y))
+# Work out what needs to be removed
+oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h))
+unwanted := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders))
+
+# stamp files for header checks
+check-y := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y))
+
+# Prefix them all with full paths to $(INSTALL_HDR_PATH)
+header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y))
+unifdef-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y))
+objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y))
+check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y))
+
+
ifdef ALTARCH
ifeq ($(obj),include/asm-$(ARCH))
altarch-y := altarch-dir
@@ -67,43 +80,47 @@ export ALTARCH
export ARCHDEF
export ALTARCHDEF
-quiet_cmd_o_hdr_install = INSTALL $(_dst)/$@
- cmd_o_hdr_install = cp $(objtree)/$(obj)/$@ $(INSTALL_HDR_PATH)/$(_dst)
+quiet_cmd_o_hdr_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+ cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \
+ $(INSTALL_HDR_PATH)/$(_dst)
-quiet_cmd_headers_install = INSTALL $(_dst)/$@
- cmd_headers_install = $(HDRSED) $(srctree)/$(obj)/$@ \
- > $(INSTALL_HDR_PATH)/$(_dst)/$@
+quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+ cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
+ > $@
-quiet_cmd_unifdef = UNIFDEF $(_dst)/$@
- cmd_unifdef = $(UNIFDEF) $(srctree)/$(obj)/$@ | $(HDRSED) \
- > $(INSTALL_HDR_PATH)/$(_dst)/$@ || :
+quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+ cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \
+ | $(HDRSED) > $@ || :
-quiet_cmd_check = CHECK $(_dst)/$@
+quiet_cmd_check = CHECK $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/.check.%,$(_dst)/%,$@)
cmd_check = $(srctree)/scripts/hdrcheck.sh \
- $(INSTALL_HDR_PATH)/include \
- $(INSTALL_HDR_PATH)/$(_dst)/$@
+ $(INSTALL_HDR_PATH)/include $(subst /.check.,/,$@)
+
+quiet_cmd_remove = REMOVE $(_dst)/$@
+ cmd_remove = rm -f $(INSTALL_HDR_PATH)/$(_dst)/$@
-quiet_cmd_mkdir = MKDIR $@
- cmd_mkdir = mkdir -p $(INSTALL_HDR_PATH)/$@
+quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+ cmd_mkdir = mkdir -p $@
-quiet_cmd_gen = GEN $(_dst)/$@
+quiet_cmd_gen = GEN $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
cmd_gen = \
+FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@) \
STUBDEF=__ASM_STUB_`echo $@ | tr a-z. A-Z_`; \
(echo "/* File autogenerated by 'make headers_install' */" ; \
echo "\#ifndef $$STUBDEF" ; \
echo "\#define $$STUBDEF" ; \
echo "\# if $(ARCHDEF)" ; \
-if [ -r $(INSTALL_HDR_PATH)/include/$(archasm)/$@ ]; then \
- echo "\# include <$(archasm)/$@>" ; \
+if [ -r $(subst /$(_dst)/,/$(archasm),$@) ]; then \
+ echo "\# include <$(archasm)/$$FNAME>" ; \
else \
- echo "\# error $(archasm)/$@ does not exist in" \
+ echo "\# error $(archasm)/$$FNAME does not exist in" \
"the $(ARCH) architecture" ; \
fi ; \
echo "\# elif $(ALTARCHDEF)" ; \
-if [ -r $(INSTALL_HDR_PATH)/include/$(altarchasm)/$@ ]; then \
- echo "\# include <$(altarchasm)/$@>" ; \
+if [ -r $(subst /$(_dst)/,/$(altarchasm),$@) ]; then \
+ echo "\# include <$(altarchasm)/$$FNAME>" ; \
else \
- echo "\# error $(altarchasm)/$@ does not exist in" \
+ echo "\# error $(altarchasm)/$$FNAME does not exist in" \
"the $(ALTARCH) architecture" ; \
fi ; \
echo "\# else" ; \
@@ -111,39 +128,45 @@ echo "\# warning This machine appears t
"neither $(ARCH) nor $(ALTARCH)." ; \
echo "\# endif" ; \
echo "\#endif /* $$STUBDEF */" ; \
-) > $(INSTALL_HDR_PATH)/$(_dst)/$@
+) > $@
__headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y)
+ @true
-.PHONY: $(header-y) $(unifdef-y) $(subdir-y)
+__headerscheck: $(subdir-y) $(check-y)
+ @true
-ifdef HDRCHECK
-# Rules for checking headers
-$(objhdr-y) $(header-y) $(unifdef-y):
+# Leave $(check-y) as .PHONY for now till we sort out proper deps for it
+.PHONY: $(check-y)
+$(check-y) : $(INSTALL_HDR_PATH)/$(_dst)/.check.%.h : $(INSTALL_HDR_PATH)/$(_dst)/%.h
$(call cmd,check)
-else
+ @touch $@
+
# Rules for installing headers
-$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): $(_dst)
+$(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted)
-.PHONY: $(_dst)
-$(_dst):
+$(INSTALL_HDR_PATH)/$(_dst):
$(call cmd,mkdir)
+.PHONY: $(unwanted)
+$(unwanted):
+ $(call cmd,remove)
+
ifdef GENASM
-$(objhdr-y) $(header-y) $(unifdef-y):
+$(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES)
$(call cmd,gen)
else
-$(objhdr-y):
+$(objhdr-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
$(call cmd,o_hdr_install)
-$(header-y):
+$(header-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
$(call cmd,headers_install)
-$(unifdef-y):
+$(unifdef-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES)
$(call cmd,unifdef)
-endif
+
endif
hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
@@ -152,9 +175,11 @@ hdrinst := -rR -f $(srctree)/scripts/Mak
# All the files in the normal arch dir must be created first, since we test
# for their existence.
altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y)
- $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH)
- $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm
+ $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) $(MAKECMDGOALS)
+ $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR) $(MAKECMDGOALS)
# Recursion
+.PHONY: $(subdir-y)
$(subdir-y):
- $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel)
+ $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel) $(MAKECMDGOALS)
+
--
dwmw2
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-18 1:27 ` [patch 1/8] extend make headers_check to detect more problems Arnd Bergmann
2006-09-18 6:21 ` Sam Ravnborg
@ 2006-09-23 11:04 ` David Woodhouse
2006-09-23 13:18 ` Arnd Bergmann
1 sibling, 1 reply; 40+ messages in thread
From: David Woodhouse @ 2006-09-23 11:04 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-arch, linux-kernel
On Mon, 2006-09-18 at 03:27 +0200, Arnd Bergmann wrote:
> plain text document attachment (headercheck-base.diff)
> In addition to the problem of including non-existant header
> files, a number of other things can go wrong with header
> files exported to user space. This adds checks for some
> common problems:
>
> - The header fails to include the files it needs, which
> results in build errors when a program tries to include
> it. Check this by doing a dummy compile.
>
> - There is a declarations of a static variable or non-inline
> function in the header, which results in object code
> in every file including it. Check for symbols in the object
> with 'nm'.
>
> - Part of the header is subject to conditional compilation
> based on CONFIG_*. Add a regex search for this.
It would be good to fix these problems, it's true -- but bear in mind
that none of these are actually fatal problems -- they're just caveats
of (ab)using kernel-private headers in userspace.
On the other hand, it would be good to get people used to running
'make headers_check' whenever they make a change -- so introducing more
breakage right now may be counterproductive from that point of view.
So I think I'd prefer to leave this for now, or at least limit it to
'make CHECKMEHARDER=1 headers_check' so that we can wean people onto
using headers_check slowly and relatively painlessly.
> I found many problems with this, which I then fixed for
> powerpc, s390 and i386, in subsequent patches.
Can you -include <linux/types.h> _every_ time, to reduce the number of
places you have to add '/* @headercheck: -include linux/types.h @ */' ?
--
dwmw2
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [patch 1/8] extend make headers_check to detect more problems
2006-09-23 11:04 ` David Woodhouse
@ 2006-09-23 13:18 ` Arnd Bergmann
0 siblings, 0 replies; 40+ messages in thread
From: Arnd Bergmann @ 2006-09-23 13:18 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-arch, linux-kernel
On Saturday 23 September 2006 13:04, David Woodhouse wrote:
> It would be good to fix these problems, it's true -- but bear in mind
> that none of these are actually fatal problems -- they're just caveats
> of (ab)using kernel-private headers in userspace.
>
> On the other hand, it would be good to get people used to running
> 'make headers_check' whenever they make a change -- so introducing more
> breakage right now may be counterproductive from that point of view.
>
> So I think I'd prefer to leave this for now, or at least limit it to
> 'make CHECKMEHARDER=1 headers_check' so that we can wean people onto
> using headers_check slowly and relatively painlessly.
yes, that sounds fair.
> > I found many problems with this, which I then fixed for
> > powerpc, s390 and i386, in subsequent patches.
>
> Can you -include <linux/types.h> _every_ time, to reduce the number of
> places you have to add '/* @headercheck: -include linux/types.h @ */' ?
The problem with this are a few files which have code like
#ifndef __KERNEL__
#include <sys/types.h>
#include <stdint.h>
#endif
or similar. These break heavily if you include <linux/types.h> before the
the glibc provided headers, because linux/types.h provides some of the
types that are normally defined elsewhere and duplicate typedefs result
in compile errors.
To solve this, we would need to make all headers build fine with
gcc -D__STRICT_KERNEL_NAMES -include linux/types.h.
That is a valueable goal as well, since it avoids a number of problems,
but it is actually a larger change than this.
Now one option we could take would be to always pass -include linux/types.h
to gcc and put /* @headercheck: -D__STRICT_KERNEL_NAMES */ into the few
places that break otherwise.
Arnd <><
^ permalink raw reply [flat|nested] 40+ messages in thread
end of thread, other threads:[~2006-09-23 13:18 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-12 16:44 All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-14 22:34 ` [PATCH] [1/5] Fix 'make headers_check' on biarch architectures for 2.6.18 David Woodhouse
2006-09-14 22:35 ` [PATCH] [2/5] Fix 'make headers_check' on s390 " David Woodhouse
2006-09-15 8:25 ` Martin Schwidefsky
2006-09-14 22:36 ` [PATCH] [3/5] Fix 'make headers_check' on ia64 " David Woodhouse
2006-09-14 22:36 ` [PATCH] [4/5] Fix 'make headers_check' on x86_64 " David Woodhouse
2006-09-14 22:37 ` [PATCH] [5/5] Fix 'make headers_check' on i386 " David Woodhouse
2006-09-17 7:39 ` All arch maintainers: 'make headers_check' fails on most architectures David Woodhouse
2006-09-17 11:51 ` Paul Mundt
2006-09-17 12:10 ` David Woodhouse
2006-09-17 12:20 ` lethal
2006-09-17 12:51 ` Paul Mundt
2006-09-17 11:56 ` Paul Mundt
2006-09-17 11:58 ` David Woodhouse
2006-09-17 12:27 ` Paul Mundt
2006-09-19 7:04 ` Hirokazu Takata
2006-09-19 8:25 ` Ian Molton
2006-09-19 15:31 ` Jeff Dike
2006-09-19 15:39 ` David Woodhouse
2006-09-19 22:03 ` Jeff Dike
2006-09-20 6:18 ` Arnd Bergmann
2006-09-20 15:02 ` Jeff Dike
2006-09-17 9:52 ` Geert Uytterhoeven
2006-09-17 10:36 ` David Woodhouse
2006-09-18 1:27 ` [patch 0/8] " Arnd Bergmann
2006-09-18 1:27 ` [patch 1/8] extend make headers_check to detect more problems Arnd Bergmann
2006-09-18 6:21 ` Sam Ravnborg
2006-09-18 6:45 ` David Woodhouse
2006-09-21 15:13 ` David Woodhouse
2006-09-18 8:05 ` Arnd Bergmann
2006-09-18 8:10 ` David Woodhouse
2006-09-23 11:04 ` David Woodhouse
2006-09-23 13:18 ` Arnd Bergmann
2006-09-18 1:27 ` [patch 2/8] fix byteorder headers for make headers_check Arnd Bergmann
2006-09-18 1:27 ` [patch 3/8] hide kernel-only parts of some installed headers Arnd Bergmann
2006-09-18 1:27 ` [patch 4/8] fix exported flock64 constants Arnd Bergmann
2006-09-18 1:27 ` [patch 5/8] add missing #includes in user space parts of headers Arnd Bergmann
2006-09-18 1:27 ` [patch 6/8] annotate header files for make headers_check Arnd Bergmann
2006-09-18 1:27 ` [patch 8/8] annotate netfilter header " Arnd Bergmann
2006-09-18 1:37 ` [patch 7/8] annotate if_* " Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).