forked from Minki/linux
a01ca78c8f
A variety of tweaks to the NVIF library interfaces, mostly ripping out things that turned out to be not so useful. - Removed refcounting from nvif_object, callers are expected to not be stupid instead. - nvif_client is directly reachable from anything derived from nvif_object, removing the need for heuristics to locate it - _new() versions of interfaces, that allocate memory for the object they construct, have been removed. The vast majority of callers used the embedded _init() interfaces. - No longer storing constructor arguments (and the data returned from nvkm) inside nvif_object, it's more or less unused and just wastes memory. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
34 lines
968 B
C
34 lines
968 B
C
#ifndef __NVIF_NOTIFY_H__
|
|
#define __NVIF_NOTIFY_H__
|
|
|
|
struct nvif_notify {
|
|
struct nvif_object *object;
|
|
int index;
|
|
|
|
#define NVIF_NOTIFY_USER 0
|
|
#define NVIF_NOTIFY_WORK 1
|
|
unsigned long flags;
|
|
atomic_t putcnt;
|
|
void (*dtor)(struct nvif_notify *);
|
|
#define NVIF_NOTIFY_DROP 0
|
|
#define NVIF_NOTIFY_KEEP 1
|
|
int (*func)(struct nvif_notify *);
|
|
|
|
/* this is const for a *very* good reason - the data might be on the
|
|
* stack from an irq handler. if you're not nvif/notify.c then you
|
|
* should probably think twice before casting it away...
|
|
*/
|
|
const void *data;
|
|
u32 size;
|
|
struct work_struct work;
|
|
};
|
|
|
|
int nvif_notify_init(struct nvif_object *, int (*func)(struct nvif_notify *),
|
|
bool work, u8 type, void *data, u32 size, u32 reply,
|
|
struct nvif_notify *);
|
|
int nvif_notify_fini(struct nvif_notify *);
|
|
int nvif_notify_get(struct nvif_notify *);
|
|
int nvif_notify_put(struct nvif_notify *);
|
|
int nvif_notify(const void *, u32, const void *, u32);
|
|
#endif
|