Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
spinlock.h
Go to the documentation of this file.
1 
4 #ifndef __KERNEL_SPINLOCK_H__
5 #define __KERNEL_SPINLOCK_H__
6 
7 #include <stdint.h>
8 
9 #define spin_lock_irq(lock) \
10  do { \
11  preempt_disable(); \
12  spin_lock(lock); \
13  } while (0)
14 
15 #define spin_unlock_irq(lock) \
16  do { \
17  spin_unlock(lock); \
18  preempt_enable(); \
19  } while (0)
20 
21 typedef uint32_t spinlock_t;
22 
23 void spin_lock(spinlock_t *lock);
24 void spin_unlock(spinlock_t *lock);
25 
26 #endif