History

[PATCH] Fix 'make headers_check' on x86_64

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.

David Woodhouse committed 20 years ago

Commit 75da7361 parent e5fa6d74 files · +21 −20Browse files

Unified · Split

4 files
  1. include/asm-x86_64/elf.h +11 −9
  2. include/asm-x86_64/signal.h +1 −1
  3. include/asm-x86_64/unistd.h +8 −8
  4. include/asm-x86_64/vsyscall.h +1 −2
include/asm-x86_64/elf.h+11−9
@@ -7,8 +7,6 @@ · 6 unmodified lines
77
88 #include <asm/ptrace.h>
99 #include <asm/user.h>
10−#include <asm/processor.h>
11−#include <asm/compat.h>
1210
1311 /* x86-64 relocation types */
1412 #define R_X86_64_NONE 0 /* No reloc */
@@ -38,12 +36,6 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; · 23 unmodified lines
3836
3937 typedef struct user_i387_struct elf_fpregset_t;
4038
41−/*
42− * This is used to ensure we don't load something for the wrong architecture.
43− */
44−#define elf_check_arch(x) \
45− ((x)->e_machine == EM_X86_64)
46−
4739 /*
4840 * These are used to set parameters in the core dumps.
4941 */
@@ -51,6 +43,17 @@ typedef struct user_i387_struct elf_fpregset_t; · 1 unmodified line
5143 #define ELF_DATA ELFDATA2LSB
5244 #define ELF_ARCH EM_X86_64
5345
46+#ifdef __KERNEL__
47+#include <asm/processor.h>
48+#include <asm/compat.h>
49+
50+/*
51+ * This is used to ensure we don't load something for the wrong architecture.
52+ */
53+#define elf_check_arch(x) \
54+ ((x)->e_machine == EM_X86_64)
55+
56+
5457 /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
5558 contains a pointer to a function which might be registered using `atexit'.
5659 This provides a mean for the dynamic linker to call DT_FINI functions for
@@ -141,7 +144,6 @@ typedef struct user_i387_struct elf_fpregset_t; · 84 unmodified lines
141144 /* I'm not sure if we can use '-' here */
142145 #define ELF_PLATFORM ("x86_64")
143146
144−#ifdef __KERNEL__
145147 extern void set_personality_64bit(void);
146148 #define SET_PERSONALITY(ex, ibcs2) set_personality_64bit()
147149 /*
include/asm-x86_64/signal.h+1−1
@@ -3,13 +3,13 @@ · 2 unmodified lines
33
44 #ifndef __ASSEMBLY__
55 #include <linux/types.h>
6−#include <linux/linkage.h>
76 #include <linux/time.h>
87
98 /* Avoid too many header ordering problems. */
109 struct siginfo;
1110
1211 #ifdef __KERNEL__
12+#include <linux/linkage.h>
1313 /* Most things should be clean enough to redefine this at will, if care
1414 is taken to make libc match. */
1515
include/asm-x86_64/unistd.h+8−8
@@ -620,6 +620,8 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice) · 619 unmodified lines
620620 #define __NR_move_pages 279
621621 __SYSCALL(__NR_move_pages, sys_move_pages)
622622
623+#ifdef __KERNEL__
624+
623625 #define __NR_syscall_max __NR_move_pages
624626
625627 #ifndef __NO_STUBS
@@ -744,8 +746,6 @@ __syscall_return(type,__res); \ · 118 unmodified lines
744746
745747 #else /* __KERNEL_SYSCALLS__ */
746748
747−#ifdef __KERNEL__
748−
749749 #include <linux/syscalls.h>
750750 #include <asm/ptrace.h>
751751
@@ -821,8 +821,6 @@ asmlinkage long sys_fork(struct pt_regs regs); · 69 unmodified lines
821821 asmlinkage long sys_vfork(struct pt_regs regs);
822822 asmlinkage long sys_pipe(int *fildes);
823823
824−#endif /* __KERNEL_SYSCALLS__ */
825−
826824 #ifndef __ASSEMBLY__
827825
828826 #include <linux/linkage.h>
@@ -838,9 +836,9 @@ asmlinkage long sys_rt_sigaction(int sig, · 9 unmodified lines
838836 struct sigaction __user *oact,
839837 size_t sigsetsize);
840838
841−#endif
839+#endif /* __ASSEMBLY__ */
842840
843−#endif
841+#endif /* __KERNEL_SYSCALLS__ */
844842
845843 /*
846844 * "Conditional" syscalls
@@ -850,6 +848,8 @@ asmlinkage long sys_rt_sigaction(int sig, · 3 unmodified lines
850848 */
851849 #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
852850
853−#endif
851+#endif /* __NO_STUBS */
854852
855−#endif
853+#endif /* __KERNEL__ */
854+
855+#endif /* _ASM_X86_64_UNISTD_H_ */
include/asm-x86_64/vsyscall.h+1−2
@@ -1,8 +1,6 @@
11 #ifndef _ASM_X86_64_VSYSCALL_H_
22 #define _ASM_X86_64_VSYSCALL_H_
33
4−#include <linux/seqlock.h>
5−
64 enum vsyscall_num {
75 __NR_vgettimeofday,
86 __NR_vtime,
@@ -14,6 +12,7 @@ enum vsyscall_num { · 5 unmodified lines
1412 #define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
1513
1614 #ifdef __KERNEL__
15+#include <linux/seqlock.h>
1716
1817 #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
1918 #define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))