[Pdbg] [PATCH 03/14] libpdbg/target: add a release operation

Alistair Popple alistair at popple.id.au
Thu Apr 12 14:10:57 AEST 2018


On Monday, 9 April 2018 5:35:11 PM AEST Nicholas Piggin wrote:
> This will be used to release special wakeup.

Looks good, I've been meaning to add release as it's also needed for the FSI
backend. One comment below though.

> +void pdbg_target_release(void)
> +{
> +	struct dt_node *dn;
> +
> +	dt_for_each_node(dt_root, dn)

What order does this happen in? We need the release to happen depth first as a
child node should be released before its parent is.

- Alistair

> +		_target_release(dn);
> +}
> +
>  bool pdbg_target_is_class(struct pdbg_target *target, const char *class)
>  {
>  	if (!target || !target->class || !class)
> diff --git a/libpdbg/target.h b/libpdbg/target.h
> index 0a618e2..99a4d68 100644
> --- a/libpdbg/target.h
> +++ b/libpdbg/target.h
> @@ -43,6 +43,7 @@ struct pdbg_target {
>  	char *compatible;
>  	char *class;
>  	int (*probe)(struct pdbg_target *target);
> +	void (*release)(struct pdbg_target *target);
>  	int index;
>  	struct dt_node *dn;
>  	struct list_node class_link;
> 




More information about the Pdbg mailing list