Add HWCAP_NEON to the ARM hwcap.h file
authorCatalin Marinas <catalin.marinas@arm.com>
Thu, 6 Nov 2008 13:23:07 +0000 (13:23 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 6 Nov 2008 13:23:07 +0000 (13:23 +0000)
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/include/asm/hwcap.h
arch/arm/kernel/setup.c
arch/arm/vfp/vfpmodule.c

index 81f4c899a555b5949df821f313af262ba5303c49..bda489f9f01739c4543ca9c2f99b1ede6a739a9f 100644 (file)
@@ -16,6 +16,7 @@
 #define HWCAP_IWMMXT   512
 #define HWCAP_CRUNCH   1024
 #define HWCAP_THUMBEE  2048
+#define HWCAP_NEON     4096
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 /*
index 66e1a643ed14a93e753d2a1e8e97aeab4e9480b7..d4dae3e9b29435befd8bf61440fb1c8f5882147e 100644 (file)
@@ -773,6 +773,7 @@ static const char *hwcap_str[] = {
        "iwmmxt",
        "crunch",
        "thumbee",
+       "neon",
        NULL
 };
 
index c0d2c9bb952b67133b66a0f81a6a734f737a29f0..67ca340a7c85c364d184d15f92c1a9205f84f472 100644 (file)
@@ -371,6 +371,15 @@ static int __init vfp_init(void)
                 * in place; report VFP support to userspace.
                 */
                elf_hwcap |= HWCAP_VFP;
+#ifdef CONFIG_NEON
+               /*
+                * Check for the presence of the Advanced SIMD
+                * load/store instructions, integer and single
+                * precision floating point operations.
+                */
+               if ((fmrx(MVFR1) & 0x000fff00) == 0x00011100)
+                       elf_hwcap |= HWCAP_NEON;
+#endif
        }
        return 0;
 }