[Pdbg] [PATCH v3 06/13] sbefifo: Add sbefifo procedure to get ffdc data
Amitay Isaacs
amitay at ozlabs.org
Mon Jul 15 15:58:44 AEST 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/hwunit.h | 1 +
libpdbg/sbefifo.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h
index 0b0c62b..2d93443 100644
--- a/libpdbg/hwunit.h
+++ b/libpdbg/hwunit.h
@@ -70,6 +70,7 @@ 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 *);
int fd;
uint32_t status;
uint8_t *ffdc;
diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index 35c4e54..21907be 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -111,6 +111,14 @@ static void sbefifo_ffdc_set(struct sbefifo *sbefifo, uint8_t *buf, uint32_t buf
sbefifo->ffdc_len = buflen;
}
+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 int sbefifo_op(struct sbefifo *sbefifo,
uint32_t *msg, size_t msg_len, uint16_t cmd,
size_t out_len, uint8_t **out)
@@ -366,6 +374,7 @@ struct sbefifo kernel_sbefifo = {
.istep = sbefifo_op_istep,
.mem_read = sbefifo_op_getmem,
.mem_write = sbefifo_op_putmem,
+ .ffdc_get = sbefifo_ffdc_get,
.fd = -1,
};
DECLARE_HW_UNIT(kernel_sbefifo);
--
2.21.0
More information about the Pdbg
mailing list