This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] powerpc: add tests for __ppc_set_ppr_* functions.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]