DragonOS/kernel/process/preempt.h

29 lines
415 B
C
Raw Normal View History

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 \
{ \
++(current_pcb->preempt_count);\
2022-04-13 03:14:49 +00:00
} while (0)
/**
* @brief
*
*/
#define preempt_enable() \
do \
{ \
--(current_pcb->preempt_count);\
2022-04-13 03:14:49 +00:00
}while(0)