summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/include/linux/preempt.h
blob: fdcaf207999187af4b84fc9946cd40b569e712e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Public domain. */

#ifndef _LINUX_PREEMPT_H
#define _LINUX_PREEMPT_H

#include <asm/preempt.h>

#define preempt_enable()
#define preempt_disable()

static inline bool
in_irq(void)
{
#if defined(__amd64__) || defined(__arm__) || defined(__arm64__) || \
    defined(__i386__)
	return (curcpu()->ci_idepth > 0);
#else
	return false;
#endif
}

#define in_interrupt()	in_irq()
#define in_task()	(!in_irq())
#define in_atomic()	0

#endif