notify.h 968 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __NVIF_NOTIFY_H__
  2. #define __NVIF_NOTIFY_H__
  3. struct nvif_notify {
  4. struct nvif_object *object;
  5. int index;
  6. #define NVIF_NOTIFY_USER 0
  7. #define NVIF_NOTIFY_WORK 1
  8. unsigned long flags;
  9. atomic_t putcnt;
  10. void (*dtor)(struct nvif_notify *);
  11. #define NVIF_NOTIFY_DROP 0
  12. #define NVIF_NOTIFY_KEEP 1
  13. int (*func)(struct nvif_notify *);
  14. /* this is const for a *very* good reason - the data might be on the
  15. * stack from an irq handler. if you're not nvif/notify.c then you
  16. * should probably think twice before casting it away...
  17. */
  18. const void *data;
  19. u32 size;
  20. struct work_struct work;
  21. };
  22. int nvif_notify_init(struct nvif_object *, int (*func)(struct nvif_notify *),
  23. bool work, u8 type, void *data, u32 size, u32 reply,
  24. struct nvif_notify *);
  25. int nvif_notify_fini(struct nvif_notify *);
  26. int nvif_notify_get(struct nvif_notify *);
  27. int nvif_notify_put(struct nvif_notify *);
  28. int nvif_notify(const void *, u32, const void *, u32);
  29. #endif