[Pdbg] [PATCH v4 15/19] libpdbg: Remove special case thread procedures using sbefifo
Alistair Popple
alistair at popple.id.au
Thu Apr 30 11:29:01 AEST 2020
Reviewed-by: Alistair Popple <alistair at popple.id.au>
On Tuesday, 21 April 2020 2:16:51 PM AEST Amitay Isaacs wrote:
> Always check if the all thread procedures are provided by pib. If not,
> use individual thread operations.
>
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
> libpdbg/chip.c | 60 +++++++++++++++++---------------------------------
> 1 file changed, 20 insertions(+), 40 deletions(-)
>
> diff --git a/libpdbg/chip.c b/libpdbg/chip.c
> index 848a831..86e91bd 100644
> --- a/libpdbg/chip.c
> +++ b/libpdbg/chip.c
> @@ -156,21 +156,16 @@ int thread_sreset(struct pdbg_target *thread_target)
>
> int thread_step_all(void)
> {
> - struct pdbg_target *pib, *thread;
> + struct pdbg_target *target, *thread;
> int rc = 0, count = 0;
>
> - pdbg_for_each_class_target("pib", pib) {
> - struct chipop *chipop;
> + pdbg_for_each_class_target("pib", target) {
> + struct pib *pib = target_to_pib(target);
>
> - chipop = pib_to_chipop(pib);
> - if (!chipop)
> + if (!pib->thread_step_all)
> break;
>
> - /*
> - * core_id = 0xff (all SMT4 cores)
> - * thread_id = 0xf (all 4 threads in the SMT4 core)
> - */
> - rc |= chipop->thread_step(chipop, 0xff, 0xf);
> + rc |= pib->thread_step_all(pib, 1);
> count++;
> }
>
> @@ -189,21 +184,16 @@ int thread_step_all(void)
>
> int thread_start_all(void)
> {
> - struct pdbg_target *pib, *thread;
> + struct pdbg_target *target, *thread;
> int rc = 0, count = 0;
>
> - pdbg_for_each_class_target("pib", pib) {
> - struct chipop *chipop;
> + pdbg_for_each_class_target("pib", target) {
> + struct pib *pib = target_to_pib(target);
>
> - chipop = pib_to_chipop(pib);
> - if (!chipop)
> + if (!pib->thread_start_all)
> break;
>
> - /*
> - * core_id = 0xff (all SMT4 cores)
> - * thread_id = 0xf (all 4 threads in the SMT4 core)
> - */
> - rc |= chipop->thread_start(chipop, 0xff, 0xf);
> + rc |= pib->thread_start_all(pib);
> count++;
> }
>
> @@ -222,21 +212,16 @@ int thread_start_all(void)
>
> int thread_stop_all(void)
> {
> - struct pdbg_target *pib, *thread;
> + struct pdbg_target *target, *thread;
> int rc = 0, count = 0;
>
> - pdbg_for_each_class_target("pib", pib) {
> - struct chipop *chipop;
> + pdbg_for_each_class_target("pib", target) {
> + struct pib *pib = target_to_pib(target);
>
> - chipop = pib_to_chipop(pib);
> - if (!chipop)
> + if (!pib->thread_stop_all)
> break;
>
> - /*
> - * core_id = 0xff (all SMT4 cores)
> - * thread_id = 0xf (all 4 threads in the SMT4 core)
> - */
> - rc |= chipop->thread_stop(chipop, 0xff, 0xf);
> + rc |= pib->thread_stop_all(pib);
> count++;
> }
>
> @@ -255,21 +240,16 @@ int thread_stop_all(void)
>
> int thread_sreset_all(void)
> {
> - struct pdbg_target *pib, *thread;
> + struct pdbg_target *target, *thread;
> int rc = 0, count = 0;
>
> - pdbg_for_each_class_target("pib", pib) {
> - struct chipop *chipop;
> + pdbg_for_each_class_target("pib", target) {
> + struct pib *pib = target_to_pib(target);
>
> - chipop = pib_to_chipop(pib);
> - if (!chipop)
> + if (!pib->thread_sreset_all)
> break;
>
> - /*
> - * core_id = 0xff (all SMT4 cores)
> - * thread_id = 0xf (all 4 threads in the SMT4 core)
> - */
> - rc |= chipop->thread_sreset(chipop, 0xff, 0xf);
> + rc |= pib->thread_sreset_all(pib);
> count++;
> }
More information about the Pdbg
mailing list