[PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
Carlos Eduardo Seo
cseo@linux.vnet.ibm.com
Tue Jun 9 15:22:00 GMT 2015
On 06/09/2015 11:22 AM, Adhemerval Zanella wrote:
>
>> @@ -203,6 +214,32 @@ register void *__thread_register __asm__
>> # define THREAD_SET_TM_CAPABLE(value) \
>> (THREAD_GET_TM_CAPABLE () = (value))
>>
>> +/* hwcap & hwcap2 fields in TCB head. */
>> +# define THREAD_GET_HWCAP() \
>> + (((tcbhead_t *) ((char *) __thread_register \
>> + - TLS_TCB_OFFSET))[-1].hwcap)
>> +# define THREAD_SET_HWCAP(value) \
>> + if (value & PPC_FEATURE_ARCH_2_06) \
>> + value |= PPC_FEATURE_ARCH_2_05 | \
>> + PPC_FEATURE_POWER5_PLUS | \
>> + PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_ARCH_2_05) \
>> + value |= PPC_FEATURE_POWER5_PLUS | \
>> + PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_POWER5_PLUS) \
>> + value |= PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_POWER5) \
>> + value |= PPC_FEATURE_POWER4; \
>
> This very logic is already presented at other powerpc32 sysdep file [1].
> Instead of duplicate the logic, I think it is better to move it in a common
> file.
>
> [1] sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
>
So, do you suggest a cleanup patch first to move this to a common file, then a rewrite of this patch on top of that? If so, in which header should I put that?
Thanks,
Carlos Eduardo Seo
Software Engineer - Linux on Power Toolchain
cseo@linux.vnet.ibm.com
More information about the Libc-alpha
mailing list