# osal\_spinlock.h - [Overview](#section835764281165628) - [Summary](#section641614913165628) - [Data Structures](#nested-classes) - [Macros](#define-members) - [Functions](#func-members) ## **Overview** **Related Modules:** [OSAL](OSAL.md) **Description:** Declares spinlock types and interfaces. This file provides the interfaces for initializing, destroying, obtaining, and releasing a spinlock, the interfaces for obtaining a spinlock and disabling the interrupt request \(IRQ\), releasing a spinlock and enabling the IRQ, obtaining a spinlock, disabling the IRQ, and saving its status, and releasing a spinlock, enabling the IRQ, and restoring the saved IRQ status. The spinlock needs to be destroyed when it is no longer used. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Data Structures
OSAL_DECLARE_SPINLOCK(spinlock) OsalSpinlock spinlock |
OsalSpinInit (OsalSpinlock *spinlock) |
|
OsalSpinDestroy (OsalSpinlock *spinlock) |
|
OsalSpinLock (OsalSpinlock *spinlock) |
|
OsalSpinUnlock (OsalSpinlock *spinlock) |
|
OsalSpinLockIrq (OsalSpinlock *spinlock) |
|
OsalSpinUnlockIrq (OsalSpinlock *spinlock) |
|
OsalSpinLockIrqSave (OsalSpinlock *spinlock, uint32_t *flags) |
|
OsalSpinUnlockIrqRestore (OsalSpinlock *spinlock, uint32_t *flags) |
Releases a spinlock, enables the IRQ, and restores the saved IRQ status. |