13#ifndef __xwos_osal_lock_spinlock_h__
14#define __xwos_osal_lock_spinlock_h__
80#define XWOS_SPLK_INITIALIZER { .osspl = XWOSDL_SPLK_INITIALIZER, }
91 xwosdl_splk_init(&spl->
osspl);
105 xwosdl_splk_lock(&spl->
osspl);
123 return xwosdl_splk_trylock(&spl->
osspl);
135 xwosdl_splk_unlock(&spl->
osspl);
149 xwosdl_splk_lock_cpuirq(&spl->
osspl);
167 return xwosdl_splk_trylock_cpuirq(&spl->
osspl);
179 xwosdl_splk_unlock_cpuirq(&spl->
osspl);
194 xwosdl_splk_lock_cpuirqsv(&spl->
osspl, cpuirq);
213 return xwosdl_splk_trylock_cpuirqsv(&spl->
osspl, cpuirq);
226 xwosdl_splk_unlock_cpuirqrs(&spl->
osspl, cpuirq);
245 xwosdl_splk_lock_irqs(&spl->
osspl, irqs, num);
268 return xwosdl_splk_trylock_irqs(&spl->
osspl, irqs, num);
284 xwosdl_splk_unlock_irqs(&spl->
osspl, irqs, num);
304 xwosdl_splk_lock_irqssv(&spl->
osspl, irqs, flags, num);
328 return xwosdl_splk_trylock_irqssv(&spl->
osspl, irqs, flags, num);
345 xwosdl_splk_unlock_irqsrs(&spl->
osspl, irqs, flags, num);
360 xwosdl_splk_lock_bh(&spl->
osspl);
379 return xwosdl_splk_trylock_bh(&spl->
osspl);
391 xwosdl_splk_unlock_bh(&spl->
osspl);
#define __xwos_inline_api
static void xwos_splk_lock_irqs(struct xwos_splk *spl, const xwirq_t irqs[], xwsz_t num)
XWOS API:上锁自旋锁,并关闭部分中断
static void xwos_splk_unlock_irqsrs(struct xwos_splk *spl, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:解锁自旋锁,并恢复部分中断的中断标志
static void xwos_splk_lock_cpuirq(struct xwos_splk *spl)
XWOS API:上锁自旋锁,并关闭本地CPU的中断
static void xwos_splk_lock_bh(struct xwos_splk *spl)
XWOS API:上锁自旋锁,关闭本地CPU的中断底半部
static xwer_t xwos_splk_trylock_cpuirq(struct xwos_splk *spl)
XWOS API:尝试上锁自旋锁,并关闭本地CPU的中断
static xwer_t xwos_splk_trylock_bh(struct xwos_splk *spl)
XWOS API:尝试上锁自旋锁,关闭本地CPU的中断底半部
static xwer_t xwos_splk_trylock_cpuirqsv(struct xwos_splk *spl, xwreg_t *cpuirq)
XWOS API:尝试上锁自旋锁,保存本地CPU的中断标志并关闭
static void xwos_splk_unlock(struct xwos_splk *spl)
XWOS API:解锁自旋锁
static void xwos_splk_lock(struct xwos_splk *spl)
XWOS API:上锁自旋锁,若自旋锁已开启临界区,就自旋等待
static void xwos_splk_unlock_irqs(struct xwos_splk *spl, const xwirq_t irqs[], xwsz_t num)
XWOS API:解锁自旋锁,并开启部分中断
static void xwos_splk_unlock_cpuirqrs(struct xwos_splk *spl, xwreg_t cpuirq)
XWOS API:解锁自旋锁,并恢复本地CPU的中断标志
static xwer_t xwos_splk_trylock_irqs(struct xwos_splk *spl, const xwirq_t irqs[], xwsz_t num)
XWOS API:尝试上锁自旋锁,并关闭部分中断
static void xwos_splk_unlock_cpuirq(struct xwos_splk *spl)
XWOS API:解锁自旋锁,并开启本地CPU的中断
static void xwos_splk_init(struct xwos_splk *spl)
XWOS API:初始化自旋锁
static xwer_t xwos_splk_trylock_irqssv(struct xwos_splk *spl, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:尝试上锁自旋锁,保存部分中断的中断标志并关闭
static void xwos_splk_lock_cpuirqsv(struct xwos_splk *spl, xwreg_t *cpuirq)
XWOS API:上锁自旋锁,保存本地CPU的中断标志并关闭
static xwer_t xwos_splk_trylock(struct xwos_splk *spl)
XWOS API:尝试上锁自旋锁
static void xwos_splk_lock_irqssv(struct xwos_splk *spl, const xwirq_t irqs[], xwreg_t flags[], xwsz_t num)
XWOS API:上锁自旋锁,保存部分中断的中断标志并关闭
static void xwos_splk_unlock_bh(struct xwos_splk *spl)
XWOS API:解锁自旋锁,开启本地CPU的中断底半部