qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to


From: David Gibson
Subject: Re: [PATCH 26/27] target/ppc: cpu_init: Move check_pow and QOM macros to a header
Date: Thu, 17 Feb 2022 10:32:00 +1100

On Wed, Feb 16, 2022 at 10:06:26AM -0300, Fabiano Rosas wrote:
> David Gibson <david@gibson.dropbear.id.au> writes:
> 
> > On Tue, Feb 15, 2022 at 06:41:47PM -0300, Fabiano Rosas wrote:
> >> These will need to be accessed from other files once we move the CPUs
> >> code to separate files.
> >> 
> >> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
> >> ---
> >>  target/ppc/cpu.h      | 57 +++++++++++++++++++++++++++++++++++++++++++
> >>  target/ppc/cpu_init.c | 55 -----------------------------------------
> >>  2 files changed, 57 insertions(+), 55 deletions(-)
> >> 
> >> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> >> index 6a06a7f533..ba0739c43b 100644
> >> --- a/target/ppc/cpu.h
> >> +++ b/target/ppc/cpu.h
> >> @@ -2733,4 +2733,61 @@ void dump_mmu(CPUPPCState *env);
> >>  void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int 
> >> len);
> >>  void ppc_store_vscr(CPUPPCState *env, uint32_t vscr);
> >>  uint32_t ppc_get_vscr(CPUPPCState *env);
> >> +
> >> +/*****************************************************************************/
> >> +/* Power management enable checks                                         
> >>    */
> >> +static inline int check_pow_none(CPUPPCState *env)
> >> +{
> >> +    return 0;
> >> +}
> >> +
> >> +static inline int check_pow_nocheck(CPUPPCState *env)
> >> +{
> >> +    return 1;
> >> +}
> >> +
> >> +static inline int check_pow_hid0(CPUPPCState *env)
> >
> > I'm a little nervous about moving this to a more exposed location.  By
> > definition the HID register is implementation dependent, and we can
> > see immediately below that not all things use the same interpretation
> > of it in practice.  So at the very least it seems like it has a bad
> > name to be exposed more widely.  It also seems like it might better
> > belong next to the code for the cpus that actually use this version.
> 
> Good point. Since these are quite simple it might be best to duplicate
> them when doing the split between the families. I'm doing the same for
> vscr_init.

Right, that sounds like a good idea to me.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]