xref: /dpdk/lib/eal/ppc/include/rte_prefetch.h (revision 99a2dd95)
1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  * Copyright (C) IBM Corporation 2014.
4  */
5 
6 #ifndef _RTE_PREFETCH_PPC_64_H_
7 #define _RTE_PREFETCH_PPC_64_H_
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #include <rte_common.h>
14 #include "generic/rte_prefetch.h"
15 
rte_prefetch0(const volatile void * p)16 static inline void rte_prefetch0(const volatile void *p)
17 {
18 	asm volatile ("dcbt 0,%[p],0" : : [p] "r" (p));
19 }
20 
rte_prefetch1(const volatile void * p)21 static inline void rte_prefetch1(const volatile void *p)
22 {
23 	asm volatile ("dcbt 0,%[p],0" : : [p] "r" (p));
24 }
25 
rte_prefetch2(const volatile void * p)26 static inline void rte_prefetch2(const volatile void *p)
27 {
28 	asm volatile ("dcbt 0,%[p],0" : : [p] "r" (p));
29 }
30 
rte_prefetch_non_temporal(const volatile void * p)31 static inline void rte_prefetch_non_temporal(const volatile void *p)
32 {
33 	/* non-temporal version not available, fallback to rte_prefetch0 */
34 	rte_prefetch0(p);
35 }
36 
37 __rte_experimental
38 static inline void
rte_cldemote(const volatile void * p)39 rte_cldemote(const volatile void *p)
40 {
41 	RTE_SET_USED(p);
42 }
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif /* _RTE_PREFETCH_PPC_64_H_ */
49