xref: /openbsd/sys/dev/pci/drm/include/linux/preempt.h (revision ba619c7d)
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
preempt_enable(void)10 preempt_enable(void)
11 {
12 }
13 
14 static inline void
preempt_disable(void)15 preempt_disable(void)
16 {
17 }
18 
19 static inline void
migrate_enable(void)20 migrate_enable(void)
21 {
22 }
23 
24 static inline void
migrate_disable(void)25 migrate_disable(void)
26 {
27 }
28 
29 static inline bool
in_irq(void)30 in_irq(void)
31 {
32 	return (curcpu()->ci_idepth > 0);
33 }
34 
35 static inline bool
in_interrupt(void)36 in_interrupt(void)
37 {
38 	return in_irq();
39 }
40 
41 static inline bool
in_task(void)42 in_task(void)
43 {
44 	return !in_irq();
45 }
46 
47 static inline bool
in_atomic(void)48 in_atomic(void)
49 {
50 	return false;
51 }
52 
53 #endif
54