Implement in_atomic() function in the LinuxKPI.
Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
d1f96a5c3d
commit
fc09dd7cd5
@ -48,10 +48,15 @@
|
||||
__task; \
|
||||
})
|
||||
|
||||
#define in_atomic() ({ \
|
||||
linux_in_atomic(); \
|
||||
})
|
||||
|
||||
extern int kthread_stop(struct task_struct *);
|
||||
extern bool kthread_should_stop_task(struct task_struct *);
|
||||
extern bool kthread_should_stop(void);
|
||||
extern void linux_kthread_fn(void *);
|
||||
extern struct task_struct *linux_kthread_setup_and_run(struct thread *, linux_task_fn_t *, void *arg);
|
||||
extern int linux_in_atomic(void);
|
||||
|
||||
#endif /* _LINUX_KTHREAD_H_ */
|
||||
|
@ -73,8 +73,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include <linux/timer.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/smp.h>
|
||||
@ -1679,6 +1680,13 @@ linux_on_each_cpu(void callback(void *), void *data)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
linux_in_atomic(void)
|
||||
{
|
||||
|
||||
return ((curthread->td_pflags & TDP_NOFAULTING) != 0);
|
||||
}
|
||||
|
||||
struct linux_cdev *
|
||||
linux_find_cdev(const char *name, unsigned major, unsigned minor)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user