[PATCH] powerpc: add tests for __ppc_set_ppr_* functions.
Tulio Magno Quites Machado Filho
tuliom@linux.vnet.ibm.com
Wed Dec 28 12:42:00 GMT 2016
Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com> writes:
> sys/platform/ppc.h defines a class of __ppc_set_ppr functions
> used to set the Program Priority Register (PPR) in powerpc.
> This patch implements test cases for these functions.
>
> Tested on ppc64le.
LGTM in overall, but....
> +/* Read the value of the Program Priority Register (PPR). */
> +static __inline__ uint64_t
> +read_ppr (void)
> +{
> + /* Represents the full 64-bits length register. */
> + uint64_t ppr;
> + asm volatile ("mfppr %0" : "=r"(ppr));
This won't work on 32 bits. You have to use mfppr32.
> + return ppr;
> +}
> +
> +/* Check the thread priority bits of PPR are set as expected. */
> +uint8_t
> +check_thread_priority (uint8_t expected, uint64_t ppr)
> +{
> + /* The thread priority value is set on bits 11:13. */
> + uint64_t p = ((ppr >> 50) & 7);
This also needs to be changed.
--
Tulio Magno
More information about the Libc-alpha
mailing list