pr.h 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _UAPI_PR_H
  2. #define _UAPI_PR_H
  3. enum pr_type {
  4. PR_WRITE_EXCLUSIVE = 1,
  5. PR_EXCLUSIVE_ACCESS = 2,
  6. PR_WRITE_EXCLUSIVE_REG_ONLY = 3,
  7. PR_EXCLUSIVE_ACCESS_REG_ONLY = 4,
  8. PR_WRITE_EXCLUSIVE_ALL_REGS = 5,
  9. PR_EXCLUSIVE_ACCESS_ALL_REGS = 6,
  10. };
  11. struct pr_reservation {
  12. __u64 key;
  13. __u32 type;
  14. __u32 flags;
  15. };
  16. struct pr_registration {
  17. __u64 old_key;
  18. __u64 new_key;
  19. __u32 flags;
  20. __u32 __pad;
  21. };
  22. struct pr_preempt {
  23. __u64 old_key;
  24. __u64 new_key;
  25. __u32 type;
  26. __u32 flags;
  27. };
  28. struct pr_clear {
  29. __u64 key;
  30. __u32 flags;
  31. __u32 __pad;
  32. };
  33. #define PR_FL_IGNORE_KEY (1 << 0) /* ignore existing key */
  34. #define IOC_PR_REGISTER _IOW('p', 200, struct pr_registration)
  35. #define IOC_PR_RESERVE _IOW('p', 201, struct pr_reservation)
  36. #define IOC_PR_RELEASE _IOW('p', 202, struct pr_reservation)
  37. #define IOC_PR_PREEMPT _IOW('p', 203, struct pr_preempt)
  38. #define IOC_PR_PREEMPT_ABORT _IOW('p', 204, struct pr_preempt)
  39. #define IOC_PR_CLEAR _IOW('p', 205, struct pr_clear)
  40. #endif /* _UAPI_PR_H */