1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/spinlock.h>
5 void rust_helper___spin_lock_init(spinlock_t
*lock
, const char *name
,
6 struct lock_class_key
*key
)
8 #ifdef CONFIG_DEBUG_SPINLOCK
9 # if defined(CONFIG_PREEMPT_RT)
10 __spin_lock_init(lock
, name
, key
, false);
11 # else /*!CONFIG_PREEMPT_RT */
12 __raw_spin_lock_init(spinlock_check(lock
), name
, key
, LD_WAIT_CONFIG
);
13 # endif /* CONFIG_PREEMPT_RT */
14 #else /* !CONFIG_DEBUG_SPINLOCK */
16 #endif /* CONFIG_DEBUG_SPINLOCK */
19 void rust_helper_spin_lock(spinlock_t
*lock
)
24 void rust_helper_spin_unlock(spinlock_t
*lock
)
29 int rust_helper_spin_trylock(spinlock_t
*lock
)
31 return spin_trylock(lock
);