Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] Move HWCAP_* definitions to asm/elf.h

Move HWCAP_* definitions into asm/elf.h, where they should belong.
Since userspace wants to get at these definitions by including
asm/procinfo.h, include asm/elf.h from this file if __KERNEL__
is not defined, and issue a warning suggesting to fix the program
up to use asm/elf.h instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Russell King and committed by
Russell King
5974eaae ee90dabc

+19 -18
+14 -2
include/asm-arm/elf.h
··· 39 39 #endif 40 40 #define ELF_ARCH EM_ARM 41 41 42 - #ifdef __KERNEL__ 43 - #include <asm/procinfo.h> 42 + /* 43 + * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP 44 + */ 45 + #define HWCAP_SWP 1 46 + #define HWCAP_HALF 2 47 + #define HWCAP_THUMB 4 48 + #define HWCAP_26BIT 8 /* Play it safe */ 49 + #define HWCAP_FAST_MULT 16 50 + #define HWCAP_FPA 32 51 + #define HWCAP_VFP 64 52 + #define HWCAP_EDSP 128 53 + #define HWCAP_JAVA 256 54 + #define HWCAP_IWMMXT 512 44 55 56 + #ifdef __KERNEL__ 45 57 #ifndef __ASSEMBLY__ 46 58 /* 47 59 * This yields a mask that user programs can use to figure out what
+5 -16
include/asm-arm/procinfo.h
··· 10 10 #ifndef __ASM_PROCINFO_H 11 11 #define __ASM_PROCINFO_H 12 12 13 - #ifndef __ASSEMBLY__ 13 + #ifdef __KERNEL__ 14 14 15 15 struct cpu_tlb_fns; 16 16 struct cpu_user_fns; ··· 42 42 struct cpu_cache_fns *cache; 43 43 }; 44 44 45 - extern unsigned int elf_hwcap; 46 - 47 - #endif /* __ASSEMBLY__ */ 48 - 49 - #define HWCAP_SWP 1 50 - #define HWCAP_HALF 2 51 - #define HWCAP_THUMB 4 52 - #define HWCAP_26BIT 8 /* Play it safe */ 53 - #define HWCAP_FAST_MULT 16 54 - #define HWCAP_FPA 32 55 - #define HWCAP_VFP 64 56 - #define HWCAP_EDSP 128 57 - #define HWCAP_JAVA 256 58 - #define HWCAP_IWMMXT 512 59 - 45 + #else /* __KERNEL__ */ 46 + #include <asm/elf.h> 47 + #warning "Please include asm/elf.h instead" 48 + #endif /* __KERNEL__ */ 60 49 #endif