blob: edb10302b903e821e72763eec79f9d9803e42e5c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Matthew Wilcoxab3a1ff2016-12-16 15:11:05 -05002#ifndef __LINUX_PREEMPT_H
3#define __LINUX_PREEMPT_H
4
Matthew Wilcox847d3572016-12-14 15:08:02 -08005extern int preempt_count;
Matthew Wilcox1366c372016-03-17 14:21:45 -07006
Matthew Wilcox847d3572016-12-14 15:08:02 -08007#define preempt_disable() uatomic_inc(&preempt_count)
8#define preempt_enable() uatomic_dec(&preempt_count)
Matthew Wilcoxab3a1ff2016-12-16 15:11:05 -05009
10static inline int in_interrupt(void)
11{
12 return 0;
13}
14
15#endif /* __LINUX_PREEMPT_H */