* @brief This function will disable the local interrupt and then lock the spinlock, will lock the thread scheduler. * * @note If the spinlock is locked, the current CPU will keep polling the spinlock state * until the spinlock is unlocked. * * @param lock is a pointer to the spinlock. * * @return Return current cpu interrupt status. */
| 71 | * @return Return current cpu interrupt status. |
| 72 | */ |
| 73 | rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock) |
| 74 | { |
| 75 | rt_base_t level; |
| 76 | RT_UNUSED(lock); |
| 77 | level = rt_hw_interrupt_disable(); |
| 78 | rt_enter_critical(); |
| 79 | RT_SPIN_LOCK_DEBUG(lock); |
| 80 | return level; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * @brief This function will unlock the spinlock and then restore current cpu interrupt status, will unlock the thread scheduler. |
no test coverage detected