3 # Check if the passed in (CAPABILITY_WORD) matches a value found in the
4 # current hwcap aux vector.
6 # return '0' to indicate the capability was found.
7 # return '1' for not found, or any other error condition.
12 # These are potential hwcap values as found in the glibc dl-procinfo.c
13 # sources as of July 2015.
14 P_HWCAP_1
=" vsx arch_2_06 power6x dfp pa6t arch_2_05 ic_snoop smt booke"
15 P_HWCAP_2
=" cellbe power5+ power5 power4 notb efpdouble efpsingle spe"
16 P_HWCAP_3
=" ucache 4xxmac mmu fpu altivec ppc601 ppc64 ppc32 "
17 P_HWCAP2_1
=" tar isel ebb dscr htm arch_2_07 arch_3_00 "
19 for POTENTIAL_CAP
in $P_HWCAP_1 $P_HWCAP_2 $P_HWCAP_3 $P_HWCAP2_1 ; do
20 if [ "x$CAPABILITY_WORD" = "x$POTENTIAL_CAP" ]; then
21 CAPABILITY_FOUND
="yes"
25 if [ x
$CAPABILITY_FOUND = "xno" ]; then
26 echo "Warning: did not find $CAPABILITY_WORD in the potential capabilities list."
27 echo " LD_SHOW_AUXV=1 /bin/true | grep ^AT_HWCAP "
28 echo " Double-check that the input value [$CAPABILITY_WORD] is valid."
32 # Capability Check Begin:
33 LD_SHOW_AUXV
=1 /bin
/true |
grep ^AT_HWCAP |
grep -w $CAPABILITY_WORD 2>&1 > /dev
/null
34 if [ "$?" -eq "0" ]; then
35 #echo "found the capability"
37 elif [ "$?" -eq "2" ]; then
41 #echo "did not find the capability"