aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/norqlock.h
blob: e4c1d06f5135bfee835c3c7dc5c3b53ae2a0990c (plain) (blame)
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
#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