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
7 7
8#include <asm/ptrace.h>8#include <asm/ptrace.h>
9#include <asm/user.h>9#include <asm/user.h>
10#include <asm/processor.h>
11#include <asm/compat.h>
12 10
13/* x86-64 relocation types */11/* x86-64 relocation types */
14#define R_X86_64_NONE 0 /* No reloc */12#define R_X86_64_NONE 0 /* No reloc */
@@ -38,12 +36,6 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; · 23 unmodified lines
38 36
39typedef struct user_i387_struct elf_fpregset_t;37typedef struct user_i387_struct elf_fpregset_t;
40 38
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
47/*39/*
48 * These are used to set parameters in the core dumps.40 * These are used to set parameters in the core dumps.
49 */41 */
@@ -51,6 +43,17 @@ typedef struct user_i387_struct elf_fpregset_t; · 1 unmodified line
51#define ELF_DATA ELFDATA2LSB43#define ELF_DATA ELFDATA2LSB
52#define ELF_ARCH EM_X86_6444#define ELF_ARCH EM_X86_64
53 45
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
54/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx57/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
55 contains a pointer to a function which might be registered using `atexit'.58 contains a pointer to a function which might be registered using `atexit'.
56 This provides a mean for the dynamic linker to call DT_FINI functions for59 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
141/* I'm not sure if we can use '-' here */144/* I'm not sure if we can use '-' here */
142#define ELF_PLATFORM ("x86_64")145#define ELF_PLATFORM ("x86_64")
143 146
144#ifdef __KERNEL__
145extern void set_personality_64bit(void);147extern void set_personality_64bit(void);
146#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit()148#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit()
147/*149/*
include/asm-x86_64/signal.h+1−1
@@ -3,13 +3,13 @@ · 2 unmodified lines
3 3
4#ifndef __ASSEMBLY__4#ifndef __ASSEMBLY__
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/linkage.h>
7#include <linux/time.h>6#include <linux/time.h>
8 7
9/* Avoid too many header ordering problems. */8/* Avoid too many header ordering problems. */
10struct siginfo;9struct siginfo;
11 10
12#ifdef __KERNEL__11#ifdef __KERNEL__
12#include <linux/linkage.h>
13/* Most things should be clean enough to redefine this at will, if care13/* Most things should be clean enough to redefine this at will, if care
14 is taken to make libc match. */14 is taken to make libc match. */
15 15
include/asm-x86_64/unistd.h+8−8
@@ -620,6 +620,8 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice) · 619 unmodified lines
620#define __NR_move_pages 279620#define __NR_move_pages 279
621__SYSCALL(__NR_move_pages, sys_move_pages)621__SYSCALL(__NR_move_pages, sys_move_pages)
622 622
623#ifdef __KERNEL__
624
623#define __NR_syscall_max __NR_move_pages625#define __NR_syscall_max __NR_move_pages
624 626
625#ifndef __NO_STUBS627#ifndef __NO_STUBS
@@ -744,8 +746,6 @@ __syscall_return(type,__res); \ · 118 unmodified lines
744 746
745#else /* __KERNEL_SYSCALLS__ */747#else /* __KERNEL_SYSCALLS__ */
746 748
747#ifdef __KERNEL__
748
749#include <linux/syscalls.h>749#include <linux/syscalls.h>
750#include <asm/ptrace.h>750#include <asm/ptrace.h>
751 751
@@ -821,8 +821,6 @@ asmlinkage long sys_fork(struct pt_regs regs); · 69 unmodified lines
821asmlinkage long sys_vfork(struct pt_regs regs);821asmlinkage long sys_vfork(struct pt_regs regs);
822asmlinkage long sys_pipe(int *fildes);822asmlinkage long sys_pipe(int *fildes);
823 823
824#endif /* __KERNEL_SYSCALLS__ */
825
826#ifndef __ASSEMBLY__824#ifndef __ASSEMBLY__
827 825
828#include <linux/linkage.h>826#include <linux/linkage.h>
@@ -838,9 +836,9 @@ asmlinkage long sys_rt_sigaction(int sig, · 9 unmodified lines
838 struct sigaction __user *oact,836 struct sigaction __user *oact,
839 size_t sigsetsize);837 size_t sigsetsize);
840 838
841#endif839#endif /* __ASSEMBLY__ */
842 840
843#endif841#endif /* __KERNEL_SYSCALLS__ */
844 842
845/*843/*
846 * "Conditional" syscalls844 * "Conditional" syscalls
@@ -850,6 +848,8 @@ asmlinkage long sys_rt_sigaction(int sig, · 3 unmodified lines
850 */848 */
851#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")849#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
852 850
853#endif851#endif /* __NO_STUBS */
854 852
855#endif853#endif /* __KERNEL__ */
854
855#endif /* _ASM_X86_64_UNISTD_H_ */
include/asm-x86_64/vsyscall.h+1−2
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_64_VSYSCALL_H_1#ifndef _ASM_X86_64_VSYSCALL_H_
2#define _ASM_X86_64_VSYSCALL_H_2#define _ASM_X86_64_VSYSCALL_H_
3 3
4#include <linux/seqlock.h>
5
6enum vsyscall_num {4enum vsyscall_num {
7 __NR_vgettimeofday,5 __NR_vgettimeofday,
8 __NR_vtime,6 __NR_vtime,
@@ -14,6 +12,7 @@ enum vsyscall_num { · 5 unmodified lines
14#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))12#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
15 13
16#ifdef __KERNEL__14#ifdef __KERNEL__
15#include <linux/seqlock.h>
17 16
18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))17#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
19#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))18#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))