diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h index c3edce938..43330215d 100644 --- a/libpdbg/hwunit.h +++ b/libpdbg/hwunit.h @@ -88,7 +88,7 @@ struct chipop { struct chipop_ody { struct pdbg_target target; - uint32_t (*ffdc_get)(struct pdbg_target *, const uint8_t **, uint32_t *); + uint32_t (*ffdc_get)(struct chipop_ody*, struct pdbg_target*, const uint8_t **, uint32_t *); int (*dump)(struct chipop_ody *, uint8_t, uint8_t, uint8_t, uint8_t **, uint32_t *); }; #define target_to_chipop_ody(x) container_of(x, struct chipop_ody, target) diff --git a/libpdbg/sbe_api.c b/libpdbg/sbe_api.c index 21e1d5be2..736b4e6a6 100644 --- a/libpdbg/sbe_api.c +++ b/libpdbg/sbe_api.c @@ -254,7 +254,9 @@ int sbe_ffdc_get(struct pdbg_target *target, uint32_t *status, uint8_t **ffdc, return -1; } - *status = chipop->ffdc_get(target, &data, &len); + struct pdbg_target *fsi = get_ody_fsi_target(target); + + *status = chipop->ffdc_get(chipop, fsi, &data, &len); if (data && len > 0) { *ffdc = malloc(len); assert(*ffdc); diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c index b2d42958e..840fffcbd 100644 --- a/libpdbg/sbefifo.c +++ b/libpdbg/sbefifo.c @@ -197,11 +197,11 @@ static uint32_t sbefifo_op_ffdc_get(struct chipop *chipop, const uint8_t **ffdc, } -static uint32_t sbefifo_op_ody_ffdc_get(struct pdbg_target *ocmb, const uint8_t **ffdc, uint32_t *ffdc_len) +static uint32_t sbefifo_op_ody_ffdc_get(struct chipop_ody *chipop, struct pdbg_target *fsi, + const uint8_t **ffdc, uint32_t *ffdc_len) { - struct pdbg_target *fsi = get_ody_fsi_target(ocmb); - struct sbefifo *sbefifo = target_to_sbefifo(ocmb); - + struct sbefifo *sbefifo = target_to_sbefifo(chipop->target.parent); + struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo); uint32_t status, value = 0; int rc;