From 6ec99c3147f3e8fd608973cd8f4a25c156bb1490 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Wed, 7 Nov 2018 16:55:18 +0100 Subject: physmem: Add physmem map support This patch adds support for mapping the virtual address to physical address and size of memory allocated. Change-Id: I7659a1881308e89b215c486fecd7c973076d0773 Signed-off-by: Mohsin Kazmi --- src/vlib/physmem.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/vlib') diff --git a/src/vlib/physmem.c b/src/vlib/physmem.c index f881e0a8e71..37bf693f182 100755 --- a/src/vlib/physmem.c +++ b/src/vlib/physmem.c @@ -112,7 +112,7 @@ show_physmem (vlib_main_t * vm, { vlib_physmem_main_t *vpm = &vm->physmem_main; unformat_input_t _line_input, *line_input = &_line_input; - u32 verbose = 0; + u32 verbose = 0, map = 0; if (unformat_user (input, unformat_line_input, line_input)) { @@ -126,20 +126,26 @@ show_physmem (vlib_main_t * vm, verbose = 2; else if (unformat (line_input, "d")) verbose = 2; + else if (unformat (line_input, "map")) + map = 1; else break; } unformat_free (line_input); } - vlib_cli_output (vm, " %U", format_pmalloc, vpm->pmalloc_main, verbose); + if (map) + vlib_cli_output (vm, " %U", format_pmalloc_map, vpm->pmalloc_main); + else + vlib_cli_output (vm, " %U", format_pmalloc, vpm->pmalloc_main, verbose); + return 0; } /* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_physmem_command, static) = { .path = "show physmem", - .short_help = "Show physical memory allocation", + .short_help = "show physmem [verbose | detail | map]", .function = show_physmem, }; /* *INDENT-ON* */ -- cgit 1.2.3-korg