Changeset 16848 in niluje


Ignore:
Timestamp:
Feb 10, 2020, 1:39:41 AM (3 weeks ago)
Author:
NiLuJe
Message:

Kindle Hacks:

  • X-TC:
    • Refresh zlib-ng patchset
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Configs/trunk/Kindle/Misc/zlib-ng-nerf-arm-hwcap.patch

    r16464 r16848  
    11diff --git a/arch/arm/armfeature.c b/arch/arm/armfeature.c
    2 index 7c4758b..5068c36 100644
     2index 9ad9eed..ad71df4 100644
    33--- a/arch/arm/armfeature.c
    44+++ b/arch/arm/armfeature.c
    5 @@ -1,39 +1,22 @@
     5@@ -1,34 +1,18 @@
    66 #include "../../zutil.h"
    77 
    88-#if defined(__linux__)
    9 -# include <sys/auxv.h>
    10 -# include <asm/hwcap.h>
     9-#  include <sys/auxv.h>
     10-#  include <asm/hwcap.h>
    1111-#elif defined(_WIN32)
    12 -# include <winapifamily.h>
     12-#  include <winapifamily.h>
    1313-#endif
    1414+// NOTE: We can't use getauxval because it was introduced in glibc 2.16, which most of our targets don't support.
     
    1717 static int arm_has_crc32() {
    1818-#if defined(__linux__) && defined(HWCAP2_CRC32)
    19 return (getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0 ? 1 : 0;
     19  return (getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0 ? 1 : 0;
    2020-#elif defined(ARM_NOCHECK_ACLE)
    21 return 1;
     21  return 1;
    2222-#else
    23 // This is an armv8 feature, we're targeting armv6 & armv7 only.
    24    return 0;
     23  // This is an armv8 feature, we're targeting armv6 & armv7 only.
     24     return 0;
    2525-#endif
    2626 }
     
    2828 /* AArch64 has neon. */
    2929 #if !defined(__aarch64__) && !defined(_M_ARM64)
    30  static inline int arm_has_neon()
    31  {
    32 - #if defined(__linux__) && defined(HWCAP_NEON)
     30-static inline int arm_has_neon() {
     31-#if defined(__linux__) && defined(HWCAP_NEON)
    3332-    return (getauxval(AT_HWCAP) & HWCAP_NEON) != 0 ? 1 : 0;
    34 - #elif defined(_M_ARM) && defined(WINAPI_FAMILY_PARTITION)
    35 -  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
     33-#elif defined(_M_ARM) && defined(WINAPI_FAMILY_PARTITION)
     34-if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
    3635-    return 1; /* Always supported */
    37 -  #endif
    38 - #endif
     36-endif
     37-#endif
    3938-
    40 - #if defined(ARM_NOCHECK_NEON)
    41 -    return 1;
    42 - #else
    43 -    return 0;
    44 - #endif
     39-#if defined(ARM_NOCHECK_NEON)
     40+static inline int arm_has_neon()
     41+{
    4542+#ifdef __ARM_NEON
    46 +  return 1;
    47 +#else
    48 +  return 0;
    49 +#endif
    50  }
    51  #endif
    52  
     43     return 1;
     44 #else
     45     return 0;
Note: See TracChangeset for help on using the changeset viewer.