Commit dca88ad6915b65f6e037f8c3e632fcd92a70bd88
Exists in
master
and in
38 other branches
Merge branch 'for-next' of git://git.infradead.org/users/dhowells/linux-headers
* 'for-next' of git://git.infradead.org/users/dhowells/linux-headers: UAPI: Split trivial #if defined(__KERNEL__) && X conditionals UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed UAPI: Make linux/patchkey.h easier to parse UAPI: Fix nested __KERNEL__ guards in video/edid.h UAPI: Alter the S390 asm include guards to be recognisable by the UAPI splitter UAPI: Guard linux/cuda.h UAPI: Guard linux/pmu.h UAPI: Guard linux/isdn_divertif.h UAPI: Guard linux/sound.h UAPI: Rearrange definition of HZ in asm-generic/param.h UAPI: Make FRV use asm-generic/param.h UAPI: Make M32R use asm-generic/param.h UAPI: Make MN10300 use asm-generic/param.h UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace UAPI: Don't include linux/compat.h in sparc's asm/siginfo.h UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines
Showing 25 changed files Side-by-side Diff
- arch/arm/include/asm/hwcap.h
- arch/arm/include/asm/swab.h
- arch/arm/include/asm/unistd.h
- arch/frv/include/asm/param.h
- arch/ia64/include/asm/intrinsics.h
- arch/m32r/include/asm/param.h
- arch/mips/include/asm/Kbuild
- arch/mips/include/asm/types.h
- arch/mn10300/include/asm/param.h
- arch/s390/include/asm/chpid.h
- arch/s390/include/asm/itcw.h
- arch/s390/include/asm/mman.h
- arch/sparc/include/asm/siginfo.h
- arch/tile/include/asm/signal.h
- include/asm-generic/param.h
- include/linux/acct.h
- include/linux/cuda.h
- include/linux/elf.h
- include/linux/isdn_divertif.h
- include/linux/mroute6.h
- include/linux/patchkey.h
- include/linux/pmu.h
- include/linux/sound.h
- include/linux/soundcard.h
- include/video/edid.h
arch/arm/include/asm/hwcap.h
... | ... | @@ -25,13 +25,15 @@ |
25 | 25 | #define HWCAP_IDIVT (1 << 18) |
26 | 26 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) |
27 | 27 | |
28 | -#if defined(__KERNEL__) && !defined(__ASSEMBLY__) | |
28 | +#if defined(__KERNEL__) | |
29 | +#if !defined(__ASSEMBLY__) | |
29 | 30 | /* |
30 | 31 | * This yields a mask that user programs can use to figure out what |
31 | 32 | * instruction set this cpu supports. |
32 | 33 | */ |
33 | 34 | #define ELF_HWCAP (elf_hwcap) |
34 | 35 | extern unsigned int elf_hwcap; |
36 | +#endif | |
35 | 37 | #endif |
36 | 38 | |
37 | 39 | #endif |
arch/arm/include/asm/swab.h
... | ... | @@ -22,7 +22,8 @@ |
22 | 22 | # define __SWAB_64_THRU_32__ |
23 | 23 | #endif |
24 | 24 | |
25 | -#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6 | |
25 | +#if defined(__KERNEL__) | |
26 | +#if __LINUX_ARM_ARCH__ >= 6 | |
26 | 27 | |
27 | 28 | static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) |
28 | 29 | { |
29 | 30 | |
... | ... | @@ -39,8 +40,10 @@ |
39 | 40 | } |
40 | 41 | #define __arch_swab32 __arch_swab32 |
41 | 42 | |
42 | -#else | |
43 | +#endif | |
44 | +#endif | |
43 | 45 | |
46 | +#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6 | |
44 | 47 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) |
45 | 48 | { |
46 | 49 | __u32 t; |
arch/arm/include/asm/unistd.h
... | ... | @@ -427,7 +427,8 @@ |
427 | 427 | /* |
428 | 428 | * The following syscalls are obsolete and no longer available for EABI. |
429 | 429 | */ |
430 | -#if defined(__ARM_EABI__) && !defined(__KERNEL__) | |
430 | +#if !defined(__KERNEL__) | |
431 | +#if defined(__ARM_EABI__) | |
431 | 432 | #undef __NR_time |
432 | 433 | #undef __NR_umount |
433 | 434 | #undef __NR_stime |
... | ... | @@ -440,6 +441,7 @@ |
440 | 441 | #undef __NR_socketcall |
441 | 442 | #undef __NR_syscall |
442 | 443 | #undef __NR_ipc |
444 | +#endif | |
443 | 445 | #endif |
444 | 446 | |
445 | 447 | #ifdef __KERNEL__ |
arch/frv/include/asm/param.h
1 | 1 | #ifndef _ASM_PARAM_H |
2 | 2 | #define _ASM_PARAM_H |
3 | 3 | |
4 | -#ifdef __KERNEL__ | |
5 | -#define HZ CONFIG_HZ /* Internal kernel timer frequency */ | |
6 | -#define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | |
7 | -#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | |
8 | -#endif | |
9 | - | |
10 | -#ifndef HZ | |
11 | -#define HZ 100 | |
12 | -#endif | |
13 | - | |
14 | 4 | #define EXEC_PAGESIZE 16384 |
15 | 5 | |
16 | -#ifndef NOGROUP | |
17 | -#define NOGROUP (-1) | |
18 | -#endif | |
19 | - | |
20 | -#define MAXHOSTNAMELEN 64 /* max length of hostname */ | |
6 | +#include <asm-generic/param.h> | |
21 | 7 | |
22 | 8 | #endif /* _ASM_PARAM_H */ |
arch/ia64/include/asm/intrinsics.h
... | ... | @@ -201,16 +201,21 @@ |
201 | 201 | #endif |
202 | 202 | |
203 | 203 | #ifndef __ASSEMBLY__ |
204 | -#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__) | |
205 | -#ifdef ASM_SUPPORTED | |
206 | -# define IA64_INTRINSIC_API(name) paravirt_ ## name | |
207 | -#else | |
208 | -# define IA64_INTRINSIC_API(name) pv_cpu_ops.name | |
209 | -#endif | |
210 | -#define IA64_INTRINSIC_MACRO(name) paravirt_ ## name | |
211 | -#else | |
204 | + | |
212 | 205 | #define IA64_INTRINSIC_API(name) ia64_native_ ## name |
213 | 206 | #define IA64_INTRINSIC_MACRO(name) ia64_native_ ## name |
207 | + | |
208 | +#if defined(__KERNEL__) | |
209 | +#if defined(CONFIG_PARAVIRT) | |
210 | +# undef IA64_INTRINSIC_API | |
211 | +# undef IA64_INTRINSIC_MACRO | |
212 | +# ifdef ASM_SUPPORTED | |
213 | +# define IA64_INTRINSIC_API(name) paravirt_ ## name | |
214 | +# else | |
215 | +# define IA64_INTRINSIC_API(name) pv_cpu_ops.name | |
216 | +# endif | |
217 | +#define IA64_INTRINSIC_MACRO(name) paravirt_ ## name | |
218 | +#endif | |
214 | 219 | #endif |
215 | 220 | |
216 | 221 | /************************************************/ |
arch/m32r/include/asm/param.h
1 | 1 | #ifndef _ASM_M32R_PARAM_H |
2 | 2 | #define _ASM_M32R_PARAM_H |
3 | 3 | |
4 | -#ifdef __KERNEL__ | |
5 | -# define HZ CONFIG_HZ /* Internal kernel timer frequency */ | |
6 | -# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | |
7 | -# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | |
8 | -#endif | |
9 | - | |
10 | -#ifndef HZ | |
11 | -#define HZ 100 | |
12 | -#endif | |
13 | - | |
14 | -#define EXEC_PAGESIZE 4096 | |
15 | - | |
16 | -#ifndef NOGROUP | |
17 | -#define NOGROUP (-1) | |
18 | -#endif | |
19 | - | |
20 | -#define MAXHOSTNAMELEN 64 /* max length of hostname */ | |
4 | +#include <asm-generic/param.h> | |
21 | 5 | |
22 | 6 | #endif /* _ASM_M32R_PARAM_H */ |
arch/mips/include/asm/Kbuild
arch/mips/include/asm/types.h
... | ... | @@ -15,10 +15,14 @@ |
15 | 15 | * We don't use int-l64.h for the kernel anymore but still use it for |
16 | 16 | * userspace to avoid code changes. |
17 | 17 | */ |
18 | -#if (_MIPS_SZLONG == 64) && !defined(__KERNEL__) | |
19 | -# include <asm-generic/int-l64.h> | |
20 | -#else | |
18 | +#ifdef __KERNEL__ | |
21 | 19 | # include <asm-generic/int-ll64.h> |
20 | +#else | |
21 | +# if _MIPS_SZLONG == 64 | |
22 | +# include <asm-generic/int-l64.h> | |
23 | +# else | |
24 | +# include <asm-generic/int-ll64.h> | |
25 | +# endif | |
22 | 26 | #endif |
23 | 27 | |
24 | 28 | /* |
arch/mn10300/include/asm/param.h
... | ... | @@ -11,24 +11,8 @@ |
11 | 11 | #ifndef _ASM_PARAM_H |
12 | 12 | #define _ASM_PARAM_H |
13 | 13 | |
14 | -#ifdef __KERNEL__ | |
15 | -#define HZ CONFIG_HZ /* Internal kernel timer frequency */ | |
16 | -#define USER_HZ 100 /* .. some user interfaces are in | |
17 | - * "ticks" */ | |
18 | -#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | |
19 | -#endif | |
14 | +#include <asm-generic/param.h> | |
20 | 15 | |
21 | -#ifndef HZ | |
22 | -#define HZ 100 | |
23 | -#endif | |
24 | - | |
25 | -#define EXEC_PAGESIZE 4096 | |
26 | - | |
27 | -#ifndef NOGROUP | |
28 | -#define NOGROUP (-1) | |
29 | -#endif | |
30 | - | |
31 | -#define MAXHOSTNAMELEN 64 /* max length of hostname */ | |
32 | 16 | #define COMMAND_LINE_SIZE 256 |
33 | 17 | |
34 | 18 | #endif /* _ASM_PARAM_H */ |
arch/s390/include/asm/chpid.h
arch/s390/include/asm/itcw.h
arch/s390/include/asm/mman.h
... | ... | @@ -11,9 +11,11 @@ |
11 | 11 | |
12 | 12 | #include <asm-generic/mman.h> |
13 | 13 | |
14 | -#if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT) | |
14 | +#if defined(__KERNEL__) | |
15 | +#if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT) | |
15 | 16 | int s390_mmap_check(unsigned long addr, unsigned long len); |
16 | 17 | #define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len) |
18 | +#endif | |
17 | 19 | #endif |
18 | 20 | |
19 | 21 | #endif /* __S390_MMAN_H__ */ |
arch/sparc/include/asm/siginfo.h
arch/tile/include/asm/signal.h
... | ... | @@ -23,7 +23,8 @@ |
23 | 23 | |
24 | 24 | #include <asm-generic/signal.h> |
25 | 25 | |
26 | -#if defined(__KERNEL__) && !defined(__ASSEMBLY__) | |
26 | +#if defined(__KERNEL__) | |
27 | +#if !defined(__ASSEMBLY__) | |
27 | 28 | struct pt_regs; |
28 | 29 | int restore_sigcontext(struct pt_regs *, struct sigcontext __user *); |
29 | 30 | int setup_sigcontext(struct sigcontext __user *, struct pt_regs *); |
... | ... | @@ -32,6 +33,7 @@ |
32 | 33 | void __user *frame, int sig); |
33 | 34 | void trace_unhandled_signal(const char *type, struct pt_regs *regs, |
34 | 35 | unsigned long address, int signo); |
36 | +#endif | |
35 | 37 | #endif |
36 | 38 | |
37 | 39 | #endif /* _ASM_TILE_SIGNAL_H */ |
include/asm-generic/param.h
1 | 1 | #ifndef __ASM_GENERIC_PARAM_H |
2 | 2 | #define __ASM_GENERIC_PARAM_H |
3 | 3 | |
4 | -#ifdef __KERNEL__ | |
5 | -# define HZ CONFIG_HZ /* Internal kernel timer frequency */ | |
6 | -# define USER_HZ 100 /* some user interfaces are */ | |
7 | -# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */ | |
8 | -#endif | |
9 | - | |
10 | 4 | #ifndef HZ |
11 | 5 | #define HZ 100 |
12 | 6 | #endif |
... | ... | @@ -20,6 +14,13 @@ |
20 | 14 | #endif |
21 | 15 | |
22 | 16 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ |
17 | + | |
18 | +#ifdef __KERNEL__ | |
19 | +# undef HZ | |
20 | +# define HZ CONFIG_HZ /* Internal kernel timer frequency */ | |
21 | +# define USER_HZ 100 /* some user interfaces are */ | |
22 | +# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */ | |
23 | +#endif | |
23 | 24 | |
24 | 25 | #endif /* __ASM_GENERIC_PARAM_H */ |
include/linux/acct.h
include/linux/cuda.h
... | ... | @@ -5,6 +5,9 @@ |
5 | 5 | * Copyright (C) 1996 Paul Mackerras. |
6 | 6 | */ |
7 | 7 | |
8 | +#ifndef _LINUX_CUDA_H | |
9 | +#define _LINUX_CUDA_H | |
10 | + | |
8 | 11 | /* CUDA commands (2nd byte) */ |
9 | 12 | #define CUDA_WARM_START 0 |
10 | 13 | #define CUDA_AUTOPOLL 1 |
... | ... | @@ -34,4 +37,6 @@ |
34 | 37 | extern void cuda_poll(void); |
35 | 38 | |
36 | 39 | #endif /* __KERNEL */ |
40 | + | |
41 | +#endif /* _LINUX_CUDA_H */ |
include/linux/elf.h
... | ... | @@ -7,15 +7,6 @@ |
7 | 7 | #include <asm/elf.h> |
8 | 8 | #endif |
9 | 9 | |
10 | -struct file; | |
11 | - | |
12 | -#ifndef elf_read_implies_exec | |
13 | - /* Executables for which elf_read_implies_exec() returns TRUE will | |
14 | - have the READ_IMPLIES_EXEC personality flag set automatically. | |
15 | - Override in asm/elf.h as needed. */ | |
16 | -# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 | |
17 | -#endif | |
18 | - | |
19 | 10 | /* 32-bit ELF base types. */ |
20 | 11 | typedef __u32 Elf32_Addr; |
21 | 12 | typedef __u16 Elf32_Half; |
... | ... | @@ -414,6 +405,13 @@ |
414 | 405 | } Elf64_Nhdr; |
415 | 406 | |
416 | 407 | #ifdef __KERNEL__ |
408 | +#ifndef elf_read_implies_exec | |
409 | + /* Executables for which elf_read_implies_exec() returns TRUE will | |
410 | + have the READ_IMPLIES_EXEC personality flag set automatically. | |
411 | + Override in asm/elf.h as needed. */ | |
412 | +# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 | |
413 | +#endif | |
414 | + | |
417 | 415 | #if ELF_CLASS == ELFCLASS32 |
418 | 416 | |
419 | 417 | extern Elf32_Dyn _DYNAMIC []; |
... | ... | @@ -437,6 +435,8 @@ |
437 | 435 | #endif |
438 | 436 | |
439 | 437 | /* Optional callbacks to write extra ELF notes. */ |
438 | +struct file; | |
439 | + | |
440 | 440 | #ifndef ARCH_HAVE_EXTRA_ELF_NOTES |
441 | 441 | static inline int elf_coredump_extra_notes_size(void) { return 0; } |
442 | 442 | static inline int elf_coredump_extra_notes_write(struct file *file, |
include/linux/isdn_divertif.h
... | ... | @@ -10,6 +10,8 @@ |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | +#ifndef _LINUX_ISDN_DIVERTIF_H | |
14 | +#define _LINUX_ISDN_DIVERTIF_H | |
13 | 15 | |
14 | 16 | /***********************************************************/ |
15 | 17 | /* magic value is also used to control version information */ |
... | ... | @@ -45,4 +47,6 @@ |
45 | 47 | /*********************/ |
46 | 48 | extern int DIVERT_REG_NAME(isdn_divert_if *); |
47 | 49 | #endif |
50 | + | |
51 | +#endif /* _LINUX_ISDN_DIVERTIF_H */ |
include/linux/mroute6.h
... | ... | @@ -43,8 +43,10 @@ |
43 | 43 | typedef __u32 if_mask; |
44 | 44 | #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ |
45 | 45 | |
46 | -#if !defined(__KERNEL__) && !defined(DIV_ROUND_UP) | |
46 | +#if !defined(__KERNEL__) | |
47 | +#if !defined(DIV_ROUND_UP) | |
47 | 48 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) |
49 | +#endif | |
48 | 50 | #endif |
49 | 51 | |
50 | 52 | typedef struct if_set { |
include/linux/patchkey.h
... | ... | @@ -32,7 +32,8 @@ |
32 | 32 | # else |
33 | 33 | # error "could not determine byte order" |
34 | 34 | # endif |
35 | -#elif defined(__BYTE_ORDER) | |
35 | +#else | |
36 | +#if defined(__BYTE_ORDER) | |
36 | 37 | # if __BYTE_ORDER == __BIG_ENDIAN |
37 | 38 | # define _PATCHKEY(id) (0xfd00|id) |
38 | 39 | # elif __BYTE_ORDER == __LITTLE_ENDIAN |
... | ... | @@ -40,6 +41,7 @@ |
40 | 41 | # else |
41 | 42 | # error "could not determine byte order" |
42 | 43 | # endif |
44 | +#endif | |
43 | 45 | #endif |
44 | 46 | |
45 | 47 | #endif /* _LINUX_PATCHKEY_H */ |
include/linux/pmu.h
include/linux/sound.h
include/linux/soundcard.h
... | ... | @@ -198,7 +198,8 @@ |
198 | 198 | # else |
199 | 199 | # error "could not determine byte order" |
200 | 200 | # endif |
201 | -#elif defined(__BYTE_ORDER) | |
201 | +#else | |
202 | +# if defined(__BYTE_ORDER) | |
202 | 203 | # if __BYTE_ORDER == __BIG_ENDIAN |
203 | 204 | # define AFMT_S16_NE AFMT_S16_BE |
204 | 205 | # elif __BYTE_ORDER == __LITTLE_ENDIAN |
... | ... | @@ -206,6 +207,7 @@ |
206 | 207 | # else |
207 | 208 | # error "could not determine byte order" |
208 | 209 | # endif |
210 | +# endif | |
209 | 211 | #endif |
210 | 212 | |
211 | 213 | /* |
include/video/edid.h
1 | 1 | #ifndef __linux_video_edid_h__ |
2 | 2 | #define __linux_video_edid_h__ |
3 | 3 | |
4 | -#if !defined(__KERNEL__) || defined(CONFIG_X86) | |
5 | - | |
6 | 4 | struct edid_info { |
7 | 5 | unsigned char dummy[128]; |
8 | 6 | }; |
9 | 7 | |
10 | 8 | #ifdef __KERNEL__ |
9 | +#ifdef CONFIG_X86 | |
11 | 10 | extern struct edid_info edid_info; |
12 | -#endif /* __KERNEL__ */ | |
13 | - | |
11 | +#endif | |
14 | 12 | #endif |
15 | 13 | |
16 | 14 | #endif /* __linux_video_edid_h__ */ |