pr.h 1.1 KB

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