[Pdbg] [PATCH v3 08/13] libpdbg/p9chip: update thread status on stop, start, sreset

Alistair Popple alistair at popple.id.au
Tue May 8 11:33:07 AEST 2018


On Wednesday, 2 May 2018 4:28:03 PM AEST Nicholas Piggin wrote:
> Update thread->status when we expect it to change. This becomes more
> important if we chain multiple operations together.

Looks good. Do you think we need to do something similar on P8?

- Alistair

> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> ---
>  libpdbg/p9chip.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
> index 3cc3dcb..3a68ea8 100644
> --- a/libpdbg/p9chip.c
> +++ b/libpdbg/p9chip.c
> @@ -127,6 +127,8 @@ static int p9_thread_start(struct thread *thread)
>  		thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(6 + 8*thread->id));
>  	}
>  
> +	thread->status = p9_get_thread_status(thread);
> +
>  	return 0;
>  }
>  
> @@ -142,6 +144,7 @@ static int p9_thread_stop(struct thread *thread)
>  			break;
>  		}
>  	}
> +	thread->status = p9_get_thread_status(thread);
>  
>  	return 0;
>  }
> @@ -149,11 +152,13 @@ static int p9_thread_stop(struct thread *thread)
>  static int p9_thread_sreset(struct thread *thread)
>  {
>  	/* Can only sreset if a thread is inactive */
> -	if (!(p9_get_thread_status(thread) & THREAD_STATUS_QUIESCE))
> +	if (!(thread->status & THREAD_STATUS_QUIESCE))
>  		return 1;
>  
>  	thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(4 + 8*thread->id));
>  
> +	thread->status = p9_get_thread_status(thread);
> +
>  	return 0;
>  }
>  
> 




More information about the Pdbg mailing list