4 * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _EAL_PRIVATE_H_
35 #define _EAL_PRIVATE_H_
42 * Initialize the memzone subsystem (private to eal).
48 int rte_eal_memzone_init(void);
51 * Common log initialization function (private to eal). Determines
52 * where log data is written when no call to rte_openlog_stream is
56 * The default log stream to be used.
61 void eal_log_set_default(FILE *default_log);
64 * Fill configuration with number of physical and logical processors
66 * This function is private to EAL.
68 * Parse /proc/cpuinfo to get the number of physical and logical
69 * processors on the machine.
72 * 0 on success, negative on error
74 int rte_eal_cpu_init(void);
79 * This function is private to EAL.
81 * Fill configuration structure with these infos, and return 0 on success.
84 * 0 on success, negative on error
86 int rte_eal_memory_init(void);
91 * This function is private to EAL.
93 * Mmap memory areas used by HPET (high precision event timer) that will
94 * provide our time reference, and configure the TSC frequency also for it
95 * to be used as a reference.
98 * 0 on success, negative on error
100 int rte_eal_timer_init(void);
103 * Init the default log stream
105 * This function is private to EAL.
108 * 0 on success, negative on error
110 int rte_eal_log_init(const char *id, int facility);
113 * Init tail queues for non-EAL library structures. This is to allow
114 * the rings, mempools, etc. lists to be shared among multiple processes
116 * This function is private to EAL
119 * 0 on success, negative on error
121 int rte_eal_tailqs_init(void);
124 * Init interrupt handling.
126 * This function is private to EAL.
129 * 0 on success, negative on error
131 int rte_eal_intr_init(void);
134 * Init alarm mechanism. This is to allow a callback be called after
137 * This function is private to EAL.
140 * 0 on success, negative on error
142 int rte_eal_alarm_init(void);
145 * Function is to check if the kernel module(like, vfio, vfio_iommu_type1,
149 * The module's name which need to be checked
152 * -1 means some error happens(NULL pointer or open failure)
153 * 0 means the module not loaded
154 * 1 means the module loaded
156 int rte_eal_check_module(const char *module_name);
161 * This function is private to the EAL.
163 unsigned eal_cpu_core_id(unsigned lcore_id);
166 * Check if cpu is present.
168 * This function is private to the EAL.
170 int eal_cpu_detected(unsigned lcore_id);
173 * Set TSC frequency from precise value or estimation
175 * This function is private to the EAL.
177 void set_tsc_freq(void);
180 * Get precise TSC frequency from system
182 * This function is private to the EAL.
184 uint64_t get_tsc_freq(void);
187 * Get TSC frequency if the architecture supports.
189 * This function is private to the EAL.
192 * The number of TSC cycles in one second.
193 * Returns zero if the architecture support is not available.
195 uint64_t get_tsc_freq_arch(void);
198 * Prepare physical memory mapping
199 * i.e. hugepages on Linux and
202 * This function is private to the EAL.
204 int rte_eal_hugepage_init(void);
207 * Creates memory mapping in secondary process
208 * i.e. hugepages on Linux and
211 * This function is private to the EAL.
213 int rte_eal_hugepage_attach(void);
216 * Find a bus capable of identifying a device.
219 * A device identifier (PCI address, virtual PMD name, ...).
222 * A valid bus handle if found.
223 * NULL if no bus is able to parse this device.
225 struct rte_bus *rte_bus_find_by_device_name(const char *str);
227 #endif /* _EAL_PRIVATE_H_ */