summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-11-07 16:55:18 +0100
committerDamjan Marion <dmarion@me.com>2018-11-08 16:09:21 +0000
commit6ec99c3147f3e8fd608973cd8f4a25c156bb1490 (patch)
treef3723b346b010cbc17c01c92742f74088c9b972a /src/vlib
parent7040075ef16ba6dd85b49905929caa4e8ac4194f (diff)
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 <sykazmi@cisco.com>
Diffstat (limited to 'src/vlib')
-rwxr-xr-xsrc/vlib/physmem.c12
1 files changed, 9 insertions, 3 deletions
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* */