summaryrefslogtreecommitdiffstats
path: root/src/vlib/physmem.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-30 18:26:20 +0200
committerDamjan Marion <dmarion@me.com>2018-10-23 14:21:10 +0000
commit68b4da67deb2e8ca224bb5abaeb9dbc7ae8e378c (patch)
treecd1ee2c463aefdb31c73665eafb876568054f49e /src/vlib/physmem.h
parentfc3b8b8ad08d2d4cc375149ecdc10c37d4a80940 (diff)
Numa-aware, growable physical memory allocator (pmalloc)
Change-Id: Ic4c46bc733afae8bf0d8146623ed15633928de30 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/physmem.h')
-rw-r--r--src/vlib/physmem.h32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/vlib/physmem.h b/src/vlib/physmem.h
index 2f54938ff10..3e73a1b03f0 100644
--- a/src/vlib/physmem.h
+++ b/src/vlib/physmem.h
@@ -40,41 +40,27 @@
#ifndef included_vlib_physmem_h
#define included_vlib_physmem_h
-typedef u8 vlib_physmem_region_index_t;
+#include <vppinfra/pmalloc.h>
typedef struct
{
- vlib_physmem_region_index_t index;
- void *mem;
- uword size;
+ int index;
int fd;
- u8 log2_page_size;
- u16 n_pages;
- u32 page_mask;
-
- void *heap;
- u32 flags;
-#define VLIB_PHYSMEM_F_INIT_MHEAP (1 << 0)
-#define VLIB_PHYSMEM_F_HUGETLB (1 << 1)
-#define VLIB_PHYSMEM_F_SHARED (1 << 2)
-
- u8 numa_node;
- u64 *page_table;
- u8 *name;
-} vlib_physmem_region_t;
-
-
+ void *base;
+ u32 n_pages;
+ uword *page_table;
+ u32 log2_page_size;
+} vlib_physmem_map_t;
typedef struct
{
u32 flags;
#define VLIB_PHYSMEM_MAIN_F_HAVE_PAGEMAP (1 << 0)
#define VLIB_PHYSMEM_MAIN_F_HAVE_IOMMU (1 << 1)
- vlib_physmem_region_t *regions;
+ vlib_physmem_map_t *maps;
+ clib_pmalloc_main_t *pmalloc_main;
} vlib_physmem_main_t;
-extern vlib_physmem_main_t physmem_main;
-
#endif /* included_vlib_physmem_h */
/*