aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/mem.h')
-rw-r--r--src/vppinfra/mem.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h
index 9d0aa0997fc..3ba20ad6d3e 100644
--- a/src/vppinfra/mem.h
+++ b/src/vppinfra/mem.h
@@ -113,6 +113,9 @@ typedef struct
/* memory maps */
clib_mem_vm_map_hdr_t *first_map, *last_map;
+
+ /* last error */
+ clib_error_t *error;
} clib_mem_main_t;
extern clib_mem_main_t clib_mem_main;
@@ -461,8 +464,7 @@ clib_mem_get_log2_default_hugepage_size ()
return clib_mem_main.log2_default_hugepage_sz;
}
-clib_error_t *clib_mem_create_fd (char *name, int *fdp);
-clib_error_t *clib_mem_create_hugetlb_fd (char *name, int *fdp);
+int clib_mem_vm_create_fd (clib_mem_page_sz_t log2_page_size, char *fmt, ...);
clib_error_t *clib_mem_vm_ext_alloc (clib_mem_vm_alloc_t * a);
void clib_mem_vm_ext_free (clib_mem_vm_alloc_t * a);
uword clib_mem_get_fd_page_size (int fd);
@@ -545,6 +547,12 @@ clib_mem_page_bytes (clib_mem_page_sz_t log2_page_size)
return 1 << clib_mem_log2_page_size_validate (log2_page_size);
}
+static_always_inline clib_error_t *
+clib_mem_get_last_error (void)
+{
+ return clib_mem_main.error;
+}
+
#include <vppinfra/error.h> /* clib_panic */