summaryrefslogtreecommitdiffstats
path: root/libpdbg/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpdbg/target.c')
-rw-r--r--libpdbg/target.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libpdbg/target.c b/libpdbg/target.c
index c733dad..7642e18 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -37,22 +37,28 @@ int pib_read(struct target *pib_dt, uint64_t addr, uint64_t *data)
{
struct pib *pib;
struct dt_node *dn = pib_dt->dn;
+ int rc;
dn = get_class_target_addr(dn, "pib", &addr);
pib_dt = dn->target;
pib = target_to_pib(pib_dt);
- return pib->read(pib, addr, data);
+ rc = pib->read(pib, addr, data);
+// printf("pib_read 0x%016llx = 0x%016llx\n", addr, *data);
+ return rc;
}
int pib_write(struct target *pib_dt, uint64_t addr, uint64_t data)
{
struct pib *pib;
struct dt_node *dn = pib_dt->dn;
+ int rc;
dn = get_class_target_addr(dn, "pib", &addr);
pib_dt = dn->target;
pib = target_to_pib(pib_dt);
- return pib->write(pib, addr, data);
+ rc = pib->write(pib, addr, data);
+// printf("pib_write 0x%016llx = 0x%016llx\n", addr, data);
+ return rc;
}
int opb_read(struct target *opb_dt, uint32_t addr, uint32_t *data)
@@ -105,6 +111,14 @@ int fsi_write(struct target *fsi_dt, uint32_t addr, uint32_t data)
return fsi->write(fsi, addr64, data);
}
+struct target *require_target_parent(struct target *target)
+{
+ struct dt_node *dn;
+
+ assert((dn = target->dn));
+ return dn->parent->target;
+}
+
/* Finds the given class. Returns NULL if not found. */
struct target_class *find_target_class(const char *name)
{
OpenPOWER on IntegriCloud