1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016 Cavium, Inc
12 #include "rte_cpuflags.h"
14 #define RTE_NATIVE_WRITE32_WC
15 #include "generic/rte_io.h"
21 static __rte_always_inline void
22 __rte_x86_movdiri(uint32_t value, volatile void *addr)
26 ".byte 0x40, 0x0f, 0x38, 0xf9, 0x02"
28 : "a" (value), "d" (addr));
31 static __rte_always_inline void
32 rte_write32_wc_relaxed(uint32_t value, volatile void *addr)
34 static int _x86_movdiri_flag = -1;
36 if (_x86_movdiri_flag == 1) {
37 __rte_x86_movdiri(value, addr);
38 } else if (_x86_movdiri_flag == 0) {
39 rte_write32_relaxed(value, addr);
42 (rte_cpu_get_flag_enabled(RTE_CPUFLAG_MOVDIRI) > 0);
43 if (_x86_movdiri_flag == 1)
44 __rte_x86_movdiri(value, addr);
46 rte_write32_relaxed(value, addr);
50 static __rte_always_inline void
51 rte_write32_wc(uint32_t value, volatile void *addr)
54 rte_write32_wc_relaxed(value, addr);
61 #endif /* _RTE_IO_X86_H_ */