Christoph Hellwig | bbd3e06 | 2015-10-15 14:10:48 +0200 | [diff] [blame] | 1 | #ifndef _UAPI_PR_H |
| 2 | #define _UAPI_PR_H |
| 3 | |
Nicolas Dichtel | 9078b4e | 2017-03-27 14:20:11 +0200 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Christoph Hellwig | bbd3e06 | 2015-10-15 14:10:48 +0200 | [diff] [blame] | 6 | enum pr_type { |
| 7 | PR_WRITE_EXCLUSIVE = 1, |
| 8 | PR_EXCLUSIVE_ACCESS = 2, |
| 9 | PR_WRITE_EXCLUSIVE_REG_ONLY = 3, |
| 10 | PR_EXCLUSIVE_ACCESS_REG_ONLY = 4, |
| 11 | PR_WRITE_EXCLUSIVE_ALL_REGS = 5, |
| 12 | PR_EXCLUSIVE_ACCESS_ALL_REGS = 6, |
| 13 | }; |
| 14 | |
| 15 | struct pr_reservation { |
| 16 | __u64 key; |
| 17 | __u32 type; |
| 18 | __u32 flags; |
| 19 | }; |
| 20 | |
| 21 | struct pr_registration { |
| 22 | __u64 old_key; |
| 23 | __u64 new_key; |
| 24 | __u32 flags; |
| 25 | __u32 __pad; |
| 26 | }; |
| 27 | |
| 28 | struct pr_preempt { |
| 29 | __u64 old_key; |
| 30 | __u64 new_key; |
| 31 | __u32 type; |
| 32 | __u32 flags; |
| 33 | }; |
| 34 | |
| 35 | struct pr_clear { |
| 36 | __u64 key; |
| 37 | __u32 flags; |
| 38 | __u32 __pad; |
| 39 | }; |
| 40 | |
| 41 | #define PR_FL_IGNORE_KEY (1 << 0) /* ignore existing key */ |
| 42 | |
| 43 | #define IOC_PR_REGISTER _IOW('p', 200, struct pr_registration) |
| 44 | #define IOC_PR_RESERVE _IOW('p', 201, struct pr_reservation) |
| 45 | #define IOC_PR_RELEASE _IOW('p', 202, struct pr_reservation) |
| 46 | #define IOC_PR_PREEMPT _IOW('p', 203, struct pr_preempt) |
| 47 | #define IOC_PR_PREEMPT_ABORT _IOW('p', 204, struct pr_preempt) |
| 48 | #define IOC_PR_CLEAR _IOW('p', 205, struct pr_clear) |
| 49 | |
| 50 | #endif /* _UAPI_PR_H */ |