eal: move common header files
[dpdk.git] / lib / librte_eal / include / generic / rte_prefetch.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4
5 #ifndef _RTE_PREFETCH_H_
6 #define _RTE_PREFETCH_H_
7
8 /**
9  * @file
10  *
11  * Prefetch operations.
12  *
13  * This file defines an API for prefetch macros / inline-functions,
14  * which are architecture-dependent. Prefetching occurs when a
15  * processor requests an instruction or data from memory to cache
16  * before it is actually needed, potentially speeding up the execution of the
17  * program.
18  */
19
20 /**
21  * Prefetch a cache line into all cache levels.
22  * @param p
23  *   Address to prefetch
24  */
25 static inline void rte_prefetch0(const volatile void *p);
26
27 /**
28  * Prefetch a cache line into all cache levels except the 0th cache level.
29  * @param p
30  *   Address to prefetch
31  */
32 static inline void rte_prefetch1(const volatile void *p);
33
34 /**
35  * Prefetch a cache line into all cache levels except the 0th and 1th cache
36  * levels.
37  * @param p
38  *   Address to prefetch
39  */
40 static inline void rte_prefetch2(const volatile void *p);
41
42 /**
43  * Prefetch a cache line into all cache levels (non-temporal/transient version)
44  *
45  * The non-temporal prefetch is intended as a prefetch hint that processor will
46  * use the prefetched data only once or short period, unlike the
47  * rte_prefetch0() function which imply that prefetched data to use repeatedly.
48  *
49  * @param p
50  *   Address to prefetch
51  */
52 static inline void rte_prefetch_non_temporal(const volatile void *p);
53
54 #endif /* _RTE_PREFETCH_H_ */