summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rwxr-xr-xsrc/vlib/physmem.c7
-rw-r--r--src/vlib/physmem.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vlib/physmem.c b/src/vlib/physmem.c
index 64920e1ebe2..a62309552f5 100755
--- a/src/vlib/physmem.c
+++ b/src/vlib/physmem.c
@@ -115,7 +115,12 @@ vlib_physmem_init (vlib_main_t * vm)
if (vpm->base_addr == 0)
vpm->base_addr = VLIB_PHYSMEM_DEFAULT_BASE_ADDDR;
- clib_pmalloc_init (vpm->pmalloc_main, vpm->base_addr, 0);
+ clib_pmalloc_init (vpm->pmalloc_main, vpm->base_addr, vpm->max_size);
+
+ /* update base_addr and max_size per actual allocation */
+ vpm->base_addr = (uword) vpm->pmalloc_main->base;
+ vpm->max_size = (uword) vpm->pmalloc_main->max_pages <<
+ vpm->pmalloc_main->def_log2_page_sz;
return error;
}
diff --git a/src/vlib/physmem.h b/src/vlib/physmem.h
index 7b7a3af3dfa..de79da51ad0 100644
--- a/src/vlib/physmem.h
+++ b/src/vlib/physmem.h
@@ -57,6 +57,7 @@ typedef struct
{
u32 flags;
uword base_addr;
+ uword max_size;
#define VLIB_PHYSMEM_MAIN_F_HAVE_PAGEMAP (1 << 0)
#define VLIB_PHYSMEM_MAIN_F_HAVE_IOMMU (1 << 1)
vlib_physmem_map_t *maps;