[Pdbg] [PATCH v3 05/13] libpdbg/p9chip.c: query thread active and stop states

Nicholas Piggin npiggin at gmail.com
Tue May 8 11:21:58 AEST 2018


On Tue, 08 May 2018 10:21:01 +1000
Alistair Popple <alistair at popple.id.au> wrote:

> > diff --git a/src/htm.c b/src/htm.c
> > index 566687e..a7e7d06 100644
> > --- a/src/htm.c
> > +++ b/src/htm.c
> > @@ -322,6 +322,8 @@ int run_htm(int optind, int argc, char *argv[])
> >  		 * This is as easy as checking that every single
> >  		 * thread is "ACTIVE" and hasn't gone into any sleep
> >  		 * state.
> > +		 *
> > +		 * On P9 it requires checking for THREAD_STATUS_STOP
> >  		 */  
> 
> Generally the aim of the interfaces in libpdbg (vs. src/*) is to hide any system
> specific details such as P8 vs. P9. However the thread interfaces are already a
> pretty leaky abstraction so this is fine for now until we come up with something
> better.

Yeah you're right...

I would say we can probably add equivalent idle state checks for P8, and
so avoid this problem here. That is, define a generic mask for all
idle/stop/nap/sleep/etc states used by any of the targets, and then
check those here.

Alternatively perhaps a call back to the target code to query whether htm
can be used would be the best way to go.

Thanks,
Nick


More information about the Pdbg mailing list