notify.h 1007 B

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