From ae9203a19764fd434ded1e4b16ce897566aba63c Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Fri, 2 May 2008 22:53:02 -0400 Subject: LITMUS: add framework for carrying out jobs after dropping rq locks Many things can't be done from within the scheduler. This framework should make it easer to defer them. --- include/litmus/norqlock.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/litmus/norqlock.h (limited to 'include') diff --git a/include/litmus/norqlock.h b/include/litmus/norqlock.h new file mode 100644 index 0000000000..e4c1d06f51 --- /dev/null +++ b/include/litmus/norqlock.h @@ -0,0 +1,26 @@ +#ifndef NORQLOCK_H +#define NORQLOCK_H + +typedef void (*work_t)(unsigned long arg); + +struct no_rqlock_work { + int active; + work_t work; + unsigned long arg; + struct no_rqlock_work* next; +}; + +void init_no_rqlock_work(struct no_rqlock_work* w, work_t work, + unsigned long arg); + +void __do_without_rqlock(struct no_rqlock_work *work); + +static inline void do_without_rqlock(struct no_rqlock_work *work) +{ + if (!test_and_set_bit(0, (void*)&work->active)) + __do_without_rqlock(work); +} + +void tick_no_rqlock(void); + +#endif -- cgit v1.2.2