summaryrefslogtreecommitdiffstats
path: root/libpdbg/device.c
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2018-10-25 16:42:15 +1100
committerAlistair Popple <alistair@popple.id.au>2018-11-09 11:27:54 +1100
commitcf249e7912069d6fece97e575ce3bae7365f8677 (patch)
tree407cc9ab8ec550ba4090eb1b7b58d0232fb5ce9c /libpdbg/device.c
parent82bd8aefa25318c03a269f6863142525010260e4 (diff)
downloadpdbg-cf249e7912069d6fece97e575ce3bae7365f8677.tar.gz
pdbg-cf249e7912069d6fece97e575ce3bae7365f8677.zip
libpdbg: Make dt_root private
Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Amitay Isaacs <amitay@ozlabs.org>
Diffstat (limited to 'libpdbg/device.c')
-rw-r--r--libpdbg/device.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libpdbg/device.c b/libpdbg/device.c
index 7e8af35..4a9d39a 100644
--- a/libpdbg/device.c
+++ b/libpdbg/device.c
@@ -36,7 +36,7 @@
/* Used to give unique handles. */
static u32 last_phandle = 0;
-struct pdbg_target *dt_root;
+static struct pdbg_target *pdbg_dt_root;
/*
* An in-memory representation of a node in the device tree.
@@ -591,7 +591,7 @@ static void dt_expand(const void *fdt)
{
PR_DEBUG("FDT: Parsing fdt @%p\n", fdt);
- if (dt_expand_node(dt_root, fdt, 0) < 0)
+ if (dt_expand_node(pdbg_dt_root, fdt, 0) < 0)
abort();
}
@@ -637,7 +637,7 @@ uint64_t pdbg_target_address(struct pdbg_target *target, uint64_t *out_size)
void pdbg_targets_init(void *fdt)
{
- dt_root = dt_new_node("", NULL, 0);
+ pdbg_dt_root = dt_new_node("", NULL, 0);
dt_expand(fdt);
}
@@ -649,7 +649,12 @@ char *pdbg_target_path(const struct pdbg_target *target)
struct pdbg_target *pdbg_target_from_path(struct pdbg_target *target, const char *path)
{
if (!target)
- target = dt_root;
+ target = pdbg_dt_root;
return dt_find_by_path(target, path);
}
+
+struct pdbg_target *pdbg_target_root(void)
+{
+ return pdbg_dt_root;
+}
OpenPOWER on IntegriCloud