1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Mellanox Technologies, Ltd
6 #include <rte_string_fns.h>
8 #include "eal_private.h"
9 #include "eal_memcfg.h"
11 /* early configuration structure, when memory config is not mmapped */
12 static struct rte_mem_config early_mem_config;
14 /* Address of global and public configuration */
15 static struct rte_config rte_config = {
16 .mem_config = &early_mem_config,
19 /* platform-specific runtime dir */
20 static char runtime_dir[PATH_MAX];
22 /* internal configuration */
23 static struct internal_config internal_config;
26 rte_eal_get_runtime_dir(void)
32 eal_set_runtime_dir(const char *run_dir)
34 if (strlcpy(runtime_dir, run_dir, PATH_MAX) >= PATH_MAX) {
35 RTE_LOG(ERR, EAL, "Runtime directory string too long\n");
42 /* Return a pointer to the configuration structure */
44 rte_eal_get_configuration(void)
49 /* Return a pointer to the internal configuration structure */
50 struct internal_config *
51 eal_get_internal_configuration(void)
53 return &internal_config;
57 rte_eal_iova_mode(void)
59 return rte_eal_get_configuration()->iova_mode;
62 /* Get the EAL base address */
64 rte_eal_get_baseaddr(void)
66 return (internal_config.base_virtaddr != 0) ?
67 (uint64_t) internal_config.base_virtaddr :
72 rte_eal_process_type(void)
74 return rte_config.process_type;
77 /* Return user provided mbuf pool ops name */
79 rte_eal_mbuf_user_pool_ops(void)
81 return internal_config.user_mbuf_pool_ops_name;
84 /* return non-zero if hugepages are enabled. */
86 rte_eal_has_hugepages(void)
88 return !internal_config.no_hugetlbfs;
94 return !internal_config.no_pci;