1 #pragma once 2 3 #if ARCH(X86_64) 4 #include <arch/x86_64/current.h> 5 #else 6 #error Unsupported architecture! 7 #endif 8 #include "proc-types.h" 9 10 /** 11 * @brief 增加自旋锁计数变量 12 * 13 */ 14 #define preempt_disable() \ 15 do \ 16 { \ 17 ++(current_pcb->preempt_count);\ 18 } while (0) 19 20 /** 21 * @brief 减少自旋锁计数变量 22 * 23 */ 24 #define preempt_enable() \ 25 do \ 26 { \ 27 --(current_pcb->preempt_count);\ 28 }while(0) 29