Lines Matching refs:lock

17 pub fn spin_lock_irqsave(lock: *mut spinlock_t, flags: &mut usize) {  in spin_lock_irqsave()
20 spin_lock(lock); in spin_lock_irqsave()
26 pub fn spin_unlock_irqrestore(lock: *mut spinlock_t, flags: usize) { in spin_unlock_irqrestore()
28 spin_unlock(lock); in spin_unlock_irqrestore()
35 pub fn spin_is_locked(lock: &spinlock_t) -> bool { in spin_is_locked()
36 let val = unsafe { read_volatile(&lock.lock as *const i8) }; in spin_is_locked()
43 Self { lock: 1 } in default()
48 pub fn spin_lock_irq(lock: *mut spinlock_t) { in spin_lock_irq()
51 spin_lock(lock); in spin_lock_irq()
56 pub fn spin_unlock_irq(lock: *mut spinlock_t) { in spin_unlock_irq()
58 spin_unlock(lock); in spin_unlock_irq()
75 pub fn lock(&self) { in lock() method
82 self.lock(); in lock_irq()
139 self.lock(); in lock_irqsave()
165 lock: RawSpinlock, field
175 lock: &'a SpinLock<T>, field
193 unsafe { &mut *this.lock.data.get() } in leak()
204 lock: RawSpinlock::INIT, in new()
210 pub fn lock(&self) -> SpinLockGuard<T> { in lock() method
211 self.lock.lock(); in lock()
214 lock: self, in lock()
222 self.lock.lock_irqsave(&mut flags); in lock_irqsave()
225 lock: self, in lock_irqsave()
231 if self.lock.try_lock() { in try_lock()
233 lock: self, in try_lock()
242 if self.lock.try_lock_irqsave(&mut flags) { in try_lock_irqsave()
244 lock: self, in try_lock_irqsave()
258 self.lock.unlock_no_preempt(); in force_unlock()
267 return unsafe { &*self.lock.data.get() }; in deref()
274 return unsafe { &mut *self.lock.data.get() }; in deref_mut()
282 self.lock.lock.unlock_irqrestore(self.flag); in drop()
284 self.lock.lock.unlock(); in drop()