[Pdbg] [PATCH v3 07/13] libpdbg: Add api to get ffdc data from sbefifo
Amitay Isaacs
amitay at ozlabs.org
Mon Jul 15 15:58:45 AEST 2019
Refactor common code to find sbefifo from pib target.
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/libpdbg.h | 1 +
libpdbg/target.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index 63b7a0f..ac1b428 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -239,6 +239,7 @@ int opb_read(struct pdbg_target *target, uint32_t addr, uint32_t *data);
int opb_write(struct pdbg_target *target, uint32_t addr, uint32_t data);
int sbe_istep(struct pdbg_target *target, uint32_t major, uint32_t minor);
+uint32_t sbe_ffdc_get(struct pdbg_target *target, const uint8_t **ffdc, uint32_t *ffdc_len);
typedef void (*pdbg_progress_tick_t)(uint64_t cur, uint64_t end);
diff --git a/libpdbg/target.c b/libpdbg/target.c
index f937bdf..0e9cc9a 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -303,6 +303,17 @@ int sbe_istep(struct pdbg_target *target, uint32_t major, uint32_t minor)
return sbefifo->istep(sbefifo, major, minor);
}
+uint32_t sbe_ffdc_get(struct pdbg_target *target, const uint8_t **ffdc, uint32_t *ffdc_len)
+{
+ struct sbefifo *sbefifo;
+
+ sbefifo = pib_to_sbefifo(target);
+ if (!sbefifo)
+ return -1;
+
+ return sbefifo->ffdc_get(sbefifo, ffdc, ffdc_len);
+}
+
struct pdbg_target *require_target_parent(struct pdbg_target *target)
{
assert(target->parent);
--
2.21.0
More information about the Pdbg
mailing list