New upstream version 18.08
[deb_dpdk.git] / lib / librte_eal / common / include / arch / arm / rte_spinlock.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015 RehiveTech. All rights reserved.
3  */
4
5 #ifndef _RTE_SPINLOCK_ARM_H_
6 #define _RTE_SPINLOCK_ARM_H_
7
8 #ifndef RTE_FORCE_INTRINSICS
9 #  error Platform must be built with CONFIG_RTE_FORCE_INTRINSICS
10 #endif
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include <rte_common.h>
17 #include "generic/rte_spinlock.h"
18
19 static inline int rte_tm_supported(void)
20 {
21         return 0;
22 }
23
24 static inline void
25 rte_spinlock_lock_tm(rte_spinlock_t *sl)
26 {
27         rte_spinlock_lock(sl); /* fall-back */
28 }
29
30 static inline int
31 rte_spinlock_trylock_tm(rte_spinlock_t *sl)
32 {
33         return rte_spinlock_trylock(sl);
34 }
35
36 static inline void
37 rte_spinlock_unlock_tm(rte_spinlock_t *sl)
38 {
39         rte_spinlock_unlock(sl);
40 }
41
42 static inline void
43 rte_spinlock_recursive_lock_tm(rte_spinlock_recursive_t *slr)
44 {
45         rte_spinlock_recursive_lock(slr); /* fall-back */
46 }
47
48 static inline void
49 rte_spinlock_recursive_unlock_tm(rte_spinlock_recursive_t *slr)
50 {
51         rte_spinlock_recursive_unlock(slr);
52 }
53
54 static inline int
55 rte_spinlock_recursive_trylock_tm(rte_spinlock_recursive_t *slr)
56 {
57         return rte_spinlock_recursive_trylock(slr);
58 }
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif /* _RTE_SPINLOCK_ARM_H_ */