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.
Showing the changes to include (4 of 4 files). Show all
Unified · Split
| @@ -7,8 +7,6 @@ · 6 unmodified lines | ||
| 7 | 7 | |
| 8 | 8 | #include <asm/ptrace.h> |
| 9 | 9 | #include <asm/user.h> |
| 10 | −#include <asm/processor.h> | |
| 11 | −#include <asm/compat.h> | |
| 12 | 10 | |
| 13 | 11 | /* x86-64 relocation types */ |
| 14 | 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 | |
| 39 | 37 | typedef 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 | 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 | 43 | #define ELF_DATA ELFDATA2LSB |
| 52 | 44 | #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 | 57 | /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx |
| 55 | 58 | contains a pointer to a function which might be registered using `atexit'. |
| 56 | 59 | 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 | 144 | /* I'm not sure if we can use '-' here */ |
| 142 | 145 | #define ELF_PLATFORM ("x86_64") |
| 143 | 146 | |
| 144 | −#ifdef __KERNEL__ | |
| 145 | 147 | extern void set_personality_64bit(void); |
| 146 | 148 | #define SET_PERSONALITY(ex, ibcs2) set_personality_64bit() |
| 147 | 149 | /* |
| @@ -3,13 +3,13 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | #ifndef __ASSEMBLY__ |
| 5 | 5 | #include <linux/types.h> |
| 6 | −#include <linux/linkage.h> | |
| 7 | 6 | #include <linux/time.h> |
| 8 | 7 | |
| 9 | 8 | /* Avoid too many header ordering problems. */ |
| 10 | 9 | struct siginfo; |
| 11 | 10 | |
| 12 | 11 | #ifdef __KERNEL__ |
| 12 | +#include <linux/linkage.h> | |
| 13 | 13 | /* Most things should be clean enough to redefine this at will, if care |
| 14 | 14 | is taken to make libc match. */ |
| 15 | 15 | |
| @@ -620,6 +620,8 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice) · 619 unmodified lines | ||
| 620 | 620 | #define __NR_move_pages 279 |
| 621 | 621 | __SYSCALL(__NR_move_pages, sys_move_pages) |
| 622 | 622 | |
| 623 | +#ifdef __KERNEL__ | |
| 624 | + | |
| 623 | 625 | #define __NR_syscall_max __NR_move_pages |
| 624 | 626 | |
| 625 | 627 | #ifndef __NO_STUBS |
| @@ -744,8 +746,6 @@ __syscall_return(type,__res); \ · 118 unmodified lines | ||
| 744 | 746 | |
| 745 | 747 | #else /* __KERNEL_SYSCALLS__ */ |
| 746 | 748 | |
| 747 | −#ifdef __KERNEL__ | |
| 748 | − | |
| 749 | 749 | #include <linux/syscalls.h> |
| 750 | 750 | #include <asm/ptrace.h> |
| 751 | 751 | |
| @@ -821,8 +821,6 @@ asmlinkage long sys_fork(struct pt_regs regs); · 69 unmodified lines | ||
| 821 | 821 | asmlinkage long sys_vfork(struct pt_regs regs); |
| 822 | 822 | asmlinkage long sys_pipe(int *fildes); |
| 823 | 823 | |
| 824 | −#endif /* __KERNEL_SYSCALLS__ */ | |
| 825 | − | |
| 826 | 824 | #ifndef __ASSEMBLY__ |
| 827 | 825 | |
| 828 | 826 | #include <linux/linkage.h> |
| @@ -838,9 +836,9 @@ asmlinkage long sys_rt_sigaction(int sig, · 9 unmodified lines | ||
| 838 | 836 | struct sigaction __user *oact, |
| 839 | 837 | size_t sigsetsize); |
| 840 | 838 | |
| 841 | −#endif | |
| 839 | +#endif /* __ASSEMBLY__ */ | |
| 842 | 840 | |
| 843 | −#endif | |
| 841 | +#endif /* __KERNEL_SYSCALLS__ */ | |
| 844 | 842 | |
| 845 | 843 | /* |
| 846 | 844 | * "Conditional" syscalls |
| @@ -850,6 +848,8 @@ asmlinkage long sys_rt_sigaction(int sig, · 3 unmodified lines | ||
| 850 | 848 | */ |
| 851 | 849 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
| 852 | 850 | |
| 853 | −#endif | |
| 851 | +#endif /* __NO_STUBS */ | |
| 854 | 852 | |
| 855 | −#endif | |
| 853 | +#endif /* __KERNEL__ */ | |
| 854 | + | |
| 855 | +#endif /* _ASM_X86_64_UNISTD_H_ */ | |
| @@ -1,8 +1,6 @@ | ||
| 1 | 1 | #ifndef _ASM_X86_64_VSYSCALL_H_ |
| 2 | 2 | #define _ASM_X86_64_VSYSCALL_H_ |
| 3 | 3 | |
| 4 | −#include <linux/seqlock.h> | |
| 5 | − | |
| 6 | 4 | enum vsyscall_num { |
| 7 | 5 | __NR_vgettimeofday, |
| 8 | 6 | __NR_vtime, |
| @@ -14,6 +12,7 @@ enum vsyscall_num { · 5 unmodified lines | ||
| 14 | 12 | #define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) |
| 15 | 13 | |
| 16 | 14 | #ifdef __KERNEL__ |
| 15 | +#include <linux/seqlock.h> | |
| 17 | 16 | |
| 18 | 17 | #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) |
| 19 | 18 | #define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16))) |