summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/cpu.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-10-28 13:47:57 +0100
committerTom Rini <trini@konsulko.com>2024-11-03 21:27:12 -0600
commit5400c4bc0528b1f2bebd97de1deed62cbd65039b (patch)
tree41c5bd417f61cfa78a0667e2b10491901cc9a92d /arch/sandbox/cpu/cpu.c
parentec6d30649cd5026acf64301cca3d1721c16e69e7 (diff)
sandbox: Add a way to show the sandbox memory-mapping
This is mostly hidden in the background, but it is sometimes useful to look at it. Add a function to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/cpu.c')
-rw-r--r--arch/sandbox/cpu/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 06f8c13fab9..d1c4dcf0764 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -253,6 +253,19 @@ phys_addr_t map_to_sysmem(const void *ptr)
return mentry->tag;
}
+void sandbox_map_list(void)
+{
+ struct sandbox_mapmem_entry *mentry;
+ struct sandbox_state *state = state_get_current();
+
+ printf("Sandbox memory-mapping\n");
+ printf("%8s %16s %6s\n", "Addr", "Mapping", "Refcnt");
+ list_for_each_entry(mentry, &state->mapmem_head, sibling_node) {
+ printf("%8lx %p %6d\n", mentry->tag, mentry->ptr,
+ mentry->refcnt);
+ }
+}
+
unsigned long sandbox_read(const void *addr, enum sandboxio_size_t size)
{
struct sandbox_state *state = state_get_current();