static void *next_baseaddr;
static uint64_t system_page_sz;
-#ifdef RTE_ARCH_64
-/*
- * Linux kernel uses a really high address as starting address for serving
- * mmaps calls. If there exists addressing limitations and IOVA mode is VA,
- * this starting address is likely too high for those devices. However, it
- * is possible to use a lower address in the process virtual address space
- * as with 64 bits there is a lot of available space.
- *
- * Current known limitations are 39 or 40 bits. Setting the starting address
- * at 4GB implies there are 508GB or 1020GB for mapping the available
- * hugepages. This is likely enough for most systems, although a device with
- * addressing limitations should call rte_mem_check_dma_mask for ensuring all
- * memory is within supported range.
- */
-static uint64_t baseaddr = 0x100000000;
-#endif
-
#define MAX_MMAP_WITH_DEFINED_ADDR_TRIES 5
void *
eal_get_virtual_area(void *requested_addr, size_t *size,
#ifdef RTE_ARCH_64
if (next_baseaddr == NULL && internal_config.base_virtaddr == 0 &&
rte_eal_process_type() == RTE_PROC_PRIMARY)
- next_baseaddr = (void *) baseaddr;
+ next_baseaddr = (void *) eal_get_baseaddr();
#endif
if (requested_addr == NULL && next_baseaddr != NULL) {
requested_addr = next_baseaddr;
#define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE))
+uint64_t eal_get_baseaddr(void)
+{
+ /*
+ * FreeBSD may allocate something in the space we will be mapping things
+ * before we get a chance to do that, so use a base address that's far
+ * away from where malloc() et al usually map things.
+ */
+ return 0x1000000000ULL;
+}
+
/*
* Get physical address of any mapped virtual address in the current process.
*/
#define RANDOMIZE_VA_SPACE_FILE "/proc/sys/kernel/randomize_va_space"
+uint64_t eal_get_baseaddr(void)
+{
+ /*
+ * Linux kernel uses a really high address as starting address for
+ * serving mmaps calls. If there exists addressing limitations and IOVA
+ * mode is VA, this starting address is likely too high for those
+ * devices. However, it is possible to use a lower address in the
+ * process virtual address space as with 64 bits there is a lot of
+ * available space.
+ *
+ * Current known limitations are 39 or 40 bits. Setting the starting
+ * address at 4GB implies there are 508GB or 1020GB for mapping the
+ * available hugepages. This is likely enough for most systems, although
+ * a device with addressing limitations should call
+ * rte_mem_check_dma_mask for ensuring all memory is within supported
+ * range.
+ */
+ return 0x100000000ULL;
+}
+
/*
* Get physical address of any mapped virtual address in the current process.
*/