diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/Kbuild | 2 | ||||
-rw-r--r-- | include/asm-alpha/compiler.h | 3 | ||||
-rw-r--r-- | include/asm-alpha/page.h | 6 | ||||
-rw-r--r-- | include/asm-i386/unistd.h | 4 | ||||
-rw-r--r-- | include/asm-ia64/Kbuild | 2 | ||||
-rw-r--r-- | include/asm-ia64/page.h | 4 | ||||
-rw-r--r-- | include/asm-ia64/ptrace.h | 10 | ||||
-rw-r--r-- | include/asm-ia64/ustack.h | 7 | ||||
-rw-r--r-- | include/asm-s390/debug.h | 2 | ||||
-rw-r--r-- | include/asm-s390/elf.h | 28 | ||||
-rw-r--r-- | include/asm-x86_64/elf.h | 20 | ||||
-rw-r--r-- | include/asm-x86_64/signal.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/unistd.h | 16 | ||||
-rw-r--r-- | include/asm-x86_64/vsyscall.h | 3 |
14 files changed, 60 insertions, 49 deletions
diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild index e57fd57538b..2b06b3bad5f 100644 --- a/include/asm-alpha/Kbuild +++ b/include/asm-alpha/Kbuild @@ -1,5 +1,5 @@ include include/asm-generic/Kbuild.asm -unifdef-y += console.h fpu.h sysinfo.h +unifdef-y += console.h fpu.h sysinfo.h compiler.h header-y += gentrap.h regdef.h pal.h reg.h diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h index 00c6f57ad9a..d2768cc3d7a 100644 --- a/include/asm-alpha/compiler.h +++ b/include/asm-alpha/compiler.h @@ -90,6 +90,7 @@ __asm__("stw %1,%0" : "=m"(mem) : "r"(val)) #endif +#ifdef __KERNEL__ /* Some idiots over in <linux/compiler.h> thought inline should imply always_inline. This breaks stuff. We'll include this file whenever we run into such problems. */ @@ -101,4 +102,6 @@ #undef __always_inline #define __always_inline inline __attribute__((always_inline)) +#endif /* __KERNEL__ */ + #endif /* __ALPHA_COMPILER_H */ diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index 8c7cd50d4ea..d2bed3cb33f 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h @@ -1,6 +1,8 @@ #ifndef _ALPHA_PAGE_H #define _ALPHA_PAGE_H +#ifdef __KERNEL__ + #include <asm/pal.h> /* PAGE_SHIFT determines the page size */ @@ -8,8 +10,6 @@ #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) -#ifdef __KERNEL__ - #ifndef __ASSEMBLY__ #define STRICT_MM_TYPECHECKS @@ -92,9 +92,9 @@ typedef unsigned long pgprot_t; #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 /* _ALPHA_PAGE_H */ diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index d983b74e4d9..fc1c8ddae14 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -324,6 +324,8 @@ #define __NR_vmsplice 316 #define __NR_move_pages 317 +#ifdef __KERNEL__ + #define NR_syscalls 318 /* @@ -423,8 +425,6 @@ __asm__ volatile ("push %%ebp ; push %%ebx ; movl 4(%2),%%ebp ; " \ __syscall_return(type,__res); \ } -#ifdef __KERNEL__ - #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_STAT diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild index 85d6f8005eb..f1cb00f39c2 100644 --- a/include/asm-ia64/Kbuild +++ b/include/asm-ia64/Kbuild @@ -4,4 +4,4 @@ header-y += break.h fpu.h fpswa.h gcc_intrin.h ia64regs.h \ 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 f5a949ec6e1..947cb72b520 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -7,6 +7,7 @@ * David Mosberger-Tang <davidm@hpl.hp.com> */ +# ifdef __KERNEL__ #include <asm/intrinsics.h> #include <asm/types.h> @@ -64,7 +65,6 @@ # 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 @@ get_order (unsigned long size) (((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 415abb23b21..1414316efd4 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h @@ -56,6 +56,8 @@ #include <asm/fpu.h> + +#ifdef __KERNEL__ #ifndef ASM_OFFSETS_C #include <asm/asm-offsets.h> #endif @@ -79,10 +81,9 @@ #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 da55c91246e..a349467913e 100644 --- a/include/asm-ia64/ustack.h +++ b/include/asm-ia64/ustack.h @@ -5,12 +5,15 @@ * 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 */ diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index 7f1ef99fd1e..c00dd2b3dc5 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h @@ -10,7 +10,6 @@ #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 710646e64f7..c0d629d61d3 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h @@ -93,19 +93,6 @@ #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 @@ typedef s390_regs elf_gregset_t; #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 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs) #define ELF_PLATFORM (NULL) -#ifdef __KERNEL__ #ifndef __s390x__ #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) #else /* __s390x__ */ diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index b4f8f4a41a6..a406fcb1e92 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86_64/elf.h @@ -7,8 +7,6 @@ #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_NGREG]; 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 @@ typedef struct user_i387_struct elf_fpregset_t; /* 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 cef7a7d51b7..3ede2a61973 100644 --- a/include/asm-x86_64/signal.h +++ b/include/asm-x86_64/signal.h @@ -3,13 +3,13 @@ #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 2d89d309a2a..80fd48e84bb 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 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 @@ asmlinkage long sys_rt_sigaction(int sig, */ #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 a85e16f56d7..146b24402a5 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 @@ enum vsyscall_num { #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))) |