xref: /linux/rust/helpers/spinlock.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/export.h>
4 #include <linux/spinlock.h>
5 
6 void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
7 				  struct lock_class_key *key)
8 {
9 #ifdef CONFIG_DEBUG_SPINLOCK
10 	__raw_spin_lock_init(spinlock_check(lock), name, key, LD_WAIT_CONFIG);
11 #else
12 	spin_lock_init(lock);
13 #endif
14 }
15 
16 void rust_helper_spin_lock(spinlock_t *lock)
17 {
18 	spin_lock(lock);
19 }
20 
21 void rust_helper_spin_unlock(spinlock_t *lock)
22 {
23 	spin_unlock(lock);
24 }
25