1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Mellanox Technologies, Ltd
5 #include <rte_string_fns.h>
7 #include "eal_private.h"
8 #include "eal_memcfg.h"
10 /* early configuration structure, when memory config is not mmapped */
11 static struct rte_mem_config early_mem_config;
13 /* Address of global and public configuration */
14 static struct rte_config rte_config = {
15 .mem_config = &early_mem_config,
18 /* platform-specific runtime dir */
19 static char runtime_dir[PATH_MAX];
21 /* internal configuration */
22 static struct internal_config internal_config;
25 rte_eal_get_runtime_dir(void)
31 eal_set_runtime_dir(const char *run_dir)
33 if (strlcpy(runtime_dir, run_dir, PATH_MAX) >= PATH_MAX) {
34 RTE_LOG(ERR, EAL, "Runtime directory string too long\n");
41 /* Return a pointer to the configuration structure */
43 rte_eal_get_configuration(void)
48 /* Return a pointer to the internal configuration structure */
49 struct internal_config *
50 eal_get_internal_configuration(void)
52 return &internal_config;
56 rte_eal_iova_mode(void)
58 return rte_eal_get_configuration()->iova_mode;
61 /* Get the EAL base address */
63 rte_eal_get_baseaddr(void)
65 return (internal_config.base_virtaddr != 0) ?
66 (uint64_t) internal_config.base_virtaddr :
71 rte_eal_process_type(void)
73 return rte_config.process_type;
76 /* Return user provided mbuf pool ops name */
78 rte_eal_mbuf_user_pool_ops(void)
80 return internal_config.user_mbuf_pool_ops_name;
83 /* return non-zero if hugepages are enabled. */
85 rte_eal_has_hugepages(void)
87 return !internal_config.no_hugetlbfs;
93 return !internal_config.no_pci;