| 1 | |
| 2 |
|
| 3 | #include <linux/spinlock.h>
|
| 4 |
|
| 5 | __rust_helper void rust_helper___spin_lock_init(spinlock_t *lock,
|
| 6 | const char *name,
|
| 7 | struct lock_class_key *key)
|
| 8 | {
|
| 9 | #ifdef CONFIG_DEBUG_SPINLOCK
|
| 10 | # if defined(CONFIG_PREEMPT_RT)
|
| 11 | __spin_lock_init(lock, name, key, false);
|
| 12 | # else
|
| 13 | __raw_spin_lock_init(spinlock_check(lock), name, key, LD_WAIT_CONFIG);
|
| 14 | # endif
|
| 15 | #else
|
| 16 | spin_lock_init(lock);
|
| 17 | #endif
|
| 18 | }
|
| 19 |
|
| 20 | __rust_helper void rust_helper_spin_lock(spinlock_t *lock)
|
| 21 | {
|
| 22 | spin_lock(lock);
|
| 23 | }
|
| 24 |
|
| 25 | __rust_helper void rust_helper_spin_unlock(spinlock_t *lock)
|
| 26 | {
|
| 27 | spin_unlock(lock);
|
| 28 | }
|
| 29 |
|
| 30 | __rust_helper int rust_helper_spin_trylock(spinlock_t *lock)
|
| 31 | {
|
| 32 | return spin_trylock(lock);
|
| 33 | }
|
| 34 |
|
| 35 | __rust_helper void rust_helper_spin_assert_is_held(spinlock_t *lock)
|
| 36 | {
|
| 37 | lockdep_assert_held(lock);
|
| 38 | }
|
| 39 |
|
| 40 | __rust_helper void rust_helper_spin_lock_irq_disable(spinlock_t *lock)
|
| 41 | {
|
| 42 | spin_lock_irq_disable(lock);
|
| 43 | }
|
| 44 |
|
| 45 | __rust_helper void rust_helper_spin_unlock_irq_enable(spinlock_t *lock)
|
| 46 | {
|
| 47 | spin_unlock_irq_enable(lock);
|
| 48 | }
|
| 49 |
|
| 50 | __rust_helper int rust_helper_spin_trylock_irq_disable(spinlock_t *lock)
|
| 51 | {
|
| 52 | return spin_trylock_irq_disable(lock);
|
| 53 | }
|