Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/preempt.h
Show All 28 Lines | |||||
#ifndef _LINUX_PREEMPT_H_ | #ifndef _LINUX_PREEMPT_H_ | ||||
#define _LINUX_PREEMPT_H_ | #define _LINUX_PREEMPT_H_ | ||||
#include <linux/list.h> | #include <linux/list.h> | ||||
#define in_interrupt() \ | #define in_interrupt() \ | ||||
(curthread->td_intr_nesting_level || curthread->td_critnest) | (curthread->td_intr_nesting_level || curthread->td_critnest) | ||||
#define in_task() \ | |||||
(curthread->td_intr_nesting_level == 0 && curthread->td_critnest == 0) | |||||
bwidawsk: I don't think td_critnest is quite right here, but I can't figure out anything obviously better. | |||||
Done Inline ActionsYeah, I'm not sure at all about this one so any feedback is welcome... johalun: Yeah, I'm not sure at all about this one so any feedback is welcome... | |||||
#define preempt_disable() critical_enter() | #define preempt_disable() critical_enter() | ||||
#define preempt_enable() critical_exit() | #define preempt_enable() critical_exit() | ||||
#endif /* _LINUX_PREEMPT_H_ */ | #endif /* _LINUX_PREEMPT_H_ */ |
I don't think td_critnest is quite right here, but I can't figure out anything obviously better. I think you might be able to do something with td_priority >= PI_SOFT or some such, but I don't know.