[Pdbg] [PATCH v2 02/12] sbefifo: Add sbefifo procedure to get ffdc data
Amitay Isaacs
amitay at ozlabs.org
Thu Jul 4 18:05:15 AEST 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/hwunit.h | 2 ++
libpdbg/sbefifo.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h
index 0b0c62b..cc94c6d 100644
--- a/libpdbg/hwunit.h
+++ b/libpdbg/hwunit.h
@@ -70,6 +70,8 @@ struct sbefifo {
int (*istep)(struct sbefifo *, uint32_t major, uint32_t minor);
int (*mem_read)(struct sbefifo *, uint64_t, uint8_t *, uint64_t, bool);
int (*mem_write)(struct sbefifo *, uint64_t, uint8_t *, uint64_t, bool);
+ uint32_t (*ffdc_get)(struct sbefifo *, const uint8_t **, uint32_t *);
+ void (*ffdc_dump)(struct sbefifo *);
int fd;
uint32_t status;
uint8_t *ffdc;
diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index a23d0b4..c48af44 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -175,6 +175,14 @@ static int sbefifo_ffdc_dump_pkg(struct sbefifo *sbefifo, uint32_t offset)
return offset2 - offset;
}
+static uint32_t sbefifo_ffdc_get(struct sbefifo *sbefifo, const uint8_t **ffdc, uint32_t *ffdc_len)
+{
+ *ffdc = sbefifo->ffdc;
+ *ffdc_len = sbefifo->ffdc_len;
+
+ return sbefifo->status;
+}
+
static void sbefifo_ffdc_dump(struct sbefifo *sbefifo)
{
uint32_t offset = 0;
@@ -440,6 +448,8 @@ struct sbefifo kernel_sbefifo = {
.istep = sbefifo_op_istep,
.mem_read = sbefifo_op_getmem,
.mem_write = sbefifo_op_putmem,
+ .ffdc_get = sbefifo_ffdc_get,
+ .ffdc_dump = sbefifo_ffdc_dump,
.fd = -1,
};
DECLARE_HW_UNIT(kernel_sbefifo);
--
2.21.0
More information about the Pdbg
mailing list