This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 6/6] aarch64: Add hwcap string routines
On Jun 07 2017, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>> diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
>> index 7a60d72..cdb36d3 100644
>> --- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
>> +++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
> ...
>> +static inline int
>> +__attribute__ ((unused))
>> +_dl_procinfo (unsigned int type, unsigned long int word)
>> +{
>> + /* This table should match the information from arch/arm64/kernel/cpuinfo.c
>> + in the kernel sources. */
>> + int i;
>>
>> -/* There are no hardware capabilities defined. */
>> -#define _dl_hwcap_string(idx) ""
>> + /* Fallback to unknown output mechanism. */
>> + if (type == AT_HWCAP2)
>> + return -1;
>> +
>> + _dl_printf ("AT_HWCAP: ");
>> +
>> + for (i = 0; i < 32; ++i)
>> + if (word & (1 << i))
>> + _dl_printf (" %s", GLRO(dl_aarch64_cap_flags)[i]);
>> +
>
> 1<<31 is ub, use 1UL << i or something
Or (word >> i) & 1.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."