Re: git: 96e53c0c65fa - main - archivers/libunrar: Support crc and crypto flags on aarch64
Date: Wed, 19 Feb 2025 11:15:46 UTC
Hi Jason, Am Wed, Feb 19, 2025 at 06:06:20AM -0500 schrieb Jason E. Hale: > > > +@@ -42,12 +42,18 @@ void InitCRC32(uint *CRCTab) > > > + } > > > + > > > + #ifdef USE_NEON_CRC32 > > > +- #ifdef _APPLE > > > ++ #if defined(_APPLE) > > > + // getauxval isn't available in OS X > > > + uint Value=0; > > > + size_t Size=sizeof(Value); > > > + int RetCode=sysctlbyname("hw.optional.armv8_crc32",&Value,&Size,NULL,0); > > > + CRC_Neon=RetCode==0 && Value!=0; > > > ++ #elif defined(__FreeBSD__) > > > ++ // getauxval isn't available on FreeBSD > > > ++ uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1); > > > ++ if (ID_AA64ISAR0_CRC32_VAL(Reg) == ID_AA64ISAR0_CRC32_BASE) { > > > ++ CRC_Neon=true; > > > ++ } > > > + #else > > > + CRC_Neon=(getauxval(AT_HWCAP) & HWCAP_CRC32)!=0; > > > + #endif > > > Note that we do have the same interface, the function is just spelled > > elf_aux_info() and has a slightly different interface. > > > > Thanks, I'm open to better, more canonical methods. I'm not an aarch64 > expert by any means. Just trying to make this stuff work. :) Your patch looks like it does the trick, so no need to revisit it. Yours, Robert Clausecker -- () ascii ribbon campaign - for an encoding-agnostic world /\ - against html email - against proprietary attachments