1
2#ifndef __NVKM_EVENT_H__
3#define __NVKM_EVENT_H__
4#include <core/os.h>
5struct nvkm_notify;
6struct nvkm_object;
7
8struct nvkm_event {
9 const struct nvkm_event_func *func;
10
11 int types_nr;
12 int index_nr;
13
14 spinlock_t refs_lock;
15 spinlock_t list_lock;
16 struct list_head list;
17 int *refs;
18};
19
20struct nvkm_event_func {
21 int (*ctor)(struct nvkm_object *, void *data, u32 size,
22 struct nvkm_notify *);
23 void (*send)(void *data, u32 size, struct nvkm_notify *);
24 void (*init)(struct nvkm_event *, int type, int index);
25 void (*fini)(struct nvkm_event *, int type, int index);
26};
27
28int nvkm_event_init(const struct nvkm_event_func *func, int types_nr,
29 int index_nr, struct nvkm_event *);
30void nvkm_event_fini(struct nvkm_event *);
31void nvkm_event_get(struct nvkm_event *, u32 types, int index);
32void nvkm_event_put(struct nvkm_event *, u32 types, int index);
33void nvkm_event_send(struct nvkm_event *, u32 types, int index,
34 void *data, u32 size);
35#endif
36