[2/5] adu: Add read/write methods for adu target

Message ID 20190107043020.145107-3-amitay@ozlabs.org
State New
Headers show
Series
  • Introduce new api mem_read/mem_write
Related show

Checks

Context Check Description
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Amitay Isaacs Jan. 7, 2019, 4:30 a.m.
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/adu.c    | 4 ++++
 libpdbg/target.h | 2 ++
 2 files changed, 6 insertions(+)

Patch

diff --git a/libpdbg/adu.c b/libpdbg/adu.c
index b2e80ee..bc01625 100644
--- a/libpdbg/adu.c
+++ b/libpdbg/adu.c
@@ -570,6 +570,8 @@  static struct adu p8_adu = {
 	},
 	.getmem = p8_adu_getmem,
 	.putmem = p8_adu_putmem,
+	.read = adu_read,
+	.write = adu_write,
 };
 DECLARE_HW_UNIT(p8_adu);
 
@@ -581,5 +583,7 @@  static struct adu p9_adu = {
 	},
 	.getmem = p9_adu_getmem,
 	.putmem = p9_adu_putmem,
+	.read = adu_read,
+	.write = adu_write,
 };
 DECLARE_HW_UNIT(p9_adu);
diff --git a/libpdbg/target.h b/libpdbg/target.h
index 16ae304..eb8d564 100644
--- a/libpdbg/target.h
+++ b/libpdbg/target.h
@@ -109,6 +109,8 @@  struct adu {
 	struct pdbg_target target;
 	int (*getmem)(struct adu *, uint64_t, uint64_t *, int, uint8_t);
 	int (*putmem)(struct adu *, uint64_t, uint64_t, int, int, uint8_t);
+	int (*read)(struct adu *, uint64_t, uint8_t *, uint64_t, uint8_t, bool);
+	int (*write)(struct adu *, uint64_t, uint8_t *, uint64_t, uint8_t, bool);
 };
 #define target_to_adu(x) container_of(x, struct adu, target)