更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
los_spinlock.h 文件参考

浏览源代码.

结构体

struct  Spinlock
 

类型定义

typedef struct Spinlock SPIN_LOCK_S
 

函数

VOID ArchSpinLock (size_t *lock)
 
VOID ArchSpinUnlock (size_t *lock)
 
INT32 ArchSpinTrylock (size_t *lock)
 
VOID LOS_SpinLock (SPIN_LOCK_S *lock)
 Lock the spinlock. 更多...
 
INT32 LOS_SpinTrylock (SPIN_LOCK_S *lock)
 Trying lock the spinlock. 更多...
 
VOID LOS_SpinUnlock (SPIN_LOCK_S *lock)
 Unlock the spinlock. 更多...
 
VOID LOS_SpinLockSave (SPIN_LOCK_S *lock, UINT32 *intSave)
 Lock the spinlock and disable all interrupts. 更多...
 
VOID LOS_SpinUnlockRestore (SPIN_LOCK_S *lock, UINT32 intSave)
 Unlock the spinlock and restore interrupt flag. 更多...
 
BOOL LOS_SpinHeld (const SPIN_LOCK_S *lock)
 Check if holding the spinlock. 更多...
 
VOID LOS_SpinInit (SPIN_LOCK_S *lock)
 Spinlock initialization. 更多...
 

类型定义说明

◆ SPIN_LOCK_S

typedef struct Spinlock SPIN_LOCK_S

函数说明

◆ ArchSpinLock()

VOID ArchSpinLock ( size_t lock)
这是这个函数的调用关系图:

◆ ArchSpinTrylock()

INT32 ArchSpinTrylock ( size_t lock)
这是这个函数的调用关系图:

◆ ArchSpinUnlock()

VOID ArchSpinUnlock ( size_t lock)
这是这个函数的调用关系图:

◆ LOS_SpinHeld()

BOOL LOS_SpinHeld ( const SPIN_LOCK_S lock)

Check if holding the spinlock.

Description:
This API is used to check if holding the spinlock.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
返回值
TRUEHolding the spinlock.
FALSENot Holding the spinlock.
Dependency:

在文件 los_spinlock.h249 行定义.

250{
251 (VOID)lock;
252 return TRUE;
253}

◆ LOS_SpinInit()

VOID LOS_SpinInit ( SPIN_LOCK_S lock)

Spinlock initialization.

Description:
This API is used to initialize a spinlock.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
返回值
None.
Dependency:

在文件 los_spinlock.h255 行定义.

256{
257 (VOID)lock;
258}

◆ LOS_SpinLock()

VOID LOS_SpinLock ( SPIN_LOCK_S lock)

Lock the spinlock.

Description:
This API is used to lock the spin lock.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
返回值
None.
Dependency:
参见
LOS_SpinUnlock

在文件 los_spinlock.h221 行定义.

222{
223 (VOID)lock;
224}

◆ LOS_SpinLockSave()

VOID LOS_SpinLockSave ( SPIN_LOCK_S lock,
UINT32 intSave 
)

Lock the spinlock and disable all interrupts.

Description:
This API is used to lock the spin lock and disable all interrupts.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
intSave[OUT] Type UINT32 Saved interrupt flag for latter restored.
返回值
None.
Dependency:
参见
LOS_SpinLock

在文件 los_spinlock.h237 行定义.

238{
239 (VOID)lock;
240 *intSave = LOS_IntLock();
241}
STATIC INLINE UINT32 LOS_IntLock(VOID)
Disable all interrupts. | 关闭当前处理器所有中断响应
Definition: los_hwi.h:286
函数调用图:

◆ LOS_SpinTrylock()

INT32 LOS_SpinTrylock ( SPIN_LOCK_S lock)

Trying lock the spinlock.

Description:
This API is used to trying lock the spin lock.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
返回值
LOS_OKGot the spinlock.
LOS_NOKNot getting the spinlock.
Dependency:
参见
LOS_SpinLock

在文件 los_spinlock.h226 行定义.

227{
228 (VOID)lock;
229 return LOS_OK;
230}

◆ LOS_SpinUnlock()

VOID LOS_SpinUnlock ( SPIN_LOCK_S lock)

Unlock the spinlock.

Description:
This API is used to unlock the spin lock.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
返回值
None.
Dependency:
参见
LOS_SpinLock

在文件 los_spinlock.h232 行定义.

233{
234 (VOID)lock;
235}

◆ LOS_SpinUnlockRestore()

VOID LOS_SpinUnlockRestore ( SPIN_LOCK_S lock,
UINT32  intSave 
)

Unlock the spinlock and restore interrupt flag.

Description:
This API is used to unlock the spin lock and restore interrupt flag.
注意
None.
参数
lock[IN] Type SPIN_LOCK_S spinlock pointer.
intSave[IN] Type UINT32 Interrupt flag to be restored.
返回值
None.
Dependency:
参见
LOS_SpinUnlock

在文件 los_spinlock.h243 行定义.

244{
245 (VOID)lock;
246 LOS_IntRestore(intSave);
247}
STATIC INLINE VOID LOS_IntRestore(UINT32 intSave)
Restore interrupts. | 恢复到使用LOS_IntLock关闭所有中断之前的状态
Definition: los_hwi.h:337
函数调用图: