diff options
Diffstat (limited to 'src/broadcom/clif')
-rw-r--r-- | src/broadcom/clif/clif_dump.c | 20 | ||||
-rw-r--r-- | src/broadcom/clif/clif_private.h | 3 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c index f297c774b5a..3b693284e49 100644 --- a/src/broadcom/clif/clif_dump.c +++ b/src/broadcom/clif/clif_dump.c @@ -70,20 +70,30 @@ clif_dump_destroy(struct clif_dump *clif) ralloc_free(clif); } -static bool -clif_lookup_vaddr(struct clif_dump *clif, uint32_t addr, void **vaddr) +struct clif_bo * +clif_lookup_bo(struct clif_dump *clif, uint32_t addr) { for (int i = 0; i < clif->bo_count; i++) { struct clif_bo *bo = &clif->bo[i]; if (addr >= bo->offset && addr < bo->offset + bo->size) { - *vaddr = bo->vaddr + addr - bo->offset; - return true; + return bo; } } - return false; + return NULL; +} + +static bool +clif_lookup_vaddr(struct clif_dump *clif, uint32_t addr, void **vaddr) +{ + struct clif_bo *bo = clif_lookup_bo(clif, addr); + if (!bo) + return false; + + *vaddr = bo->vaddr + addr - bo->offset; + return true; } #define out_uint(_clif, field) out(_clif, " /* %s = */ %u\n", \ diff --git a/src/broadcom/clif/clif_private.h b/src/broadcom/clif/clif_private.h index da5f2a3cc29..ea96784289a 100644 --- a/src/broadcom/clif/clif_private.h +++ b/src/broadcom/clif/clif_private.h @@ -74,6 +74,9 @@ struct reloc_worklist_entry { }; }; +struct clif_bo * +clif_lookup_bo(struct clif_dump *clif, uint32_t addr); + struct reloc_worklist_entry * clif_dump_add_address_to_worklist(struct clif_dump *clif, enum reloc_worklist_type type, |