1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
6 #ifndef _QBMAN_SYS_DECL_H_
7 #define _QBMAN_SYS_DECL_H_
10 #include <fsl_qbman_base.h>
13 #if (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) && \
14 (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)
15 #error "Unknown endianness!"
21 #if defined(RTE_ARCH_ARM64)
22 #define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); }
23 #define lwsync() { asm volatile("dmb st" : : : "memory"); }
24 #define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); }
25 #define dccivac(p) { asm volatile("dc civac, %0" : : "r"(p) : "memory"); }
26 static inline void prefetch_for_load(void *p)
28 asm volatile("prfm pldl1keep, [%0, #0]" : : "r" (p));
31 static inline void prefetch_for_store(void *p)
33 asm volatile("prfm pstl1keep, [%0, #0]" : : "r" (p));
35 #elif defined(RTE_ARCH_ARM)
36 #define dcbz(p) memset(p, 0, 64)
37 #define lwsync() { asm volatile("dmb st" : : : "memory"); }
38 #define dcbf(p) RTE_SET_USED(p)
39 #define dccivac(p) RTE_SET_USED(p)
40 #define prefetch_for_load(p) { asm volatile ("pld [%0]" : : "r" (p)); }
41 #define prefetch_for_store(p) { asm volatile ("pld [%0]" : : "r" (p)); }
44 #define dcbz(p) RTE_SET_USED(p)
46 #define dcbf(p) RTE_SET_USED(p)
47 #define dccivac(p) RTE_SET_USED(p)
48 static inline void prefetch_for_load(void *p)
52 static inline void prefetch_for_store(void *p)
57 #endif /* _QBMAN_SYS_DECL_H_ */