2022-04-13 03:14:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-08-15 08:39:10 +00:00
|
|
|
#if ARCH(X86_64)
|
2022-08-14 17:42:34 +00:00
|
|
|
#include <arch/x86_64/current.h>
|
2022-08-15 08:39:10 +00:00
|
|
|
#else
|
|
|
|
|
#error Unsupported architecture!
|
|
|
|
|
#endif
|
2022-08-14 17:42:34 +00:00
|
|
|
#include "proc-types.h"
|
2022-04-13 03:14:49 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 增加自旋锁计数变量
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#define preempt_disable() \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
2022-06-09 08:27:55 +00:00
|
|
|
++(current_pcb->preempt_count);\
|
2022-04-13 03:14:49 +00:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 减少自旋锁计数变量
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
#define preempt_enable() \
|
|
|
|
|
do \
|
|
|
|
|
{ \
|
2022-06-09 08:27:55 +00:00
|
|
|
--(current_pcb->preempt_count);\
|
2022-04-13 03:14:49 +00:00
|
|
|
}while(0)
|