aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/kexclu_affinity.h
blob: f6355de4907481c09dbd5611d53c0876a50e8b25 (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
27
28
29
30
31
32
33
34
35
#ifndef LITMUS_AFF_OBS_H
#define LITMUS_AFF_OBS_H

#include <litmus/locking.h>

struct affinity_observer_ops;

struct affinity_observer
{
	struct affinity_observer_ops* ops;
	int type;
	int ident;

	struct litmus_lock* lock;  // the lock under observation
};

typedef int (*aff_obs_open_t)(struct affinity_observer* aff_obs,
							  void* __user arg);
typedef int (*aff_obs_close_t)(struct affinity_observer* aff_obs);
typedef void (*aff_obs_free_t)(struct affinity_observer* aff_obs);

struct affinity_observer_ops
{
	aff_obs_open_t open;
	aff_obs_close_t close;
	aff_obs_free_t deallocate;
};

struct litmus_lock* get_lock_from_od(int od);

void affinity_observer_new(struct affinity_observer* aff,
						   struct affinity_observer_ops* ops,
						   struct affinity_observer_args* args);

#endif