This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: add tests for __ppc_set_ppr_* functions.
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: Wainer dos Santos Moschetta <wainersm at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Cc:
- Date: Wed, 28 Dec 2016 10:41:42 -0200
- Subject: Re: [PATCH] powerpc: add tests for __ppc_set_ppr_* functions.
- Authentication-results: sourceware.org; auth=none
- References: <20161222121300.28285-1-wainersm@linux.vnet.ibm.com>
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