xref: /OK3568_Linux_fs/kernel/tools/testing/radix-tree/linux/preempt.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef __LINUX_PREEMPT_H
3*4882a593Smuzhiyun #define __LINUX_PREEMPT_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun extern int preempt_count;
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #define preempt_disable()	uatomic_inc(&preempt_count)
8*4882a593Smuzhiyun #define preempt_enable()	uatomic_dec(&preempt_count)
9*4882a593Smuzhiyun 
in_interrupt(void)10*4882a593Smuzhiyun static inline int in_interrupt(void)
11*4882a593Smuzhiyun {
12*4882a593Smuzhiyun 	return 0;
13*4882a593Smuzhiyun }
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun #endif /* __LINUX_PREEMPT_H */
16