1 /* Public domain. */ 2 3 #ifndef _LINUX_PREEMPT_H 4 #define _LINUX_PREEMPT_H 5 6 #include <asm/preempt.h> 7 #include <sys/param.h> /* for curcpu in machine/cpu.h */ 8 9 static inline void 10 preempt_enable(void) 11 { 12 } 13 14 static inline void 15 preempt_disable(void) 16 { 17 } 18 19 static inline void 20 migrate_enable(void) 21 { 22 } 23 24 static inline void 25 migrate_disable(void) 26 { 27 } 28 29 static inline bool 30 in_irq(void) 31 { 32 return (curcpu()->ci_idepth > 0); 33 } 34 35 static inline bool 36 in_interrupt(void) 37 { 38 return in_irq(); 39 } 40 41 static inline bool 42 in_task(void) 43 { 44 return !in_irq(); 45 } 46 47 static inline bool 48 in_atomic(void) 49 { 50 return false; 51 } 52 53 #endif 54