Message ID | 20191003041909.23187-8-amitay@ozlabs.org |
---|---|
State | Accepted |
Headers | show |
Series | Add system device tree to libpdbg | expand |
Nice. Now I feel like I know what a virtual target is :-) Reviewed-by: Alistair Popple <alistair@popple.id.au> On Thursday, 3 October 2019 2:18:46 PM AEDT Amitay Isaacs wrote: > All targets without "compatible" property are treated as virtual targets. > > Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> > --- > libpdbg/target.c | 6 ++++++ > libpdbg/target.h | 1 + > 2 files changed, 7 insertions(+) > > diff --git a/libpdbg/target.c b/libpdbg/target.c > index f803ab2..9110b81 100644 > --- a/libpdbg/target.c > +++ b/libpdbg/target.c > @@ -467,3 +467,9 @@ void pdbg_target_priv_set(struct pdbg_target *target, void *priv) > { > target->priv = priv; > } > + > +/* For virtual nodes, compatible property is not set */ > +bool target_is_virtual(struct pdbg_target *target) > +{ > + return (!target->compatible); > +} > diff --git a/libpdbg/target.h b/libpdbg/target.h > index 71ffd2f..f5769ea 100644 > --- a/libpdbg/target.h > +++ b/libpdbg/target.h > @@ -64,5 +64,6 @@ extern struct list_head target_classes; > const char *pdbg_get_backend_option(void); > > struct sbefifo *pib_to_sbefifo(struct pdbg_target *target); > +bool target_is_virtual(struct pdbg_target *target); > > #endif >
diff --git a/libpdbg/target.c b/libpdbg/target.c index f803ab2..9110b81 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -467,3 +467,9 @@ void pdbg_target_priv_set(struct pdbg_target *target, void *priv) { target->priv = priv; } + +/* For virtual nodes, compatible property is not set */ +bool target_is_virtual(struct pdbg_target *target) +{ + return (!target->compatible); +} diff --git a/libpdbg/target.h b/libpdbg/target.h index 71ffd2f..f5769ea 100644 --- a/libpdbg/target.h +++ b/libpdbg/target.h @@ -64,5 +64,6 @@ extern struct list_head target_classes; const char *pdbg_get_backend_option(void); struct sbefifo *pib_to_sbefifo(struct pdbg_target *target); +bool target_is_virtual(struct pdbg_target *target); #endif
All targets without "compatible" property are treated as virtual targets. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> --- libpdbg/target.c | 6 ++++++ libpdbg/target.h | 1 + 2 files changed, 7 insertions(+)