xref: /DragonOS/kernel/src/process/preempt.h (revision 26d84a31393c50063ff416bc509316e8d342028c)
1 #pragma once
2 
3 #include <asm/current.h>
4 
5 #include "proc-types.h"
6 
7 /**
8  * @brief 增加自旋锁计数变量
9  *
10  */
11 #define preempt_disable()   \
12 do  \
13 {   \
14     ++(current_pcb->preempt_count);\
15 } while (0)
16 
17 /**
18  * @brief 减少自旋锁计数变量
19  *
20  */
21 #define preempt_enable()   \
22 do  \
23 {   \
24     --(current_pcb->preempt_count);\
25 }while(0)
26