1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2018 Intel Corporation
5 #ifndef _EAL_PRIVATE_H_
6 #define _EAL_PRIVATE_H_
13 * Initialize the memzone subsystem (private to eal).
19 int rte_eal_memzone_init(void);
22 * Common log initialization function (private to eal). Determines
23 * where log data is written when no call to rte_openlog_stream is
27 * The default log stream to be used.
32 void eal_log_set_default(FILE *default_log);
35 * Fill configuration with number of physical and logical processors
37 * This function is private to EAL.
39 * Parse /proc/cpuinfo to get the number of physical and logical
40 * processors on the machine.
43 * 0 on success, negative on error
45 int rte_eal_cpu_init(void);
50 * This function is private to EAL.
52 * Fill configuration structure with these infos, and return 0 on success.
55 * 0 on success, negative on error
57 int rte_eal_memory_init(void);
62 * This function is private to EAL.
64 * Mmap memory areas used by HPET (high precision event timer) that will
65 * provide our time reference, and configure the TSC frequency also for it
66 * to be used as a reference.
69 * 0 on success, negative on error
71 int rte_eal_timer_init(void);
74 * Init the default log stream
76 * This function is private to EAL.
79 * 0 on success, negative on error
81 int rte_eal_log_init(const char *id, int facility);
84 * Init tail queues for non-EAL library structures. This is to allow
85 * the rings, mempools, etc. lists to be shared among multiple processes
87 * This function is private to EAL
90 * 0 on success, negative on error
92 int rte_eal_tailqs_init(void);
95 * Init interrupt handling.
97 * This function is private to EAL.
100 * 0 on success, negative on error
102 int rte_eal_intr_init(void);
105 * Init alarm mechanism. This is to allow a callback be called after
108 * This function is private to EAL.
111 * 0 on success, negative on error
113 int rte_eal_alarm_init(void);
116 * Function is to check if the kernel module(like, vfio, vfio_iommu_type1,
120 * The module's name which need to be checked
123 * -1 means some error happens(NULL pointer or open failure)
124 * 0 means the module not loaded
125 * 1 means the module loaded
127 int rte_eal_check_module(const char *module_name);
130 * Get virtual area of specified size from the OS.
132 * This function is private to the EAL.
134 * @param requested_addr
135 * Address where to request address space.
137 * Size of requested area.
139 * Page size on which to align requested virtual area.
141 * EAL_VIRTUAL_AREA_* flags.
143 * Extra flags passed directly to mmap().
146 * Virtual area address if successful.
147 * NULL if unsuccessful.
150 #define EAL_VIRTUAL_AREA_ADDR_IS_HINT (1 << 0)
151 /**< don't fail if cannot get exact requested address. */
152 #define EAL_VIRTUAL_AREA_ALLOW_SHRINK (1 << 1)
153 /**< try getting smaller sized (decrement by page size) virtual areas if cannot
154 * get area of requested size.
156 #define EAL_VIRTUAL_AREA_UNMAP (1 << 2)
157 /**< immediately unmap reserved virtual area. */
159 eal_get_virtual_area(void *requested_addr, size_t *size,
160 size_t page_sz, int flags, int mmap_flags);
165 * This function is private to the EAL.
167 unsigned eal_cpu_core_id(unsigned lcore_id);
170 * Check if cpu is present.
172 * This function is private to the EAL.
174 int eal_cpu_detected(unsigned lcore_id);
177 * Set TSC frequency from precise value or estimation
179 * This function is private to the EAL.
181 void set_tsc_freq(void);
184 * Get precise TSC frequency from system
186 * This function is private to the EAL.
188 uint64_t get_tsc_freq(void);
191 * Get TSC frequency if the architecture supports.
193 * This function is private to the EAL.
196 * The number of TSC cycles in one second.
197 * Returns zero if the architecture support is not available.
199 uint64_t get_tsc_freq_arch(void);
202 * Prepare physical memory mapping
203 * i.e. hugepages on Linux and
206 * This function is private to the EAL.
208 int rte_eal_hugepage_init(void);
211 * Creates memory mapping in secondary process
212 * i.e. hugepages on Linux and
215 * This function is private to the EAL.
217 int rte_eal_hugepage_attach(void);
220 * Find a bus capable of identifying a device.
223 * A device identifier (PCI address, virtual PMD name, ...).
226 * A valid bus handle if found.
227 * NULL if no bus is able to parse this device.
229 struct rte_bus *rte_bus_find_by_device_name(const char *str);
232 * Create the unix channel for primary/secondary communication.
239 int rte_mp_channel_init(void);
241 #endif /* _EAL_PRIVATE_H_ */