1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef _OTX2_IO_GENERIC_H_
6 #define _OTX2_IO_GENERIC_H_
10 #define otx2_load_pair(val0, val1, addr) \
12 val0 = rte_read64_relaxed((void *)(addr)); \
13 val1 = rte_read64_relaxed((uint8_t *)(addr) + 8); \
16 #define otx2_store_pair(val0, val1, addr) \
18 rte_write64_relaxed(val0, (void *)(addr)); \
19 rte_write64_relaxed(val1, (((uint8_t *)(addr)) + 8)); \
22 #define otx2_prefetch_store_keep(ptr) do {} while (0)
24 static inline uint64_t
25 otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr)
33 static inline uint64_t
34 otx2_atomic64_add_sync(int64_t incr, int64_t *ptr)
43 otx2_lmt_submit(uint64_t io_address)
45 RTE_SET_USED(io_address);
51 otx2_lmt_submit_release(uint64_t io_address)
53 RTE_SET_USED(io_address);
58 static __rte_always_inline void
59 otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext)
61 /* Copy four words if lmtext = 0
62 * six words if lmtext = 1
63 * eight words if lmtext =2
65 memcpy(out, in, (4 + (2 * lmtext)) * sizeof(uint64_t));
68 static __rte_always_inline void
69 otx2_lmt_mov_seg(void *out, const void *in, const uint16_t segdw)
75 #endif /* _OTX2_IO_GENERIC_H_ */