blob: 43776925ceda1bbc8c8008712b6e9cd68e6325d0 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris05d08e92016-02-04 13:16:38 -08007#ifndef _UAPI_PR_H
8#define _UAPI_PR_H
Christopher Ferris525ce912017-07-26 13:12:53 -07009#include <linux/types.h>
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080010enum pr_status {
11 PR_STS_SUCCESS = 0x0,
12 PR_STS_IOERR = 0x2,
13 PR_STS_RESERVATION_CONFLICT = 0x18,
14 PR_STS_RETRY_PATH_FAILURE = 0xe0000,
15 PR_STS_PATH_FAST_FAILED = 0xf0000,
16 PR_STS_PATH_FAILED = 0x10000,
17};
Christopher Ferris05d08e92016-02-04 13:16:38 -080018enum pr_type {
19 PR_WRITE_EXCLUSIVE = 1,
Christopher Ferris05d08e92016-02-04 13:16:38 -080020 PR_EXCLUSIVE_ACCESS = 2,
21 PR_WRITE_EXCLUSIVE_REG_ONLY = 3,
22 PR_EXCLUSIVE_ACCESS_REG_ONLY = 4,
23 PR_WRITE_EXCLUSIVE_ALL_REGS = 5,
Christopher Ferris05d08e92016-02-04 13:16:38 -080024 PR_EXCLUSIVE_ACCESS_ALL_REGS = 6,
25};
26struct pr_reservation {
27 __u64 key;
Christopher Ferris05d08e92016-02-04 13:16:38 -080028 __u32 type;
29 __u32 flags;
30};
31struct pr_registration {
Christopher Ferris05d08e92016-02-04 13:16:38 -080032 __u64 old_key;
33 __u64 new_key;
34 __u32 flags;
35 __u32 __pad;
Christopher Ferris05d08e92016-02-04 13:16:38 -080036};
37struct pr_preempt {
38 __u64 old_key;
39 __u64 new_key;
Christopher Ferris05d08e92016-02-04 13:16:38 -080040 __u32 type;
41 __u32 flags;
42};
43struct pr_clear {
Christopher Ferris05d08e92016-02-04 13:16:38 -080044 __u64 key;
45 __u32 flags;
46 __u32 __pad;
47};
Christopher Ferris05d08e92016-02-04 13:16:38 -080048#define PR_FL_IGNORE_KEY (1 << 0)
49#define IOC_PR_REGISTER _IOW('p', 200, struct pr_registration)
50#define IOC_PR_RESERVE _IOW('p', 201, struct pr_reservation)
51#define IOC_PR_RELEASE _IOW('p', 202, struct pr_reservation)
Christopher Ferris05d08e92016-02-04 13:16:38 -080052#define IOC_PR_PREEMPT _IOW('p', 203, struct pr_preempt)
53#define IOC_PR_PREEMPT_ABORT _IOW('p', 204, struct pr_preempt)
54#define IOC_PR_CLEAR _IOW('p', 205, struct pr_clear)
55#endif