authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-09 13:08:39-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-08-09 13:08:39-07:00
log71a27ebd847bbd09d246eaf6657359ecfa0f8483
tree0ca38e8313369e7efc91daa540b0f350c583cffc
parent291fb43f275b368f425380a3028068c7facafabb
parent10949a691403988137d3bc7dd629c4e95c243ab3
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21004 from alexrp/linux-6.10

Linux 6.10 headers/syscalls

310 files changed, 17575 insertions(+), 3299 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+20
......@@ -102,5 +102,25 @@
102102#define HWCAP2_SME_BI32I32 (1UL << 40)
103103#define HWCAP2_SME_B16B16 (1UL << 41)
104104#define HWCAP2_SME_F16F16 (1UL << 42)
105#define HWCAP2_MOPS (1UL << 43)
106#define HWCAP2_HBC (1UL << 44)
107#define HWCAP2_SVE_B16B16 (1UL << 45)
108#define HWCAP2_LRCPC3 (1UL << 46)
109#define HWCAP2_LSE128 (1UL << 47)
110#define HWCAP2_FPMR (1UL << 48)
111#define HWCAP2_LUT (1UL << 49)
112#define HWCAP2_FAMINMAX (1UL << 50)
113#define HWCAP2_F8CVT (1UL << 51)
114#define HWCAP2_F8FMA (1UL << 52)
115#define HWCAP2_F8DP4 (1UL << 53)
116#define HWCAP2_F8DP2 (1UL << 54)
117#define HWCAP2_F8E4M3 (1UL << 55)
118#define HWCAP2_F8E5M2 (1UL << 56)
119#define HWCAP2_SME_LUTV2 (1UL << 57)
120#define HWCAP2_SME_F8F16 (1UL << 58)
121#define HWCAP2_SME_F8F32 (1UL << 59)
122#define HWCAP2_SME_SF8FMA (1UL << 60)
123#define HWCAP2_SME_SF8DP4 (1UL << 61)
124#define HWCAP2_SME_SF8DP2 (1UL << 62)
105125
106126#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h+74-6
......@@ -37,9 +37,7 @@
3737#include <asm/ptrace.h>
3838#include <asm/sve_context.h>
3939
40#define __KVM_HAVE_GUEST_DEBUG
4140#define __KVM_HAVE_IRQ_LINE
42#define __KVM_HAVE_READONLY_MEM
4341#define __KVM_HAVE_VCPU_EVENTS
4442
4543#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
......@@ -76,11 +74,11 @@ struct kvm_regs {
7674
7775/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
7876#define KVM_ARM_DEVICE_TYPE_SHIFT 0
79#define KVM_ARM_DEVICE_TYPE_MASK GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
80 KVM_ARM_DEVICE_TYPE_SHIFT)
77#define KVM_ARM_DEVICE_TYPE_MASK __GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
78 KVM_ARM_DEVICE_TYPE_SHIFT)
8179#define KVM_ARM_DEVICE_ID_SHIFT 16
82#define KVM_ARM_DEVICE_ID_MASK GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
83 KVM_ARM_DEVICE_ID_SHIFT)
80#define KVM_ARM_DEVICE_ID_MASK __GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
81 KVM_ARM_DEVICE_ID_SHIFT)
8482
8583/* Supported device IDs */
8684#define KVM_ARM_DEVICE_VGIC_V2 0
......@@ -162,6 +160,11 @@ struct kvm_sync_regs {
162160 __u64 device_irq_level;
163161};
164162
163/* Bits for run->s.regs.device_irq_level */
164#define KVM_ARM_DEV_EL1_VTIMER (1 << 0)
165#define KVM_ARM_DEV_EL1_PTIMER (1 << 1)
166#define KVM_ARM_DEV_PMU (1 << 2)
167
165168/*
166169 * PMU filter structure. Describe a range of events with a particular
167170 * action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER.
......@@ -198,6 +201,15 @@ struct kvm_arm_copy_mte_tags {
198201 __u64 reserved[2];
199202};
200203
204/*
205 * Counter/Timer offset structure. Describe the virtual/physical offset.
206 * To be used with KVM_ARM_SET_COUNTER_OFFSET.
207 */
208struct kvm_arm_counter_offset {
209 __u64 counter_offset;
210 __u64 reserved;
211};
212
201213#define KVM_ARM_TAGS_TO_GUEST 0
202214#define KVM_ARM_TAGS_FROM_GUEST 1
203215
......@@ -363,6 +375,10 @@ enum {
363375 KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
364376};
365377
378/* Device Control API on vm fd */
379#define KVM_ARM_VM_SMCCC_CTRL 0
380#define KVM_ARM_VM_SMCCC_FILTER 0
381
366382/* Device Control API: ARM VGIC */
367383#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
368384#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
......@@ -402,6 +418,8 @@ enum {
402418#define KVM_ARM_VCPU_TIMER_CTRL 1
403419#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
404420#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
421#define KVM_ARM_VCPU_TIMER_IRQ_HVTIMER 2
422#define KVM_ARM_VCPU_TIMER_IRQ_HPTIMER 3
405423#define KVM_ARM_VCPU_PVTIME_CTRL 2
406424#define KVM_ARM_VCPU_PVTIME_IPA 0
407425
......@@ -458,6 +476,56 @@ enum {
458476/* run->fail_entry.hardware_entry_failure_reason codes. */
459477#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
460478
479enum kvm_smccc_filter_action {
480 KVM_SMCCC_FILTER_HANDLE = 0,
481 KVM_SMCCC_FILTER_DENY,
482 KVM_SMCCC_FILTER_FWD_TO_USER,
483
484};
485
486struct kvm_smccc_filter {
487 __u32 base;
488 __u32 nr_functions;
489 __u8 action;
490 __u8 pad[15];
491};
492
493/* arm64-specific KVM_EXIT_HYPERCALL flags */
494#define KVM_HYPERCALL_EXIT_SMC (1U << 0)
495#define KVM_HYPERCALL_EXIT_16BIT (1U << 1)
496
497/*
498 * Get feature ID registers userspace writable mask.
499 *
500 * From DDI0487J.a, D19.2.66 ("ID_AA64MMFR2_EL1, AArch64 Memory Model
501 * Feature Register 2"):
502 *
503 * "The Feature ID space is defined as the System register space in
504 * AArch64 with op0==3, op1=={0, 1, 3}, CRn==0, CRm=={0-7},
505 * op2=={0-7}."
506 *
507 * This covers all currently known R/O registers that indicate
508 * anything useful feature wise, including the ID registers.
509 *
510 * If we ever need to introduce a new range, it will be described as
511 * such in the range field.
512 */
513#define KVM_ARM_FEATURE_ID_RANGE_IDX(op0, op1, crn, crm, op2) \
514 ({ \
515 __u64 __op1 = (op1) & 3; \
516 __op1 -= (__op1 == 3); \
517 (__op1 << 6 | ((crm) & 7) << 3 | (op2)); \
518 })
519
520#define KVM_ARM_FEATURE_ID_RANGE 0
521#define KVM_ARM_FEATURE_ID_RANGE_SIZE (3 * 8 * 8)
522
523struct reg_mask_range {
524 __u64 addr; /* Pointer to mask array */
525 __u32 range; /* Requested range */
526 __u32 reserved[13];
527};
528
461529#endif
462530
463531#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/sigcontext.h+9-1
......@@ -152,6 +152,14 @@ struct tpidr2_context {
152152 __u64 tpidr2;
153153};
154154
155/* FPMR context */
156#define FPMR_MAGIC 0x46504d52
157
158struct fpmr_context {
159 struct _aarch64_ctx head;
160 __u64 fpmr;
161};
162
155163#define ZA_MAGIC 0x54366345
156164
157165struct za_context {
......@@ -177,7 +185,7 @@ struct zt_context {
177185 * vector length beyond its initial architectural limit of 2048 bits
178186 * (16 quadwords).
179187 *
180 * See linux/Documentation/arm64/sve.rst for a description of the VL/VQ
188 * See linux/Documentation/arch/arm64/sve.rst for a description of the VL/VQ
181189 * terminology.
182190 */
183191#define SVE_VQ_BYTES __SVE_VQ_BYTES /* bytes per quadword */
lib/libc/include/aarch64-linux-any/asm/sve_context.h+11
......@@ -13,6 +13,17 @@
1313
1414#define __SVE_VQ_BYTES 16 /* number of bytes per quadword */
1515
16/*
17 * Yes, __SVE_VQ_MAX is 512 QUADWORDS.
18 *
19 * To help ensure forward portability, this is much larger than the
20 * current maximum value defined by the SVE architecture. While arrays
21 * or static allocations can be sized based on this value, watch out!
22 * It will waste a surprisingly large amount of memory.
23 *
24 * Dynamic sizing based on the actual runtime vector length is likely to
25 * be preferable for most purposes.
26 */
1627#define __SVE_VQ_MIN 1
1728#define __SVE_VQ_MAX 512
1829
lib/libc/include/any-linux-any/asm-generic/bitsperlong.h+16-1
......@@ -2,6 +2,17 @@
22#ifndef __ASM_GENERIC_BITS_PER_LONG
33#define __ASM_GENERIC_BITS_PER_LONG
44
5#ifndef __BITS_PER_LONG
6/*
7 * In order to keep safe and avoid regression, only unify uapi
8 * bitsperlong.h for some archs which are using newer toolchains
9 * that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.
10 * See the following link for more info:
11 * https://lore.kernel.org/linux-arch/b9624545-2c80-49a1-ac3c-39264a591f7b@app.fastmail.com/
12 */
13#if defined(__CHAR_BIT__) && defined(__SIZEOF_LONG__)
14#define __BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__)
15#else
516/*
617 * There seems to be no way of detecting this automatically from user
718 * space, so 64 bit architectures should override this in their
......@@ -9,8 +20,12 @@
920 * both 32 and 64 bit user space must not rely on CONFIG_64BIT
1021 * to decide it, but rather check a compiler provided macro.
1122 */
12#ifndef __BITS_PER_LONG
1323#define __BITS_PER_LONG 32
1424#endif
25#endif
26
27#ifndef __BITS_PER_LONG_LONG
28#define __BITS_PER_LONG_LONG 64
29#endif
1530
1631#endif /* __ASM_GENERIC_BITS_PER_LONG */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/siginfo.h+2-6
......@@ -68,11 +68,6 @@ union __sifields {
6868 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
6969 struct {
7070 void *_addr; /* faulting insn/memory ref. */
71#ifdef __ia64__
72 int _imm; /* immediate value for "break" */
73 unsigned int _flags; /* see ia64 si_flags */
74 unsigned long _isr; /* isr */
75#endif
7671
7772#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \
7873 sizeof(short) : __alignof__(void *))
......@@ -242,7 +237,8 @@ typedef struct siginfo {
242237#define SEGV_ADIPERR 7 /* Precise MCD exception */
243238#define SEGV_MTEAERR 8 /* Asynchronous ARM MTE error */
244239#define SEGV_MTESERR 9 /* Synchronous ARM MTE exception */
245#define NSIGSEGV 9
240#define SEGV_CPERR 10 /* Control protection fault */
241#define NSIGSEGV 10
246242
247243/*
248244 * SIGBUS si_codes
lib/libc/include/any-linux-any/asm-generic/socket.h+3
......@@ -132,6 +132,9 @@
132132
133133#define SO_RCVMARK 75
134134
135#define SO_PASSPIDFD 76
136#define SO_PEERPIDFD 77
137
135138
136139#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
137140/* on 64-bit and x32, avoid the ?: operator */
lib/libc/include/any-linux-any/asm-generic/unistd.h+61-102
......@@ -38,12 +38,12 @@ __SYSCALL(__NR_io_destroy, sys_io_destroy)
3838__SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
3939#define __NR_io_cancel 3
4040__SYSCALL(__NR_io_cancel, sys_io_cancel)
41
4142#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
4243#define __NR_io_getevents 4
4344__SC_3264(__NR_io_getevents, sys_io_getevents_time32, sys_io_getevents)
4445#endif
4546
46/* fs/xattr.c */
4747#define __NR_setxattr 5
4848__SYSCALL(__NR_setxattr, sys_setxattr)
4949#define __NR_lsetxattr 6
......@@ -68,58 +68,38 @@ __SYSCALL(__NR_removexattr, sys_removexattr)
6868__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
6969#define __NR_fremovexattr 16
7070__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
71
72/* fs/dcache.c */
7371#define __NR_getcwd 17
7472__SYSCALL(__NR_getcwd, sys_getcwd)
75
76/* fs/cookies.c */
7773#define __NR_lookup_dcookie 18
78__SC_COMP(__NR_lookup_dcookie, sys_lookup_dcookie, compat_sys_lookup_dcookie)
79
80/* fs/eventfd.c */
74__SYSCALL(__NR_lookup_dcookie, sys_ni_syscall)
8175#define __NR_eventfd2 19
8276__SYSCALL(__NR_eventfd2, sys_eventfd2)
83
84/* fs/eventpoll.c */
8577#define __NR_epoll_create1 20
8678__SYSCALL(__NR_epoll_create1, sys_epoll_create1)
8779#define __NR_epoll_ctl 21
8880__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
8981#define __NR_epoll_pwait 22
9082__SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
91
92/* fs/fcntl.c */
9383#define __NR_dup 23
9484__SYSCALL(__NR_dup, sys_dup)
9585#define __NR_dup3 24
9686__SYSCALL(__NR_dup3, sys_dup3)
9787#define __NR3264_fcntl 25
9888__SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
99
100/* fs/inotify_user.c */
10189#define __NR_inotify_init1 26
10290__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
10391#define __NR_inotify_add_watch 27
10492__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
10593#define __NR_inotify_rm_watch 28
10694__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
107
108/* fs/ioctl.c */
10995#define __NR_ioctl 29
11096__SC_COMP(__NR_ioctl, sys_ioctl, compat_sys_ioctl)
111
112/* fs/ioprio.c */
11397#define __NR_ioprio_set 30
11498__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
11599#define __NR_ioprio_get 31
116100__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
117
118/* fs/locks.c */
119101#define __NR_flock 32
120102__SYSCALL(__NR_flock, sys_flock)
121
122/* fs/namei.c */
123103#define __NR_mknodat 33
124104__SYSCALL(__NR_mknodat, sys_mknodat)
125105#define __NR_mkdirat 34
......@@ -130,25 +110,21 @@ __SYSCALL(__NR_unlinkat, sys_unlinkat)
130110__SYSCALL(__NR_symlinkat, sys_symlinkat)
131111#define __NR_linkat 37
132112__SYSCALL(__NR_linkat, sys_linkat)
113
133114#ifdef __ARCH_WANT_RENAMEAT
134115/* renameat is superseded with flags by renameat2 */
135116#define __NR_renameat 38
136117__SYSCALL(__NR_renameat, sys_renameat)
137118#endif /* __ARCH_WANT_RENAMEAT */
138119
139/* fs/namespace.c */
140120#define __NR_umount2 39
141121__SYSCALL(__NR_umount2, sys_umount)
142122#define __NR_mount 40
143123__SYSCALL(__NR_mount, sys_mount)
144124#define __NR_pivot_root 41
145125__SYSCALL(__NR_pivot_root, sys_pivot_root)
146
147/* fs/nfsctl.c */
148126#define __NR_nfsservctl 42
149127__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
150
151/* fs/open.c */
152128#define __NR3264_statfs 43
153129__SC_COMP_3264(__NR3264_statfs, sys_statfs64, sys_statfs, \
154130 compat_sys_statfs64)
......@@ -161,7 +137,6 @@ __SC_COMP_3264(__NR3264_truncate, sys_truncate64, sys_truncate, \
161137#define __NR3264_ftruncate 46
162138__SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
163139 compat_sys_ftruncate64)
164
165140#define __NR_fallocate 47
166141__SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
167142#define __NR_faccessat 48
......@@ -186,20 +161,12 @@ __SYSCALL(__NR_openat, sys_openat)
186161__SYSCALL(__NR_close, sys_close)
187162#define __NR_vhangup 58
188163__SYSCALL(__NR_vhangup, sys_vhangup)
189
190/* fs/pipe.c */
191164#define __NR_pipe2 59
192165__SYSCALL(__NR_pipe2, sys_pipe2)
193
194/* fs/quota.c */
195166#define __NR_quotactl 60
196167__SYSCALL(__NR_quotactl, sys_quotactl)
197
198/* fs/readdir.c */
199168#define __NR_getdents64 61
200169__SYSCALL(__NR_getdents64, sys_getdents64)
201
202/* fs/read_write.c */
203170#define __NR3264_lseek 62
204171__SC_3264(__NR3264_lseek, sys_llseek, sys_lseek)
205172#define __NR_read 63
......@@ -218,12 +185,9 @@ __SC_COMP(__NR_pwrite64, sys_pwrite64, compat_sys_pwrite64)
218185__SC_COMP(__NR_preadv, sys_preadv, compat_sys_preadv)
219186#define __NR_pwritev 70
220187__SC_COMP(__NR_pwritev, sys_pwritev, compat_sys_pwritev)
221
222/* fs/sendfile.c */
223188#define __NR3264_sendfile 71
224189__SYSCALL(__NR3264_sendfile, sys_sendfile64)
225190
226/* fs/select.c */
227191#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
228192#define __NR_pselect6 72
229193__SC_COMP_3264(__NR_pselect6, sys_pselect6_time32, sys_pselect6, compat_sys_pselect6_time32)
......@@ -231,21 +195,17 @@ __SC_COMP_3264(__NR_pselect6, sys_pselect6_time32, sys_pselect6, compat_sys_psel
231195__SC_COMP_3264(__NR_ppoll, sys_ppoll_time32, sys_ppoll, compat_sys_ppoll_time32)
232196#endif
233197
234/* fs/signalfd.c */
235198#define __NR_signalfd4 74
236199__SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
237
238/* fs/splice.c */
239200#define __NR_vmsplice 75
240201__SYSCALL(__NR_vmsplice, sys_vmsplice)
241202#define __NR_splice 76
242203__SYSCALL(__NR_splice, sys_splice)
243204#define __NR_tee 77
244205__SYSCALL(__NR_tee, sys_tee)
245
246/* fs/stat.c */
247206#define __NR_readlinkat 78
248207__SYSCALL(__NR_readlinkat, sys_readlinkat)
208
249209#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
250210#define __NR3264_fstatat 79
251211__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
......@@ -253,13 +213,13 @@ __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
253213__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
254214#endif
255215
256/* fs/sync.c */
257216#define __NR_sync 81
258217__SYSCALL(__NR_sync, sys_sync)
259218#define __NR_fsync 82
260219__SYSCALL(__NR_fsync, sys_fsync)
261220#define __NR_fdatasync 83
262221__SYSCALL(__NR_fdatasync, sys_fdatasync)
222
263223#ifdef __ARCH_WANT_SYNC_FILE_RANGE2
264224#define __NR_sync_file_range2 84
265225__SC_COMP(__NR_sync_file_range2, sys_sync_file_range2, \
......@@ -270,9 +230,9 @@ __SC_COMP(__NR_sync_file_range, sys_sync_file_range, \
270230 compat_sys_sync_file_range)
271231#endif
272232
273/* fs/timerfd.c */
274233#define __NR_timerfd_create 85
275234__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
235
276236#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
277237#define __NR_timerfd_settime 86
278238__SC_3264(__NR_timerfd_settime, sys_timerfd_settime32, \
......@@ -282,45 +242,35 @@ __SC_3264(__NR_timerfd_gettime, sys_timerfd_gettime32, \
282242 sys_timerfd_gettime)
283243#endif
284244
285/* fs/utimes.c */
286245#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
287246#define __NR_utimensat 88
288247__SC_3264(__NR_utimensat, sys_utimensat_time32, sys_utimensat)
289248#endif
290249
291/* kernel/acct.c */
292250#define __NR_acct 89
293251__SYSCALL(__NR_acct, sys_acct)
294
295/* kernel/capability.c */
296252#define __NR_capget 90
297253__SYSCALL(__NR_capget, sys_capget)
298254#define __NR_capset 91
299255__SYSCALL(__NR_capset, sys_capset)
300
301/* kernel/exec_domain.c */
302256#define __NR_personality 92
303257__SYSCALL(__NR_personality, sys_personality)
304
305/* kernel/exit.c */
306258#define __NR_exit 93
307259__SYSCALL(__NR_exit, sys_exit)
308260#define __NR_exit_group 94
309261__SYSCALL(__NR_exit_group, sys_exit_group)
310262#define __NR_waitid 95
311263__SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
312
313/* kernel/fork.c */
314264#define __NR_set_tid_address 96
315265__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
316266#define __NR_unshare 97
317267__SYSCALL(__NR_unshare, sys_unshare)
318268
319/* kernel/futex.c */
320269#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
321270#define __NR_futex 98
322271__SC_3264(__NR_futex, sys_futex_time32, sys_futex)
323272#endif
273
324274#define __NR_set_robust_list 99
325275__SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
326276 compat_sys_set_robust_list)
......@@ -328,43 +278,40 @@ __SC_COMP(__NR_set_robust_list, sys_set_robust_list, \
328278__SC_COMP(__NR_get_robust_list, sys_get_robust_list, \
329279 compat_sys_get_robust_list)
330280
331/* kernel/hrtimer.c */
332281#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
333282#define __NR_nanosleep 101
334283__SC_3264(__NR_nanosleep, sys_nanosleep_time32, sys_nanosleep)
335284#endif
336285
337/* kernel/itimer.c */
338286#define __NR_getitimer 102
339287__SC_COMP(__NR_getitimer, sys_getitimer, compat_sys_getitimer)
340288#define __NR_setitimer 103
341289__SC_COMP(__NR_setitimer, sys_setitimer, compat_sys_setitimer)
342
343/* kernel/kexec.c */
344290#define __NR_kexec_load 104
345291__SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
346
347/* kernel/module.c */
348292#define __NR_init_module 105
349293__SYSCALL(__NR_init_module, sys_init_module)
350294#define __NR_delete_module 106
351295__SYSCALL(__NR_delete_module, sys_delete_module)
352
353/* kernel/posix-timers.c */
354296#define __NR_timer_create 107
355297__SC_COMP(__NR_timer_create, sys_timer_create, compat_sys_timer_create)
298
356299#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
357300#define __NR_timer_gettime 108
358301__SC_3264(__NR_timer_gettime, sys_timer_gettime32, sys_timer_gettime)
359302#endif
303
360304#define __NR_timer_getoverrun 109
361305__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
306
362307#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
363308#define __NR_timer_settime 110
364309__SC_3264(__NR_timer_settime, sys_timer_settime32, sys_timer_settime)
365310#endif
311
366312#define __NR_timer_delete 111
367313__SYSCALL(__NR_timer_delete, sys_timer_delete)
314
368315#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
369316#define __NR_clock_settime 112
370317__SC_3264(__NR_clock_settime, sys_clock_settime32, sys_clock_settime)
......@@ -377,15 +324,10 @@ __SC_3264(__NR_clock_nanosleep, sys_clock_nanosleep_time32, \
377324 sys_clock_nanosleep)
378325#endif
379326
380/* kernel/printk.c */
381327#define __NR_syslog 116
382328__SYSCALL(__NR_syslog, sys_syslog)
383
384/* kernel/ptrace.c */
385329#define __NR_ptrace 117
386330__SC_COMP(__NR_ptrace, sys_ptrace, compat_sys_ptrace)
387
388/* kernel/sched/core.c */
389331#define __NR_sched_setparam 118
390332__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
391333#define __NR_sched_setscheduler 119
......@@ -406,13 +348,13 @@ __SYSCALL(__NR_sched_yield, sys_sched_yield)
406348__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
407349#define __NR_sched_get_priority_min 126
408350__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
351
409352#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
410353#define __NR_sched_rr_get_interval 127
411354__SC_3264(__NR_sched_rr_get_interval, sys_sched_rr_get_interval_time32, \
412355 sys_sched_rr_get_interval)
413356#endif
414357
415/* kernel/signal.c */
416358#define __NR_restart_syscall 128
417359__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
418360#define __NR_kill 129
......@@ -431,18 +373,18 @@ __SC_COMP(__NR_rt_sigaction, sys_rt_sigaction, compat_sys_rt_sigaction)
431373__SC_COMP(__NR_rt_sigprocmask, sys_rt_sigprocmask, compat_sys_rt_sigprocmask)
432374#define __NR_rt_sigpending 136
433375__SC_COMP(__NR_rt_sigpending, sys_rt_sigpending, compat_sys_rt_sigpending)
376
434377#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
435378#define __NR_rt_sigtimedwait 137
436379__SC_COMP_3264(__NR_rt_sigtimedwait, sys_rt_sigtimedwait_time32, \
437380 sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time32)
438381#endif
382
439383#define __NR_rt_sigqueueinfo 138
440384__SC_COMP(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo, \
441385 compat_sys_rt_sigqueueinfo)
442386#define __NR_rt_sigreturn 139
443387__SC_COMP(__NR_rt_sigreturn, sys_rt_sigreturn, compat_sys_rt_sigreturn)
444
445/* kernel/sys.c */
446388#define __NR_setpriority 140
447389__SYSCALL(__NR_setpriority, sys_setpriority)
448390#define __NR_getpriority 141
......@@ -507,7 +449,6 @@ __SYSCALL(__NR_prctl, sys_prctl)
507449#define __NR_getcpu 168
508450__SYSCALL(__NR_getcpu, sys_getcpu)
509451
510/* kernel/time.c */
511452#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
512453#define __NR_gettimeofday 169
513454__SC_COMP(__NR_gettimeofday, sys_gettimeofday, compat_sys_gettimeofday)
......@@ -517,7 +458,6 @@ __SC_COMP(__NR_settimeofday, sys_settimeofday, compat_sys_settimeofday)
517458__SC_3264(__NR_adjtimex, sys_adjtimex_time32, sys_adjtimex)
518459#endif
519460
520/* kernel/sys.c */
521461#define __NR_getpid 172
522462__SYSCALL(__NR_getpid, sys_getpid)
523463#define __NR_getppid 173
......@@ -534,12 +474,11 @@ __SYSCALL(__NR_getegid, sys_getegid)
534474__SYSCALL(__NR_gettid, sys_gettid)
535475#define __NR_sysinfo 179
536476__SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
537
538/* ipc/mqueue.c */
539477#define __NR_mq_open 180
540478__SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
541479#define __NR_mq_unlink 181
542480__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
481
543482#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
544483#define __NR_mq_timedsend 182
545484__SC_3264(__NR_mq_timedsend, sys_mq_timedsend_time32, sys_mq_timedsend)
......@@ -547,12 +486,11 @@ __SC_3264(__NR_mq_timedsend, sys_mq_timedsend_time32, sys_mq_timedsend)
547486__SC_3264(__NR_mq_timedreceive, sys_mq_timedreceive_time32, \
548487 sys_mq_timedreceive)
549488#endif
489
550490#define __NR_mq_notify 184
551491__SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)
552492#define __NR_mq_getsetattr 185
553493__SC_COMP(__NR_mq_getsetattr, sys_mq_getsetattr, compat_sys_mq_getsetattr)
554
555/* ipc/msg.c */
556494#define __NR_msgget 186
557495__SYSCALL(__NR_msgget, sys_msgget)
558496#define __NR_msgctl 187
......@@ -561,20 +499,18 @@ __SC_COMP(__NR_msgctl, sys_msgctl, compat_sys_msgctl)
561499__SC_COMP(__NR_msgrcv, sys_msgrcv, compat_sys_msgrcv)
562500#define __NR_msgsnd 189
563501__SC_COMP(__NR_msgsnd, sys_msgsnd, compat_sys_msgsnd)
564
565/* ipc/sem.c */
566502#define __NR_semget 190
567503__SYSCALL(__NR_semget, sys_semget)
568504#define __NR_semctl 191
569505__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
506
570507#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
571508#define __NR_semtimedop 192
572509__SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop)
573510#endif
511
574512#define __NR_semop 193
575513__SYSCALL(__NR_semop, sys_semop)
576
577/* ipc/shm.c */
578514#define __NR_shmget 194
579515__SYSCALL(__NR_shmget, sys_shmget)
580516#define __NR_shmctl 195
......@@ -583,8 +519,6 @@ __SC_COMP(__NR_shmctl, sys_shmctl, compat_sys_shmctl)
583519__SC_COMP(__NR_shmat, sys_shmat, compat_sys_shmat)
584520#define __NR_shmdt 197
585521__SYSCALL(__NR_shmdt, sys_shmdt)
586
587/* net/socket.c */
588522#define __NR_socket 198
589523__SYSCALL(__NR_socket, sys_socket)
590524#define __NR_socketpair 199
......@@ -615,40 +549,30 @@ __SYSCALL(__NR_shutdown, sys_shutdown)
615549__SC_COMP(__NR_sendmsg, sys_sendmsg, compat_sys_sendmsg)
616550#define __NR_recvmsg 212
617551__SC_COMP(__NR_recvmsg, sys_recvmsg, compat_sys_recvmsg)
618
619/* mm/filemap.c */
620552#define __NR_readahead 213
621553__SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
622
623/* mm/nommu.c, also with MMU */
624554#define __NR_brk 214
625555__SYSCALL(__NR_brk, sys_brk)
626556#define __NR_munmap 215
627557__SYSCALL(__NR_munmap, sys_munmap)
628558#define __NR_mremap 216
629559__SYSCALL(__NR_mremap, sys_mremap)
630
631/* security/keys/keyctl.c */
632560#define __NR_add_key 217
633561__SYSCALL(__NR_add_key, sys_add_key)
634562#define __NR_request_key 218
635563__SYSCALL(__NR_request_key, sys_request_key)
636564#define __NR_keyctl 219
637565__SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
638
639/* arch/example/kernel/sys_example.c */
640566#define __NR_clone 220
641567__SYSCALL(__NR_clone, sys_clone)
642568#define __NR_execve 221
643569__SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
644
645570#define __NR3264_mmap 222
646571__SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap)
647/* mm/fadvise.c */
648572#define __NR3264_fadvise64 223
649573__SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
650574
651/* mm/, CONFIG_MMU only */
575/* CONFIG_MMU only */
652576#ifndef __ARCH_NOMMU
653577#define __NR_swapon 224
654578__SYSCALL(__NR_swapon, sys_swapon)
......@@ -691,6 +615,7 @@ __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
691615__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
692616#define __NR_accept4 242
693617__SYSCALL(__NR_accept4, sys_accept4)
618
694619#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
695620#define __NR_recvmmsg 243
696621__SC_COMP_3264(__NR_recvmmsg, sys_recvmmsg_time32, sys_recvmmsg, compat_sys_recvmmsg_time32)
......@@ -706,6 +631,7 @@ __SC_COMP_3264(__NR_recvmmsg, sys_recvmmsg_time32, sys_recvmmsg, compat_sys_recv
706631#define __NR_wait4 260
707632__SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
708633#endif
634
709635#define __NR_prlimit64 261
710636__SYSCALL(__NR_prlimit64, sys_prlimit64)
711637#define __NR_fanotify_init 262
......@@ -716,10 +642,12 @@ __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
716642__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
717643#define __NR_open_by_handle_at 265
718644__SYSCALL(__NR_open_by_handle_at, sys_open_by_handle_at)
645
719646#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
720647#define __NR_clock_adjtime 266
721648__SC_3264(__NR_clock_adjtime, sys_clock_adjtime32, sys_clock_adjtime)
722649#endif
650
723651#define __NR_syncfs 267
724652__SYSCALL(__NR_syncfs, sys_syncfs)
725653#define __NR_setns 268
......@@ -770,15 +698,19 @@ __SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
770698__SYSCALL(__NR_pkey_free, sys_pkey_free)
771699#define __NR_statx 291
772700__SYSCALL(__NR_statx, sys_statx)
701
773702#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
774703#define __NR_io_pgetevents 292
775704__SC_COMP_3264(__NR_io_pgetevents, sys_io_pgetevents_time32, sys_io_pgetevents, compat_sys_io_pgetevents)
776705#endif
706
777707#define __NR_rseq 293
778708__SYSCALL(__NR_rseq, sys_rseq)
779709#define __NR_kexec_file_load 294
780710__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
711
781712/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
713
782714#if defined(__SYSCALL_COMPAT) || __BITS_PER_LONG == 32
783715#define __NR_clock_gettime64 403
784716__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
......@@ -805,7 +737,7 @@ __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64)
805737#define __NR_ppoll_time64 414
806738__SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64)
807739#define __NR_io_pgetevents_time64 416
808__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents)
740__SC_COMP(__NR_io_pgetevents_time64, sys_io_pgetevents, compat_sys_io_pgetevents_time64)
809741#define __NR_recvmmsg_time64 417
810742__SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64)
811743#define __NR_mq_timedsend_time64 418
......@@ -844,13 +776,14 @@ __SYSCALL(__NR_fsmount, sys_fsmount)
844776__SYSCALL(__NR_fspick, sys_fspick)
845777#define __NR_pidfd_open 434
846778__SYSCALL(__NR_pidfd_open, sys_pidfd_open)
779
847780#ifdef __ARCH_WANT_SYS_CLONE3
848781#define __NR_clone3 435
849782__SYSCALL(__NR_clone3, sys_clone3)
850783#endif
784
851785#define __NR_close_range 436
852786__SYSCALL(__NR_close_range, sys_close_range)
853
854787#define __NR_openat2 437
855788__SYSCALL(__NR_openat2, sys_openat2)
856789#define __NR_pidfd_getfd 438
......@@ -865,7 +798,6 @@ __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
865798__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
866799#define __NR_quotactl_fd 443
867800__SYSCALL(__NR_quotactl_fd, sys_quotactl_fd)
868
869801#define __NR_landlock_create_ruleset 444
870802__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
871803#define __NR_landlock_add_rule 445
......@@ -877,17 +809,44 @@ __SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self)
877809#define __NR_memfd_secret 447
878810__SYSCALL(__NR_memfd_secret, sys_memfd_secret)
879811#endif
812
880813#define __NR_process_mrelease 448
881814__SYSCALL(__NR_process_mrelease, sys_process_mrelease)
882
883815#define __NR_futex_waitv 449
884816__SYSCALL(__NR_futex_waitv, sys_futex_waitv)
885
886817#define __NR_set_mempolicy_home_node 450
887818__SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
819#define __NR_cachestat 451
820__SYSCALL(__NR_cachestat, sys_cachestat)
821#define __NR_fchmodat2 452
822__SYSCALL(__NR_fchmodat2, sys_fchmodat2)
823#define __NR_map_shadow_stack 453
824__SYSCALL(__NR_map_shadow_stack, sys_map_shadow_stack)
825#define __NR_futex_wake 454
826__SYSCALL(__NR_futex_wake, sys_futex_wake)
827#define __NR_futex_wait 455
828__SYSCALL(__NR_futex_wait, sys_futex_wait)
829#define __NR_futex_requeue 456
830__SYSCALL(__NR_futex_requeue, sys_futex_requeue)
831
832#define __NR_statmount 457
833__SYSCALL(__NR_statmount, sys_statmount)
834
835#define __NR_listmount 458
836__SYSCALL(__NR_listmount, sys_listmount)
837
838#define __NR_lsm_get_self_attr 459
839__SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr)
840#define __NR_lsm_set_self_attr 460
841__SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
842#define __NR_lsm_list_modules 461
843__SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
844
845#define __NR_mseal 462
846__SYSCALL(__NR_mseal, sys_mseal)
888847
889848#undef __NR_syscalls
890#define __NR_syscalls 451
849#define __NR_syscalls 463
891850
892851/*
893852 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+62-5
......@@ -94,6 +94,9 @@ extern "C" {
9494 *
9595 * %AMDGPU_GEM_DOMAIN_OA Ordered append, used by 3D or Compute engines
9696 * for appending data.
97 *
98 * %AMDGPU_GEM_DOMAIN_DOORBELL Doorbell. It is an MMIO region for
99 * signalling user mode queues.
97100 */
98101#define AMDGPU_GEM_DOMAIN_CPU 0x1
99102#define AMDGPU_GEM_DOMAIN_GTT 0x2
......@@ -101,12 +104,14 @@ extern "C" {
101104#define AMDGPU_GEM_DOMAIN_GDS 0x8
102105#define AMDGPU_GEM_DOMAIN_GWS 0x10
103106#define AMDGPU_GEM_DOMAIN_OA 0x20
107#define AMDGPU_GEM_DOMAIN_DOORBELL 0x40
104108#define AMDGPU_GEM_DOMAIN_MASK (AMDGPU_GEM_DOMAIN_CPU | \
105109 AMDGPU_GEM_DOMAIN_GTT | \
106110 AMDGPU_GEM_DOMAIN_VRAM | \
107111 AMDGPU_GEM_DOMAIN_GDS | \
108112 AMDGPU_GEM_DOMAIN_GWS | \
109 AMDGPU_GEM_DOMAIN_OA)
113 AMDGPU_GEM_DOMAIN_OA | \
114 AMDGPU_GEM_DOMAIN_DOORBELL)
110115
111116/* Flag that CPU access will be required for the case of VRAM domain */
112117#define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0)
......@@ -145,7 +150,7 @@ extern "C" {
145150 */
146151#define AMDGPU_GEM_CREATE_DISCARDABLE (1 << 12)
147152/* Flag that BO is shared coherently between multiple devices or CPU threads.
148 * May depend on GPU instructions to flush caches explicitly
153 * May depend on GPU instructions to flush caches to system scope explicitly.
149154 *
150155 * This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
151156 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
......@@ -158,6 +163,14 @@ extern "C" {
158163 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
159164 */
160165#define AMDGPU_GEM_CREATE_UNCACHED (1 << 14)
166/* Flag that BO should be coherent across devices when using device-level
167 * atomics. May depend on GPU instructions to flush caches to device scope
168 * explicitly, promoting them to system scope automatically.
169 *
170 * This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
171 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
172 */
173#define AMDGPU_GEM_CREATE_EXT_COHERENT (1 << 15)
161174
162175struct drm_amdgpu_gem_create_in {
163176 /** the requested memory size */
......@@ -236,15 +249,17 @@ union drm_amdgpu_bo_list {
236249/* unknown cause */
237250#define AMDGPU_CTX_UNKNOWN_RESET 3
238251
239/* indicate gpu reset occured after ctx created */
252/* indicate gpu reset occurred after ctx created */
240253#define AMDGPU_CTX_QUERY2_FLAGS_RESET (1<<0)
241/* indicate vram lost occured after ctx created */
254/* indicate vram lost occurred after ctx created */
242255#define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1<<1)
243256/* indicate some job from this context once cause gpu hang */
244257#define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1<<2)
245258/* indicate some errors are detected by RAS */
246259#define AMDGPU_CTX_QUERY2_FLAGS_RAS_CE (1<<3)
247260#define AMDGPU_CTX_QUERY2_FLAGS_RAS_UE (1<<4)
261/* indicate that the reset hasn't completed yet */
262#define AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS (1<<5)
248263
249264/* Context priority level */
250265#define AMDGPU_CTX_PRIORITY_UNSET -2048
......@@ -579,7 +594,8 @@ struct drm_amdgpu_gem_va {
579594 */
580595#define AMDGPU_HW_IP_VCN_ENC 7
581596#define AMDGPU_HW_IP_VCN_JPEG 8
582#define AMDGPU_HW_IP_NUM 9
597#define AMDGPU_HW_IP_VPE 9
598#define AMDGPU_HW_IP_NUM 10
583599
584600#define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1
585601
......@@ -592,6 +608,7 @@ struct drm_amdgpu_gem_va {
592608#define AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES 0x07
593609#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x08
594610#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x09
611#define AMDGPU_CHUNK_ID_CP_GFX_SHADOW 0x0a
595612
596613struct drm_amdgpu_cs_chunk {
597614 __u32 chunk_id;
......@@ -708,6 +725,15 @@ struct drm_amdgpu_cs_chunk_data {
708725 };
709726};
710727
728#define AMDGPU_CS_CHUNK_CP_GFX_SHADOW_FLAGS_INIT_SHADOW 0x1
729
730struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
731 __u64 shadow_va;
732 __u64 csa_va;
733 __u64 gds_va;
734 __u64 flags;
735};
736
711737/*
712738 * Query h/w info: Flag that this is integrated (a.h.a. fusion) GPU
713739 *
......@@ -780,6 +806,8 @@ struct drm_amdgpu_cs_chunk_data {
780806 #define AMDGPU_INFO_FW_MES 0x1a
781807 /* Subquery id: Query IMU firmware version */
782808 #define AMDGPU_INFO_FW_IMU 0x1b
809 /* Subquery id: Query VPE firmware version */
810 #define AMDGPU_INFO_FW_VPE 0x1c
783811
784812/* number of bytes moved for TTM migration */
785813#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
......@@ -837,6 +865,8 @@ struct drm_amdgpu_cs_chunk_data {
837865 #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa
838866 /* Subquery id: Query GPU peak pstate memory clock */
839867 #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb
868 /* Subquery id: Query input GPU power */
869 #define AMDGPU_INFO_SENSOR_GPU_INPUT_POWER 0xc
840870/* Number of VRAM page faults on CPU access. */
841871#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
842872#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
......@@ -876,6 +906,10 @@ struct drm_amdgpu_cs_chunk_data {
876906 #define AMDGPU_INFO_VIDEO_CAPS_DECODE 0
877907 /* Subquery id: Encode */
878908 #define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1
909/* Query the max number of IBs per gang per submission */
910#define AMDGPU_INFO_MAX_IBS 0x22
911/* query last page fault info */
912#define AMDGPU_INFO_GPUVM_FAULT 0x23
879913
880914#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
881915#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
......@@ -1126,6 +1160,14 @@ struct drm_amdgpu_info_device {
11261160 __u64 mall_size; /* AKA infinity cache */
11271161 /* high 32 bits of the rb pipes mask */
11281162 __u32 enabled_rb_pipes_mask_hi;
1163 /* shadow area size for gfx11 */
1164 __u32 shadow_size;
1165 /* shadow area base virtual alignment for gfx11 */
1166 __u32 shadow_alignment;
1167 /* context save area size for gfx11 */
1168 __u32 csa_size;
1169 /* context save area base virtual alignment for gfx11 */
1170 __u32 csa_alignment;
11291171};
11301172
11311173struct drm_amdgpu_info_hw_ip {
......@@ -1193,6 +1235,20 @@ struct drm_amdgpu_info_video_caps {
11931235 struct drm_amdgpu_info_video_codec_info codec_info[AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT];
11941236};
11951237
1238#define AMDGPU_VMHUB_TYPE_MASK 0xff
1239#define AMDGPU_VMHUB_TYPE_SHIFT 0
1240#define AMDGPU_VMHUB_TYPE_GFX 0
1241#define AMDGPU_VMHUB_TYPE_MM0 1
1242#define AMDGPU_VMHUB_TYPE_MM1 2
1243#define AMDGPU_VMHUB_IDX_MASK 0xff00
1244#define AMDGPU_VMHUB_IDX_SHIFT 8
1245
1246struct drm_amdgpu_info_gpuvm_fault {
1247 __u64 addr;
1248 __u32 status;
1249 __u32 vmhub;
1250};
1251
11961252/*
11971253 * Supported GPU families
11981254 */
......@@ -1211,6 +1267,7 @@ struct drm_amdgpu_info_video_caps {
12111267#define AMDGPU_FAMILY_GC_11_0_1 148 /* GC 11.0.1 */
12121268#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */
12131269#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */
1270#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
12141271
12151272#if defined(__cplusplus)
12161273}
lib/libc/include/any-linux-any/drm/drm.h+215-18
......@@ -667,8 +667,11 @@ struct drm_gem_open {
667667 * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
668668 * and &DRM_PRIME_CAP_EXPORT.
669669 *
670 * PRIME buffers are exposed as dma-buf file descriptors. See
671 * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing".
670 * Starting from kernel version 6.6, both &DRM_PRIME_CAP_IMPORT and
671 * &DRM_PRIME_CAP_EXPORT are always advertised.
672 *
673 * PRIME buffers are exposed as dma-buf file descriptors.
674 * See :ref:`prime_buffer_sharing`.
672675 */
673676#define DRM_CAP_PRIME 0x5
674677/**
......@@ -676,6 +679,8 @@ struct drm_gem_open {
676679 *
677680 * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
678681 * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
682 *
683 * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
679684 */
680685#define DRM_PRIME_CAP_IMPORT 0x1
681686/**
......@@ -683,6 +688,8 @@ struct drm_gem_open {
683688 *
684689 * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
685690 * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
691 *
692 * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
686693 */
687694#define DRM_PRIME_CAP_EXPORT 0x2
688695/**
......@@ -700,7 +707,8 @@ struct drm_gem_open {
700707/**
701708 * DRM_CAP_ASYNC_PAGE_FLIP
702709 *
703 * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC.
710 * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for legacy
711 * page-flips.
704712 */
705713#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
706714/**
......@@ -750,17 +758,23 @@ struct drm_gem_open {
750758/**
751759 * DRM_CAP_SYNCOBJ
752760 *
753 * If set to 1, the driver supports sync objects. See
754 * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
761 * If set to 1, the driver supports sync objects. See :ref:`drm_sync_objects`.
755762 */
756763#define DRM_CAP_SYNCOBJ 0x13
757764/**
758765 * DRM_CAP_SYNCOBJ_TIMELINE
759766 *
760767 * If set to 1, the driver supports timeline operations on sync objects. See
761 * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
768 * :ref:`drm_sync_objects`.
762769 */
763770#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
771/**
772 * DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP
773 *
774 * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for atomic
775 * commits.
776 */
777#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
764778
765779/* DRM_IOCTL_GET_CAP ioctl argument type */
766780struct drm_get_cap {
......@@ -830,6 +844,31 @@ struct drm_get_cap {
830844 */
831845#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
832846
847/**
848 * DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT
849 *
850 * Drivers for para-virtualized hardware (e.g. vmwgfx, qxl, virtio and
851 * virtualbox) have additional restrictions for cursor planes (thus
852 * making cursor planes on those drivers not truly universal,) e.g.
853 * they need cursor planes to act like one would expect from a mouse
854 * cursor and have correctly set hotspot properties.
855 * If this client cap is not set the DRM core will hide cursor plane on
856 * those virtualized drivers because not setting it implies that the
857 * client is not capable of dealing with those extra restictions.
858 * Clients which do set cursor hotspot and treat the cursor plane
859 * like a mouse cursor should set this property.
860 * The client must enable &DRM_CLIENT_CAP_ATOMIC first.
861 *
862 * Setting this property on drivers which do not special case
863 * cursor planes (i.e. non-virtualized drivers) will return
864 * EOPNOTSUPP, which can be used by userspace to gauge
865 * requirements of the hardware/drivers they're running on.
866 *
867 * This capability is always supported for atomic-capable virtualized
868 * drivers starting from kernel version 6.6.
869 */
870#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6
871
833872/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
834873struct drm_set_client_cap {
835874 __u64 capability;
......@@ -881,6 +920,7 @@ struct drm_syncobj_transfer {
881920#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
882921#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
883922#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
923#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE (1 << 3) /* set fence deadline to deadline_nsec */
884924struct drm_syncobj_wait {
885925 __u64 handles;
886926 /* absolute timeout */
......@@ -889,6 +929,14 @@ struct drm_syncobj_wait {
889929 __u32 flags;
890930 __u32 first_signaled; /* only valid when not waiting all */
891931 __u32 pad;
932 /**
933 * @deadline_nsec - fence deadline hint
934 *
935 * Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
936 * fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
937 * set.
938 */
939 __u64 deadline_nsec;
892940};
893941
894942struct drm_syncobj_timeline_wait {
......@@ -901,6 +949,35 @@ struct drm_syncobj_timeline_wait {
901949 __u32 flags;
902950 __u32 first_signaled; /* only valid when not waiting all */
903951 __u32 pad;
952 /**
953 * @deadline_nsec - fence deadline hint
954 *
955 * Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
956 * fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
957 * set.
958 */
959 __u64 deadline_nsec;
960};
961
962/**
963 * struct drm_syncobj_eventfd
964 * @handle: syncobj handle.
965 * @flags: Zero to wait for the point to be signalled, or
966 * &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
967 * available for the point.
968 * @point: syncobj timeline point (set to zero for binary syncobjs).
969 * @fd: Existing eventfd to sent events to.
970 * @pad: Must be zero.
971 *
972 * Register an eventfd to be signalled by a syncobj. The eventfd counter will
973 * be incremented by one.
974 */
975struct drm_syncobj_eventfd {
976 __u32 handle;
977 __u32 flags;
978 __u64 point;
979 __s32 fd;
980 __u32 pad;
904981};
905982
906983
......@@ -966,6 +1043,19 @@ extern "C" {
9661043#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
9671044#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
9681045#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
1046/**
1047 * DRM_IOCTL_GEM_CLOSE - Close a GEM handle.
1048 *
1049 * GEM handles are not reference-counted by the kernel. User-space is
1050 * responsible for managing their lifetime. For example, if user-space imports
1051 * the same memory object twice on the same DRM file description, the same GEM
1052 * handle is returned by both imports, and user-space needs to ensure
1053 * &DRM_IOCTL_GEM_CLOSE is performed once only. The same situation can happen
1054 * when a memory object is allocated, then exported and imported again on the
1055 * same DRM file description. The &DRM_IOCTL_MODE_GETFB2 IOCTL is an exception
1056 * and always returns fresh new GEM handles even if an existing GEM handle
1057 * already refers to the same memory object before the IOCTL is performed.
1058 */
9691059#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
9701060#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
9711061#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
......@@ -1006,7 +1096,37 @@ extern "C" {
10061096#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
10071097#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
10081098
1099/**
1100 * DRM_IOCTL_PRIME_HANDLE_TO_FD - Convert a GEM handle to a DMA-BUF FD.
1101 *
1102 * User-space sets &drm_prime_handle.handle with the GEM handle to export and
1103 * &drm_prime_handle.flags, and gets back a DMA-BUF file descriptor in
1104 * &drm_prime_handle.fd.
1105 *
1106 * The export can fail for any driver-specific reason, e.g. because export is
1107 * not supported for this specific GEM handle (but might be for others).
1108 *
1109 * Support for exporting DMA-BUFs is advertised via &DRM_PRIME_CAP_EXPORT.
1110 */
10091111#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
1112/**
1113 * DRM_IOCTL_PRIME_FD_TO_HANDLE - Convert a DMA-BUF FD to a GEM handle.
1114 *
1115 * User-space sets &drm_prime_handle.fd with a DMA-BUF file descriptor to
1116 * import, and gets back a GEM handle in &drm_prime_handle.handle.
1117 * &drm_prime_handle.flags is unused.
1118 *
1119 * If an existing GEM handle refers to the memory object backing the DMA-BUF,
1120 * that GEM handle is returned. Therefore user-space which needs to handle
1121 * arbitrary DMA-BUFs must have a user-space lookup data structure to manually
1122 * reference-count duplicated GEM handles. For more information see
1123 * &DRM_IOCTL_GEM_CLOSE.
1124 *
1125 * The import can fail for any driver-specific reason, e.g. because import is
1126 * only supported for DMA-BUFs allocated on this DRM device.
1127 *
1128 * Support for importing DMA-BUFs is advertised via &DRM_PRIME_CAP_IMPORT.
1129 */
10101130#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
10111131
10121132#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
......@@ -1058,6 +1178,26 @@ extern "C" {
10581178#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
10591179#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
10601180
1181/**
1182 * DRM_IOCTL_MODE_CREATE_DUMB - Create a new dumb buffer object.
1183 *
1184 * KMS dumb buffers provide a very primitive way to allocate a buffer object
1185 * suitable for scanout and map it for software rendering. KMS dumb buffers are
1186 * not suitable for hardware-accelerated rendering nor video decoding. KMS dumb
1187 * buffers are not suitable to be displayed on any other device than the KMS
1188 * device where they were allocated from. Also see
1189 * :ref:`kms_dumb_buffer_objects`.
1190 *
1191 * The IOCTL argument is a struct drm_mode_create_dumb.
1192 *
1193 * User-space is expected to create a KMS dumb buffer via this IOCTL, then add
1194 * it as a KMS framebuffer via &DRM_IOCTL_MODE_ADDFB and map it via
1195 * &DRM_IOCTL_MODE_MAP_DUMB.
1196 *
1197 * &DRM_CAP_DUMB_BUFFER indicates whether this IOCTL is supported.
1198 * &DRM_CAP_DUMB_PREFERRED_DEPTH and &DRM_CAP_DUMB_PREFER_SHADOW indicate
1199 * driver preferences for dumb buffers.
1200 */
10611201#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
10621202#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
10631203#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
......@@ -1098,8 +1238,13 @@ extern "C" {
10981238 * struct as the output.
10991239 *
11001240 * If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles
1101 * will be filled with GEM buffer handles. Planes are valid until one has a
1102 * zero handle -- this can be used to compute the number of planes.
1241 * will be filled with GEM buffer handles. Fresh new GEM handles are always
1242 * returned, even if another GEM handle referring to the same memory object
1243 * already exists on the DRM file description. The caller is responsible for
1244 * removing the new handles, e.g. via the &DRM_IOCTL_GEM_CLOSE IOCTL. The same
1245 * new handle will be returned for multiple planes in case they use the same
1246 * memory object. Planes are valid until one has a zero handle -- this can be
1247 * used to compute the number of planes.
11031248 *
11041249 * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid
11051250 * until one has a zero &drm_mode_fb_cmd2.pitches.
......@@ -1107,9 +1252,36 @@ extern "C" {
11071252 * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set
11081253 * in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the
11091254 * modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.
1255 *
1256 * To obtain DMA-BUF FDs for each plane without leaking GEM handles, user-space
1257 * can export each handle via &DRM_IOCTL_PRIME_HANDLE_TO_FD, then immediately
1258 * close each unique handle via &DRM_IOCTL_GEM_CLOSE, making sure to not
1259 * double-close handles which are specified multiple times in the array.
11101260 */
11111261#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
11121262
1263#define DRM_IOCTL_SYNCOBJ_EVENTFD DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
1264
1265/**
1266 * DRM_IOCTL_MODE_CLOSEFB - Close a framebuffer.
1267 *
1268 * This closes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
1269 * argument is a framebuffer object ID.
1270 *
1271 * This IOCTL is similar to &DRM_IOCTL_MODE_RMFB, except it doesn't disable
1272 * planes and CRTCs. As long as the framebuffer is used by a plane, it's kept
1273 * alive. When the plane no longer uses the framebuffer (because the
1274 * framebuffer is replaced with another one, or the plane is disabled), the
1275 * framebuffer is cleaned up.
1276 *
1277 * This is useful to implement flicker-free transitions between two processes.
1278 *
1279 * Depending on the threat model, user-space may want to ensure that the
1280 * framebuffer doesn't expose any sensitive user information: closed
1281 * framebuffers attached to a plane can be read back by the next DRM master.
1282 */
1283#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)
1284
11131285/*
11141286 * Device specific ioctls should only be in their respective headers
11151287 * The device specific ioctl range is from 0x40 to 0x9f.
......@@ -1121,25 +1293,50 @@ extern "C" {
11211293#define DRM_COMMAND_BASE 0x40
11221294#define DRM_COMMAND_END 0xA0
11231295
1124/*
1125 * Header for events written back to userspace on the drm fd. The
1126 * type defines the type of event, the length specifies the total
1127 * length of the event (including the header), and user_data is
1128 * typically a 64 bit value passed with the ioctl that triggered the
1129 * event. A read on the drm fd will always only return complete
1130 * events, that is, if for example the read buffer is 100 bytes, and
1131 * there are two 64 byte events pending, only one will be returned.
1296/**
1297 * struct drm_event - Header for DRM events
1298 * @type: event type.
1299 * @length: total number of payload bytes (including header).
1300 *
1301 * This struct is a header for events written back to user-space on the DRM FD.
1302 * A read on the DRM FD will always only return complete events: e.g. if the
1303 * read buffer is 100 bytes large and there are two 64 byte events pending,
1304 * only one will be returned.
11321305 *
1133 * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
1134 * up are chipset specific.
1306 * Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
1307 * up are chipset specific. Generic DRM events include &DRM_EVENT_VBLANK,
1308 * &DRM_EVENT_FLIP_COMPLETE and &DRM_EVENT_CRTC_SEQUENCE.
11351309 */
11361310struct drm_event {
11371311 __u32 type;
11381312 __u32 length;
11391313};
11401314
1315/**
1316 * DRM_EVENT_VBLANK - vertical blanking event
1317 *
1318 * This event is sent in response to &DRM_IOCTL_WAIT_VBLANK with the
1319 * &_DRM_VBLANK_EVENT flag set.
1320 *
1321 * The event payload is a struct drm_event_vblank.
1322 */
11411323#define DRM_EVENT_VBLANK 0x01
1324/**
1325 * DRM_EVENT_FLIP_COMPLETE - page-flip completion event
1326 *
1327 * This event is sent in response to an atomic commit or legacy page-flip with
1328 * the &DRM_MODE_PAGE_FLIP_EVENT flag set.
1329 *
1330 * The event payload is a struct drm_event_vblank.
1331 */
11421332#define DRM_EVENT_FLIP_COMPLETE 0x02
1333/**
1334 * DRM_EVENT_CRTC_SEQUENCE - CRTC sequence event
1335 *
1336 * This event is sent in response to &DRM_IOCTL_CRTC_QUEUE_SEQUENCE.
1337 *
1338 * The event payload is a struct drm_event_crtc_sequence.
1339 */
11431340#define DRM_EVENT_CRTC_SEQUENCE 0x03
11441341
11451342struct drm_event_vblank {
lib/libc/include/any-linux-any/drm/drm_fourcc.h+50-5
......@@ -54,7 +54,7 @@ extern "C" {
5454 * Format modifiers may change any property of the buffer, including the number
5555 * of planes and/or the required allocation size. Format modifiers are
5656 * vendor-namespaced, and as such the relationship between a fourcc code and a
57 * modifier is specific to the modifer being used. For example, some modifiers
57 * modifier is specific to the modifier being used. For example, some modifiers
5858 * may preserve meaning - such as number of planes - from the fourcc code,
5959 * whereas others may not.
6060 *
......@@ -79,7 +79,7 @@ extern "C" {
7979 * format.
8080 * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users
8181 * see modifiers as opaque tokens they can check for equality and intersect.
82 * These users musn't need to know to reason about the modifier value
82 * These users mustn't need to know to reason about the modifier value
8383 * (i.e. they are not expected to extract information out of the modifier).
8484 *
8585 * Vendors should document their modifier usage in as much detail as
......@@ -323,6 +323,8 @@ extern "C" {
323323 * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
324324 */
325325#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
326#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
327#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
326328
327329/*
328330 * 2 plane YCbCr MSB aligned
......@@ -538,7 +540,7 @@ extern "C" {
538540 * This is a tiled layout using 4Kb tiles in row-major layout.
539541 * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which
540542 * are arranged in four groups (two wide, two high) with column-major layout.
541 * Each group therefore consits out of four 256 byte units, which are also laid
543 * Each group therefore consists out of four 256 byte units, which are also laid
542544 * out as 2x2 column-major.
543545 * 256 byte units are made out of four 64 byte blocks of pixels, producing
544546 * either a square block or a 2:1 unit.
......@@ -657,6 +659,49 @@ extern "C" {
657659 */
658660#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
659661
662/*
663 * Intel Color Control Surfaces (CCS) for display ver. 14 render compression.
664 *
665 * The main surface is tile4 and at plane index 0, the CCS is linear and
666 * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
667 * main surface. In other words, 4 bits in CCS map to a main surface cache
668 * line pair. The main surface pitch is required to be a multiple of four
669 * tile4 widths.
670 */
671#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS fourcc_mod_code(INTEL, 13)
672
673/*
674 * Intel Color Control Surfaces (CCS) for display ver. 14 media compression
675 *
676 * The main surface is tile4 and at plane index 0, the CCS is linear and
677 * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
678 * main surface. In other words, 4 bits in CCS map to a main surface cache
679 * line pair. The main surface pitch is required to be a multiple of four
680 * tile4 widths. For semi-planar formats like NV12, CCS planes follow the
681 * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces,
682 * planes 2 and 3 for the respective CCS.
683 */
684#define I915_FORMAT_MOD_4_TILED_MTL_MC_CCS fourcc_mod_code(INTEL, 14)
685
686/*
687 * Intel Color Control Surface with Clear Color (CCS) for display ver. 14 render
688 * compression.
689 *
690 * The main surface is tile4 and is at plane index 0 whereas CCS is linear
691 * and at index 1. The clear color is stored at index 2, and the pitch should
692 * be ignored. The clear color structure is 256 bits. The first 128 bits
693 * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
694 * by 32 bits. The raw clear color is consumed by the 3d engine and generates
695 * the converted clear color of size 64 bits. The first 32 bits store the Lower
696 * Converted Clear Color value and the next 32 bits store the Higher Converted
697 * Clear Color value when applicable. The Converted Clear Color values are
698 * consumed by the DE. The last 64 bits are used to store Color Discard Enable
699 * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
700 * corresponds to an area of 4x1 tiles in the main surface. The main surface
701 * pitch is required to be a multiple of 4 tile widths.
702 */
703#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
704
660705/*
661706 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
662707 *
......@@ -1058,7 +1103,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
10581103 */
10591104
10601105/*
1061 * The top 4 bits (out of the 56 bits alloted for specifying vendor specific
1106 * The top 4 bits (out of the 56 bits allotted for specifying vendor specific
10621107 * modifiers) denote the category for modifiers. Currently we have three
10631108 * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of
10641109 * sixteen different categories.
......@@ -1374,7 +1419,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
13741419 * Amlogic FBC Memory Saving mode
13751420 *
13761421 * Indicates the storage is packed when pixel size is multiple of word
1377 * boudaries, i.e. 8bit should be stored in this mode to save allocation
1422 * boundaries, i.e. 8bit should be stored in this mode to save allocation
13781423 * memory.
13791424 *
13801425 * This mode reduces body layout to 3072 bytes per 64x32 superblock with
lib/libc/include/any-linux-any/drm/drm_mode.h+71-13
......@@ -36,10 +36,10 @@ extern "C" {
3636/**
3737 * DOC: overview
3838 *
39 * DRM exposes many UAPI and structure definition to have a consistent
40 * and standardized interface with user.
39 * DRM exposes many UAPI and structure definitions to have a consistent
40 * and standardized interface with users.
4141 * Userspace can refer to these structure definitions and UAPI formats
42 * to communicate to driver
42 * to communicate to drivers.
4343 */
4444
4545#define DRM_CONNECTOR_NAME_LEN 32
......@@ -488,6 +488,9 @@ struct drm_mode_get_connector {
488488 * This is not an object ID. This is a per-type connector number. Each
489489 * (type, type_id) combination is unique across all connectors of a DRM
490490 * device.
491 *
492 * The (type, type_id) combination is not a stable identifier: the
493 * type_id can change depending on the driver probe order.
491494 */
492495 __u32 connector_type_id;
493496
......@@ -537,7 +540,7 @@ struct drm_mode_get_connector {
537540/* the PROP_ATOMIC flag is used to hide properties from userspace that
538541 * is not aware of atomic properties. This is mostly to work around
539542 * older userspace (DDX drivers) that read/write each prop they find,
540 * witout being aware that this could be triggering a lengthy modeset.
543 * without being aware that this could be triggering a lengthy modeset.
541544 */
542545#define DRM_MODE_PROP_ATOMIC 0x80000000
543546
......@@ -661,7 +664,7 @@ struct drm_mode_fb_cmd {
661664};
662665
663666#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
664#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
667#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifier[] */
665668
666669/**
667670 * struct drm_mode_fb_cmd2 - Frame-buffer metadata.
......@@ -834,10 +837,23 @@ struct drm_color_ctm {
834837 /*
835838 * Conversion matrix in S31.32 sign-magnitude
836839 * (not two's complement!) format.
840 *
841 * out matrix in
842 * |R| |0 1 2| |R|
843 * |G| = |3 4 5| x |G|
844 * |B| |6 7 8| |B|
837845 */
838846 __u64 matrix[9];
839847};
840848
849struct drm_color_ctm_3x4 {
850 /*
851 * Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
852 * (not two's complement!) format.
853 */
854 __u64 matrix[12];
855};
856
841857struct drm_color_lut {
842858 /*
843859 * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
......@@ -849,6 +865,17 @@ struct drm_color_lut {
849865 __u16 reserved;
850866};
851867
868/**
869 * struct drm_plane_size_hint - Plane size hints
870 *
871 * The plane SIZE_HINTS property blob contains an
872 * array of struct drm_plane_size_hint.
873 */
874struct drm_plane_size_hint {
875 __u16 width;
876 __u16 height;
877};
878
852879/**
853880 * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
854881 *
......@@ -873,23 +900,23 @@ struct hdr_metadata_infoframe {
873900 * These are coded as unsigned 16-bit values in units of
874901 * 0.00002, where 0x0000 represents zero and 0xC350
875902 * represents 1.0000.
876 * @display_primaries.x: X cordinate of color primary.
877 * @display_primaries.y: Y cordinate of color primary.
903 * @display_primaries.x: X coordinate of color primary.
904 * @display_primaries.y: Y coordinate of color primary.
878905 */
879906 struct {
880907 __u16 x, y;
881 } display_primaries[3];
908 } display_primaries[3];
882909 /**
883910 * @white_point: White Point of Colorspace Data.
884911 * These are coded as unsigned 16-bit values in units of
885912 * 0.00002, where 0x0000 represents zero and 0xC350
886913 * represents 1.0000.
887 * @white_point.x: X cordinate of whitepoint of color primary.
888 * @white_point.y: Y cordinate of whitepoint of color primary.
914 * @white_point.x: X coordinate of whitepoint of color primary.
915 * @white_point.y: Y coordinate of whitepoint of color primary.
889916 */
890917 struct {
891918 __u16 x, y;
892 } white_point;
919 } white_point;
893920 /**
894921 * @max_display_mastering_luminance: Max Mastering Display Luminance.
895922 * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
......@@ -949,6 +976,15 @@ struct hdr_output_metadata {
949976 * Request that the page-flip is performed as soon as possible, ie. with no
950977 * delay due to waiting for vblank. This may cause tearing to be visible on
951978 * the screen.
979 *
980 * When used with atomic uAPI, the driver will return an error if the hardware
981 * doesn't support performing an asynchronous page-flip for this update.
982 * User-space should handle this, e.g. by falling back to a regular page-flip.
983 *
984 * Note, some hardware might need to perform one last synchronous page-flip
985 * before being able to switch to asynchronous page-flips. As an exception,
986 * the driver will return success even though that first page-flip is not
987 * asynchronous.
952988 */
953989#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
954990#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
......@@ -1024,13 +1060,25 @@ struct drm_mode_crtc_page_flip_target {
10241060 __u64 user_data;
10251061};
10261062
1027/* create a dumb scanout buffer */
1063/**
1064 * struct drm_mode_create_dumb - Create a KMS dumb buffer for scanout.
1065 * @height: buffer height in pixels
1066 * @width: buffer width in pixels
1067 * @bpp: bits per pixel
1068 * @flags: must be zero
1069 * @handle: buffer object handle
1070 * @pitch: number of bytes between two consecutive lines
1071 * @size: size of the whole buffer in bytes
1072 *
1073 * User-space fills @height, @width, @bpp and @flags. If the IOCTL succeeds,
1074 * the kernel fills @handle, @pitch and @size.
1075 */
10281076struct drm_mode_create_dumb {
10291077 __u32 height;
10301078 __u32 width;
10311079 __u32 bpp;
10321080 __u32 flags;
1033 /* handle, pitch, size will be returned */
1081
10341082 __u32 handle;
10351083 __u32 pitch;
10361084 __u64 size;
......@@ -1303,6 +1351,16 @@ struct drm_mode_rect {
13031351 __s32 y2;
13041352};
13051353
1354/**
1355 * struct drm_mode_closefb
1356 * @fb_id: Framebuffer ID.
1357 * @pad: Must be zero.
1358 */
1359struct drm_mode_closefb {
1360 __u32 fb_id;
1361 __u32 pad;
1362};
1363
13061364#if defined(__cplusplus)
13071365}
13081366#endif
lib/libc/include/any-linux-any/drm/habanalabs_accel.h+173-38
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 *
3 * Copyright 2016-2022 HabanaLabs, Ltd.
3 * Copyright 2016-2023 HabanaLabs, Ltd.
44 * All Rights Reserved.
55 *
66 */
......@@ -8,8 +8,7 @@
88#ifndef HABANALABS_H_
99#define HABANALABS_H_
1010
11#include <linux/types.h>
12#include <linux/ioctl.h>
11#include <drm/drm.h>
1312
1413/*
1514 * Defines that are asic-specific but constitutes as ABI between kernel driver
......@@ -607,9 +606,9 @@ enum gaudi2_engine_id {
607606/*
608607 * ASIC specific PLL index
609608 *
610 * Used to retrieve in frequency info of different IPs via
611 * HL_INFO_PLL_FREQUENCY under HL_IOCTL_INFO IOCTL. The enums need to be
612 * used as an index in struct hl_pll_frequency_info
609 * Used to retrieve in frequency info of different IPs via HL_INFO_PLL_FREQUENCY under
610 * DRM_IOCTL_HL_INFO IOCTL.
611 * The enums need to be used as an index in struct hl_pll_frequency_info.
613612 */
614613
615614enum hl_goya_pll_index {
......@@ -708,7 +707,8 @@ enum hl_server_type {
708707 HL_SERVER_GAUDI_HLS1H = 2,
709708 HL_SERVER_GAUDI_TYPE1 = 3,
710709 HL_SERVER_GAUDI_TYPE2 = 4,
711 HL_SERVER_GAUDI2_HLS2 = 5
710 HL_SERVER_GAUDI2_HLS2 = 5,
711 HL_SERVER_GAUDI2_TYPE1 = 7
712712};
713713
714714/*
......@@ -723,6 +723,10 @@ enum hl_server_type {
723723 * HL_NOTIFIER_EVENT_GENERAL_HW_ERR - Indicates device HW error
724724 * HL_NOTIFIER_EVENT_RAZWI - Indicates razwi happened
725725 * HL_NOTIFIER_EVENT_PAGE_FAULT - Indicates page fault happened
726 * HL_NOTIFIER_EVENT_CRITICAL_HW_ERR - Indicates a HW error that requires SW abort and
727 * HW reset
728 * HL_NOTIFIER_EVENT_CRITICAL_FW_ERR - Indicates a FW error that requires SW abort and
729 * HW reset
726730 */
727731#define HL_NOTIFIER_EVENT_TPC_ASSERT (1ULL << 0)
728732#define HL_NOTIFIER_EVENT_UNDEFINED_OPCODE (1ULL << 1)
......@@ -733,6 +737,8 @@ enum hl_server_type {
733737#define HL_NOTIFIER_EVENT_GENERAL_HW_ERR (1ULL << 6)
734738#define HL_NOTIFIER_EVENT_RAZWI (1ULL << 7)
735739#define HL_NOTIFIER_EVENT_PAGE_FAULT (1ULL << 8)
740#define HL_NOTIFIER_EVENT_CRITICL_HW_ERR (1ULL << 9)
741#define HL_NOTIFIER_EVENT_CRITICL_FW_ERR (1ULL << 10)
736742
737743/* Opcode for management ioctl
738744 *
......@@ -780,16 +786,29 @@ enum hl_server_type {
780786 * The address which accessing it caused the razwi.
781787 * Razwi initiator.
782788 * Razwi cause, was it a page fault or MMU access error.
789 * May return 0 even though no new data is available, in that case
790 * timestamp will be 0.
783791 * HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES - Retrieve valid page sizes for device memory allocation
784792 * HL_INFO_SECURED_ATTESTATION - Retrieve attestation report of the boot.
785793 * HL_INFO_REGISTER_EVENTFD - Register eventfd for event notifications.
786794 * HL_INFO_UNREGISTER_EVENTFD - Unregister eventfd
787795 * HL_INFO_GET_EVENTS - Retrieve the last occurred events
788796 * HL_INFO_UNDEFINED_OPCODE_EVENT - Retrieve last undefined opcode error information.
797 * May return 0 even though no new data is available, in that case
798 * timestamp will be 0.
789799 * HL_INFO_ENGINE_STATUS - Retrieve the status of all the h/w engines in the asic.
790800 * HL_INFO_PAGE_FAULT_EVENT - Retrieve parameters of captured page fault.
801 * May return 0 even though no new data is available, in that case
802 * timestamp will be 0.
791803 * HL_INFO_USER_MAPPINGS - Retrieve user mappings, captured after page fault event.
792804 * HL_INFO_FW_GENERIC_REQ - Send generic request to FW.
805 * HL_INFO_HW_ERR_EVENT - Retrieve information on the reported HW error.
806 * May return 0 even though no new data is available, in that case
807 * timestamp will be 0.
808 * HL_INFO_FW_ERR_EVENT - Retrieve information on the reported FW error.
809 * May return 0 even though no new data is available, in that case
810 * timestamp will be 0.
811 * HL_INFO_USER_ENGINE_ERR_EVENT - Retrieve the last engine id that reported an error.
793812 */
794813#define HL_INFO_HW_IP_INFO 0
795814#define HL_INFO_HW_EVENTS 1
......@@ -824,6 +843,10 @@ enum hl_server_type {
824843#define HL_INFO_PAGE_FAULT_EVENT 33
825844#define HL_INFO_USER_MAPPINGS 34
826845#define HL_INFO_FW_GENERIC_REQ 35
846#define HL_INFO_HW_ERR_EVENT 36
847#define HL_INFO_FW_ERR_EVENT 37
848#define HL_INFO_USER_ENGINE_ERR_EVENT 38
849#define HL_INFO_DEV_SIGNED 40
827850
828851#define HL_INFO_VERSION_MAX_LEN 128
829852#define HL_INFO_CARD_NAME_MAX_LEN 16
......@@ -863,11 +886,11 @@ enum hl_server_type {
863886 * @dram_enabled: Whether the DRAM is enabled.
864887 * @security_enabled: Whether security is enabled on device.
865888 * @mme_master_slave_mode: Indicate whether the MME is working in master/slave
866 * configuration. Relevant for Greco and later.
889 * configuration. Relevant for Gaudi2 and later.
867890 * @cpucp_version: The CPUCP f/w version.
868891 * @card_name: The card name as passed by the f/w.
869892 * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled.
870 * Relevant for Greco and later.
893 * Relevant for Gaudi2 and later.
871894 * @dram_page_size: The DRAM physical page size.
872895 * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled.
873896 * Relevant for Gaudi2 and later.
......@@ -875,6 +898,12 @@ enum hl_server_type {
875898 * application to use. Relevant for Gaudi2 and later.
876899 * @device_mem_alloc_default_page_size: default page size used in device memory allocation.
877900 * @revision_id: PCI revision ID of the ASIC.
901 * @tpc_interrupt_id: interrupt id for TPC to use in order to raise events towards the host.
902 * @rotator_enabled_mask: Bit-mask that represents which rotators are enabled.
903 * Relevant for Gaudi3 and later.
904 * @engine_core_interrupt_reg_addr: interrupt register address for engine core to use
905 * in order to raise events toward FW.
906 * @reserved_dram_size: DRAM size reserved for driver and firmware.
878907 */
879908struct hl_info_hw_ip_info {
880909 __u64 sram_base_address;
......@@ -902,15 +931,20 @@ struct hl_info_hw_ip_info {
902931 __u64 dram_page_size;
903932 __u32 edma_enabled_mask;
904933 __u16 number_of_user_interrupts;
905 __u16 pad2;
906 __u64 reserved4;
934 __u8 reserved1;
935 __u8 reserved2;
936 __u64 reserved3;
907937 __u64 device_mem_alloc_default_page_size;
938 __u64 reserved4;
908939 __u64 reserved5;
909 __u64 reserved6;
910 __u32 reserved7;
911 __u8 reserved8;
940 __u32 reserved6;
941 __u8 reserved7;
912942 __u8 revision_id;
913 __u8 pad[2];
943 __u16 tpc_interrupt_id;
944 __u32 rotator_enabled_mask;
945 __u32 reserved9;
946 __u64 engine_core_interrupt_reg_addr;
947 __u64 reserved_dram_size;
914948};
915949
916950struct hl_info_dram_usage {
......@@ -958,6 +992,7 @@ struct hl_info_reset_count {
958992struct hl_info_time_sync {
959993 __u64 device_time;
960994 __u64 host_time;
995 __u64 tsc_time;
961996};
962997
963998/**
......@@ -1161,6 +1196,53 @@ struct hl_info_undefined_opcode_event {
11611196 __u32 stream_id;
11621197};
11631198
1199/**
1200 * struct hl_info_hw_err_event - info about HW error
1201 * @timestamp: timestamp of error occurrence
1202 * @event_id: The async event ID (specific to each device type).
1203 * @pad: size padding for u64 granularity.
1204 */
1205struct hl_info_hw_err_event {
1206 __s64 timestamp;
1207 __u16 event_id;
1208 __u16 pad[3];
1209};
1210
1211/* FW error definition for event_type in struct hl_info_fw_err_event */
1212enum hl_info_fw_err_type {
1213 HL_INFO_FW_HEARTBEAT_ERR,
1214 HL_INFO_FW_REPORTED_ERR,
1215};
1216
1217/**
1218 * struct hl_info_fw_err_event - info about FW error
1219 * @timestamp: time-stamp of error occurrence
1220 * @err_type: The type of event as defined in hl_info_fw_err_type.
1221 * @event_id: The async event ID (specific to each device type, applicable only when event type is
1222 * HL_INFO_FW_REPORTED_ERR).
1223 * @pad: size padding for u64 granularity.
1224 */
1225struct hl_info_fw_err_event {
1226 __s64 timestamp;
1227 __u16 err_type;
1228 __u16 event_id;
1229 __u32 pad;
1230};
1231
1232/**
1233 * struct hl_info_engine_err_event - engine error info
1234 * @timestamp: time-stamp of error occurrence
1235 * @engine_id: engine id who reported the error.
1236 * @error_count: Amount of errors reported.
1237 * @pad: size padding for u64 granularity.
1238 */
1239struct hl_info_engine_err_event {
1240 __s64 timestamp;
1241 __u16 engine_id;
1242 __u16 error_count;
1243 __u32 pad;
1244};
1245
11641246/**
11651247 * struct hl_info_dev_memalloc_page_sizes - valid page sizes in device mem alloc information.
11661248 * @page_order_bitmask: bitmap in which a set bit represents the order of the supported page size
......@@ -1175,6 +1257,7 @@ struct hl_info_dev_memalloc_page_sizes {
11751257#define SEC_SIGNATURE_BUF_SZ 255 /* (256 - 1) 1 byte used for size */
11761258#define SEC_PUB_DATA_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
11771259#define SEC_CERTIFICATE_BUF_SZ 2046 /* (2048 - 2) 2 bytes used for size */
1260#define SEC_DEV_INFO_BUF_SZ 5120
11781261
11791262/*
11801263 * struct hl_info_sec_attest - attestation report of the boot
......@@ -1209,6 +1292,32 @@ struct hl_info_sec_attest {
12091292 __u8 pad0[2];
12101293};
12111294
1295/*
1296 * struct hl_info_signed - device information signed by a secured device.
1297 * @nonce: number only used once. random number provided by host. this also passed to the quote
1298 * command as a qualifying data.
1299 * @pub_data_len: length of the public data (bytes)
1300 * @certificate_len: length of the certificate (bytes)
1301 * @info_sig_len: length of the attestation signature (bytes)
1302 * @public_data: public key info signed info data (outPublic + name + qualifiedName)
1303 * @certificate: certificate for the signing key
1304 * @info_sig: signature of the info + nonce data.
1305 * @dev_info_len: length of device info (bytes)
1306 * @dev_info: device info as byte array.
1307 */
1308struct hl_info_signed {
1309 __u32 nonce;
1310 __u16 pub_data_len;
1311 __u16 certificate_len;
1312 __u8 info_sig_len;
1313 __u8 public_data[SEC_PUB_DATA_BUF_SZ];
1314 __u8 certificate[SEC_CERTIFICATE_BUF_SZ];
1315 __u8 info_sig[SEC_SIGNATURE_BUF_SZ];
1316 __u16 dev_info_len;
1317 __u8 dev_info[SEC_DEV_INFO_BUF_SZ];
1318 __u8 pad[2];
1319};
1320
12121321/**
12131322 * struct hl_page_fault_info - page fault information.
12141323 * @timestamp: timestamp of page fault.
......@@ -1344,7 +1453,7 @@ union hl_cb_args {
13441453 *
13451454 * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB:
13461455 * Indicates if the CB was allocated and mapped by userspace
1347 * (relevant to greco and above). User allocated CB is a command buffer,
1456 * (relevant to Gaudi2 and later). User allocated CB is a command buffer,
13481457 * allocated by the user, via malloc (or similar). After allocating the
13491458 * CB, the user invokes - “memory ioctl” to map the user memory into a
13501459 * device virtual address. The user provides this address via the
......@@ -1369,7 +1478,7 @@ struct hl_cs_chunk {
13691478 * a DRAM address of the internal CB. In Gaudi, this might also
13701479 * represent a mapped host address of the CB.
13711480 *
1372 * Greco onwards:
1481 * Gaudi2 onwards:
13731482 * For H/W queue, this represents either a Handle of CB on the
13741483 * Host, or an SRAM, a DRAM, or a mapped host address of the CB.
13751484 *
......@@ -1486,17 +1595,31 @@ struct hl_cs_chunk {
14861595 */
14871596#define HL_CS_FLAGS_FLUSH_PCI_HBW_WRITES 0x8000
14881597
1598/*
1599 * The engines CS is merged into the existing CS ioctls.
1600 * Use it to control engines modes.
1601 */
1602#define HL_CS_FLAGS_ENGINES_COMMAND 0x10000
1603
14891604#define HL_CS_STATUS_SUCCESS 0
14901605
14911606#define HL_MAX_JOBS_PER_CS 512
14921607
1493/* HL_ENGINE_CORE_ values
1608/*
1609 * enum hl_engine_command - engine command
14941610 *
1495 * HL_ENGINE_CORE_HALT: engine core halt
1496 * HL_ENGINE_CORE_RUN: engine core run
1611 * @HL_ENGINE_CORE_HALT: engine core halt
1612 * @HL_ENGINE_CORE_RUN: engine core run
1613 * @HL_ENGINE_STALL: user engine/s stall
1614 * @HL_ENGINE_RESUME: user engine/s resume
14971615 */
1498#define HL_ENGINE_CORE_HALT (1 << 0)
1499#define HL_ENGINE_CORE_RUN (1 << 1)
1616enum hl_engine_command {
1617 HL_ENGINE_CORE_HALT = 1,
1618 HL_ENGINE_CORE_RUN = 2,
1619 HL_ENGINE_STALL = 3,
1620 HL_ENGINE_RESUME = 4,
1621 HL_ENGINE_COMMAND_MAX
1622};
15001623
15011624struct hl_cs_in {
15021625
......@@ -1520,6 +1643,18 @@ struct hl_cs_in {
15201643 /* the core command to be sent towards engine cores */
15211644 __u32 core_command;
15221645 };
1646
1647 /* Valid only when HL_CS_FLAGS_ENGINES_COMMAND is set */
1648 struct {
1649 /* this holds address of array of uint32 for engines */
1650 __u64 engines;
1651
1652 /* number of engines in engines array */
1653 __u32 num_engines;
1654
1655 /* the engine command to be sent towards engines */
1656 __u32 engine_command;
1657 };
15231658 };
15241659
15251660 union {
......@@ -2056,6 +2191,13 @@ struct hl_debug_args {
20562191 __u32 ctx_id;
20572192};
20582193
2194#define HL_IOCTL_INFO 0x00
2195#define HL_IOCTL_CB 0x01
2196#define HL_IOCTL_CS 0x02
2197#define HL_IOCTL_WAIT_CS 0x03
2198#define HL_IOCTL_MEMORY 0x04
2199#define HL_IOCTL_DEBUG 0x05
2200
20592201/*
20602202 * Various information operations such as:
20612203 * - H/W IP information
......@@ -2070,8 +2212,7 @@ struct hl_debug_args {
20702212 * definitions of structures in kernel and userspace, e.g. in case of old
20712213 * userspace and new kernel driver
20722214 */
2073#define HL_IOCTL_INFO \
2074 _IOWR('H', 0x01, struct hl_info_args)
2215#define DRM_IOCTL_HL_INFO DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_INFO, struct hl_info_args)
20752216
20762217/*
20772218 * Command Buffer
......@@ -2092,8 +2233,7 @@ struct hl_debug_args {
20922233 * and won't be returned to user.
20932234 *
20942235 */
2095#define HL_IOCTL_CB \
2096 _IOWR('H', 0x02, union hl_cb_args)
2236#define DRM_IOCTL_HL_CB DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_CB, union hl_cb_args)
20972237
20982238/*
20992239 * Command Submission
......@@ -2115,7 +2255,7 @@ struct hl_debug_args {
21152255 * internal. The driver will get completion notifications from the device only
21162256 * on JOBS which are enqueued in the external queues.
21172257 *
2118 * Greco onwards:
2258 * Gaudi2 onwards:
21192259 * There is a single type of queue for all types of engines, either DMA engines
21202260 * for transfers from/to the host or inside the device, or compute engines.
21212261 * The driver will get completion notifications from the device for all queues.
......@@ -2145,8 +2285,7 @@ struct hl_debug_args {
21452285 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
21462286 * queues).
21472287 */
2148#define HL_IOCTL_CS \
2149 _IOWR('H', 0x03, union hl_cs_args)
2288#define DRM_IOCTL_HL_CS DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_CS, union hl_cs_args)
21502289
21512290/*
21522291 * Wait for Command Submission
......@@ -2178,9 +2317,7 @@ struct hl_debug_args {
21782317 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
21792318 * device was reset (EIO)
21802319 */
2181
2182#define HL_IOCTL_WAIT_CS \
2183 _IOWR('H', 0x04, union hl_wait_cs_args)
2320#define DRM_IOCTL_HL_WAIT_CS DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_WAIT_CS, union hl_wait_cs_args)
21842321
21852322/*
21862323 * Memory
......@@ -2197,8 +2334,7 @@ struct hl_debug_args {
21972334 * There is an option for the user to specify the requested virtual address.
21982335 *
21992336 */
2200#define HL_IOCTL_MEMORY \
2201 _IOWR('H', 0x05, union hl_mem_args)
2337#define DRM_IOCTL_HL_MEMORY DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_MEMORY, union hl_mem_args)
22022338
22032339/*
22042340 * Debug
......@@ -2224,10 +2360,9 @@ struct hl_debug_args {
22242360 * The driver can decide to "kick out" the user if he abuses this interface.
22252361 *
22262362 */
2227#define HL_IOCTL_DEBUG \
2228 _IOWR('H', 0x06, struct hl_debug_args)
2363#define DRM_IOCTL_HL_DEBUG DRM_IOWR(DRM_COMMAND_BASE + HL_IOCTL_DEBUG, struct hl_debug_args)
22292364
2230#define HL_COMMAND_START 0x01
2231#define HL_COMMAND_END 0x07
2365#define HL_COMMAND_START (DRM_COMMAND_BASE + HL_IOCTL_INFO)
2366#define HL_COMMAND_END (DRM_COMMAND_BASE + HL_IOCTL_DEBUG + 1)
22322367
22332368#endif /* HABANALABS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/i915_drm.h+171-16
......@@ -38,13 +38,13 @@ extern "C" {
3838 */
3939
4040/**
41 * DOC: uevents generated by i915 on it's device node
41 * DOC: uevents generated by i915 on its device node
4242 *
4343 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
44 * event from the gpu l3 cache. Additional information supplied is ROW,
44 * event from the GPU L3 cache. Additional information supplied is ROW,
4545 * BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep
46 * track of these events and if a specific cache-line seems to have a
47 * persistent error remap it with the l3 remapping tool supplied in
46 * track of these events, and if a specific cache-line seems to have a
47 * persistent error, remap it with the L3 remapping tool supplied in
4848 * intel-gpu-tools. The value supplied with the event is always 1.
4949 *
5050 * I915_ERROR_UEVENT - Generated upon error detection, currently only via
......@@ -280,7 +280,16 @@ enum drm_i915_pmu_engine_sample {
280280#define I915_PMU_ENGINE_SEMA(class, instance) \
281281 __I915_PMU_ENGINE(class, instance, I915_SAMPLE_SEMA)
282282
283#define __I915_PMU_OTHER(x) (__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x))
283/*
284 * Top 4 bits of every non-engine counter are GT id.
285 */
286#define __I915_PMU_GT_SHIFT (60)
287
288#define ___I915_PMU_OTHER(gt, x) \
289 (((__u64)__I915_PMU_ENGINE(0xff, 0xff, 0xf) + 1 + (x)) | \
290 ((__u64)(gt) << __I915_PMU_GT_SHIFT))
291
292#define __I915_PMU_OTHER(x) ___I915_PMU_OTHER(0, x)
284293
285294#define I915_PMU_ACTUAL_FREQUENCY __I915_PMU_OTHER(0)
286295#define I915_PMU_REQUESTED_FREQUENCY __I915_PMU_OTHER(1)
......@@ -290,6 +299,12 @@ enum drm_i915_pmu_engine_sample {
290299
291300#define I915_PMU_LAST /* Deprecated - do not use */ I915_PMU_RC6_RESIDENCY
292301
302#define __I915_PMU_ACTUAL_FREQUENCY(gt) ___I915_PMU_OTHER(gt, 0)
303#define __I915_PMU_REQUESTED_FREQUENCY(gt) ___I915_PMU_OTHER(gt, 1)
304#define __I915_PMU_INTERRUPTS(gt) ___I915_PMU_OTHER(gt, 2)
305#define __I915_PMU_RC6_RESIDENCY(gt) ___I915_PMU_OTHER(gt, 3)
306#define __I915_PMU_SOFTWARE_GT_AWAKE_TIME(gt) ___I915_PMU_OTHER(gt, 4)
307
293308/* Each region is a minimum of 16k, and there are at most 255 of them.
294309 */
295310#define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use
......@@ -659,7 +674,8 @@ typedef struct drm_i915_irq_wait {
659674 * If the IOCTL is successful, the returned parameter will be set to one of the
660675 * following values:
661676 * * 0 if HuC firmware load is not complete,
662 * * 1 if HuC firmware is authenticated and running.
677 * * 1 if HuC firmware is loaded and fully authenticated,
678 * * 2 if HuC firmware is loaded and authenticated for clear media only
663679 */
664680#define I915_PARAM_HUC_STATUS 42
665681
......@@ -677,7 +693,7 @@ typedef struct drm_i915_irq_wait {
677693#define I915_PARAM_HAS_EXEC_FENCE 44
678694
679695/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
680 * user specified bufffers for post-mortem debugging of GPU hangs. See
696 * user-specified buffers for post-mortem debugging of GPU hangs. See
681697 * EXEC_OBJECT_CAPTURE.
682698 */
683699#define I915_PARAM_HAS_EXEC_CAPTURE 45
......@@ -771,6 +787,31 @@ typedef struct drm_i915_irq_wait {
771787 */
772788#define I915_PARAM_OA_TIMESTAMP_FREQUENCY 57
773789
790/*
791 * Query the status of PXP support in i915.
792 *
793 * The query can fail in the following scenarios with the listed error codes:
794 * -ENODEV = PXP support is not available on the GPU device or in the
795 * kernel due to missing component drivers or kernel configs.
796 *
797 * If the IOCTL is successful, the returned parameter will be set to one of
798 * the following values:
799 * 1 = PXP feature is supported and is ready for use.
800 * 2 = PXP feature is supported but should be ready soon (pending
801 * initialization of non-i915 system dependencies).
802 *
803 * NOTE: When param is supported (positive return values), user space should
804 * still refer to the GEM PXP context-creation UAPI header specs to be
805 * aware of possible failure due to system state machine at the time.
806 */
807#define I915_PARAM_PXP_STATUS 58
808
809/*
810 * Query if kernel allows marking a context to send a Freq hint to SLPC. This
811 * will enable use of the strategies allowed by the SLPC algorithm.
812 */
813#define I915_PARAM_HAS_CONTEXT_FREQ_HINT 59
814
774815/* Must be kept compact -- no holes and well documented */
775816
776817/**
......@@ -1571,7 +1612,7 @@ struct drm_i915_gem_busy {
15711612 * is accurate.
15721613 *
15731614 * The returned dword is split into two fields to indicate both
1574 * the engine classess on which the object is being read, and the
1615 * the engine classes on which the object is being read, and the
15751616 * engine class on which it is currently being written (if any).
15761617 *
15771618 * The low word (bits 0:15) indicate if the object is being written
......@@ -1780,7 +1821,7 @@ struct drm_i915_gem_madvise {
17801821 __u32 handle;
17811822
17821823 /* Advice: either the buffer will be needed again in the near future,
1783 * or wont be and could be discarded under memory pressure.
1824 * or won't be and could be discarded under memory pressure.
17841825 */
17851826 __u32 madv;
17861827
......@@ -2096,8 +2137,32 @@ struct drm_i915_gem_context_param {
20962137 *
20972138 * -ENODEV: feature not available
20982139 * -EPERM: trying to mark a recoverable or not bannable context as protected
2140 * -ENXIO: A dependency such as a component driver or firmware is not yet
2141 * loaded so user space may need to attempt again. Depending on the
2142 * device, this error may be reported if protected context creation is
2143 * attempted very early after kernel start because the internal timeout
2144 * waiting for such dependencies is not guaranteed to be larger than
2145 * required (numbers differ depending on system and kernel config):
2146 * - ADL/RPL: dependencies may take up to 3 seconds from kernel start
2147 * while context creation internal timeout is 250 milisecs
2148 * - MTL: dependencies may take up to 8 seconds from kernel start
2149 * while context creation internal timeout is 250 milisecs
2150 * NOTE: such dependencies happen once, so a subsequent call to create a
2151 * protected context after a prior successful call will not experience
2152 * such timeouts and will not return -ENXIO (unless the driver is reloaded,
2153 * or, depending on the device, resumes from a suspended state).
2154 * -EIO: The firmware did not succeed in creating the protected context.
20992155 */
21002156#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
2157
2158/*
2159 * I915_CONTEXT_PARAM_LOW_LATENCY:
2160 *
2161 * Mark this context as a low latency workload which requires aggressive GT
2162 * frequency scaling. Use I915_PARAM_HAS_CONTEXT_FREQ_HINT to check if the kernel
2163 * supports this per context flag.
2164 */
2165#define I915_CONTEXT_PARAM_LOW_LATENCY 0xe
21012166/* Must be kept compact -- no holes and well documented */
21022167
21032168 /** @value: Context parameter value to be set or queried */
......@@ -2491,7 +2556,7 @@ struct i915_context_param_engines {
24912556#define I915_CONTEXT_ENGINES_EXT_LOAD_BALANCE 0 /* see i915_context_engines_load_balance */
24922557#define I915_CONTEXT_ENGINES_EXT_BOND 1 /* see i915_context_engines_bond */
24932558#define I915_CONTEXT_ENGINES_EXT_PARALLEL_SUBMIT 2 /* see i915_context_engines_parallel_submit */
2494 struct i915_engine_class_instance engines[0];
2559 struct i915_engine_class_instance engines[];
24952560} __attribute__((packed));
24962561
24972562#define I915_DEFINE_CONTEXT_PARAM_ENGINES(name__, N__) struct { \
......@@ -2573,19 +2638,29 @@ struct drm_i915_reg_read {
25732638 *
25742639 */
25752640
2641/*
2642 * struct drm_i915_reset_stats - Return global reset and other context stats
2643 *
2644 * Driver keeps few stats for each contexts and also global reset count.
2645 * This struct can be used to query those stats.
2646 */
25762647struct drm_i915_reset_stats {
2648 /** @ctx_id: ID of the requested context */
25772649 __u32 ctx_id;
2650
2651 /** @flags: MBZ */
25782652 __u32 flags;
25792653
2580 /* All resets since boot/module reload, for all contexts */
2654 /** @reset_count: All resets since boot/module reload, for all contexts */
25812655 __u32 reset_count;
25822656
2583 /* Number of batches lost when active in GPU, for this context */
2657 /** @batch_active: Number of batches lost when active in GPU, for this context */
25842658 __u32 batch_active;
25852659
2586 /* Number of batches lost pending for execution, for this context */
2660 /** @batch_pending: Number of batches lost pending for execution, for this context */
25872661 __u32 batch_pending;
25882662
2663 /** @pad: MBZ */
25892664 __u32 pad;
25902665};
25912666
......@@ -2676,6 +2751,10 @@ enum drm_i915_oa_format {
26762751 I915_OAR_FORMAT_A32u40_A4u32_B8_C8,
26772752 I915_OA_FORMAT_A24u40_A14u32_B8_C8,
26782753
2754 /* MTL OAM */
2755 I915_OAM_FORMAT_MPEC8u64_B8_C8,
2756 I915_OAM_FORMAT_MPEC8u32_B8_C8,
2757
26792758 I915_OA_FORMAT_MAX /* non-ABI */
26802759};
26812760
......@@ -2758,6 +2837,25 @@ enum drm_i915_perf_property_id {
27582837 */
27592838 DRM_I915_PERF_PROP_POLL_OA_PERIOD,
27602839
2840 /**
2841 * Multiple engines may be mapped to the same OA unit. The OA unit is
2842 * identified by class:instance of any engine mapped to it.
2843 *
2844 * This parameter specifies the engine class and must be passed along
2845 * with DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE.
2846 *
2847 * This property is available in perf revision 6.
2848 */
2849 DRM_I915_PERF_PROP_OA_ENGINE_CLASS,
2850
2851 /**
2852 * This parameter specifies the engine instance and must be passed along
2853 * with DRM_I915_PERF_PROP_OA_ENGINE_CLASS.
2854 *
2855 * This property is available in perf revision 6.
2856 */
2857 DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE,
2858
27612859 DRM_I915_PERF_PROP_MAX /* non-ABI */
27622860};
27632861
......@@ -2940,6 +3038,7 @@ struct drm_i915_query_item {
29403038 * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions)
29413039 * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`)
29423040 * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info)
3041 * - %DRM_I915_QUERY_GUC_SUBMISSION_VERSION (see struct drm_i915_query_guc_submission_version)
29433042 */
29443043 __u64 query_id;
29453044#define DRM_I915_QUERY_TOPOLOGY_INFO 1
......@@ -2948,6 +3047,7 @@ struct drm_i915_query_item {
29483047#define DRM_I915_QUERY_MEMORY_REGIONS 4
29493048#define DRM_I915_QUERY_HWCONFIG_BLOB 5
29503049#define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6
3050#define DRM_I915_QUERY_GUC_SUBMISSION_VERSION 7
29513051/* Must be kept compact -- no holes and well documented */
29523052
29533053 /**
......@@ -3173,7 +3273,7 @@ struct drm_i915_query_topology_info {
31733273 * // enough to hold our array of engines. The kernel will fill out the
31743274 * // item.length for us, which is the number of bytes we need.
31753275 * //
3176 * // Alternatively a large buffer can be allocated straight away enabling
3276 * // Alternatively a large buffer can be allocated straightaway enabling
31773277 * // querying in one pass, in which case item.length should contain the
31783278 * // length of the provided buffer.
31793279 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
......@@ -3183,7 +3283,7 @@ struct drm_i915_query_topology_info {
31833283 * // Now that we allocated the required number of bytes, we call the ioctl
31843284 * // again, this time with the data_ptr pointing to our newly allocated
31853285 * // blob, which the kernel can then populate with info on all engines.
3186 * item.data_ptr = (uintptr_t)&info,
3286 * item.data_ptr = (uintptr_t)&info;
31873287 *
31883288 * err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
31893289 * if (err) ...
......@@ -3213,7 +3313,7 @@ struct drm_i915_query_topology_info {
32133313/**
32143314 * struct drm_i915_engine_info
32153315 *
3216 * Describes one engine and it's capabilities as known to the driver.
3316 * Describes one engine and its capabilities as known to the driver.
32173317 */
32183318struct drm_i915_engine_info {
32193319 /** @engine: Engine class and instance. */
......@@ -3493,6 +3593,20 @@ struct drm_i915_query_memory_regions {
34933593 struct drm_i915_memory_region_info regions[];
34943594};
34953595
3596/**
3597 * struct drm_i915_query_guc_submission_version - query GuC submission interface version
3598 */
3599struct drm_i915_query_guc_submission_version {
3600 /** @branch: Firmware branch version. */
3601 __u32 branch;
3602 /** @major: Firmware major version. */
3603 __u32 major;
3604 /** @minor: Firmware minor version. */
3605 __u32 minor;
3606 /** @patch: Firmware patch version. */
3607 __u32 patch;
3608};
3609
34963610/**
34973611 * DOC: GuC HWCONFIG blob uAPI
34983612 *
......@@ -3607,9 +3721,13 @@ struct drm_i915_gem_create_ext {
36073721 *
36083722 * For I915_GEM_CREATE_EXT_PROTECTED_CONTENT usage see
36093723 * struct drm_i915_gem_create_ext_protected_content.
3724 *
3725 * For I915_GEM_CREATE_EXT_SET_PAT usage see
3726 * struct drm_i915_gem_create_ext_set_pat.
36103727 */
36113728#define I915_GEM_CREATE_EXT_MEMORY_REGIONS 0
36123729#define I915_GEM_CREATE_EXT_PROTECTED_CONTENT 1
3730#define I915_GEM_CREATE_EXT_SET_PAT 2
36133731 __u64 extensions;
36143732};
36153733
......@@ -3724,6 +3842,43 @@ struct drm_i915_gem_create_ext_protected_content {
37243842 __u32 flags;
37253843};
37263844
3845/**
3846 * struct drm_i915_gem_create_ext_set_pat - The
3847 * I915_GEM_CREATE_EXT_SET_PAT extension.
3848 *
3849 * If this extension is provided, the specified caching policy (PAT index) is
3850 * applied to the buffer object.
3851 *
3852 * Below is an example on how to create an object with specific caching policy:
3853 *
3854 * .. code-block:: C
3855 *
3856 * struct drm_i915_gem_create_ext_set_pat set_pat_ext = {
3857 * .base = { .name = I915_GEM_CREATE_EXT_SET_PAT },
3858 * .pat_index = 0,
3859 * };
3860 * struct drm_i915_gem_create_ext create_ext = {
3861 * .size = PAGE_SIZE,
3862 * .extensions = (uintptr_t)&set_pat_ext,
3863 * };
3864 *
3865 * int err = ioctl(fd, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
3866 * if (err) ...
3867 */
3868struct drm_i915_gem_create_ext_set_pat {
3869 /** @base: Extension link. See struct i915_user_extension. */
3870 struct i915_user_extension base;
3871 /**
3872 * @pat_index: PAT index to be set
3873 * PAT index is a bit field in Page Table Entry to control caching
3874 * behaviors for GPU accesses. The definition of PAT index is
3875 * platform dependent and can be found in hardware specifications,
3876 */
3877 __u32 pat_index;
3878 /** @rsvd: reserved for future use */
3879 __u32 rsvd;
3880};
3881
37273882/* ID of the protected content session managed by i915 when PXP is active */
37283883#define I915_PROTECTED_CONTENT_DEFAULT_SESSION 0xf
37293884
lib/libc/include/any-linux-any/drm/ivpu_accel.h+44-7
......@@ -53,21 +53,44 @@ extern "C" {
5353#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
5454#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
5555#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
56#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
56#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6 /* Deprecated */
5757#define DRM_IVPU_PARAM_CONTEXT_ID 7
5858#define DRM_IVPU_PARAM_FW_API_VERSION 8
5959#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
6060#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
6161#define DRM_IVPU_PARAM_TILE_CONFIG 11
6262#define DRM_IVPU_PARAM_SKU 12
63#define DRM_IVPU_PARAM_CAPABILITIES 13
6364
6465#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
6566
67/* Deprecated, use DRM_IVPU_JOB_PRIORITY */
6668#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
6769#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
6870#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
6971#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
7072
73#define DRM_IVPU_JOB_PRIORITY_DEFAULT 0
74#define DRM_IVPU_JOB_PRIORITY_IDLE 1
75#define DRM_IVPU_JOB_PRIORITY_NORMAL 2
76#define DRM_IVPU_JOB_PRIORITY_FOCUS 3
77#define DRM_IVPU_JOB_PRIORITY_REALTIME 4
78
79/**
80 * DRM_IVPU_CAP_METRIC_STREAMER
81 *
82 * Metric streamer support. Provides sampling of various hardware performance
83 * metrics like DMA bandwidth and cache miss/hits. Can be used for profiling.
84 */
85#define DRM_IVPU_CAP_METRIC_STREAMER 1
86/**
87 * DRM_IVPU_CAP_DMA_MEMORY_RANGE
88 *
89 * Driver has capability to allocate separate memory range
90 * accessible by hardware DMA.
91 */
92#define DRM_IVPU_CAP_DMA_MEMORY_RANGE 2
93
7194/**
7295 * struct drm_ivpu_param - Get/Set VPU parameters
7396 */
......@@ -96,10 +119,6 @@ struct drm_ivpu_param {
96119 * %DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
97120 * Lowest VPU virtual address available in the current context (read-only)
98121 *
99 * %DRM_IVPU_PARAM_CONTEXT_PRIORITY:
100 * Value of current context scheduling priority (read-write).
101 * See DRM_IVPU_CONTEXT_PRIORITY_* for possible values.
102 *
103122 * %DRM_IVPU_PARAM_CONTEXT_ID:
104123 * Current context ID, always greater than 0 (read-only)
105124 *
......@@ -119,6 +138,8 @@ struct drm_ivpu_param {
119138 * %DRM_IVPU_PARAM_SKU:
120139 * VPU SKU ID (read-only)
121140 *
141 * %DRM_IVPU_PARAM_CAPABILITIES:
142 * Supported capabilities (read-only)
122143 */
123144 __u32 param;
124145
......@@ -129,8 +150,10 @@ struct drm_ivpu_param {
129150 __u64 value;
130151};
131152
132#define DRM_IVPU_BO_HIGH_MEM 0x00000001
153#define DRM_IVPU_BO_SHAVE_MEM 0x00000001
154#define DRM_IVPU_BO_HIGH_MEM DRM_IVPU_BO_SHAVE_MEM
133155#define DRM_IVPU_BO_MAPPABLE 0x00000002
156#define DRM_IVPU_BO_DMA_MEM 0x00000004
134157
135158#define DRM_IVPU_BO_CACHED 0x00000000
136159#define DRM_IVPU_BO_UNCACHED 0x00010000
......@@ -140,6 +163,7 @@ struct drm_ivpu_param {
140163#define DRM_IVPU_BO_FLAGS \
141164 (DRM_IVPU_BO_HIGH_MEM | \
142165 DRM_IVPU_BO_MAPPABLE | \
166 DRM_IVPU_BO_DMA_MEM | \
143167 DRM_IVPU_BO_CACHE_MASK)
144168
145169/**
......@@ -175,7 +199,7 @@ struct drm_ivpu_bo_create {
175199 *
176200 * %DRM_IVPU_BO_UNCACHED:
177201 *
178 * Allocated BO will not be cached on host side nor snooped on the VPU side.
202 * Not supported. Use DRM_IVPU_BO_WC instead.
179203 *
180204 * %DRM_IVPU_BO_WC:
181205 *
......@@ -265,10 +289,23 @@ struct drm_ivpu_submit {
265289 * to be executed. The offset has to be 8-byte aligned.
266290 */
267291 __u32 commands_offset;
292
293 /**
294 * @priority:
295 *
296 * Priority to be set for related job command queue, can be one of the following:
297 * %DRM_IVPU_JOB_PRIORITY_DEFAULT
298 * %DRM_IVPU_JOB_PRIORITY_IDLE
299 * %DRM_IVPU_JOB_PRIORITY_NORMAL
300 * %DRM_IVPU_JOB_PRIORITY_FOCUS
301 * %DRM_IVPU_JOB_PRIORITY_REALTIME
302 */
303 __u32 priority;
268304};
269305
270306/* drm_ivpu_bo_wait job status codes */
271307#define DRM_IVPU_JOB_STATUS_SUCCESS 0
308#define DRM_IVPU_JOB_STATUS_ABORTED 256
272309
273310/**
274311 * struct drm_ivpu_bo_wait - Wait for BO to become inactive
lib/libc/include/any-linux-any/drm/msm_drm.h+19-2
......@@ -86,6 +86,7 @@ struct drm_msm_timespec {
8686#define MSM_PARAM_CMDLINE 0x0d /* WO: override for task cmdline */
8787#define MSM_PARAM_VA_START 0x0e /* RO: start of valid GPU iova range */
8888#define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */
89#define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */
8990
9091/* For backwards compat. The original support for preemption was based on
9192 * a single ring per priority level so # of priority levels equals the #
......@@ -139,6 +140,8 @@ struct drm_msm_gem_new {
139140#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */
140141#define MSM_INFO_SET_IOVA 0x04 /* set the iova, passed by value */
141142#define MSM_INFO_GET_FLAGS 0x05 /* get the MSM_BO_x flags */
143#define MSM_INFO_SET_METADATA 0x06 /* set userspace metadata */
144#define MSM_INFO_GET_METADATA 0x07 /* get userspace metadata */
142145
143146struct drm_msm_gem_info {
144147 __u32 handle; /* in */
......@@ -151,8 +154,13 @@ struct drm_msm_gem_info {
151154#define MSM_PREP_READ 0x01
152155#define MSM_PREP_WRITE 0x02
153156#define MSM_PREP_NOSYNC 0x04
157#define MSM_PREP_BOOST 0x08
154158
155#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
159#define MSM_PREP_FLAGS (MSM_PREP_READ | \
160 MSM_PREP_WRITE | \
161 MSM_PREP_NOSYNC | \
162 MSM_PREP_BOOST | \
163 0)
156164
157165struct drm_msm_gem_cpu_prep {
158166 __u32 handle; /* in */
......@@ -181,7 +189,11 @@ struct drm_msm_gem_cpu_fini {
181189 */
182190struct drm_msm_gem_submit_reloc {
183191 __u32 submit_offset; /* in, offset from submit_bo */
192#ifdef __cplusplus
193 __u32 _or; /* in, value OR'd with result */
194#else
184195 __u32 or; /* in, value OR'd with result */
196#endif
185197 __s32 shift; /* in, amount of left shift (can be negative) */
186198 __u32 reloc_idx; /* in, index of reloc_bo buffer */
187199 __u64 reloc_offset; /* in, offset from start of reloc_bo */
......@@ -286,6 +298,11 @@ struct drm_msm_gem_submit {
286298
287299};
288300
301#define MSM_WAIT_FENCE_BOOST 0x00000001
302#define MSM_WAIT_FENCE_FLAGS ( \
303 MSM_WAIT_FENCE_BOOST | \
304 0)
305
289306/* The normal way to synchronize with the GPU is just to CPU_PREP on
290307 * a buffer if you need to access it from the CPU (other cmdstream
291308 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
......@@ -295,7 +312,7 @@ struct drm_msm_gem_submit {
295312 */
296313struct drm_msm_wait_fence {
297314 __u32 fence; /* in */
298 __u32 pad;
315 __u32 flags; /* in, bitmask of MSM_WAIT_FENCE_x */
299316 struct drm_msm_timespec timeout; /* in */
300317 __u32 queueid; /* in, submitqueue id */
301318};
lib/libc/include/any-linux-any/drm/nouveau_drm.h+319-3
......@@ -33,11 +33,104 @@
3333extern "C" {
3434#endif
3535
36#define NOUVEAU_GETPARAM_PCI_VENDOR 3
37#define NOUVEAU_GETPARAM_PCI_DEVICE 4
38#define NOUVEAU_GETPARAM_BUS_TYPE 5
39#define NOUVEAU_GETPARAM_FB_SIZE 8
40#define NOUVEAU_GETPARAM_AGP_SIZE 9
41#define NOUVEAU_GETPARAM_CHIPSET_ID 11
42#define NOUVEAU_GETPARAM_VM_VRAM_BASE 12
43#define NOUVEAU_GETPARAM_GRAPH_UNITS 13
44#define NOUVEAU_GETPARAM_PTIMER_TIME 14
45#define NOUVEAU_GETPARAM_HAS_BO_USAGE 15
46#define NOUVEAU_GETPARAM_HAS_PAGEFLIP 16
47
48/*
49 * NOUVEAU_GETPARAM_EXEC_PUSH_MAX - query max pushes through getparam
50 *
51 * Query the maximum amount of IBs that can be pushed through a single
52 * &drm_nouveau_exec structure and hence a single &DRM_IOCTL_NOUVEAU_EXEC
53 * ioctl().
54 */
55#define NOUVEAU_GETPARAM_EXEC_PUSH_MAX 17
56
57/*
58 * NOUVEAU_GETPARAM_VRAM_BAR_SIZE - query bar size
59 *
60 * Query the VRAM BAR size.
61 */
62#define NOUVEAU_GETPARAM_VRAM_BAR_SIZE 18
63
64/*
65 * NOUVEAU_GETPARAM_VRAM_USED
66 *
67 * Get remaining VRAM size.
68 */
69#define NOUVEAU_GETPARAM_VRAM_USED 19
70
71/*
72 * NOUVEAU_GETPARAM_HAS_VMA_TILEMODE
73 *
74 * Query whether tile mode and PTE kind are accepted with VM allocs or not.
75 */
76#define NOUVEAU_GETPARAM_HAS_VMA_TILEMODE 20
77
78struct drm_nouveau_getparam {
79 __u64 param;
80 __u64 value;
81};
82
83/*
84 * Those are used to support selecting the main engine used on Kepler.
85 * This goes into drm_nouveau_channel_alloc::tt_ctxdma_handle
86 */
87#define NOUVEAU_FIFO_ENGINE_GR 0x01
88#define NOUVEAU_FIFO_ENGINE_VP 0x02
89#define NOUVEAU_FIFO_ENGINE_PPP 0x04
90#define NOUVEAU_FIFO_ENGINE_BSP 0x08
91#define NOUVEAU_FIFO_ENGINE_CE 0x30
92
93struct drm_nouveau_channel_alloc {
94 __u32 fb_ctxdma_handle;
95 __u32 tt_ctxdma_handle;
96
97 __s32 channel;
98 __u32 pushbuf_domains;
99
100 /* Notifier memory */
101 __u32 notifier_handle;
102
103 /* DRM-enforced subchannel assignments */
104 struct {
105 __u32 handle;
106 __u32 grclass;
107 } subchan[8];
108 __u32 nr_subchan;
109};
110
111struct drm_nouveau_channel_free {
112 __s32 channel;
113};
114
115struct drm_nouveau_notifierobj_alloc {
116 __u32 channel;
117 __u32 handle;
118 __u32 size;
119 __u32 offset;
120};
121
122struct drm_nouveau_gpuobj_free {
123 __s32 channel;
124 __u32 handle;
125};
126
36127#define NOUVEAU_GEM_DOMAIN_CPU (1 << 0)
37128#define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1)
38129#define NOUVEAU_GEM_DOMAIN_GART (1 << 2)
39130#define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3)
40131#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4)
132/* The BO will never be shared via import or export. */
133#define NOUVEAU_GEM_DOMAIN_NO_SHARE (1 << 5)
41134
42135#define NOUVEAU_GEM_TILE_COMP 0x00030000 /* nv50-only */
43136#define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00
......@@ -98,6 +191,7 @@ struct drm_nouveau_gem_pushbuf_push {
98191 __u32 pad;
99192 __u64 offset;
100193 __u64 length;
194#define NOUVEAU_GEM_PUSHBUF_NO_PREFETCH (1 << 23)
101195};
102196
103197struct drm_nouveau_gem_pushbuf {
......@@ -126,16 +220,231 @@ struct drm_nouveau_gem_cpu_fini {
126220 __u32 handle;
127221};
128222
129#define DRM_NOUVEAU_GETPARAM 0x00 /* deprecated */
223/**
224 * struct drm_nouveau_sync - sync object
225 *
226 * This structure serves as synchronization mechanism for (potentially)
227 * asynchronous operations such as EXEC or VM_BIND.
228 */
229struct drm_nouveau_sync {
230 /**
231 * @flags: the flags for a sync object
232 *
233 * The first 8 bits are used to determine the type of the sync object.
234 */
235 __u32 flags;
236#define DRM_NOUVEAU_SYNC_SYNCOBJ 0x0
237#define DRM_NOUVEAU_SYNC_TIMELINE_SYNCOBJ 0x1
238#define DRM_NOUVEAU_SYNC_TYPE_MASK 0xf
239 /**
240 * @handle: the handle of the sync object
241 */
242 __u32 handle;
243 /**
244 * @timeline_value:
245 *
246 * The timeline point of the sync object in case the syncobj is of
247 * type DRM_NOUVEAU_SYNC_TIMELINE_SYNCOBJ.
248 */
249 __u64 timeline_value;
250};
251
252/**
253 * struct drm_nouveau_vm_init - GPU VA space init structure
254 *
255 * Used to initialize the GPU's VA space for a user client, telling the kernel
256 * which portion of the VA space is managed by the UMD and kernel respectively.
257 *
258 * For the UMD to use the VM_BIND uAPI, this must be called before any BOs or
259 * channels are created; if called afterwards DRM_IOCTL_NOUVEAU_VM_INIT fails
260 * with -ENOSYS.
261 */
262struct drm_nouveau_vm_init {
263 /**
264 * @kernel_managed_addr: start address of the kernel managed VA space
265 * region
266 */
267 __u64 kernel_managed_addr;
268 /**
269 * @kernel_managed_size: size of the kernel managed VA space region in
270 * bytes
271 */
272 __u64 kernel_managed_size;
273};
274
275/**
276 * struct drm_nouveau_vm_bind_op - VM_BIND operation
277 *
278 * This structure represents a single VM_BIND operation. UMDs should pass
279 * an array of this structure via struct drm_nouveau_vm_bind's &op_ptr field.
280 */
281struct drm_nouveau_vm_bind_op {
282 /**
283 * @op: the operation type
284 *
285 * Supported values:
286 *
287 * %DRM_NOUVEAU_VM_BIND_OP_MAP - Map a GEM object to the GPU's VA
288 * space. Optionally, the &DRM_NOUVEAU_VM_BIND_SPARSE flag can be
289 * passed to instruct the kernel to create sparse mappings for the
290 * given range.
291 *
292 * %DRM_NOUVEAU_VM_BIND_OP_UNMAP - Unmap an existing mapping in the
293 * GPU's VA space. If the region the mapping is located in is a
294 * sparse region, new sparse mappings are created where the unmapped
295 * (memory backed) mapping was mapped previously. To remove a sparse
296 * region the &DRM_NOUVEAU_VM_BIND_SPARSE must be set.
297 */
298 __u32 op;
299#define DRM_NOUVEAU_VM_BIND_OP_MAP 0x0
300#define DRM_NOUVEAU_VM_BIND_OP_UNMAP 0x1
301 /**
302 * @flags: the flags for a &drm_nouveau_vm_bind_op
303 *
304 * Supported values:
305 *
306 * %DRM_NOUVEAU_VM_BIND_SPARSE - Indicates that an allocated VA
307 * space region should be sparse.
308 */
309 __u32 flags;
310#define DRM_NOUVEAU_VM_BIND_SPARSE (1 << 8)
311 /**
312 * @handle: the handle of the DRM GEM object to map
313 */
314 __u32 handle;
315 /**
316 * @pad: 32 bit padding, should be 0
317 */
318 __u32 pad;
319 /**
320 * @addr:
321 *
322 * the address the VA space region or (memory backed) mapping should be mapped to
323 */
324 __u64 addr;
325 /**
326 * @bo_offset: the offset within the BO backing the mapping
327 */
328 __u64 bo_offset;
329 /**
330 * @range: the size of the requested mapping in bytes
331 */
332 __u64 range;
333};
334
335/**
336 * struct drm_nouveau_vm_bind - structure for DRM_IOCTL_NOUVEAU_VM_BIND
337 */
338struct drm_nouveau_vm_bind {
339 /**
340 * @op_count: the number of &drm_nouveau_vm_bind_op
341 */
342 __u32 op_count;
343 /**
344 * @flags: the flags for a &drm_nouveau_vm_bind ioctl
345 *
346 * Supported values:
347 *
348 * %DRM_NOUVEAU_VM_BIND_RUN_ASYNC - Indicates that the given VM_BIND
349 * operation should be executed asynchronously by the kernel.
350 *
351 * If this flag is not supplied the kernel executes the associated
352 * operations synchronously and doesn't accept any &drm_nouveau_sync
353 * objects.
354 */
355 __u32 flags;
356#define DRM_NOUVEAU_VM_BIND_RUN_ASYNC 0x1
357 /**
358 * @wait_count: the number of wait &drm_nouveau_syncs
359 */
360 __u32 wait_count;
361 /**
362 * @sig_count: the number of &drm_nouveau_syncs to signal when finished
363 */
364 __u32 sig_count;
365 /**
366 * @wait_ptr: pointer to &drm_nouveau_syncs to wait for
367 */
368 __u64 wait_ptr;
369 /**
370 * @sig_ptr: pointer to &drm_nouveau_syncs to signal when finished
371 */
372 __u64 sig_ptr;
373 /**
374 * @op_ptr: pointer to the &drm_nouveau_vm_bind_ops to execute
375 */
376 __u64 op_ptr;
377};
378
379/**
380 * struct drm_nouveau_exec_push - EXEC push operation
381 *
382 * This structure represents a single EXEC push operation. UMDs should pass an
383 * array of this structure via struct drm_nouveau_exec's &push_ptr field.
384 */
385struct drm_nouveau_exec_push {
386 /**
387 * @va: the virtual address of the push buffer mapping
388 */
389 __u64 va;
390 /**
391 * @va_len: the length of the push buffer mapping
392 */
393 __u32 va_len;
394 /**
395 * @flags: the flags for this push buffer mapping
396 */
397 __u32 flags;
398#define DRM_NOUVEAU_EXEC_PUSH_NO_PREFETCH 0x1
399};
400
401/**
402 * struct drm_nouveau_exec - structure for DRM_IOCTL_NOUVEAU_EXEC
403 */
404struct drm_nouveau_exec {
405 /**
406 * @channel: the channel to execute the push buffer in
407 */
408 __u32 channel;
409 /**
410 * @push_count: the number of &drm_nouveau_exec_push ops
411 */
412 __u32 push_count;
413 /**
414 * @wait_count: the number of wait &drm_nouveau_syncs
415 */
416 __u32 wait_count;
417 /**
418 * @sig_count: the number of &drm_nouveau_syncs to signal when finished
419 */
420 __u32 sig_count;
421 /**
422 * @wait_ptr: pointer to &drm_nouveau_syncs to wait for
423 */
424 __u64 wait_ptr;
425 /**
426 * @sig_ptr: pointer to &drm_nouveau_syncs to signal when finished
427 */
428 __u64 sig_ptr;
429 /**
430 * @push_ptr: pointer to &drm_nouveau_exec_push ops
431 */
432 __u64 push_ptr;
433};
434
435#define DRM_NOUVEAU_GETPARAM 0x00
130436#define DRM_NOUVEAU_SETPARAM 0x01 /* deprecated */
131#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02 /* deprecated */
132#define DRM_NOUVEAU_CHANNEL_FREE 0x03 /* deprecated */
437#define DRM_NOUVEAU_CHANNEL_ALLOC 0x02
438#define DRM_NOUVEAU_CHANNEL_FREE 0x03
133439#define DRM_NOUVEAU_GROBJ_ALLOC 0x04 /* deprecated */
134440#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05 /* deprecated */
135441#define DRM_NOUVEAU_GPUOBJ_FREE 0x06 /* deprecated */
136442#define DRM_NOUVEAU_NVIF 0x07
137443#define DRM_NOUVEAU_SVM_INIT 0x08
138444#define DRM_NOUVEAU_SVM_BIND 0x09
445#define DRM_NOUVEAU_VM_INIT 0x10
446#define DRM_NOUVEAU_VM_BIND 0x11
447#define DRM_NOUVEAU_EXEC 0x12
139448#define DRM_NOUVEAU_GEM_NEW 0x40
140449#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
141450#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
......@@ -188,6 +497,10 @@ struct drm_nouveau_svm_bind {
188497#define NOUVEAU_SVM_BIND_TARGET__GPU_VRAM (1UL << 31)
189498
190499
500#define DRM_IOCTL_NOUVEAU_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
501#define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
502#define DRM_IOCTL_NOUVEAU_CHANNEL_FREE DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
503
191504#define DRM_IOCTL_NOUVEAU_SVM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_INIT, struct drm_nouveau_svm_init)
192505#define DRM_IOCTL_NOUVEAU_SVM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SVM_BIND, struct drm_nouveau_svm_bind)
193506
......@@ -197,6 +510,9 @@ struct drm_nouveau_svm_bind {
197510#define DRM_IOCTL_NOUVEAU_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_CPU_FINI, struct drm_nouveau_gem_cpu_fini)
198511#define DRM_IOCTL_NOUVEAU_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GEM_INFO, struct drm_nouveau_gem_info)
199512
513#define DRM_IOCTL_NOUVEAU_VM_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_VM_INIT, struct drm_nouveau_vm_init)
514#define DRM_IOCTL_NOUVEAU_VM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_VM_BIND, struct drm_nouveau_vm_bind)
515#define DRM_IOCTL_NOUVEAU_EXEC DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_EXEC, struct drm_nouveau_exec)
200516#if defined(__cplusplus)
201517}
202518#endif
lib/libc/include/any-linux-any/drm/panthor_drm.h created+962
......@@ -0,0 +1,962 @@
1/* SPDX-License-Identifier: MIT */
2/* Copyright (C) 2023 Collabora ltd. */
3#ifndef _PANTHOR_DRM_H_
4#define _PANTHOR_DRM_H_
5
6#include "drm.h"
7
8#if defined(__cplusplus)
9extern "C" {
10#endif
11
12/**
13 * DOC: Introduction
14 *
15 * This documentation describes the Panthor IOCTLs.
16 *
17 * Just a few generic rules about the data passed to the Panthor IOCTLs:
18 *
19 * - Structures must be aligned on 64-bit/8-byte. If the object is not
20 * naturally aligned, a padding field must be added.
21 * - Fields must be explicitly aligned to their natural type alignment with
22 * pad[0..N] fields.
23 * - All padding fields will be checked by the driver to make sure they are
24 * zeroed.
25 * - Flags can be added, but not removed/replaced.
26 * - New fields can be added to the main structures (the structures
27 * directly passed to the ioctl). Those fields can be added at the end of
28 * the structure, or replace existing padding fields. Any new field being
29 * added must preserve the behavior that existed before those fields were
30 * added when a value of zero is passed.
31 * - New fields can be added to indirect objects (objects pointed by the
32 * main structure), iff those objects are passed a size to reflect the
33 * size known by the userspace driver (see drm_panthor_obj_array::stride
34 * or drm_panthor_dev_query::size).
35 * - If the kernel driver is too old to know some fields, those will be
36 * ignored if zero, and otherwise rejected (and so will be zero on output).
37 * - If userspace is too old to know some fields, those will be zeroed
38 * (input) before the structure is parsed by the kernel driver.
39 * - Each new flag/field addition must come with a driver version update so
40 * the userspace driver doesn't have to trial and error to know which
41 * flags are supported.
42 * - Structures should not contain unions, as this would defeat the
43 * extensibility of such structures.
44 * - IOCTLs can't be removed or replaced. New IOCTL IDs should be placed
45 * at the end of the drm_panthor_ioctl_id enum.
46 */
47
48/**
49 * DOC: MMIO regions exposed to userspace.
50 *
51 * .. c:macro:: DRM_PANTHOR_USER_MMIO_OFFSET
52 *
53 * File offset for all MMIO regions being exposed to userspace. Don't use
54 * this value directly, use DRM_PANTHOR_USER_<name>_OFFSET values instead.
55 * pgoffset passed to mmap2() is an unsigned long, which forces us to use a
56 * different offset on 32-bit and 64-bit systems.
57 *
58 * .. c:macro:: DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET
59 *
60 * File offset for the LATEST_FLUSH_ID register. The Userspace driver controls
61 * GPU cache flushing through CS instructions, but the flush reduction
62 * mechanism requires a flush_id. This flush_id could be queried with an
63 * ioctl, but Arm provides a well-isolated register page containing only this
64 * read-only register, so let's expose this page through a static mmap offset
65 * and allow direct mapping of this MMIO region so we can avoid the
66 * user <-> kernel round-trip.
67 */
68#define DRM_PANTHOR_USER_MMIO_OFFSET_32BIT (1ull << 43)
69#define DRM_PANTHOR_USER_MMIO_OFFSET_64BIT (1ull << 56)
70#define DRM_PANTHOR_USER_MMIO_OFFSET (sizeof(unsigned long) < 8 ? \
71 DRM_PANTHOR_USER_MMIO_OFFSET_32BIT : \
72 DRM_PANTHOR_USER_MMIO_OFFSET_64BIT)
73#define DRM_PANTHOR_USER_FLUSH_ID_MMIO_OFFSET (DRM_PANTHOR_USER_MMIO_OFFSET | 0)
74
75/**
76 * DOC: IOCTL IDs
77 *
78 * enum drm_panthor_ioctl_id - IOCTL IDs
79 *
80 * Place new ioctls at the end, don't re-order, don't replace or remove entries.
81 *
82 * These IDs are not meant to be used directly. Use the DRM_IOCTL_PANTHOR_xxx
83 * definitions instead.
84 */
85enum drm_panthor_ioctl_id {
86 /** @DRM_PANTHOR_DEV_QUERY: Query device information. */
87 DRM_PANTHOR_DEV_QUERY = 0,
88
89 /** @DRM_PANTHOR_VM_CREATE: Create a VM. */
90 DRM_PANTHOR_VM_CREATE,
91
92 /** @DRM_PANTHOR_VM_DESTROY: Destroy a VM. */
93 DRM_PANTHOR_VM_DESTROY,
94
95 /** @DRM_PANTHOR_VM_BIND: Bind/unbind memory to a VM. */
96 DRM_PANTHOR_VM_BIND,
97
98 /** @DRM_PANTHOR_VM_GET_STATE: Get VM state. */
99 DRM_PANTHOR_VM_GET_STATE,
100
101 /** @DRM_PANTHOR_BO_CREATE: Create a buffer object. */
102 DRM_PANTHOR_BO_CREATE,
103
104 /**
105 * @DRM_PANTHOR_BO_MMAP_OFFSET: Get the file offset to pass to
106 * mmap to map a GEM object.
107 */
108 DRM_PANTHOR_BO_MMAP_OFFSET,
109
110 /** @DRM_PANTHOR_GROUP_CREATE: Create a scheduling group. */
111 DRM_PANTHOR_GROUP_CREATE,
112
113 /** @DRM_PANTHOR_GROUP_DESTROY: Destroy a scheduling group. */
114 DRM_PANTHOR_GROUP_DESTROY,
115
116 /**
117 * @DRM_PANTHOR_GROUP_SUBMIT: Submit jobs to queues belonging
118 * to a specific scheduling group.
119 */
120 DRM_PANTHOR_GROUP_SUBMIT,
121
122 /** @DRM_PANTHOR_GROUP_GET_STATE: Get the state of a scheduling group. */
123 DRM_PANTHOR_GROUP_GET_STATE,
124
125 /** @DRM_PANTHOR_TILER_HEAP_CREATE: Create a tiler heap. */
126 DRM_PANTHOR_TILER_HEAP_CREATE,
127
128 /** @DRM_PANTHOR_TILER_HEAP_DESTROY: Destroy a tiler heap. */
129 DRM_PANTHOR_TILER_HEAP_DESTROY,
130};
131
132/**
133 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
134 * @__access: Access type. Must be R, W or RW.
135 * @__id: One of the DRM_PANTHOR_xxx id.
136 * @__type: Suffix of the type being passed to the IOCTL.
137 *
138 * Don't use this macro directly, use the DRM_IOCTL_PANTHOR_xxx
139 * values instead.
140 *
141 * Return: An IOCTL number to be passed to ioctl() from userspace.
142 */
143#define DRM_IOCTL_PANTHOR(__access, __id, __type) \
144 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_PANTHOR_ ## __id, \
145 struct drm_panthor_ ## __type)
146
147#define DRM_IOCTL_PANTHOR_DEV_QUERY \
148 DRM_IOCTL_PANTHOR(WR, DEV_QUERY, dev_query)
149#define DRM_IOCTL_PANTHOR_VM_CREATE \
150 DRM_IOCTL_PANTHOR(WR, VM_CREATE, vm_create)
151#define DRM_IOCTL_PANTHOR_VM_DESTROY \
152 DRM_IOCTL_PANTHOR(WR, VM_DESTROY, vm_destroy)
153#define DRM_IOCTL_PANTHOR_VM_BIND \
154 DRM_IOCTL_PANTHOR(WR, VM_BIND, vm_bind)
155#define DRM_IOCTL_PANTHOR_VM_GET_STATE \
156 DRM_IOCTL_PANTHOR(WR, VM_GET_STATE, vm_get_state)
157#define DRM_IOCTL_PANTHOR_BO_CREATE \
158 DRM_IOCTL_PANTHOR(WR, BO_CREATE, bo_create)
159#define DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET \
160 DRM_IOCTL_PANTHOR(WR, BO_MMAP_OFFSET, bo_mmap_offset)
161#define DRM_IOCTL_PANTHOR_GROUP_CREATE \
162 DRM_IOCTL_PANTHOR(WR, GROUP_CREATE, group_create)
163#define DRM_IOCTL_PANTHOR_GROUP_DESTROY \
164 DRM_IOCTL_PANTHOR(WR, GROUP_DESTROY, group_destroy)
165#define DRM_IOCTL_PANTHOR_GROUP_SUBMIT \
166 DRM_IOCTL_PANTHOR(WR, GROUP_SUBMIT, group_submit)
167#define DRM_IOCTL_PANTHOR_GROUP_GET_STATE \
168 DRM_IOCTL_PANTHOR(WR, GROUP_GET_STATE, group_get_state)
169#define DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE \
170 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create)
171#define DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY \
172 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy)
173
174/**
175 * DOC: IOCTL arguments
176 */
177
178/**
179 * struct drm_panthor_obj_array - Object array.
180 *
181 * This object is used to pass an array of objects whose size is subject to changes in
182 * future versions of the driver. In order to support this mutability, we pass a stride
183 * describing the size of the object as known by userspace.
184 *
185 * You shouldn't fill drm_panthor_obj_array fields directly. You should instead use
186 * the DRM_PANTHOR_OBJ_ARRAY() macro that takes care of initializing the stride to
187 * the object size.
188 */
189struct drm_panthor_obj_array {
190 /** @stride: Stride of object struct. Used for versioning. */
191 __u32 stride;
192
193 /** @count: Number of objects in the array. */
194 __u32 count;
195
196 /** @array: User pointer to an array of objects. */
197 __u64 array;
198};
199
200/**
201 * DRM_PANTHOR_OBJ_ARRAY() - Initialize a drm_panthor_obj_array field.
202 * @cnt: Number of elements in the array.
203 * @ptr: Pointer to the array to pass to the kernel.
204 *
205 * Macro initializing a drm_panthor_obj_array based on the object size as known
206 * by userspace.
207 */
208#define DRM_PANTHOR_OBJ_ARRAY(cnt, ptr) \
209 { .stride = sizeof((ptr)[0]), .count = (cnt), .array = (__u64)(uintptr_t)(ptr) }
210
211/**
212 * enum drm_panthor_sync_op_flags - Synchronization operation flags.
213 */
214enum drm_panthor_sync_op_flags {
215 /** @DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_MASK: Synchronization handle type mask. */
216 DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_MASK = 0xff,
217
218 /** @DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_SYNCOBJ: Synchronization object type. */
219 DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_SYNCOBJ = 0,
220
221 /**
222 * @DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_TIMELINE_SYNCOBJ: Timeline synchronization
223 * object type.
224 */
225 DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_TIMELINE_SYNCOBJ = 1,
226
227 /** @DRM_PANTHOR_SYNC_OP_WAIT: Wait operation. */
228 DRM_PANTHOR_SYNC_OP_WAIT = 0 << 31,
229
230 /** @DRM_PANTHOR_SYNC_OP_SIGNAL: Signal operation. */
231 DRM_PANTHOR_SYNC_OP_SIGNAL = (int)(1u << 31),
232};
233
234/**
235 * struct drm_panthor_sync_op - Synchronization operation.
236 */
237struct drm_panthor_sync_op {
238 /** @flags: Synchronization operation flags. Combination of DRM_PANTHOR_SYNC_OP values. */
239 __u32 flags;
240
241 /** @handle: Sync handle. */
242 __u32 handle;
243
244 /**
245 * @timeline_value: MBZ if
246 * (flags & DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_MASK) !=
247 * DRM_PANTHOR_SYNC_OP_HANDLE_TYPE_TIMELINE_SYNCOBJ.
248 */
249 __u64 timeline_value;
250};
251
252/**
253 * enum drm_panthor_dev_query_type - Query type
254 *
255 * Place new types at the end, don't re-order, don't remove or replace.
256 */
257enum drm_panthor_dev_query_type {
258 /** @DRM_PANTHOR_DEV_QUERY_GPU_INFO: Query GPU information. */
259 DRM_PANTHOR_DEV_QUERY_GPU_INFO = 0,
260
261 /** @DRM_PANTHOR_DEV_QUERY_CSIF_INFO: Query command-stream interface information. */
262 DRM_PANTHOR_DEV_QUERY_CSIF_INFO,
263};
264
265/**
266 * struct drm_panthor_gpu_info - GPU information
267 *
268 * Structure grouping all queryable information relating to the GPU.
269 */
270struct drm_panthor_gpu_info {
271 /** @gpu_id : GPU ID. */
272 __u32 gpu_id;
273#define DRM_PANTHOR_ARCH_MAJOR(x) ((x) >> 28)
274#define DRM_PANTHOR_ARCH_MINOR(x) (((x) >> 24) & 0xf)
275#define DRM_PANTHOR_ARCH_REV(x) (((x) >> 20) & 0xf)
276#define DRM_PANTHOR_PRODUCT_MAJOR(x) (((x) >> 16) & 0xf)
277#define DRM_PANTHOR_VERSION_MAJOR(x) (((x) >> 12) & 0xf)
278#define DRM_PANTHOR_VERSION_MINOR(x) (((x) >> 4) & 0xff)
279#define DRM_PANTHOR_VERSION_STATUS(x) ((x) & 0xf)
280
281 /** @gpu_rev: GPU revision. */
282 __u32 gpu_rev;
283
284 /** @csf_id: Command stream frontend ID. */
285 __u32 csf_id;
286#define DRM_PANTHOR_CSHW_MAJOR(x) (((x) >> 26) & 0x3f)
287#define DRM_PANTHOR_CSHW_MINOR(x) (((x) >> 20) & 0x3f)
288#define DRM_PANTHOR_CSHW_REV(x) (((x) >> 16) & 0xf)
289#define DRM_PANTHOR_MCU_MAJOR(x) (((x) >> 10) & 0x3f)
290#define DRM_PANTHOR_MCU_MINOR(x) (((x) >> 4) & 0x3f)
291#define DRM_PANTHOR_MCU_REV(x) ((x) & 0xf)
292
293 /** @l2_features: L2-cache features. */
294 __u32 l2_features;
295
296 /** @tiler_features: Tiler features. */
297 __u32 tiler_features;
298
299 /** @mem_features: Memory features. */
300 __u32 mem_features;
301
302 /** @mmu_features: MMU features. */
303 __u32 mmu_features;
304#define DRM_PANTHOR_MMU_VA_BITS(x) ((x) & 0xff)
305
306 /** @thread_features: Thread features. */
307 __u32 thread_features;
308
309 /** @max_threads: Maximum number of threads. */
310 __u32 max_threads;
311
312 /** @thread_max_workgroup_size: Maximum workgroup size. */
313 __u32 thread_max_workgroup_size;
314
315 /**
316 * @thread_max_barrier_size: Maximum number of threads that can wait
317 * simultaneously on a barrier.
318 */
319 __u32 thread_max_barrier_size;
320
321 /** @coherency_features: Coherency features. */
322 __u32 coherency_features;
323
324 /** @texture_features: Texture features. */
325 __u32 texture_features[4];
326
327 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */
328 __u32 as_present;
329
330 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */
331 __u64 shader_present;
332
333 /** @l2_present: Bitmask encoding the L2 caches exposed by the GPU. */
334 __u64 l2_present;
335
336 /** @tiler_present: Bitmask encoding the tiler units exposed by the GPU. */
337 __u64 tiler_present;
338
339 /** @core_features: Used to discriminate core variants when they exist. */
340 __u32 core_features;
341
342 /** @pad: MBZ. */
343 __u32 pad;
344};
345
346/**
347 * struct drm_panthor_csif_info - Command stream interface information
348 *
349 * Structure grouping all queryable information relating to the command stream interface.
350 */
351struct drm_panthor_csif_info {
352 /** @csg_slot_count: Number of command stream group slots exposed by the firmware. */
353 __u32 csg_slot_count;
354
355 /** @cs_slot_count: Number of command stream slots per group. */
356 __u32 cs_slot_count;
357
358 /** @cs_reg_count: Number of command stream registers. */
359 __u32 cs_reg_count;
360
361 /** @scoreboard_slot_count: Number of scoreboard slots. */
362 __u32 scoreboard_slot_count;
363
364 /**
365 * @unpreserved_cs_reg_count: Number of command stream registers reserved by
366 * the kernel driver to call a userspace command stream.
367 *
368 * All registers can be used by a userspace command stream, but the
369 * [cs_slot_count - unpreserved_cs_reg_count .. cs_slot_count] registers are
370 * used by the kernel when DRM_PANTHOR_IOCTL_GROUP_SUBMIT is called.
371 */
372 __u32 unpreserved_cs_reg_count;
373
374 /**
375 * @pad: Padding field, set to zero.
376 */
377 __u32 pad;
378};
379
380/**
381 * struct drm_panthor_dev_query - Arguments passed to DRM_PANTHOR_IOCTL_DEV_QUERY
382 */
383struct drm_panthor_dev_query {
384 /** @type: the query type (see drm_panthor_dev_query_type). */
385 __u32 type;
386
387 /**
388 * @size: size of the type being queried.
389 *
390 * If pointer is NULL, size is updated by the driver to provide the
391 * output structure size. If pointer is not NULL, the driver will
392 * only copy min(size, actual_structure_size) bytes to the pointer,
393 * and update the size accordingly. This allows us to extend query
394 * types without breaking userspace.
395 */
396 __u32 size;
397
398 /**
399 * @pointer: user pointer to a query type struct.
400 *
401 * Pointer can be NULL, in which case, nothing is copied, but the
402 * actual structure size is returned. If not NULL, it must point to
403 * a location that's large enough to hold size bytes.
404 */
405 __u64 pointer;
406};
407
408/**
409 * struct drm_panthor_vm_create - Arguments passed to DRM_PANTHOR_IOCTL_VM_CREATE
410 */
411struct drm_panthor_vm_create {
412 /** @flags: VM flags, MBZ. */
413 __u32 flags;
414
415 /** @id: Returned VM ID. */
416 __u32 id;
417
418 /**
419 * @user_va_range: Size of the VA space reserved for user objects.
420 *
421 * The kernel will pick the remaining space to map kernel-only objects to the
422 * VM (heap chunks, heap context, ring buffers, kernel synchronization objects,
423 * ...). If the space left for kernel objects is too small, kernel object
424 * allocation will fail further down the road. One can use
425 * drm_panthor_gpu_info::mmu_features to extract the total virtual address
426 * range, and chose a user_va_range that leaves some space to the kernel.
427 *
428 * If user_va_range is zero, the kernel will pick a sensible value based on
429 * TASK_SIZE and the virtual range supported by the GPU MMU (the kernel/user
430 * split should leave enough VA space for userspace processes to support SVM,
431 * while still allowing the kernel to map some amount of kernel objects in
432 * the kernel VA range). The value chosen by the driver will be returned in
433 * @user_va_range.
434 *
435 * User VA space always starts at 0x0, kernel VA space is always placed after
436 * the user VA range.
437 */
438 __u64 user_va_range;
439};
440
441/**
442 * struct drm_panthor_vm_destroy - Arguments passed to DRM_PANTHOR_IOCTL_VM_DESTROY
443 */
444struct drm_panthor_vm_destroy {
445 /** @id: ID of the VM to destroy. */
446 __u32 id;
447
448 /** @pad: MBZ. */
449 __u32 pad;
450};
451
452/**
453 * enum drm_panthor_vm_bind_op_flags - VM bind operation flags
454 */
455enum drm_panthor_vm_bind_op_flags {
456 /**
457 * @DRM_PANTHOR_VM_BIND_OP_MAP_READONLY: Map the memory read-only.
458 *
459 * Only valid with DRM_PANTHOR_VM_BIND_OP_TYPE_MAP.
460 */
461 DRM_PANTHOR_VM_BIND_OP_MAP_READONLY = 1 << 0,
462
463 /**
464 * @DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC: Map the memory not-executable.
465 *
466 * Only valid with DRM_PANTHOR_VM_BIND_OP_TYPE_MAP.
467 */
468 DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC = 1 << 1,
469
470 /**
471 * @DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED: Map the memory uncached.
472 *
473 * Only valid with DRM_PANTHOR_VM_BIND_OP_TYPE_MAP.
474 */
475 DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED = 1 << 2,
476
477 /**
478 * @DRM_PANTHOR_VM_BIND_OP_TYPE_MASK: Mask used to determine the type of operation.
479 */
480 DRM_PANTHOR_VM_BIND_OP_TYPE_MASK = (int)(0xfu << 28),
481
482 /** @DRM_PANTHOR_VM_BIND_OP_TYPE_MAP: Map operation. */
483 DRM_PANTHOR_VM_BIND_OP_TYPE_MAP = 0 << 28,
484
485 /** @DRM_PANTHOR_VM_BIND_OP_TYPE_UNMAP: Unmap operation. */
486 DRM_PANTHOR_VM_BIND_OP_TYPE_UNMAP = 1 << 28,
487
488 /**
489 * @DRM_PANTHOR_VM_BIND_OP_TYPE_SYNC_ONLY: No VM operation.
490 *
491 * Just serves as a synchronization point on a VM queue.
492 *
493 * Only valid if %DRM_PANTHOR_VM_BIND_ASYNC is set in drm_panthor_vm_bind::flags,
494 * and drm_panthor_vm_bind_op::syncs contains at least one element.
495 */
496 DRM_PANTHOR_VM_BIND_OP_TYPE_SYNC_ONLY = 2 << 28,
497};
498
499/**
500 * struct drm_panthor_vm_bind_op - VM bind operation
501 */
502struct drm_panthor_vm_bind_op {
503 /** @flags: Combination of drm_panthor_vm_bind_op_flags flags. */
504 __u32 flags;
505
506 /**
507 * @bo_handle: Handle of the buffer object to map.
508 * MBZ for unmap or sync-only operations.
509 */
510 __u32 bo_handle;
511
512 /**
513 * @bo_offset: Buffer object offset.
514 * MBZ for unmap or sync-only operations.
515 */
516 __u64 bo_offset;
517
518 /**
519 * @va: Virtual address to map/unmap.
520 * MBZ for sync-only operations.
521 */
522 __u64 va;
523
524 /**
525 * @size: Size to map/unmap.
526 * MBZ for sync-only operations.
527 */
528 __u64 size;
529
530 /**
531 * @syncs: Array of struct drm_panthor_sync_op synchronization
532 * operations.
533 *
534 * This array must be empty if %DRM_PANTHOR_VM_BIND_ASYNC is not set on
535 * the drm_panthor_vm_bind object containing this VM bind operation.
536 *
537 * This array shall not be empty for sync-only operations.
538 */
539 struct drm_panthor_obj_array syncs;
540
541};
542
543/**
544 * enum drm_panthor_vm_bind_flags - VM bind flags
545 */
546enum drm_panthor_vm_bind_flags {
547 /**
548 * @DRM_PANTHOR_VM_BIND_ASYNC: VM bind operations are queued to the VM
549 * queue instead of being executed synchronously.
550 */
551 DRM_PANTHOR_VM_BIND_ASYNC = 1 << 0,
552};
553
554/**
555 * struct drm_panthor_vm_bind - Arguments passed to DRM_IOCTL_PANTHOR_VM_BIND
556 */
557struct drm_panthor_vm_bind {
558 /** @vm_id: VM targeted by the bind request. */
559 __u32 vm_id;
560
561 /** @flags: Combination of drm_panthor_vm_bind_flags flags. */
562 __u32 flags;
563
564 /** @ops: Array of struct drm_panthor_vm_bind_op bind operations. */
565 struct drm_panthor_obj_array ops;
566};
567
568/**
569 * enum drm_panthor_vm_state - VM states.
570 */
571enum drm_panthor_vm_state {
572 /**
573 * @DRM_PANTHOR_VM_STATE_USABLE: VM is usable.
574 *
575 * New VM operations will be accepted on this VM.
576 */
577 DRM_PANTHOR_VM_STATE_USABLE,
578
579 /**
580 * @DRM_PANTHOR_VM_STATE_UNUSABLE: VM is unusable.
581 *
582 * Something put the VM in an unusable state (like an asynchronous
583 * VM_BIND request failing for any reason).
584 *
585 * Once the VM is in this state, all new MAP operations will be
586 * rejected, and any GPU job targeting this VM will fail.
587 * UNMAP operations are still accepted.
588 *
589 * The only way to recover from an unusable VM is to create a new
590 * VM, and destroy the old one.
591 */
592 DRM_PANTHOR_VM_STATE_UNUSABLE,
593};
594
595/**
596 * struct drm_panthor_vm_get_state - Get VM state.
597 */
598struct drm_panthor_vm_get_state {
599 /** @vm_id: VM targeted by the get_state request. */
600 __u32 vm_id;
601
602 /**
603 * @state: state returned by the driver.
604 *
605 * Must be one of the enum drm_panthor_vm_state values.
606 */
607 __u32 state;
608};
609
610/**
611 * enum drm_panthor_bo_flags - Buffer object flags, passed at creation time.
612 */
613enum drm_panthor_bo_flags {
614 /** @DRM_PANTHOR_BO_NO_MMAP: The buffer object will never be CPU-mapped in userspace. */
615 DRM_PANTHOR_BO_NO_MMAP = (1 << 0),
616};
617
618/**
619 * struct drm_panthor_bo_create - Arguments passed to DRM_IOCTL_PANTHOR_BO_CREATE.
620 */
621struct drm_panthor_bo_create {
622 /**
623 * @size: Requested size for the object
624 *
625 * The (page-aligned) allocated size for the object will be returned.
626 */
627 __u64 size;
628
629 /**
630 * @flags: Flags. Must be a combination of drm_panthor_bo_flags flags.
631 */
632 __u32 flags;
633
634 /**
635 * @exclusive_vm_id: Exclusive VM this buffer object will be mapped to.
636 *
637 * If not zero, the field must refer to a valid VM ID, and implies that:
638 * - the buffer object will only ever be bound to that VM
639 * - cannot be exported as a PRIME fd
640 */
641 __u32 exclusive_vm_id;
642
643 /**
644 * @handle: Returned handle for the object.
645 *
646 * Object handles are nonzero.
647 */
648 __u32 handle;
649
650 /** @pad: MBZ. */
651 __u32 pad;
652};
653
654/**
655 * struct drm_panthor_bo_mmap_offset - Arguments passed to DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET.
656 */
657struct drm_panthor_bo_mmap_offset {
658 /** @handle: Handle of the object we want an mmap offset for. */
659 __u32 handle;
660
661 /** @pad: MBZ. */
662 __u32 pad;
663
664 /** @offset: The fake offset to use for subsequent mmap calls. */
665 __u64 offset;
666};
667
668/**
669 * struct drm_panthor_queue_create - Queue creation arguments.
670 */
671struct drm_panthor_queue_create {
672 /**
673 * @priority: Defines the priority of queues inside a group. Goes from 0 to 15,
674 * 15 being the highest priority.
675 */
676 __u8 priority;
677
678 /** @pad: Padding fields, MBZ. */
679 __u8 pad[3];
680
681 /** @ringbuf_size: Size of the ring buffer to allocate to this queue. */
682 __u32 ringbuf_size;
683};
684
685/**
686 * enum drm_panthor_group_priority - Scheduling group priority
687 */
688enum drm_panthor_group_priority {
689 /** @PANTHOR_GROUP_PRIORITY_LOW: Low priority group. */
690 PANTHOR_GROUP_PRIORITY_LOW = 0,
691
692 /** @PANTHOR_GROUP_PRIORITY_MEDIUM: Medium priority group. */
693 PANTHOR_GROUP_PRIORITY_MEDIUM,
694
695 /** @PANTHOR_GROUP_PRIORITY_HIGH: High priority group. */
696 PANTHOR_GROUP_PRIORITY_HIGH,
697};
698
699/**
700 * struct drm_panthor_group_create - Arguments passed to DRM_IOCTL_PANTHOR_GROUP_CREATE
701 */
702struct drm_panthor_group_create {
703 /** @queues: Array of drm_panthor_queue_create elements. */
704 struct drm_panthor_obj_array queues;
705
706 /**
707 * @max_compute_cores: Maximum number of cores that can be used by compute
708 * jobs across CS queues bound to this group.
709 *
710 * Must be less or equal to the number of bits set in @compute_core_mask.
711 */
712 __u8 max_compute_cores;
713
714 /**
715 * @max_fragment_cores: Maximum number of cores that can be used by fragment
716 * jobs across CS queues bound to this group.
717 *
718 * Must be less or equal to the number of bits set in @fragment_core_mask.
719 */
720 __u8 max_fragment_cores;
721
722 /**
723 * @max_tiler_cores: Maximum number of tilers that can be used by tiler jobs
724 * across CS queues bound to this group.
725 *
726 * Must be less or equal to the number of bits set in @tiler_core_mask.
727 */
728 __u8 max_tiler_cores;
729
730 /** @priority: Group priority (see enum drm_panthor_group_priority). */
731 __u8 priority;
732
733 /** @pad: Padding field, MBZ. */
734 __u32 pad;
735
736 /**
737 * @compute_core_mask: Mask encoding cores that can be used for compute jobs.
738 *
739 * This field must have at least @max_compute_cores bits set.
740 *
741 * The bits set here should also be set in drm_panthor_gpu_info::shader_present.
742 */
743 __u64 compute_core_mask;
744
745 /**
746 * @fragment_core_mask: Mask encoding cores that can be used for fragment jobs.
747 *
748 * This field must have at least @max_fragment_cores bits set.
749 *
750 * The bits set here should also be set in drm_panthor_gpu_info::shader_present.
751 */
752 __u64 fragment_core_mask;
753
754 /**
755 * @tiler_core_mask: Mask encoding cores that can be used for tiler jobs.
756 *
757 * This field must have at least @max_tiler_cores bits set.
758 *
759 * The bits set here should also be set in drm_panthor_gpu_info::tiler_present.
760 */
761 __u64 tiler_core_mask;
762
763 /**
764 * @vm_id: VM ID to bind this group to.
765 *
766 * All submission to queues bound to this group will use this VM.
767 */
768 __u32 vm_id;
769
770 /**
771 * @group_handle: Returned group handle. Passed back when submitting jobs or
772 * destroying a group.
773 */
774 __u32 group_handle;
775};
776
777/**
778 * struct drm_panthor_group_destroy - Arguments passed to DRM_IOCTL_PANTHOR_GROUP_DESTROY
779 */
780struct drm_panthor_group_destroy {
781 /** @group_handle: Group to destroy */
782 __u32 group_handle;
783
784 /** @pad: Padding field, MBZ. */
785 __u32 pad;
786};
787
788/**
789 * struct drm_panthor_queue_submit - Job submission arguments.
790 *
791 * This is describing the userspace command stream to call from the kernel
792 * command stream ring-buffer. Queue submission is always part of a group
793 * submission, taking one or more jobs to submit to the underlying queues.
794 */
795struct drm_panthor_queue_submit {
796 /** @queue_index: Index of the queue inside a group. */
797 __u32 queue_index;
798
799 /**
800 * @stream_size: Size of the command stream to execute.
801 *
802 * Must be 64-bit/8-byte aligned (the size of a CS instruction)
803 *
804 * Can be zero if stream_addr is zero too.
805 *
806 * When the stream size is zero, the queue submit serves as a
807 * synchronization point.
808 */
809 __u32 stream_size;
810
811 /**
812 * @stream_addr: GPU address of the command stream to execute.
813 *
814 * Must be aligned on 64-byte.
815 *
816 * Can be zero is stream_size is zero too.
817 */
818 __u64 stream_addr;
819
820 /**
821 * @latest_flush: FLUSH_ID read at the time the stream was built.
822 *
823 * This allows cache flush elimination for the automatic
824 * flush+invalidate(all) done at submission time, which is needed to
825 * ensure the GPU doesn't get garbage when reading the indirect command
826 * stream buffers. If you want the cache flush to happen
827 * unconditionally, pass a zero here.
828 *
829 * Ignored when stream_size is zero.
830 */
831 __u32 latest_flush;
832
833 /** @pad: MBZ. */
834 __u32 pad;
835
836 /** @syncs: Array of struct drm_panthor_sync_op sync operations. */
837 struct drm_panthor_obj_array syncs;
838};
839
840/**
841 * struct drm_panthor_group_submit - Arguments passed to DRM_IOCTL_PANTHOR_GROUP_SUBMIT
842 */
843struct drm_panthor_group_submit {
844 /** @group_handle: Handle of the group to queue jobs to. */
845 __u32 group_handle;
846
847 /** @pad: MBZ. */
848 __u32 pad;
849
850 /** @queue_submits: Array of drm_panthor_queue_submit objects. */
851 struct drm_panthor_obj_array queue_submits;
852};
853
854/**
855 * enum drm_panthor_group_state_flags - Group state flags
856 */
857enum drm_panthor_group_state_flags {
858 /**
859 * @DRM_PANTHOR_GROUP_STATE_TIMEDOUT: Group had unfinished jobs.
860 *
861 * When a group ends up with this flag set, no jobs can be submitted to its queues.
862 */
863 DRM_PANTHOR_GROUP_STATE_TIMEDOUT = 1 << 0,
864
865 /**
866 * @DRM_PANTHOR_GROUP_STATE_FATAL_FAULT: Group had fatal faults.
867 *
868 * When a group ends up with this flag set, no jobs can be submitted to its queues.
869 */
870 DRM_PANTHOR_GROUP_STATE_FATAL_FAULT = 1 << 1,
871};
872
873/**
874 * struct drm_panthor_group_get_state - Arguments passed to DRM_IOCTL_PANTHOR_GROUP_GET_STATE
875 *
876 * Used to query the state of a group and decide whether a new group should be created to
877 * replace it.
878 */
879struct drm_panthor_group_get_state {
880 /** @group_handle: Handle of the group to query state on */
881 __u32 group_handle;
882
883 /**
884 * @state: Combination of DRM_PANTHOR_GROUP_STATE_* flags encoding the
885 * group state.
886 */
887 __u32 state;
888
889 /** @fatal_queues: Bitmask of queues that faced fatal faults. */
890 __u32 fatal_queues;
891
892 /** @pad: MBZ */
893 __u32 pad;
894};
895
896/**
897 * struct drm_panthor_tiler_heap_create - Arguments passed to DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE
898 */
899struct drm_panthor_tiler_heap_create {
900 /** @vm_id: VM ID the tiler heap should be mapped to */
901 __u32 vm_id;
902
903 /** @initial_chunk_count: Initial number of chunks to allocate. Must be at least one. */
904 __u32 initial_chunk_count;
905
906 /**
907 * @chunk_size: Chunk size.
908 *
909 * Must be page-aligned and lie in the [128k:8M] range.
910 */
911 __u32 chunk_size;
912
913 /**
914 * @max_chunks: Maximum number of chunks that can be allocated.
915 *
916 * Must be at least @initial_chunk_count.
917 */
918 __u32 max_chunks;
919
920 /**
921 * @target_in_flight: Maximum number of in-flight render passes.
922 *
923 * If the heap has more than tiler jobs in-flight, the FW will wait for render
924 * passes to finish before queuing new tiler jobs.
925 */
926 __u32 target_in_flight;
927
928 /** @handle: Returned heap handle. Passed back to DESTROY_TILER_HEAP. */
929 __u32 handle;
930
931 /** @tiler_heap_ctx_gpu_va: Returned heap GPU virtual address returned */
932 __u64 tiler_heap_ctx_gpu_va;
933
934 /**
935 * @first_heap_chunk_gpu_va: First heap chunk.
936 *
937 * The tiler heap is formed of heap chunks forming a single-link list. This
938 * is the first element in the list.
939 */
940 __u64 first_heap_chunk_gpu_va;
941};
942
943/**
944 * struct drm_panthor_tiler_heap_destroy - Arguments passed to DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY
945 */
946struct drm_panthor_tiler_heap_destroy {
947 /**
948 * @handle: Handle of the tiler heap to destroy.
949 *
950 * Must be a valid heap handle returned by DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE.
951 */
952 __u32 handle;
953
954 /** @pad: Padding field, MBZ. */
955 __u32 pad;
956};
957
958#if defined(__cplusplus)
959}
960#endif
961
962#endif /* _PANTHOR_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/pvr_drm.h created+1295
......@@ -0,0 +1,1295 @@
1/* SPDX-License-Identifier: (GPL-2.0-only WITH Linux-syscall-note) OR MIT */
2/* Copyright (c) 2023 Imagination Technologies Ltd. */
3
4#ifndef PVR_DRM_UAPI_H
5#define PVR_DRM_UAPI_H
6
7#include "drm.h"
8
9#include <linux/const.h>
10#include <linux/types.h>
11
12#if defined(__cplusplus)
13extern "C" {
14#endif
15
16/**
17 * DOC: PowerVR UAPI
18 *
19 * The PowerVR IOCTL argument structs have a few limitations in place, in
20 * addition to the standard kernel restrictions:
21 *
22 * - All members must be type-aligned.
23 * - The overall struct must be padded to 64-bit alignment.
24 * - Explicit padding is almost always required. This takes the form of
25 * ``_padding_[x]`` members of sufficient size to pad to the next power-of-two
26 * alignment, where [x] is the offset into the struct in hexadecimal. Arrays
27 * are never used for alignment. Padding fields must be zeroed; this is
28 * always checked.
29 * - Unions may only appear as the last member of a struct.
30 * - Individual union members may grow in the future. The space between the
31 * end of a union member and the end of its containing union is considered
32 * "implicit padding" and must be zeroed. This is always checked.
33 *
34 * In addition to the IOCTL argument structs, the PowerVR UAPI makes use of
35 * DEV_QUERY argument structs. These are used to fetch information about the
36 * device and runtime. These structs are subject to the same rules set out
37 * above.
38 */
39
40/**
41 * struct drm_pvr_obj_array - Container used to pass arrays of objects
42 *
43 * It is not unusual to have to extend objects to pass new parameters, and the DRM
44 * ioctl infrastructure is supporting that by padding ioctl arguments with zeros
45 * when the data passed by userspace is smaller than the struct defined in the
46 * drm_ioctl_desc, thus keeping things backward compatible. This type is just
47 * applying the same concepts to indirect objects passed through arrays referenced
48 * from the main ioctl arguments structure: the stride basically defines the size
49 * of the object passed by userspace, which allows the kernel driver to pad with
50 * zeros when it's smaller than the size of the object it expects.
51 *
52 * Use ``DRM_PVR_OBJ_ARRAY()`` to fill object array fields, unless you
53 * have a very good reason not to.
54 */
55struct drm_pvr_obj_array {
56 /** @stride: Stride of object struct. Used for versioning. */
57 __u32 stride;
58
59 /** @count: Number of objects in the array. */
60 __u32 count;
61
62 /** @array: User pointer to an array of objects. */
63 __u64 array;
64};
65
66/**
67 * DRM_PVR_OBJ_ARRAY() - Helper macro for filling &struct drm_pvr_obj_array.
68 * @cnt: Number of elements pointed to py @ptr.
69 * @ptr: Pointer to start of a C array.
70 *
71 * Return: Literal of type &struct drm_pvr_obj_array.
72 */
73#define DRM_PVR_OBJ_ARRAY(cnt, ptr) \
74 { .stride = sizeof((ptr)[0]), .count = (cnt), .array = (__u64)(uintptr_t)(ptr) }
75
76/**
77 * DOC: PowerVR IOCTL interface
78 */
79
80/**
81 * PVR_IOCTL() - Build a PowerVR IOCTL number
82 * @_ioctl: An incrementing id for this IOCTL. Added to %DRM_COMMAND_BASE.
83 * @_mode: Must be one of %DRM_IOR, %DRM_IOW or %DRM_IOWR.
84 * @_data: The type of the args struct passed by this IOCTL.
85 *
86 * The struct referred to by @_data must have a ``drm_pvr_ioctl_`` prefix and an
87 * ``_args suffix``. They are therefore omitted from @_data.
88 *
89 * This should only be used to build the constants described below; it should
90 * never be used to call an IOCTL directly.
91 *
92 * Return: An IOCTL number to be passed to ioctl() from userspace.
93 */
94#define PVR_IOCTL(_ioctl, _mode, _data) \
95 _mode(DRM_COMMAND_BASE + (_ioctl), struct drm_pvr_ioctl_##_data##_args)
96
97#define DRM_IOCTL_PVR_DEV_QUERY PVR_IOCTL(0x00, DRM_IOWR, dev_query)
98#define DRM_IOCTL_PVR_CREATE_BO PVR_IOCTL(0x01, DRM_IOWR, create_bo)
99#define DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET PVR_IOCTL(0x02, DRM_IOWR, get_bo_mmap_offset)
100#define DRM_IOCTL_PVR_CREATE_VM_CONTEXT PVR_IOCTL(0x03, DRM_IOWR, create_vm_context)
101#define DRM_IOCTL_PVR_DESTROY_VM_CONTEXT PVR_IOCTL(0x04, DRM_IOW, destroy_vm_context)
102#define DRM_IOCTL_PVR_VM_MAP PVR_IOCTL(0x05, DRM_IOW, vm_map)
103#define DRM_IOCTL_PVR_VM_UNMAP PVR_IOCTL(0x06, DRM_IOW, vm_unmap)
104#define DRM_IOCTL_PVR_CREATE_CONTEXT PVR_IOCTL(0x07, DRM_IOWR, create_context)
105#define DRM_IOCTL_PVR_DESTROY_CONTEXT PVR_IOCTL(0x08, DRM_IOW, destroy_context)
106#define DRM_IOCTL_PVR_CREATE_FREE_LIST PVR_IOCTL(0x09, DRM_IOWR, create_free_list)
107#define DRM_IOCTL_PVR_DESTROY_FREE_LIST PVR_IOCTL(0x0a, DRM_IOW, destroy_free_list)
108#define DRM_IOCTL_PVR_CREATE_HWRT_DATASET PVR_IOCTL(0x0b, DRM_IOWR, create_hwrt_dataset)
109#define DRM_IOCTL_PVR_DESTROY_HWRT_DATASET PVR_IOCTL(0x0c, DRM_IOW, destroy_hwrt_dataset)
110#define DRM_IOCTL_PVR_SUBMIT_JOBS PVR_IOCTL(0x0d, DRM_IOW, submit_jobs)
111
112/**
113 * DOC: PowerVR IOCTL DEV_QUERY interface
114 */
115
116/**
117 * struct drm_pvr_dev_query_gpu_info - Container used to fetch information about
118 * the graphics processor.
119 *
120 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
121 * to %DRM_PVR_DEV_QUERY_GPU_INFO_GET.
122 */
123struct drm_pvr_dev_query_gpu_info {
124 /**
125 * @gpu_id: GPU identifier.
126 *
127 * For all currently supported GPUs this is the BVNC encoded as a 64-bit
128 * value as follows:
129 *
130 * +--------+--------+--------+-------+
131 * | 63..48 | 47..32 | 31..16 | 15..0 |
132 * +========+========+========+=======+
133 * | B | V | N | C |
134 * +--------+--------+--------+-------+
135 */
136 __u64 gpu_id;
137
138 /**
139 * @num_phantoms: Number of Phantoms present.
140 */
141 __u32 num_phantoms;
142
143 /** @_padding_c: Reserved. This field must be zeroed. */
144 __u32 _padding_c;
145};
146
147/**
148 * struct drm_pvr_dev_query_runtime_info - Container used to fetch information
149 * about the graphics runtime.
150 *
151 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
152 * to %DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET.
153 */
154struct drm_pvr_dev_query_runtime_info {
155 /**
156 * @free_list_min_pages: Minimum allowed free list size,
157 * in PM physical pages.
158 */
159 __u64 free_list_min_pages;
160
161 /**
162 * @free_list_max_pages: Maximum allowed free list size,
163 * in PM physical pages.
164 */
165 __u64 free_list_max_pages;
166
167 /**
168 * @common_store_alloc_region_size: Size of the Allocation
169 * Region within the Common Store used for coefficient and shared
170 * registers, in dwords.
171 */
172 __u32 common_store_alloc_region_size;
173
174 /**
175 * @common_store_partition_space_size: Size of the
176 * Partition Space within the Common Store for output buffers, in
177 * dwords.
178 */
179 __u32 common_store_partition_space_size;
180
181 /**
182 * @max_coeffs: Maximum coefficients, in dwords.
183 */
184 __u32 max_coeffs;
185
186 /**
187 * @cdm_max_local_mem_size_regs: Maximum amount of local
188 * memory available to a compute kernel, in dwords.
189 */
190 __u32 cdm_max_local_mem_size_regs;
191};
192
193/**
194 * struct drm_pvr_dev_query_quirks - Container used to fetch information about
195 * hardware fixes for which the device may require support in the user mode
196 * driver.
197 *
198 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
199 * to %DRM_PVR_DEV_QUERY_QUIRKS_GET.
200 */
201struct drm_pvr_dev_query_quirks {
202 /**
203 * @quirks: A userspace address for the hardware quirks __u32 array.
204 *
205 * The first @musthave_count items in the list are quirks that the
206 * client must support for this device. If userspace does not support
207 * all these quirks then functionality is not guaranteed and client
208 * initialisation must fail.
209 * The remaining quirks in the list affect userspace and the kernel or
210 * firmware. They are disabled by default and require userspace to
211 * opt-in. The opt-in mechanism depends on the quirk.
212 */
213 __u64 quirks;
214
215 /** @count: Length of @quirks (number of __u32). */
216 __u16 count;
217
218 /**
219 * @musthave_count: The number of entries in @quirks that are
220 * mandatory, starting at index 0.
221 */
222 __u16 musthave_count;
223
224 /** @_padding_c: Reserved. This field must be zeroed. */
225 __u32 _padding_c;
226};
227
228/**
229 * struct drm_pvr_dev_query_enhancements - Container used to fetch information
230 * about optional enhancements supported by the device that require support in
231 * the user mode driver.
232 *
233 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
234 * to %DRM_PVR_DEV_ENHANCEMENTS_GET.
235 */
236struct drm_pvr_dev_query_enhancements {
237 /**
238 * @enhancements: A userspace address for the hardware enhancements
239 * __u32 array.
240 *
241 * These enhancements affect userspace and the kernel or firmware. They
242 * are disabled by default and require userspace to opt-in. The opt-in
243 * mechanism depends on the enhancement.
244 */
245 __u64 enhancements;
246
247 /** @count: Length of @enhancements (number of __u32). */
248 __u16 count;
249
250 /** @_padding_a: Reserved. This field must be zeroed. */
251 __u16 _padding_a;
252
253 /** @_padding_c: Reserved. This field must be zeroed. */
254 __u32 _padding_c;
255};
256
257/**
258 * enum drm_pvr_heap_id - Array index for heap info data returned by
259 * %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
260 *
261 * For compatibility reasons all indices will be present in the returned array,
262 * however some heaps may not be present. These are indicated where
263 * &struct drm_pvr_heap.size is set to zero.
264 */
265enum drm_pvr_heap_id {
266 /** @DRM_PVR_HEAP_GENERAL: General purpose heap. */
267 DRM_PVR_HEAP_GENERAL = 0,
268 /** @DRM_PVR_HEAP_PDS_CODE_DATA: PDS code and data heap. */
269 DRM_PVR_HEAP_PDS_CODE_DATA,
270 /** @DRM_PVR_HEAP_USC_CODE: USC code heap. */
271 DRM_PVR_HEAP_USC_CODE,
272 /** @DRM_PVR_HEAP_RGNHDR: Region header heap. Only used if GPU has BRN63142. */
273 DRM_PVR_HEAP_RGNHDR,
274 /** @DRM_PVR_HEAP_VIS_TEST: Visibility test heap. */
275 DRM_PVR_HEAP_VIS_TEST,
276 /** @DRM_PVR_HEAP_TRANSFER_FRAG: Transfer fragment heap. */
277 DRM_PVR_HEAP_TRANSFER_FRAG,
278
279 /**
280 * @DRM_PVR_HEAP_COUNT: The number of heaps returned by
281 * %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
282 *
283 * More heaps may be added, so this also serves as the copy limit when
284 * sent by the caller.
285 */
286 DRM_PVR_HEAP_COUNT
287 /* Please only add additional heaps above DRM_PVR_HEAP_COUNT! */
288};
289
290/**
291 * struct drm_pvr_heap - Container holding information about a single heap.
292 *
293 * This will always be fetched as an array.
294 */
295struct drm_pvr_heap {
296 /** @base: Base address of heap. */
297 __u64 base;
298
299 /** @size: Size of heap, in bytes. Will be 0 if the heap is not present. */
300 __u64 size;
301
302 /** @flags: Flags for this heap. Currently always 0. */
303 __u32 flags;
304
305 /** @page_size_log2: Log2 of page size. */
306 __u32 page_size_log2;
307};
308
309/**
310 * struct drm_pvr_dev_query_heap_info - Container used to fetch information
311 * about heaps supported by the device driver.
312 *
313 * Please note all driver-supported heaps will be returned up to &heaps.count.
314 * Some heaps will not be present in all devices, which will be indicated by
315 * &struct drm_pvr_heap.size being set to zero.
316 *
317 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
318 * to %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
319 */
320struct drm_pvr_dev_query_heap_info {
321 /**
322 * @heaps: Array of &struct drm_pvr_heap. If pointer is NULL, the count
323 * and stride will be updated with those known to the driver version, to
324 * facilitate allocation by the caller.
325 */
326 struct drm_pvr_obj_array heaps;
327};
328
329/**
330 * enum drm_pvr_static_data_area_usage - Array index for static data area info
331 * returned by %DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET.
332 *
333 * For compatibility reasons all indices will be present in the returned array,
334 * however some areas may not be present. These are indicated where
335 * &struct drm_pvr_static_data_area.size is set to zero.
336 */
337enum drm_pvr_static_data_area_usage {
338 /**
339 * @DRM_PVR_STATIC_DATA_AREA_EOT: End of Tile PDS program code segment.
340 *
341 * The End of Tile PDS task runs at completion of a tile during a fragment job, and is
342 * responsible for emitting the tile to the Pixel Back End.
343 */
344 DRM_PVR_STATIC_DATA_AREA_EOT = 0,
345
346 /**
347 * @DRM_PVR_STATIC_DATA_AREA_FENCE: MCU fence area, used during cache flush and
348 * invalidation.
349 *
350 * This must point to valid physical memory but the contents otherwise are not used.
351 */
352 DRM_PVR_STATIC_DATA_AREA_FENCE,
353
354 /**
355 * @DRM_PVR_STATIC_DATA_AREA_VDM_SYNC: VDM sync program.
356 *
357 * The VDM sync program is used to synchronise multiple areas of the GPU hardware.
358 */
359 DRM_PVR_STATIC_DATA_AREA_VDM_SYNC,
360
361 /**
362 * @DRM_PVR_STATIC_DATA_AREA_YUV_CSC: YUV coefficients.
363 *
364 * Area contains up to 16 slots with stride of 64 bytes. Each is a 3x4 matrix of u16 fixed
365 * point numbers, with 1 sign bit, 2 integer bits and 13 fractional bits.
366 *
367 * The slots are :
368 * 0 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR
369 * 1 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR (full range)
370 * 2 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR (conformant range)
371 * 3 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (full range)
372 * 4 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (conformant range)
373 * 5 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (full range)
374 * 6 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (conformant range)
375 * 7 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (full range)
376 * 8 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (conformant range)
377 * 9 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (conformant range, 10 bit)
378 * 10 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (conformant range, 10 bit)
379 * 11 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (conformant range, 10 bit)
380 * 14 = Identity (biased)
381 * 15 = Identity
382 */
383 DRM_PVR_STATIC_DATA_AREA_YUV_CSC,
384};
385
386/**
387 * struct drm_pvr_static_data_area - Container holding information about a
388 * single static data area.
389 *
390 * This will always be fetched as an array.
391 */
392struct drm_pvr_static_data_area {
393 /**
394 * @area_usage: Usage of static data area.
395 * See &enum drm_pvr_static_data_area_usage.
396 */
397 __u16 area_usage;
398
399 /**
400 * @location_heap_id: Array index of heap where this of static data
401 * area is located. This array is fetched using
402 * %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
403 */
404 __u16 location_heap_id;
405
406 /** @size: Size of static data area. Not present if set to zero. */
407 __u32 size;
408
409 /** @offset: Offset of static data area from start of heap. */
410 __u64 offset;
411};
412
413/**
414 * struct drm_pvr_dev_query_static_data_areas - Container used to fetch
415 * information about the static data areas in heaps supported by the device
416 * driver.
417 *
418 * Please note all driver-supported static data areas will be returned up to
419 * &static_data_areas.count. Some will not be present for all devices which,
420 * will be indicated by &struct drm_pvr_static_data_area.size being set to zero.
421 *
422 * Further, some heaps will not be present either. See &struct
423 * drm_pvr_dev_query_heap_info.
424 *
425 * When fetching this type &struct drm_pvr_ioctl_dev_query_args.type must be set
426 * to %DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET.
427 */
428struct drm_pvr_dev_query_static_data_areas {
429 /**
430 * @static_data_areas: Array of &struct drm_pvr_static_data_area. If
431 * pointer is NULL, the count and stride will be updated with those
432 * known to the driver version, to facilitate allocation by the caller.
433 */
434 struct drm_pvr_obj_array static_data_areas;
435};
436
437/**
438 * enum drm_pvr_dev_query - For use with &drm_pvr_ioctl_dev_query_args.type to
439 * indicate the type of the receiving container.
440 *
441 * Append only. Do not reorder.
442 */
443enum drm_pvr_dev_query {
444 /**
445 * @DRM_PVR_DEV_QUERY_GPU_INFO_GET: The dev query args contain a pointer
446 * to &struct drm_pvr_dev_query_gpu_info.
447 */
448 DRM_PVR_DEV_QUERY_GPU_INFO_GET = 0,
449
450 /**
451 * @DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET: The dev query args contain a
452 * pointer to &struct drm_pvr_dev_query_runtime_info.
453 */
454 DRM_PVR_DEV_QUERY_RUNTIME_INFO_GET,
455
456 /**
457 * @DRM_PVR_DEV_QUERY_QUIRKS_GET: The dev query args contain a pointer
458 * to &struct drm_pvr_dev_query_quirks.
459 */
460 DRM_PVR_DEV_QUERY_QUIRKS_GET,
461
462 /**
463 * @DRM_PVR_DEV_QUERY_ENHANCEMENTS_GET: The dev query args contain a
464 * pointer to &struct drm_pvr_dev_query_enhancements.
465 */
466 DRM_PVR_DEV_QUERY_ENHANCEMENTS_GET,
467
468 /**
469 * @DRM_PVR_DEV_QUERY_HEAP_INFO_GET: The dev query args contain a
470 * pointer to &struct drm_pvr_dev_query_heap_info.
471 */
472 DRM_PVR_DEV_QUERY_HEAP_INFO_GET,
473
474 /**
475 * @DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET: The dev query args contain
476 * a pointer to &struct drm_pvr_dev_query_static_data_areas.
477 */
478 DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET,
479};
480
481/**
482 * struct drm_pvr_ioctl_dev_query_args - Arguments for %DRM_IOCTL_PVR_DEV_QUERY.
483 */
484struct drm_pvr_ioctl_dev_query_args {
485 /**
486 * @type: Type of query and output struct. See &enum drm_pvr_dev_query.
487 */
488 __u32 type;
489
490 /**
491 * @size: Size of the receiving struct, see @type.
492 *
493 * After a successful call this will be updated to the written byte
494 * length.
495 * Can also be used to get the minimum byte length (see @pointer).
496 * This allows additional fields to be appended to the structs in
497 * future.
498 */
499 __u32 size;
500
501 /**
502 * @pointer: Pointer to struct @type.
503 *
504 * Must be large enough to contain @size bytes.
505 * If pointer is NULL, the expected size will be returned in the @size
506 * field, but no other data will be written.
507 */
508 __u64 pointer;
509};
510
511/**
512 * DOC: PowerVR IOCTL CREATE_BO interface
513 */
514
515/**
516 * DOC: Flags for CREATE_BO
517 *
518 * We use "device" to refer to the GPU here because of the ambiguity between CPU and GPU in some
519 * fonts.
520 *
521 * Device mapping options
522 * :DRM_PVR_BO_BYPASS_DEVICE_CACHE: Specify that device accesses to this memory will bypass the
523 * cache. This is used for buffers that will either be regularly updated by the CPU (eg free
524 * lists) or will be accessed only once and therefore isn't worth caching (eg partial render
525 * buffers).
526 * By default, the device flushes its memory caches after every job, so this is not normally
527 * required for coherency.
528 * :DRM_PVR_BO_PM_FW_PROTECT: Specify that only the Parameter Manager (PM) and/or firmware
529 * processor should be allowed to access this memory when mapped to the device. It is not
530 * valid to specify this flag with DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS.
531 *
532 * CPU mapping options
533 * :DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS: Allow userspace to map and access the contents of this
534 * memory. It is not valid to specify this flag with DRM_PVR_BO_PM_FW_PROTECT.
535 */
536#define DRM_PVR_BO_BYPASS_DEVICE_CACHE _BITULL(0)
537#define DRM_PVR_BO_PM_FW_PROTECT _BITULL(1)
538#define DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS _BITULL(2)
539/* Bits 3..63 are reserved. */
540
541#define DRM_PVR_BO_FLAGS_MASK (DRM_PVR_BO_BYPASS_DEVICE_CACHE | DRM_PVR_BO_PM_FW_PROTECT | \
542 DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS)
543
544/**
545 * struct drm_pvr_ioctl_create_bo_args - Arguments for %DRM_IOCTL_PVR_CREATE_BO
546 */
547struct drm_pvr_ioctl_create_bo_args {
548 /**
549 * @size: [IN] Size of buffer object to create. This must be page size
550 * aligned.
551 */
552 __u64 size;
553
554 /**
555 * @handle: [OUT] GEM handle of the new buffer object for use in
556 * userspace.
557 */
558 __u32 handle;
559
560 /** @_padding_c: Reserved. This field must be zeroed. */
561 __u32 _padding_c;
562
563 /**
564 * @flags: [IN] Options which will affect the behaviour of this
565 * creation operation and future mapping operations on the created
566 * object. This field must be a valid combination of ``DRM_PVR_BO_*``
567 * values, with all bits marked as reserved set to zero.
568 */
569 __u64 flags;
570};
571
572/**
573 * DOC: PowerVR IOCTL GET_BO_MMAP_OFFSET interface
574 */
575
576/**
577 * struct drm_pvr_ioctl_get_bo_mmap_offset_args - Arguments for
578 * %DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET
579 *
580 * Like other DRM drivers, the "mmap" IOCTL doesn't actually map any memory.
581 * Instead, it allocates a fake offset which refers to the specified buffer
582 * object. This offset can be used with a real mmap call on the DRM device
583 * itself.
584 */
585struct drm_pvr_ioctl_get_bo_mmap_offset_args {
586 /** @handle: [IN] GEM handle of the buffer object to be mapped. */
587 __u32 handle;
588
589 /** @_padding_4: Reserved. This field must be zeroed. */
590 __u32 _padding_4;
591
592 /** @offset: [OUT] Fake offset to use in the real mmap call. */
593 __u64 offset;
594};
595
596/**
597 * DOC: PowerVR IOCTL CREATE_VM_CONTEXT and DESTROY_VM_CONTEXT interfaces
598 */
599
600/**
601 * struct drm_pvr_ioctl_create_vm_context_args - Arguments for
602 * %DRM_IOCTL_PVR_CREATE_VM_CONTEXT
603 */
604struct drm_pvr_ioctl_create_vm_context_args {
605 /** @handle: [OUT] Handle for new VM context. */
606 __u32 handle;
607
608 /** @_padding_4: Reserved. This field must be zeroed. */
609 __u32 _padding_4;
610};
611
612/**
613 * struct drm_pvr_ioctl_destroy_vm_context_args - Arguments for
614 * %DRM_IOCTL_PVR_DESTROY_VM_CONTEXT
615 */
616struct drm_pvr_ioctl_destroy_vm_context_args {
617 /**
618 * @handle: [IN] Handle for VM context to be destroyed.
619 */
620 __u32 handle;
621
622 /** @_padding_4: Reserved. This field must be zeroed. */
623 __u32 _padding_4;
624};
625
626/**
627 * DOC: PowerVR IOCTL VM_MAP and VM_UNMAP interfaces
628 *
629 * The VM UAPI allows userspace to create buffer object mappings in GPU virtual address space.
630 *
631 * The client is responsible for managing GPU address space. It should allocate mappings within
632 * the heaps returned by %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
633 *
634 * %DRM_IOCTL_PVR_VM_MAP creates a new mapping. The client provides the target virtual address for
635 * the mapping. Size and offset within the mapped buffer object can be specified, so the client can
636 * partially map a buffer.
637 *
638 * %DRM_IOCTL_PVR_VM_UNMAP removes a mapping. The entire mapping will be removed from GPU address
639 * space only if the size of the mapping matches that known to the driver.
640 */
641
642/**
643 * struct drm_pvr_ioctl_vm_map_args - Arguments for %DRM_IOCTL_PVR_VM_MAP.
644 */
645struct drm_pvr_ioctl_vm_map_args {
646 /**
647 * @vm_context_handle: [IN] Handle for VM context for this mapping to
648 * exist in.
649 */
650 __u32 vm_context_handle;
651
652 /** @flags: [IN] Flags which affect this mapping. Currently always 0. */
653 __u32 flags;
654
655 /**
656 * @device_addr: [IN] Requested device-virtual address for the mapping.
657 * This must be non-zero and aligned to the device page size for the
658 * heap containing the requested address. It is an error to specify an
659 * address which is not contained within one of the heaps returned by
660 * %DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
661 */
662 __u64 device_addr;
663
664 /**
665 * @handle: [IN] Handle of the target buffer object. This must be a
666 * valid handle returned by %DRM_IOCTL_PVR_CREATE_BO.
667 */
668 __u32 handle;
669
670 /** @_padding_14: Reserved. This field must be zeroed. */
671 __u32 _padding_14;
672
673 /**
674 * @offset: [IN] Offset into the target bo from which to begin the
675 * mapping.
676 */
677 __u64 offset;
678
679 /**
680 * @size: [IN] Size of the requested mapping. Must be aligned to
681 * the device page size for the heap containing the requested address,
682 * as well as the host page size. When added to @device_addr, the
683 * result must not overflow the heap which contains @device_addr (i.e.
684 * the range specified by @device_addr and @size must be completely
685 * contained within a single heap specified by
686 * %DRM_PVR_DEV_QUERY_HEAP_INFO_GET).
687 */
688 __u64 size;
689};
690
691/**
692 * struct drm_pvr_ioctl_vm_unmap_args - Arguments for %DRM_IOCTL_PVR_VM_UNMAP.
693 */
694struct drm_pvr_ioctl_vm_unmap_args {
695 /**
696 * @vm_context_handle: [IN] Handle for VM context that this mapping
697 * exists in.
698 */
699 __u32 vm_context_handle;
700
701 /** @_padding_4: Reserved. This field must be zeroed. */
702 __u32 _padding_4;
703
704 /**
705 * @device_addr: [IN] Device-virtual address at the start of the target
706 * mapping. This must be non-zero.
707 */
708 __u64 device_addr;
709
710 /**
711 * @size: Size in bytes of the target mapping. This must be non-zero.
712 */
713 __u64 size;
714};
715
716/**
717 * DOC: PowerVR IOCTL CREATE_CONTEXT and DESTROY_CONTEXT interfaces
718 */
719
720/**
721 * enum drm_pvr_ctx_priority - Arguments for
722 * &drm_pvr_ioctl_create_context_args.priority
723 */
724enum drm_pvr_ctx_priority {
725 /** @DRM_PVR_CTX_PRIORITY_LOW: Priority below normal. */
726 DRM_PVR_CTX_PRIORITY_LOW = -512,
727
728 /** @DRM_PVR_CTX_PRIORITY_NORMAL: Normal priority. */
729 DRM_PVR_CTX_PRIORITY_NORMAL = 0,
730
731 /**
732 * @DRM_PVR_CTX_PRIORITY_HIGH: Priority above normal.
733 * Note this requires ``CAP_SYS_NICE`` or ``DRM_MASTER``.
734 */
735 DRM_PVR_CTX_PRIORITY_HIGH = 512,
736};
737
738/**
739 * enum drm_pvr_ctx_type - Arguments for
740 * &struct drm_pvr_ioctl_create_context_args.type
741 */
742enum drm_pvr_ctx_type {
743 /**
744 * @DRM_PVR_CTX_TYPE_RENDER: Render context.
745 */
746 DRM_PVR_CTX_TYPE_RENDER = 0,
747
748 /**
749 * @DRM_PVR_CTX_TYPE_COMPUTE: Compute context.
750 */
751 DRM_PVR_CTX_TYPE_COMPUTE,
752
753 /**
754 * @DRM_PVR_CTX_TYPE_TRANSFER_FRAG: Transfer context for fragment data
755 * master.
756 */
757 DRM_PVR_CTX_TYPE_TRANSFER_FRAG,
758};
759
760/**
761 * struct drm_pvr_ioctl_create_context_args - Arguments for
762 * %DRM_IOCTL_PVR_CREATE_CONTEXT
763 */
764struct drm_pvr_ioctl_create_context_args {
765 /**
766 * @type: [IN] Type of context to create.
767 *
768 * This must be one of the values defined by &enum drm_pvr_ctx_type.
769 */
770 __u32 type;
771
772 /** @flags: [IN] Flags for context. */
773 __u32 flags;
774
775 /**
776 * @priority: [IN] Priority of new context.
777 *
778 * This must be one of the values defined by &enum drm_pvr_ctx_priority.
779 */
780 __s32 priority;
781
782 /** @handle: [OUT] Handle for new context. */
783 __u32 handle;
784
785 /**
786 * @static_context_state: [IN] Pointer to static context state stream.
787 */
788 __u64 static_context_state;
789
790 /**
791 * @static_context_state_len: [IN] Length of static context state, in bytes.
792 */
793 __u32 static_context_state_len;
794
795 /**
796 * @vm_context_handle: [IN] Handle for VM context that this context is
797 * associated with.
798 */
799 __u32 vm_context_handle;
800
801 /**
802 * @callstack_addr: [IN] Address for initial call stack pointer. Only valid
803 * if @type is %DRM_PVR_CTX_TYPE_RENDER, otherwise must be 0.
804 */
805 __u64 callstack_addr;
806};
807
808/**
809 * struct drm_pvr_ioctl_destroy_context_args - Arguments for
810 * %DRM_IOCTL_PVR_DESTROY_CONTEXT
811 */
812struct drm_pvr_ioctl_destroy_context_args {
813 /**
814 * @handle: [IN] Handle for context to be destroyed.
815 */
816 __u32 handle;
817
818 /** @_padding_4: Reserved. This field must be zeroed. */
819 __u32 _padding_4;
820};
821
822/**
823 * DOC: PowerVR IOCTL CREATE_FREE_LIST and DESTROY_FREE_LIST interfaces
824 */
825
826/**
827 * struct drm_pvr_ioctl_create_free_list_args - Arguments for
828 * %DRM_IOCTL_PVR_CREATE_FREE_LIST
829 *
830 * Free list arguments have the following constraints :
831 *
832 * - @max_num_pages must be greater than zero.
833 * - @grow_threshold must be between 0 and 100.
834 * - @grow_num_pages must be less than or equal to &max_num_pages.
835 * - @initial_num_pages, @max_num_pages and @grow_num_pages must be multiples
836 * of 4.
837 * - When &grow_num_pages is 0, @initial_num_pages must be equal to
838 * @max_num_pages.
839 * - When &grow_num_pages is non-zero, @initial_num_pages must be less than
840 * @max_num_pages.
841 */
842struct drm_pvr_ioctl_create_free_list_args {
843 /**
844 * @free_list_gpu_addr: [IN] Address of GPU mapping of buffer object
845 * containing memory to be used by free list.
846 *
847 * The mapped region of the buffer object must be at least
848 * @max_num_pages * ``sizeof(__u32)``.
849 *
850 * The buffer object must have been created with
851 * %DRM_PVR_BO_DEVICE_PM_FW_PROTECT set and
852 * %DRM_PVR_BO_CPU_ALLOW_USERSPACE_ACCESS not set.
853 */
854 __u64 free_list_gpu_addr;
855
856 /** @initial_num_pages: [IN] Pages initially allocated to free list. */
857 __u32 initial_num_pages;
858
859 /** @max_num_pages: [IN] Maximum number of pages in free list. */
860 __u32 max_num_pages;
861
862 /** @grow_num_pages: [IN] Pages to grow free list by per request. */
863 __u32 grow_num_pages;
864
865 /**
866 * @grow_threshold: [IN] Percentage of FL memory used that should
867 * trigger a new grow request.
868 */
869 __u32 grow_threshold;
870
871 /**
872 * @vm_context_handle: [IN] Handle for VM context that the free list buffer
873 * object is mapped in.
874 */
875 __u32 vm_context_handle;
876
877 /**
878 * @handle: [OUT] Handle for created free list.
879 */
880 __u32 handle;
881};
882
883/**
884 * struct drm_pvr_ioctl_destroy_free_list_args - Arguments for
885 * %DRM_IOCTL_PVR_DESTROY_FREE_LIST
886 */
887struct drm_pvr_ioctl_destroy_free_list_args {
888 /**
889 * @handle: [IN] Handle for free list to be destroyed.
890 */
891 __u32 handle;
892
893 /** @_padding_4: Reserved. This field must be zeroed. */
894 __u32 _padding_4;
895};
896
897/**
898 * DOC: PowerVR IOCTL CREATE_HWRT_DATASET and DESTROY_HWRT_DATASET interfaces
899 */
900
901/**
902 * struct drm_pvr_create_hwrt_geom_data_args - Geometry data arguments used for
903 * &struct drm_pvr_ioctl_create_hwrt_dataset_args.geom_data_args.
904 */
905struct drm_pvr_create_hwrt_geom_data_args {
906 /** @tpc_dev_addr: [IN] Tail pointer cache GPU virtual address. */
907 __u64 tpc_dev_addr;
908
909 /** @tpc_size: [IN] Size of TPC, in bytes. */
910 __u32 tpc_size;
911
912 /** @tpc_stride: [IN] Stride between layers in TPC, in pages */
913 __u32 tpc_stride;
914
915 /** @vheap_table_dev_addr: [IN] VHEAP table GPU virtual address. */
916 __u64 vheap_table_dev_addr;
917
918 /** @rtc_dev_addr: [IN] Render Target Cache virtual address. */
919 __u64 rtc_dev_addr;
920};
921
922/**
923 * struct drm_pvr_create_hwrt_rt_data_args - Render target arguments used for
924 * &struct drm_pvr_ioctl_create_hwrt_dataset_args.rt_data_args.
925 */
926struct drm_pvr_create_hwrt_rt_data_args {
927 /** @pm_mlist_dev_addr: [IN] PM MLIST GPU virtual address. */
928 __u64 pm_mlist_dev_addr;
929
930 /** @macrotile_array_dev_addr: [IN] Macrotile array GPU virtual address. */
931 __u64 macrotile_array_dev_addr;
932
933 /** @region_header_dev_addr: [IN] Region header array GPU virtual address. */
934 __u64 region_header_dev_addr;
935};
936
937#define PVR_DRM_HWRT_FREE_LIST_LOCAL 0
938#define PVR_DRM_HWRT_FREE_LIST_GLOBAL 1U
939
940/**
941 * struct drm_pvr_ioctl_create_hwrt_dataset_args - Arguments for
942 * %DRM_IOCTL_PVR_CREATE_HWRT_DATASET
943 */
944struct drm_pvr_ioctl_create_hwrt_dataset_args {
945 /** @geom_data_args: [IN] Geometry data arguments. */
946 struct drm_pvr_create_hwrt_geom_data_args geom_data_args;
947
948 /**
949 * @rt_data_args: [IN] Array of render target arguments.
950 *
951 * Each entry in this array represents a render target in a double buffered
952 * setup.
953 */
954 struct drm_pvr_create_hwrt_rt_data_args rt_data_args[2];
955
956 /**
957 * @free_list_handles: [IN] Array of free list handles.
958 *
959 * free_list_handles[PVR_DRM_HWRT_FREE_LIST_LOCAL] must have initial
960 * size of at least that reported by
961 * &drm_pvr_dev_query_runtime_info.free_list_min_pages.
962 */
963 __u32 free_list_handles[2];
964
965 /** @width: [IN] Width in pixels. */
966 __u32 width;
967
968 /** @height: [IN] Height in pixels. */
969 __u32 height;
970
971 /** @samples: [IN] Number of samples. */
972 __u32 samples;
973
974 /** @layers: [IN] Number of layers. */
975 __u32 layers;
976
977 /** @isp_merge_lower_x: [IN] Lower X coefficient for triangle merging. */
978 __u32 isp_merge_lower_x;
979
980 /** @isp_merge_lower_y: [IN] Lower Y coefficient for triangle merging. */
981 __u32 isp_merge_lower_y;
982
983 /** @isp_merge_scale_x: [IN] Scale X coefficient for triangle merging. */
984 __u32 isp_merge_scale_x;
985
986 /** @isp_merge_scale_y: [IN] Scale Y coefficient for triangle merging. */
987 __u32 isp_merge_scale_y;
988
989 /** @isp_merge_upper_x: [IN] Upper X coefficient for triangle merging. */
990 __u32 isp_merge_upper_x;
991
992 /** @isp_merge_upper_y: [IN] Upper Y coefficient for triangle merging. */
993 __u32 isp_merge_upper_y;
994
995 /**
996 * @region_header_size: [IN] Size of region header array. This common field is used by
997 * both render targets in this data set.
998 *
999 * The units for this field differ depending on what version of the simple internal
1000 * parameter format the device uses. If format 2 is in use then this is interpreted as the
1001 * number of region headers. For other formats it is interpreted as the size in dwords.
1002 */
1003 __u32 region_header_size;
1004
1005 /**
1006 * @handle: [OUT] Handle for created HWRT dataset.
1007 */
1008 __u32 handle;
1009};
1010
1011/**
1012 * struct drm_pvr_ioctl_destroy_hwrt_dataset_args - Arguments for
1013 * %DRM_IOCTL_PVR_DESTROY_HWRT_DATASET
1014 */
1015struct drm_pvr_ioctl_destroy_hwrt_dataset_args {
1016 /**
1017 * @handle: [IN] Handle for HWRT dataset to be destroyed.
1018 */
1019 __u32 handle;
1020
1021 /** @_padding_4: Reserved. This field must be zeroed. */
1022 __u32 _padding_4;
1023};
1024
1025/**
1026 * DOC: PowerVR IOCTL SUBMIT_JOBS interface
1027 */
1028
1029/**
1030 * DOC: Flags for the drm_pvr_sync_op object.
1031 *
1032 * .. c:macro:: DRM_PVR_SYNC_OP_HANDLE_TYPE_MASK
1033 *
1034 * Handle type mask for the drm_pvr_sync_op::flags field.
1035 *
1036 * .. c:macro:: DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_SYNCOBJ
1037 *
1038 * Indicates the handle passed in drm_pvr_sync_op::handle is a syncobj handle.
1039 * This is the default type.
1040 *
1041 * .. c:macro:: DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_TIMELINE_SYNCOBJ
1042 *
1043 * Indicates the handle passed in drm_pvr_sync_op::handle is a timeline syncobj handle.
1044 *
1045 * .. c:macro:: DRM_PVR_SYNC_OP_FLAG_SIGNAL
1046 *
1047 * Signal operation requested. The out-fence bound to the job will be attached to
1048 * the syncobj whose handle is passed in drm_pvr_sync_op::handle.
1049 *
1050 * .. c:macro:: DRM_PVR_SYNC_OP_FLAG_WAIT
1051 *
1052 * Wait operation requested. The job will wait for this particular syncobj or syncobj
1053 * point to be signaled before being started.
1054 * This is the default operation.
1055 */
1056#define DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_MASK 0xf
1057#define DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_SYNCOBJ 0
1058#define DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_TIMELINE_SYNCOBJ 1
1059#define DRM_PVR_SYNC_OP_FLAG_SIGNAL _BITULL(31)
1060#define DRM_PVR_SYNC_OP_FLAG_WAIT 0
1061
1062#define DRM_PVR_SYNC_OP_FLAGS_MASK (DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_MASK | \
1063 DRM_PVR_SYNC_OP_FLAG_SIGNAL)
1064
1065/**
1066 * struct drm_pvr_sync_op - Object describing a sync operation
1067 */
1068struct drm_pvr_sync_op {
1069 /** @handle: Handle of sync object. */
1070 __u32 handle;
1071
1072 /** @flags: Combination of ``DRM_PVR_SYNC_OP_FLAG_`` flags. */
1073 __u32 flags;
1074
1075 /** @value: Timeline value for this drm_syncobj. MBZ for a binary syncobj. */
1076 __u64 value;
1077};
1078
1079/**
1080 * DOC: Flags for SUBMIT_JOB ioctl geometry command.
1081 *
1082 * .. c:macro:: DRM_PVR_SUBMIT_JOB_GEOM_CMD_FIRST
1083 *
1084 * Indicates if this the first command to be issued for a render.
1085 *
1086 * .. c:macro:: DRM_PVR_SUBMIT_JOB_GEOM_CMD_LAST
1087 *
1088 * Indicates if this the last command to be issued for a render.
1089 *
1090 * .. c:macro:: DRM_PVR_SUBMIT_JOB_GEOM_CMD_SINGLE_CORE
1091 *
1092 * Forces to use single core in a multi core device.
1093 *
1094 * .. c:macro:: DRM_PVR_SUBMIT_JOB_GEOM_CMD_FLAGS_MASK
1095 *
1096 * Logical OR of all the geometry cmd flags.
1097 */
1098#define DRM_PVR_SUBMIT_JOB_GEOM_CMD_FIRST _BITULL(0)
1099#define DRM_PVR_SUBMIT_JOB_GEOM_CMD_LAST _BITULL(1)
1100#define DRM_PVR_SUBMIT_JOB_GEOM_CMD_SINGLE_CORE _BITULL(2)
1101#define DRM_PVR_SUBMIT_JOB_GEOM_CMD_FLAGS_MASK \
1102 (DRM_PVR_SUBMIT_JOB_GEOM_CMD_FIRST | \
1103 DRM_PVR_SUBMIT_JOB_GEOM_CMD_LAST | \
1104 DRM_PVR_SUBMIT_JOB_GEOM_CMD_SINGLE_CORE)
1105
1106/**
1107 * DOC: Flags for SUBMIT_JOB ioctl fragment command.
1108 *
1109 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_SINGLE_CORE
1110 *
1111 * Use single core in a multi core setup.
1112 *
1113 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_DEPTHBUFFER
1114 *
1115 * Indicates whether a depth buffer is present.
1116 *
1117 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_STENCILBUFFER
1118 *
1119 * Indicates whether a stencil buffer is present.
1120 *
1121 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_PREVENT_CDM_OVERLAP
1122 *
1123 * Disallow compute overlapped with this render.
1124 *
1125 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_GET_VIS_RESULTS
1126 *
1127 * Indicates whether this render produces visibility results.
1128 *
1129 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_SCRATCHBUFFER
1130 *
1131 * Indicates whether partial renders write to a scratch buffer instead of
1132 * the final surface. It also forces the full screen copy expected to be
1133 * present on the last render after all partial renders have completed.
1134 *
1135 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_DISABLE_PIXELMERGE
1136 *
1137 * Disable pixel merging for this render.
1138 *
1139 * .. c:macro:: DRM_PVR_SUBMIT_JOB_FRAG_CMD_FLAGS_MASK
1140 *
1141 * Logical OR of all the fragment cmd flags.
1142 */
1143#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_SINGLE_CORE _BITULL(0)
1144#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_DEPTHBUFFER _BITULL(1)
1145#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_STENCILBUFFER _BITULL(2)
1146#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_PREVENT_CDM_OVERLAP _BITULL(3)
1147#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_SCRATCHBUFFER _BITULL(4)
1148#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_GET_VIS_RESULTS _BITULL(5)
1149#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_PARTIAL_RENDER _BITULL(6)
1150#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_DISABLE_PIXELMERGE _BITULL(7)
1151#define DRM_PVR_SUBMIT_JOB_FRAG_CMD_FLAGS_MASK \
1152 (DRM_PVR_SUBMIT_JOB_FRAG_CMD_SINGLE_CORE | \
1153 DRM_PVR_SUBMIT_JOB_FRAG_CMD_DEPTHBUFFER | \
1154 DRM_PVR_SUBMIT_JOB_FRAG_CMD_STENCILBUFFER | \
1155 DRM_PVR_SUBMIT_JOB_FRAG_CMD_PREVENT_CDM_OVERLAP | \
1156 DRM_PVR_SUBMIT_JOB_FRAG_CMD_SCRATCHBUFFER | \
1157 DRM_PVR_SUBMIT_JOB_FRAG_CMD_GET_VIS_RESULTS | \
1158 DRM_PVR_SUBMIT_JOB_FRAG_CMD_PARTIAL_RENDER | \
1159 DRM_PVR_SUBMIT_JOB_FRAG_CMD_DISABLE_PIXELMERGE)
1160
1161/**
1162 * DOC: Flags for SUBMIT_JOB ioctl compute command.
1163 *
1164 * .. c:macro:: DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_PREVENT_ALL_OVERLAP
1165 *
1166 * Disallow other jobs overlapped with this compute.
1167 *
1168 * .. c:macro:: DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_SINGLE_CORE
1169 *
1170 * Forces to use single core in a multi core device.
1171 *
1172 * .. c:macro:: DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_FLAGS_MASK
1173 *
1174 * Logical OR of all the compute cmd flags.
1175 */
1176#define DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_PREVENT_ALL_OVERLAP _BITULL(0)
1177#define DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_SINGLE_CORE _BITULL(1)
1178#define DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_FLAGS_MASK \
1179 (DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_PREVENT_ALL_OVERLAP | \
1180 DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_SINGLE_CORE)
1181
1182/**
1183 * DOC: Flags for SUBMIT_JOB ioctl transfer command.
1184 *
1185 * .. c:macro:: DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_SINGLE_CORE
1186 *
1187 * Forces job to use a single core in a multi core device.
1188 *
1189 * .. c:macro:: DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_FLAGS_MASK
1190 *
1191 * Logical OR of all the transfer cmd flags.
1192 */
1193#define DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_SINGLE_CORE _BITULL(0)
1194
1195#define DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_FLAGS_MASK \
1196 DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_SINGLE_CORE
1197
1198/**
1199 * enum drm_pvr_job_type - Arguments for &struct drm_pvr_job.job_type
1200 */
1201enum drm_pvr_job_type {
1202 /** @DRM_PVR_JOB_TYPE_GEOMETRY: Job type is geometry. */
1203 DRM_PVR_JOB_TYPE_GEOMETRY = 0,
1204
1205 /** @DRM_PVR_JOB_TYPE_FRAGMENT: Job type is fragment. */
1206 DRM_PVR_JOB_TYPE_FRAGMENT,
1207
1208 /** @DRM_PVR_JOB_TYPE_COMPUTE: Job type is compute. */
1209 DRM_PVR_JOB_TYPE_COMPUTE,
1210
1211 /** @DRM_PVR_JOB_TYPE_TRANSFER_FRAG: Job type is a fragment transfer. */
1212 DRM_PVR_JOB_TYPE_TRANSFER_FRAG,
1213};
1214
1215/**
1216 * struct drm_pvr_hwrt_data_ref - Reference HWRT data
1217 */
1218struct drm_pvr_hwrt_data_ref {
1219 /** @set_handle: HWRT data set handle. */
1220 __u32 set_handle;
1221
1222 /** @data_index: Index of the HWRT data inside the data set. */
1223 __u32 data_index;
1224};
1225
1226/**
1227 * struct drm_pvr_job - Job arguments passed to the %DRM_IOCTL_PVR_SUBMIT_JOBS ioctl
1228 */
1229struct drm_pvr_job {
1230 /**
1231 * @type: [IN] Type of job being submitted
1232 *
1233 * This must be one of the values defined by &enum drm_pvr_job_type.
1234 */
1235 __u32 type;
1236
1237 /**
1238 * @context_handle: [IN] Context handle.
1239 *
1240 * When @job_type is %DRM_PVR_JOB_TYPE_RENDER, %DRM_PVR_JOB_TYPE_COMPUTE or
1241 * %DRM_PVR_JOB_TYPE_TRANSFER_FRAG, this must be a valid handle returned by
1242 * %DRM_IOCTL_PVR_CREATE_CONTEXT. The type of context must be compatible
1243 * with the type of job being submitted.
1244 *
1245 * When @job_type is %DRM_PVR_JOB_TYPE_NULL, this must be zero.
1246 */
1247 __u32 context_handle;
1248
1249 /**
1250 * @flags: [IN] Flags for command.
1251 *
1252 * Those are job-dependent. See all ``DRM_PVR_SUBMIT_JOB_*``.
1253 */
1254 __u32 flags;
1255
1256 /**
1257 * @cmd_stream_len: [IN] Length of command stream, in bytes.
1258 */
1259 __u32 cmd_stream_len;
1260
1261 /**
1262 * @cmd_stream: [IN] Pointer to command stream for command.
1263 *
1264 * The command stream must be u64-aligned.
1265 */
1266 __u64 cmd_stream;
1267
1268 /** @sync_ops: [IN] Fragment sync operations. */
1269 struct drm_pvr_obj_array sync_ops;
1270
1271 /**
1272 * @hwrt: [IN] HWRT data used by render jobs (geometry or fragment).
1273 *
1274 * Must be zero for non-render jobs.
1275 */
1276 struct drm_pvr_hwrt_data_ref hwrt;
1277};
1278
1279/**
1280 * struct drm_pvr_ioctl_submit_jobs_args - Arguments for %DRM_IOCTL_PVR_SUBMIT_JOB
1281 *
1282 * If the syscall returns an error it is important to check the value of
1283 * @jobs.count. This indicates the index into @jobs.array where the
1284 * error occurred.
1285 */
1286struct drm_pvr_ioctl_submit_jobs_args {
1287 /** @jobs: [IN] Array of jobs to submit. */
1288 struct drm_pvr_obj_array jobs;
1289};
1290
1291#if defined(__cplusplus)
1292}
1293#endif
1294
1295#endif /* PVR_DRM_UAPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/qaic_accel.h created+399
......@@ -0,0 +1,399 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2 *
3 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
5 */
6
7#ifndef QAIC_ACCEL_H_
8#define QAIC_ACCEL_H_
9
10#include "drm.h"
11
12#if defined(__cplusplus)
13extern "C" {
14#endif
15
16/* The length(4K) includes len and count fields of qaic_manage_msg */
17#define QAIC_MANAGE_MAX_MSG_LENGTH SZ_4K
18
19/* semaphore flags */
20#define QAIC_SEM_INSYNCFENCE 2
21#define QAIC_SEM_OUTSYNCFENCE 1
22
23/* Semaphore commands */
24#define QAIC_SEM_NOP 0
25#define QAIC_SEM_INIT 1
26#define QAIC_SEM_INC 2
27#define QAIC_SEM_DEC 3
28#define QAIC_SEM_WAIT_EQUAL 4
29#define QAIC_SEM_WAIT_GT_EQ 5 /* Greater than or equal */
30#define QAIC_SEM_WAIT_GT_0 6 /* Greater than 0 */
31
32#define QAIC_TRANS_UNDEFINED 0
33#define QAIC_TRANS_PASSTHROUGH_FROM_USR 1
34#define QAIC_TRANS_PASSTHROUGH_TO_USR 2
35#define QAIC_TRANS_PASSTHROUGH_FROM_DEV 3
36#define QAIC_TRANS_PASSTHROUGH_TO_DEV 4
37#define QAIC_TRANS_DMA_XFER_FROM_USR 5
38#define QAIC_TRANS_DMA_XFER_TO_DEV 6
39#define QAIC_TRANS_ACTIVATE_FROM_USR 7
40#define QAIC_TRANS_ACTIVATE_FROM_DEV 8
41#define QAIC_TRANS_ACTIVATE_TO_DEV 9
42#define QAIC_TRANS_DEACTIVATE_FROM_USR 10
43#define QAIC_TRANS_DEACTIVATE_FROM_DEV 11
44#define QAIC_TRANS_STATUS_FROM_USR 12
45#define QAIC_TRANS_STATUS_TO_USR 13
46#define QAIC_TRANS_STATUS_FROM_DEV 14
47#define QAIC_TRANS_STATUS_TO_DEV 15
48#define QAIC_TRANS_TERMINATE_FROM_DEV 16
49#define QAIC_TRANS_TERMINATE_TO_DEV 17
50#define QAIC_TRANS_DMA_XFER_CONT 18
51#define QAIC_TRANS_VALIDATE_PARTITION_FROM_DEV 19
52#define QAIC_TRANS_VALIDATE_PARTITION_TO_DEV 20
53
54/**
55 * struct qaic_manage_trans_hdr - Header for a transaction in a manage message.
56 * @type: In. Identifies this transaction. See QAIC_TRANS_* defines.
57 * @len: In. Length of this transaction, including this header.
58 */
59struct qaic_manage_trans_hdr {
60 __u32 type;
61 __u32 len;
62};
63
64/**
65 * struct qaic_manage_trans_passthrough - Defines a passthrough transaction.
66 * @hdr: In. Header to identify this transaction.
67 * @data: In. Payload of this ransaction. Opaque to the driver. Userspace must
68 * encode in little endian and align/pad to 64-bit.
69 */
70struct qaic_manage_trans_passthrough {
71 struct qaic_manage_trans_hdr hdr;
72 __u8 data[];
73};
74
75/**
76 * struct qaic_manage_trans_dma_xfer - Defines a DMA transfer transaction.
77 * @hdr: In. Header to identify this transaction.
78 * @tag: In. Identified this transfer in other transactions. Opaque to the
79 * driver.
80 * @pad: Structure padding.
81 * @addr: In. Address of the data to DMA to the device.
82 * @size: In. Length of the data to DMA to the device.
83 */
84struct qaic_manage_trans_dma_xfer {
85 struct qaic_manage_trans_hdr hdr;
86 __u32 tag;
87 __u32 pad;
88 __u64 addr;
89 __u64 size;
90};
91
92/**
93 * struct qaic_manage_trans_activate_to_dev - Defines an activate request.
94 * @hdr: In. Header to identify this transaction.
95 * @queue_size: In. Number of elements for DBC request and response queues.
96 * @eventfd: Unused.
97 * @options: In. Device specific options for this activate.
98 * @pad: Structure padding. Must be 0.
99 */
100struct qaic_manage_trans_activate_to_dev {
101 struct qaic_manage_trans_hdr hdr;
102 __u32 queue_size;
103 __u32 eventfd;
104 __u32 options;
105 __u32 pad;
106};
107
108/**
109 * struct qaic_manage_trans_activate_from_dev - Defines an activate response.
110 * @hdr: Out. Header to identify this transaction.
111 * @status: Out. Return code of the request from the device.
112 * @dbc_id: Out. Id of the assigned DBC for successful request.
113 * @options: Out. Device specific options for this activate.
114 */
115struct qaic_manage_trans_activate_from_dev {
116 struct qaic_manage_trans_hdr hdr;
117 __u32 status;
118 __u32 dbc_id;
119 __u64 options;
120};
121
122/**
123 * struct qaic_manage_trans_deactivate - Defines a deactivate request.
124 * @hdr: In. Header to identify this transaction.
125 * @dbc_id: In. Id of assigned DBC.
126 * @pad: Structure padding. Must be 0.
127 */
128struct qaic_manage_trans_deactivate {
129 struct qaic_manage_trans_hdr hdr;
130 __u32 dbc_id;
131 __u32 pad;
132};
133
134/**
135 * struct qaic_manage_trans_status_to_dev - Defines a status request.
136 * @hdr: In. Header to identify this transaction.
137 */
138struct qaic_manage_trans_status_to_dev {
139 struct qaic_manage_trans_hdr hdr;
140};
141
142/**
143 * struct qaic_manage_trans_status_from_dev - Defines a status response.
144 * @hdr: Out. Header to identify this transaction.
145 * @major: Out. NNC protocol version major number.
146 * @minor: Out. NNC protocol version minor number.
147 * @status: Out. Return code from device.
148 * @status_flags: Out. Flags from device. Bit 0 indicates if CRCs are required.
149 */
150struct qaic_manage_trans_status_from_dev {
151 struct qaic_manage_trans_hdr hdr;
152 __u16 major;
153 __u16 minor;
154 __u32 status;
155 __u64 status_flags;
156};
157
158/**
159 * struct qaic_manage_msg - Defines a message to the device.
160 * @len: In. Length of all the transactions contained within this message.
161 * @count: In. Number of transactions in this message.
162 * @data: In. Address to an array where the transactions can be found.
163 */
164struct qaic_manage_msg {
165 __u32 len;
166 __u32 count;
167 __u64 data;
168};
169
170/**
171 * struct qaic_create_bo - Defines a request to create a buffer object.
172 * @size: In. Size of the buffer in bytes.
173 * @handle: Out. GEM handle for the BO.
174 * @pad: Structure padding. Must be 0.
175 */
176struct qaic_create_bo {
177 __u64 size;
178 __u32 handle;
179 __u32 pad;
180};
181
182/**
183 * struct qaic_mmap_bo - Defines a request to prepare a BO for mmap().
184 * @handle: In. Handle of the GEM BO to prepare for mmap().
185 * @pad: Structure padding. Must be 0.
186 * @offset: Out. Offset value to provide to mmap().
187 */
188struct qaic_mmap_bo {
189 __u32 handle;
190 __u32 pad;
191 __u64 offset;
192};
193
194/**
195 * struct qaic_sem - Defines a semaphore command for a BO slice.
196 * @val: In. Only lower 12 bits are valid.
197 * @index: In. Only lower 5 bits are valid.
198 * @presync: In. 1 if presync operation, 0 if postsync.
199 * @cmd: In. One of QAIC_SEM_*.
200 * @flags: In. Bitfield. See QAIC_SEM_INSYNCFENCE and QAIC_SEM_OUTSYNCFENCE
201 * @pad: Structure padding. Must be 0.
202 */
203struct qaic_sem {
204 __u16 val;
205 __u8 index;
206 __u8 presync;
207 __u8 cmd;
208 __u8 flags;
209 __u16 pad;
210};
211
212/**
213 * struct qaic_attach_slice_entry - Defines a single BO slice.
214 * @size: In. Size of this slice in bytes.
215 * @sem0: In. Semaphore command 0. Must be 0 is not valid.
216 * @sem1: In. Semaphore command 1. Must be 0 is not valid.
217 * @sem2: In. Semaphore command 2. Must be 0 is not valid.
218 * @sem3: In. Semaphore command 3. Must be 0 is not valid.
219 * @dev_addr: In. Device address this slice pushes to or pulls from.
220 * @db_addr: In. Address of the doorbell to ring.
221 * @db_data: In. Data to write to the doorbell.
222 * @db_len: In. Size of the doorbell data in bits - 32, 16, or 8. 0 is for
223 * inactive doorbells.
224 * @offset: In. Start of this slice as an offset from the start of the BO.
225 */
226struct qaic_attach_slice_entry {
227 __u64 size;
228 struct qaic_sem sem0;
229 struct qaic_sem sem1;
230 struct qaic_sem sem2;
231 struct qaic_sem sem3;
232 __u64 dev_addr;
233 __u64 db_addr;
234 __u32 db_data;
235 __u32 db_len;
236 __u64 offset;
237};
238
239/**
240 * struct qaic_attach_slice_hdr - Defines metadata for a set of BO slices.
241 * @count: In. Number of slices for this BO.
242 * @dbc_id: In. Associate the sliced BO with this DBC.
243 * @handle: In. GEM handle of the BO to slice.
244 * @dir: In. Direction of data flow. 1 = DMA_TO_DEVICE, 2 = DMA_FROM_DEVICE
245 * @size: Deprecated. This value is ignored and size of @handle is used instead.
246 */
247struct qaic_attach_slice_hdr {
248 __u32 count;
249 __u32 dbc_id;
250 __u32 handle;
251 __u32 dir;
252 __u64 size;
253};
254
255/**
256 * struct qaic_attach_slice - Defines a set of BO slices.
257 * @hdr: In. Metadata of the set of slices.
258 * @data: In. Pointer to an array containing the slice definitions.
259 */
260struct qaic_attach_slice {
261 struct qaic_attach_slice_hdr hdr;
262 __u64 data;
263};
264
265/**
266 * struct qaic_execute_entry - Defines a BO to submit to the device.
267 * @handle: In. GEM handle of the BO to commit to the device.
268 * @dir: In. Direction of data. 1 = to device, 2 = from device.
269 */
270struct qaic_execute_entry {
271 __u32 handle;
272 __u32 dir;
273};
274
275/**
276 * struct qaic_partial_execute_entry - Defines a BO to resize and submit.
277 * @handle: In. GEM handle of the BO to commit to the device.
278 * @dir: In. Direction of data. 1 = to device, 2 = from device.
279 * @resize: In. New size of the BO. Must be <= the original BO size.
280 * @resize as 0 would be interpreted as no DMA transfer is
281 * involved.
282 */
283struct qaic_partial_execute_entry {
284 __u32 handle;
285 __u32 dir;
286 __u64 resize;
287};
288
289/**
290 * struct qaic_execute_hdr - Defines metadata for BO submission.
291 * @count: In. Number of BOs to submit.
292 * @dbc_id: In. DBC to submit the BOs on.
293 */
294struct qaic_execute_hdr {
295 __u32 count;
296 __u32 dbc_id;
297};
298
299/**
300 * struct qaic_execute - Defines a list of BOs to submit to the device.
301 * @hdr: In. BO list metadata.
302 * @data: In. Pointer to an array of BOs to submit.
303 */
304struct qaic_execute {
305 struct qaic_execute_hdr hdr;
306 __u64 data;
307};
308
309/**
310 * struct qaic_wait - Defines a blocking wait for BO execution.
311 * @handle: In. GEM handle of the BO to wait on.
312 * @timeout: In. Maximum time in ms to wait for the BO.
313 * @dbc_id: In. DBC the BO is submitted to.
314 * @pad: Structure padding. Must be 0.
315 */
316struct qaic_wait {
317 __u32 handle;
318 __u32 timeout;
319 __u32 dbc_id;
320 __u32 pad;
321};
322
323/**
324 * struct qaic_perf_stats_hdr - Defines metadata for getting BO perf info.
325 * @count: In. Number of BOs requested.
326 * @pad: Structure padding. Must be 0.
327 * @dbc_id: In. DBC the BO are associated with.
328 */
329struct qaic_perf_stats_hdr {
330 __u16 count;
331 __u16 pad;
332 __u32 dbc_id;
333};
334
335/**
336 * struct qaic_perf_stats - Defines a request for getting BO perf info.
337 * @hdr: In. Request metadata
338 * @data: In. Pointer to array of stats structures that will receive the data.
339 */
340struct qaic_perf_stats {
341 struct qaic_perf_stats_hdr hdr;
342 __u64 data;
343};
344
345/**
346 * struct qaic_perf_stats_entry - Defines a BO perf info.
347 * @handle: In. GEM handle of the BO to get perf stats for.
348 * @queue_level_before: Out. Number of elements in the queue before this BO
349 * was submitted.
350 * @num_queue_element: Out. Number of elements added to the queue to submit
351 * this BO.
352 * @submit_latency_us: Out. Time taken by the driver to submit this BO.
353 * @device_latency_us: Out. Time taken by the device to execute this BO.
354 * @pad: Structure padding. Must be 0.
355 */
356struct qaic_perf_stats_entry {
357 __u32 handle;
358 __u32 queue_level_before;
359 __u32 num_queue_element;
360 __u32 submit_latency_us;
361 __u32 device_latency_us;
362 __u32 pad;
363};
364
365/**
366 * struct qaic_detach_slice - Detaches slicing configuration from BO.
367 * @handle: In. GEM handle of the BO to detach slicing configuration.
368 * @pad: Structure padding. Must be 0.
369 */
370struct qaic_detach_slice {
371 __u32 handle;
372 __u32 pad;
373};
374
375#define DRM_QAIC_MANAGE 0x00
376#define DRM_QAIC_CREATE_BO 0x01
377#define DRM_QAIC_MMAP_BO 0x02
378#define DRM_QAIC_ATTACH_SLICE_BO 0x03
379#define DRM_QAIC_EXECUTE_BO 0x04
380#define DRM_QAIC_PARTIAL_EXECUTE_BO 0x05
381#define DRM_QAIC_WAIT_BO 0x06
382#define DRM_QAIC_PERF_STATS_BO 0x07
383#define DRM_QAIC_DETACH_SLICE_BO 0x08
384
385#define DRM_IOCTL_QAIC_MANAGE DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_MANAGE, struct qaic_manage_msg)
386#define DRM_IOCTL_QAIC_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_CREATE_BO, struct qaic_create_bo)
387#define DRM_IOCTL_QAIC_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_MMAP_BO, struct qaic_mmap_bo)
388#define DRM_IOCTL_QAIC_ATTACH_SLICE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_ATTACH_SLICE_BO, struct qaic_attach_slice)
389#define DRM_IOCTL_QAIC_EXECUTE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_EXECUTE_BO, struct qaic_execute)
390#define DRM_IOCTL_QAIC_PARTIAL_EXECUTE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_PARTIAL_EXECUTE_BO, struct qaic_execute)
391#define DRM_IOCTL_QAIC_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_WAIT_BO, struct qaic_wait)
392#define DRM_IOCTL_QAIC_PERF_STATS_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_QAIC_PERF_STATS_BO, struct qaic_perf_stats)
393#define DRM_IOCTL_QAIC_DETACH_SLICE_BO DRM_IOW(DRM_COMMAND_BASE + DRM_QAIC_DETACH_SLICE_BO, struct qaic_detach_slice)
394
395#if defined(__cplusplus)
396}
397#endif
398
399#endif /* QAIC_ACCEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/v3d_drm.h+244-1
......@@ -41,6 +41,7 @@ extern "C" {
4141#define DRM_V3D_PERFMON_CREATE 0x08
4242#define DRM_V3D_PERFMON_DESTROY 0x09
4343#define DRM_V3D_PERFMON_GET_VALUES 0x0a
44#define DRM_V3D_SUBMIT_CPU 0x0b
4445
4546#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4647#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
......@@ -56,6 +57,7 @@ extern "C" {
5657 struct drm_v3d_perfmon_destroy)
5758#define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, \
5859 struct drm_v3d_perfmon_get_values)
60#define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)
5961
6062#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
6163#define DRM_V3D_SUBMIT_EXTENSION 0x02
......@@ -69,7 +71,13 @@ extern "C" {
6971struct drm_v3d_extension {
7072 __u64 next;
7173 __u32 id;
72#define DRM_V3D_EXT_ID_MULTI_SYNC 0x01
74#define DRM_V3D_EXT_ID_MULTI_SYNC 0x01
75#define DRM_V3D_EXT_ID_CPU_INDIRECT_CSD 0x02
76#define DRM_V3D_EXT_ID_CPU_TIMESTAMP_QUERY 0x03
77#define DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY 0x04
78#define DRM_V3D_EXT_ID_CPU_COPY_TIMESTAMP_QUERY 0x05
79#define DRM_V3D_EXT_ID_CPU_RESET_PERFORMANCE_QUERY 0x06
80#define DRM_V3D_EXT_ID_CPU_COPY_PERFORMANCE_QUERY 0x07
7381 __u32 flags; /* mbz */
7482};
7583
......@@ -93,6 +101,7 @@ enum v3d_queue {
93101 V3D_TFU,
94102 V3D_CSD,
95103 V3D_CACHE_CLEAN,
104 V3D_CPU,
96105};
97106
98107/**
......@@ -276,6 +285,7 @@ enum drm_v3d_param {
276285 DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH,
277286 DRM_V3D_PARAM_SUPPORTS_PERFMON,
278287 DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT,
288 DRM_V3D_PARAM_SUPPORTS_CPU_QUEUE,
279289};
280290
281291struct drm_v3d_get_param {
......@@ -319,6 +329,11 @@ struct drm_v3d_submit_tfu {
319329
320330 /* Pointer to an array of ioctl extensions*/
321331 __u64 extensions;
332
333 struct {
334 __u32 ioc;
335 __u32 pad;
336 } v71;
322337};
323338
324339/* Submits a compute shader for dispatch. This job will block on any
......@@ -356,6 +371,234 @@ struct drm_v3d_submit_csd {
356371 __u32 pad;
357372};
358373
374/**
375 * struct drm_v3d_indirect_csd - ioctl extension for the CPU job to create an
376 * indirect CSD
377 *
378 * When an extension of DRM_V3D_EXT_ID_CPU_INDIRECT_CSD id is defined, it
379 * points to this extension to define a indirect CSD submission. It creates a
380 * CPU job linked to a CSD job. The CPU job waits for the indirect CSD
381 * dependencies and, once they are signaled, it updates the CSD job config
382 * before allowing the CSD job execution.
383 */
384struct drm_v3d_indirect_csd {
385 struct drm_v3d_extension base;
386
387 /* Indirect CSD */
388 struct drm_v3d_submit_csd submit;
389
390 /* Handle of the indirect BO, that should be also attached to the
391 * indirect CSD.
392 */
393 __u32 indirect;
394
395 /* Offset within the BO where the workgroup counts are stored */
396 __u32 offset;
397
398 /* Workgroups size */
399 __u32 wg_size;
400
401 /* Indices of the uniforms with the workgroup dispatch counts
402 * in the uniform stream. If the uniform rewrite is not needed,
403 * the offset must be 0xffffffff.
404 */
405 __u32 wg_uniform_offsets[3];
406};
407
408/**
409 * struct drm_v3d_timestamp_query - ioctl extension for the CPU job to calculate
410 * a timestamp query
411 *
412 * When an extension DRM_V3D_EXT_ID_TIMESTAMP_QUERY is defined, it points to
413 * this extension to define a timestamp query submission. This CPU job will
414 * calculate the timestamp query and update the query value within the
415 * timestamp BO. Moreover, it will signal the timestamp syncobj to indicate
416 * query availability.
417 */
418struct drm_v3d_timestamp_query {
419 struct drm_v3d_extension base;
420
421 /* Array of queries' offsets within the timestamp BO for their value */
422 __u64 offsets;
423
424 /* Array of timestamp's syncobjs to indicate its availability */
425 __u64 syncs;
426
427 /* Number of queries */
428 __u32 count;
429
430 /* mbz */
431 __u32 pad;
432};
433
434/**
435 * struct drm_v3d_reset_timestamp_query - ioctl extension for the CPU job to
436 * reset timestamp queries
437 *
438 * When an extension DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY is defined, it
439 * points to this extension to define a reset timestamp submission. This CPU
440 * job will reset the timestamp queries based on value offset of the first
441 * query. Moreover, it will reset the timestamp syncobj to reset query
442 * availability.
443 */
444struct drm_v3d_reset_timestamp_query {
445 struct drm_v3d_extension base;
446
447 /* Array of timestamp's syncobjs to indicate its availability */
448 __u64 syncs;
449
450 /* Offset of the first query within the timestamp BO for its value */
451 __u32 offset;
452
453 /* Number of queries */
454 __u32 count;
455};
456
457/**
458 * struct drm_v3d_copy_timestamp_query - ioctl extension for the CPU job to copy
459 * query results to a buffer
460 *
461 * When an extension DRM_V3D_EXT_ID_CPU_COPY_TIMESTAMP_QUERY is defined, it
462 * points to this extension to define a copy timestamp query submission. This
463 * CPU job will copy the timestamp queries results to a BO with the offset
464 * and stride defined in the extension.
465 */
466struct drm_v3d_copy_timestamp_query {
467 struct drm_v3d_extension base;
468
469 /* Define if should write to buffer using 64 or 32 bits */
470 __u8 do_64bit;
471
472 /* Define if it can write to buffer even if the query is not available */
473 __u8 do_partial;
474
475 /* Define if it should write availability bit to buffer */
476 __u8 availability_bit;
477
478 /* mbz */
479 __u8 pad;
480
481 /* Offset of the buffer in the BO */
482 __u32 offset;
483
484 /* Stride of the buffer in the BO */
485 __u32 stride;
486
487 /* Number of queries */
488 __u32 count;
489
490 /* Array of queries' offsets within the timestamp BO for their value */
491 __u64 offsets;
492
493 /* Array of timestamp's syncobjs to indicate its availability */
494 __u64 syncs;
495};
496
497/**
498 * struct drm_v3d_reset_performance_query - ioctl extension for the CPU job to
499 * reset performance queries
500 *
501 * When an extension DRM_V3D_EXT_ID_CPU_RESET_PERFORMANCE_QUERY is defined, it
502 * points to this extension to define a reset performance submission. This CPU
503 * job will reset the performance queries by resetting the values of the
504 * performance monitors. Moreover, it will reset the syncobj to reset query
505 * availability.
506 */
507struct drm_v3d_reset_performance_query {
508 struct drm_v3d_extension base;
509
510 /* Array of performance queries's syncobjs to indicate its availability */
511 __u64 syncs;
512
513 /* Number of queries */
514 __u32 count;
515
516 /* Number of performance monitors */
517 __u32 nperfmons;
518
519 /* Array of u64 user-pointers that point to an array of kperfmon_ids */
520 __u64 kperfmon_ids;
521};
522
523/**
524 * struct drm_v3d_copy_performance_query - ioctl extension for the CPU job to copy
525 * performance query results to a buffer
526 *
527 * When an extension DRM_V3D_EXT_ID_CPU_COPY_PERFORMANCE_QUERY is defined, it
528 * points to this extension to define a copy performance query submission. This
529 * CPU job will copy the performance queries results to a BO with the offset
530 * and stride defined in the extension.
531 */
532struct drm_v3d_copy_performance_query {
533 struct drm_v3d_extension base;
534
535 /* Define if should write to buffer using 64 or 32 bits */
536 __u8 do_64bit;
537
538 /* Define if it can write to buffer even if the query is not available */
539 __u8 do_partial;
540
541 /* Define if it should write availability bit to buffer */
542 __u8 availability_bit;
543
544 /* mbz */
545 __u8 pad;
546
547 /* Offset of the buffer in the BO */
548 __u32 offset;
549
550 /* Stride of the buffer in the BO */
551 __u32 stride;
552
553 /* Number of performance monitors */
554 __u32 nperfmons;
555
556 /* Number of performance counters related to this query pool */
557 __u32 ncounters;
558
559 /* Number of queries */
560 __u32 count;
561
562 /* Array of performance queries's syncobjs to indicate its availability */
563 __u64 syncs;
564
565 /* Array of u64 user-pointers that point to an array of kperfmon_ids */
566 __u64 kperfmon_ids;
567};
568
569struct drm_v3d_submit_cpu {
570 /* Pointer to a u32 array of the BOs that are referenced by the job.
571 *
572 * For DRM_V3D_EXT_ID_CPU_INDIRECT_CSD, it must contain only one BO,
573 * that contains the workgroup counts.
574 *
575 * For DRM_V3D_EXT_ID_TIMESTAMP_QUERY, it must contain only one BO,
576 * that will contain the timestamp.
577 *
578 * For DRM_V3D_EXT_ID_CPU_RESET_TIMESTAMP_QUERY, it must contain only
579 * one BO, that contains the timestamp.
580 *
581 * For DRM_V3D_EXT_ID_CPU_COPY_TIMESTAMP_QUERY, it must contain two
582 * BOs. The first is the BO where the timestamp queries will be written
583 * to. The second is the BO that contains the timestamp.
584 *
585 * For DRM_V3D_EXT_ID_CPU_RESET_PERFORMANCE_QUERY, it must contain no
586 * BOs.
587 *
588 * For DRM_V3D_EXT_ID_CPU_COPY_PERFORMANCE_QUERY, it must contain one
589 * BO, where the performance queries will be written.
590 */
591 __u64 bo_handles;
592
593 /* Number of BO handles passed in (size is that times 4). */
594 __u32 bo_handle_count;
595
596 __u32 flags;
597
598 /* Pointer to an array of ioctl extensions*/
599 __u64 extensions;
600};
601
359602enum {
360603 V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS,
361604 V3D_PERFCNT_FEP_VALID_PRIMS,
lib/libc/include/any-linux-any/drm/virtgpu_drm.h+17-1
......@@ -64,6 +64,16 @@ struct drm_virtgpu_map {
6464 __u32 pad;
6565};
6666
67#define VIRTGPU_EXECBUF_SYNCOBJ_RESET 0x01
68#define VIRTGPU_EXECBUF_SYNCOBJ_FLAGS ( \
69 VIRTGPU_EXECBUF_SYNCOBJ_RESET | \
70 0)
71struct drm_virtgpu_execbuffer_syncobj {
72 __u32 handle;
73 __u32 flags;
74 __u64 point;
75};
76
6777/* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */
6878struct drm_virtgpu_execbuffer {
6979 __u32 flags;
......@@ -73,7 +83,11 @@ struct drm_virtgpu_execbuffer {
7383 __u32 num_bo_handles;
7484 __s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
7585 __u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
76 __u32 pad;
86 __u32 syncobj_stride; /* size of @drm_virtgpu_execbuffer_syncobj */
87 __u32 num_in_syncobjs;
88 __u32 num_out_syncobjs;
89 __u64 in_syncobjs;
90 __u64 out_syncobjs;
7791};
7892
7993#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
......@@ -83,6 +97,7 @@ struct drm_virtgpu_execbuffer {
8397#define VIRTGPU_PARAM_CROSS_DEVICE 5 /* Cross virtio-device resource sharing */
8498#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
8599#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
100#define VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME 8 /* Ability to set debug name from userspace */
86101
87102struct drm_virtgpu_getparam {
88103 __u64 param;
......@@ -184,6 +199,7 @@ struct drm_virtgpu_resource_create_blob {
184199#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001
185200#define VIRTGPU_CONTEXT_PARAM_NUM_RINGS 0x0002
186201#define VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK 0x0003
202#define VIRTGPU_CONTEXT_PARAM_DEBUG_NAME 0x0004
187203struct drm_virtgpu_context_set_param {
188204 __u64 param;
189205 __u64 value;
lib/libc/include/any-linux-any/drm/vmwgfx_drm.h+4-2
......@@ -1,6 +1,7 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
12/**************************************************************************
23 *
3 * Copyright © 2009-2022 VMware, Inc., Palo Alto, CA., USA
4 * Copyright © 2009-2023 VMware, Inc., Palo Alto, CA., USA
45 * All Rights Reserved.
56 *
67 * Permission is hereby granted, free of charge, to any person obtaining a
......@@ -902,7 +903,8 @@ struct drm_vmw_shader_arg {
902903/**
903904 * enum drm_vmw_surface_flags
904905 *
905 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
906 * @drm_vmw_surface_flag_shareable: Deprecated - all userspace surfaces are
907 * shareable.
906908 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
907909 * surface.
908910 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
lib/libc/include/any-linux-any/drm/xe_drm.h created+1375
......@@ -0,0 +1,1375 @@
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2023 Intel Corporation
4 */
5
6#ifndef _XE_DRM_H_
7#define _XE_DRM_H_
8
9#include "drm.h"
10
11#if defined(__cplusplus)
12extern "C" {
13#endif
14
15/*
16 * Please note that modifications to all structs defined here are
17 * subject to backwards-compatibility constraints.
18 * Sections in this file are organized as follows:
19 * 1. IOCTL definition
20 * 2. Extension definition and helper structs
21 * 3. IOCTL's Query structs in the order of the Query's entries.
22 * 4. The rest of IOCTL structs in the order of IOCTL declaration.
23 */
24
25/**
26 * DOC: Xe Device Block Diagram
27 *
28 * The diagram below represents a high-level simplification of a discrete
29 * GPU supported by the Xe driver. It shows some device components which
30 * are necessary to understand this API, as well as how their relations
31 * to each other. This diagram does not represent real hardware::
32 *
33 * ┌──────────────────────────────────────────────────────────────────┐
34 * │ ┌──────────────────────────────────────────────────┐ ┌─────────┐ │
35 * │ │ ┌───────────────────────┐ ┌─────┐ │ │ ┌─────┐ │ │
36 * │ │ │ VRAM0 ├───┤ ... │ │ │ │VRAM1│ │ │
37 * │ │ └───────────┬───────────┘ └─GT1─┘ │ │ └──┬──┘ │ │
38 * │ │ ┌──────────────────┴───────────────────────────┐ │ │ ┌──┴──┐ │ │
39 * │ │ │ ┌─────────────────────┐ ┌─────────────────┐ │ │ │ │ │ │ │
40 * │ │ │ │ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ │ │
41 * │ │ │ │ │EU│ │EU│ │EU│ │EU│ │ │ │RCS0 │ │BCS0 │ │ │ │ │ │ │ │ │
42 * │ │ │ │ └──┘ └──┘ └──┘ └──┘ │ │ └─────┘ └─────┘ │ │ │ │ │ │ │ │
43 * │ │ │ │ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ │ │
44 * │ │ │ │ │EU│ │EU│ │EU│ │EU│ │ │ │VCS0 │ │VCS1 │ │ │ │ │ │ │ │ │
45 * │ │ │ │ └──┘ └──┘ └──┘ └──┘ │ │ └─────┘ └─────┘ │ │ │ │ │ │ │ │
46 * │ │ │ │ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ │ │
47 * │ │ │ │ │EU│ │EU│ │EU│ │EU│ │ │ │VECS0│ │VECS1│ │ │ │ │ │ ... │ │ │
48 * │ │ │ │ └──┘ └──┘ └──┘ └──┘ │ │ └─────┘ └─────┘ │ │ │ │ │ │ │ │
49 * │ │ │ │ ┌──┐ ┌──┐ ┌──┐ ┌──┐ │ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ │ │
50 * │ │ │ │ │EU│ │EU│ │EU│ │EU│ │ │ │CCS0 │ │CCS1 │ │ │ │ │ │ │ │ │
51 * │ │ │ │ └──┘ └──┘ └──┘ └──┘ │ │ └─────┘ └─────┘ │ │ │ │ │ │ │ │
52 * │ │ │ └─────────DSS─────────┘ │ ┌─────┐ ┌─────┐ │ │ │ │ │ │ │ │
53 * │ │ │ │ │CCS2 │ │CCS3 │ │ │ │ │ │ │ │ │
54 * │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ └─────┘ └─────┘ │ │ │ │ │ │ │ │
55 * │ │ │ │ ... │ │ ... │ │ ... │ │ │ │ │ │ │ │ │ │
56 * │ │ │ └─DSS─┘ └─DSS─┘ └─DSS─┘ └─────Engines─────┘ │ │ │ │ │ │ │
57 * │ │ └───────────────────────────GT0────────────────┘ │ │ └─GT2─┘ │ │
58 * │ └────────────────────────────Tile0─────────────────┘ └─ Tile1──┘ │
59 * └─────────────────────────────Device0───────┬──────────────────────┘
60 * │
61 * ───────────────────────┴────────── PCI bus
62 */
63
64/**
65 * DOC: Xe uAPI Overview
66 *
67 * This section aims to describe the Xe's IOCTL entries, its structs, and other
68 * Xe related uAPI such as uevents and PMU (Platform Monitoring Unit) related
69 * entries and usage.
70 *
71 * List of supported IOCTLs:
72 * - &DRM_IOCTL_XE_DEVICE_QUERY
73 * - &DRM_IOCTL_XE_GEM_CREATE
74 * - &DRM_IOCTL_XE_GEM_MMAP_OFFSET
75 * - &DRM_IOCTL_XE_VM_CREATE
76 * - &DRM_IOCTL_XE_VM_DESTROY
77 * - &DRM_IOCTL_XE_VM_BIND
78 * - &DRM_IOCTL_XE_EXEC_QUEUE_CREATE
79 * - &DRM_IOCTL_XE_EXEC_QUEUE_DESTROY
80 * - &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY
81 * - &DRM_IOCTL_XE_EXEC
82 * - &DRM_IOCTL_XE_WAIT_USER_FENCE
83 */
84
85/*
86 * xe specific ioctls.
87 *
88 * The device specific ioctl range is [DRM_COMMAND_BASE, DRM_COMMAND_END) ie
89 * [0x40, 0xa0) (a0 is excluded). The numbers below are defined as offset
90 * against DRM_COMMAND_BASE and should be between [0x0, 0x60).
91 */
92#define DRM_XE_DEVICE_QUERY 0x00
93#define DRM_XE_GEM_CREATE 0x01
94#define DRM_XE_GEM_MMAP_OFFSET 0x02
95#define DRM_XE_VM_CREATE 0x03
96#define DRM_XE_VM_DESTROY 0x04
97#define DRM_XE_VM_BIND 0x05
98#define DRM_XE_EXEC_QUEUE_CREATE 0x06
99#define DRM_XE_EXEC_QUEUE_DESTROY 0x07
100#define DRM_XE_EXEC_QUEUE_GET_PROPERTY 0x08
101#define DRM_XE_EXEC 0x09
102#define DRM_XE_WAIT_USER_FENCE 0x0a
103/* Must be kept compact -- no holes */
104
105#define DRM_IOCTL_XE_DEVICE_QUERY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_DEVICE_QUERY, struct drm_xe_device_query)
106#define DRM_IOCTL_XE_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_GEM_CREATE, struct drm_xe_gem_create)
107#define DRM_IOCTL_XE_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_GEM_MMAP_OFFSET, struct drm_xe_gem_mmap_offset)
108#define DRM_IOCTL_XE_VM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_VM_CREATE, struct drm_xe_vm_create)
109#define DRM_IOCTL_XE_VM_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_XE_VM_DESTROY, struct drm_xe_vm_destroy)
110#define DRM_IOCTL_XE_VM_BIND DRM_IOW(DRM_COMMAND_BASE + DRM_XE_VM_BIND, struct drm_xe_vm_bind)
111#define DRM_IOCTL_XE_EXEC_QUEUE_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_CREATE, struct drm_xe_exec_queue_create)
112#define DRM_IOCTL_XE_EXEC_QUEUE_DESTROY DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_DESTROY, struct drm_xe_exec_queue_destroy)
113#define DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_EXEC_QUEUE_GET_PROPERTY, struct drm_xe_exec_queue_get_property)
114#define DRM_IOCTL_XE_EXEC DRM_IOW(DRM_COMMAND_BASE + DRM_XE_EXEC, struct drm_xe_exec)
115#define DRM_IOCTL_XE_WAIT_USER_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_XE_WAIT_USER_FENCE, struct drm_xe_wait_user_fence)
116
117/**
118 * DOC: Xe IOCTL Extensions
119 *
120 * Before detailing the IOCTLs and its structs, it is important to highlight
121 * that every IOCTL in Xe is extensible.
122 *
123 * Many interfaces need to grow over time. In most cases we can simply
124 * extend the struct and have userspace pass in more data. Another option,
125 * as demonstrated by Vulkan's approach to providing extensions for forward
126 * and backward compatibility, is to use a list of optional structs to
127 * provide those extra details.
128 *
129 * The key advantage to using an extension chain is that it allows us to
130 * redefine the interface more easily than an ever growing struct of
131 * increasing complexity, and for large parts of that interface to be
132 * entirely optional. The downside is more pointer chasing; chasing across
133 * the boundary with pointers encapsulated inside u64.
134 *
135 * Example chaining:
136 *
137 * .. code-block:: C
138 *
139 * struct drm_xe_user_extension ext3 {
140 * .next_extension = 0, // end
141 * .name = ...,
142 * };
143 * struct drm_xe_user_extension ext2 {
144 * .next_extension = (uintptr_t)&ext3,
145 * .name = ...,
146 * };
147 * struct drm_xe_user_extension ext1 {
148 * .next_extension = (uintptr_t)&ext2,
149 * .name = ...,
150 * };
151 *
152 * Typically the struct drm_xe_user_extension would be embedded in some uAPI
153 * struct, and in this case we would feed it the head of the chain(i.e ext1),
154 * which would then apply all of the above extensions.
155*/
156
157/**
158 * struct drm_xe_user_extension - Base class for defining a chain of extensions
159 */
160struct drm_xe_user_extension {
161 /**
162 * @next_extension:
163 *
164 * Pointer to the next struct drm_xe_user_extension, or zero if the end.
165 */
166 __u64 next_extension;
167
168 /**
169 * @name: Name of the extension.
170 *
171 * Note that the name here is just some integer.
172 *
173 * Also note that the name space for this is not global for the whole
174 * driver, but rather its scope/meaning is limited to the specific piece
175 * of uAPI which has embedded the struct drm_xe_user_extension.
176 */
177 __u32 name;
178
179 /**
180 * @pad: MBZ
181 *
182 * All undefined bits must be zero.
183 */
184 __u32 pad;
185};
186
187/**
188 * struct drm_xe_ext_set_property - Generic set property extension
189 *
190 * A generic struct that allows any of the Xe's IOCTL to be extended
191 * with a set_property operation.
192 */
193struct drm_xe_ext_set_property {
194 /** @base: base user extension */
195 struct drm_xe_user_extension base;
196
197 /** @property: property to set */
198 __u32 property;
199
200 /** @pad: MBZ */
201 __u32 pad;
202
203 /** @value: property value */
204 __u64 value;
205
206 /** @reserved: Reserved */
207 __u64 reserved[2];
208};
209
210/**
211 * struct drm_xe_engine_class_instance - instance of an engine class
212 *
213 * It is returned as part of the @drm_xe_engine, but it also is used as
214 * the input of engine selection for both @drm_xe_exec_queue_create and
215 * @drm_xe_query_engine_cycles
216 *
217 * The @engine_class can be:
218 * - %DRM_XE_ENGINE_CLASS_RENDER
219 * - %DRM_XE_ENGINE_CLASS_COPY
220 * - %DRM_XE_ENGINE_CLASS_VIDEO_DECODE
221 * - %DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE
222 * - %DRM_XE_ENGINE_CLASS_COMPUTE
223 * - %DRM_XE_ENGINE_CLASS_VM_BIND - Kernel only classes (not actual
224 * hardware engine class). Used for creating ordered queues of VM
225 * bind operations.
226 */
227struct drm_xe_engine_class_instance {
228#define DRM_XE_ENGINE_CLASS_RENDER 0
229#define DRM_XE_ENGINE_CLASS_COPY 1
230#define DRM_XE_ENGINE_CLASS_VIDEO_DECODE 2
231#define DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE 3
232#define DRM_XE_ENGINE_CLASS_COMPUTE 4
233#define DRM_XE_ENGINE_CLASS_VM_BIND 5
234 /** @engine_class: engine class id */
235 __u16 engine_class;
236 /** @engine_instance: engine instance id */
237 __u16 engine_instance;
238 /** @gt_id: Unique ID of this GT within the PCI Device */
239 __u16 gt_id;
240 /** @pad: MBZ */
241 __u16 pad;
242};
243
244/**
245 * struct drm_xe_engine - describe hardware engine
246 */
247struct drm_xe_engine {
248 /** @instance: The @drm_xe_engine_class_instance */
249 struct drm_xe_engine_class_instance instance;
250
251 /** @reserved: Reserved */
252 __u64 reserved[3];
253};
254
255/**
256 * struct drm_xe_query_engines - describe engines
257 *
258 * If a query is made with a struct @drm_xe_device_query where .query
259 * is equal to %DRM_XE_DEVICE_QUERY_ENGINES, then the reply uses an array of
260 * struct @drm_xe_query_engines in .data.
261 */
262struct drm_xe_query_engines {
263 /** @num_engines: number of engines returned in @engines */
264 __u32 num_engines;
265 /** @pad: MBZ */
266 __u32 pad;
267 /** @engines: The returned engines for this device */
268 struct drm_xe_engine engines[];
269};
270
271/**
272 * enum drm_xe_memory_class - Supported memory classes.
273 */
274enum drm_xe_memory_class {
275 /** @DRM_XE_MEM_REGION_CLASS_SYSMEM: Represents system memory. */
276 DRM_XE_MEM_REGION_CLASS_SYSMEM = 0,
277 /**
278 * @DRM_XE_MEM_REGION_CLASS_VRAM: On discrete platforms, this
279 * represents the memory that is local to the device, which we
280 * call VRAM. Not valid on integrated platforms.
281 */
282 DRM_XE_MEM_REGION_CLASS_VRAM
283};
284
285/**
286 * struct drm_xe_mem_region - Describes some region as known to
287 * the driver.
288 */
289struct drm_xe_mem_region {
290 /**
291 * @mem_class: The memory class describing this region.
292 *
293 * See enum drm_xe_memory_class for supported values.
294 */
295 __u16 mem_class;
296 /**
297 * @instance: The unique ID for this region, which serves as the
298 * index in the placement bitmask used as argument for
299 * &DRM_IOCTL_XE_GEM_CREATE
300 */
301 __u16 instance;
302 /**
303 * @min_page_size: Min page-size in bytes for this region.
304 *
305 * When the kernel allocates memory for this region, the
306 * underlying pages will be at least @min_page_size in size.
307 * Buffer objects with an allowable placement in this region must be
308 * created with a size aligned to this value.
309 * GPU virtual address mappings of (parts of) buffer objects that
310 * may be placed in this region must also have their GPU virtual
311 * address and range aligned to this value.
312 * Affected IOCTLS will return %-EINVAL if alignment restrictions are
313 * not met.
314 */
315 __u32 min_page_size;
316 /**
317 * @total_size: The usable size in bytes for this region.
318 */
319 __u64 total_size;
320 /**
321 * @used: Estimate of the memory used in bytes for this region.
322 *
323 * Requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable
324 * accounting. Without this the value here will always equal
325 * zero.
326 */
327 __u64 used;
328 /**
329 * @cpu_visible_size: How much of this region can be CPU
330 * accessed, in bytes.
331 *
332 * This will always be <= @total_size, and the remainder (if
333 * any) will not be CPU accessible. If the CPU accessible part
334 * is smaller than @total_size then this is referred to as a
335 * small BAR system.
336 *
337 * On systems without small BAR (full BAR), the probed_size will
338 * always equal the @total_size, since all of it will be CPU
339 * accessible.
340 *
341 * Note this is only tracked for DRM_XE_MEM_REGION_CLASS_VRAM
342 * regions (for other types the value here will always equal
343 * zero).
344 */
345 __u64 cpu_visible_size;
346 /**
347 * @cpu_visible_used: Estimate of CPU visible memory used, in
348 * bytes.
349 *
350 * Requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable
351 * accounting. Without this the value here will always equal
352 * zero. Note this is only currently tracked for
353 * DRM_XE_MEM_REGION_CLASS_VRAM regions (for other types the value
354 * here will always be zero).
355 */
356 __u64 cpu_visible_used;
357 /** @reserved: Reserved */
358 __u64 reserved[6];
359};
360
361/**
362 * struct drm_xe_query_mem_regions - describe memory regions
363 *
364 * If a query is made with a struct drm_xe_device_query where .query
365 * is equal to DRM_XE_DEVICE_QUERY_MEM_REGIONS, then the reply uses
366 * struct drm_xe_query_mem_regions in .data.
367 */
368struct drm_xe_query_mem_regions {
369 /** @num_mem_regions: number of memory regions returned in @mem_regions */
370 __u32 num_mem_regions;
371 /** @pad: MBZ */
372 __u32 pad;
373 /** @mem_regions: The returned memory regions for this device */
374 struct drm_xe_mem_region mem_regions[];
375};
376
377/**
378 * struct drm_xe_query_config - describe the device configuration
379 *
380 * If a query is made with a struct drm_xe_device_query where .query
381 * is equal to DRM_XE_DEVICE_QUERY_CONFIG, then the reply uses
382 * struct drm_xe_query_config in .data.
383 *
384 * The index in @info can be:
385 * - %DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID - Device ID (lower 16 bits)
386 * and the device revision (next 8 bits)
387 * - %DRM_XE_QUERY_CONFIG_FLAGS - Flags describing the device
388 * configuration, see list below
389 *
390 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device
391 * has usable VRAM
392 * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment
393 * required by this device, typically SZ_4K or SZ_64K
394 * - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address
395 * - %DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY - Value of the highest
396 * available exec queue priority
397 */
398struct drm_xe_query_config {
399 /** @num_params: number of parameters returned in info */
400 __u32 num_params;
401
402 /** @pad: MBZ */
403 __u32 pad;
404
405#define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0
406#define DRM_XE_QUERY_CONFIG_FLAGS 1
407 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM (1 << 0)
408#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2
409#define DRM_XE_QUERY_CONFIG_VA_BITS 3
410#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
411 /** @info: array of elements containing the config info */
412 __u64 info[];
413};
414
415/**
416 * struct drm_xe_gt - describe an individual GT.
417 *
418 * To be used with drm_xe_query_gt_list, which will return a list with all the
419 * existing GT individual descriptions.
420 * Graphics Technology (GT) is a subset of a GPU/tile that is responsible for
421 * implementing graphics and/or media operations.
422 *
423 * The index in @type can be:
424 * - %DRM_XE_QUERY_GT_TYPE_MAIN
425 * - %DRM_XE_QUERY_GT_TYPE_MEDIA
426 */
427struct drm_xe_gt {
428#define DRM_XE_QUERY_GT_TYPE_MAIN 0
429#define DRM_XE_QUERY_GT_TYPE_MEDIA 1
430 /** @type: GT type: Main or Media */
431 __u16 type;
432 /** @tile_id: Tile ID where this GT lives (Information only) */
433 __u16 tile_id;
434 /** @gt_id: Unique ID of this GT within the PCI Device */
435 __u16 gt_id;
436 /** @pad: MBZ */
437 __u16 pad[3];
438 /** @reference_clock: A clock frequency for timestamp */
439 __u32 reference_clock;
440 /**
441 * @near_mem_regions: Bit mask of instances from
442 * drm_xe_query_mem_regions that are nearest to the current engines
443 * of this GT.
444 * Each index in this mask refers directly to the struct
445 * drm_xe_query_mem_regions' instance, no assumptions should
446 * be made about order. The type of each region is described
447 * by struct drm_xe_query_mem_regions' mem_class.
448 */
449 __u64 near_mem_regions;
450 /**
451 * @far_mem_regions: Bit mask of instances from
452 * drm_xe_query_mem_regions that are far from the engines of this GT.
453 * In general, they have extra indirections when compared to the
454 * @near_mem_regions. For a discrete device this could mean system
455 * memory and memory living in a different tile.
456 * Each index in this mask refers directly to the struct
457 * drm_xe_query_mem_regions' instance, no assumptions should
458 * be made about order. The type of each region is described
459 * by struct drm_xe_query_mem_regions' mem_class.
460 */
461 __u64 far_mem_regions;
462 /** @ip_ver_major: Graphics/media IP major version on GMD_ID platforms */
463 __u16 ip_ver_major;
464 /** @ip_ver_minor: Graphics/media IP minor version on GMD_ID platforms */
465 __u16 ip_ver_minor;
466 /** @ip_ver_rev: Graphics/media IP revision version on GMD_ID platforms */
467 __u16 ip_ver_rev;
468 /** @pad2: MBZ */
469 __u16 pad2;
470 /** @reserved: Reserved */
471 __u64 reserved[7];
472};
473
474/**
475 * struct drm_xe_query_gt_list - A list with GT description items.
476 *
477 * If a query is made with a struct drm_xe_device_query where .query
478 * is equal to DRM_XE_DEVICE_QUERY_GT_LIST, then the reply uses struct
479 * drm_xe_query_gt_list in .data.
480 */
481struct drm_xe_query_gt_list {
482 /** @num_gt: number of GT items returned in gt_list */
483 __u32 num_gt;
484 /** @pad: MBZ */
485 __u32 pad;
486 /** @gt_list: The GT list returned for this device */
487 struct drm_xe_gt gt_list[];
488};
489
490/**
491 * struct drm_xe_query_topology_mask - describe the topology mask of a GT
492 *
493 * This is the hardware topology which reflects the internal physical
494 * structure of the GPU.
495 *
496 * If a query is made with a struct drm_xe_device_query where .query
497 * is equal to DRM_XE_DEVICE_QUERY_GT_TOPOLOGY, then the reply uses
498 * struct drm_xe_query_topology_mask in .data.
499 *
500 * The @type can be:
501 * - %DRM_XE_TOPO_DSS_GEOMETRY - To query the mask of Dual Sub Slices
502 * (DSS) available for geometry operations. For example a query response
503 * containing the following in mask:
504 * ``DSS_GEOMETRY ff ff ff ff 00 00 00 00``
505 * means 32 DSS are available for geometry.
506 * - %DRM_XE_TOPO_DSS_COMPUTE - To query the mask of Dual Sub Slices
507 * (DSS) available for compute operations. For example a query response
508 * containing the following in mask:
509 * ``DSS_COMPUTE ff ff ff ff 00 00 00 00``
510 * means 32 DSS are available for compute.
511 * - %DRM_XE_TOPO_EU_PER_DSS - To query the mask of Execution Units (EU)
512 * available per Dual Sub Slices (DSS). For example a query response
513 * containing the following in mask:
514 * ``EU_PER_DSS ff ff 00 00 00 00 00 00``
515 * means each DSS has 16 EU.
516 */
517struct drm_xe_query_topology_mask {
518 /** @gt_id: GT ID the mask is associated with */
519 __u16 gt_id;
520
521#define DRM_XE_TOPO_DSS_GEOMETRY 1
522#define DRM_XE_TOPO_DSS_COMPUTE 2
523#define DRM_XE_TOPO_EU_PER_DSS 4
524 /** @type: type of mask */
525 __u16 type;
526
527 /** @num_bytes: number of bytes in requested mask */
528 __u32 num_bytes;
529
530 /** @mask: little-endian mask of @num_bytes */
531 __u8 mask[];
532};
533
534/**
535 * struct drm_xe_query_engine_cycles - correlate CPU and GPU timestamps
536 *
537 * If a query is made with a struct drm_xe_device_query where .query is equal to
538 * DRM_XE_DEVICE_QUERY_ENGINE_CYCLES, then the reply uses struct drm_xe_query_engine_cycles
539 * in .data. struct drm_xe_query_engine_cycles is allocated by the user and
540 * .data points to this allocated structure.
541 *
542 * The query returns the engine cycles, which along with GT's @reference_clock,
543 * can be used to calculate the engine timestamp. In addition the
544 * query returns a set of cpu timestamps that indicate when the command
545 * streamer cycle count was captured.
546 */
547struct drm_xe_query_engine_cycles {
548 /**
549 * @eci: This is input by the user and is the engine for which command
550 * streamer cycles is queried.
551 */
552 struct drm_xe_engine_class_instance eci;
553
554 /**
555 * @clockid: This is input by the user and is the reference clock id for
556 * CPU timestamp. For definition, see clock_gettime(2) and
557 * perf_event_open(2). Supported clock ids are CLOCK_MONOTONIC,
558 * CLOCK_MONOTONIC_RAW, CLOCK_REALTIME, CLOCK_BOOTTIME, CLOCK_TAI.
559 */
560 __s32 clockid;
561
562 /** @width: Width of the engine cycle counter in bits. */
563 __u32 width;
564
565 /**
566 * @engine_cycles: Engine cycles as read from its register
567 * at 0x358 offset.
568 */
569 __u64 engine_cycles;
570
571 /**
572 * @cpu_timestamp: CPU timestamp in ns. The timestamp is captured before
573 * reading the engine_cycles register using the reference clockid set by the
574 * user.
575 */
576 __u64 cpu_timestamp;
577
578 /**
579 * @cpu_delta: Time delta in ns captured around reading the lower dword
580 * of the engine_cycles register.
581 */
582 __u64 cpu_delta;
583};
584
585/**
586 * struct drm_xe_query_uc_fw_version - query a micro-controller firmware version
587 *
588 * Given a uc_type this will return the branch, major, minor and patch version
589 * of the micro-controller firmware.
590 */
591struct drm_xe_query_uc_fw_version {
592 /** @uc_type: The micro-controller type to query firmware version */
593#define XE_QUERY_UC_TYPE_GUC_SUBMISSION 0
594#define XE_QUERY_UC_TYPE_HUC 1
595 __u16 uc_type;
596
597 /** @pad: MBZ */
598 __u16 pad;
599
600 /** @branch_ver: branch uc fw version */
601 __u32 branch_ver;
602 /** @major_ver: major uc fw version */
603 __u32 major_ver;
604 /** @minor_ver: minor uc fw version */
605 __u32 minor_ver;
606 /** @patch_ver: patch uc fw version */
607 __u32 patch_ver;
608
609 /** @pad2: MBZ */
610 __u32 pad2;
611
612 /** @reserved: Reserved */
613 __u64 reserved;
614};
615
616/**
617 * struct drm_xe_device_query - Input of &DRM_IOCTL_XE_DEVICE_QUERY - main
618 * structure to query device information
619 *
620 * The user selects the type of data to query among DRM_XE_DEVICE_QUERY_*
621 * and sets the value in the query member. This determines the type of
622 * the structure provided by the driver in data, among struct drm_xe_query_*.
623 *
624 * The @query can be:
625 * - %DRM_XE_DEVICE_QUERY_ENGINES
626 * - %DRM_XE_DEVICE_QUERY_MEM_REGIONS
627 * - %DRM_XE_DEVICE_QUERY_CONFIG
628 * - %DRM_XE_DEVICE_QUERY_GT_LIST
629 * - %DRM_XE_DEVICE_QUERY_HWCONFIG - Query type to retrieve the hardware
630 * configuration of the device such as information on slices, memory,
631 * caches, and so on. It is provided as a table of key / value
632 * attributes.
633 * - %DRM_XE_DEVICE_QUERY_GT_TOPOLOGY
634 * - %DRM_XE_DEVICE_QUERY_ENGINE_CYCLES
635 *
636 * If size is set to 0, the driver fills it with the required size for
637 * the requested type of data to query. If size is equal to the required
638 * size, the queried information is copied into data. If size is set to
639 * a value different from 0 and different from the required size, the
640 * IOCTL call returns -EINVAL.
641 *
642 * For example the following code snippet allows retrieving and printing
643 * information about the device engines with DRM_XE_DEVICE_QUERY_ENGINES:
644 *
645 * .. code-block:: C
646 *
647 * struct drm_xe_query_engines *engines;
648 * struct drm_xe_device_query query = {
649 * .extensions = 0,
650 * .query = DRM_XE_DEVICE_QUERY_ENGINES,
651 * .size = 0,
652 * .data = 0,
653 * };
654 * ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
655 * engines = malloc(query.size);
656 * query.data = (uintptr_t)engines;
657 * ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query);
658 * for (int i = 0; i < engines->num_engines; i++) {
659 * printf("Engine %d: %s\n", i,
660 * engines->engines[i].instance.engine_class ==
661 * DRM_XE_ENGINE_CLASS_RENDER ? "RENDER":
662 * engines->engines[i].instance.engine_class ==
663 * DRM_XE_ENGINE_CLASS_COPY ? "COPY":
664 * engines->engines[i].instance.engine_class ==
665 * DRM_XE_ENGINE_CLASS_VIDEO_DECODE ? "VIDEO_DECODE":
666 * engines->engines[i].instance.engine_class ==
667 * DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE ? "VIDEO_ENHANCE":
668 * engines->engines[i].instance.engine_class ==
669 * DRM_XE_ENGINE_CLASS_COMPUTE ? "COMPUTE":
670 * "UNKNOWN");
671 * }
672 * free(engines);
673 */
674struct drm_xe_device_query {
675 /** @extensions: Pointer to the first extension struct, if any */
676 __u64 extensions;
677
678#define DRM_XE_DEVICE_QUERY_ENGINES 0
679#define DRM_XE_DEVICE_QUERY_MEM_REGIONS 1
680#define DRM_XE_DEVICE_QUERY_CONFIG 2
681#define DRM_XE_DEVICE_QUERY_GT_LIST 3
682#define DRM_XE_DEVICE_QUERY_HWCONFIG 4
683#define DRM_XE_DEVICE_QUERY_GT_TOPOLOGY 5
684#define DRM_XE_DEVICE_QUERY_ENGINE_CYCLES 6
685#define DRM_XE_DEVICE_QUERY_UC_FW_VERSION 7
686 /** @query: The type of data to query */
687 __u32 query;
688
689 /** @size: Size of the queried data */
690 __u32 size;
691
692 /** @data: Queried data is placed here */
693 __u64 data;
694
695 /** @reserved: Reserved */
696 __u64 reserved[2];
697};
698
699/**
700 * struct drm_xe_gem_create - Input of &DRM_IOCTL_XE_GEM_CREATE - A structure for
701 * gem creation
702 *
703 * The @flags can be:
704 * - %DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING
705 * - %DRM_XE_GEM_CREATE_FLAG_SCANOUT
706 * - %DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM - When using VRAM as a
707 * possible placement, ensure that the corresponding VRAM allocation
708 * will always use the CPU accessible part of VRAM. This is important
709 * for small-bar systems (on full-bar systems this gets turned into a
710 * noop).
711 * Note1: System memory can be used as an extra placement if the kernel
712 * should spill the allocation to system memory, if space can't be made
713 * available in the CPU accessible part of VRAM (giving the same
714 * behaviour as the i915 interface, see
715 * I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS).
716 * Note2: For clear-color CCS surfaces the kernel needs to read the
717 * clear-color value stored in the buffer, and on discrete platforms we
718 * need to use VRAM for display surfaces, therefore the kernel requires
719 * setting this flag for such objects, otherwise an error is thrown on
720 * small-bar systems.
721 *
722 * @cpu_caching supports the following values:
723 * - %DRM_XE_GEM_CPU_CACHING_WB - Allocate the pages with write-back
724 * caching. On iGPU this can't be used for scanout surfaces. Currently
725 * not allowed for objects placed in VRAM.
726 * - %DRM_XE_GEM_CPU_CACHING_WC - Allocate the pages as write-combined. This
727 * is uncached. Scanout surfaces should likely use this. All objects
728 * that can be placed in VRAM must use this.
729 */
730struct drm_xe_gem_create {
731 /** @extensions: Pointer to the first extension struct, if any */
732 __u64 extensions;
733
734 /**
735 * @size: Size of the object to be created, must match region
736 * (system or vram) minimum alignment (&min_page_size).
737 */
738 __u64 size;
739
740 /**
741 * @placement: A mask of memory instances of where BO can be placed.
742 * Each index in this mask refers directly to the struct
743 * drm_xe_query_mem_regions' instance, no assumptions should
744 * be made about order. The type of each region is described
745 * by struct drm_xe_query_mem_regions' mem_class.
746 */
747 __u32 placement;
748
749#define DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING (1 << 0)
750#define DRM_XE_GEM_CREATE_FLAG_SCANOUT (1 << 1)
751#define DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM (1 << 2)
752 /**
753 * @flags: Flags, currently a mask of memory instances of where BO can
754 * be placed
755 */
756 __u32 flags;
757
758 /**
759 * @vm_id: Attached VM, if any
760 *
761 * If a VM is specified, this BO must:
762 *
763 * 1. Only ever be bound to that VM.
764 * 2. Cannot be exported as a PRIME fd.
765 */
766 __u32 vm_id;
767
768 /**
769 * @handle: Returned handle for the object.
770 *
771 * Object handles are nonzero.
772 */
773 __u32 handle;
774
775#define DRM_XE_GEM_CPU_CACHING_WB 1
776#define DRM_XE_GEM_CPU_CACHING_WC 2
777 /**
778 * @cpu_caching: The CPU caching mode to select for this object. If
779 * mmaping the object the mode selected here will also be used.
780 */
781 __u16 cpu_caching;
782 /** @pad: MBZ */
783 __u16 pad[3];
784
785 /** @reserved: Reserved */
786 __u64 reserved[2];
787};
788
789/**
790 * struct drm_xe_gem_mmap_offset - Input of &DRM_IOCTL_XE_GEM_MMAP_OFFSET
791 */
792struct drm_xe_gem_mmap_offset {
793 /** @extensions: Pointer to the first extension struct, if any */
794 __u64 extensions;
795
796 /** @handle: Handle for the object being mapped. */
797 __u32 handle;
798
799 /** @flags: Must be zero */
800 __u32 flags;
801
802 /** @offset: The fake offset to use for subsequent mmap call */
803 __u64 offset;
804
805 /** @reserved: Reserved */
806 __u64 reserved[2];
807};
808
809/**
810 * struct drm_xe_vm_create - Input of &DRM_IOCTL_XE_VM_CREATE
811 *
812 * The @flags can be:
813 * - %DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE
814 * - %DRM_XE_VM_CREATE_FLAG_LR_MODE - An LR, or Long Running VM accepts
815 * exec submissions to its exec_queues that don't have an upper time
816 * limit on the job execution time. But exec submissions to these
817 * don't allow any of the flags DRM_XE_SYNC_FLAG_SYNCOBJ,
818 * DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ, DRM_XE_SYNC_FLAG_DMA_BUF,
819 * used as out-syncobjs, that is, together with DRM_XE_SYNC_FLAG_SIGNAL.
820 * LR VMs can be created in recoverable page-fault mode using
821 * DRM_XE_VM_CREATE_FLAG_FAULT_MODE, if the device supports it.
822 * If that flag is omitted, the UMD can not rely on the slightly
823 * different per-VM overcommit semantics that are enabled by
824 * DRM_XE_VM_CREATE_FLAG_FAULT_MODE (see below), but KMD may
825 * still enable recoverable pagefaults if supported by the device.
826 * - %DRM_XE_VM_CREATE_FLAG_FAULT_MODE - Requires also
827 * DRM_XE_VM_CREATE_FLAG_LR_MODE. It allows memory to be allocated on
828 * demand when accessed, and also allows per-VM overcommit of memory.
829 * The xe driver internally uses recoverable pagefaults to implement
830 * this.
831 */
832struct drm_xe_vm_create {
833 /** @extensions: Pointer to the first extension struct, if any */
834 __u64 extensions;
835
836#define DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE (1 << 0)
837#define DRM_XE_VM_CREATE_FLAG_LR_MODE (1 << 1)
838#define DRM_XE_VM_CREATE_FLAG_FAULT_MODE (1 << 2)
839 /** @flags: Flags */
840 __u32 flags;
841
842 /** @vm_id: Returned VM ID */
843 __u32 vm_id;
844
845 /** @reserved: Reserved */
846 __u64 reserved[2];
847};
848
849/**
850 * struct drm_xe_vm_destroy - Input of &DRM_IOCTL_XE_VM_DESTROY
851 */
852struct drm_xe_vm_destroy {
853 /** @vm_id: VM ID */
854 __u32 vm_id;
855
856 /** @pad: MBZ */
857 __u32 pad;
858
859 /** @reserved: Reserved */
860 __u64 reserved[2];
861};
862
863/**
864 * struct drm_xe_vm_bind_op - run bind operations
865 *
866 * The @op can be:
867 * - %DRM_XE_VM_BIND_OP_MAP
868 * - %DRM_XE_VM_BIND_OP_UNMAP
869 * - %DRM_XE_VM_BIND_OP_MAP_USERPTR
870 * - %DRM_XE_VM_BIND_OP_UNMAP_ALL
871 * - %DRM_XE_VM_BIND_OP_PREFETCH
872 *
873 * and the @flags can be:
874 * - %DRM_XE_VM_BIND_FLAG_READONLY - Setup the page tables as read-only
875 * to ensure write protection
876 * - %DRM_XE_VM_BIND_FLAG_IMMEDIATE - On a faulting VM, do the
877 * MAP operation immediately rather than deferring the MAP to the page
878 * fault handler. This is implied on a non-faulting VM as there is no
879 * fault handler to defer to.
880 * - %DRM_XE_VM_BIND_FLAG_NULL - When the NULL flag is set, the page
881 * tables are setup with a special bit which indicates writes are
882 * dropped and all reads return zero. In the future, the NULL flags
883 * will only be valid for DRM_XE_VM_BIND_OP_MAP operations, the BO
884 * handle MBZ, and the BO offset MBZ. This flag is intended to
885 * implement VK sparse bindings.
886 */
887struct drm_xe_vm_bind_op {
888 /** @extensions: Pointer to the first extension struct, if any */
889 __u64 extensions;
890
891 /**
892 * @obj: GEM object to operate on, MBZ for MAP_USERPTR, MBZ for UNMAP
893 */
894 __u32 obj;
895
896 /**
897 * @pat_index: The platform defined @pat_index to use for this mapping.
898 * The index basically maps to some predefined memory attributes,
899 * including things like caching, coherency, compression etc. The exact
900 * meaning of the pat_index is platform specific and defined in the
901 * Bspec and PRMs. When the KMD sets up the binding the index here is
902 * encoded into the ppGTT PTE.
903 *
904 * For coherency the @pat_index needs to be at least 1way coherent when
905 * drm_xe_gem_create.cpu_caching is DRM_XE_GEM_CPU_CACHING_WB. The KMD
906 * will extract the coherency mode from the @pat_index and reject if
907 * there is a mismatch (see note below for pre-MTL platforms).
908 *
909 * Note: On pre-MTL platforms there is only a caching mode and no
910 * explicit coherency mode, but on such hardware there is always a
911 * shared-LLC (or is dgpu) so all GT memory accesses are coherent with
912 * CPU caches even with the caching mode set as uncached. It's only the
913 * display engine that is incoherent (on dgpu it must be in VRAM which
914 * is always mapped as WC on the CPU). However to keep the uapi somewhat
915 * consistent with newer platforms the KMD groups the different cache
916 * levels into the following coherency buckets on all pre-MTL platforms:
917 *
918 * ppGTT UC -> COH_NONE
919 * ppGTT WC -> COH_NONE
920 * ppGTT WT -> COH_NONE
921 * ppGTT WB -> COH_AT_LEAST_1WAY
922 *
923 * In practice UC/WC/WT should only ever used for scanout surfaces on
924 * such platforms (or perhaps in general for dma-buf if shared with
925 * another device) since it is only the display engine that is actually
926 * incoherent. Everything else should typically use WB given that we
927 * have a shared-LLC. On MTL+ this completely changes and the HW
928 * defines the coherency mode as part of the @pat_index, where
929 * incoherent GT access is possible.
930 *
931 * Note: For userptr and externally imported dma-buf the kernel expects
932 * either 1WAY or 2WAY for the @pat_index.
933 *
934 * For DRM_XE_VM_BIND_FLAG_NULL bindings there are no KMD restrictions
935 * on the @pat_index. For such mappings there is no actual memory being
936 * mapped (the address in the PTE is invalid), so the various PAT memory
937 * attributes likely do not apply. Simply leaving as zero is one
938 * option (still a valid pat_index).
939 */
940 __u16 pat_index;
941
942 /** @pad: MBZ */
943 __u16 pad;
944
945 union {
946 /**
947 * @obj_offset: Offset into the object, MBZ for CLEAR_RANGE,
948 * ignored for unbind
949 */
950 __u64 obj_offset;
951
952 /** @userptr: user pointer to bind on */
953 __u64 userptr;
954 };
955
956 /**
957 * @range: Number of bytes from the object to bind to addr, MBZ for UNMAP_ALL
958 */
959 __u64 range;
960
961 /** @addr: Address to operate on, MBZ for UNMAP_ALL */
962 __u64 addr;
963
964#define DRM_XE_VM_BIND_OP_MAP 0x0
965#define DRM_XE_VM_BIND_OP_UNMAP 0x1
966#define DRM_XE_VM_BIND_OP_MAP_USERPTR 0x2
967#define DRM_XE_VM_BIND_OP_UNMAP_ALL 0x3
968#define DRM_XE_VM_BIND_OP_PREFETCH 0x4
969 /** @op: Bind operation to perform */
970 __u32 op;
971
972#define DRM_XE_VM_BIND_FLAG_READONLY (1 << 0)
973#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)
974#define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)
975#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3)
976 /** @flags: Bind flags */
977 __u32 flags;
978
979 /**
980 * @prefetch_mem_region_instance: Memory region to prefetch VMA to.
981 * It is a region instance, not a mask.
982 * To be used only with %DRM_XE_VM_BIND_OP_PREFETCH operation.
983 */
984 __u32 prefetch_mem_region_instance;
985
986 /** @pad2: MBZ */
987 __u32 pad2;
988
989 /** @reserved: Reserved */
990 __u64 reserved[3];
991};
992
993/**
994 * struct drm_xe_vm_bind - Input of &DRM_IOCTL_XE_VM_BIND
995 *
996 * Below is an example of a minimal use of @drm_xe_vm_bind to
997 * asynchronously bind the buffer `data` at address `BIND_ADDRESS` to
998 * illustrate `userptr`. It can be synchronized by using the example
999 * provided for @drm_xe_sync.
1000 *
1001 * .. code-block:: C
1002 *
1003 * data = aligned_alloc(ALIGNMENT, BO_SIZE);
1004 * struct drm_xe_vm_bind bind = {
1005 * .vm_id = vm,
1006 * .num_binds = 1,
1007 * .bind.obj = 0,
1008 * .bind.obj_offset = to_user_pointer(data),
1009 * .bind.range = BO_SIZE,
1010 * .bind.addr = BIND_ADDRESS,
1011 * .bind.op = DRM_XE_VM_BIND_OP_MAP_USERPTR,
1012 * .bind.flags = 0,
1013 * .num_syncs = 1,
1014 * .syncs = &sync,
1015 * .exec_queue_id = 0,
1016 * };
1017 * ioctl(fd, DRM_IOCTL_XE_VM_BIND, &bind);
1018 *
1019 */
1020struct drm_xe_vm_bind {
1021 /** @extensions: Pointer to the first extension struct, if any */
1022 __u64 extensions;
1023
1024 /** @vm_id: The ID of the VM to bind to */
1025 __u32 vm_id;
1026
1027 /**
1028 * @exec_queue_id: exec_queue_id, must be of class DRM_XE_ENGINE_CLASS_VM_BIND
1029 * and exec queue must have same vm_id. If zero, the default VM bind engine
1030 * is used.
1031 */
1032 __u32 exec_queue_id;
1033
1034 /** @pad: MBZ */
1035 __u32 pad;
1036
1037 /** @num_binds: number of binds in this IOCTL */
1038 __u32 num_binds;
1039
1040 union {
1041 /** @bind: used if num_binds == 1 */
1042 struct drm_xe_vm_bind_op bind;
1043
1044 /**
1045 * @vector_of_binds: userptr to array of struct
1046 * drm_xe_vm_bind_op if num_binds > 1
1047 */
1048 __u64 vector_of_binds;
1049 };
1050
1051 /** @pad2: MBZ */
1052 __u32 pad2;
1053
1054 /** @num_syncs: amount of syncs to wait on */
1055 __u32 num_syncs;
1056
1057 /** @syncs: pointer to struct drm_xe_sync array */
1058 __u64 syncs;
1059
1060 /** @reserved: Reserved */
1061 __u64 reserved[2];
1062};
1063
1064/**
1065 * struct drm_xe_exec_queue_create - Input of &DRM_IOCTL_XE_EXEC_QUEUE_CREATE
1066 *
1067 * The example below shows how to use @drm_xe_exec_queue_create to create
1068 * a simple exec_queue (no parallel submission) of class
1069 * &DRM_XE_ENGINE_CLASS_RENDER.
1070 *
1071 * .. code-block:: C
1072 *
1073 * struct drm_xe_engine_class_instance instance = {
1074 * .engine_class = DRM_XE_ENGINE_CLASS_RENDER,
1075 * };
1076 * struct drm_xe_exec_queue_create exec_queue_create = {
1077 * .extensions = 0,
1078 * .vm_id = vm,
1079 * .num_bb_per_exec = 1,
1080 * .num_eng_per_bb = 1,
1081 * .instances = to_user_pointer(&instance),
1082 * };
1083 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);
1084 *
1085 */
1086struct drm_xe_exec_queue_create {
1087#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
1088#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY 0
1089#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE 1
1090
1091 /** @extensions: Pointer to the first extension struct, if any */
1092 __u64 extensions;
1093
1094 /** @width: submission width (number BB per exec) for this exec queue */
1095 __u16 width;
1096
1097 /** @num_placements: number of valid placements for this exec queue */
1098 __u16 num_placements;
1099
1100 /** @vm_id: VM to use for this exec queue */
1101 __u32 vm_id;
1102
1103 /** @flags: MBZ */
1104 __u32 flags;
1105
1106 /** @exec_queue_id: Returned exec queue ID */
1107 __u32 exec_queue_id;
1108
1109 /**
1110 * @instances: user pointer to a 2-d array of struct
1111 * drm_xe_engine_class_instance
1112 *
1113 * length = width (i) * num_placements (j)
1114 * index = j + i * width
1115 */
1116 __u64 instances;
1117
1118 /** @reserved: Reserved */
1119 __u64 reserved[2];
1120};
1121
1122/**
1123 * struct drm_xe_exec_queue_destroy - Input of &DRM_IOCTL_XE_EXEC_QUEUE_DESTROY
1124 */
1125struct drm_xe_exec_queue_destroy {
1126 /** @exec_queue_id: Exec queue ID */
1127 __u32 exec_queue_id;
1128
1129 /** @pad: MBZ */
1130 __u32 pad;
1131
1132 /** @reserved: Reserved */
1133 __u64 reserved[2];
1134};
1135
1136/**
1137 * struct drm_xe_exec_queue_get_property - Input of &DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY
1138 *
1139 * The @property can be:
1140 * - %DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN
1141 */
1142struct drm_xe_exec_queue_get_property {
1143 /** @extensions: Pointer to the first extension struct, if any */
1144 __u64 extensions;
1145
1146 /** @exec_queue_id: Exec queue ID */
1147 __u32 exec_queue_id;
1148
1149#define DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN 0
1150 /** @property: property to get */
1151 __u32 property;
1152
1153 /** @value: property value */
1154 __u64 value;
1155
1156 /** @reserved: Reserved */
1157 __u64 reserved[2];
1158};
1159
1160/**
1161 * struct drm_xe_sync - sync object
1162 *
1163 * The @type can be:
1164 * - %DRM_XE_SYNC_TYPE_SYNCOBJ
1165 * - %DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ
1166 * - %DRM_XE_SYNC_TYPE_USER_FENCE
1167 *
1168 * and the @flags can be:
1169 * - %DRM_XE_SYNC_FLAG_SIGNAL
1170 *
1171 * A minimal use of @drm_xe_sync looks like this:
1172 *
1173 * .. code-block:: C
1174 *
1175 * struct drm_xe_sync sync = {
1176 * .flags = DRM_XE_SYNC_FLAG_SIGNAL,
1177 * .type = DRM_XE_SYNC_TYPE_SYNCOBJ,
1178 * };
1179 * struct drm_syncobj_create syncobj_create = { 0 };
1180 * ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &syncobj_create);
1181 * sync.handle = syncobj_create.handle;
1182 * ...
1183 * use of &sync in drm_xe_exec or drm_xe_vm_bind
1184 * ...
1185 * struct drm_syncobj_wait wait = {
1186 * .handles = &sync.handle,
1187 * .timeout_nsec = INT64_MAX,
1188 * .count_handles = 1,
1189 * .flags = 0,
1190 * .first_signaled = 0,
1191 * .pad = 0,
1192 * };
1193 * ioctl(fd, DRM_IOCTL_SYNCOBJ_WAIT, &wait);
1194 */
1195struct drm_xe_sync {
1196 /** @extensions: Pointer to the first extension struct, if any */
1197 __u64 extensions;
1198
1199#define DRM_XE_SYNC_TYPE_SYNCOBJ 0x0
1200#define DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ 0x1
1201#define DRM_XE_SYNC_TYPE_USER_FENCE 0x2
1202 /** @type: Type of the this sync object */
1203 __u32 type;
1204
1205#define DRM_XE_SYNC_FLAG_SIGNAL (1 << 0)
1206 /** @flags: Sync Flags */
1207 __u32 flags;
1208
1209 union {
1210 /** @handle: Handle for the object */
1211 __u32 handle;
1212
1213 /**
1214 * @addr: Address of user fence. When sync is passed in via exec
1215 * IOCTL this is a GPU address in the VM. When sync passed in via
1216 * VM bind IOCTL this is a user pointer. In either case, it is
1217 * the users responsibility that this address is present and
1218 * mapped when the user fence is signalled. Must be qword
1219 * aligned.
1220 */
1221 __u64 addr;
1222 };
1223
1224 /**
1225 * @timeline_value: Input for the timeline sync object. Needs to be
1226 * different than 0 when used with %DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ.
1227 */
1228 __u64 timeline_value;
1229
1230 /** @reserved: Reserved */
1231 __u64 reserved[2];
1232};
1233
1234/**
1235 * struct drm_xe_exec - Input of &DRM_IOCTL_XE_EXEC
1236 *
1237 * This is an example to use @drm_xe_exec for execution of the object
1238 * at BIND_ADDRESS (see example in @drm_xe_vm_bind) by an exec_queue
1239 * (see example in @drm_xe_exec_queue_create). It can be synchronized
1240 * by using the example provided for @drm_xe_sync.
1241 *
1242 * .. code-block:: C
1243 *
1244 * struct drm_xe_exec exec = {
1245 * .exec_queue_id = exec_queue,
1246 * .syncs = &sync,
1247 * .num_syncs = 1,
1248 * .address = BIND_ADDRESS,
1249 * .num_batch_buffer = 1,
1250 * };
1251 * ioctl(fd, DRM_IOCTL_XE_EXEC, &exec);
1252 *
1253 */
1254struct drm_xe_exec {
1255 /** @extensions: Pointer to the first extension struct, if any */
1256 __u64 extensions;
1257
1258 /** @exec_queue_id: Exec queue ID for the batch buffer */
1259 __u32 exec_queue_id;
1260
1261 /** @num_syncs: Amount of struct drm_xe_sync in array. */
1262 __u32 num_syncs;
1263
1264 /** @syncs: Pointer to struct drm_xe_sync array. */
1265 __u64 syncs;
1266
1267 /**
1268 * @address: address of batch buffer if num_batch_buffer == 1 or an
1269 * array of batch buffer addresses
1270 */
1271 __u64 address;
1272
1273 /**
1274 * @num_batch_buffer: number of batch buffer in this exec, must match
1275 * the width of the engine
1276 */
1277 __u16 num_batch_buffer;
1278
1279 /** @pad: MBZ */
1280 __u16 pad[3];
1281
1282 /** @reserved: Reserved */
1283 __u64 reserved[2];
1284};
1285
1286/**
1287 * struct drm_xe_wait_user_fence - Input of &DRM_IOCTL_XE_WAIT_USER_FENCE
1288 *
1289 * Wait on user fence, XE will wake-up on every HW engine interrupt in the
1290 * instances list and check if user fence is complete::
1291 *
1292 * (*addr & MASK) OP (VALUE & MASK)
1293 *
1294 * Returns to user on user fence completion or timeout.
1295 *
1296 * The @op can be:
1297 * - %DRM_XE_UFENCE_WAIT_OP_EQ
1298 * - %DRM_XE_UFENCE_WAIT_OP_NEQ
1299 * - %DRM_XE_UFENCE_WAIT_OP_GT
1300 * - %DRM_XE_UFENCE_WAIT_OP_GTE
1301 * - %DRM_XE_UFENCE_WAIT_OP_LT
1302 * - %DRM_XE_UFENCE_WAIT_OP_LTE
1303 *
1304 * and the @flags can be:
1305 * - %DRM_XE_UFENCE_WAIT_FLAG_ABSTIME
1306 * - %DRM_XE_UFENCE_WAIT_FLAG_SOFT_OP
1307 *
1308 * The @mask values can be for example:
1309 * - 0xffu for u8
1310 * - 0xffffu for u16
1311 * - 0xffffffffu for u32
1312 * - 0xffffffffffffffffu for u64
1313 */
1314struct drm_xe_wait_user_fence {
1315 /** @extensions: Pointer to the first extension struct, if any */
1316 __u64 extensions;
1317
1318 /**
1319 * @addr: user pointer address to wait on, must qword aligned
1320 */
1321 __u64 addr;
1322
1323#define DRM_XE_UFENCE_WAIT_OP_EQ 0x0
1324#define DRM_XE_UFENCE_WAIT_OP_NEQ 0x1
1325#define DRM_XE_UFENCE_WAIT_OP_GT 0x2
1326#define DRM_XE_UFENCE_WAIT_OP_GTE 0x3
1327#define DRM_XE_UFENCE_WAIT_OP_LT 0x4
1328#define DRM_XE_UFENCE_WAIT_OP_LTE 0x5
1329 /** @op: wait operation (type of comparison) */
1330 __u16 op;
1331
1332#define DRM_XE_UFENCE_WAIT_FLAG_ABSTIME (1 << 0)
1333 /** @flags: wait flags */
1334 __u16 flags;
1335
1336 /** @pad: MBZ */
1337 __u32 pad;
1338
1339 /** @value: compare value */
1340 __u64 value;
1341
1342 /** @mask: comparison mask */
1343 __u64 mask;
1344
1345 /**
1346 * @timeout: how long to wait before bailing, value in nanoseconds.
1347 * Without DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flag set (relative timeout)
1348 * it contains timeout expressed in nanoseconds to wait (fence will
1349 * expire at now() + timeout).
1350 * When DRM_XE_UFENCE_WAIT_FLAG_ABSTIME flat is set (absolute timeout) wait
1351 * will end at timeout (uses system MONOTONIC_CLOCK).
1352 * Passing negative timeout leads to neverending wait.
1353 *
1354 * On relative timeout this value is updated with timeout left
1355 * (for restarting the call in case of signal delivery).
1356 * On absolute timeout this value stays intact (restarted call still
1357 * expire at the same point of time).
1358 */
1359 __s64 timeout;
1360
1361 /** @exec_queue_id: exec_queue_id returned from xe_exec_queue_create_ioctl */
1362 __u32 exec_queue_id;
1363
1364 /** @pad2: MBZ */
1365 __u32 pad2;
1366
1367 /** @reserved: Reserved */
1368 __u64 reserved[2];
1369};
1370
1371#if defined(__cplusplus)
1372}
1373#endif
1374
1375#endif /* _XE_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/affs_hardblocks.h+34-34
......@@ -7,42 +7,42 @@
77/* Just the needed definitions for the RDB of an Amiga HD. */
88
99struct RigidDiskBlock {
10 __u32 rdb_ID;
10 __be32 rdb_ID;
1111 __be32 rdb_SummedLongs;
12 __s32 rdb_ChkSum;
13 __u32 rdb_HostID;
12 __be32 rdb_ChkSum;
13 __be32 rdb_HostID;
1414 __be32 rdb_BlockBytes;
15 __u32 rdb_Flags;
16 __u32 rdb_BadBlockList;
15 __be32 rdb_Flags;
16 __be32 rdb_BadBlockList;
1717 __be32 rdb_PartitionList;
18 __u32 rdb_FileSysHeaderList;
19 __u32 rdb_DriveInit;
20 __u32 rdb_Reserved1[6];
21 __u32 rdb_Cylinders;
22 __u32 rdb_Sectors;
23 __u32 rdb_Heads;
24 __u32 rdb_Interleave;
25 __u32 rdb_Park;
26 __u32 rdb_Reserved2[3];
27 __u32 rdb_WritePreComp;
28 __u32 rdb_ReducedWrite;
29 __u32 rdb_StepRate;
30 __u32 rdb_Reserved3[5];
31 __u32 rdb_RDBBlocksLo;
32 __u32 rdb_RDBBlocksHi;
33 __u32 rdb_LoCylinder;
34 __u32 rdb_HiCylinder;
35 __u32 rdb_CylBlocks;
36 __u32 rdb_AutoParkSeconds;
37 __u32 rdb_HighRDSKBlock;
38 __u32 rdb_Reserved4;
18 __be32 rdb_FileSysHeaderList;
19 __be32 rdb_DriveInit;
20 __be32 rdb_Reserved1[6];
21 __be32 rdb_Cylinders;
22 __be32 rdb_Sectors;
23 __be32 rdb_Heads;
24 __be32 rdb_Interleave;
25 __be32 rdb_Park;
26 __be32 rdb_Reserved2[3];
27 __be32 rdb_WritePreComp;
28 __be32 rdb_ReducedWrite;
29 __be32 rdb_StepRate;
30 __be32 rdb_Reserved3[5];
31 __be32 rdb_RDBBlocksLo;
32 __be32 rdb_RDBBlocksHi;
33 __be32 rdb_LoCylinder;
34 __be32 rdb_HiCylinder;
35 __be32 rdb_CylBlocks;
36 __be32 rdb_AutoParkSeconds;
37 __be32 rdb_HighRDSKBlock;
38 __be32 rdb_Reserved4;
3939 char rdb_DiskVendor[8];
4040 char rdb_DiskProduct[16];
4141 char rdb_DiskRevision[4];
4242 char rdb_ControllerVendor[8];
4343 char rdb_ControllerProduct[16];
4444 char rdb_ControllerRevision[4];
45 __u32 rdb_Reserved5[10];
45 __be32 rdb_Reserved5[10];
4646};
4747
4848#define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */
......@@ -50,16 +50,16 @@ struct RigidDiskBlock {
5050struct PartitionBlock {
5151 __be32 pb_ID;
5252 __be32 pb_SummedLongs;
53 __s32 pb_ChkSum;
54 __u32 pb_HostID;
53 __be32 pb_ChkSum;
54 __be32 pb_HostID;
5555 __be32 pb_Next;
56 __u32 pb_Flags;
57 __u32 pb_Reserved1[2];
58 __u32 pb_DevFlags;
56 __be32 pb_Flags;
57 __be32 pb_Reserved1[2];
58 __be32 pb_DevFlags;
5959 __u8 pb_DriveName[32];
60 __u32 pb_Reserved2[15];
60 __be32 pb_Reserved2[15];
6161 __be32 pb_Environment[17];
62 __u32 pb_EReserved[15];
62 __be32 pb_EReserved[15];
6363};
6464
6565#define IDNAME_PARTITION 0x50415254 /* "PART" */
lib/libc/include/any-linux-any/linux/android/binder.h+16-14
......@@ -251,20 +251,22 @@ struct binder_extended_error {
251251 __s32 param;
252252};
253253
254#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
255#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
256#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
257#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
258#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
259#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
260#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
261#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
262#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
263#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
264#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
265#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
266#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
267#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error)
254enum {
255 BINDER_WRITE_READ = _IOWR('b', 1, struct binder_write_read),
256 BINDER_SET_IDLE_TIMEOUT = _IOW('b', 3, __s64),
257 BINDER_SET_MAX_THREADS = _IOW('b', 5, __u32),
258 BINDER_SET_IDLE_PRIORITY = _IOW('b', 6, __s32),
259 BINDER_SET_CONTEXT_MGR = _IOW('b', 7, __s32),
260 BINDER_THREAD_EXIT = _IOW('b', 8, __s32),
261 BINDER_VERSION = _IOWR('b', 9, struct binder_version),
262 BINDER_GET_NODE_DEBUG_INFO = _IOWR('b', 11, struct binder_node_debug_info),
263 BINDER_GET_NODE_INFO_FOR_REF = _IOWR('b', 12, struct binder_node_info_for_ref),
264 BINDER_SET_CONTEXT_MGR_EXT = _IOW('b', 13, struct flat_binder_object),
265 BINDER_FREEZE = _IOW('b', 14, struct binder_freeze_info),
266 BINDER_GET_FROZEN_INFO = _IOWR('b', 15, struct binder_frozen_status_info),
267 BINDER_ENABLE_ONEWAY_SPAM_DETECTION = _IOW('b', 16, __u32),
268 BINDER_GET_EXTENDED_ERROR = _IOWR('b', 17, struct binder_extended_error),
269};
268270
269271/*
270272 * NOTE: Two special error codes you should check for when calling
lib/libc/include/any-linux-any/linux/atmdev.h-4
......@@ -101,10 +101,6 @@ struct atm_dev_stats {
101101 /* use backend to make new if */
102102#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
103103 /* add party to p2mp call */
104#ifdef CONFIG_COMPAT
105/* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */
106#define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf)
107#endif
108104#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
109105 /* drop party from p2mp call */
110106
lib/libc/include/any-linux-any/linux/auto_dev-ioctl.h+1-1
......@@ -109,7 +109,7 @@ struct autofs_dev_ioctl {
109109 struct args_ismountpoint ismountpoint;
110110 };
111111
112 char path[0];
112 char path[];
113113};
114114
115115static __inline__ void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
lib/libc/include/any-linux-any/linux/auxvec.h+2
......@@ -32,6 +32,8 @@
3232#define AT_HWCAP2 26 /* extension of AT_HWCAP */
3333#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size */
3434#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment */
35#define AT_HWCAP3 29 /* extension of AT_HWCAP */
36#define AT_HWCAP4 30 /* extension of AT_HWCAP */
3537
3638#define AT_EXECFN 31 /* filename of program */
3739
lib/libc/include/any-linux-any/linux/batadv_packet.h+39-6
......@@ -116,6 +116,9 @@ enum batadv_icmp_packettype {
116116 * only need routable IPv4 multicast packets we signed up for explicitly
117117 * @BATADV_MCAST_WANT_NO_RTR6: we have no IPv6 multicast router and therefore
118118 * only need routable IPv6 multicast packets we signed up for explicitly
119 * @BATADV_MCAST_HAVE_MC_PTYPE_CAPA: we can parse, receive and forward
120 * batman-adv multicast packets with a multicast tracker TVLV. And all our
121 * hard interfaces have an MTU of at least 1280 bytes.
119122 */
120123enum batadv_mcast_flags {
121124 BATADV_MCAST_WANT_ALL_UNSNOOPABLES = 1UL << 0,
......@@ -123,6 +126,7 @@ enum batadv_mcast_flags {
123126 BATADV_MCAST_WANT_ALL_IPV6 = 1UL << 2,
124127 BATADV_MCAST_WANT_NO_RTR4 = 1UL << 3,
125128 BATADV_MCAST_WANT_NO_RTR6 = 1UL << 4,
129 BATADV_MCAST_HAVE_MC_PTYPE_CAPA = 1UL << 5,
126130};
127131
128132/* tt data subtypes */
......@@ -174,14 +178,16 @@ enum batadv_bla_claimframe {
174178 * @BATADV_TVLV_TT: translation table tvlv
175179 * @BATADV_TVLV_ROAM: roaming advertisement tvlv
176180 * @BATADV_TVLV_MCAST: multicast capability tvlv
181 * @BATADV_TVLV_MCAST_TRACKER: multicast tracker tvlv
177182 */
178183enum batadv_tvlv_type {
179 BATADV_TVLV_GW = 0x01,
180 BATADV_TVLV_DAT = 0x02,
181 BATADV_TVLV_NC = 0x03,
182 BATADV_TVLV_TT = 0x04,
183 BATADV_TVLV_ROAM = 0x05,
184 BATADV_TVLV_MCAST = 0x06,
184 BATADV_TVLV_GW = 0x01,
185 BATADV_TVLV_DAT = 0x02,
186 BATADV_TVLV_NC = 0x03,
187 BATADV_TVLV_TT = 0x04,
188 BATADV_TVLV_ROAM = 0x05,
189 BATADV_TVLV_MCAST = 0x06,
190 BATADV_TVLV_MCAST_TRACKER = 0x07,
185191};
186192
187193#pragma pack(2)
......@@ -487,6 +493,25 @@ struct batadv_bcast_packet {
487493 */
488494};
489495
496/**
497 * struct batadv_mcast_packet - multicast packet for network payload
498 * @packet_type: batman-adv packet type, part of the general header
499 * @version: batman-adv protocol version, part of the general header
500 * @ttl: time to live for this packet, part of the general header
501 * @reserved: reserved byte for alignment
502 * @tvlv_len: length of the appended tvlv buffer (in bytes)
503 */
504struct batadv_mcast_packet {
505 __u8 packet_type;
506 __u8 version;
507 __u8 ttl;
508 __u8 reserved;
509 __be16 tvlv_len;
510 /* "4 bytes boundary + 2 bytes" long to make the payload after the
511 * following ethernet header again 4 bytes boundary aligned
512 */
513};
514
490515/**
491516 * struct batadv_coded_packet - network coded packet
492517 * @packet_type: batman-adv packet type, part of the general header
......@@ -628,6 +653,14 @@ struct batadv_tvlv_mcast_data {
628653 __u8 reserved[3];
629654};
630655
656/**
657 * struct batadv_tvlv_mcast_tracker - payload of a multicast tracker tvlv
658 * @num_dests: number of subsequent destination originator MAC addresses
659 */
660struct batadv_tvlv_mcast_tracker {
661 __be16 num_dests;
662};
663
631664#pragma pack()
632665
633666#endif /* _LINUX_BATADV_PACKET_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bits.h created+15
......@@ -0,0 +1,15 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* bits.h: Macros for dealing with bitmasks. */
3
4#ifndef _LINUX_BITS_H
5#define _LINUX_BITS_H
6
7#define __GENMASK(h, l) \
8 (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
9 (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
10
11#define __GENMASK_ULL(h, l) \
12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
14
15#endif /* _LINUX_BITS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blkzoned.h+5-5
......@@ -51,13 +51,13 @@ enum blk_zone_type {
5151 *
5252 * The Zone Condition state machine in the ZBC/ZAC standards maps the above
5353 * deinitions as:
54 * - ZC1: Empty | BLK_ZONE_EMPTY
54 * - ZC1: Empty | BLK_ZONE_COND_EMPTY
5555 * - ZC2: Implicit Open | BLK_ZONE_COND_IMP_OPEN
5656 * - ZC3: Explicit Open | BLK_ZONE_COND_EXP_OPEN
57 * - ZC4: Closed | BLK_ZONE_CLOSED
58 * - ZC5: Full | BLK_ZONE_FULL
59 * - ZC6: Read Only | BLK_ZONE_READONLY
60 * - ZC7: Offline | BLK_ZONE_OFFLINE
57 * - ZC4: Closed | BLK_ZONE_COND_CLOSED
58 * - ZC5: Full | BLK_ZONE_COND_FULL
59 * - ZC6: Read Only | BLK_ZONE_COND_READONLY
60 * - ZC7: Offline | BLK_ZONE_COND_OFFLINE
6161 *
6262 * Conditions 0x5 to 0xC are reserved by the current ZBC/ZAC spec and should
6363 * be considered invalid.
lib/libc/include/any-linux-any/linux/bpf.h+487-65
......@@ -19,6 +19,7 @@
1919
2020/* ld/ldx fields */
2121#define BPF_DW 0x18 /* double word (64-bit) */
22#define BPF_MEMSX 0x80 /* load with sign extension */
2223#define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */
2324#define BPF_XADD 0xc0 /* exclusive add - legacy name */
2425
......@@ -41,6 +42,7 @@
4142#define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */
4243#define BPF_JSLT 0xc0 /* SLT is signed, '<' */
4344#define BPF_JSLE 0xd0 /* SLE is signed, '<=' */
45#define BPF_JCOND 0xe0 /* conditional pseudo jumps: may_goto, goto_or_nop */
4446#define BPF_CALL 0x80 /* function call */
4547#define BPF_EXIT 0x90 /* function return */
4648
......@@ -49,6 +51,10 @@
4951#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
5052#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
5153
54enum bpf_cond_pseudo_jmp {
55 BPF_MAY_GOTO = 0,
56};
57
5258/* Register numbers */
5359enum {
5460 BPF_REG_0 = 0,
......@@ -76,12 +82,29 @@ struct bpf_insn {
7682 __s32 imm; /* signed immediate constant */
7783};
7884
79/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
85/* Deprecated: use struct bpf_lpm_trie_key_u8 (when the "data" member is needed for
86 * byte access) or struct bpf_lpm_trie_key_hdr (when using an alternative type for
87 * the trailing flexible array member) instead.
88 */
8089struct bpf_lpm_trie_key {
8190 __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
8291 __u8 data[0]; /* Arbitrary size */
8392};
8493
94/* Header for bpf_lpm_trie_key structs */
95struct bpf_lpm_trie_key_hdr {
96 __u32 prefixlen;
97};
98
99/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry, with trailing byte array. */
100struct bpf_lpm_trie_key_u8 {
101 union {
102 struct bpf_lpm_trie_key_hdr hdr;
103 __u32 prefixlen;
104 };
105 __u8 data[]; /* Arbitrary size */
106};
107
85108struct bpf_cgroup_storage_key {
86109 __u64 cgroup_inode_id; /* cgroup inode id */
87110 __u32 attach_type; /* program attach type (enum bpf_attach_type) */
......@@ -616,7 +639,11 @@ union bpf_iter_link_info {
616639 * to NULL to begin the batched operation. After each subsequent
617640 * **BPF_MAP_LOOKUP_BATCH**, the caller should pass the resultant
618641 * *out_batch* as the *in_batch* for the next operation to
619 * continue iteration from the current point.
642 * continue iteration from the current point. Both *in_batch* and
643 * *out_batch* must point to memory large enough to hold a key,
644 * except for maps of type **BPF_MAP_TYPE_{HASH, PERCPU_HASH,
645 * LRU_HASH, LRU_PERCPU_HASH}**, for which batch parameters
646 * must be at least 4 bytes wide regardless of key size.
620647 *
621648 * The *keys* and *values* are output parameters which must point
622649 * to memory large enough to hold *count* items based on the key
......@@ -846,6 +873,36 @@ union bpf_iter_link_info {
846873 * Returns zero on success. On error, -1 is returned and *errno*
847874 * is set appropriately.
848875 *
876 * BPF_TOKEN_CREATE
877 * Description
878 * Create BPF token with embedded information about what
879 * BPF-related functionality it allows:
880 * - a set of allowed bpf() syscall commands;
881 * - a set of allowed BPF map types to be created with
882 * BPF_MAP_CREATE command, if BPF_MAP_CREATE itself is allowed;
883 * - a set of allowed BPF program types and BPF program attach
884 * types to be loaded with BPF_PROG_LOAD command, if
885 * BPF_PROG_LOAD itself is allowed.
886 *
887 * BPF token is created (derived) from an instance of BPF FS,
888 * assuming it has necessary delegation mount options specified.
889 * This BPF token can be passed as an extra parameter to various
890 * bpf() syscall commands to grant BPF subsystem functionality to
891 * unprivileged processes.
892 *
893 * When created, BPF token is "associated" with the owning
894 * user namespace of BPF FS instance (super block) that it was
895 * derived from, and subsequent BPF operations performed with
896 * BPF token would be performing capabilities checks (i.e.,
897 * CAP_BPF, CAP_PERFMON, CAP_NET_ADMIN, CAP_SYS_ADMIN) within
898 * that user namespace. Without BPF token, such capabilities
899 * have to be granted in init user namespace, making bpf()
900 * syscall incompatible with user namespace, for the most part.
901 *
902 * Return
903 * A new file descriptor (a nonnegative integer), or -1 if an
904 * error occurred (in which case, *errno* is set appropriately).
905 *
849906 * NOTES
850907 * eBPF objects (maps and programs) can be shared between processes.
851908 *
......@@ -900,6 +957,8 @@ enum bpf_cmd {
900957 BPF_ITER_CREATE,
901958 BPF_LINK_DETACH,
902959 BPF_PROG_BIND_MAP,
960 BPF_TOKEN_CREATE,
961 __MAX_BPF_CMD,
903962};
904963
905964enum bpf_map_type {
......@@ -931,7 +990,14 @@ enum bpf_map_type {
931990 */
932991 BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED,
933992 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
934 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
993 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED,
994 /* BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE is available to bpf programs
995 * attaching to a cgroup. The new mechanism (BPF_MAP_TYPE_CGRP_STORAGE +
996 * local percpu kptr) supports all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE
997 * functionality and more. So mark * BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE
998 * deprecated.
999 */
1000 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE_DEPRECATED,
9351001 BPF_MAP_TYPE_QUEUE,
9361002 BPF_MAP_TYPE_STACK,
9371003 BPF_MAP_TYPE_SK_STORAGE,
......@@ -943,6 +1009,8 @@ enum bpf_map_type {
9431009 BPF_MAP_TYPE_BLOOM_FILTER,
9441010 BPF_MAP_TYPE_USER_RINGBUF,
9451011 BPF_MAP_TYPE_CGRP_STORAGE,
1012 BPF_MAP_TYPE_ARENA,
1013 __MAX_BPF_MAP_TYPE
9461014};
9471015
9481016/* Note that tracing related programs such as
......@@ -986,6 +1054,8 @@ enum bpf_prog_type {
9861054 BPF_PROG_TYPE_LSM,
9871055 BPF_PROG_TYPE_SK_LOOKUP,
9881056 BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
1057 BPF_PROG_TYPE_NETFILTER,
1058 __MAX_BPF_PROG_TYPE
9891059};
9901060
9911061enum bpf_attach_type {
......@@ -1033,6 +1103,19 @@ enum bpf_attach_type {
10331103 BPF_PERF_EVENT,
10341104 BPF_TRACE_KPROBE_MULTI,
10351105 BPF_LSM_CGROUP,
1106 BPF_STRUCT_OPS,
1107 BPF_NETFILTER,
1108 BPF_TCX_INGRESS,
1109 BPF_TCX_EGRESS,
1110 BPF_TRACE_UPROBE_MULTI,
1111 BPF_CGROUP_UNIX_CONNECT,
1112 BPF_CGROUP_UNIX_SENDMSG,
1113 BPF_CGROUP_UNIX_RECVMSG,
1114 BPF_CGROUP_UNIX_GETPEERNAME,
1115 BPF_CGROUP_UNIX_GETSOCKNAME,
1116 BPF_NETKIT_PRIMARY,
1117 BPF_NETKIT_PEER,
1118 BPF_TRACE_KPROBE_SESSION,
10361119 __MAX_BPF_ATTACH_TYPE
10371120};
10381121
......@@ -1049,8 +1132,24 @@ enum bpf_link_type {
10491132 BPF_LINK_TYPE_PERF_EVENT = 7,
10501133 BPF_LINK_TYPE_KPROBE_MULTI = 8,
10511134 BPF_LINK_TYPE_STRUCT_OPS = 9,
1135 BPF_LINK_TYPE_NETFILTER = 10,
1136 BPF_LINK_TYPE_TCX = 11,
1137 BPF_LINK_TYPE_UPROBE_MULTI = 12,
1138 BPF_LINK_TYPE_NETKIT = 13,
1139 BPF_LINK_TYPE_SOCKMAP = 14,
1140 __MAX_BPF_LINK_TYPE,
1141};
1142
1143#define MAX_BPF_LINK_TYPE __MAX_BPF_LINK_TYPE
10521144
1053 MAX_BPF_LINK_TYPE,
1145enum bpf_perf_event_type {
1146 BPF_PERF_EVENT_UNSPEC = 0,
1147 BPF_PERF_EVENT_UPROBE = 1,
1148 BPF_PERF_EVENT_URETPROBE = 2,
1149 BPF_PERF_EVENT_KPROBE = 3,
1150 BPF_PERF_EVENT_KRETPROBE = 4,
1151 BPF_PERF_EVENT_TRACEPOINT = 5,
1152 BPF_PERF_EVENT_EVENT = 6,
10541153};
10551154
10561155/* cgroup-bpf attach flags used in BPF_PROG_ATTACH command
......@@ -1099,7 +1198,12 @@ enum bpf_link_type {
10991198 */
11001199#define BPF_F_ALLOW_OVERRIDE (1U << 0)
11011200#define BPF_F_ALLOW_MULTI (1U << 1)
1201/* Generic attachment flags. */
11021202#define BPF_F_REPLACE (1U << 2)
1203#define BPF_F_BEFORE (1U << 3)
1204#define BPF_F_AFTER (1U << 4)
1205#define BPF_F_ID (1U << 5)
1206#define BPF_F_LINK BPF_F_LINK /* 1 << 13 */
11031207
11041208/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
11051209 * verifier will perform strict alignment checking as if the kernel
......@@ -1108,7 +1212,7 @@ enum bpf_link_type {
11081212 */
11091213#define BPF_F_STRICT_ALIGNMENT (1U << 0)
11101214
1111/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the
1215/* If BPF_F_ANY_ALIGNMENT is used in BPF_PROG_LOAD command, the
11121216 * verifier will allow any alignment whatsoever. On platforms
11131217 * with strict alignment requirements for loads ands stores (such
11141218 * as sparc and mips) the verifier validates that all loads and
......@@ -1161,10 +1265,27 @@ enum bpf_link_type {
11611265 */
11621266#define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6)
11631267
1268/* The verifier internal test flag. Behavior is undefined */
1269#define BPF_F_TEST_REG_INVARIANTS (1U << 7)
1270
11641271/* link_create.kprobe_multi.flags used in LINK_CREATE command for
11651272 * BPF_TRACE_KPROBE_MULTI attach type to create return probe.
11661273 */
1167#define BPF_F_KPROBE_MULTI_RETURN (1U << 0)
1274enum {
1275 BPF_F_KPROBE_MULTI_RETURN = (1U << 0)
1276};
1277
1278/* link_create.uprobe_multi.flags used in LINK_CREATE command for
1279 * BPF_TRACE_UPROBE_MULTI attach type to create return probe.
1280 */
1281enum {
1282 BPF_F_UPROBE_MULTI_RETURN = (1U << 0)
1283};
1284
1285/* link_create.netfilter.flags used in LINK_CREATE command for
1286 * BPF_PROG_TYPE_NETFILTER to enable IP packet defragmentation.
1287 */
1288#define BPF_F_NETFILTER_IP_DEFRAG (1U << 0)
11681289
11691290/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
11701291 * the following extensions:
......@@ -1220,6 +1341,10 @@ enum bpf_link_type {
12201341 */
12211342#define BPF_PSEUDO_KFUNC_CALL 2
12221343
1344enum bpf_addr_space_cast {
1345 BPF_ADDR_SPACE_CAST = 1,
1346};
1347
12231348/* flags for BPF_MAP_UPDATE_ELEM command */
12241349enum {
12251350 BPF_ANY = 0, /* create new element or update existing */
......@@ -1266,6 +1391,24 @@ enum {
12661391
12671392/* Create a map that is suitable to be an inner map with dynamic max entries */
12681393 BPF_F_INNER_MAP = (1U << 12),
1394
1395/* Create a map that will be registered/unregesitered by the backed bpf_link */
1396 BPF_F_LINK = (1U << 13),
1397
1398/* Get path from provided FD in BPF_OBJ_PIN/BPF_OBJ_GET commands */
1399 BPF_F_PATH_FD = (1U << 14),
1400
1401/* Flag for value_type_btf_obj_fd, the fd is available */
1402 BPF_F_VTYPE_BTF_OBJ_FD = (1U << 15),
1403
1404/* BPF token FD is passed in a corresponding command's token_fd field */
1405 BPF_F_TOKEN_FD = (1U << 16),
1406
1407/* When user space page faults in bpf_arena send SIGSEGV instead of inserting new page */
1408 BPF_F_SEGV_ON_FAULT = (1U << 17),
1409
1410/* Do not translate kernel bpf_arena pointers to user pointers */
1411 BPF_F_NO_USER_CONV = (1U << 18),
12691412};
12701413
12711414/* Flags for BPF_PROG_QUERY. */
......@@ -1337,8 +1480,20 @@ union bpf_attr {
13371480 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
13381481 * number of hash functions (if 0, the bloom filter will default
13391482 * to using 5 hash functions).
1483 *
1484 * BPF_MAP_TYPE_ARENA - contains the address where user space
1485 * is going to mmap() the arena. It has to be page aligned.
13401486 */
13411487 __u64 map_extra;
1488
1489 __s32 value_type_btf_obj_fd; /* fd pointing to a BTF
1490 * type data for
1491 * btf_vmlinux_value_type_id.
1492 */
1493 /* BPF token FD to use with BPF_MAP_CREATE operation.
1494 * If provided, map_flags should have BPF_F_TOKEN_FD flag set.
1495 */
1496 __s32 map_token_fd;
13421497 };
13431498
13441499 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
......@@ -1403,23 +1558,44 @@ union bpf_attr {
14031558 __aligned_u64 fd_array; /* array of FDs */
14041559 __aligned_u64 core_relos;
14051560 __u32 core_relo_rec_size; /* sizeof(struct bpf_core_relo) */
1561 /* output: actual total log contents size (including termintaing zero).
1562 * It could be both larger than original log_size (if log was
1563 * truncated), or smaller (if log buffer wasn't filled completely).
1564 */
1565 __u32 log_true_size;
1566 /* BPF token FD to use with BPF_PROG_LOAD operation.
1567 * If provided, prog_flags should have BPF_F_TOKEN_FD flag set.
1568 */
1569 __s32 prog_token_fd;
14061570 };
14071571
14081572 struct { /* anonymous struct used by BPF_OBJ_* commands */
14091573 __aligned_u64 pathname;
14101574 __u32 bpf_fd;
14111575 __u32 file_flags;
1576 /* Same as dirfd in openat() syscall; see openat(2)
1577 * manpage for details of path FD and pathname semantics;
1578 * path_fd should accompanied by BPF_F_PATH_FD flag set in
1579 * file_flags field, otherwise it should be set to zero;
1580 * if BPF_F_PATH_FD flag is not set, AT_FDCWD is assumed.
1581 */
1582 __s32 path_fd;
14121583 };
14131584
14141585 struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */
1415 __u32 target_fd; /* container object to attach to */
1416 __u32 attach_bpf_fd; /* eBPF program to attach */
1586 union {
1587 __u32 target_fd; /* target object to attach to or ... */
1588 __u32 target_ifindex; /* target ifindex */
1589 };
1590 __u32 attach_bpf_fd;
14171591 __u32 attach_type;
14181592 __u32 attach_flags;
1419 __u32 replace_bpf_fd; /* previously attached eBPF
1420 * program to replace if
1421 * BPF_F_REPLACE is used
1422 */
1593 __u32 replace_bpf_fd;
1594 union {
1595 __u32 relative_fd;
1596 __u32 relative_id;
1597 };
1598 __u64 expected_revision;
14231599 };
14241600
14251601 struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */
......@@ -1465,21 +1641,33 @@ union bpf_attr {
14651641 } info;
14661642
14671643 struct { /* anonymous struct used by BPF_PROG_QUERY command */
1468 __u32 target_fd; /* container object to query */
1644 union {
1645 __u32 target_fd; /* target object to query or ... */
1646 __u32 target_ifindex; /* target ifindex */
1647 };
14691648 __u32 attach_type;
14701649 __u32 query_flags;
14711650 __u32 attach_flags;
14721651 __aligned_u64 prog_ids;
1473 __u32 prog_cnt;
1652 union {
1653 __u32 prog_cnt;
1654 __u32 count;
1655 };
1656 __u32 :32;
14741657 /* output: per-program attach_flags.
14751658 * not allowed to be set during effective query.
14761659 */
14771660 __aligned_u64 prog_attach_flags;
1661 __aligned_u64 link_ids;
1662 __aligned_u64 link_attach_flags;
1663 __u64 revision;
14781664 } query;
14791665
14801666 struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */
1481 __u64 name;
1482 __u32 prog_fd;
1667 __u64 name;
1668 __u32 prog_fd;
1669 __u32 :32;
1670 __aligned_u64 cookie;
14831671 } raw_tracepoint;
14841672
14851673 struct { /* anonymous struct for BPF_BTF_LOAD */
......@@ -1488,6 +1676,16 @@ union bpf_attr {
14881676 __u32 btf_size;
14891677 __u32 btf_log_size;
14901678 __u32 btf_log_level;
1679 /* output: actual total log contents size (including termintaing zero).
1680 * It could be both larger than original log_size (if log was
1681 * truncated), or smaller (if log buffer wasn't filled completely).
1682 */
1683 __u32 btf_log_true_size;
1684 __u32 btf_flags;
1685 /* BPF token FD to use with BPF_BTF_LOAD operation.
1686 * If provided, btf_flags should have BPF_F_TOKEN_FD flag set.
1687 */
1688 __s32 btf_token_fd;
14911689 };
14921690
14931691 struct {
......@@ -1507,15 +1705,18 @@ union bpf_attr {
15071705 } task_fd_query;
15081706
15091707 struct { /* struct used by BPF_LINK_CREATE command */
1510 __u32 prog_fd; /* eBPF program to attach */
15111708 union {
1512 __u32 target_fd; /* object to attach to */
1513 __u32 target_ifindex; /* target ifindex */
1709 __u32 prog_fd; /* eBPF program to attach */
1710 __u32 map_fd; /* struct_ops to attach */
1711 };
1712 union {
1713 __u32 target_fd; /* target object to attach to or ... */
1714 __u32 target_ifindex; /* target ifindex */
15141715 };
15151716 __u32 attach_type; /* attach type */
15161717 __u32 flags; /* extra flags */
15171718 union {
1518 __u32 target_btf_id; /* btf_id of target to attach to */
1719 __u32 target_btf_id; /* btf_id of target to attach to */
15191720 struct {
15201721 __aligned_u64 iter_info; /* extra bpf_iter_link_info */
15211722 __u32 iter_info_len; /* iter_info length */
......@@ -1543,17 +1744,57 @@ union bpf_attr {
15431744 */
15441745 __u64 cookie;
15451746 } tracing;
1747 struct {
1748 __u32 pf;
1749 __u32 hooknum;
1750 __s32 priority;
1751 __u32 flags;
1752 } netfilter;
1753 struct {
1754 union {
1755 __u32 relative_fd;
1756 __u32 relative_id;
1757 };
1758 __u64 expected_revision;
1759 } tcx;
1760 struct {
1761 __aligned_u64 path;
1762 __aligned_u64 offsets;
1763 __aligned_u64 ref_ctr_offsets;
1764 __aligned_u64 cookies;
1765 __u32 cnt;
1766 __u32 flags;
1767 __u32 pid;
1768 } uprobe_multi;
1769 struct {
1770 union {
1771 __u32 relative_fd;
1772 __u32 relative_id;
1773 };
1774 __u64 expected_revision;
1775 } netkit;
15461776 };
15471777 } link_create;
15481778
15491779 struct { /* struct used by BPF_LINK_UPDATE command */
15501780 __u32 link_fd; /* link fd */
1551 /* new program fd to update link with */
1552 __u32 new_prog_fd;
1781 union {
1782 /* new program fd to update link with */
1783 __u32 new_prog_fd;
1784 /* new struct_ops map fd to update link with */
1785 __u32 new_map_fd;
1786 };
15531787 __u32 flags; /* extra flags */
1554 /* expected link's program fd; is specified only if
1555 * BPF_F_REPLACE flag is set in flags */
1556 __u32 old_prog_fd;
1788 union {
1789 /* expected link's program fd; is specified only if
1790 * BPF_F_REPLACE flag is set in flags.
1791 */
1792 __u32 old_prog_fd;
1793 /* expected link's map fd; is specified only
1794 * if BPF_F_REPLACE flag is set.
1795 */
1796 __u32 old_map_fd;
1797 };
15571798 } link_update;
15581799
15591800 struct {
......@@ -1575,6 +1816,11 @@ union bpf_attr {
15751816 __u32 flags; /* extra flags */
15761817 } prog_bind_map;
15771818
1819 struct { /* struct used by BPF_TOKEN_CREATE command */
1820 __u32 flags;
1821 __u32 bpffs_fd;
1822 } token_create;
1823
15781824} __attribute__((aligned(8)));
15791825
15801826/* The description below is an attempt at providing documentation to eBPF
......@@ -1647,17 +1893,17 @@ union bpf_attr {
16471893 * Description
16481894 * This helper is a "printk()-like" facility for debugging. It
16491895 * prints a message defined by format *fmt* (of size *fmt_size*)
1650 * to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if
1896 * to file *\/sys/kernel/tracing/trace* from TraceFS, if
16511897 * available. It can take up to three additional **u64**
16521898 * arguments (as an eBPF helpers, the total number of arguments is
16531899 * limited to five).
16541900 *
16551901 * Each time the helper is called, it appends a line to the trace.
1656 * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is
1657 * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this.
1902 * Lines are discarded while *\/sys/kernel/tracing/trace* is
1903 * open, use *\/sys/kernel/tracing/trace_pipe* to avoid this.
16581904 * The format of the trace is customizable, and the exact output
16591905 * one will get depends on the options set in
1660 * *\/sys/kernel/debug/tracing/trace_options* (see also the
1906 * *\/sys/kernel/tracing/trace_options* (see also the
16611907 * *README* file under the same directory). However, it usually
16621908 * defaults to something like:
16631909 *
......@@ -1850,7 +2096,9 @@ union bpf_attr {
18502096 * performed again, if the helper is used in combination with
18512097 * direct packet access.
18522098 * Return
1853 * 0 on success, or a negative error in case of failure.
2099 * 0 on success, or a negative error in case of failure. Positive
2100 * error indicates a potential drop or congestion in the target
2101 * device. The particular positive error codes are not defined.
18542102 *
18552103 * u64 bpf_get_current_pid_tgid(void)
18562104 * Description
......@@ -2583,8 +2831,8 @@ union bpf_attr {
25832831 * *bpf_socket* should be one of the following:
25842832 *
25852833 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2586 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2587 * and **BPF_CGROUP_INET6_CONNECT**.
2834 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
2835 * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
25882836 *
25892837 * This helper actually implements a subset of **setsockopt()**.
25902838 * It supports the following *level*\ s:
......@@ -2822,8 +3070,8 @@ union bpf_attr {
28223070 * *bpf_socket* should be one of the following:
28233071 *
28243072 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2825 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2826 * and **BPF_CGROUP_INET6_CONNECT**.
3073 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
3074 * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
28273075 *
28283076 * This helper actually implements a subset of **getsockopt()**.
28293077 * It supports the same set of *optname*\ s that is supported by
......@@ -3131,6 +3379,10 @@ union bpf_attr {
31313379 * **BPF_FIB_LOOKUP_DIRECT**
31323380 * Do a direct table lookup vs full lookup using FIB
31333381 * rules.
3382 * **BPF_FIB_LOOKUP_TBID**
3383 * Used with BPF_FIB_LOOKUP_DIRECT.
3384 * Use the routing table ID present in *params*->tbid
3385 * for the fib lookup.
31343386 * **BPF_FIB_LOOKUP_OUTPUT**
31353387 * Perform lookup from an egress perspective (default is
31363388 * ingress).
......@@ -3139,6 +3391,15 @@ union bpf_attr {
31393391 * and *params*->smac will not be set as output. A common
31403392 * use case is to call **bpf_redirect_neigh**\ () after
31413393 * doing **bpf_fib_lookup**\ ().
3394 * **BPF_FIB_LOOKUP_SRC**
3395 * Derive and set source IP addr in *params*->ipv{4,6}_src
3396 * for the nexthop. If the src addr cannot be derived,
3397 * **BPF_FIB_LKUP_RET_NO_SRC_ADDR** is returned. In this
3398 * case, *params*->dmac and *params*->smac are not set either.
3399 * **BPF_FIB_LOOKUP_MARK**
3400 * Use the mark present in *params*->mark for the fib lookup.
3401 * This option should not be used with BPF_FIB_LOOKUP_DIRECT,
3402 * as it only has meaning for full lookups.
31423403 *
31433404 * *ctx* is either **struct xdp_md** for XDP programs or
31443405 * **struct sk_buff** tc cls_act programs.
......@@ -4108,9 +4369,6 @@ union bpf_attr {
41084369 * **-EOPNOTSUPP** if the operation is not supported, for example
41094370 * a call from outside of TC ingress.
41104371 *
4111 * **-ESOCKTNOSUPPORT** if the socket type is not supported
4112 * (reuseport).
4113 *
41144372 * long bpf_sk_assign(struct bpf_sk_lookup *ctx, struct bpf_sock *sk, u64 flags)
41154373 * Description
41164374 * Helper is overloaded depending on BPF program type. This
......@@ -4375,6 +4633,8 @@ union bpf_attr {
43754633 * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
43764634 * Description
43774635 * Return a user or a kernel stack in bpf program provided buffer.
4636 * Note: the user stack will only be populated if the *task* is
4637 * the current task; all other tasks will return -EOPNOTSUPP.
43784638 * To achieve this, the helper needs *task*, which is a valid
43794639 * pointer to **struct task_struct**. To store the stacktrace, the
43804640 * bpf program provides *buf* with a nonnegative *size*.
......@@ -4386,6 +4646,7 @@ union bpf_attr {
43864646 *
43874647 * **BPF_F_USER_STACK**
43884648 * Collect a user space stack instead of a kernel stack.
4649 * The *task* must be the current task.
43894650 * **BPF_F_USER_BUILD_ID**
43904651 * Collect buildid+offset instead of ips for user stack,
43914652 * only valid if **BPF_F_USER_STACK** is also specified.
......@@ -4689,9 +4950,9 @@ union bpf_attr {
46894950 * going through the CPU's backlog queue.
46904951 *
46914952 * The *flags* argument is reserved and must be 0. The helper is
4692 * currently only supported for tc BPF program types at the ingress
4693 * hook and for veth device types. The peer device must reside in a
4694 * different network namespace.
4953 * currently only supported for tc BPF program types at the
4954 * ingress hook and for veth and netkit target device types. The
4955 * peer device must reside in a different network namespace.
46954956 * Return
46964957 * The helper returns **TC_ACT_REDIRECT** on success or
46974958 * **TC_ACT_SHOT** on error.
......@@ -4767,7 +5028,7 @@ union bpf_attr {
47675028 * bytes will be copied to *dst*
47685029 * Return
47695030 * The **hash_algo** is returned on success,
4770 * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if
5031 * **-EOPNOTSUPP** if IMA is disabled or **-EINVAL** if
47715032 * invalid arguments are passed.
47725033 *
47735034 * struct socket *bpf_sock_from_file(struct file *file)
......@@ -4969,6 +5230,14 @@ union bpf_attr {
49695230 * different maps if key/value layout matches across maps.
49705231 * Every bpf_timer_set_callback() can have different callback_fn.
49715232 *
5233 * *flags* can be one of:
5234 *
5235 * **BPF_F_TIMER_ABS**
5236 * Start the timer in absolute expire value instead of the
5237 * default relative one.
5238 * **BPF_F_TIMER_CPU_PIN**
5239 * Timer will be pinned to the CPU of the caller.
5240 *
49725241 * Return
49735242 * 0 on success.
49745243 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
......@@ -4987,9 +5256,14 @@ union bpf_attr {
49875256 * u64 bpf_get_func_ip(void *ctx)
49885257 * Description
49895258 * Get address of the traced function (for tracing and kprobe programs).
5259 *
5260 * When called for kprobe program attached as uprobe it returns
5261 * probe address for both entry and return uprobe.
5262 *
49905263 * Return
4991 * Address of the traced function.
5264 * Address of the traced function for kprobe.
49925265 * 0 for kprobes placed within the function (not at the entry).
5266 * Address of the probe for uprobe and return uprobe.
49935267 *
49945268 * u64 bpf_get_attach_cookie(void *ctx)
49955269 * Description
......@@ -5240,7 +5514,7 @@ union bpf_attr {
52405514 * bytes will be copied to *dst*
52415515 * Return
52425516 * The **hash_algo** is returned on success,
5243 * **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
5517 * **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
52445518 * invalid arguments are passed.
52455519 *
52465520 * void *bpf_kptr_xchg(void *map_value, void *ptr)
......@@ -5325,11 +5599,22 @@ union bpf_attr {
53255599 * Description
53265600 * Write *len* bytes from *src* into *dst*, starting from *offset*
53275601 * into *dst*.
5328 * *flags* is currently unused.
5602 *
5603 * *flags* must be 0 except for skb-type dynptrs.
5604 *
5605 * For skb-type dynptrs:
5606 * * All data slices of the dynptr are automatically
5607 * invalidated after **bpf_dynptr_write**\ (). This is
5608 * because writing may pull the skb and change the
5609 * underlying packet buffer.
5610 *
5611 * * For *flags*, please see the flags accepted by
5612 * **bpf_skb_store_bytes**\ ().
53295613 * Return
53305614 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
53315615 * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
5332 * is a read-only dynptr or if *flags* is not 0.
5616 * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
5617 * other errors correspond to errors returned by **bpf_skb_store_bytes**\ ().
53335618 *
53345619 * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len)
53355620 * Description
......@@ -5337,6 +5622,9 @@ union bpf_attr {
53375622 *
53385623 * *len* must be a statically known value. The returned data slice
53395624 * is invalidated whenever the dynptr is invalidated.
5625 *
5626 * skb and xdp type dynptrs may not use bpf_dynptr_data. They should
5627 * instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr.
53405628 * Return
53415629 * Pointer to the underlying dynptr data, NULL if the dynptr is
53425630 * read-only, if the dynptr is invalid, or if the offset and length
......@@ -6116,6 +6404,19 @@ struct bpf_sock_tuple {
61166404 };
61176405};
61186406
6407/* (Simplified) user return codes for tcx prog type.
6408 * A valid tcx program must return one of these defined values. All other
6409 * return codes are reserved for future use. Must remain compatible with
6410 * their TC_ACT_* counter-parts. For compatibility in behavior, unknown
6411 * return codes are mapped to TCX_NEXT.
6412 */
6413enum tcx_action_base {
6414 TCX_NEXT = -1,
6415 TCX_PASS = 0,
6416 TCX_DROP = 2,
6417 TCX_REDIRECT = 7,
6418};
6419
61196420struct bpf_xdp_sock {
61206421 __u32 queue_id;
61216422};
......@@ -6297,7 +6598,7 @@ struct bpf_map_info {
62976598 __u32 btf_id;
62986599 __u32 btf_key_type_id;
62996600 __u32 btf_value_type_id;
6300 __u32 :32; /* alignment pad */
6601 __u32 btf_vmlinux_id;
63016602 __u64 map_extra;
63026603} __attribute__((aligned(8)));
63036604
......@@ -6359,6 +6660,76 @@ struct bpf_link_info {
63596660 struct {
63606661 __u32 ifindex;
63616662 } xdp;
6663 struct {
6664 __u32 map_id;
6665 } struct_ops;
6666 struct {
6667 __u32 pf;
6668 __u32 hooknum;
6669 __s32 priority;
6670 __u32 flags;
6671 } netfilter;
6672 struct {
6673 __aligned_u64 addrs;
6674 __u32 count; /* in/out: kprobe_multi function count */
6675 __u32 flags;
6676 __u64 missed;
6677 __aligned_u64 cookies;
6678 } kprobe_multi;
6679 struct {
6680 __aligned_u64 path;
6681 __aligned_u64 offsets;
6682 __aligned_u64 ref_ctr_offsets;
6683 __aligned_u64 cookies;
6684 __u32 path_size; /* in/out: real path size on success, including zero byte */
6685 __u32 count; /* in/out: uprobe_multi offsets/ref_ctr_offsets/cookies count */
6686 __u32 flags;
6687 __u32 pid;
6688 } uprobe_multi;
6689 struct {
6690 __u32 type; /* enum bpf_perf_event_type */
6691 __u32 :32;
6692 union {
6693 struct {
6694 __aligned_u64 file_name; /* in/out */
6695 __u32 name_len;
6696 __u32 offset; /* offset from file_name */
6697 __u64 cookie;
6698 } uprobe; /* BPF_PERF_EVENT_UPROBE, BPF_PERF_EVENT_URETPROBE */
6699 struct {
6700 __aligned_u64 func_name; /* in/out */
6701 __u32 name_len;
6702 __u32 offset; /* offset from func_name */
6703 __u64 addr;
6704 __u64 missed;
6705 __u64 cookie;
6706 } kprobe; /* BPF_PERF_EVENT_KPROBE, BPF_PERF_EVENT_KRETPROBE */
6707 struct {
6708 __aligned_u64 tp_name; /* in/out */
6709 __u32 name_len;
6710 __u32 :32;
6711 __u64 cookie;
6712 } tracepoint; /* BPF_PERF_EVENT_TRACEPOINT */
6713 struct {
6714 __u64 config;
6715 __u32 type;
6716 __u32 :32;
6717 __u64 cookie;
6718 } event; /* BPF_PERF_EVENT_EVENT */
6719 };
6720 } perf_event;
6721 struct {
6722 __u32 ifindex;
6723 __u32 attach_type;
6724 } tcx;
6725 struct {
6726 __u32 ifindex;
6727 __u32 attach_type;
6728 } netkit;
6729 struct {
6730 __u32 map_id;
6731 __u32 attach_type;
6732 } sockmap;
63626733 };
63636734} __attribute__((aligned(8)));
63646735
......@@ -6577,6 +6948,8 @@ enum {
65776948 * socket transition to LISTEN state.
65786949 */
65796950 BPF_SOCK_OPS_RTT_CB, /* Called on every RTT.
6951 * Arg1: measured RTT input (mrtt)
6952 * Arg2: updated srtt
65806953 */
65816954 BPF_SOCK_OPS_PARSE_HDR_OPT_CB, /* Parse the header option.
65826955 * It will be called to handle
......@@ -6655,6 +7028,7 @@ enum {
66557028 BPF_TCP_LISTEN,
66567029 BPF_TCP_CLOSING, /* Now a valid state */
66577030 BPF_TCP_NEW_SYN_RECV,
7031 BPF_TCP_BOUND_INACTIVE,
66587032
66597033 BPF_TCP_MAX_STATES /* Leave at the end! */
66607034};
......@@ -6756,6 +7130,9 @@ enum {
67567130 BPF_FIB_LOOKUP_DIRECT = (1U << 0),
67577131 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
67587132 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
7133 BPF_FIB_LOOKUP_TBID = (1U << 3),
7134 BPF_FIB_LOOKUP_SRC = (1U << 4),
7135 BPF_FIB_LOOKUP_MARK = (1U << 5),
67597136};
67607137
67617138enum {
......@@ -6768,6 +7145,7 @@ enum {
67687145 BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
67697146 BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
67707147 BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
7148 BPF_FIB_LKUP_RET_NO_SRC_ADDR, /* failed to derive IP src addr */
67717149};
67727150
67737151struct bpf_fib_lookup {
......@@ -6787,7 +7165,7 @@ struct bpf_fib_lookup {
67877165
67887166 /* output: MTU value */
67897167 __u16 mtu_result;
6790 };
7168 } __attribute__((packed, aligned(2)));
67917169 /* input: L3 device index for lookup
67927170 * output: device index from FIB lookup
67937171 */
......@@ -6802,6 +7180,9 @@ struct bpf_fib_lookup {
68027180 __u32 rt_metric;
68037181 };
68047182
7183 /* input: source address to consider for lookup
7184 * output: source address result from lookup
7185 */
68057186 union {
68067187 __be32 ipv4_src;
68077188 __u32 ipv6_src[4]; /* in6_addr; network order */
......@@ -6816,11 +7197,32 @@ struct bpf_fib_lookup {
68167197 __u32 ipv6_dst[4]; /* in6_addr; network order */
68177198 };
68187199
6819 /* output */
6820 __be16 h_vlan_proto;
6821 __be16 h_vlan_TCI;
6822 __u8 smac[6]; /* ETH_ALEN */
6823 __u8 dmac[6]; /* ETH_ALEN */
7200 union {
7201 struct {
7202 /* output */
7203 __be16 h_vlan_proto;
7204 __be16 h_vlan_TCI;
7205 };
7206 /* input: when accompanied with the
7207 * 'BPF_FIB_LOOKUP_DIRECT | BPF_FIB_LOOKUP_TBID` flags, a
7208 * specific routing table to use for the fib lookup.
7209 */
7210 __u32 tbid;
7211 };
7212
7213 union {
7214 /* input */
7215 struct {
7216 __u32 mark; /* policy routing */
7217 /* 2 4-byte holes for input */
7218 };
7219
7220 /* output: source and dest mac */
7221 struct {
7222 __u8 smac[6]; /* ETH_ALEN */
7223 __u8 dmac[6]; /* ETH_ALEN */
7224 };
7225 };
68247226};
68257227
68267228struct bpf_redir_neigh {
......@@ -6904,36 +7306,37 @@ struct bpf_spin_lock {
69047306};
69057307
69067308struct bpf_timer {
6907 __u64 :64;
6908 __u64 :64;
7309 __u64 __opaque[2];
7310} __attribute__((aligned(8)));
7311
7312struct bpf_wq {
7313 __u64 __opaque[2];
69097314} __attribute__((aligned(8)));
69107315
69117316struct bpf_dynptr {
6912 __u64 :64;
6913 __u64 :64;
7317 __u64 __opaque[2];
69147318} __attribute__((aligned(8)));
69157319
69167320struct bpf_list_head {
6917 __u64 :64;
6918 __u64 :64;
7321 __u64 __opaque[2];
69197322} __attribute__((aligned(8)));
69207323
69217324struct bpf_list_node {
6922 __u64 :64;
6923 __u64 :64;
7325 __u64 __opaque[3];
69247326} __attribute__((aligned(8)));
69257327
69267328struct bpf_rb_root {
6927 __u64 :64;
6928 __u64 :64;
7329 __u64 __opaque[2];
69297330} __attribute__((aligned(8)));
69307331
69317332struct bpf_rb_node {
6932 __u64 :64;
6933 __u64 :64;
6934 __u64 :64;
7333 __u64 __opaque[4];
69357334} __attribute__((aligned(8)));
69367335
7336struct bpf_refcount {
7337 __u32 __opaque[1];
7338} __attribute__((aligned(4)));
7339
69377340struct bpf_sysctl {
69387341 __u32 write; /* Sysctl is being read (= 0) or written (= 1).
69397342 * Allows 1,2,4-byte read, but no write.
......@@ -7083,4 +7486,23 @@ struct bpf_core_relo {
70837486 enum bpf_core_relo_kind kind;
70847487};
70857488
7489/*
7490 * Flags to control bpf_timer_start() behaviour.
7491 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7492 * relative to current time.
7493 * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.
7494 */
7495enum {
7496 BPF_F_TIMER_ABS = (1ULL << 0),
7497 BPF_F_TIMER_CPU_PIN = (1ULL << 1),
7498};
7499
7500/* BPF numbers iterator state */
7501struct bpf_iter_num {
7502 /* opaque iterator state; having __u64 here allows to preserve correct
7503 * alignment requirements in vmlinux.h, generated from BTF
7504 */
7505 __u64 __opaque[1];
7506} __attribute__((aligned(8)));
7507
70867508#endif /* __LINUX_BPF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/bpfilter.h deleted-21
......@@ -1,21 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_BPFILTER_H
3#define _LINUX_BPFILTER_H
4
5#include <linux/if.h>
6
7enum {
8 BPFILTER_IPT_SO_SET_REPLACE = 64,
9 BPFILTER_IPT_SO_SET_ADD_COUNTERS = 65,
10 BPFILTER_IPT_SET_MAX,
11};
12
13enum {
14 BPFILTER_IPT_SO_GET_INFO = 64,
15 BPFILTER_IPT_SO_GET_ENTRIES = 65,
16 BPFILTER_IPT_SO_GET_REVISION_MATCH = 66,
17 BPFILTER_IPT_SO_GET_REVISION_TARGET = 67,
18 BPFILTER_IPT_GET_MAX,
19};
20
21#endif /* _LINUX_BPFILTER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs.h+7
......@@ -90,6 +90,7 @@ struct btrfs_qgroup_limit {
9090 * struct btrfs_qgroup_inherit.flags
9191 */
9292#define BTRFS_QGROUP_INHERIT_SET_LIMITS (1ULL << 0)
93#define BTRFS_QGROUP_INHERIT_FLAGS_SUPP (BTRFS_QGROUP_INHERIT_SET_LIMITS)
9394
9495struct btrfs_qgroup_inherit {
9596 __u64 flags;
......@@ -331,6 +332,8 @@ struct btrfs_ioctl_fs_info_args {
331332#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
332333#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
333334#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
335#define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
336#define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
334337
335338struct btrfs_ioctl_feature_flags {
336339 __u64 compat_flags;
......@@ -610,6 +613,9 @@ struct btrfs_ioctl_clone_range_args {
610613 */
611614#define BTRFS_DEFRAG_RANGE_COMPRESS 1
612615#define BTRFS_DEFRAG_RANGE_START_IO 2
616#define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS | \
617 BTRFS_DEFRAG_RANGE_START_IO)
618
613619struct btrfs_ioctl_defrag_range_args {
614620 /* start of the defrag operation */
615621 __u64 start;
......@@ -751,6 +757,7 @@ struct btrfs_ioctl_get_dev_stats {
751757#define BTRFS_QUOTA_CTL_ENABLE 1
752758#define BTRFS_QUOTA_CTL_DISABLE 2
753759#define BTRFS_QUOTA_CTL_RESCAN__NOTUSED 3
760#define BTRFS_QUOTA_CTL_ENABLE_SIMPLE_QUOTA 4
754761struct btrfs_ioctl_quota_ctl_args {
755762 __u64 cmd;
756763 __u64 status;
lib/libc/include/any-linux-any/linux/btrfs_tree.h+72-2
......@@ -69,6 +69,9 @@
6969/* Holds the block group items for extent tree v2. */
7070#define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL
7171
72/* Tracks RAID stripes in block groups. */
73#define BTRFS_RAID_STRIPE_TREE_OBJECTID 12ULL
74
7275/* device stats in the device tree */
7376#define BTRFS_DEV_STATS_OBJECTID 0ULL
7477
......@@ -212,11 +215,31 @@
212215 */
213216#define BTRFS_METADATA_ITEM_KEY 169
214217
218/*
219 * Special __inline__ ref key which stores the id of the subvolume which originally
220 * created the extent. This subvolume owns the extent permanently from the
221 * perspective of simple quotas. Needed to know which subvolume to free quota
222 * usage from when the extent is deleted.
223 *
224 * Stored as an __inline__ ref rather to avoid wasting space on a separate item on
225 * top of the existing extent item. However, unlike the other __inline__ refs,
226 * there is one one owner ref per extent rather than one per extent.
227 *
228 * Because of this, it goes at the front of the list of __inline__ refs, and thus
229 * must have a lower type value than any other __inline__ ref type (to satisfy the
230 * disk format rule that __inline__ refs have non-decreasing type).
231 */
232#define BTRFS_EXTENT_OWNER_REF_KEY 172
233
215234#define BTRFS_TREE_BLOCK_REF_KEY 176
216235
217236#define BTRFS_EXTENT_DATA_REF_KEY 178
218237
219#define BTRFS_EXTENT_REF_V0_KEY 180
238/*
239 * Obsolete key. Defintion removed in 6.6, value may be reused in the future.
240 *
241 * #define BTRFS_EXTENT_REF_V0_KEY 180
242 */
220243
221244#define BTRFS_SHARED_BLOCK_REF_KEY 182
222245
......@@ -253,6 +276,8 @@
253276#define BTRFS_DEV_ITEM_KEY 216
254277#define BTRFS_CHUNK_ITEM_KEY 228
255278
279#define BTRFS_RAID_STRIPE_KEY 230
280
256281/*
257282 * Records the overall state of the qgroups.
258283 * There's only one instance of this key present,
......@@ -711,6 +736,30 @@ struct btrfs_free_space_header {
711736 __le64 num_bitmaps;
712737} __attribute__ ((__packed__));
713738
739struct btrfs_raid_stride {
740 /* The id of device this raid extent lives on. */
741 __le64 devid;
742 /* The physical location on disk. */
743 __le64 physical;
744} __attribute__ ((__packed__));
745
746/* The stripe_extent::encoding, 1:1 mapping of enum btrfs_raid_types. */
747#define BTRFS_STRIPE_RAID0 1
748#define BTRFS_STRIPE_RAID1 2
749#define BTRFS_STRIPE_DUP 3
750#define BTRFS_STRIPE_RAID10 4
751#define BTRFS_STRIPE_RAID5 5
752#define BTRFS_STRIPE_RAID6 6
753#define BTRFS_STRIPE_RAID1C3 7
754#define BTRFS_STRIPE_RAID1C4 8
755
756struct btrfs_stripe_extent {
757 __u8 encoding;
758 __u8 reserved[7];
759 /* An array of raid strides this stripe is composed of. */
760 struct btrfs_raid_stride strides[];
761} __attribute__ ((__packed__));
762
714763#define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)
715764#define BTRFS_HEADER_FLAG_RELOC (1ULL << 1)
716765
......@@ -779,6 +828,10 @@ struct btrfs_shared_data_ref {
779828 __le32 count;
780829} __attribute__ ((__packed__));
781830
831struct btrfs_extent_owner_ref {
832 __le64 root_id;
833} __attribute__ ((__packed__));
834
782835struct btrfs_extent_inline_ref {
783836 __u8 type;
784837 __le64 offset;
......@@ -1196,9 +1249,17 @@ static __inline__ __u16 btrfs_qgroup_level(__u64 qgroupid)
11961249 */
11971250#define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)
11981251
1252/*
1253 * Whether or not this filesystem is using simple quotas. Not exactly the
1254 * incompat bit, because we support using simple quotas, disabling it, then
1255 * going back to full qgroup quotas.
1256 */
1257#define BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE (1ULL << 3)
1258
11991259#define BTRFS_QGROUP_STATUS_FLAGS_MASK (BTRFS_QGROUP_STATUS_FLAG_ON | \
12001260 BTRFS_QGROUP_STATUS_FLAG_RESCAN | \
1201 BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT)
1261 BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT | \
1262 BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE)
12021263
12031264#define BTRFS_QGROUP_STATUS_VERSION 1
12041265
......@@ -1220,6 +1281,15 @@ struct btrfs_qgroup_status_item {
12201281 * of the scan. It contains a logical address
12211282 */
12221283 __le64 rescan;
1284
1285 /*
1286 * The generation when quotas were last enabled. Used by simple quotas to
1287 * avoid decrementing when freeing an extent that was written before
1288 * enable.
1289 *
1290 * Set only if flags contain BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE.
1291 */
1292 __le64 enable_gen;
12231293} __attribute__ ((__packed__));
12241294
12251295struct btrfs_qgroup_info_item {
lib/libc/include/any-linux-any/linux/can.h+7-3
......@@ -193,9 +193,14 @@ struct canfd_frame {
193193#define CANXL_XLF 0x80 /* mandatory CAN XL frame flag (must always be set!) */
194194#define CANXL_SEC 0x01 /* Simple Extended Content (security/segmentation) */
195195
196/* the 8-bit VCID is optionally placed in the canxl_frame.prio element */
197#define CANXL_VCID_OFFSET 16 /* bit offset of VCID in prio element */
198#define CANXL_VCID_VAL_MASK 0xFFUL /* VCID is an 8-bit value */
199#define CANXL_VCID_MASK (CANXL_VCID_VAL_MASK << CANXL_VCID_OFFSET)
200
196201/**
197202 * struct canxl_frame - CAN with e'X'tended frame 'L'ength frame structure
198 * @prio: 11 bit arbitration priority with zero'ed CAN_*_FLAG flags
203 * @prio: 11 bit arbitration priority with zero'ed CAN_*_FLAG flags / VCID
199204 * @flags: additional flags for CAN XL
200205 * @sdt: SDU (service data unit) type
201206 * @len: frame payload length in byte (CANXL_MIN_DLEN .. CANXL_MAX_DLEN)
......@@ -205,7 +210,7 @@ struct canfd_frame {
205210 * @prio shares the same position as @can_id from struct can[fd]_frame.
206211 */
207212struct canxl_frame {
208 canid_t prio; /* 11 bit priority for arbitration (canid_t) */
213 canid_t prio; /* 11 bit priority for arbitration / 8 bit VCID */
209214 __u8 flags; /* additional flags for CAN XL */
210215 __u8 sdt; /* SDU (service data unit) type */
211216 __u16 len; /* frame payload length in byte */
......@@ -285,6 +290,5 @@ struct can_filter {
285290};
286291
287292#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
288#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
289293
290294#endif /* !_UAPI_CAN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can/isotp.h+1
......@@ -137,6 +137,7 @@ struct can_isotp_ll_options {
137137#define CAN_ISOTP_WAIT_TX_DONE 0x0400 /* wait for tx completion */
138138#define CAN_ISOTP_SF_BROADCAST 0x0800 /* 1-to-N functional addressing */
139139#define CAN_ISOTP_CF_BROADCAST 0x1000 /* 1-to-N transmission w/o FC */
140#define CAN_ISOTP_DYN_FC_PARMS 0x2000 /* dynamic FC parameters BS/STmin */
140141
141142/* protocol machine default values */
142143
lib/libc/include/any-linux-any/linux/can/raw.h+18
......@@ -49,6 +49,8 @@
4949#include <linux/can.h>
5050
5151#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
52#define CAN_RAW_FILTER_MAX 512 /* maximum number of can_filter set via setsockopt() */
53
5254enum {
5355 SCM_CAN_RAW_ERRQUEUE = 1,
5456};
......@@ -63,6 +65,22 @@ enum {
6365 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
6466 CAN_RAW_JOIN_FILTERS, /* all filters must match to trigger */
6567 CAN_RAW_XL_FRAMES, /* allow CAN XL frames (default:off) */
68 CAN_RAW_XL_VCID_OPTS, /* CAN XL VCID configuration options */
69};
70
71/* configuration for CAN XL virtual CAN identifier (VCID) handling */
72struct can_raw_vcid_options {
73
74 __u8 flags; /* flags for vcid (filter) behaviour */
75 __u8 tx_vcid; /* VCID value set into canxl_frame.prio */
76 __u8 rx_vcid; /* VCID value for VCID filter */
77 __u8 rx_vcid_mask; /* VCID mask for VCID filter */
78
6679};
6780
81/* can_raw_vcid_options.flags for CAN XL virtual CAN identifier handling */
82#define CAN_RAW_XL_VCID_TX_SET 0x01
83#define CAN_RAW_XL_VCID_TX_PASS 0x02
84#define CAN_RAW_XL_VCID_RX_FILTER 0x04
85
6886#endif /* !_UAPI_CAN_RAW_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/capability.h+3-2
......@@ -41,11 +41,12 @@ typedef struct __user_cap_header_struct {
4141 int pid;
4242} *cap_user_header_t;
4343
44typedef struct __user_cap_data_struct {
44struct __user_cap_data_struct {
4545 __u32 effective;
4646 __u32 permitted;
4747 __u32 inheritable;
48} *cap_user_data_t;
48};
49typedef struct __user_cap_data_struct *cap_user_data_t;
4950
5051
5152#define VFS_CAP_REVISION_MASK 0xFF000000
lib/libc/include/any-linux-any/linux/cgroupstats.h-2
......@@ -24,8 +24,6 @@
2424 * basis. This data is shared using taskstats.
2525 *
2626 * Most of these states are derived by looking at the task->state value
27 * For the nr_io_wait state, a flag in the delay accounting structure
28 * indicates that the task is waiting on IO
2927 *
3028 * Each member is aligned to a 8 byte boundary.
3129 */
lib/libc/include/any-linux-any/linux/cm4000_cs.h deleted-64
......@@ -1,64 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _CM4000_H_
3#define _CM4000_H_
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8#define MAX_ATR 33
9
10#define CM4000_MAX_DEV 4
11
12/* those two structures are passed via ioctl() from/to userspace. They are
13 * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
14 * not to break compilation of userspace apps. -HW */
15
16typedef struct atreq {
17 __s32 atr_len;
18 unsigned char atr[64];
19 __s32 power_act;
20 unsigned char bIFSD;
21 unsigned char bIFSC;
22} atreq_t;
23
24
25/* what is particularly stupid in the original driver is the arch-dependent
26 * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
27 * will lay out the structure members differently than the 64bit kernel.
28 *
29 * I've changed "ptsreq.protocol" from "unsigned long" to "__u32".
30 * On 32bit this will make no difference. With 64bit kernels, it will make
31 * 32bit apps work, too.
32 */
33
34typedef struct ptsreq {
35 __u32 protocol; /*T=0: 2^0, T=1: 2^1*/
36 unsigned char flags;
37 unsigned char pts1;
38 unsigned char pts2;
39 unsigned char pts3;
40} ptsreq_t;
41
42#define CM_IOC_MAGIC 'c'
43#define CM_IOC_MAXNR 255
44
45#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
46#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
47#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
48#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
49#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
50
51#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
52
53/* card and device states */
54#define CM_CARD_INSERTED 0x01
55#define CM_CARD_POWERED 0x02
56#define CM_ATR_PRESENT 0x04
57#define CM_ATR_VALID 0x08
58#define CM_STATE_VALID 0x0f
59/* extra info only from CM4000 */
60#define CM_NO_READER 0x10
61#define CM_BAD_CARD 0x20
62
63
64#endif /* _CM4000_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cn_proc.h+43-18
......@@ -30,6 +30,48 @@ enum proc_cn_mcast_op {
3030 PROC_CN_MCAST_IGNORE = 2
3131};
3232
33#define PROC_EVENT_ALL (PROC_EVENT_FORK | PROC_EVENT_EXEC | PROC_EVENT_UID | \
34 PROC_EVENT_GID | PROC_EVENT_SID | PROC_EVENT_PTRACE | \
35 PROC_EVENT_COMM | PROC_EVENT_NONZERO_EXIT | \
36 PROC_EVENT_COREDUMP | PROC_EVENT_EXIT)
37
38/*
39 * If you add an entry in proc_cn_event, make sure you add it in
40 * PROC_EVENT_ALL above as well.
41 */
42enum proc_cn_event {
43 /* Use successive bits so the enums can be used to record
44 * sets of events as well
45 */
46 PROC_EVENT_NONE = 0x00000000,
47 PROC_EVENT_FORK = 0x00000001,
48 PROC_EVENT_EXEC = 0x00000002,
49 PROC_EVENT_UID = 0x00000004,
50 PROC_EVENT_GID = 0x00000040,
51 PROC_EVENT_SID = 0x00000080,
52 PROC_EVENT_PTRACE = 0x00000100,
53 PROC_EVENT_COMM = 0x00000200,
54 /* "next" should be 0x00000400 */
55 /* "last" is the last process event: exit,
56 * while "next to last" is coredumping event
57 * before that is report only if process dies
58 * with non-zero exit status
59 */
60 PROC_EVENT_NONZERO_EXIT = 0x20000000,
61 PROC_EVENT_COREDUMP = 0x40000000,
62 PROC_EVENT_EXIT = 0x80000000
63};
64
65struct proc_input {
66 enum proc_cn_mcast_op mcast_op;
67 enum proc_cn_event event_type;
68};
69
70static __inline__ enum proc_cn_event valid_event(enum proc_cn_event ev_type)
71{
72 return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL);
73}
74
3375/*
3476 * From the user's point of view, the process
3577 * ID is the thread group ID and thread ID is the internal
......@@ -44,24 +86,7 @@ enum proc_cn_mcast_op {
4486 */
4587
4688struct proc_event {
47 enum what {
48 /* Use successive bits so the enums can be used to record
49 * sets of events as well
50 */
51 PROC_EVENT_NONE = 0x00000000,
52 PROC_EVENT_FORK = 0x00000001,
53 PROC_EVENT_EXEC = 0x00000002,
54 PROC_EVENT_UID = 0x00000004,
55 PROC_EVENT_GID = 0x00000040,
56 PROC_EVENT_SID = 0x00000080,
57 PROC_EVENT_PTRACE = 0x00000100,
58 PROC_EVENT_COMM = 0x00000200,
59 /* "next" should be 0x00000400 */
60 /* "last" is the last process event: exit,
61 * while "next to last" is coredumping event */
62 PROC_EVENT_COREDUMP = 0x40000000,
63 PROC_EVENT_EXIT = 0x80000000
64 } what;
89 enum proc_cn_event what;
6590 __u32 cpu;
6691 __u64 __attribute__((aligned(8))) timestamp_ns;
6792 /* Number of nano seconds since system boot */
lib/libc/include/any-linux-any/linux/counter.h+7-1
......@@ -38,7 +38,7 @@ enum counter_scope {
3838 *
3939 * For example, if the Count 2 ceiling extension of Counter device 4 is desired,
4040 * set type equal to COUNTER_COMPONENT_EXTENSION, scope equal to
41 * COUNTER_COUNT_SCOPE, parent equal to 2, and id equal to the value provided by
41 * COUNTER_SCOPE_COUNT, parent equal to 2, and id equal to the value provided by
4242 * the respective /sys/bus/counter/devices/counter4/count2/ceiling_component_id
4343 * sysfs attribute.
4444 */
......@@ -127,6 +127,12 @@ enum counter_count_mode {
127127 COUNTER_COUNT_MODE_RANGE_LIMIT,
128128 COUNTER_COUNT_MODE_NON_RECYCLE,
129129 COUNTER_COUNT_MODE_MODULO_N,
130 COUNTER_COUNT_MODE_INTERRUPT_ON_TERMINAL_COUNT,
131 COUNTER_COUNT_MODE_HARDWARE_RETRIGGERABLE_ONESHOT,
132 COUNTER_COUNT_MODE_RATE_GENERATOR,
133 COUNTER_COUNT_MODE_SQUARE_WAVE_MODE,
134 COUNTER_COUNT_MODE_SOFTWARE_TRIGGERED_STROBE,
135 COUNTER_COUNT_MODE_HARDWARE_TRIGGERED_STROBE,
130136};
131137
132138/* Count function values */
lib/libc/include/any-linux-any/linux/cryptouser.h+19-11
......@@ -32,7 +32,7 @@ enum {
3232 CRYPTO_MSG_UPDATEALG,
3333 CRYPTO_MSG_GETALG,
3434 CRYPTO_MSG_DELRNG,
35 CRYPTO_MSG_GETSTAT,
35 CRYPTO_MSG_GETSTAT, /* No longer supported, do not use. */
3636 __CRYPTO_MSG_MAX
3737};
3838#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
......@@ -54,16 +54,16 @@ enum crypto_attr_type_t {
5454 CRYPTOCFGA_REPORT_AKCIPHER, /* struct crypto_report_akcipher */
5555 CRYPTOCFGA_REPORT_KPP, /* struct crypto_report_kpp */
5656 CRYPTOCFGA_REPORT_ACOMP, /* struct crypto_report_acomp */
57 CRYPTOCFGA_STAT_LARVAL, /* struct crypto_stat */
58 CRYPTOCFGA_STAT_HASH, /* struct crypto_stat */
59 CRYPTOCFGA_STAT_BLKCIPHER, /* struct crypto_stat */
60 CRYPTOCFGA_STAT_AEAD, /* struct crypto_stat */
61 CRYPTOCFGA_STAT_COMPRESS, /* struct crypto_stat */
62 CRYPTOCFGA_STAT_RNG, /* struct crypto_stat */
63 CRYPTOCFGA_STAT_CIPHER, /* struct crypto_stat */
64 CRYPTOCFGA_STAT_AKCIPHER, /* struct crypto_stat */
65 CRYPTOCFGA_STAT_KPP, /* struct crypto_stat */
66 CRYPTOCFGA_STAT_ACOMP, /* struct crypto_stat */
57 CRYPTOCFGA_STAT_LARVAL, /* No longer supported, do not use. */
58 CRYPTOCFGA_STAT_HASH, /* No longer supported, do not use. */
59 CRYPTOCFGA_STAT_BLKCIPHER, /* No longer supported, do not use. */
60 CRYPTOCFGA_STAT_AEAD, /* No longer supported, do not use. */
61 CRYPTOCFGA_STAT_COMPRESS, /* No longer supported, do not use. */
62 CRYPTOCFGA_STAT_RNG, /* No longer supported, do not use. */
63 CRYPTOCFGA_STAT_CIPHER, /* No longer supported, do not use. */
64 CRYPTOCFGA_STAT_AKCIPHER, /* No longer supported, do not use. */
65 CRYPTOCFGA_STAT_KPP, /* No longer supported, do not use. */
66 CRYPTOCFGA_STAT_ACOMP, /* No longer supported, do not use. */
6767 __CRYPTOCFGA_MAX
6868
6969#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
......@@ -79,6 +79,7 @@ struct crypto_user_alg {
7979 __u32 cru_flags;
8080};
8181
82/* No longer supported, do not use. */
8283struct crypto_stat_aead {
8384 char type[CRYPTO_MAX_NAME];
8485 __u64 stat_encrypt_cnt;
......@@ -88,6 +89,7 @@ struct crypto_stat_aead {
8889 __u64 stat_err_cnt;
8990};
9091
92/* No longer supported, do not use. */
9193struct crypto_stat_akcipher {
9294 char type[CRYPTO_MAX_NAME];
9395 __u64 stat_encrypt_cnt;
......@@ -99,6 +101,7 @@ struct crypto_stat_akcipher {
99101 __u64 stat_err_cnt;
100102};
101103
104/* No longer supported, do not use. */
102105struct crypto_stat_cipher {
103106 char type[CRYPTO_MAX_NAME];
104107 __u64 stat_encrypt_cnt;
......@@ -108,6 +111,7 @@ struct crypto_stat_cipher {
108111 __u64 stat_err_cnt;
109112};
110113
114/* No longer supported, do not use. */
111115struct crypto_stat_compress {
112116 char type[CRYPTO_MAX_NAME];
113117 __u64 stat_compress_cnt;
......@@ -117,6 +121,7 @@ struct crypto_stat_compress {
117121 __u64 stat_err_cnt;
118122};
119123
124/* No longer supported, do not use. */
120125struct crypto_stat_hash {
121126 char type[CRYPTO_MAX_NAME];
122127 __u64 stat_hash_cnt;
......@@ -124,6 +129,7 @@ struct crypto_stat_hash {
124129 __u64 stat_err_cnt;
125130};
126131
132/* No longer supported, do not use. */
127133struct crypto_stat_kpp {
128134 char type[CRYPTO_MAX_NAME];
129135 __u64 stat_setsecret_cnt;
......@@ -132,6 +138,7 @@ struct crypto_stat_kpp {
132138 __u64 stat_err_cnt;
133139};
134140
141/* No longer supported, do not use. */
135142struct crypto_stat_rng {
136143 char type[CRYPTO_MAX_NAME];
137144 __u64 stat_generate_cnt;
......@@ -140,6 +147,7 @@ struct crypto_stat_rng {
140147 __u64 stat_err_cnt;
141148};
142149
150/* No longer supported, do not use. */
143151struct crypto_stat_larval {
144152 char type[CRYPTO_MAX_NAME];
145153};
lib/libc/include/any-linux-any/linux/cxl_mem.h+34-5
......@@ -40,19 +40,26 @@
4040 ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), \
4141 ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), \
4242 ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), \
43 ___C(GET_POISON, "Get Poison List"), \
44 ___C(INJECT_POISON, "Inject Poison"), \
45 ___C(CLEAR_POISON, "Clear Poison"), \
43 ___DEPRECATED(GET_POISON, "Get Poison List"), \
44 ___DEPRECATED(INJECT_POISON, "Inject Poison"), \
45 ___DEPRECATED(CLEAR_POISON, "Clear Poison"), \
4646 ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), \
47 ___C(SCAN_MEDIA, "Scan Media"), \
48 ___C(GET_SCAN_MEDIA, "Get Scan Media Results"), \
47 ___DEPRECATED(SCAN_MEDIA, "Scan Media"), \
48 ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), \
49 ___C(GET_TIMESTAMP, "Get Timestamp"), \
50 ___C(GET_LOG_CAPS, "Get Log Capabilities"), \
51 ___C(CLEAR_LOG, "Clear Log"), \
52 ___C(GET_SUP_LOG_SUBLIST, "Get Supported Logs Sub-List"), \
4953 ___C(MAX, "invalid / last command")
5054
5155#define ___C(a, b) CXL_MEM_COMMAND_ID_##a
56#define ___DEPRECATED(a, b) CXL_MEM_DEPRECATED_ID_##a
5257enum { CXL_CMDS };
5358
5459#undef ___C
60#undef ___DEPRECATED
5561#define ___C(a, b) { b }
62#define ___DEPRECATED(a, b) { "Deprecated " b }
5663static const struct {
5764 const char *name;
5865} cxl_command_names[] __attribute__((__unused__)) = { CXL_CMDS };
......@@ -68,6 +75,28 @@ static const struct {
6875 */
6976
7077#undef ___C
78#undef ___DEPRECATED
79#define ___C(a, b) (0)
80#define ___DEPRECATED(a, b) (1)
81
82static const __u8 cxl_deprecated_commands[]
83 __attribute__((__unused__)) = { CXL_CMDS };
84
85/*
86 * Here's how this actually breaks out:
87 * cxl_deprecated_commands[] = {
88 * [CXL_MEM_COMMAND_ID_INVALID] = 0,
89 * [CXL_MEM_COMMAND_ID_IDENTIFY] = 0,
90 * ...
91 * [CXL_MEM_DEPRECATED_ID_GET_POISON] = 1,
92 * [CXL_MEM_DEPRECATED_ID_INJECT_POISON] = 1,
93 * [CXL_MEM_DEPRECATED_ID_CLEAR_POISON] = 1,
94 * ...
95 * };
96 */
97
98#undef ___C
99#undef ___DEPRECATED
71100
72101/**
73102 * struct cxl_command_info - Command information returned from a query.
lib/libc/include/any-linux-any/linux/devlink.h+13-2
......@@ -139,6 +139,8 @@ enum devlink_command {
139139 DEVLINK_CMD_SELFTESTS_GET, /* can dump */
140140 DEVLINK_CMD_SELFTESTS_RUN,
141141
142 DEVLINK_CMD_NOTIFY_FILTER_SET,
143
142144 /* add new commands above here */
143145 __DEVLINK_CMD_MAX,
144146 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
......@@ -265,7 +267,7 @@ enum {
265267 * Documentation/networking/devlink/devlink-flash.rst
266268 *
267269 */
268enum {
270enum devlink_flash_overwrite {
269271 DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT,
270272 DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT,
271273
......@@ -612,7 +614,10 @@ enum devlink_attr {
612614
613615 DEVLINK_ATTR_REGION_DIRECT, /* flag */
614616
615 /* add new attributes above here, update the policy in devlink.c */
617 /* Add new attributes above here, update the spec in
618 * Documentation/netlink/specs/devlink.yaml and re-generate
619 * net/devlink/netlink_gen.c.
620 */
616621
617622 __DEVLINK_ATTR_MAX,
618623 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
......@@ -661,6 +666,8 @@ enum devlink_resource_unit {
661666enum devlink_port_fn_attr_cap {
662667 DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT,
663668 DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT,
669 DEVLINK_PORT_FN_ATTR_CAP_IPSEC_CRYPTO_BIT,
670 DEVLINK_PORT_FN_ATTR_CAP_IPSEC_PACKET_BIT,
664671
665672 /* Add new caps above */
666673 __DEVLINK_PORT_FN_ATTR_CAPS_MAX,
......@@ -669,6 +676,8 @@ enum devlink_port_fn_attr_cap {
669676#define DEVLINK_PORT_FN_CAP_ROCE _BITUL(DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT)
670677#define DEVLINK_PORT_FN_CAP_MIGRATABLE \
671678 _BITUL(DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT)
679#define DEVLINK_PORT_FN_CAP_IPSEC_CRYPTO _BITUL(DEVLINK_PORT_FN_ATTR_CAP_IPSEC_CRYPTO_BIT)
680#define DEVLINK_PORT_FN_CAP_IPSEC_PACKET _BITUL(DEVLINK_PORT_FN_ATTR_CAP_IPSEC_PACKET_BIT)
672681
673682enum devlink_port_function_attr {
674683 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
......@@ -676,6 +685,8 @@ enum devlink_port_function_attr {
676685 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */
677686 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */
678687 DEVLINK_PORT_FN_ATTR_CAPS, /* bitfield32 */
688 DEVLINK_PORT_FN_ATTR_DEVLINK, /* nested */
689 DEVLINK_PORT_FN_ATTR_MAX_IO_EQS, /* u32 */
679690
680691 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
681692 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
lib/libc/include/any-linux-any/linux/dlm.h+1
......@@ -68,6 +68,7 @@ struct dlm_lksb {
6868
6969/* dlm_new_lockspace() flags */
7070
71/* DLM_LSFL_TIMEWARN is deprecated and reserved. DO NOT USE! */
7172#define DLM_LSFL_TIMEWARN 0x00000002
7273#define DLM_LSFL_NEWEXCL 0x00000008
7374
lib/libc/include/any-linux-any/linux/dlm_netlink.h deleted-60
......@@ -1,60 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License v.2.
8 */
9
10#ifndef _DLM_NETLINK_H
11#define _DLM_NETLINK_H
12
13#include <linux/types.h>
14#include <linux/dlmconstants.h>
15
16enum {
17 DLM_STATUS_WAITING = 1,
18 DLM_STATUS_GRANTED = 2,
19 DLM_STATUS_CONVERT = 3,
20};
21
22#define DLM_LOCK_DATA_VERSION 1
23
24struct dlm_lock_data {
25 __u16 version;
26 __u32 lockspace_id;
27 int nodeid;
28 int ownpid;
29 __u32 id;
30 __u32 remid;
31 __u64 xid;
32 __s8 status;
33 __s8 grmode;
34 __s8 rqmode;
35 unsigned long timestamp;
36 int resource_namelen;
37 char resource_name[DLM_RESNAME_MAXLEN];
38};
39
40enum {
41 DLM_CMD_UNSPEC = 0,
42 DLM_CMD_HELLO, /* user->kernel */
43 DLM_CMD_TIMEOUT, /* kernel->user */
44 __DLM_CMD_MAX,
45};
46
47#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
48
49enum {
50 DLM_TYPE_UNSPEC = 0,
51 DLM_TYPE_LOCK,
52 __DLM_TYPE_MAX,
53};
54
55#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
56
57#define DLM_GENL_VERSION 0x1
58#define DLM_GENL_NAME "DLM"
59
60#endif /* _DLM_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dlm_plock.h+1
......@@ -22,6 +22,7 @@ enum {
2222 DLM_PLOCK_OP_LOCK = 1,
2323 DLM_PLOCK_OP_UNLOCK,
2424 DLM_PLOCK_OP_GET,
25 DLM_PLOCK_OP_CANCEL,
2526};
2627
2728#define DLM_PLOCK_FL_CLOSE 1
lib/libc/include/any-linux-any/linux/dlmconstants.h+4-1
......@@ -87,7 +87,6 @@
8787 * DLM_LKF_NODLCKWT
8888 *
8989 * Do not cancel the lock if it gets into conversion deadlock.
90 * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
9190 *
9291 * DLM_LKF_NODLCKBLK
9392 *
......@@ -132,6 +131,10 @@
132131 * Unlock the lock even if it is converting or waiting or has sublocks.
133132 * Only really for use by the userland device.c code.
134133 *
134 * DLM_LKF_TIMEOUT
135 *
136 * This value is deprecated and reserved. DO NOT USE!
137 *
135138 */
136139
137140#define DLM_LKF_NOQUEUE 0x00000001
lib/libc/include/any-linux-any/linux/dm-ioctl.h+2-2
......@@ -286,9 +286,9 @@ enum {
286286#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
287287
288288#define DM_VERSION_MAJOR 4
289#define DM_VERSION_MINOR 47
289#define DM_VERSION_MINOR 48
290290#define DM_VERSION_PATCHLEVEL 0
291#define DM_VERSION_EXTRA "-ioctl (2022-07-28)"
291#define DM_VERSION_EXTRA "-ioctl (2023-03-01)"
292292
293293/* Status bits */
294294#define DM_READONLY_FLAG (1 << 0) /* In/Out */
lib/libc/include/any-linux-any/linux/dpll.h created+238
......@@ -0,0 +1,238 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/dpll.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_DPLL_H
7#define _LINUX_DPLL_H
8
9#define DPLL_FAMILY_NAME "dpll"
10#define DPLL_FAMILY_VERSION 1
11
12/**
13 * enum dpll_mode - working modes a dpll can support, differentiates if and how
14 * dpll selects one of its inputs to syntonize with it, valid values for
15 * DPLL_A_MODE attribute
16 * @DPLL_MODE_MANUAL: input can be only selected by sending a request to dpll
17 * @DPLL_MODE_AUTOMATIC: highest prio input pin auto selected by dpll
18 */
19enum dpll_mode {
20 DPLL_MODE_MANUAL = 1,
21 DPLL_MODE_AUTOMATIC,
22
23 /* private: */
24 __DPLL_MODE_MAX,
25 DPLL_MODE_MAX = (__DPLL_MODE_MAX - 1)
26};
27
28/**
29 * enum dpll_lock_status - provides information of dpll device lock status,
30 * valid values for DPLL_A_LOCK_STATUS attribute
31 * @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input (or
32 * forced by setting DPLL_A_MODE to DPLL_MODE_DETACHED)
33 * @DPLL_LOCK_STATUS_LOCKED: dpll is locked to a valid signal, but no holdover
34 * available
35 * @DPLL_LOCK_STATUS_LOCKED_HO_ACQ: dpll is locked and holdover acquired
36 * @DPLL_LOCK_STATUS_HOLDOVER: dpll is in holdover state - lost a valid lock or
37 * was forced by disconnecting all the pins (latter possible only when dpll
38 * lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ, if dpll lock-state
39 * was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the dpll's lock-state shall remain
40 * DPLL_LOCK_STATUS_UNLOCKED)
41 */
42enum dpll_lock_status {
43 DPLL_LOCK_STATUS_UNLOCKED = 1,
44 DPLL_LOCK_STATUS_LOCKED,
45 DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
46 DPLL_LOCK_STATUS_HOLDOVER,
47
48 /* private: */
49 __DPLL_LOCK_STATUS_MAX,
50 DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1)
51};
52
53/**
54 * enum dpll_lock_status_error - if previous status change was done due to a
55 * failure, this provides information of dpll device lock status error. Valid
56 * values for DPLL_A_LOCK_STATUS_ERROR attribute
57 * @DPLL_LOCK_STATUS_ERROR_NONE: dpll device lock status was changed without
58 * any error
59 * @DPLL_LOCK_STATUS_ERROR_UNDEFINED: dpll device lock status was changed due
60 * to undefined error. Driver fills this value up in case it is not able to
61 * obtain suitable exact error type.
62 * @DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN: dpll device lock status was changed
63 * because of associated media got down. This may happen for example if dpll
64 * device was previously locked on an input pin of type
65 * PIN_TYPE_SYNCE_ETH_PORT.
66 * @DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH: the FFO
67 * (Fractional Frequency Offset) between the RX and TX symbol rate on the
68 * media got too high. This may happen for example if dpll device was
69 * previously locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
70 */
71enum dpll_lock_status_error {
72 DPLL_LOCK_STATUS_ERROR_NONE = 1,
73 DPLL_LOCK_STATUS_ERROR_UNDEFINED,
74 DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN,
75 DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH,
76
77 /* private: */
78 __DPLL_LOCK_STATUS_ERROR_MAX,
79 DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
80};
81
82#define DPLL_TEMP_DIVIDER 1000
83
84/**
85 * enum dpll_type - type of dpll, valid values for DPLL_A_TYPE attribute
86 * @DPLL_TYPE_PPS: dpll produces Pulse-Per-Second signal
87 * @DPLL_TYPE_EEC: dpll drives the Ethernet Equipment Clock
88 */
89enum dpll_type {
90 DPLL_TYPE_PPS = 1,
91 DPLL_TYPE_EEC,
92
93 /* private: */
94 __DPLL_TYPE_MAX,
95 DPLL_TYPE_MAX = (__DPLL_TYPE_MAX - 1)
96};
97
98/**
99 * enum dpll_pin_type - defines possible types of a pin, valid values for
100 * DPLL_A_PIN_TYPE attribute
101 * @DPLL_PIN_TYPE_MUX: aggregates another layer of selectable pins
102 * @DPLL_PIN_TYPE_EXT: external input
103 * @DPLL_PIN_TYPE_SYNCE_ETH_PORT: ethernet port PHY's recovered clock
104 * @DPLL_PIN_TYPE_INT_OSCILLATOR: device internal oscillator
105 * @DPLL_PIN_TYPE_GNSS: GNSS recovered clock
106 */
107enum dpll_pin_type {
108 DPLL_PIN_TYPE_MUX = 1,
109 DPLL_PIN_TYPE_EXT,
110 DPLL_PIN_TYPE_SYNCE_ETH_PORT,
111 DPLL_PIN_TYPE_INT_OSCILLATOR,
112 DPLL_PIN_TYPE_GNSS,
113
114 /* private: */
115 __DPLL_PIN_TYPE_MAX,
116 DPLL_PIN_TYPE_MAX = (__DPLL_PIN_TYPE_MAX - 1)
117};
118
119/**
120 * enum dpll_pin_direction - defines possible direction of a pin, valid values
121 * for DPLL_A_PIN_DIRECTION attribute
122 * @DPLL_PIN_DIRECTION_INPUT: pin used as a input of a signal
123 * @DPLL_PIN_DIRECTION_OUTPUT: pin used to output the signal
124 */
125enum dpll_pin_direction {
126 DPLL_PIN_DIRECTION_INPUT = 1,
127 DPLL_PIN_DIRECTION_OUTPUT,
128
129 /* private: */
130 __DPLL_PIN_DIRECTION_MAX,
131 DPLL_PIN_DIRECTION_MAX = (__DPLL_PIN_DIRECTION_MAX - 1)
132};
133
134#define DPLL_PIN_FREQUENCY_1_HZ 1
135#define DPLL_PIN_FREQUENCY_10_KHZ 10000
136#define DPLL_PIN_FREQUENCY_77_5_KHZ 77500
137#define DPLL_PIN_FREQUENCY_10_MHZ 10000000
138
139/**
140 * enum dpll_pin_state - defines possible states of a pin, valid values for
141 * DPLL_A_PIN_STATE attribute
142 * @DPLL_PIN_STATE_CONNECTED: pin connected, active input of phase locked loop
143 * @DPLL_PIN_STATE_DISCONNECTED: pin disconnected, not considered as a valid
144 * input
145 * @DPLL_PIN_STATE_SELECTABLE: pin enabled for automatic input selection
146 */
147enum dpll_pin_state {
148 DPLL_PIN_STATE_CONNECTED = 1,
149 DPLL_PIN_STATE_DISCONNECTED,
150 DPLL_PIN_STATE_SELECTABLE,
151
152 /* private: */
153 __DPLL_PIN_STATE_MAX,
154 DPLL_PIN_STATE_MAX = (__DPLL_PIN_STATE_MAX - 1)
155};
156
157/**
158 * enum dpll_pin_capabilities - defines possible capabilities of a pin, valid
159 * flags on DPLL_A_PIN_CAPABILITIES attribute
160 * @DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE: pin direction can be changed
161 * @DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE: pin priority can be changed
162 * @DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE: pin state can be changed
163 */
164enum dpll_pin_capabilities {
165 DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE = 1,
166 DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE = 2,
167 DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE = 4,
168};
169
170#define DPLL_PHASE_OFFSET_DIVIDER 1000
171
172enum dpll_a {
173 DPLL_A_ID = 1,
174 DPLL_A_MODULE_NAME,
175 DPLL_A_PAD,
176 DPLL_A_CLOCK_ID,
177 DPLL_A_MODE,
178 DPLL_A_MODE_SUPPORTED,
179 DPLL_A_LOCK_STATUS,
180 DPLL_A_TEMP,
181 DPLL_A_TYPE,
182 DPLL_A_LOCK_STATUS_ERROR,
183
184 __DPLL_A_MAX,
185 DPLL_A_MAX = (__DPLL_A_MAX - 1)
186};
187
188enum dpll_a_pin {
189 DPLL_A_PIN_ID = 1,
190 DPLL_A_PIN_PARENT_ID,
191 DPLL_A_PIN_MODULE_NAME,
192 DPLL_A_PIN_PAD,
193 DPLL_A_PIN_CLOCK_ID,
194 DPLL_A_PIN_BOARD_LABEL,
195 DPLL_A_PIN_PANEL_LABEL,
196 DPLL_A_PIN_PACKAGE_LABEL,
197 DPLL_A_PIN_TYPE,
198 DPLL_A_PIN_DIRECTION,
199 DPLL_A_PIN_FREQUENCY,
200 DPLL_A_PIN_FREQUENCY_SUPPORTED,
201 DPLL_A_PIN_FREQUENCY_MIN,
202 DPLL_A_PIN_FREQUENCY_MAX,
203 DPLL_A_PIN_PRIO,
204 DPLL_A_PIN_STATE,
205 DPLL_A_PIN_CAPABILITIES,
206 DPLL_A_PIN_PARENT_DEVICE,
207 DPLL_A_PIN_PARENT_PIN,
208 DPLL_A_PIN_PHASE_ADJUST_MIN,
209 DPLL_A_PIN_PHASE_ADJUST_MAX,
210 DPLL_A_PIN_PHASE_ADJUST,
211 DPLL_A_PIN_PHASE_OFFSET,
212 DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET,
213
214 __DPLL_A_PIN_MAX,
215 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
216};
217
218enum dpll_cmd {
219 DPLL_CMD_DEVICE_ID_GET = 1,
220 DPLL_CMD_DEVICE_GET,
221 DPLL_CMD_DEVICE_SET,
222 DPLL_CMD_DEVICE_CREATE_NTF,
223 DPLL_CMD_DEVICE_DELETE_NTF,
224 DPLL_CMD_DEVICE_CHANGE_NTF,
225 DPLL_CMD_PIN_ID_GET,
226 DPLL_CMD_PIN_GET,
227 DPLL_CMD_PIN_SET,
228 DPLL_CMD_PIN_CREATE_NTF,
229 DPLL_CMD_PIN_DELETE_NTF,
230 DPLL_CMD_PIN_CHANGE_NTF,
231
232 __DPLL_CMD_MAX,
233 DPLL_CMD_MAX = (__DPLL_CMD_MAX - 1)
234};
235
236#define DPLL_MCGRP_MONITOR "monitor"
237
238#endif /* _LINUX_DPLL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dvb/frontend.h+9-1
......@@ -296,6 +296,10 @@ enum fe_spectral_inversion {
296296 * @FEC_28_45: Forward Error Correction Code 28/45
297297 * @FEC_32_45: Forward Error Correction Code 32/45
298298 * @FEC_77_90: Forward Error Correction Code 77/90
299 * @FEC_11_45: Forward Error Correction Code 11/45
300 * @FEC_4_15: Forward Error Correction Code 4/15
301 * @FEC_14_45: Forward Error Correction Code 14/45
302 * @FEC_7_15: Forward Error Correction Code 7/15
299303 *
300304 * Please note that not all FEC types are supported by a given standard.
301305 */
......@@ -329,6 +333,10 @@ enum fe_code_rate {
329333 FEC_28_45,
330334 FEC_32_45,
331335 FEC_77_90,
336 FEC_11_45,
337 FEC_4_15,
338 FEC_14_45,
339 FEC_7_15,
332340};
333341
334342/**
......@@ -846,7 +854,7 @@ struct dtv_stats {
846854 union {
847855 __u64 uvalue; /* for counters and relative scales */
848856 __s64 svalue; /* for 0.001 dB measures */
849 };
857 } __attribute__ ((packed));
850858} __attribute__ ((packed));
851859
852860
lib/libc/include/any-linux-any/linux/dvb/version.h+1-1
......@@ -10,6 +10,6 @@
1010#define _DVBVERSION_H_
1111
1212#define DVB_API_VERSION 5
13#define DVB_API_VERSION_MINOR 11
13#define DVB_API_VERSION_MINOR 12
1414
1515#endif /*_DVBVERSION_H_*/
\ No newline at end of file
lib/libc/include/any-linux-any/linux/elf-fdpic.h+15
......@@ -32,4 +32,19 @@ struct elf32_fdpic_loadmap {
3232
3333#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
3434
35/* segment mappings for ELF FDPIC libraries/executables/interpreters */
36struct elf64_fdpic_loadseg {
37 Elf64_Addr addr; /* core address to which mapped */
38 Elf64_Addr p_vaddr; /* VMA recorded in file */
39 Elf64_Word p_memsz; /* allocation size recorded in file */
40};
41
42struct elf64_fdpic_loadmap {
43 Elf64_Half version; /* version of these structures, just in case... */
44 Elf64_Half nsegs; /* number of segments */
45 struct elf64_fdpic_loadseg segs[];
46};
47
48#define ELF64_FDPIC_LOADMAP_VERSION 0x0000
49
3550#endif /* _LINUX_ELF_FDPIC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/elf.h+10-2
......@@ -140,7 +140,7 @@ typedef __s64 Elf64_Sxword;
140140#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
141141#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
142142
143typedef struct dynamic {
143typedef struct {
144144 Elf32_Sword d_tag;
145145 union {
146146 Elf32_Sword d_val;
......@@ -372,7 +372,8 @@ typedef struct elf64_shdr {
372372 * Notes used in ET_CORE. Architectures export some of the arch register sets
373373 * using the corresponding note types via the PTRACE_GETREGSET and
374374 * PTRACE_SETREGSET requests.
375 * The note name for all these is "LINUX".
375 * The note name for these types is "LINUX", except NT_PRFPREG that is named
376 * "CORE".
376377 */
377378#define NT_PRSTATUS 1
378379#define NT_PRFPREG 2
......@@ -403,9 +404,13 @@ typedef struct elf64_shdr {
403404#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */
404405#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */
405406#define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */
407#define NT_PPC_DEXCR 0x111 /* PowerPC DEXCR registers */
408#define NT_PPC_HASHKEYR 0x112 /* PowerPC HASHKEYR register */
406409#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
407410#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
408411#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
412/* Old binutils treats 0x203 as a CET state */
413#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
409414#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
410415#define NT_S390_TIMER 0x301 /* s390 timer register */
411416#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
......@@ -435,11 +440,14 @@ typedef struct elf64_shdr {
435440#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers */
436441#define NT_ARM_ZA 0x40c /* ARM SME ZA registers */
437442#define NT_ARM_ZT 0x40d /* ARM SME ZT registers */
443#define NT_ARM_FPMR 0x40e /* ARM floating point mode register */
438444#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
439445#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
440446#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
441447#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
442448#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
449#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
450#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
443451#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */
444452#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */
445453#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */
lib/libc/include/any-linux-any/linux/ethtool.h+131-13
......@@ -750,6 +750,61 @@ enum ethtool_module_power_mode {
750750 ETHTOOL_MODULE_POWER_MODE_HIGH,
751751};
752752
753/**
754 * enum ethtool_pse_types - Types of PSE controller.
755 * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown
756 * @ETHTOOL_PSE_PODL: PSE controller which support PoDL
757 * @ETHTOOL_PSE_C33: PSE controller which support Clause 33 (PoE)
758 */
759enum ethtool_pse_types {
760 ETHTOOL_PSE_UNKNOWN = 1 << 0,
761 ETHTOOL_PSE_PODL = 1 << 1,
762 ETHTOOL_PSE_C33 = 1 << 2,
763};
764
765/**
766 * enum ethtool_c33_pse_admin_state - operational state of the PoDL PSE
767 * functions. IEEE 802.3-2022 30.9.1.1.2 aPSEAdminState
768 * @ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN: state of PSE functions is unknown
769 * @ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED: PSE functions are disabled
770 * @ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED: PSE functions are enabled
771 */
772enum ethtool_c33_pse_admin_state {
773 ETHTOOL_C33_PSE_ADMIN_STATE_UNKNOWN = 1,
774 ETHTOOL_C33_PSE_ADMIN_STATE_DISABLED,
775 ETHTOOL_C33_PSE_ADMIN_STATE_ENABLED,
776};
777
778/**
779 * enum ethtool_c33_pse_pw_d_status - power detection status of the PSE.
780 * IEEE 802.3-2022 30.9.1.1.3 aPoDLPSEPowerDetectionStatus:
781 * @ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN: PSE status is unknown
782 * @ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED: The enumeration "disabled"
783 * indicates that the PSE State diagram is in the state DISABLED.
784 * @ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING: The enumeration "searching"
785 * indicates the PSE State diagram is in a state other than those
786 * listed.
787 * @ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING: The enumeration
788 * "deliveringPower" indicates that the PSE State diagram is in the
789 * state POWER_ON.
790 * @ETHTOOL_C33_PSE_PW_D_STATUS_TEST: The enumeration "test" indicates that
791 * the PSE State diagram is in the state TEST_MODE.
792 * @ETHTOOL_C33_PSE_PW_D_STATUS_FAULT: The enumeration "fault" indicates that
793 * the PSE State diagram is in the state TEST_ERROR.
794 * @ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT: The enumeration "otherFault"
795 * indicates that the PSE State diagram is in the state IDLE due to
796 * the variable error_condition = true.
797 */
798enum ethtool_c33_pse_pw_d_status {
799 ETHTOOL_C33_PSE_PW_D_STATUS_UNKNOWN = 1,
800 ETHTOOL_C33_PSE_PW_D_STATUS_DISABLED,
801 ETHTOOL_C33_PSE_PW_D_STATUS_SEARCHING,
802 ETHTOOL_C33_PSE_PW_D_STATUS_DELIVERING,
803 ETHTOOL_C33_PSE_PW_D_STATUS_TEST,
804 ETHTOOL_C33_PSE_PW_D_STATUS_FAULT,
805 ETHTOOL_C33_PSE_PW_D_STATUS_OTHERFAULT,
806};
807
753808/**
754809 * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE
755810 * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState
......@@ -1264,6 +1319,8 @@ struct ethtool_rxfh_indir {
12641319 * hardware hash key.
12651320 * @hfunc: Defines the current RSS hash function used by HW (or to be set to).
12661321 * Valid values are one of the %ETH_RSS_HASH_*.
1322 * @input_xfrm: Defines how the input data is transformed. Valid values are one
1323 * of %RXH_XFRM_*.
12671324 * @rsvd8: Reserved for future use; see the note on reserved space.
12681325 * @rsvd32: Reserved for future use; see the note on reserved space.
12691326 * @rss_config: RX ring/queue index for each hash value i.e., indirection table
......@@ -1283,7 +1340,8 @@ struct ethtool_rxfh {
12831340 __u32 indir_size;
12841341 __u32 key_size;
12851342 __u8 hfunc;
1286 __u8 rsvd8[3];
1343 __u8 input_xfrm;
1344 __u8 rsvd8[2];
12871345 __u32 rsvd32;
12881346 __u32 rss_config[];
12891347};
......@@ -1990,6 +2048,15 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
19902048
19912049#define WOL_MODE_COUNT 8
19922050
2051/* RSS hash function data
2052 * XOR the corresponding source and destination fields of each specified
2053 * protocol. Both copies of the XOR'ed fields are fed into the RSS and RXHASH
2054 * calculation. Note that this XORing reduces the input set entropy and could
2055 * be exploited to reduce the RSS queue spread.
2056 */
2057#define RXH_XFRM_SYM_XOR (1 << 0)
2058#define RXH_XFRM_NO_CHANGE 0xff
2059
19932060/* L2-L4 network traffic flow types */
19942061#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
19952062#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
......@@ -2009,6 +2076,53 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
20092076#define IPV4_FLOW 0x10 /* hash only */
20102077#define IPV6_FLOW 0x11 /* hash only */
20112078#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
2079
2080/* Used for GTP-U IPv4 and IPv6.
2081 * The format of GTP packets only includes
2082 * elements such as TEID and GTP version.
2083 * It is primarily intended for data communication of the UE.
2084 */
2085#define GTPU_V4_FLOW 0x13 /* hash only */
2086#define GTPU_V6_FLOW 0x14 /* hash only */
2087
2088/* Use for GTP-C IPv4 and v6.
2089 * The format of these GTP packets does not include TEID.
2090 * Primarily expected to be used for communication
2091 * to create sessions for UE data communication,
2092 * commonly referred to as CSR (Create Session Request).
2093 */
2094#define GTPC_V4_FLOW 0x15 /* hash only */
2095#define GTPC_V6_FLOW 0x16 /* hash only */
2096
2097/* Use for GTP-C IPv4 and v6.
2098 * Unlike GTPC_V4_FLOW, the format of these GTP packets includes TEID.
2099 * After session creation, it becomes this packet.
2100 * This is mainly used for requests to realize UE handover.
2101 */
2102#define GTPC_TEID_V4_FLOW 0x17 /* hash only */
2103#define GTPC_TEID_V6_FLOW 0x18 /* hash only */
2104
2105/* Use for GTP-U and extended headers for the PSC (PDU Session Container).
2106 * The format of these GTP packets includes TEID and QFI.
2107 * In 5G communication using UPF (User Plane Function),
2108 * data communication with this extended header is performed.
2109 */
2110#define GTPU_EH_V4_FLOW 0x19 /* hash only */
2111#define GTPU_EH_V6_FLOW 0x1a /* hash only */
2112
2113/* Use for GTP-U IPv4 and v6 PSC (PDU Session Container) extended headers.
2114 * This differs from GTPU_EH_V(4|6)_FLOW in that it is distinguished by
2115 * UL/DL included in the PSC.
2116 * There are differences in the data included based on Downlink/Uplink,
2117 * and can be used to distinguish packets.
2118 * The functions described so far are useful when you want to
2119 * handle communication from the mobile network in UPF, PGW, etc.
2120 */
2121#define GTPU_UL_V4_FLOW 0x1b /* hash only */
2122#define GTPU_UL_V6_FLOW 0x1c /* hash only */
2123#define GTPU_DL_V4_FLOW 0x1d /* hash only */
2124#define GTPU_DL_V6_FLOW 0x1e /* hash only */
2125
20122126/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
20132127#define FLOW_EXT 0x80000000
20142128#define FLOW_MAC_EXT 0x40000000
......@@ -2023,6 +2137,7 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
20232137#define RXH_IP_DST (1 << 5)
20242138#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
20252139#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
2140#define RXH_GTP_TEID (1 << 8) /* teid in case of GTP */
20262141#define RXH_DISCARD (1 << 31)
20272142
20282143#define RX_CLS_FLOW_DISC 0xffffffffffffffffULL
......@@ -2126,18 +2241,6 @@ enum ethtool_reset_flags {
21262241 * refused. For drivers: ignore this field (use kernel's
21272242 * __ETHTOOL_LINK_MODE_MASK_NBITS instead), any change to it will
21282243 * be overwritten by kernel.
2129 * @supported: Bitmap with each bit meaning given by
2130 * %ethtool_link_mode_bit_indices for the link modes, physical
2131 * connectors and other link features for which the interface
2132 * supports autonegotiation or auto-detection. Read-only.
2133 * @advertising: Bitmap with each bit meaning given by
2134 * %ethtool_link_mode_bit_indices for the link modes, physical
2135 * connectors and other link features that are advertised through
2136 * autonegotiation or enabled for auto-detection.
2137 * @lp_advertising: Bitmap with each bit meaning given by
2138 * %ethtool_link_mode_bit_indices for the link modes, and other
2139 * link features that the link partner advertised through
2140 * autonegotiation; 0 if unknown or not applicable. Read-only.
21412244 * @transceiver: Used to distinguish different possible PHY types,
21422245 * reported consistently by PHYLIB. Read-only.
21432246 * @master_slave_cfg: Master/slave port mode.
......@@ -2179,6 +2282,21 @@ enum ethtool_reset_flags {
21792282 * %set_link_ksettings() should validate all fields other than @cmd
21802283 * and @link_mode_masks_nwords that are not described as read-only or
21812284 * deprecated, and must ignore all fields described as read-only.
2285 *
2286 * @link_mode_masks is divided into three bitfields, each of length
2287 * @link_mode_masks_nwords:
2288 * - supported: Bitmap with each bit meaning given by
2289 * %ethtool_link_mode_bit_indices for the link modes, physical
2290 * connectors and other link features for which the interface
2291 * supports autonegotiation or auto-detection. Read-only.
2292 * - advertising: Bitmap with each bit meaning given by
2293 * %ethtool_link_mode_bit_indices for the link modes, physical
2294 * connectors and other link features that are advertised through
2295 * autonegotiation or enabled for auto-detection.
2296 * - lp_advertising: Bitmap with each bit meaning given by
2297 * %ethtool_link_mode_bit_indices for the link modes, and other
2298 * link features that the link partner advertised through
2299 * autonegotiation; 0 if unknown or not applicable. Read-only.
21822300 */
21832301struct ethtool_link_settings {
21842302 __u32 cmd;
lib/libc/include/any-linux-any/linux/ethtool_netlink.h+30-7
......@@ -117,12 +117,11 @@ enum {
117117
118118/* request header */
119119
120/* use compact bitsets in reply */
121#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0)
122/* provide optional reply for SET or ACT requests */
123#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1)
124/* request statistics, if supported by the driver */
125#define ETHTOOL_FLAG_STATS (1 << 2)
120enum ethtool_header_flags {
121 ETHTOOL_FLAG_COMPACT_BITSETS = 1 << 0, /* use compact bitsets in reply */
122 ETHTOOL_FLAG_OMIT_REPLY = 1 << 1, /* provide optional reply for SET or ACT requests */
123 ETHTOOL_FLAG_STATS = 1 << 2, /* request statistics, if supported by the driver */
124};
126125
127126#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
128127 ETHTOOL_FLAG_OMIT_REPLY | \
......@@ -357,6 +356,8 @@ enum {
357356 ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */
358357 ETHTOOL_A_RINGS_TX_PUSH, /* u8 */
359358 ETHTOOL_A_RINGS_RX_PUSH, /* u8 */
359 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN, /* u32 */
360 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX, /* u32 */
360361
361362 /* add new constants above here */
362363 __ETHTOOL_A_RINGS_CNT,
......@@ -476,12 +477,26 @@ enum {
476477 ETHTOOL_A_TSINFO_TX_TYPES, /* bitset */
477478 ETHTOOL_A_TSINFO_RX_FILTERS, /* bitset */
478479 ETHTOOL_A_TSINFO_PHC_INDEX, /* u32 */
480 ETHTOOL_A_TSINFO_STATS, /* nest - _A_TSINFO_STAT */
479481
480482 /* add new constants above here */
481483 __ETHTOOL_A_TSINFO_CNT,
482484 ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
483485};
484486
487enum {
488 ETHTOOL_A_TS_STAT_UNSPEC,
489
490 ETHTOOL_A_TS_STAT_TX_PKTS, /* uint */
491 ETHTOOL_A_TS_STAT_TX_LOST, /* uint */
492 ETHTOOL_A_TS_STAT_TX_ERR, /* uint */
493
494 /* add new constants above here */
495 __ETHTOOL_A_TS_STAT_CNT,
496 ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1)
497
498};
499
485500/* PHC VCLOCKS */
486501
487502enum {
......@@ -513,6 +528,10 @@ enum {
513528 ETHTOOL_A_CABLE_RESULT_CODE_OPEN,
514529 ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT,
515530 ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT,
531 /* detected reflection caused by the impedance discontinuity between
532 * a regular 100 Ohm cable and a part with the abnormal impedance value
533 */
534 ETHTOOL_A_CABLE_RESULT_CODE_IMPEDANCE_MISMATCH,
516535};
517536
518537enum {
......@@ -781,7 +800,7 @@ enum {
781800
782801 /* add new constants above here */
783802 __ETHTOOL_A_STATS_GRP_CNT,
784 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
803 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
785804};
786805
787806enum {
......@@ -893,6 +912,9 @@ enum {
893912 ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */
894913 ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */
895914 ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */
915 ETHTOOL_A_C33_PSE_ADMIN_STATE, /* u32 */
916 ETHTOOL_A_C33_PSE_ADMIN_CONTROL, /* u32 */
917 ETHTOOL_A_C33_PSE_PW_D_STATUS, /* u32 */
896918
897919 /* add new constants above here */
898920 __ETHTOOL_A_PSE_CNT,
......@@ -906,6 +928,7 @@ enum {
906928 ETHTOOL_A_RSS_HFUNC, /* u32 */
907929 ETHTOOL_A_RSS_INDIR, /* binary */
908930 ETHTOOL_A_RSS_HKEY, /* binary */
931 ETHTOOL_A_RSS_INPUT_XFRM, /* u32 */
909932
910933 __ETHTOOL_A_RSS_CNT,
911934 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
lib/libc/include/any-linux-any/linux/eventfd.h created+11
......@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_EVENTFD_H
3#define _LINUX_EVENTFD_H
4
5#include <linux/fcntl.h>
6
7#define EFD_SEMAPHORE (1 << 0)
8#define EFD_CLOEXEC O_CLOEXEC
9#define EFD_NONBLOCK O_NONBLOCK
10
11#endif /* _LINUX_EVENTFD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/eventpoll.h+13-12
......@@ -85,16 +85,17 @@ struct epoll_event {
8585 __u64 data;
8686} EPOLL_PACKED;
8787
88#ifdef CONFIG_PM_SLEEP
89static __inline__ void ep_take_care_of_epollwakeup(struct epoll_event *epev)
90{
91 if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
92 epev->events &= ~EPOLLWAKEUP;
93}
94#else
95static __inline__ void ep_take_care_of_epollwakeup(struct epoll_event *epev)
96{
97 epev->events &= ~EPOLLWAKEUP;
98}
99#endif
88struct epoll_params {
89 __u32 busy_poll_usecs;
90 __u16 busy_poll_budget;
91 __u8 prefer_busy_poll;
92
93 /* pad the struct to a multiple of 64bits */
94 __u8 __pad;
95};
96
97#define EPOLL_IOC_TYPE 0x8A
98#define EPIOCSPARAMS _IOW(EPOLL_IOC_TYPE, 0x01, struct epoll_params)
99#define EPIOCGPARAMS _IOR(EPOLL_IOC_TYPE, 0x02, struct epoll_params)
100
100101#endif /* _LINUX_EVENTPOLL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ext4.h created+117
......@@ -0,0 +1,117 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_EXT4_H
4#define _LINUX_EXT4_H
5#include <linux/fiemap.h>
6#include <linux/fs.h>
7#include <linux/ioctl.h>
8#include <linux/types.h>
9
10/*
11 * ext4-specific ioctl commands
12 */
13#define EXT4_IOC_GETVERSION _IOR('f', 3, long)
14#define EXT4_IOC_SETVERSION _IOW('f', 4, long)
15#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
16#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
17#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
18#define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
19#define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
20#define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
21#define EXT4_IOC_MIGRATE _IO('f', 9)
22 /* note ioctl 10 reserved for an early version of the FIEMAP ioctl */
23 /* note ioctl 11 reserved for filesystem-independent FIEMAP ioctl */
24#define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
25#define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
26#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
27#define EXT4_IOC_SWAP_BOOT _IO('f', 17)
28#define EXT4_IOC_PRECACHE_EXTENTS _IO('f', 18)
29/* ioctl codes 19--39 are reserved for fscrypt */
30#define EXT4_IOC_CLEAR_ES_CACHE _IO('f', 40)
31#define EXT4_IOC_GETSTATE _IOW('f', 41, __u32)
32#define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap)
33#define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
34#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
35#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
36
37#define EXT4_IOC_SHUTDOWN _IOR('X', 125, __u32)
38
39/*
40 * ioctl commands in 32 bit emulation
41 */
42#define EXT4_IOC32_GETVERSION _IOR('f', 3, int)
43#define EXT4_IOC32_SETVERSION _IOW('f', 4, int)
44#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
45#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
46#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
47#define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input)
48#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
49#define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
50
51/*
52 * Flags returned by EXT4_IOC_GETSTATE
53 *
54 * We only expose to userspace a subset of the state flags in
55 * i_state_flags
56 */
57#define EXT4_STATE_FLAG_EXT_PRECACHED 0x00000001
58#define EXT4_STATE_FLAG_NEW 0x00000002
59#define EXT4_STATE_FLAG_NEWENTRY 0x00000004
60#define EXT4_STATE_FLAG_DA_ALLOC_CLOSE 0x00000008
61
62/*
63 * Flags for ioctl EXT4_IOC_CHECKPOINT
64 */
65#define EXT4_IOC_CHECKPOINT_FLAG_DISCARD 0x1
66#define EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT 0x2
67#define EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN 0x4
68#define EXT4_IOC_CHECKPOINT_FLAG_VALID (EXT4_IOC_CHECKPOINT_FLAG_DISCARD | \
69 EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | \
70 EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN)
71
72/*
73 * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID
74 */
75struct fsuuid {
76 __u32 fsu_len;
77 __u32 fsu_flags;
78 __u8 fsu_uuid[];
79};
80
81/*
82 * Structure for EXT4_IOC_MOVE_EXT
83 */
84struct move_extent {
85 __u32 reserved; /* should be zero */
86 __u32 donor_fd; /* donor file descriptor */
87 __u64 orig_start; /* logical start offset in block for orig */
88 __u64 donor_start; /* logical start offset in block for donor */
89 __u64 len; /* block length to be moved */
90 __u64 moved_len; /* moved block length */
91};
92
93/*
94 * Flags used by EXT4_IOC_SHUTDOWN
95 */
96#define EXT4_GOING_FLAGS_DEFAULT 0x0 /* going down */
97#define EXT4_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
98#define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
99
100/* Used to pass group descriptor data when online resize is done */
101struct ext4_new_group_input {
102 __u32 group; /* Group number for this data */
103 __u64 block_bitmap; /* Absolute block number of block bitmap */
104 __u64 inode_bitmap; /* Absolute block number of inode bitmap */
105 __u64 inode_table; /* Absolute block number of inode table start */
106 __u32 blocks_count; /* Total number of blocks in this group */
107 __u16 reserved_blocks; /* Number of reserved blocks in this group */
108 __u16 unused;
109};
110
111/*
112 * Returned by EXT4_IOC_GET_ES_CACHE as an additional possible flag.
113 * It indicates that the entry in extent status cache is for a hole.
114 */
115#define EXT4_FIEMAP_EXTENT_HOLE 0x08000000
116
117#endif /* _LINUX_EXT4_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fanotify.h+2-2
......@@ -8,8 +8,8 @@
88#define FAN_ACCESS 0x00000001 /* File was accessed */
99#define FAN_MODIFY 0x00000002 /* File was modified */
1010#define FAN_ATTRIB 0x00000004 /* Metadata changed */
11#define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */
12#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
11#define FAN_CLOSE_WRITE 0x00000008 /* Writable file closed */
12#define FAN_CLOSE_NOWRITE 0x00000010 /* Unwritable file closed */
1313#define FAN_OPEN 0x00000020 /* File was opened */
1414#define FAN_MOVED_FROM 0x00000040 /* File was moved from X */
1515#define FAN_MOVED_TO 0x00000080 /* File was moved to Y */
lib/libc/include/any-linux-any/linux/fb.h+1-7
......@@ -4,6 +4,7 @@
44
55#include <linux/types.h>
66#include <linux/i2c.h>
7#include <linux/vesa.h>
78
89/* Definitions of frame buffers */
910
......@@ -291,13 +292,6 @@ struct fb_con2fbmap {
291292 __u32 framebuffer;
292293};
293294
294/* VESA Blanking Levels */
295#define VESA_NO_BLANKING 0
296#define VESA_VSYNC_SUSPEND 1
297#define VESA_HSYNC_SUSPEND 2
298#define VESA_POWERDOWN 3
299
300
301295enum {
302296 /* screen: unblanked, hsync: on, vsync: on */
303297 FB_BLANK_UNBLANK = VESA_NO_BLANKING,
lib/libc/include/any-linux-any/linux/fcntl.h+13-6
......@@ -8,6 +8,14 @@
88#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
99#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
1010
11/*
12 * Request nofications on a directory.
13 * See below for events that may be notified.
14 */
15#define F_NOTIFY (F_LINUX_SPECIFIC_BASE + 2)
16
17#define F_DUPFD_QUERY (F_LINUX_SPECIFIC_BASE + 3)
18
1119/*
1220 * Cancel a blocking posix lock; internal use only until we expose an
1321 * asynchronous lock api to userspace:
......@@ -17,12 +25,6 @@
1725/* Create a file descriptor with FD_CLOEXEC set. */
1826#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
1927
20/*
21 * Request nofications on a directory.
22 * See below for events that may be notified.
23 */
24#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
25
2628/*
2729 * Set and get of pipe page size array
2830 */
......@@ -112,4 +114,9 @@
112114
113115#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
114116
117/* Flags for name_to_handle_at(2). We reuse AT_ flag space to save bits... */
118#define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to
119 compare object identity and may not
120 be usable to open_by_handle_at(2) */
121
115122#endif /* _LINUX_FCNTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/firewire-cdev.h+156-22
......@@ -46,6 +46,12 @@
4646#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08
4747#define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
4848
49/* available since kernel version 6.5 */
50#define FW_CDEV_EVENT_REQUEST3 0x0a
51#define FW_CDEV_EVENT_RESPONSE2 0x0b
52#define FW_CDEV_EVENT_PHY_PACKET_SENT2 0x0c
53#define FW_CDEV_EVENT_PHY_PACKET_RECEIVED2 0x0d
54
4955/**
5056 * struct fw_cdev_event_common - Common part of all fw_cdev_event_* types
5157 * @closure: For arbitrary use by userspace
......@@ -103,6 +109,32 @@ struct fw_cdev_event_bus_reset {
103109 * @length: Data length, i.e. the response's payload size in bytes
104110 * @data: Payload data, if any
105111 *
112 * This event is sent instead of &fw_cdev_event_response if the kernel or the client implements
113 * ABI version <= 5. It has the lack of time stamp field comparing to &fw_cdev_event_response2.
114 */
115struct fw_cdev_event_response {
116 __u64 closure;
117 __u32 type;
118 __u32 rcode;
119 __u32 length;
120 __u32 data[];
121};
122
123/**
124 * struct fw_cdev_event_response2 - Sent when a response packet was received
125 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_REQUEST
126 * or %FW_CDEV_IOC_SEND_BROADCAST_REQUEST
127 * or %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl
128 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
129 * @rcode: Response code returned by the remote node
130 * @length: Data length, i.e. the response's payload size in bytes
131 * @request_tstamp: The time stamp of isochronous cycle at which the request was sent.
132 * @response_tstamp: The time stamp of isochronous cycle at which the response was sent.
133 * @padding: Padding to keep the size of structure as multiples of 8 in various architectures
134 * since 4 byte alignment is used for 8 byte of object type in System V ABI for i386
135 * architecture.
136 * @data: Payload data, if any
137 *
106138 * This event is sent when the stack receives a response to an outgoing request
107139 * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
108140 * carrying data (read and lock responses) follows immediately and can be
......@@ -112,12 +144,21 @@ struct fw_cdev_event_bus_reset {
112144 * involve response packets. This includes unified write transactions,
113145 * broadcast write transactions, and transmission of asynchronous stream
114146 * packets. @rcode indicates success or failure of such transmissions.
147 *
148 * The value of @request_tstamp expresses the isochronous cycle at which the request was sent to
149 * initiate the transaction. The value of @response_tstamp expresses the isochronous cycle at which
150 * the response arrived to complete the transaction. Each value is unsigned 16 bit integer
151 * containing three low order bits of second field and all 13 bits of cycle field in format of
152 * CYCLE_TIMER register.
115153 */
116struct fw_cdev_event_response {
154struct fw_cdev_event_response2 {
117155 __u64 closure;
118156 __u32 type;
119157 __u32 rcode;
120158 __u32 length;
159 __u32 request_tstamp;
160 __u32 response_tstamp;
161 __u32 padding;
121162 __u32 data[];
122163};
123164
......@@ -159,6 +200,41 @@ struct fw_cdev_event_request {
159200 * @length: Data length, i.e. the request's payload size in bytes
160201 * @data: Incoming data, if any
161202 *
203 * This event is sent instead of &fw_cdev_event_request3 if the kernel or the client implements
204 * ABI version <= 5. It has the lack of time stamp field comparing to &fw_cdev_event_request3.
205 */
206struct fw_cdev_event_request2 {
207 __u64 closure;
208 __u32 type;
209 __u32 tcode;
210 __u64 offset;
211 __u32 source_node_id;
212 __u32 destination_node_id;
213 __u32 card;
214 __u32 generation;
215 __u32 handle;
216 __u32 length;
217 __u32 data[];
218};
219
220/**
221 * struct fw_cdev_event_request3 - Sent on incoming request to an address region
222 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
223 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST2
224 * @tcode: Transaction code of the incoming request
225 * @offset: The offset into the 48-bit per-node address space
226 * @source_node_id: Sender node ID
227 * @destination_node_id: Destination node ID
228 * @card: The index of the card from which the request came
229 * @generation: Bus generation in which the request is valid
230 * @handle: Reference to the kernel-side pending request
231 * @length: Data length, i.e. the request's payload size in bytes
232 * @tstamp: The time stamp of isochronous cycle at which the request arrived.
233 * @padding: Padding to keep the size of structure as multiples of 8 in various architectures
234 * since 4 byte alignment is used for 8 byte of object type in System V ABI for i386
235 * architecture.
236 * @data: Incoming data, if any
237 *
162238 * This event is sent when the stack receives an incoming request to an address
163239 * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
164240 * guaranteed to be completely contained in the specified region. Userspace is
......@@ -191,10 +267,14 @@ struct fw_cdev_event_request {
191267 * sent.
192268 *
193269 * If the client subsequently needs to initiate requests to the sender node of
194 * an &fw_cdev_event_request2, it needs to use a device file with matching
270 * an &fw_cdev_event_request3, it needs to use a device file with matching
195271 * card index, node ID, and generation for outbound requests.
272 *
273 * @tstamp is isochronous cycle at which the request arrived. It is 16 bit integer value and the
274 * higher 3 bits expresses three low order bits of second field in the format of CYCLE_TIME
275 * register and the rest 13 bits expresses cycle field.
196276 */
197struct fw_cdev_event_request2 {
277struct fw_cdev_event_request3 {
198278 __u64 closure;
199279 __u32 type;
200280 __u32 tcode;
......@@ -205,6 +285,8 @@ struct fw_cdev_event_request2 {
205285 __u32 generation;
206286 __u32 handle;
207287 __u32 length;
288 __u32 tstamp;
289 __u32 padding;
208290 __u32 data[];
209291};
210292
......@@ -341,20 +423,59 @@ struct fw_cdev_event_iso_resource {
341423 * @type: %FW_CDEV_EVENT_PHY_PACKET_SENT or %..._RECEIVED
342424 * @rcode: %RCODE_..., indicates success or failure of transmission
343425 * @length: Data length in bytes
426 * @data: Incoming data for %FW_CDEV_IOC_RECEIVE_PHY_PACKETS. For %FW_CDEV_IOC_SEND_PHY_PACKET
427 * the field has the same data in the request, thus the length of 8 bytes.
428 *
429 * This event is sent instead of &fw_cdev_event_phy_packet2 if the kernel or
430 * the client implements ABI version <= 5. It has the lack of time stamp field comparing to
431 * &fw_cdev_event_phy_packet2.
432 */
433struct fw_cdev_event_phy_packet {
434 __u64 closure;
435 __u32 type;
436 __u32 rcode;
437 __u32 length;
438 __u32 data[];
439};
440
441/**
442 * struct fw_cdev_event_phy_packet2 - A PHY packet was transmitted or received with time stamp.
443 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_SEND_PHY_PACKET
444 * or %FW_CDEV_IOC_RECEIVE_PHY_PACKETS ioctl
445 * @type: %FW_CDEV_EVENT_PHY_PACKET_SENT2 or %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2
446 * @rcode: %RCODE_..., indicates success or failure of transmission
447 * @length: Data length in bytes
448 * @tstamp: For %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2, the time stamp of isochronous cycle at
449 * which the packet arrived. For %FW_CDEV_EVENT_PHY_PACKET_SENT2 and non-ping packet,
450 * the time stamp of isochronous cycle at which the packet was sent. For ping packet,
451 * the tick count for round-trip time measured by 1394 OHCI controller.
452 * The time stamp of isochronous cycle at which either the response was sent for
453 * %FW_CDEV_EVENT_PHY_PACKET_SENT2 or the request arrived for
454 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2.
344455 * @data: Incoming data
345456 *
346 * If @type is %FW_CDEV_EVENT_PHY_PACKET_SENT, @length is 0 and @data empty,
347 * except in case of a ping packet: Then, @length is 4, and @data[0] is the
348 * ping time in 49.152MHz clocks if @rcode is %RCODE_COMPLETE.
457 * If @type is %FW_CDEV_EVENT_PHY_PACKET_SENT2, @length is 8 and @data consists of the two PHY
458 * packet quadlets to be sent, in host byte order,
349459 *
350 * If @type is %FW_CDEV_EVENT_PHY_PACKET_RECEIVED, @length is 8 and @data
351 * consists of the two PHY packet quadlets, in host byte order.
460 * If @type is %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2, @length is 8 and @data consists of the two PHY
461 * packet quadlets, in host byte order.
462 *
463 * For %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2, the @tstamp is the isochronous cycle at which the
464 * packet arrived. It is 16 bit integer value and the higher 3 bits expresses three low order bits
465 * of second field and the rest 13 bits expresses cycle field in the format of CYCLE_TIME register.
466 *
467 * For %FW_CDEV_EVENT_PHY_PACKET_SENT2, the @tstamp has different meanings whether to sent the
468 * packet for ping or not. If it's not for ping, the @tstamp is the isochronous cycle at which the
469 * packet was sent, and use the same format as the case of %FW_CDEV_EVENT_PHY_PACKET_SENT2. If it's
470 * for ping, the @tstamp is for round-trip time measured by 1394 OHCI controller with 42.195 MHz
471 * resolution.
352472 */
353struct fw_cdev_event_phy_packet {
473struct fw_cdev_event_phy_packet2 {
354474 __u64 closure;
355475 __u32 type;
356476 __u32 rcode;
357477 __u32 length;
478 __u32 tstamp;
358479 __u32 data[];
359480};
360481
......@@ -375,6 +496,11 @@ struct fw_cdev_event_phy_packet {
375496 * %FW_CDEV_EVENT_PHY_PACKET_SENT or
376497 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED
377498 *
499 * @request3: Valid if @common.type == %FW_CDEV_EVENT_REQUEST3
500 * @response2: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE2
501 * @phy_packet2: Valid if @common.type == %FW_CDEV_EVENT_PHY_PACKET_SENT2 or
502 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2
503 *
378504 * Convenience union for userspace use. Events could be read(2) into an
379505 * appropriately aligned char buffer and then cast to this union for further
380506 * processing. Note that for a request, response or iso_interrupt event,
......@@ -393,6 +519,9 @@ union fw_cdev_event {
393519 struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc; /* added in 2.6.36 */
394520 struct fw_cdev_event_iso_resource iso_resource; /* added in 2.6.30 */
395521 struct fw_cdev_event_phy_packet phy_packet; /* added in 2.6.36 */
522 struct fw_cdev_event_request3 request3; /* added in 6.5 */
523 struct fw_cdev_event_response2 response2; /* added in 6.5 */
524 struct fw_cdev_event_phy_packet2 phy_packet2; /* added in 6.5 */
396525};
397526
398527/* available since kernel version 2.6.22 */
......@@ -457,6 +586,11 @@ union fw_cdev_event {
457586 * 5 (3.4) - send %FW_CDEV_EVENT_ISO_INTERRUPT events when needed to
458587 * avoid dropping data
459588 * - added %FW_CDEV_IOC_FLUSH_ISO
589 * 6 (6.5) - added some event for subactions of asynchronous transaction with time stamp
590 * - %FW_CDEV_EVENT_REQUEST3
591 * - %FW_CDEV_EVENT_RESPONSE2
592 * - %FW_CDEV_EVENT_PHY_PACKET_SENT2
593 * - %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2
460594 */
461595
462596/**
......@@ -502,11 +636,11 @@ struct fw_cdev_get_info {
502636 * @data: Userspace pointer to payload
503637 * @generation: The bus generation where packet is valid
504638 *
505 * Send a request to the device. This ioctl implements all outgoing requests.
506 * Both quadlet and block request specify the payload as a pointer to the data
507 * in the @data field. Once the transaction completes, the kernel writes an
508 * &fw_cdev_event_response event back. The @closure field is passed back to
509 * user space in the response event.
639 * Send a request to the device. This ioctl implements all outgoing requests. Both quadlet and
640 * block request specify the payload as a pointer to the data in the @data field. Once the
641 * transaction completes, the kernel writes either &fw_cdev_event_response event or
642 * &fw_cdev_event_response event back. The @closure field is passed back to user space in the
643 * response event.
510644 */
511645struct fw_cdev_send_request {
512646 __u32 tcode;
......@@ -989,10 +1123,9 @@ struct fw_cdev_allocate_iso_resource {
9891123 * @generation: The bus generation where packet is valid
9901124 * @speed: Speed to transmit at
9911125 *
992 * The %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl sends an asynchronous stream packet
993 * to every device which is listening to the specified channel. The kernel
994 * writes an &fw_cdev_event_response event which indicates success or failure of
995 * the transmission.
1126 * The %FW_CDEV_IOC_SEND_STREAM_PACKET ioctl sends an asynchronous stream packet to every device
1127 * which is listening to the specified channel. The kernel writes either &fw_cdev_event_response
1128 * event or &fw_cdev_event_response2 event which indicates success or failure of the transmission.
9961129 */
9971130struct fw_cdev_send_stream_packet {
9981131 __u32 length;
......@@ -1011,8 +1144,8 @@ struct fw_cdev_send_stream_packet {
10111144 * @data: First and second quadlet of the PHY packet
10121145 * @generation: The bus generation where packet is valid
10131146 *
1014 * The %FW_CDEV_IOC_SEND_PHY_PACKET ioctl sends a PHY packet to all nodes
1015 * on the same card as this device. After transmission, an
1147 * The %FW_CDEV_IOC_SEND_PHY_PACKET ioctl sends a PHY packet to all nodes on the same card as this
1148 * device. After transmission, either %FW_CDEV_EVENT_PHY_PACKET_SENT event or
10161149 * %FW_CDEV_EVENT_PHY_PACKET_SENT event is generated.
10171150 *
10181151 * The payload @data\[\] shall be specified in host byte order. Usually,
......@@ -1031,8 +1164,9 @@ struct fw_cdev_send_phy_packet {
10311164 * struct fw_cdev_receive_phy_packets - start reception of PHY packets
10321165 * @closure: Passed back to userspace in phy packet events
10331166 *
1034 * This ioctl activates issuing of %FW_CDEV_EVENT_PHY_PACKET_RECEIVED due to
1035 * incoming PHY packets from any node on the same bus as the device.
1167 * This ioctl activates issuing of either %FW_CDEV_EVENT_PHY_PACKET_RECEIVED or
1168 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2 due to incoming PHY packets from any node on the same bus
1169 * as the device.
10361170 *
10371171 * The ioctl is only permitted on device files which represent a local node.
10381172 */
lib/libc/include/any-linux-any/linux/fs.h+89-1
......@@ -60,6 +60,24 @@ struct fstrim_range {
6060 __u64 minlen;
6161};
6262
63/*
64 * We include a length field because some filesystems (vfat) have an identifier
65 * that we do want to expose as a UUID, but doesn't have the standard length.
66 *
67 * We use a fixed size buffer beacuse this interface will, by fiat, never
68 * support "UUIDs" longer than 16 bytes; we don't want to force all downstream
69 * users to have to deal with that.
70 */
71struct fsuuid2 {
72 __u8 len;
73 __u8 uuid[16];
74};
75
76struct fs_sysfs_path {
77 __u8 len;
78 __u8 name[128];
79};
80
6381/* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
6482#define FILE_DEDUPE_RANGE_SAME 0
6583#define FILE_DEDUPE_RANGE_DIFFERS 1
......@@ -211,6 +229,13 @@ struct fsxattr {
211229#define FS_IOC_FSSETXATTR _IOW('X', 32, struct fsxattr)
212230#define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX])
213231#define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX])
232/* Returns the external filesystem UUID, the same one blkid returns */
233#define FS_IOC_GETFSUUID _IOR(0x15, 0, struct fsuuid2)
234/*
235 * Returns the path component under /sys/fs/ that refers to this filesystem;
236 * also /sys/kernel/debug/ for filesystems with debugfs exports
237 */
238#define FS_IOC_GETFSSYSFSPATH _IOR(0x15, 1, struct fs_sysfs_path)
214239
215240/*
216241 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
......@@ -297,8 +322,71 @@ typedef int __bitwise __kernel_rwf_t;
297322/* per-IO O_APPEND */
298323#define RWF_APPEND ((__kernel_rwf_t)0x00000010)
299324
325/* per-IO negation of O_APPEND */
326#define RWF_NOAPPEND ((__kernel_rwf_t)0x00000020)
327
300328/* mask of flags supported by the kernel */
301329#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
302 RWF_APPEND)
330 RWF_APPEND | RWF_NOAPPEND)
331
332/* Pagemap ioctl */
333#define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg)
334
335/* Bitmasks provided in pm_scan_args masks and reported in page_region.categories. */
336#define PAGE_IS_WPALLOWED (1 << 0)
337#define PAGE_IS_WRITTEN (1 << 1)
338#define PAGE_IS_FILE (1 << 2)
339#define PAGE_IS_PRESENT (1 << 3)
340#define PAGE_IS_SWAPPED (1 << 4)
341#define PAGE_IS_PFNZERO (1 << 5)
342#define PAGE_IS_HUGE (1 << 6)
343#define PAGE_IS_SOFT_DIRTY (1 << 7)
344
345/*
346 * struct page_region - Page region with flags
347 * @start: Start of the region
348 * @end: End of the region (exclusive)
349 * @categories: PAGE_IS_* category bitmask for the region
350 */
351struct page_region {
352 __u64 start;
353 __u64 end;
354 __u64 categories;
355};
356
357/* Flags for PAGEMAP_SCAN ioctl */
358#define PM_SCAN_WP_MATCHING (1 << 0) /* Write protect the pages matched. */
359#define PM_SCAN_CHECK_WPASYNC (1 << 1) /* Abort the scan when a non-WP-enabled page is found. */
360
361/*
362 * struct pm_scan_arg - Pagemap ioctl argument
363 * @size: Size of the structure
364 * @flags: Flags for the IOCTL
365 * @start: Starting address of the region
366 * @end: Ending address of the region
367 * @walk_end Address where the scan stopped (written by kernel).
368 * walk_end == end (address tags cleared) informs that the scan completed on entire range.
369 * @vec: Address of page_region struct array for output
370 * @vec_len: Length of the page_region struct array
371 * @max_pages: Optional limit for number of returned pages (0 = disabled)
372 * @category_inverted: PAGE_IS_* categories which values match if 0 instead of 1
373 * @category_mask: Skip pages for which any category doesn't match
374 * @category_anyof_mask: Skip pages for which no category matches
375 * @return_mask: PAGE_IS_* categories that are to be reported in `page_region`s returned
376 */
377struct pm_scan_arg {
378 __u64 size;
379 __u64 flags;
380 __u64 start;
381 __u64 end;
382 __u64 walk_end;
383 __u64 vec;
384 __u64 vec_len;
385 __u64 max_pages;
386 __u64 category_inverted;
387 __u64 category_mask;
388 __u64 category_anyof_mask;
389 __u64 return_mask;
390};
303391
304392#endif /* _LINUX_FS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fscrypt.h+2-1
......@@ -71,7 +71,8 @@ struct fscrypt_policy_v2 {
7171 __u8 contents_encryption_mode;
7272 __u8 filenames_encryption_mode;
7373 __u8 flags;
74 __u8 __reserved[4];
74 __u8 log2_data_unit_size;
75 __u8 __reserved[3];
7576 __u8 master_key_identifier[FSCRYPT_KEY_IDENTIFIER_SIZE];
7677};
7778
lib/libc/include/any-linux-any/linux/fsi.h+10
......@@ -59,6 +59,16 @@ struct scom_access {
5959 * /dev/sbefifo* ioctl interface
6060 */
6161
62/**
63 * FSI_SBEFIFO_CMD_TIMEOUT sets the timeout for writing data to the SBEFIFO.
64 *
65 * The command timeout is specified in seconds. The minimum value of command
66 * timeout is 1 seconds (default) and the maximum value of command timeout is
67 * 120 seconds. A command timeout of 0 will reset the value to the default of
68 * 1 seconds.
69 */
70#define FSI_SBEFIFO_CMD_TIMEOUT_SECONDS _IOW('s', 0x01, __u32)
71
6272/**
6373 * FSI_SBEFIFO_READ_TIMEOUT sets the read timeout for response from SBE.
6474 *
lib/libc/include/any-linux-any/linux/fuse.h+99-3
......@@ -206,6 +206,17 @@
206206 * - add extension header
207207 * - add FUSE_EXT_GROUPS
208208 * - add FUSE_CREATE_SUPP_GROUP
209 * - add FUSE_HAS_EXPIRE_ONLY
210 *
211 * 7.39
212 * - add FUSE_DIRECT_IO_ALLOW_MMAP
213 * - add FUSE_STATX and related structures
214 *
215 * 7.40
216 * - add max_stack_depth to fuse_init_out, add FUSE_PASSTHROUGH init flag
217 * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag
218 * - add FUSE_NO_EXPORT_SUPPORT init flag
219 * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag
209220 */
210221
211222#ifndef _LINUX_FUSE_H
......@@ -237,7 +248,7 @@
237248#define FUSE_KERNEL_VERSION 7
238249
239250/** Minor version number of this interface */
240#define FUSE_KERNEL_MINOR_VERSION 38
251#define FUSE_KERNEL_MINOR_VERSION 40
241252
242253/** The node ID of the root inode */
243254#define FUSE_ROOT_ID 1
......@@ -264,6 +275,40 @@ struct fuse_attr {
264275 uint32_t flags;
265276};
266277
278/*
279 * The following structures are bit-for-bit compatible with the statx(2) ABI in
280 * Linux.
281 */
282struct fuse_sx_time {
283 int64_t tv_sec;
284 uint32_t tv_nsec;
285 int32_t __reserved;
286};
287
288struct fuse_statx {
289 uint32_t mask;
290 uint32_t blksize;
291 uint64_t attributes;
292 uint32_t nlink;
293 uint32_t uid;
294 uint32_t gid;
295 uint16_t mode;
296 uint16_t __spare0[1];
297 uint64_t ino;
298 uint64_t size;
299 uint64_t blocks;
300 uint64_t attributes_mask;
301 struct fuse_sx_time atime;
302 struct fuse_sx_time btime;
303 struct fuse_sx_time ctime;
304 struct fuse_sx_time mtime;
305 uint32_t rdev_major;
306 uint32_t rdev_minor;
307 uint32_t dev_major;
308 uint32_t dev_minor;
309 uint64_t __spare2[14];
310};
311
267312struct fuse_kstatfs {
268313 uint64_t blocks;
269314 uint64_t bfree;
......@@ -310,6 +355,7 @@ struct fuse_file_lock {
310355 * FOPEN_STREAM: the file is stream-like (no file position at all)
311356 * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE)
312357 * FOPEN_PARALLEL_DIRECT_WRITES: Allow concurrent direct writes on the same inode
358 * FOPEN_PASSTHROUGH: passthrough read/write io for this open file
313359 */
314360#define FOPEN_DIRECT_IO (1 << 0)
315361#define FOPEN_KEEP_CACHE (1 << 1)
......@@ -318,6 +364,7 @@ struct fuse_file_lock {
318364#define FOPEN_STREAM (1 << 4)
319365#define FOPEN_NOFLUSH (1 << 5)
320366#define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
367#define FOPEN_PASSTHROUGH (1 << 7)
321368
322369/**
323370 * INIT request/reply flags
......@@ -365,6 +412,11 @@ struct fuse_file_lock {
365412 * FUSE_HAS_INODE_DAX: use per inode DAX
366413 * FUSE_CREATE_SUPP_GROUP: add supplementary group info to create, mkdir,
367414 * symlink and mknod (single group that matches parent)
415 * FUSE_HAS_EXPIRE_ONLY: kernel supports expiry-only entry invalidation
416 * FUSE_DIRECT_IO_ALLOW_MMAP: allow shared mmap in FOPEN_DIRECT_IO mode.
417 * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support
418 * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit
419 * of the request ID indicates resend requests
368420 */
369421#define FUSE_ASYNC_READ (1 << 0)
370422#define FUSE_POSIX_LOCKS (1 << 1)
......@@ -402,6 +454,14 @@ struct fuse_file_lock {
402454#define FUSE_SECURITY_CTX (1ULL << 32)
403455#define FUSE_HAS_INODE_DAX (1ULL << 33)
404456#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
457#define FUSE_HAS_EXPIRE_ONLY (1ULL << 35)
458#define FUSE_DIRECT_IO_ALLOW_MMAP (1ULL << 36)
459#define FUSE_PASSTHROUGH (1ULL << 37)
460#define FUSE_NO_EXPORT_SUPPORT (1ULL << 38)
461#define FUSE_HAS_RESEND (1ULL << 39)
462
463/* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */
464#define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP
405465
406466/**
407467 * CUSE INIT request/reply flags
......@@ -568,6 +628,7 @@ enum fuse_opcode {
568628 FUSE_REMOVEMAPPING = 49,
569629 FUSE_SYNCFS = 50,
570630 FUSE_TMPFILE = 51,
631 FUSE_STATX = 52,
571632
572633 /* CUSE specific operations */
573634 CUSE_INIT = 4096,
......@@ -584,6 +645,7 @@ enum fuse_notify_code {
584645 FUSE_NOTIFY_STORE = 4,
585646 FUSE_NOTIFY_RETRIEVE = 5,
586647 FUSE_NOTIFY_DELETE = 6,
648 FUSE_NOTIFY_RESEND = 7,
587649 FUSE_NOTIFY_CODE_MAX,
588650};
589651
......@@ -632,6 +694,22 @@ struct fuse_attr_out {
632694 struct fuse_attr attr;
633695};
634696
697struct fuse_statx_in {
698 uint32_t getattr_flags;
699 uint32_t reserved;
700 uint64_t fh;
701 uint32_t sx_flags;
702 uint32_t sx_mask;
703};
704
705struct fuse_statx_out {
706 uint64_t attr_valid; /* Cache timeout for the attributes */
707 uint32_t attr_valid_nsec;
708 uint32_t flags;
709 uint64_t spare[2];
710 struct fuse_statx stat;
711};
712
635713#define FUSE_COMPAT_MKNOD_IN_SIZE 8
636714
637715struct fuse_mknod_in {
......@@ -694,7 +772,7 @@ struct fuse_create_in {
694772struct fuse_open_out {
695773 uint64_t fh;
696774 uint32_t open_flags;
697 uint32_t padding;
775 int32_t backing_id;
698776};
699777
700778struct fuse_release_in {
......@@ -810,7 +888,8 @@ struct fuse_init_out {
810888 uint16_t max_pages;
811889 uint16_t map_alignment;
812890 uint32_t flags2;
813 uint32_t unused[7];
891 uint32_t max_stack_depth;
892 uint32_t unused[6];
814893};
815894
816895#define CUSE_INIT_INFO_MAX 4096
......@@ -893,6 +972,14 @@ struct fuse_fallocate_in {
893972 uint32_t padding;
894973};
895974
975/**
976 * FUSE request unique ID flag
977 *
978 * Indicates whether this is a resend request. The receiver should handle this
979 * request accordingly.
980 */
981#define FUSE_UNIQUE_RESEND (1ULL << 63)
982
896983struct fuse_in_header {
897984 uint32_t len;
898985 uint32_t opcode;
......@@ -982,9 +1069,18 @@ struct fuse_notify_retrieve_in {
9821069 uint64_t dummy4;
9831070};
9841071
1072struct fuse_backing_map {
1073 int32_t fd;
1074 uint32_t flags;
1075 uint64_t padding;
1076};
1077
9851078/* Device ioctls: */
9861079#define FUSE_DEV_IOC_MAGIC 229
9871080#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
1081#define FUSE_DEV_IOC_BACKING_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 1, \
1082 struct fuse_backing_map)
1083#define FUSE_DEV_IOC_BACKING_CLOSE _IOW(FUSE_DEV_IOC_MAGIC, 2, uint32_t)
9881084
9891085struct fuse_lseek_in {
9901086 uint64_t fh;
lib/libc/include/any-linux-any/linux/futex.h+28-3
......@@ -44,10 +44,35 @@
4444 FUTEX_PRIVATE_FLAG)
4545
4646/*
47 * Flags to specify the bit length of the futex word for futex2 syscalls.
48 * Currently, only 32 is supported.
47 * Flags for futex2 syscalls.
48 *
49 * NOTE: these are not pure flags, they can also be seen as:
50 *
51 * union {
52 * u32 flags;
53 * struct {
54 * u32 size : 2,
55 * numa : 1,
56 * : 4,
57 * private : 1;
58 * };
59 * };
4960 */
50#define FUTEX_32 2
61#define FUTEX2_SIZE_U8 0x00
62#define FUTEX2_SIZE_U16 0x01
63#define FUTEX2_SIZE_U32 0x02
64#define FUTEX2_SIZE_U64 0x03
65#define FUTEX2_NUMA 0x04
66 /* 0x08 */
67 /* 0x10 */
68 /* 0x20 */
69 /* 0x40 */
70#define FUTEX2_PRIVATE FUTEX_PRIVATE_FLAG
71
72#define FUTEX2_SIZE_MASK 0x03
73
74/* do not use */
75#define FUTEX_32 FUTEX2_SIZE_U32 /* historical accident :-( */
5176
5277/*
5378 * Max numbers of elements in a futex_waitv array
lib/libc/include/any-linux-any/linux/gpio.h+33-30
......@@ -67,7 +67,7 @@ struct gpiochip_info {
6767 * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
6868 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps
6969 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE: line events contain timestamps from
70 * hardware timestamp engine
70 * the hardware timestamping engine (HTE) subsystem
7171 */
7272enum gpio_v2_line_flag {
7373 GPIO_V2_LINE_FLAG_USED = _BITULL(0),
......@@ -88,10 +88,10 @@ enum gpio_v2_line_flag {
8888/**
8989 * struct gpio_v2_line_values - Values of GPIO lines
9090 * @bits: a bitmap containing the value of the lines, set to 1 for active
91 * and 0 for inactive.
91 * and 0 for inactive
9292 * @mask: a bitmap identifying the lines to get or set, with each bit
9393 * number corresponding to the index into &struct
94 * gpio_v2_line_request.offsets.
94 * gpio_v2_line_request.offsets
9595 */
9696struct gpio_v2_line_values {
9797 __aligned_u64 bits;
......@@ -123,7 +123,7 @@ enum gpio_v2_line_attr_id {
123123 * @values: if id is %GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, a bitmap
124124 * containing the values to which the lines will be set, with each bit
125125 * number corresponding to the index into &struct
126 * gpio_v2_line_request.offsets.
126 * gpio_v2_line_request.offsets
127127 * @debounce_period_us: if id is %GPIO_V2_LINE_ATTR_ID_DEBOUNCE, the
128128 * desired debounce period, in microseconds
129129 */
......@@ -143,7 +143,7 @@ struct gpio_v2_line_attribute {
143143 * @attr: the configurable attribute
144144 * @mask: a bitmap identifying the lines to which the attribute applies,
145145 * with each bit number corresponding to the index into &struct
146 * gpio_v2_line_request.offsets.
146 * gpio_v2_line_request.offsets
147147 */
148148struct gpio_v2_line_config_attribute {
149149 struct gpio_v2_line_attribute attr;
......@@ -178,7 +178,7 @@ struct gpio_v2_line_config {
178178 * associated GPIO chip
179179 * @consumer: a desired consumer label for the selected GPIO lines such as
180180 * "my-bitbanged-relay"
181 * @config: requested configuration for the lines.
181 * @config: requested configuration for the lines
182182 * @num_lines: number of lines requested in this request, i.e. the number
183183 * of valid fields in the %GPIO_V2_LINES_MAX sized arrays, set to 1 to
184184 * request a single line
......@@ -189,9 +189,8 @@ struct gpio_v2_line_config {
189189 * buffer. If this field is zero then the buffer size defaults to a minimum
190190 * of @num_lines * 16.
191191 * @padding: reserved for future use and must be zero filled
192 * @fd: if successful this field will contain a valid anonymous file handle
193 * after a %GPIO_GET_LINE_IOCTL operation, zero or negative value means
194 * error
192 * @fd: after a successful %GPIO_V2_GET_LINE_IOCTL operation, contains
193 * a valid anonymous file descriptor representing the request
195194 */
196195struct gpio_v2_line_request {
197196 __u32 offsets[GPIO_V2_LINES_MAX];
......@@ -217,7 +216,7 @@ struct gpio_v2_line_request {
217216 * @num_attrs: the number of attributes in @attrs
218217 * @flags: flags for this GPIO line, with values from &enum
219218 * gpio_v2_line_flag, such as %GPIO_V2_LINE_FLAG_ACTIVE_LOW,
220 * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together.
219 * %GPIO_V2_LINE_FLAG_OUTPUT etc, added together
221220 * @attrs: the configuration attributes associated with the line
222221 * @padding: reserved for future use
223222 */
......@@ -274,7 +273,7 @@ enum gpio_v2_line_event_id {
274273
275274/**
276275 * struct gpio_v2_line_event - The actual event being pushed to userspace
277 * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds.
276 * @timestamp_ns: best estimate of time of event occurrence, in nanoseconds
278277 * @id: event identifier with value from &enum gpio_v2_line_event_id
279278 * @offset: the offset of the line that triggered the event
280279 * @seqno: the sequence number for this event in the sequence of events for
......@@ -289,6 +288,10 @@ enum gpio_v2_line_event_id {
289288 *
290289 * If the %GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME flag is set then the
291290 * @timestamp_ns is read from %CLOCK_REALTIME.
291 *
292 * If the %GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag is set then the
293 * @timestamp_ns is provided by the hardware timestamping engine (HTE)
294 * subsystem.
292295 */
293296struct gpio_v2_line_event {
294297 __aligned_u64 timestamp_ns;
......@@ -330,7 +333,7 @@ struct gpio_v2_line_event {
330333 * also be empty if the consumer doesn't set this up
331334 *
332335 * Note: This struct is part of ABI v1 and is deprecated.
333 * Use &struct gpio_v2_line_info instead.
336 * Use ABI v2 and &struct gpio_v2_line_info instead.
334337 */
335338struct gpioline_info {
336339 __u32 line_offset;
......@@ -365,7 +368,7 @@ enum {
365368 * at the end of the structure on 64-bit architectures.
366369 *
367370 * Note: This struct is part of ABI v1 and is deprecated.
368 * Use &struct gpio_v2_line_info_changed instead.
371 * Use ABI v2 and &struct gpio_v2_line_info_changed instead.
369372 */
370373struct gpioline_info_changed {
371374 struct gpioline_info info;
......@@ -396,18 +399,17 @@ struct gpioline_info_changed {
396399 * a batch of input or output lines, but they must all have the same
397400 * characteristics, i.e. all inputs or all outputs, all active low etc
398401 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested
399 * line, this specifies the default output value, should be 0 (low) or
400 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
402 * line, this specifies the default output value, should be 0 (inactive) or
403 * 1 (active). Anything other than 0 or 1 will be interpreted as active.
401404 * @consumer_label: a desired consumer label for the selected GPIO line(s)
402405 * such as "my-bitbanged-relay"
403406 * @lines: number of lines requested in this request, i.e. the number of
404407 * valid fields in the above arrays, set to 1 to request a single line
405 * @fd: if successful this field will contain a valid anonymous file handle
406 * after a %GPIO_GET_LINEHANDLE_IOCTL operation, zero or negative value
407 * means error
408 * @fd: after a successful %GPIO_GET_LINEHANDLE_IOCTL operation, contains
409 * a valid anonymous file descriptor representing the request
408410 *
409411 * Note: This struct is part of ABI v1 and is deprecated.
410 * Use &struct gpio_v2_line_request instead.
412 * Use ABI v2 and &struct gpio_v2_line_request instead.
411413 */
412414struct gpiohandle_request {
413415 __u32 lineoffsets[GPIOHANDLES_MAX];
......@@ -424,12 +426,12 @@ struct gpiohandle_request {
424426 * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
425427 * together
426428 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,
427 * this specifies the default output value, should be 0 (low) or
428 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
429 * this specifies the default output value, should be 0 (inactive) or
430 * 1 (active). Anything other than 0 or 1 will be interpreted as active.
429431 * @padding: reserved for future use and should be zero filled
430432 *
431433 * Note: This struct is part of ABI v1 and is deprecated.
432 * Use &struct gpio_v2_line_config instead.
434 * Use ABI v2 and &struct gpio_v2_line_config instead.
433435 */
434436struct gpiohandle_config {
435437 __u32 flags;
......@@ -441,10 +443,11 @@ struct gpiohandle_config {
441443 * struct gpiohandle_data - Information of values on a GPIO handle
442444 * @values: when getting the state of lines this contains the current
443445 * state of a line, when setting the state of lines these should contain
444 * the desired target state
446 * the desired target state. States are 0 (inactive) or 1 (active).
447 * When setting, anything other than 0 or 1 will be interpreted as active.
445448 *
446449 * Note: This struct is part of ABI v1 and is deprecated.
447 * Use &struct gpio_v2_line_values instead.
450 * Use ABI v2 and &struct gpio_v2_line_values instead.
448451 */
449452struct gpiohandle_data {
450453 __u8 values[GPIOHANDLES_MAX];
......@@ -465,12 +468,11 @@ struct gpiohandle_data {
465468 * %GPIOEVENT_REQUEST_RISING_EDGE or %GPIOEVENT_REQUEST_FALLING_EDGE
466469 * @consumer_label: a desired consumer label for the selected GPIO line(s)
467470 * such as "my-listener"
468 * @fd: if successful this field will contain a valid anonymous file handle
469 * after a %GPIO_GET_LINEEVENT_IOCTL operation, zero or negative value
470 * means error
471 * @fd: after a successful %GPIO_GET_LINEEVENT_IOCTL operation, contains a
472 * valid anonymous file descriptor representing the request
471473 *
472474 * Note: This struct is part of ABI v1 and is deprecated.
473 * Use &struct gpio_v2_line_request instead.
475 * Use ABI v2 and &struct gpio_v2_line_request instead.
474476 */
475477struct gpioevent_request {
476478 __u32 lineoffset;
......@@ -489,10 +491,11 @@ struct gpioevent_request {
489491/**
490492 * struct gpioevent_data - The actual event being pushed to userspace
491493 * @timestamp: best estimate of time of event occurrence, in nanoseconds
492 * @id: event identifier
494 * @id: event identifier, one of %GPIOEVENT_EVENT_RISING_EDGE or
495 * %GPIOEVENT_EVENT_FALLING_EDGE
493496 *
494497 * Note: This struct is part of ABI v1 and is deprecated.
495 * Use &struct gpio_v2_line_event instead.
498 * Use ABI v2 and &struct gpio_v2_line_event instead.
496499 */
497500struct gpioevent_data {
498501 __u64 timestamp;
lib/libc/include/any-linux-any/linux/gsmmux.h+106-10
......@@ -1,11 +1,47 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (c) 2022/23 Siemens Mobility GmbH */
23#ifndef _LINUX_GSMMUX_H
34#define _LINUX_GSMMUX_H
45
6#include <linux/const.h>
57#include <linux/if.h>
68#include <linux/ioctl.h>
79#include <linux/types.h>
810
11/*
12 * flags definition for n_gsm
13 *
14 * Used by:
15 * struct gsm_config_ext.flags
16 * struct gsm_dlci_config.flags
17 */
18/* Forces a DLCI reset if set. Otherwise, a DLCI reset is only done if
19 * incompatible settings were provided. Always cleared on retrieval.
20 */
21#define GSM_FL_RESTART _BITUL(0)
22
23/**
24 * struct gsm_config - n_gsm basic configuration parameters
25 *
26 * This structure is used in combination with GSMIOC_GETCONF and GSMIOC_SETCONF
27 * to retrieve and set the basic parameters of an n_gsm ldisc.
28 * struct gsm_config_ext can be used to configure extended ldisc parameters.
29 *
30 * All timers are in units of 1/100th of a second.
31 *
32 * @adaption: Convergence layer type
33 * @encapsulation: Framing (0 = basic option, 1 = advanced option)
34 * @initiator: Initiator or responder
35 * @t1: Acknowledgment timer
36 * @t2: Response timer for multiplexer control channel
37 * @t3: Response timer for wake-up procedure
38 * @n2: Maximum number of retransmissions
39 * @mru: Maximum incoming frame payload size
40 * @mtu: Maximum outgoing frame payload size
41 * @k: Window size
42 * @i: Frame type (1 = UIH, 2 = UI)
43 * @unused: Can not be used
44 */
945struct gsm_config
1046{
1147 unsigned int adaption;
......@@ -19,18 +55,32 @@ struct gsm_config
1955 unsigned int mtu;
2056 unsigned int k;
2157 unsigned int i;
22 unsigned int unused[8]; /* Can not be used */
58 unsigned int unused[8];
2359};
2460
2561#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
2662#define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config)
2763
64/**
65 * struct gsm_netconfig - n_gsm network configuration parameters
66 *
67 * This structure is used in combination with GSMIOC_ENABLE_NET and
68 * GSMIOC_DISABLE_NET to enable or disable a network data connection
69 * over a mux virtual tty channel. This is for modems that support
70 * data connections with raw IP frames instead of PPP.
71 *
72 * @adaption: Adaption to use in network mode.
73 * @protocol: Protocol to use - only ETH_P_IP supported.
74 * @unused2: Can not be used.
75 * @if_name: Interface name format string.
76 * @unused: Can not be used.
77 */
2878struct gsm_netconfig {
29 unsigned int adaption; /* Adaption to use in network mode */
30 unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */
31 unsigned short unused2; /* Can not be used */
32 char if_name[IFNAMSIZ]; /* interface name format string */
33 __u8 unused[28]; /* Can not be used */
79 unsigned int adaption;
80 unsigned short protocol;
81 unsigned short unused2;
82 char if_name[IFNAMSIZ];
83 __u8 unused[28];
3484};
3585
3686#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
......@@ -39,14 +89,60 @@ struct gsm_netconfig {
3989/* get the base tty number for a configured gsmmux tty */
4090#define GSMIOC_GETFIRST _IOR('G', 4, __u32)
4191
92/**
93 * struct gsm_config_ext - n_gsm extended configuration parameters
94 *
95 * This structure is used in combination with GSMIOC_GETCONF_EXT and
96 * GSMIOC_SETCONF_EXT to retrieve and set the extended parameters of an
97 * n_gsm ldisc.
98 *
99 * All timers are in units of 1/100th of a second.
100 *
101 * @keep_alive: Control channel keep-alive in 1/100th of a second (0 to disable).
102 * @wait_config: Wait for DLCI config before opening virtual link?
103 * @flags: Mux specific flags.
104 * @reserved: For future use, must be initialized to zero.
105 */
42106struct gsm_config_ext {
43 __u32 keep_alive; /* Control channel keep-alive in 1/100th of a
44 * second (0 to disable)
45 */
46 __u32 reserved[7]; /* For future use, must be initialized to zero */
107 __u32 keep_alive;
108 __u32 wait_config;
109 __u32 flags;
110 __u32 reserved[5];
47111};
48112
49113#define GSMIOC_GETCONF_EXT _IOR('G', 5, struct gsm_config_ext)
50114#define GSMIOC_SETCONF_EXT _IOW('G', 6, struct gsm_config_ext)
51115
116/**
117 * struct gsm_dlci_config - n_gsm channel configuration parameters
118 *
119 * This structure is used in combination with GSMIOC_GETCONF_DLCI and
120 * GSMIOC_SETCONF_DLCI to retrieve and set the channel specific parameters
121 * of an n_gsm ldisc.
122 *
123 * Set the channel accordingly before calling GSMIOC_GETCONF_DLCI.
124 *
125 * @channel: DLCI (0 for the associated DLCI).
126 * @adaption: Convergence layer type.
127 * @mtu: Maximum transfer unit.
128 * @priority: Priority (0 for default value).
129 * @i: Frame type (1 = UIH, 2 = UI).
130 * @k: Window size (0 for default value).
131 * @flags: DLCI specific flags.
132 * @reserved: For future use, must be initialized to zero.
133 */
134struct gsm_dlci_config {
135 __u32 channel;
136 __u32 adaption;
137 __u32 mtu;
138 __u32 priority;
139 __u32 i;
140 __u32 k;
141 __u32 flags;
142 __u32 reserved[7];
143};
144
145#define GSMIOC_GETCONF_DLCI _IOWR('G', 7, struct gsm_dlci_config)
146#define GSMIOC_SETCONF_DLCI _IOW('G', 8, struct gsm_dlci_config)
147
52148#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gtp.h+4-1
......@@ -31,8 +31,11 @@ enum gtp_attrs {
3131 GTPA_I_TEI, /* for GTPv1 only */
3232 GTPA_O_TEI, /* for GTPv1 only */
3333 GTPA_PAD,
34 GTPA_PEER_ADDR6,
35 GTPA_MS_ADDR6,
36 GTPA_FAMILY,
3437 __GTPA_MAX,
3538};
36#define GTPA_MAX (__GTPA_MAX + 1)
39#define GTPA_MAX (__GTPA_MAX - 1)
3740
3841#endif /* _LINUX_GTP_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/handshake.h created+74
......@@ -0,0 +1,74 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/handshake.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_HANDSHAKE_H
7#define _LINUX_HANDSHAKE_H
8
9#define HANDSHAKE_FAMILY_NAME "handshake"
10#define HANDSHAKE_FAMILY_VERSION 1
11
12enum handshake_handler_class {
13 HANDSHAKE_HANDLER_CLASS_NONE,
14 HANDSHAKE_HANDLER_CLASS_TLSHD,
15 HANDSHAKE_HANDLER_CLASS_MAX,
16};
17
18enum handshake_msg_type {
19 HANDSHAKE_MSG_TYPE_UNSPEC,
20 HANDSHAKE_MSG_TYPE_CLIENTHELLO,
21 HANDSHAKE_MSG_TYPE_SERVERHELLO,
22};
23
24enum handshake_auth {
25 HANDSHAKE_AUTH_UNSPEC,
26 HANDSHAKE_AUTH_UNAUTH,
27 HANDSHAKE_AUTH_PSK,
28 HANDSHAKE_AUTH_X509,
29};
30
31enum {
32 HANDSHAKE_A_X509_CERT = 1,
33 HANDSHAKE_A_X509_PRIVKEY,
34
35 __HANDSHAKE_A_X509_MAX,
36 HANDSHAKE_A_X509_MAX = (__HANDSHAKE_A_X509_MAX - 1)
37};
38
39enum {
40 HANDSHAKE_A_ACCEPT_SOCKFD = 1,
41 HANDSHAKE_A_ACCEPT_HANDLER_CLASS,
42 HANDSHAKE_A_ACCEPT_MESSAGE_TYPE,
43 HANDSHAKE_A_ACCEPT_TIMEOUT,
44 HANDSHAKE_A_ACCEPT_AUTH_MODE,
45 HANDSHAKE_A_ACCEPT_PEER_IDENTITY,
46 HANDSHAKE_A_ACCEPT_CERTIFICATE,
47 HANDSHAKE_A_ACCEPT_PEERNAME,
48
49 __HANDSHAKE_A_ACCEPT_MAX,
50 HANDSHAKE_A_ACCEPT_MAX = (__HANDSHAKE_A_ACCEPT_MAX - 1)
51};
52
53enum {
54 HANDSHAKE_A_DONE_STATUS = 1,
55 HANDSHAKE_A_DONE_SOCKFD,
56 HANDSHAKE_A_DONE_REMOTE_AUTH,
57
58 __HANDSHAKE_A_DONE_MAX,
59 HANDSHAKE_A_DONE_MAX = (__HANDSHAKE_A_DONE_MAX - 1)
60};
61
62enum {
63 HANDSHAKE_CMD_READY = 1,
64 HANDSHAKE_CMD_ACCEPT,
65 HANDSHAKE_CMD_DONE,
66
67 __HANDSHAKE_CMD_MAX,
68 HANDSHAKE_CMD_MAX = (__HANDSHAKE_CMD_MAX - 1)
69};
70
71#define HANDSHAKE_MCGRP_NONE "none"
72#define HANDSHAKE_MCGRP_TLSHD "tlshd"
73
74#endif /* _LINUX_HANDSHAKE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/hash_info.h+3
......@@ -35,6 +35,9 @@ enum hash_algo {
3535 HASH_ALGO_SM3_256,
3636 HASH_ALGO_STREEBOG_256,
3737 HASH_ALGO_STREEBOG_512,
38 HASH_ALGO_SHA3_256,
39 HASH_ALGO_SHA3_384,
40 HASH_ALGO_SHA3_512,
3841 HASH_ALGO__LAST
3942};
4043
lib/libc/include/any-linux-any/linux/hw_breakpoint.h-10
......@@ -22,14 +22,4 @@ enum {
2222 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
2323};
2424
25enum bp_type_idx {
26 TYPE_INST = 0,
27#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
28 TYPE_DATA = 0,
29#else
30 TYPE_DATA = 1,
31#endif
32 TYPE_MAX
33};
34
3525#endif /* _LINUX_HW_BREAKPOINT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/icmpv6.h+1
......@@ -112,6 +112,7 @@ struct icmp6hdr {
112112#define ICMPV6_MOBILE_PREFIX_ADV 147
113113
114114#define ICMPV6_MRDISC_ADV 151
115#define ICMPV6_MRDISC_SOL 152
115116
116117#define ICMPV6_MSG_MAX 255
117118
lib/libc/include/any-linux-any/linux/idxd.h+46-3
......@@ -26,6 +26,8 @@ enum idxd_scmd_stat {
2626 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
2727 IDXD_SCMD_WQ_IRQ_ERR = 0x80100000,
2828 IDXD_SCMD_WQ_USER_NO_IOMMU = 0x80110000,
29 IDXD_SCMD_DEV_EVL_ERR = 0x80120000,
30 IDXD_SCMD_WQ_NO_DRV_NAME = 0x80200000,
2931};
3032
3133#define IDXD_SCMD_SOFTERR_MASK 0x80000000
......@@ -68,12 +70,14 @@ enum dsa_opcode {
6870 DSA_OPCODE_CR_DELTA,
6971 DSA_OPCODE_AP_DELTA,
7072 DSA_OPCODE_DUALCAST,
73 DSA_OPCODE_TRANSL_FETCH,
7174 DSA_OPCODE_CRCGEN = 0x10,
7275 DSA_OPCODE_COPY_CRC,
7376 DSA_OPCODE_DIF_CHECK,
7477 DSA_OPCODE_DIF_INS,
7578 DSA_OPCODE_DIF_STRP,
7679 DSA_OPCODE_DIF_UPDT,
80 DSA_OPCODE_DIX_GEN = 0x17,
7781 DSA_OPCODE_CFLUSH = 0x20,
7882};
7983
......@@ -128,6 +132,8 @@ enum dsa_completion_status {
128132 DSA_COMP_HW_ERR1,
129133 DSA_COMP_HW_ERR_DRB,
130134 DSA_COMP_TRANSLATION_FAIL,
135 DSA_COMP_DRAIN_EVL = 0x26,
136 DSA_COMP_BATCH_EVL_ERR,
131137};
132138
133139enum iax_completion_status {
......@@ -163,6 +169,7 @@ enum iax_completion_status {
163169
164170#define DSA_COMP_STATUS_MASK 0x7f
165171#define DSA_COMP_STATUS_WRITE 0x80
172#define DSA_COMP_STATUS(status) ((status) & DSA_COMP_STATUS_MASK)
166173
167174struct dsa_hw_desc {
168175 uint32_t pasid:20;
......@@ -176,6 +183,8 @@ struct dsa_hw_desc {
176183 uint64_t rdback_addr;
177184 uint64_t pattern;
178185 uint64_t desc_list_addr;
186 uint64_t pattern_lower;
187 uint64_t transl_fetch_addr;
179188 };
180189 union {
181190 uint64_t dst_addr;
......@@ -186,6 +195,7 @@ struct dsa_hw_desc {
186195 union {
187196 uint32_t xfer_size;
188197 uint32_t desc_count;
198 uint32_t region_size;
189199 };
190200 uint16_t int_handle;
191201 uint16_t rsvd1;
......@@ -240,6 +250,26 @@ struct dsa_hw_desc {
240250 uint16_t dest_app_tag_seed;
241251 };
242252
253 /* Fill */
254 uint64_t pattern_upper;
255
256 /* Translation fetch */
257 struct {
258 uint64_t transl_fetch_res;
259 uint32_t region_stride;
260 };
261
262 /* DIX generate */
263 struct {
264 uint8_t dix_gen_res;
265 uint8_t dest_dif_flags;
266 uint8_t dif_flags;
267 uint8_t dix_gen_res2[13];
268 uint32_t ref_tag_seed;
269 uint16_t app_tag_mask;
270 uint16_t app_tag_seed;
271 };
272
243273 uint8_t op_specific[24];
244274 };
245275} __attribute__((packed));
......@@ -280,8 +310,12 @@ struct dsa_completion_record {
280310 uint8_t result;
281311 uint8_t dif_status;
282312 };
283 uint16_t rsvd;
284 uint32_t bytes_completed;
313 uint8_t fault_info;
314 uint8_t rsvd;
315 union {
316 uint32_t bytes_completed;
317 uint32_t descs_completed;
318 };
285319 uint64_t fault_addr;
286320 union {
287321 /* common record */
......@@ -318,6 +352,14 @@ struct dsa_completion_record {
318352 uint16_t dif_upd_dest_app_tag;
319353 };
320354
355 /* DIX generate */
356 struct {
357 uint64_t dix_gen_res;
358 uint32_t dix_ref_tag;
359 uint16_t dix_app_tag_mask;
360 uint16_t dix_app_tag;
361 };
362
321363 uint8_t op_specific[16];
322364 };
323365} __attribute__((packed));
......@@ -329,7 +371,8 @@ struct dsa_raw_completion_record {
329371struct iax_completion_record {
330372 __volatile__ uint8_t status;
331373 uint8_t error_code;
332 uint16_t rsvd;
374 uint8_t fault_info;
375 uint8_t rsvd;
333376 uint32_t bytes_completed;
334377 uint64_t fault_addr;
335378 uint32_t invalid_flags;
lib/libc/include/any-linux-any/linux/if_bridge.h+30
......@@ -525,6 +525,7 @@ enum {
525525 BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
526526 BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS,
527527 BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS,
528 BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS,
528529 __BRIDGE_VLANDB_ENTRY_MAX,
529530};
530531#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
......@@ -633,6 +634,11 @@ enum {
633634 MDBA_MDB_EATTR_GROUP_MODE,
634635 MDBA_MDB_EATTR_SOURCE,
635636 MDBA_MDB_EATTR_RTPROT,
637 MDBA_MDB_EATTR_DST,
638 MDBA_MDB_EATTR_DST_PORT,
639 MDBA_MDB_EATTR_VNI,
640 MDBA_MDB_EATTR_IFINDEX,
641 MDBA_MDB_EATTR_SRC_VNI,
636642 __MDBA_MDB_EATTR_MAX
637643};
638644#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
......@@ -717,6 +723,24 @@ enum {
717723};
718724#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
719725
726/* [MDBA_GET_ENTRY] = {
727 * struct br_mdb_entry
728 * [MDBA_GET_ENTRY_ATTRS] = {
729 * [MDBE_ATTR_SOURCE]
730 * struct in_addr / struct in6_addr
731 * [MDBE_ATTR_SRC_VNI]
732 * u32
733 * }
734 * }
735 */
736enum {
737 MDBA_GET_ENTRY_UNSPEC,
738 MDBA_GET_ENTRY,
739 MDBA_GET_ENTRY_ATTRS,
740 __MDBA_GET_ENTRY_MAX,
741};
742#define MDBA_GET_ENTRY_MAX (__MDBA_GET_ENTRY_MAX - 1)
743
720744/* [MDBA_SET_ENTRY_ATTRS] = {
721745 * [MDBE_ATTR_xxx]
722746 * ...
......@@ -728,6 +752,12 @@ enum {
728752 MDBE_ATTR_SRC_LIST,
729753 MDBE_ATTR_GROUP_MODE,
730754 MDBE_ATTR_RTPROT,
755 MDBE_ATTR_DST,
756 MDBE_ATTR_DST_PORT,
757 MDBE_ATTR_VNI,
758 MDBE_ATTR_IFINDEX,
759 MDBE_ATTR_SRC_VNI,
760 MDBE_ATTR_STATE_MASK,
731761 __MDBE_ATTR_MAX,
732762};
733763#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
lib/libc/include/any-linux-any/linux/if_link.h+567-2
......@@ -376,7 +376,7 @@ enum {
376376
377377 IFLA_GSO_IPV4_MAX_SIZE,
378378 IFLA_GRO_IPV4_MAX_SIZE,
379
379 IFLA_DPLL_PIN,
380380 __IFLA_MAX
381381};
382382
......@@ -459,6 +459,286 @@ enum in6_addr_gen_mode {
459459
460460/* Bridge section */
461461
462/**
463 * DOC: Bridge enum definition
464 *
465 * Please *note* that the timer values in the following section are expected
466 * in clock_t format, which is seconds multiplied by USER_HZ (generally
467 * defined as 100).
468 *
469 * @IFLA_BR_FORWARD_DELAY
470 * The bridge forwarding delay is the time spent in LISTENING state
471 * (before moving to LEARNING) and in LEARNING state (before moving
472 * to FORWARDING). Only relevant if STP is enabled.
473 *
474 * The valid values are between (2 * USER_HZ) and (30 * USER_HZ).
475 * The default value is (15 * USER_HZ).
476 *
477 * @IFLA_BR_HELLO_TIME
478 * The time between hello packets sent by the bridge, when it is a root
479 * bridge or a designated bridge. Only relevant if STP is enabled.
480 *
481 * The valid values are between (1 * USER_HZ) and (10 * USER_HZ).
482 * The default value is (2 * USER_HZ).
483 *
484 * @IFLA_BR_MAX_AGE
485 * The hello packet timeout is the time until another bridge in the
486 * spanning tree is assumed to be dead, after reception of its last hello
487 * message. Only relevant if STP is enabled.
488 *
489 * The valid values are between (6 * USER_HZ) and (40 * USER_HZ).
490 * The default value is (20 * USER_HZ).
491 *
492 * @IFLA_BR_AGEING_TIME
493 * Configure the bridge's FDB entries aging time. It is the time a MAC
494 * address will be kept in the FDB after a packet has been received from
495 * that address. After this time has passed, entries are cleaned up.
496 * Allow values outside the 802.1 standard specification for special cases:
497 *
498 * * 0 - entry never ages (all permanent)
499 * * 1 - entry disappears (no persistence)
500 *
501 * The default value is (300 * USER_HZ).
502 *
503 * @IFLA_BR_STP_STATE
504 * Turn spanning tree protocol on (*IFLA_BR_STP_STATE* > 0) or off
505 * (*IFLA_BR_STP_STATE* == 0) for this bridge.
506 *
507 * The default value is 0 (disabled).
508 *
509 * @IFLA_BR_PRIORITY
510 * Set this bridge's spanning tree priority, used during STP root bridge
511 * election.
512 *
513 * The valid values are between 0 and 65535.
514 *
515 * @IFLA_BR_VLAN_FILTERING
516 * Turn VLAN filtering on (*IFLA_BR_VLAN_FILTERING* > 0) or off
517 * (*IFLA_BR_VLAN_FILTERING* == 0). When disabled, the bridge will not
518 * consider the VLAN tag when handling packets.
519 *
520 * The default value is 0 (disabled).
521 *
522 * @IFLA_BR_VLAN_PROTOCOL
523 * Set the protocol used for VLAN filtering.
524 *
525 * The valid values are 0x8100(802.1Q) or 0x88A8(802.1AD). The default value
526 * is 0x8100(802.1Q).
527 *
528 * @IFLA_BR_GROUP_FWD_MASK
529 * The group forwarding mask. This is the bitmask that is applied to
530 * decide whether to forward incoming frames destined to link-local
531 * addresses (of the form 01:80:C2:00:00:0X).
532 *
533 * The default value is 0, which means the bridge does not forward any
534 * link-local frames coming on this port.
535 *
536 * @IFLA_BR_ROOT_ID
537 * The bridge root id, read only.
538 *
539 * @IFLA_BR_BRIDGE_ID
540 * The bridge id, read only.
541 *
542 * @IFLA_BR_ROOT_PORT
543 * The bridge root port, read only.
544 *
545 * @IFLA_BR_ROOT_PATH_COST
546 * The bridge root path cost, read only.
547 *
548 * @IFLA_BR_TOPOLOGY_CHANGE
549 * The bridge topology change, read only.
550 *
551 * @IFLA_BR_TOPOLOGY_CHANGE_DETECTED
552 * The bridge topology change detected, read only.
553 *
554 * @IFLA_BR_HELLO_TIMER
555 * The bridge hello timer, read only.
556 *
557 * @IFLA_BR_TCN_TIMER
558 * The bridge tcn timer, read only.
559 *
560 * @IFLA_BR_TOPOLOGY_CHANGE_TIMER
561 * The bridge topology change timer, read only.
562 *
563 * @IFLA_BR_GC_TIMER
564 * The bridge gc timer, read only.
565 *
566 * @IFLA_BR_GROUP_ADDR
567 * Set the MAC address of the multicast group this bridge uses for STP.
568 * The address must be a link-local address in standard Ethernet MAC address
569 * format. It is an address of the form 01:80:C2:00:00:0X, with X in [0, 4..f].
570 *
571 * The default value is 0.
572 *
573 * @IFLA_BR_FDB_FLUSH
574 * Flush bridge's fdb dynamic entries.
575 *
576 * @IFLA_BR_MCAST_ROUTER
577 * Set bridge's multicast router if IGMP snooping is enabled.
578 * The valid values are:
579 *
580 * * 0 - disabled.
581 * * 1 - automatic (queried).
582 * * 2 - permanently enabled.
583 *
584 * The default value is 1.
585 *
586 * @IFLA_BR_MCAST_SNOOPING
587 * Turn multicast snooping on (*IFLA_BR_MCAST_SNOOPING* > 0) or off
588 * (*IFLA_BR_MCAST_SNOOPING* == 0).
589 *
590 * The default value is 1.
591 *
592 * @IFLA_BR_MCAST_QUERY_USE_IFADDR
593 * If enabled use the bridge's own IP address as source address for IGMP
594 * queries (*IFLA_BR_MCAST_QUERY_USE_IFADDR* > 0) or the default of 0.0.0.0
595 * (*IFLA_BR_MCAST_QUERY_USE_IFADDR* == 0).
596 *
597 * The default value is 0 (disabled).
598 *
599 * @IFLA_BR_MCAST_QUERIER
600 * Enable (*IFLA_BR_MULTICAST_QUERIER* > 0) or disable
601 * (*IFLA_BR_MULTICAST_QUERIER* == 0) IGMP querier, ie sending of multicast
602 * queries by the bridge.
603 *
604 * The default value is 0 (disabled).
605 *
606 * @IFLA_BR_MCAST_HASH_ELASTICITY
607 * Set multicast database hash elasticity, It is the maximum chain length in
608 * the multicast hash table. This attribute is *deprecated* and the value
609 * is always 16.
610 *
611 * @IFLA_BR_MCAST_HASH_MAX
612 * Set maximum size of the multicast hash table
613 *
614 * The default value is 4096, the value must be a power of 2.
615 *
616 * @IFLA_BR_MCAST_LAST_MEMBER_CNT
617 * The Last Member Query Count is the number of Group-Specific Queries
618 * sent before the router assumes there are no local members. The Last
619 * Member Query Count is also the number of Group-and-Source-Specific
620 * Queries sent before the router assumes there are no listeners for a
621 * particular source.
622 *
623 * The default value is 2.
624 *
625 * @IFLA_BR_MCAST_STARTUP_QUERY_CNT
626 * The Startup Query Count is the number of Queries sent out on startup,
627 * separated by the Startup Query Interval.
628 *
629 * The default value is 2.
630 *
631 * @IFLA_BR_MCAST_LAST_MEMBER_INTVL
632 * The Last Member Query Interval is the Max Response Time inserted into
633 * Group-Specific Queries sent in response to Leave Group messages, and
634 * is also the amount of time between Group-Specific Query messages.
635 *
636 * The default value is (1 * USER_HZ).
637 *
638 * @IFLA_BR_MCAST_MEMBERSHIP_INTVL
639 * The interval after which the bridge will leave a group, if no membership
640 * reports for this group are received.
641 *
642 * The default value is (260 * USER_HZ).
643 *
644 * @IFLA_BR_MCAST_QUERIER_INTVL
645 * The interval between queries sent by other routers. if no queries are
646 * seen after this delay has passed, the bridge will start to send its own
647 * queries (as if *IFLA_BR_MCAST_QUERIER_INTVL* was enabled).
648 *
649 * The default value is (255 * USER_HZ).
650 *
651 * @IFLA_BR_MCAST_QUERY_INTVL
652 * The Query Interval is the interval between General Queries sent by
653 * the Querier.
654 *
655 * The default value is (125 * USER_HZ). The minimum value is (1 * USER_HZ).
656 *
657 * @IFLA_BR_MCAST_QUERY_RESPONSE_INTVL
658 * The Max Response Time used to calculate the Max Resp Code inserted
659 * into the periodic General Queries.
660 *
661 * The default value is (10 * USER_HZ).
662 *
663 * @IFLA_BR_MCAST_STARTUP_QUERY_INTVL
664 * The interval between queries in the startup phase.
665 *
666 * The default value is (125 * USER_HZ) / 4. The minimum value is (1 * USER_HZ).
667 *
668 * @IFLA_BR_NF_CALL_IPTABLES
669 * Enable (*NF_CALL_IPTABLES* > 0) or disable (*NF_CALL_IPTABLES* == 0)
670 * iptables hooks on the bridge.
671 *
672 * The default value is 0 (disabled).
673 *
674 * @IFLA_BR_NF_CALL_IP6TABLES
675 * Enable (*NF_CALL_IP6TABLES* > 0) or disable (*NF_CALL_IP6TABLES* == 0)
676 * ip6tables hooks on the bridge.
677 *
678 * The default value is 0 (disabled).
679 *
680 * @IFLA_BR_NF_CALL_ARPTABLES
681 * Enable (*NF_CALL_ARPTABLES* > 0) or disable (*NF_CALL_ARPTABLES* == 0)
682 * arptables hooks on the bridge.
683 *
684 * The default value is 0 (disabled).
685 *
686 * @IFLA_BR_VLAN_DEFAULT_PVID
687 * VLAN ID applied to untagged and priority-tagged incoming packets.
688 *
689 * The default value is 1. Setting to the special value 0 makes all ports of
690 * this bridge not have a PVID by default, which means that they will
691 * not accept VLAN-untagged traffic.
692 *
693 * @IFLA_BR_PAD
694 * Bridge attribute padding type for netlink message.
695 *
696 * @IFLA_BR_VLAN_STATS_ENABLED
697 * Enable (*IFLA_BR_VLAN_STATS_ENABLED* == 1) or disable
698 * (*IFLA_BR_VLAN_STATS_ENABLED* == 0) per-VLAN stats accounting.
699 *
700 * The default value is 0 (disabled).
701 *
702 * @IFLA_BR_MCAST_STATS_ENABLED
703 * Enable (*IFLA_BR_MCAST_STATS_ENABLED* > 0) or disable
704 * (*IFLA_BR_MCAST_STATS_ENABLED* == 0) multicast (IGMP/MLD) stats
705 * accounting.
706 *
707 * The default value is 0 (disabled).
708 *
709 * @IFLA_BR_MCAST_IGMP_VERSION
710 * Set the IGMP version.
711 *
712 * The valid values are 2 and 3. The default value is 2.
713 *
714 * @IFLA_BR_MCAST_MLD_VERSION
715 * Set the MLD version.
716 *
717 * The valid values are 1 and 2. The default value is 1.
718 *
719 * @IFLA_BR_VLAN_STATS_PER_PORT
720 * Enable (*IFLA_BR_VLAN_STATS_PER_PORT* == 1) or disable
721 * (*IFLA_BR_VLAN_STATS_PER_PORT* == 0) per-VLAN per-port stats accounting.
722 * Can be changed only when there are no port VLANs configured.
723 *
724 * The default value is 0 (disabled).
725 *
726 * @IFLA_BR_MULTI_BOOLOPT
727 * The multi_boolopt is used to control new boolean options to avoid adding
728 * new netlink attributes. You can look at ``enum br_boolopt_id`` for those
729 * options.
730 *
731 * @IFLA_BR_MCAST_QUERIER_STATE
732 * Bridge mcast querier states, read only.
733 *
734 * @IFLA_BR_FDB_N_LEARNED
735 * The number of dynamically learned FDB entries for the current bridge,
736 * read only.
737 *
738 * @IFLA_BR_FDB_MAX_LEARNED
739 * Set the number of max dynamically learned FDB entries for the current
740 * bridge.
741 */
462742enum {
463743 IFLA_BR_UNSPEC,
464744 IFLA_BR_FORWARD_DELAY,
......@@ -508,6 +788,8 @@ enum {
508788 IFLA_BR_VLAN_STATS_PER_PORT,
509789 IFLA_BR_MULTI_BOOLOPT,
510790 IFLA_BR_MCAST_QUERIER_STATE,
791 IFLA_BR_FDB_N_LEARNED,
792 IFLA_BR_FDB_MAX_LEARNED,
511793 __IFLA_BR_MAX,
512794};
513795
......@@ -518,11 +800,252 @@ struct ifla_bridge_id {
518800 __u8 addr[6]; /* ETH_ALEN */
519801};
520802
803/**
804 * DOC: Bridge mode enum definition
805 *
806 * @BRIDGE_MODE_HAIRPIN
807 * Controls whether traffic may be sent back out of the port on which it
808 * was received. This option is also called reflective relay mode, and is
809 * used to support basic VEPA (Virtual Ethernet Port Aggregator)
810 * capabilities. By default, this flag is turned off and the bridge will
811 * not forward traffic back out of the receiving port.
812 */
521813enum {
522814 BRIDGE_MODE_UNSPEC,
523815 BRIDGE_MODE_HAIRPIN,
524816};
525817
818/**
819 * DOC: Bridge port enum definition
820 *
821 * @IFLA_BRPORT_STATE
822 * The operation state of the port. Here are the valid values.
823 *
824 * * 0 - port is in STP *DISABLED* state. Make this port completely
825 * inactive for STP. This is also called BPDU filter and could be used
826 * to disable STP on an untrusted port, like a leaf virtual device.
827 * The traffic forwarding is also stopped on this port.
828 * * 1 - port is in STP *LISTENING* state. Only valid if STP is enabled
829 * on the bridge. In this state the port listens for STP BPDUs and
830 * drops all other traffic frames.
831 * * 2 - port is in STP *LEARNING* state. Only valid if STP is enabled on
832 * the bridge. In this state the port will accept traffic only for the
833 * purpose of updating MAC address tables.
834 * * 3 - port is in STP *FORWARDING* state. Port is fully active.
835 * * 4 - port is in STP *BLOCKING* state. Only valid if STP is enabled on
836 * the bridge. This state is used during the STP election process.
837 * In this state, port will only process STP BPDUs.
838 *
839 * @IFLA_BRPORT_PRIORITY
840 * The STP port priority. The valid values are between 0 and 255.
841 *
842 * @IFLA_BRPORT_COST
843 * The STP path cost of the port. The valid values are between 1 and 65535.
844 *
845 * @IFLA_BRPORT_MODE
846 * Set the bridge port mode. See *BRIDGE_MODE_HAIRPIN* for more details.
847 *
848 * @IFLA_BRPORT_GUARD
849 * Controls whether STP BPDUs will be processed by the bridge port. By
850 * default, the flag is turned off to allow BPDU processing. Turning this
851 * flag on will disable the bridge port if a STP BPDU packet is received.
852 *
853 * If the bridge has Spanning Tree enabled, hostile devices on the network
854 * may send BPDU on a port and cause network failure. Setting *guard on*
855 * will detect and stop this by disabling the port. The port will be
856 * restarted if the link is brought down, or removed and reattached.
857 *
858 * @IFLA_BRPORT_PROTECT
859 * Controls whether a given port is allowed to become a root port or not.
860 * Only used when STP is enabled on the bridge. By default the flag is off.
861 *
862 * This feature is also called root port guard. If BPDU is received from a
863 * leaf (edge) port, it should not be elected as root port. This could
864 * be used if using STP on a bridge and the downstream bridges are not fully
865 * trusted; this prevents a hostile guest from rerouting traffic.
866 *
867 * @IFLA_BRPORT_FAST_LEAVE
868 * This flag allows the bridge to immediately stop multicast traffic
869 * forwarding on a port that receives an IGMP Leave message. It is only used
870 * when IGMP snooping is enabled on the bridge. By default the flag is off.
871 *
872 * @IFLA_BRPORT_LEARNING
873 * Controls whether a given port will learn *source* MAC addresses from
874 * received traffic or not. Also controls whether dynamic FDB entries
875 * (which can also be added by software) will be refreshed by incoming
876 * traffic. By default this flag is on.
877 *
878 * @IFLA_BRPORT_UNICAST_FLOOD
879 * Controls whether unicast traffic for which there is no FDB entry will
880 * be flooded towards this port. By default this flag is on.
881 *
882 * @IFLA_BRPORT_PROXYARP
883 * Enable proxy ARP on this port.
884 *
885 * @IFLA_BRPORT_LEARNING_SYNC
886 * Controls whether a given port will sync MAC addresses learned on device
887 * port to bridge FDB.
888 *
889 * @IFLA_BRPORT_PROXYARP_WIFI
890 * Enable proxy ARP on this port which meets extended requirements by
891 * IEEE 802.11 and Hotspot 2.0 specifications.
892 *
893 * @IFLA_BRPORT_ROOT_ID
894 *
895 * @IFLA_BRPORT_BRIDGE_ID
896 *
897 * @IFLA_BRPORT_DESIGNATED_PORT
898 *
899 * @IFLA_BRPORT_DESIGNATED_COST
900 *
901 * @IFLA_BRPORT_ID
902 *
903 * @IFLA_BRPORT_NO
904 *
905 * @IFLA_BRPORT_TOPOLOGY_CHANGE_ACK
906 *
907 * @IFLA_BRPORT_CONFIG_PENDING
908 *
909 * @IFLA_BRPORT_MESSAGE_AGE_TIMER
910 *
911 * @IFLA_BRPORT_FORWARD_DELAY_TIMER
912 *
913 * @IFLA_BRPORT_HOLD_TIMER
914 *
915 * @IFLA_BRPORT_FLUSH
916 * Flush bridge ports' fdb dynamic entries.
917 *
918 * @IFLA_BRPORT_MULTICAST_ROUTER
919 * Configure the port's multicast router presence. A port with
920 * a multicast router will receive all multicast traffic.
921 * The valid values are:
922 *
923 * * 0 disable multicast routers on this port
924 * * 1 let the system detect the presence of routers (default)
925 * * 2 permanently enable multicast traffic forwarding on this port
926 * * 3 enable multicast routers temporarily on this port, not depending
927 * on incoming queries.
928 *
929 * @IFLA_BRPORT_PAD
930 *
931 * @IFLA_BRPORT_MCAST_FLOOD
932 * Controls whether a given port will flood multicast traffic for which
933 * there is no MDB entry. By default this flag is on.
934 *
935 * @IFLA_BRPORT_MCAST_TO_UCAST
936 * Controls whether a given port will replicate packets using unicast
937 * instead of multicast. By default this flag is off.
938 *
939 * This is done by copying the packet per host and changing the multicast
940 * destination MAC to a unicast one accordingly.
941 *
942 * *mcast_to_unicast* works on top of the multicast snooping feature of the
943 * bridge. Which means unicast copies are only delivered to hosts which
944 * are interested in unicast and signaled this via IGMP/MLD reports previously.
945 *
946 * This feature is intended for interface types which have a more reliable
947 * and/or efficient way to deliver unicast packets than broadcast ones
948 * (e.g. WiFi).
949 *
950 * However, it should only be enabled on interfaces where no IGMPv2/MLDv1
951 * report suppression takes place. IGMP/MLD report suppression issue is
952 * usually overcome by the network daemon (supplicant) enabling AP isolation
953 * and by that separating all STAs.
954 *
955 * Delivery of STA-to-STA IP multicast is made possible again by enabling
956 * and utilizing the bridge hairpin mode, which considers the incoming port
957 * as a potential outgoing port, too (see *BRIDGE_MODE_HAIRPIN* option).
958 * Hairpin mode is performed after multicast snooping, therefore leading
959 * to only deliver reports to STAs running a multicast router.
960 *
961 * @IFLA_BRPORT_VLAN_TUNNEL
962 * Controls whether vlan to tunnel mapping is enabled on the port.
963 * By default this flag is off.
964 *
965 * @IFLA_BRPORT_BCAST_FLOOD
966 * Controls flooding of broadcast traffic on the given port. By default
967 * this flag is on.
968 *
969 * @IFLA_BRPORT_GROUP_FWD_MASK
970 * Set the group forward mask. This is a bitmask that is applied to
971 * decide whether to forward incoming frames destined to link-local
972 * addresses. The addresses of the form are 01:80:C2:00:00:0X (defaults
973 * to 0, which means the bridge does not forward any link-local frames
974 * coming on this port).
975 *
976 * @IFLA_BRPORT_NEIGH_SUPPRESS
977 * Controls whether neighbor discovery (arp and nd) proxy and suppression
978 * is enabled on the port. By default this flag is off.
979 *
980 * @IFLA_BRPORT_ISOLATED
981 * Controls whether a given port will be isolated, which means it will be
982 * able to communicate with non-isolated ports only. By default this
983 * flag is off.
984 *
985 * @IFLA_BRPORT_BACKUP_PORT
986 * Set a backup port. If the port loses carrier all traffic will be
987 * redirected to the configured backup port. Set the value to 0 to disable
988 * it.
989 *
990 * @IFLA_BRPORT_MRP_RING_OPEN
991 *
992 * @IFLA_BRPORT_MRP_IN_OPEN
993 *
994 * @IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT
995 * The number of per-port EHT hosts limit. The default value is 512.
996 * Setting to 0 is not allowed.
997 *
998 * @IFLA_BRPORT_MCAST_EHT_HOSTS_CNT
999 * The current number of tracked hosts, read only.
1000 *
1001 * @IFLA_BRPORT_LOCKED
1002 * Controls whether a port will be locked, meaning that hosts behind the
1003 * port will not be able to communicate through the port unless an FDB
1004 * entry with the unit's MAC address is in the FDB. The common use case is
1005 * that hosts are allowed access through authentication with the IEEE 802.1X
1006 * protocol or based on whitelists. By default this flag is off.
1007 *
1008 * Please note that secure 802.1X deployments should always use the
1009 * *BR_BOOLOPT_NO_LL_LEARN* flag, to not permit the bridge to populate its
1010 * FDB based on link-local (EAPOL) traffic received on the port.
1011 *
1012 * @IFLA_BRPORT_MAB
1013 * Controls whether a port will use MAC Authentication Bypass (MAB), a
1014 * technique through which select MAC addresses may be allowed on a locked
1015 * port, without using 802.1X authentication. Packets with an unknown source
1016 * MAC address generates a "locked" FDB entry on the incoming bridge port.
1017 * The common use case is for user space to react to these bridge FDB
1018 * notifications and optionally replace the locked FDB entry with a normal
1019 * one, allowing traffic to pass for whitelisted MAC addresses.
1020 *
1021 * Setting this flag also requires *IFLA_BRPORT_LOCKED* and
1022 * *IFLA_BRPORT_LEARNING*. *IFLA_BRPORT_LOCKED* ensures that unauthorized
1023 * data packets are dropped, and *IFLA_BRPORT_LEARNING* allows the dynamic
1024 * FDB entries installed by user space (as replacements for the locked FDB
1025 * entries) to be refreshed and/or aged out.
1026 *
1027 * @IFLA_BRPORT_MCAST_N_GROUPS
1028 *
1029 * @IFLA_BRPORT_MCAST_MAX_GROUPS
1030 * Sets the maximum number of MDB entries that can be registered for a
1031 * given port. Attempts to register more MDB entries at the port than this
1032 * limit allows will be rejected, whether they are done through netlink
1033 * (e.g. the bridge tool), or IGMP or MLD membership reports. Setting a
1034 * limit of 0 disables the limit. The default value is 0.
1035 *
1036 * @IFLA_BRPORT_NEIGH_VLAN_SUPPRESS
1037 * Controls whether neighbor discovery (arp and nd) proxy and suppression is
1038 * enabled for a given port. By default this flag is off.
1039 *
1040 * Note that this option only takes effect when *IFLA_BRPORT_NEIGH_SUPPRESS*
1041 * is enabled for a given port.
1042 *
1043 * @IFLA_BRPORT_BACKUP_NHID
1044 * The FDB nexthop object ID to attach to packets being redirected to a
1045 * backup port that has VLAN tunnel mapping enabled (via the
1046 * *IFLA_BRPORT_VLAN_TUNNEL* option). Setting a value of 0 (default) has
1047 * the effect of not attaching any ID.
1048 */
5261049enum {
5271050 IFLA_BRPORT_UNSPEC,
5281051 IFLA_BRPORT_STATE, /* Spanning tree state */
......@@ -567,6 +1090,8 @@ enum {
5671090 IFLA_BRPORT_MAB,
5681091 IFLA_BRPORT_MCAST_N_GROUPS,
5691092 IFLA_BRPORT_MCAST_MAX_GROUPS,
1093 IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
1094 IFLA_BRPORT_BACKUP_NHID,
5701095 __IFLA_BRPORT_MAX
5711096};
5721097#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
......@@ -633,6 +1158,7 @@ enum {
6331158 IFLA_MACVLAN_MACADDR_COUNT,
6341159 IFLA_MACVLAN_BC_QUEUE_LEN,
6351160 IFLA_MACVLAN_BC_QUEUE_LEN_USED,
1161 IFLA_MACVLAN_BC_CUTOFF,
6361162 __IFLA_MACVLAN_MAX,
6371163};
6381164
......@@ -751,6 +1277,30 @@ struct tunnel_msg {
7511277 __u32 ifindex;
7521278};
7531279
1280/* netkit section */
1281enum netkit_action {
1282 NETKIT_NEXT = -1,
1283 NETKIT_PASS = 0,
1284 NETKIT_DROP = 2,
1285 NETKIT_REDIRECT = 7,
1286};
1287
1288enum netkit_mode {
1289 NETKIT_L2,
1290 NETKIT_L3,
1291};
1292
1293enum {
1294 IFLA_NETKIT_UNSPEC,
1295 IFLA_NETKIT_PEER_INFO,
1296 IFLA_NETKIT_PRIMARY,
1297 IFLA_NETKIT_POLICY,
1298 IFLA_NETKIT_PEER_POLICY,
1299 IFLA_NETKIT_MODE,
1300 __IFLA_NETKIT_MAX,
1301};
1302#define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)
1303
7541304/* VXLAN section */
7551305
7561306/* include statistics in the dump */
......@@ -824,6 +1374,8 @@ enum {
8241374 IFLA_VXLAN_TTL_INHERIT,
8251375 IFLA_VXLAN_DF,
8261376 IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
1377 IFLA_VXLAN_LOCALBYPASS,
1378 IFLA_VXLAN_LABEL_POLICY, /* IPv6 flow label policy; ifla_vxlan_label_policy */
8271379 __IFLA_VXLAN_MAX
8281380};
8291381#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
......@@ -841,6 +1393,13 @@ enum ifla_vxlan_df {
8411393 VXLAN_DF_MAX = __VXLAN_DF_END - 1,
8421394};
8431395
1396enum ifla_vxlan_label_policy {
1397 VXLAN_LABEL_FIXED = 0,
1398 VXLAN_LABEL_INHERIT = 1,
1399 __VXLAN_LABEL_END,
1400 VXLAN_LABEL_MAX = __VXLAN_LABEL_END - 1,
1401};
1402
8441403/* GENEVE section */
8451404enum {
8461405 IFLA_GENEVE_UNSPEC,
......@@ -905,6 +1464,8 @@ enum {
9051464 IFLA_GTP_ROLE,
9061465 IFLA_GTP_CREATE_SOCKETS,
9071466 IFLA_GTP_RESTART_COUNT,
1467 IFLA_GTP_LOCAL,
1468 IFLA_GTP_LOCAL6,
9081469 __IFLA_GTP_MAX,
9091470};
9101471#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
......@@ -944,6 +1505,7 @@ enum {
9441505 IFLA_BOND_AD_LACP_ACTIVE,
9451506 IFLA_BOND_MISSED_MAX,
9461507 IFLA_BOND_NS_IP6_TARGET,
1508 IFLA_BOND_COUPLED_CONTROL,
9471509 __IFLA_BOND_MAX,
9481510};
9491511
......@@ -1209,6 +1771,7 @@ enum {
12091771 IFLA_HSR_PROTOCOL, /* Indicate different protocol than
12101772 * HSR. For example PRP.
12111773 */
1774 IFLA_HSR_INTERLINK, /* HSR interlink network device */
12121775 __IFLA_HSR_MAX,
12131776};
12141777
......@@ -1386,7 +1949,9 @@ enum {
13861949
13871950enum {
13881951 IFLA_DSA_UNSPEC,
1389 IFLA_DSA_MASTER,
1952 IFLA_DSA_CONDUIT,
1953 /* Deprecated, use IFLA_DSA_CONDUIT instead */
1954 IFLA_DSA_MASTER = IFLA_DSA_CONDUIT,
13901955 __IFLA_DSA_MAX,
13911956};
13921957
lib/libc/include/any-linux-any/linux/if_packet.h+1
......@@ -59,6 +59,7 @@ struct sockaddr_ll {
5959#define PACKET_ROLLOVER_STATS 21
6060#define PACKET_FANOUT_DATA 22
6161#define PACKET_IGNORE_OUTGOING 23
62#define PACKET_VNET_HDR_SZ 24
6263
6364#define PACKET_FANOUT_HASH 0
6465#define PACKET_FANOUT_LB 1
lib/libc/include/any-linux-any/linux/if_team.h+43-73
......@@ -1,108 +1,78 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * include/linux/if_team.h - Network team device driver header
4 * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/team.yaml */
4/* YNL-GEN uapi header */
115
12#ifndef _LINUX_IF_TEAM_H_
13#define _LINUX_IF_TEAM_H_
6#ifndef _LINUX_IF_TEAM_H
7#define _LINUX_IF_TEAM_H
148
9#define TEAM_GENL_NAME "team"
10#define TEAM_GENL_VERSION 1
1511
16#define TEAM_STRING_MAX_LEN 32
17
18/**********************************
19 * NETLINK_GENERIC netlink family.
20 **********************************/
21
22enum {
23 TEAM_CMD_NOOP,
24 TEAM_CMD_OPTIONS_SET,
25 TEAM_CMD_OPTIONS_GET,
26 TEAM_CMD_PORT_LIST_GET,
27
28 __TEAM_CMD_MAX,
29 TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
30};
12#define TEAM_STRING_MAX_LEN 32
13#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
3114
3215enum {
3316 TEAM_ATTR_UNSPEC,
34 TEAM_ATTR_TEAM_IFINDEX, /* u32 */
35 TEAM_ATTR_LIST_OPTION, /* nest */
36 TEAM_ATTR_LIST_PORT, /* nest */
17 TEAM_ATTR_TEAM_IFINDEX,
18 TEAM_ATTR_LIST_OPTION,
19 TEAM_ATTR_LIST_PORT,
3720
3821 __TEAM_ATTR_MAX,
39 TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
22 TEAM_ATTR_MAX = (__TEAM_ATTR_MAX - 1)
4023};
4124
42/* Nested layout of get/set msg:
43 *
44 * [TEAM_ATTR_LIST_OPTION]
45 * [TEAM_ATTR_ITEM_OPTION]
46 * [TEAM_ATTR_OPTION_*], ...
47 * [TEAM_ATTR_ITEM_OPTION]
48 * [TEAM_ATTR_OPTION_*], ...
49 * ...
50 * [TEAM_ATTR_LIST_PORT]
51 * [TEAM_ATTR_ITEM_PORT]
52 * [TEAM_ATTR_PORT_*], ...
53 * [TEAM_ATTR_ITEM_PORT]
54 * [TEAM_ATTR_PORT_*], ...
55 * ...
56 */
57
5825enum {
5926 TEAM_ATTR_ITEM_OPTION_UNSPEC,
60 TEAM_ATTR_ITEM_OPTION, /* nest */
27 TEAM_ATTR_ITEM_OPTION,
6128
6229 __TEAM_ATTR_ITEM_OPTION_MAX,
63 TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
30 TEAM_ATTR_ITEM_OPTION_MAX = (__TEAM_ATTR_ITEM_OPTION_MAX - 1)
6431};
6532
6633enum {
6734 TEAM_ATTR_OPTION_UNSPEC,
68 TEAM_ATTR_OPTION_NAME, /* string */
69 TEAM_ATTR_OPTION_CHANGED, /* flag */
70 TEAM_ATTR_OPTION_TYPE, /* u8 */
71 TEAM_ATTR_OPTION_DATA, /* dynamic */
72 TEAM_ATTR_OPTION_REMOVED, /* flag */
73 TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
74 TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
35 TEAM_ATTR_OPTION_NAME,
36 TEAM_ATTR_OPTION_CHANGED,
37 TEAM_ATTR_OPTION_TYPE,
38 TEAM_ATTR_OPTION_DATA,
39 TEAM_ATTR_OPTION_REMOVED,
40 TEAM_ATTR_OPTION_PORT_IFINDEX,
41 TEAM_ATTR_OPTION_ARRAY_INDEX,
7542
7643 __TEAM_ATTR_OPTION_MAX,
77 TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
44 TEAM_ATTR_OPTION_MAX = (__TEAM_ATTR_OPTION_MAX - 1)
7845};
7946
8047enum {
8148 TEAM_ATTR_ITEM_PORT_UNSPEC,
82 TEAM_ATTR_ITEM_PORT, /* nest */
49 TEAM_ATTR_ITEM_PORT,
8350
8451 __TEAM_ATTR_ITEM_PORT_MAX,
85 TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
52 TEAM_ATTR_ITEM_PORT_MAX = (__TEAM_ATTR_ITEM_PORT_MAX - 1)
8653};
8754
8855enum {
8956 TEAM_ATTR_PORT_UNSPEC,
90 TEAM_ATTR_PORT_IFINDEX, /* u32 */
91 TEAM_ATTR_PORT_CHANGED, /* flag */
92 TEAM_ATTR_PORT_LINKUP, /* flag */
93 TEAM_ATTR_PORT_SPEED, /* u32 */
94 TEAM_ATTR_PORT_DUPLEX, /* u8 */
95 TEAM_ATTR_PORT_REMOVED, /* flag */
57 TEAM_ATTR_PORT_IFINDEX,
58 TEAM_ATTR_PORT_CHANGED,
59 TEAM_ATTR_PORT_LINKUP,
60 TEAM_ATTR_PORT_SPEED,
61 TEAM_ATTR_PORT_DUPLEX,
62 TEAM_ATTR_PORT_REMOVED,
9663
9764 __TEAM_ATTR_PORT_MAX,
98 TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
65 TEAM_ATTR_PORT_MAX = (__TEAM_ATTR_PORT_MAX - 1)
9966};
10067
101/*
102 * NETLINK_GENERIC related info
103 */
104#define TEAM_GENL_NAME "team"
105#define TEAM_GENL_VERSION 0x1
106#define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
68enum {
69 TEAM_CMD_NOOP,
70 TEAM_CMD_OPTIONS_SET,
71 TEAM_CMD_OPTIONS_GET,
72 TEAM_CMD_PORT_LIST_GET,
73
74 __TEAM_CMD_MAX,
75 TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1)
76};
10777
108#endif /* _LINUX_IF_TEAM_H_ */
\ No newline at end of file
78#endif /* _LINUX_IF_TEAM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_tunnel.h+34
......@@ -161,6 +161,13 @@ enum {
161161
162162#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1)
163163
164/* Historically, tunnel flags have been defined as __be16 and now there are
165 * no free bits left. It is strongly advised to switch the already existing
166 * userspace code to the new *_BIT definitions from down below, as __be16
167 * can't be simply cast to a wider type on LE systems. All new flags and
168 * code must use *_BIT only.
169 */
170
164171#define TUNNEL_CSUM __cpu_to_be16(0x01)
165172#define TUNNEL_ROUTING __cpu_to_be16(0x02)
166173#define TUNNEL_KEY __cpu_to_be16(0x04)
......@@ -182,4 +189,31 @@ enum {
182189 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT | \
183190 TUNNEL_GTP_OPT)
184191
192enum {
193 IP_TUNNEL_CSUM_BIT = 0U,
194 IP_TUNNEL_ROUTING_BIT,
195 IP_TUNNEL_KEY_BIT,
196 IP_TUNNEL_SEQ_BIT,
197 IP_TUNNEL_STRICT_BIT,
198 IP_TUNNEL_REC_BIT,
199 IP_TUNNEL_VERSION_BIT,
200 IP_TUNNEL_NO_KEY_BIT,
201 IP_TUNNEL_DONT_FRAGMENT_BIT,
202 IP_TUNNEL_OAM_BIT,
203 IP_TUNNEL_CRIT_OPT_BIT,
204 IP_TUNNEL_GENEVE_OPT_BIT, /* OPTIONS_PRESENT */
205 IP_TUNNEL_VXLAN_OPT_BIT, /* OPTIONS_PRESENT */
206 IP_TUNNEL_NOCACHE_BIT,
207 IP_TUNNEL_ERSPAN_OPT_BIT, /* OPTIONS_PRESENT */
208 IP_TUNNEL_GTP_OPT_BIT, /* OPTIONS_PRESENT */
209
210 IP_TUNNEL_VTI_BIT,
211 IP_TUNNEL_SIT_ISATAP_BIT = IP_TUNNEL_VTI_BIT,
212
213 /* Flags starting from here are not available via the old UAPI */
214 IP_TUNNEL_PFCP_OPT_BIT, /* OPTIONS_PRESENT */
215
216 __IP_TUNNEL_FLAG_NUM,
217};
218
185219#endif /* _IF_TUNNEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_xdp.h+59-1
......@@ -25,9 +25,21 @@
2525 * application.
2626 */
2727#define XDP_USE_NEED_WAKEUP (1 << 3)
28/* By setting this option, userspace application indicates that it can
29 * handle multiple descriptors per packet thus enabling AF_XDP to split
30 * multi-buffer XDP frames into multiple Rx descriptors. Without this set
31 * such frames will be dropped.
32 */
33#define XDP_USE_SG (1 << 4)
2834
2935/* Flags for xsk_umem_config flags */
30#define XDP_UMEM_UNALIGNED_CHUNK_FLAG (1 << 0)
36#define XDP_UMEM_UNALIGNED_CHUNK_FLAG (1 << 0)
37
38/* Force checksum calculation in software. Can be used for testing or
39 * working around potential HW issues. This option causes performance
40 * degradation and only works in XDP_COPY mode.
41 */
42#define XDP_UMEM_TX_SW_CSUM (1 << 1)
3143
3244struct sockaddr_xdp {
3345 __u16 sxdp_family;
......@@ -70,6 +82,7 @@ struct xdp_umem_reg {
7082 __u32 chunk_size;
7183 __u32 headroom;
7284 __u32 flags;
85 __u32 tx_metadata_len;
7386};
7487
7588struct xdp_statistics {
......@@ -99,6 +112,41 @@ struct xdp_options {
99112#define XSK_UNALIGNED_BUF_ADDR_MASK \
100113 ((1ULL << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1)
101114
115/* Request transmit timestamp. Upon completion, put it into tx_timestamp
116 * field of struct xsk_tx_metadata.
117 */
118#define XDP_TXMD_FLAGS_TIMESTAMP (1 << 0)
119
120/* Request transmit checksum offload. Checksum start position and offset
121 * are communicated via csum_start and csum_offset fields of struct
122 * xsk_tx_metadata.
123 */
124#define XDP_TXMD_FLAGS_CHECKSUM (1 << 1)
125
126/* AF_XDP offloads request. 'request' union member is consumed by the driver
127 * when the packet is being transmitted. 'completion' union member is
128 * filled by the driver when the transmit completion arrives.
129 */
130struct xsk_tx_metadata {
131 __u64 flags;
132
133 union {
134 struct {
135 /* XDP_TXMD_FLAGS_CHECKSUM */
136
137 /* Offset from desc->addr where checksumming should start. */
138 __u16 csum_start;
139 /* Offset from csum_start where checksum should be stored. */
140 __u16 csum_offset;
141 } request;
142
143 struct {
144 /* XDP_TXMD_FLAGS_TIMESTAMP */
145 __u64 tx_timestamp;
146 } completion;
147 };
148};
149
102150/* Rx/Tx descriptor */
103151struct xdp_desc {
104152 __u64 addr;
......@@ -108,4 +156,14 @@ struct xdp_desc {
108156
109157/* UMEM descriptor is __u64 */
110158
159/* Flag indicating that the packet continues with the buffer pointed out by the
160 * next frame in the ring. The end of the packet is signalled by setting this
161 * bit to zero. For single buffer packets, every descriptor has 'options' set
162 * to 0 and this maintains backward compatibility.
163 */
164#define XDP_PKT_CONTD (1 << 0)
165
166/* TX packet carries valid metadata. */
167#define XDP_TX_METADATA (1 << 1)
168
111169#endif /* _LINUX_IF_XDP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iio/types.h+6
......@@ -47,6 +47,10 @@ enum iio_chan_type {
4747 IIO_POSITIONRELATIVE,
4848 IIO_PHASE,
4949 IIO_MASSCONCENTRATION,
50 IIO_DELTA_ANGL,
51 IIO_DELTA_VELOCITY,
52 IIO_COLORTEMP,
53 IIO_CHROMATICITY,
5054};
5155
5256enum iio_modifier {
......@@ -101,6 +105,8 @@ enum iio_modifier {
101105 IIO_MOD_PITCH,
102106 IIO_MOD_YAW,
103107 IIO_MOD_ROLL,
108 IIO_MOD_LIGHT_UVA,
109 IIO_MOD_LIGHT_UVB,
104110};
105111
106112enum iio_event_type {
lib/libc/include/any-linux-any/linux/in6.h+1-1
......@@ -145,7 +145,7 @@ struct in6_flowlabel_req {
145145#define IPV6_TLV_PADN 1
146146#define IPV6_TLV_ROUTERALERT 5
147147#define IPV6_TLV_CALIPSO 7 /* RFC 5570 */
148#define IPV6_TLV_IOAM 49 /* TEMPORARY IANA allocation for IOAM */
148#define IPV6_TLV_IOAM 49 /* RFC 9486 */
149149#define IPV6_TLV_JUMBO 194
150150#define IPV6_TLV_HAO 201 /* home address option */
151151
lib/libc/include/any-linux-any/linux/inotify.h+2-2
......@@ -30,8 +30,8 @@ struct inotify_event {
3030#define IN_ACCESS 0x00000001 /* File was accessed */
3131#define IN_MODIFY 0x00000002 /* File was modified */
3232#define IN_ATTRIB 0x00000004 /* Metadata changed */
33#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
34#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
33#define IN_CLOSE_WRITE 0x00000008 /* Writable file was closed */
34#define IN_CLOSE_NOWRITE 0x00000010 /* Unwritable file closed */
3535#define IN_OPEN 0x00000020 /* File was opened */
3636#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
3737#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
lib/libc/include/any-linux-any/linux/input-event-codes.h+3
......@@ -602,6 +602,7 @@
602602
603603#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
604604#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
605#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
605606
606607#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */
607608#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */
......@@ -617,6 +618,8 @@
617618#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
618619#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
619620#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
621#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
622#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
620623
621624#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
622625#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
lib/libc/include/any-linux-any/linux/io_uring.h+128-26
......@@ -43,6 +43,10 @@ struct io_uring_sqe {
4343 union {
4444 __u64 addr; /* pointer to buffer or iovecs */
4545 __u64 splice_off_in;
46 struct {
47 __u32 level;
48 __u32 optname;
49 };
4650 };
4751 __u32 len; /* buffer size or number of iovecs */
4852 union {
......@@ -65,6 +69,10 @@ struct io_uring_sqe {
6569 __u32 xattr_flags;
6670 __u32 msg_ring_flags;
6771 __u32 uring_cmd_flags;
72 __u32 waitid_flags;
73 __u32 futex_flags;
74 __u32 install_fd_flags;
75 __u32 nop_flags;
6876 };
6977 __u64 user_data; /* data to be passed back at completion time */
7078 /* pack this to avoid bogus arm OABI complaints */
......@@ -79,6 +87,7 @@ struct io_uring_sqe {
7987 union {
8088 __s32 splice_fd_in;
8189 __u32 file_index;
90 __u32 optlen;
8291 struct {
8392 __u16 addr_len;
8493 __u16 __pad3[1];
......@@ -89,6 +98,7 @@ struct io_uring_sqe {
8998 __u64 addr3;
9099 __u64 __pad2[1];
91100 };
101 __u64 optval;
92102 /*
93103 * If the ring is initialized with IORING_SETUP_SQE128, then
94104 * this field is used for 80 bytes of arbitrary command data
......@@ -106,7 +116,7 @@ struct io_uring_sqe {
106116 */
107117#define IORING_FILE_INDEX_ALLOC (~0U)
108118
109enum {
119enum io_uring_sqe_flags_bit {
110120 IOSQE_FIXED_FILE_BIT,
111121 IOSQE_IO_DRAIN_BIT,
112122 IOSQE_IO_LINK_BIT,
......@@ -173,6 +183,23 @@ enum {
173183 */
174184#define IORING_SETUP_DEFER_TASKRUN (1U << 13)
175185
186/*
187 * Application provides the memory for the rings
188 */
189#define IORING_SETUP_NO_MMAP (1U << 14)
190
191/*
192 * Register the ring fd in itself for use with
193 * IORING_REGISTER_USE_REGISTERED_RING; return a registered fd index rather
194 * than an fd.
195 */
196#define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15)
197
198/*
199 * Removes indirection through the SQ index array.
200 */
201#define IORING_SETUP_NO_SQARRAY (1U << 16)
202
176203enum io_uring_op {
177204 IORING_OP_NOP,
178205 IORING_OP_READV,
......@@ -223,17 +250,25 @@ enum io_uring_op {
223250 IORING_OP_URING_CMD,
224251 IORING_OP_SEND_ZC,
225252 IORING_OP_SENDMSG_ZC,
253 IORING_OP_READ_MULTISHOT,
254 IORING_OP_WAITID,
255 IORING_OP_FUTEX_WAIT,
256 IORING_OP_FUTEX_WAKE,
257 IORING_OP_FUTEX_WAITV,
258 IORING_OP_FIXED_FD_INSTALL,
259 IORING_OP_FTRUNCATE,
226260
227261 /* this goes last, obviously */
228262 IORING_OP_LAST,
229263};
230264
231265/*
232 * sqe->uring_cmd_flags
266 * sqe->uring_cmd_flags top 8bits aren't available for userspace
233267 * IORING_URING_CMD_FIXED use registered buffer; pass this flag
234268 * along with setting sqe->buf_index.
235269 */
236270#define IORING_URING_CMD_FIXED (1U << 0)
271#define IORING_URING_CMD_MASK IORING_URING_CMD_FIXED
237272
238273
239274/*
......@@ -250,6 +285,7 @@ enum io_uring_op {
250285#define IORING_TIMEOUT_REALTIME (1U << 3)
251286#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
252287#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
288#define IORING_TIMEOUT_MULTISHOT (1U << 6)
253289#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
254290#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
255291/*
......@@ -284,11 +320,15 @@ enum io_uring_op {
284320 * request 'user_data'
285321 * IORING_ASYNC_CANCEL_ANY Match any request
286322 * IORING_ASYNC_CANCEL_FD_FIXED 'fd' passed in is a fixed descriptor
323 * IORING_ASYNC_CANCEL_USERDATA Match on user_data, default for no other key
324 * IORING_ASYNC_CANCEL_OP Match request based on opcode
287325 */
288326#define IORING_ASYNC_CANCEL_ALL (1U << 0)
289327#define IORING_ASYNC_CANCEL_FD (1U << 1)
290328#define IORING_ASYNC_CANCEL_ANY (1U << 2)
291329#define IORING_ASYNC_CANCEL_FD_FIXED (1U << 3)
330#define IORING_ASYNC_CANCEL_USERDATA (1U << 4)
331#define IORING_ASYNC_CANCEL_OP (1U << 5)
292332
293333/*
294334 * send/sendmsg and recv/recvmsg flags (sqe->ioprio)
......@@ -312,11 +352,20 @@ enum io_uring_op {
312352 * 0 is reported if zerocopy was actually possible.
313353 * IORING_NOTIF_USAGE_ZC_COPIED if data was copied
314354 * (at least partially).
355 *
356 * IORING_RECVSEND_BUNDLE Used with IOSQE_BUFFER_SELECT. If set, send or
357 * recv will grab as many buffers from the buffer
358 * group ID given and send them all. The completion
359 * result will be the number of buffers send, with
360 * the starting buffer ID in cqe->flags as per
361 * usual for provided buffer usage. The buffers
362 * will be contigious from the starting buffer ID.
315363 */
316364#define IORING_RECVSEND_POLL_FIRST (1U << 0)
317365#define IORING_RECV_MULTISHOT (1U << 1)
318366#define IORING_RECVSEND_FIXED_BUF (1U << 2)
319367#define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
368#define IORING_RECVSEND_BUNDLE (1U << 4)
320369
321370/*
322371 * cqe.res for IORING_CQE_F_NOTIF if
......@@ -331,11 +380,13 @@ enum io_uring_op {
331380 * accept flags stored in sqe->ioprio
332381 */
333382#define IORING_ACCEPT_MULTISHOT (1U << 0)
383#define IORING_ACCEPT_DONTWAIT (1U << 1)
384#define IORING_ACCEPT_POLL_FIRST (1U << 2)
334385
335386/*
336387 * IORING_OP_MSG_RING command types, stored in sqe->addr
337388 */
338enum {
389enum io_uring_msg_ring_flags {
339390 IORING_MSG_DATA, /* pass sqe->len as 'res' and off as user_data */
340391 IORING_MSG_SEND_FD, /* send a registered fd to another ring */
341392};
......@@ -350,6 +401,20 @@ enum {
350401/* Pass through the flags from sqe->file_index to cqe->flags */
351402#define IORING_MSG_RING_FLAGS_PASS (1U << 1)
352403
404/*
405 * IORING_OP_FIXED_FD_INSTALL flags (sqe->install_fd_flags)
406 *
407 * IORING_FIXED_FD_NO_CLOEXEC Don't mark the fd as O_CLOEXEC
408 */
409#define IORING_FIXED_FD_NO_CLOEXEC (1U << 0)
410
411/*
412 * IORING_OP_NOP flags (sqe->nop_flags)
413 *
414 * IORING_NOP_INJECT_RESULT Inject result from sqe->result
415 */
416#define IORING_NOP_INJECT_RESULT (1U << 0)
417
353418/*
354419 * IO completion data structure (Completion Queue Entry)
355420 */
......@@ -379,9 +444,7 @@ struct io_uring_cqe {
379444#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
380445#define IORING_CQE_F_NOTIF (1U << 3)
381446
382enum {
383 IORING_CQE_BUFFER_SHIFT = 16,
384};
447#define IORING_CQE_BUFFER_SHIFT 16
385448
386449/*
387450 * Magic offsets for the application to mmap the data it needs
......@@ -389,6 +452,9 @@ enum {
389452#define IORING_OFF_SQ_RING 0ULL
390453#define IORING_OFF_CQ_RING 0x8000000ULL
391454#define IORING_OFF_SQES 0x10000000ULL
455#define IORING_OFF_PBUF_RING 0x80000000ULL
456#define IORING_OFF_PBUF_SHIFT 16
457#define IORING_OFF_MMAP_MASK 0xf8000000ULL
392458
393459/*
394460 * Filled with the offset for mmap(2)
......@@ -402,7 +468,7 @@ struct io_sqring_offsets {
402468 __u32 dropped;
403469 __u32 array;
404470 __u32 resv1;
405 __u64 resv2;
471 __u64 user_addr;
406472};
407473
408474/*
......@@ -421,7 +487,7 @@ struct io_cqring_offsets {
421487 __u32 cqes;
422488 __u32 flags;
423489 __u32 resv1;
424 __u64 resv2;
490 __u64 user_addr;
425491};
426492
427493/*
......@@ -473,11 +539,12 @@ struct io_uring_params {
473539#define IORING_FEAT_CQE_SKIP (1U << 11)
474540#define IORING_FEAT_LINKED_FILE (1U << 12)
475541#define IORING_FEAT_REG_REG_RING (1U << 13)
542#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
476543
477544/*
478545 * io_uring_register(2) opcodes and arguments
479546 */
480enum {
547enum io_uring_register_op {
481548 IORING_REGISTER_BUFFERS = 0,
482549 IORING_UNREGISTER_BUFFERS = 1,
483550 IORING_REGISTER_FILES = 2,
......@@ -519,6 +586,13 @@ enum {
519586 /* register a range of fixed file slots for automatic slot allocation */
520587 IORING_REGISTER_FILE_ALLOC_RANGE = 25,
521588
589 /* return status information for a buffer group */
590 IORING_REGISTER_PBUF_STATUS = 26,
591
592 /* set/clear busy poll settings */
593 IORING_REGISTER_NAPI = 27,
594 IORING_UNREGISTER_NAPI = 28,
595
522596 /* this goes last */
523597 IORING_REGISTER_LAST,
524598
......@@ -527,7 +601,7 @@ enum {
527601};
528602
529603/* io-wq worker categories */
530enum {
604enum io_wq_type {
531605 IO_WQ_BOUND,
532606 IO_WQ_UNBOUND,
533607};
......@@ -568,19 +642,6 @@ struct io_uring_rsrc_update2 {
568642 __u32 resv2;
569643};
570644
571struct io_uring_notification_slot {
572 __u64 tag;
573 __u64 resv[3];
574};
575
576struct io_uring_notification_register {
577 __u32 nr_slots;
578 __u32 resv;
579 __u64 resv2;
580 __u64 data;
581 __u64 resv3;
582};
583
584645/* Skip updating fd indexes set to this value in the fd table */
585646#define IORING_REGISTER_FILES_SKIP (-2)
586647
......@@ -635,19 +696,48 @@ struct io_uring_buf_ring {
635696 };
636697};
637698
699/*
700 * Flags for IORING_REGISTER_PBUF_RING.
701 *
702 * IOU_PBUF_RING_MMAP: If set, kernel will allocate the memory for the ring.
703 * The application must not set a ring_addr in struct
704 * io_uring_buf_reg, instead it must subsequently call
705 * mmap(2) with the offset set as:
706 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT)
707 * to get a virtual mapping for the ring.
708 */
709enum io_uring_register_pbuf_ring_flags {
710 IOU_PBUF_RING_MMAP = 1,
711};
712
638713/* argument for IORING_(UN)REGISTER_PBUF_RING */
639714struct io_uring_buf_reg {
640715 __u64 ring_addr;
641716 __u32 ring_entries;
642717 __u16 bgid;
643 __u16 pad;
718 __u16 flags;
644719 __u64 resv[3];
645720};
646721
722/* argument for IORING_REGISTER_PBUF_STATUS */
723struct io_uring_buf_status {
724 __u32 buf_group; /* input */
725 __u32 head; /* output */
726 __u32 resv[8];
727};
728
729/* argument for IORING_(UN)REGISTER_NAPI */
730struct io_uring_napi {
731 __u32 busy_poll_to;
732 __u8 prefer_busy_poll;
733 __u8 pad[3];
734 __u64 resv;
735};
736
647737/*
648738 * io_uring_restriction->opcode values
649739 */
650enum {
740enum io_uring_register_restriction_op {
651741 /* Allow an io_uring_register(2) opcode */
652742 IORING_RESTRICTION_REGISTER_OP = 0,
653743
......@@ -678,7 +768,9 @@ struct io_uring_sync_cancel_reg {
678768 __s32 fd;
679769 __u32 flags;
680770 struct __kernel_timespec timeout;
681 __u64 pad[4];
771 __u8 opcode;
772 __u8 pad[7];
773 __u64 pad2[3];
682774};
683775
684776/*
......@@ -698,6 +790,16 @@ struct io_uring_recvmsg_out {
698790 __u32 flags;
699791};
700792
793/*
794 * Argument for IORING_OP_URING_CMD when file is a socket
795 */
796enum io_uring_socket_op {
797 SOCKET_URING_OP_SIOCINQ = 0,
798 SOCKET_URING_OP_SIOCOUTQ,
799 SOCKET_URING_OP_GETSOCKOPT,
800 SOCKET_URING_OP_SETSOCKOPT,
801};
802
701803#ifdef __cplusplus
702804}
703805#endif
lib/libc/include/any-linux-any/linux/ioam6_genl.h+20
......@@ -49,4 +49,24 @@ enum {
4949
5050#define IOAM6_CMD_MAX (__IOAM6_CMD_MAX - 1)
5151
52#define IOAM6_GENL_EV_GRP_NAME "ioam6_events"
53
54enum ioam6_event_type {
55 IOAM6_EVENT_UNSPEC,
56 IOAM6_EVENT_TRACE,
57};
58
59enum ioam6_event_attr {
60 IOAM6_EVENT_ATTR_UNSPEC,
61
62 IOAM6_EVENT_ATTR_TRACE_NAMESPACE, /* u16 */
63 IOAM6_EVENT_ATTR_TRACE_NODELEN, /* u8 */
64 IOAM6_EVENT_ATTR_TRACE_TYPE, /* u32 */
65 IOAM6_EVENT_ATTR_TRACE_DATA, /* Binary */
66
67 __IOAM6_EVENT_ATTR_MAX
68};
69
70#define IOAM6_EVENT_ATTR_MAX (__IOAM6_EVENT_ATTR_MAX - 1)
71
5272#endif /* _LINUX_IOAM6_GENL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommu.h deleted-161
......@@ -1,161 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * IOMMU user API definitions
4 */
5
6#ifndef _IOMMU_H
7#define _IOMMU_H
8
9#include <linux/types.h>
10
11#define IOMMU_FAULT_PERM_READ (1 << 0) /* read */
12#define IOMMU_FAULT_PERM_WRITE (1 << 1) /* write */
13#define IOMMU_FAULT_PERM_EXEC (1 << 2) /* exec */
14#define IOMMU_FAULT_PERM_PRIV (1 << 3) /* privileged */
15
16/* Generic fault types, can be expanded IRQ remapping fault */
17enum iommu_fault_type {
18 IOMMU_FAULT_DMA_UNRECOV = 1, /* unrecoverable fault */
19 IOMMU_FAULT_PAGE_REQ, /* page request fault */
20};
21
22enum iommu_fault_reason {
23 IOMMU_FAULT_REASON_UNKNOWN = 0,
24
25 /* Could not access the PASID table (fetch caused external abort) */
26 IOMMU_FAULT_REASON_PASID_FETCH,
27
28 /* PASID entry is invalid or has configuration errors */
29 IOMMU_FAULT_REASON_BAD_PASID_ENTRY,
30
31 /*
32 * PASID is out of range (e.g. exceeds the maximum PASID
33 * supported by the IOMMU) or disabled.
34 */
35 IOMMU_FAULT_REASON_PASID_INVALID,
36
37 /*
38 * An external abort occurred fetching (or updating) a translation
39 * table descriptor
40 */
41 IOMMU_FAULT_REASON_WALK_EABT,
42
43 /*
44 * Could not access the page table entry (Bad address),
45 * actual translation fault
46 */
47 IOMMU_FAULT_REASON_PTE_FETCH,
48
49 /* Protection flag check failed */
50 IOMMU_FAULT_REASON_PERMISSION,
51
52 /* access flag check failed */
53 IOMMU_FAULT_REASON_ACCESS,
54
55 /* Output address of a translation stage caused Address Size fault */
56 IOMMU_FAULT_REASON_OOR_ADDRESS,
57};
58
59/**
60 * struct iommu_fault_unrecoverable - Unrecoverable fault data
61 * @reason: reason of the fault, from &enum iommu_fault_reason
62 * @flags: parameters of this fault (IOMMU_FAULT_UNRECOV_* values)
63 * @pasid: Process Address Space ID
64 * @perm: requested permission access using by the incoming transaction
65 * (IOMMU_FAULT_PERM_* values)
66 * @addr: offending page address
67 * @fetch_addr: address that caused a fetch abort, if any
68 */
69struct iommu_fault_unrecoverable {
70 __u32 reason;
71#define IOMMU_FAULT_UNRECOV_PASID_VALID (1 << 0)
72#define IOMMU_FAULT_UNRECOV_ADDR_VALID (1 << 1)
73#define IOMMU_FAULT_UNRECOV_FETCH_ADDR_VALID (1 << 2)
74 __u32 flags;
75 __u32 pasid;
76 __u32 perm;
77 __u64 addr;
78 __u64 fetch_addr;
79};
80
81/**
82 * struct iommu_fault_page_request - Page Request data
83 * @flags: encodes whether the corresponding fields are valid and whether this
84 * is the last page in group (IOMMU_FAULT_PAGE_REQUEST_* values).
85 * When IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID is set, the page response
86 * must have the same PASID value as the page request. When it is clear,
87 * the page response should not have a PASID.
88 * @pasid: Process Address Space ID
89 * @grpid: Page Request Group Index
90 * @perm: requested page permissions (IOMMU_FAULT_PERM_* values)
91 * @addr: page address
92 * @private_data: device-specific private information
93 */
94struct iommu_fault_page_request {
95#define IOMMU_FAULT_PAGE_REQUEST_PASID_VALID (1 << 0)
96#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
97#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
98#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
99 __u32 flags;
100 __u32 pasid;
101 __u32 grpid;
102 __u32 perm;
103 __u64 addr;
104 __u64 private_data[2];
105};
106
107/**
108 * struct iommu_fault - Generic fault data
109 * @type: fault type from &enum iommu_fault_type
110 * @padding: reserved for future use (should be zero)
111 * @event: fault event, when @type is %IOMMU_FAULT_DMA_UNRECOV
112 * @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
113 * @padding2: sets the fault size to allow for future extensions
114 */
115struct iommu_fault {
116 __u32 type;
117 __u32 padding;
118 union {
119 struct iommu_fault_unrecoverable event;
120 struct iommu_fault_page_request prm;
121 __u8 padding2[56];
122 };
123};
124
125/**
126 * enum iommu_page_response_code - Return status of fault handlers
127 * @IOMMU_PAGE_RESP_SUCCESS: Fault has been handled and the page tables
128 * populated, retry the access. This is "Success" in PCI PRI.
129 * @IOMMU_PAGE_RESP_FAILURE: General error. Drop all subsequent faults from
130 * this device if possible. This is "Response Failure" in PCI PRI.
131 * @IOMMU_PAGE_RESP_INVALID: Could not handle this fault, don't retry the
132 * access. This is "Invalid Request" in PCI PRI.
133 */
134enum iommu_page_response_code {
135 IOMMU_PAGE_RESP_SUCCESS = 0,
136 IOMMU_PAGE_RESP_INVALID,
137 IOMMU_PAGE_RESP_FAILURE,
138};
139
140/**
141 * struct iommu_page_response - Generic page response information
142 * @argsz: User filled size of this data
143 * @version: API version of this structure
144 * @flags: encodes whether the corresponding fields are valid
145 * (IOMMU_FAULT_PAGE_RESPONSE_* values)
146 * @pasid: Process Address Space ID
147 * @grpid: Page Request Group Index
148 * @code: response code from &enum iommu_page_response_code
149 */
150struct iommu_page_response {
151 __u32 argsz;
152#define IOMMU_PAGE_RESP_VERSION_1 1
153 __u32 version;
154#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
155 __u32 flags;
156 __u32 pasid;
157 __u32 grpid;
158 __u32 code;
159};
160
161#endif /* _IOMMU_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommufd.h+348
......@@ -45,6 +45,11 @@ enum {
4545 IOMMUFD_CMD_IOAS_UNMAP,
4646 IOMMUFD_CMD_OPTION,
4747 IOMMUFD_CMD_VFIO_IOAS,
48 IOMMUFD_CMD_HWPT_ALLOC,
49 IOMMUFD_CMD_GET_HW_INFO,
50 IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING,
51 IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP,
52 IOMMUFD_CMD_HWPT_INVALIDATE,
4853};
4954
5055/**
......@@ -344,4 +349,347 @@ struct iommu_vfio_ioas {
344349 __u16 __reserved;
345350};
346351#define IOMMU_VFIO_IOAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VFIO_IOAS)
352
353/**
354 * enum iommufd_hwpt_alloc_flags - Flags for HWPT allocation
355 * @IOMMU_HWPT_ALLOC_NEST_PARENT: If set, allocate a HWPT that can serve as
356 * the parent HWPT in a nesting configuration.
357 * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is
358 * enforced on device attachment
359 */
360enum iommufd_hwpt_alloc_flags {
361 IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0,
362 IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1,
363};
364
365/**
366 * enum iommu_hwpt_vtd_s1_flags - Intel VT-d stage-1 page table
367 * entry attributes
368 * @IOMMU_VTD_S1_SRE: Supervisor request
369 * @IOMMU_VTD_S1_EAFE: Extended access enable
370 * @IOMMU_VTD_S1_WPE: Write protect enable
371 */
372enum iommu_hwpt_vtd_s1_flags {
373 IOMMU_VTD_S1_SRE = 1 << 0,
374 IOMMU_VTD_S1_EAFE = 1 << 1,
375 IOMMU_VTD_S1_WPE = 1 << 2,
376};
377
378/**
379 * struct iommu_hwpt_vtd_s1 - Intel VT-d stage-1 page table
380 * info (IOMMU_HWPT_DATA_VTD_S1)
381 * @flags: Combination of enum iommu_hwpt_vtd_s1_flags
382 * @pgtbl_addr: The base address of the stage-1 page table.
383 * @addr_width: The address width of the stage-1 page table
384 * @__reserved: Must be 0
385 */
386struct iommu_hwpt_vtd_s1 {
387 __aligned_u64 flags;
388 __aligned_u64 pgtbl_addr;
389 __u32 addr_width;
390 __u32 __reserved;
391};
392
393/**
394 * enum iommu_hwpt_data_type - IOMMU HWPT Data Type
395 * @IOMMU_HWPT_DATA_NONE: no data
396 * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table
397 */
398enum iommu_hwpt_data_type {
399 IOMMU_HWPT_DATA_NONE,
400 IOMMU_HWPT_DATA_VTD_S1,
401};
402
403/**
404 * struct iommu_hwpt_alloc - ioctl(IOMMU_HWPT_ALLOC)
405 * @size: sizeof(struct iommu_hwpt_alloc)
406 * @flags: Combination of enum iommufd_hwpt_alloc_flags
407 * @dev_id: The device to allocate this HWPT for
408 * @pt_id: The IOAS or HWPT to connect this HWPT to
409 * @out_hwpt_id: The ID of the new HWPT
410 * @__reserved: Must be 0
411 * @data_type: One of enum iommu_hwpt_data_type
412 * @data_len: Length of the type specific data
413 * @data_uptr: User pointer to the type specific data
414 *
415 * Explicitly allocate a hardware page table object. This is the same object
416 * type that is returned by iommufd_device_attach() and represents the
417 * underlying iommu driver's iommu_domain kernel object.
418 *
419 * A kernel-managed HWPT will be created with the mappings from the given
420 * IOAS via the @pt_id. The @data_type for this allocation must be set to
421 * IOMMU_HWPT_DATA_NONE. The HWPT can be allocated as a parent HWPT for a
422 * nesting configuration by passing IOMMU_HWPT_ALLOC_NEST_PARENT via @flags.
423 *
424 * A user-managed nested HWPT will be created from a given parent HWPT via
425 * @pt_id, in which the parent HWPT must be allocated previously via the
426 * same ioctl from a given IOAS (@pt_id). In this case, the @data_type
427 * must be set to a pre-defined type corresponding to an I/O page table
428 * type supported by the underlying IOMMU hardware.
429 *
430 * If the @data_type is set to IOMMU_HWPT_DATA_NONE, @data_len and
431 * @data_uptr should be zero. Otherwise, both @data_len and @data_uptr
432 * must be given.
433 */
434struct iommu_hwpt_alloc {
435 __u32 size;
436 __u32 flags;
437 __u32 dev_id;
438 __u32 pt_id;
439 __u32 out_hwpt_id;
440 __u32 __reserved;
441 __u32 data_type;
442 __u32 data_len;
443 __aligned_u64 data_uptr;
444};
445#define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC)
446
447/**
448 * enum iommu_hw_info_vtd_flags - Flags for VT-d hw_info
449 * @IOMMU_HW_INFO_VTD_ERRATA_772415_SPR17: If set, disallow read-only mappings
450 * on a nested_parent domain.
451 * https://www.intel.com/content/www/us/en/content-details/772415/content-details.html
452 */
453enum iommu_hw_info_vtd_flags {
454 IOMMU_HW_INFO_VTD_ERRATA_772415_SPR17 = 1 << 0,
455};
456
457/**
458 * struct iommu_hw_info_vtd - Intel VT-d hardware information
459 *
460 * @flags: Combination of enum iommu_hw_info_vtd_flags
461 * @__reserved: Must be 0
462 *
463 * @cap_reg: Value of Intel VT-d capability register defined in VT-d spec
464 * section 11.4.2 Capability Register.
465 * @ecap_reg: Value of Intel VT-d capability register defined in VT-d spec
466 * section 11.4.3 Extended Capability Register.
467 *
468 * User needs to understand the Intel VT-d specification to decode the
469 * register value.
470 */
471struct iommu_hw_info_vtd {
472 __u32 flags;
473 __u32 __reserved;
474 __aligned_u64 cap_reg;
475 __aligned_u64 ecap_reg;
476};
477
478/**
479 * enum iommu_hw_info_type - IOMMU Hardware Info Types
480 * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware
481 * info
482 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type
483 */
484enum iommu_hw_info_type {
485 IOMMU_HW_INFO_TYPE_NONE,
486 IOMMU_HW_INFO_TYPE_INTEL_VTD,
487};
488
489/**
490 * enum iommufd_hw_capabilities
491 * @IOMMU_HW_CAP_DIRTY_TRACKING: IOMMU hardware support for dirty tracking
492 * If available, it means the following APIs
493 * are supported:
494 *
495 * IOMMU_HWPT_GET_DIRTY_BITMAP
496 * IOMMU_HWPT_SET_DIRTY_TRACKING
497 *
498 */
499enum iommufd_hw_capabilities {
500 IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0,
501};
502
503/**
504 * struct iommu_hw_info - ioctl(IOMMU_GET_HW_INFO)
505 * @size: sizeof(struct iommu_hw_info)
506 * @flags: Must be 0
507 * @dev_id: The device bound to the iommufd
508 * @data_len: Input the length of a user buffer in bytes. Output the length of
509 * data that kernel supports
510 * @data_uptr: User pointer to a user-space buffer used by the kernel to fill
511 * the iommu type specific hardware information data
512 * @out_data_type: Output the iommu hardware info type as defined in the enum
513 * iommu_hw_info_type.
514 * @out_capabilities: Output the generic iommu capability info type as defined
515 * in the enum iommu_hw_capabilities.
516 * @__reserved: Must be 0
517 *
518 * Query an iommu type specific hardware information data from an iommu behind
519 * a given device that has been bound to iommufd. This hardware info data will
520 * be used to sync capabilities between the virtual iommu and the physical
521 * iommu, e.g. a nested translation setup needs to check the hardware info, so
522 * a guest stage-1 page table can be compatible with the physical iommu.
523 *
524 * To capture an iommu type specific hardware information data, @data_uptr and
525 * its length @data_len must be provided. Trailing bytes will be zeroed if the
526 * user buffer is larger than the data that kernel has. Otherwise, kernel only
527 * fills the buffer using the given length in @data_len. If the ioctl succeeds,
528 * @data_len will be updated to the length that kernel actually supports,
529 * @out_data_type will be filled to decode the data filled in the buffer
530 * pointed by @data_uptr. Input @data_len == zero is allowed.
531 */
532struct iommu_hw_info {
533 __u32 size;
534 __u32 flags;
535 __u32 dev_id;
536 __u32 data_len;
537 __aligned_u64 data_uptr;
538 __u32 out_data_type;
539 __u32 __reserved;
540 __aligned_u64 out_capabilities;
541};
542#define IOMMU_GET_HW_INFO _IO(IOMMUFD_TYPE, IOMMUFD_CMD_GET_HW_INFO)
543
544/*
545 * enum iommufd_hwpt_set_dirty_tracking_flags - Flags for steering dirty
546 * tracking
547 * @IOMMU_HWPT_DIRTY_TRACKING_ENABLE: Enable dirty tracking
548 */
549enum iommufd_hwpt_set_dirty_tracking_flags {
550 IOMMU_HWPT_DIRTY_TRACKING_ENABLE = 1,
551};
552
553/**
554 * struct iommu_hwpt_set_dirty_tracking - ioctl(IOMMU_HWPT_SET_DIRTY_TRACKING)
555 * @size: sizeof(struct iommu_hwpt_set_dirty_tracking)
556 * @flags: Combination of enum iommufd_hwpt_set_dirty_tracking_flags
557 * @hwpt_id: HW pagetable ID that represents the IOMMU domain
558 * @__reserved: Must be 0
559 *
560 * Toggle dirty tracking on an HW pagetable.
561 */
562struct iommu_hwpt_set_dirty_tracking {
563 __u32 size;
564 __u32 flags;
565 __u32 hwpt_id;
566 __u32 __reserved;
567};
568#define IOMMU_HWPT_SET_DIRTY_TRACKING _IO(IOMMUFD_TYPE, \
569 IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING)
570
571/**
572 * enum iommufd_hwpt_get_dirty_bitmap_flags - Flags for getting dirty bits
573 * @IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR: Just read the PTEs without clearing
574 * any dirty bits metadata. This flag
575 * can be passed in the expectation
576 * where the next operation is an unmap
577 * of the same IOVA range.
578 *
579 */
580enum iommufd_hwpt_get_dirty_bitmap_flags {
581 IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR = 1,
582};
583
584/**
585 * struct iommu_hwpt_get_dirty_bitmap - ioctl(IOMMU_HWPT_GET_DIRTY_BITMAP)
586 * @size: sizeof(struct iommu_hwpt_get_dirty_bitmap)
587 * @hwpt_id: HW pagetable ID that represents the IOMMU domain
588 * @flags: Combination of enum iommufd_hwpt_get_dirty_bitmap_flags
589 * @__reserved: Must be 0
590 * @iova: base IOVA of the bitmap first bit
591 * @length: IOVA range size
592 * @page_size: page size granularity of each bit in the bitmap
593 * @data: bitmap where to set the dirty bits. The bitmap bits each
594 * represent a page_size which you deviate from an arbitrary iova.
595 *
596 * Checking a given IOVA is dirty:
597 *
598 * data[(iova / page_size) / 64] & (1ULL << ((iova / page_size) % 64))
599 *
600 * Walk the IOMMU pagetables for a given IOVA range to return a bitmap
601 * with the dirty IOVAs. In doing so it will also by default clear any
602 * dirty bit metadata set in the IOPTE.
603 */
604struct iommu_hwpt_get_dirty_bitmap {
605 __u32 size;
606 __u32 hwpt_id;
607 __u32 flags;
608 __u32 __reserved;
609 __aligned_u64 iova;
610 __aligned_u64 length;
611 __aligned_u64 page_size;
612 __aligned_u64 data;
613};
614#define IOMMU_HWPT_GET_DIRTY_BITMAP _IO(IOMMUFD_TYPE, \
615 IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP)
616
617/**
618 * enum iommu_hwpt_invalidate_data_type - IOMMU HWPT Cache Invalidation
619 * Data Type
620 * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1
621 */
622enum iommu_hwpt_invalidate_data_type {
623 IOMMU_HWPT_INVALIDATE_DATA_VTD_S1,
624};
625
626/**
627 * enum iommu_hwpt_vtd_s1_invalidate_flags - Flags for Intel VT-d
628 * stage-1 cache invalidation
629 * @IOMMU_VTD_INV_FLAGS_LEAF: Indicates whether the invalidation applies
630 * to all-levels page structure cache or just
631 * the leaf PTE cache.
632 */
633enum iommu_hwpt_vtd_s1_invalidate_flags {
634 IOMMU_VTD_INV_FLAGS_LEAF = 1 << 0,
635};
636
637/**
638 * struct iommu_hwpt_vtd_s1_invalidate - Intel VT-d cache invalidation
639 * (IOMMU_HWPT_INVALIDATE_DATA_VTD_S1)
640 * @addr: The start address of the range to be invalidated. It needs to
641 * be 4KB aligned.
642 * @npages: Number of contiguous 4K pages to be invalidated.
643 * @flags: Combination of enum iommu_hwpt_vtd_s1_invalidate_flags
644 * @__reserved: Must be 0
645 *
646 * The Intel VT-d specific invalidation data for user-managed stage-1 cache
647 * invalidation in nested translation. Userspace uses this structure to
648 * tell the impacted cache scope after modifying the stage-1 page table.
649 *
650 * Invalidating all the caches related to the page table by setting @addr
651 * to be 0 and @npages to be U64_MAX.
652 *
653 * The device TLB will be invalidated automatically if ATS is enabled.
654 */
655struct iommu_hwpt_vtd_s1_invalidate {
656 __aligned_u64 addr;
657 __aligned_u64 npages;
658 __u32 flags;
659 __u32 __reserved;
660};
661
662/**
663 * struct iommu_hwpt_invalidate - ioctl(IOMMU_HWPT_INVALIDATE)
664 * @size: sizeof(struct iommu_hwpt_invalidate)
665 * @hwpt_id: ID of a nested HWPT for cache invalidation
666 * @data_uptr: User pointer to an array of driver-specific cache invalidation
667 * data.
668 * @data_type: One of enum iommu_hwpt_invalidate_data_type, defining the data
669 * type of all the entries in the invalidation request array. It
670 * should be a type supported by the hwpt pointed by @hwpt_id.
671 * @entry_len: Length (in bytes) of a request entry in the request array
672 * @entry_num: Input the number of cache invalidation requests in the array.
673 * Output the number of requests successfully handled by kernel.
674 * @__reserved: Must be 0.
675 *
676 * Invalidate the iommu cache for user-managed page table. Modifications on a
677 * user-managed page table should be followed by this operation to sync cache.
678 * Each ioctl can support one or more cache invalidation requests in the array
679 * that has a total size of @entry_len * @entry_num.
680 *
681 * An empty invalidation request array by setting @entry_num==0 is allowed, and
682 * @entry_len and @data_uptr would be ignored in this case. This can be used to
683 * check if the given @data_type is supported or not by kernel.
684 */
685struct iommu_hwpt_invalidate {
686 __u32 size;
687 __u32 hwpt_id;
688 __aligned_u64 data_uptr;
689 __u32 data_type;
690 __u32 entry_len;
691 __u32 entry_num;
692 __u32 __reserved;
693};
694#define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE)
347695#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioprio.h+88-13
......@@ -2,22 +2,23 @@
22#ifndef _LINUX_IOPRIO_H
33#define _LINUX_IOPRIO_H
44
5#include <linux/stddef.h>
6#include <linux/types.h>
7
58/*
69 * Gives us 8 prio classes with 13-bits of data for each class
710 */
811#define IOPRIO_CLASS_SHIFT 13
9#define IOPRIO_CLASS_MASK 0x07
12#define IOPRIO_NR_CLASSES 8
13#define IOPRIO_CLASS_MASK (IOPRIO_NR_CLASSES - 1)
1014#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
1115
1216#define IOPRIO_PRIO_CLASS(ioprio) \
1317 (((ioprio) >> IOPRIO_CLASS_SHIFT) & IOPRIO_CLASS_MASK)
1418#define IOPRIO_PRIO_DATA(ioprio) ((ioprio) & IOPRIO_PRIO_MASK)
15#define IOPRIO_PRIO_VALUE(class, data) \
16 ((((class) & IOPRIO_CLASS_MASK) << IOPRIO_CLASS_SHIFT) | \
17 ((data) & IOPRIO_PRIO_MASK))
1819
1920/*
20 * These are the io priority groups as implemented by the BFQ and mq-deadline
21 * These are the io priority classes as implemented by the BFQ and mq-deadline
2122 * schedulers. RT is the realtime class, it always gets premium service. For
2223 * ATA disks supporting NCQ IO priority, RT class IOs will be processed using
2324 * high priority NCQ commands. BE is the best-effort scheduling class, the
......@@ -25,18 +26,30 @@
2526 * served when no one else is using the disk.
2627 */
2728enum {
28 IOPRIO_CLASS_NONE,
29 IOPRIO_CLASS_RT,
30 IOPRIO_CLASS_BE,
31 IOPRIO_CLASS_IDLE,
29 IOPRIO_CLASS_NONE = 0,
30 IOPRIO_CLASS_RT = 1,
31 IOPRIO_CLASS_BE = 2,
32 IOPRIO_CLASS_IDLE = 3,
33
34 /* Special class to indicate an invalid ioprio value */
35 IOPRIO_CLASS_INVALID = 7,
3236};
3337
3438/*
35 * The RT and BE priority classes both support up to 8 priority levels.
39 * The RT and BE priority classes both support up to 8 priority levels that
40 * can be specified using the lower 3-bits of the priority data.
3641 */
37#define IOPRIO_NR_LEVELS 8
38#define IOPRIO_BE_NR IOPRIO_NR_LEVELS
42#define IOPRIO_LEVEL_NR_BITS 3
43#define IOPRIO_NR_LEVELS (1 << IOPRIO_LEVEL_NR_BITS)
44#define IOPRIO_LEVEL_MASK (IOPRIO_NR_LEVELS - 1)
45#define IOPRIO_PRIO_LEVEL(ioprio) ((ioprio) & IOPRIO_LEVEL_MASK)
46
47#define IOPRIO_BE_NR IOPRIO_NR_LEVELS
3948
49/*
50 * Possible values for the "which" argument of the ioprio_get() and
51 * ioprio_set() system calls (see "man ioprio_set").
52 */
4053enum {
4154 IOPRIO_WHO_PROCESS = 1,
4255 IOPRIO_WHO_PGRP,
......@@ -44,9 +57,71 @@ enum {
4457};
4558
4659/*
47 * Fallback BE priority level.
60 * Fallback BE class priority level.
4861 */
4962#define IOPRIO_NORM 4
5063#define IOPRIO_BE_NORM IOPRIO_NORM
5164
65/*
66 * The 10 bits between the priority class and the priority level are used to
67 * optionally define I/O hints for any combination of I/O priority class and
68 * level. Depending on the kernel configuration, I/O scheduler being used and
69 * the target I/O device being used, hints can influence how I/Os are processed
70 * without affecting the I/O scheduling ordering defined by the I/O priority
71 * class and level.
72 */
73#define IOPRIO_HINT_SHIFT IOPRIO_LEVEL_NR_BITS
74#define IOPRIO_HINT_NR_BITS 10
75#define IOPRIO_NR_HINTS (1 << IOPRIO_HINT_NR_BITS)
76#define IOPRIO_HINT_MASK (IOPRIO_NR_HINTS - 1)
77#define IOPRIO_PRIO_HINT(ioprio) \
78 (((ioprio) >> IOPRIO_HINT_SHIFT) & IOPRIO_HINT_MASK)
79
80/*
81 * I/O hints.
82 */
83enum {
84 /* No hint */
85 IOPRIO_HINT_NONE = 0,
86
87 /*
88 * Device command duration limits: indicate to the device a desired
89 * duration limit for the commands that will be used to process an I/O.
90 * These will currently only be effective for SCSI and ATA devices that
91 * support the command duration limits feature. If this feature is
92 * enabled, then the commands issued to the device to process an I/O with
93 * one of these hints set will have the duration limit index (dld field)
94 * set to the value of the hint.
95 */
96 IOPRIO_HINT_DEV_DURATION_LIMIT_1 = 1,
97 IOPRIO_HINT_DEV_DURATION_LIMIT_2 = 2,
98 IOPRIO_HINT_DEV_DURATION_LIMIT_3 = 3,
99 IOPRIO_HINT_DEV_DURATION_LIMIT_4 = 4,
100 IOPRIO_HINT_DEV_DURATION_LIMIT_5 = 5,
101 IOPRIO_HINT_DEV_DURATION_LIMIT_6 = 6,
102 IOPRIO_HINT_DEV_DURATION_LIMIT_7 = 7,
103};
104
105#define IOPRIO_BAD_VALUE(val, max) ((val) < 0 || (val) >= (max))
106
107/*
108 * Return an I/O priority value based on a class, a level and a hint.
109 */
110static __always_inline __u16 ioprio_value(int prioclass, int priolevel,
111 int priohint)
112{
113 if (IOPRIO_BAD_VALUE(prioclass, IOPRIO_NR_CLASSES) ||
114 IOPRIO_BAD_VALUE(priolevel, IOPRIO_NR_LEVELS) ||
115 IOPRIO_BAD_VALUE(priohint, IOPRIO_NR_HINTS))
116 return IOPRIO_CLASS_INVALID << IOPRIO_CLASS_SHIFT;
117
118 return (prioclass << IOPRIO_CLASS_SHIFT) |
119 (priohint << IOPRIO_HINT_SHIFT) | priolevel;
120}
121
122#define IOPRIO_PRIO_VALUE(prioclass, priolevel) \
123 ioprio_value(prioclass, priolevel, IOPRIO_HINT_NONE)
124#define IOPRIO_PRIO_VALUE_HINT(prioclass, priolevel, priohint) \
125 ioprio_value(prioclass, priolevel, priohint)
126
52127#endif /* _LINUX_IOPRIO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ipv6.h+2-1
......@@ -81,7 +81,7 @@ struct ipv6_opt_hdr {
8181struct rt0_hdr {
8282 struct ipv6_rt_hdr rt_hdr;
8383 __u32 reserved;
84 struct in6_addr addr[0];
84 struct in6_addr addr[];
8585
8686#define rt0_type rt_hdr.type
8787};
......@@ -198,6 +198,7 @@ enum {
198198 DEVCONF_IOAM6_ID_WIDE,
199199 DEVCONF_NDISC_EVICT_NOCARRIER,
200200 DEVCONF_ACCEPT_UNTRACKED_NA,
201 DEVCONF_ACCEPT_RA_MIN_LFT,
201202 DEVCONF_MAX
202203};
203204
lib/libc/include/any-linux-any/linux/isst_if.h+303
......@@ -163,10 +163,313 @@ struct isst_if_msr_cmds {
163163 struct isst_if_msr_cmd msr_cmd[1];
164164};
165165
166/**
167 * struct isst_core_power - Structure to get/set core_power feature
168 * @get_set: 0: Get, 1: Set
169 * @socket_id: Socket/package id
170 * @power_domain: Power Domain id
171 * @enable: Feature enable status
172 * @priority_type: Priority type for the feature (ordered/proportional)
173 *
174 * Structure to get/set core_power feature state using IOCTL
175 * ISST_IF_CORE_POWER_STATE.
176 */
177struct isst_core_power {
178 __u8 get_set;
179 __u8 socket_id;
180 __u8 power_domain_id;
181 __u8 enable;
182 __u8 supported;
183 __u8 priority_type;
184};
185
186/**
187 * struct isst_clos_param - Structure to get/set clos praram
188 * @get_set: 0: Get, 1: Set
189 * @socket_id: Socket/package id
190 * @power_domain: Power Domain id
191 * clos: Clos ID for the parameters
192 * min_freq_mhz: Minimum frequency in MHz
193 * max_freq_mhz: Maximum frequency in MHz
194 * prop_prio: Proportional priority from 0-15
195 *
196 * Structure to get/set per clos property using IOCTL
197 * ISST_IF_CLOS_PARAM.
198 */
199struct isst_clos_param {
200 __u8 get_set;
201 __u8 socket_id;
202 __u8 power_domain_id;
203 __u8 clos;
204 __u16 min_freq_mhz;
205 __u16 max_freq_mhz;
206 __u8 prop_prio;
207};
208
209/**
210 * struct isst_if_clos_assoc - Structure to assign clos to a CPU
211 * @socket_id: Socket/package id
212 * @power_domain: Power Domain id
213 * @logical_cpu: CPU number
214 * @clos: Clos ID to assign to the logical CPU
215 *
216 * Structure to get/set core_power feature.
217 */
218struct isst_if_clos_assoc {
219 __u8 socket_id;
220 __u8 power_domain_id;
221 __u16 logical_cpu;
222 __u16 clos;
223};
224
225/**
226 * struct isst_if_clos_assoc_cmds - Structure to assign clos to CPUs
227 * @cmd_count: Number of cmds (cpus) in this request
228 * @get_set: Request is for get or set
229 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not
230 * Linux CPU number
231 *
232 * Structure used to get/set associate CPUs to clos using IOCTL
233 * ISST_IF_CLOS_ASSOC.
234 */
235struct isst_if_clos_assoc_cmds {
236 __u16 cmd_count;
237 __u16 get_set;
238 __u16 punit_cpu_map;
239 struct isst_if_clos_assoc assoc_info[1];
240};
241
242/**
243 * struct isst_tpmi_instance_count - Get number of TPMI instances per socket
244 * @socket_id: Socket/package id
245 * @count: Number of instances
246 * @valid_mask: Mask of instances as there can be holes
247 *
248 * Structure used to get TPMI instances information using
249 * IOCTL ISST_IF_COUNT_TPMI_INSTANCES.
250 */
251struct isst_tpmi_instance_count {
252 __u8 socket_id;
253 __u8 count;
254 __u16 valid_mask;
255};
256
257/**
258 * struct isst_perf_level_info - Structure to get information on SST-PP levels
259 * @socket_id: Socket/package id
260 * @power_domain: Power Domain id
261 * @logical_cpu: CPU number
262 * @clos: Clos ID to assign to the logical CPU
263 * @max_level: Maximum performance level supported by the platform
264 * @feature_rev: The feature revision for SST-PP supported by the platform
265 * @level_mask: Mask of supported performance levels
266 * @current_level: Current performance level
267 * @feature_state: SST-BF and SST-TF (enabled/disabled) status at current level
268 * @locked: SST-PP performance level change is locked/unlocked
269 * @enabled: SST-PP feature is enabled or not
270 * @sst-tf_support: SST-TF support status at this level
271 * @sst-bf_support: SST-BF support status at this level
272 *
273 * Structure to get SST-PP details using IOCTL ISST_IF_PERF_LEVELS.
274 */
275struct isst_perf_level_info {
276 __u8 socket_id;
277 __u8 power_domain_id;
278 __u8 max_level;
279 __u8 feature_rev;
280 __u8 level_mask;
281 __u8 current_level;
282 __u8 feature_state;
283 __u8 locked;
284 __u8 enabled;
285 __u8 sst_tf_support;
286 __u8 sst_bf_support;
287};
288
289/**
290 * struct isst_perf_level_control - Structure to set SST-PP level
291 * @socket_id: Socket/package id
292 * @power_domain: Power Domain id
293 * @level: level to set
294 *
295 * Structure used change SST-PP level using IOCTL ISST_IF_PERF_SET_LEVEL.
296 */
297struct isst_perf_level_control {
298 __u8 socket_id;
299 __u8 power_domain_id;
300 __u8 level;
301};
302
303/**
304 * struct isst_perf_feature_control - Structure to activate SST-BF/SST-TF
305 * @socket_id: Socket/package id
306 * @power_domain: Power Domain id
307 * @feature: bit 0 = SST-BF state, bit 1 = SST-TF state
308 *
309 * Structure used to enable SST-BF/SST-TF using IOCTL ISST_IF_PERF_SET_FEATURE.
310 */
311struct isst_perf_feature_control {
312 __u8 socket_id;
313 __u8 power_domain_id;
314 __u8 feature;
315};
316
317#define TRL_MAX_BUCKETS 8
318#define TRL_MAX_LEVELS 6
319
320/**
321 * struct isst_perf_level_data_info - Structure to get SST-PP level details
322 * @socket_id: Socket/package id
323 * @power_domain: Power Domain id
324 * @level: SST-PP level for which caller wants to get information
325 * @tdp_ratio: TDP Ratio
326 * @base_freq_mhz: Base frequency in MHz
327 * @base_freq_avx2_mhz: AVX2 Base frequency in MHz
328 * @base_freq_avx512_mhz: AVX512 base frequency in MHz
329 * @base_freq_amx_mhz: AMX base frequency in MHz
330 * @thermal_design_power_w: Thermal design (TDP) power
331 * @tjunction_max_c: Max junction temperature
332 * @max_memory_freq_mhz: Max memory frequency in MHz
333 * @cooling_type: Type of cooling is used
334 * @p0_freq_mhz: core maximum frequency
335 * @p1_freq_mhz: Core TDP frequency
336 * @pn_freq_mhz: Core maximum efficiency frequency
337 * @pm_freq_mhz: Core minimum frequency
338 * @p0_fabric_freq_mhz: Fabric (Uncore) maximum frequency
339 * @p1_fabric_freq_mhz: Fabric (Uncore) TDP frequency
340 * @pn_fabric_freq_mhz: Fabric (Uncore) minimum efficiency frequency
341 * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency
342 * @max_buckets: Maximum trl buckets
343 * @max_trl_levels: Maximum trl levels
344 * @bucket_core_counts[TRL_MAX_BUCKETS]: Number of cores per bucket
345 * @trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]: maximum frequency
346 * for a bucket and trl level
347 *
348 * Structure used to get information on frequencies and TDP for a SST-PP
349 * level using ISST_IF_GET_PERF_LEVEL_INFO.
350 */
351struct isst_perf_level_data_info {
352 __u8 socket_id;
353 __u8 power_domain_id;
354 __u16 level;
355 __u16 tdp_ratio;
356 __u16 base_freq_mhz;
357 __u16 base_freq_avx2_mhz;
358 __u16 base_freq_avx512_mhz;
359 __u16 base_freq_amx_mhz;
360 __u16 thermal_design_power_w;
361 __u16 tjunction_max_c;
362 __u16 max_memory_freq_mhz;
363 __u16 cooling_type;
364 __u16 p0_freq_mhz;
365 __u16 p1_freq_mhz;
366 __u16 pn_freq_mhz;
367 __u16 pm_freq_mhz;
368 __u16 p0_fabric_freq_mhz;
369 __u16 p1_fabric_freq_mhz;
370 __u16 pn_fabric_freq_mhz;
371 __u16 pm_fabric_freq_mhz;
372 __u16 max_buckets;
373 __u16 max_trl_levels;
374 __u16 bucket_core_counts[TRL_MAX_BUCKETS];
375 __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
376};
377
378/**
379 * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask
380 * @socket_id: Socket/package id
381 * @power_domain: Power Domain id
382 * @level: SST-PP level for which caller wants to get information
383 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not
384 * Linux CPU number. If 0 CPU buffer is copied to user space
385 * supplied cpu_buffer of size cpu_buffer_size. Punit
386 * cpu mask is copied to "mask" field.
387 * @mask: cpu mask for this PP level (punit CPU numbering)
388 * @cpu_buffer_size: size of cpu_buffer also used to return the copied CPU
389 * buffer size.
390 * @cpu_buffer: Buffer to copy CPU mask when punit_cpu_map is 0
391 *
392 * Structure used to get cpumask for a SST-PP level using
393 * IOCTL ISST_IF_GET_PERF_LEVEL_CPU_MASK. Also used to get CPU mask for
394 * IOCTL ISST_IF_GET_BASE_FREQ_CPU_MASK for SST-BF.
395 */
396struct isst_perf_level_cpu_mask {
397 __u8 socket_id;
398 __u8 power_domain_id;
399 __u8 level;
400 __u8 punit_cpu_map;
401 __u64 mask;
402 __u16 cpu_buffer_size;
403 __s8 cpu_buffer[1];
404};
405
406/**
407 * struct isst_base_freq_info - Structure to get SST-BF frequencies
408 * @socket_id: Socket/package id
409 * @power_domain: Power Domain id
410 * @level: SST-PP level for which caller wants to get information
411 * @high_base_freq_mhz: High priority CPU base frequency
412 * @low_base_freq_mhz: Low priority CPU base frequency
413 * @tjunction_max_c: Max junction temperature
414 * @thermal_design_power_w: Thermal design power in watts
415 *
416 * Structure used to get SST-BF information using
417 * IOCTL ISST_IF_GET_BASE_FREQ_INFO.
418 */
419struct isst_base_freq_info {
420 __u8 socket_id;
421 __u8 power_domain_id;
422 __u16 level;
423 __u16 high_base_freq_mhz;
424 __u16 low_base_freq_mhz;
425 __u16 tjunction_max_c;
426 __u16 thermal_design_power_w;
427};
428
429/**
430 * struct isst_turbo_freq_info - Structure to get SST-TF frequencies
431 * @socket_id: Socket/package id
432 * @power_domain: Power Domain id
433 * @level: SST-PP level for which caller wants to get information
434 * @max_clip_freqs: Maximum number of low priority core clipping frequencies
435 * @lp_clip_freq_mhz: Clip frequencies per trl level
436 * @bucket_core_counts: Maximum number of cores for a bucket
437 * @trl_freq_mhz: Frequencies per trl level for each bucket
438 *
439 * Structure used to get SST-TF information using
440 * IOCTL ISST_IF_GET_TURBO_FREQ_INFO.
441 */
442struct isst_turbo_freq_info {
443 __u8 socket_id;
444 __u8 power_domain_id;
445 __u16 level;
446 __u16 max_clip_freqs;
447 __u16 max_buckets;
448 __u16 max_trl_levels;
449 __u16 lp_clip_freq_mhz[TRL_MAX_LEVELS];
450 __u16 bucket_core_counts[TRL_MAX_BUCKETS];
451 __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
452};
453
166454#define ISST_IF_MAGIC 0xFE
167455#define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *)
168456#define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *)
169457#define ISST_IF_IO_CMD _IOW(ISST_IF_MAGIC, 2, struct isst_if_io_regs *)
170458#define ISST_IF_MBOX_COMMAND _IOWR(ISST_IF_MAGIC, 3, struct isst_if_mbox_cmds *)
171459#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *)
460
461#define ISST_IF_COUNT_TPMI_INSTANCES _IOR(ISST_IF_MAGIC, 5, struct isst_tpmi_instance_count *)
462#define ISST_IF_CORE_POWER_STATE _IOWR(ISST_IF_MAGIC, 6, struct isst_core_power *)
463#define ISST_IF_CLOS_PARAM _IOWR(ISST_IF_MAGIC, 7, struct isst_clos_param *)
464#define ISST_IF_CLOS_ASSOC _IOWR(ISST_IF_MAGIC, 8, struct isst_if_clos_assoc_cmds *)
465
466#define ISST_IF_PERF_LEVELS _IOWR(ISST_IF_MAGIC, 9, struct isst_perf_level_info *)
467#define ISST_IF_PERF_SET_LEVEL _IOW(ISST_IF_MAGIC, 10, struct isst_perf_level_control *)
468#define ISST_IF_PERF_SET_FEATURE _IOW(ISST_IF_MAGIC, 11, struct isst_perf_feature_control *)
469#define ISST_IF_GET_PERF_LEVEL_INFO _IOR(ISST_IF_MAGIC, 12, struct isst_perf_level_data_info *)
470#define ISST_IF_GET_PERF_LEVEL_CPU_MASK _IOR(ISST_IF_MAGIC, 13, struct isst_perf_level_cpu_mask *)
471#define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *)
472#define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *)
473#define ISST_IF_GET_TURBO_FREQ_INFO _IOR(ISST_IF_MAGIC, 16, struct isst_turbo_freq_info *)
474
172475#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kexec.h+3
......@@ -12,6 +12,8 @@
1212/* kexec flags for different usage scenarios */
1313#define KEXEC_ON_CRASH 0x00000001
1414#define KEXEC_PRESERVE_CONTEXT 0x00000002
15#define KEXEC_UPDATE_ELFCOREHDR 0x00000004
16#define KEXEC_CRASH_HOTPLUG_SUPPORT 0x00000008
1517#define KEXEC_ARCH_MASK 0xffff0000
1618
1719/*
......@@ -24,6 +26,7 @@
2426#define KEXEC_FILE_UNLOAD 0x00000001
2527#define KEXEC_FILE_ON_CRASH 0x00000002
2628#define KEXEC_FILE_NO_INITRAMFS 0x00000004
29#define KEXEC_FILE_DEBUG 0x00000008
2730
2831/* These values match the ELF architecture values.
2932 * Unless there is a good reason that should continue to be the case.
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+704-3
......@@ -37,9 +37,13 @@
3737 * - 1.9 - Add available memory ioctl
3838 * - 1.10 - Add SMI profiler event log
3939 * - 1.11 - Add unified memory for ctx save/restore area
40 * - 1.12 - Add DMA buf export ioctl
41 * - 1.13 - Add debugger API
42 * - 1.14 - Update kfd_event_data
43 * - 1.15 - Enable managing mappings in compute VMs with GEM_VA ioctl
4044 */
4145#define KFD_IOCTL_MAJOR_VERSION 1
42#define KFD_IOCTL_MINOR_VERSION 11
46#define KFD_IOCTL_MINOR_VERSION 15
4347
4448struct kfd_ioctl_get_version_args {
4549 __u32 major_version; /* from KFD */
......@@ -109,6 +113,32 @@ struct kfd_ioctl_get_available_memory_args {
109113 __u32 pad;
110114};
111115
116struct kfd_dbg_device_info_entry {
117 __u64 exception_status;
118 __u64 lds_base;
119 __u64 lds_limit;
120 __u64 scratch_base;
121 __u64 scratch_limit;
122 __u64 gpuvm_base;
123 __u64 gpuvm_limit;
124 __u32 gpu_id;
125 __u32 location_id;
126 __u32 vendor_id;
127 __u32 device_id;
128 __u32 revision_id;
129 __u32 subsystem_vendor_id;
130 __u32 subsystem_device_id;
131 __u32 fw_version;
132 __u32 gfx_target_version;
133 __u32 simd_count;
134 __u32 max_waves_per_simd;
135 __u32 array_count;
136 __u32 simd_arrays_per_engine;
137 __u32 num_xcc;
138 __u32 capability;
139 __u32 debug_prop;
140};
141
112142/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
113143#define KFD_IOC_CACHE_POLICY_COHERENT 0
114144#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
......@@ -292,12 +322,20 @@ struct kfd_hsa_hw_exception_data {
292322 __u32 gpu_id;
293323};
294324
325/* hsa signal event data */
326struct kfd_hsa_signal_event_data {
327 __u64 last_event_age; /* to and from KFD */
328};
329
295330/* Event data */
296331struct kfd_event_data {
297332 union {
333 /* From KFD */
298334 struct kfd_hsa_memory_exception_data memory_exception_data;
299335 struct kfd_hsa_hw_exception_data hw_exception_data;
300 }; /* From KFD */
336 /* To and From KFD */
337 struct kfd_hsa_signal_event_data signal_event_data;
338 };
301339 __u64 kfd_event_data_ext; /* pointer to an extension structure
302340 for future exception types */
303341 __u32 event_id; /* to KFD */
......@@ -368,6 +406,7 @@ struct kfd_ioctl_acquire_vm_args {
368406#define KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM (1 << 27)
369407#define KFD_IOC_ALLOC_MEM_FLAGS_COHERENT (1 << 26)
370408#define KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED (1 << 25)
409#define KFD_IOC_ALLOC_MEM_FLAGS_EXT_COHERENT (1 << 24)
371410
372411/* Allocate memory for later SVM (shared virtual memory) mapping.
373412 *
......@@ -463,6 +502,12 @@ struct kfd_ioctl_import_dmabuf_args {
463502 __u32 dmabuf_fd; /* to KFD */
464503};
465504
505struct kfd_ioctl_export_dmabuf_args {
506 __u64 handle; /* to KFD */
507 __u32 flags; /* to KFD */
508 __u32 dmabuf_fd; /* from KFD */
509};
510
466511/*
467512 * KFD SMI(System Management Interface) events
468513 */
......@@ -616,6 +661,8 @@ enum kfd_mmio_remap {
616661#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
617662/* Keep GPU memory mapping always valid as if XNACK is disable */
618663#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
664/* Fine grained coherency between all devices using device-scope atomics */
665#define KFD_IOCTL_SVM_FLAG_EXT_COHERENT 0x00000080
619666
620667/**
621668 * kfd_ioctl_svm_op - SVM ioctl operations
......@@ -766,6 +813,651 @@ struct kfd_ioctl_set_xnack_mode_args {
766813 __s32 xnack_enabled;
767814};
768815
816/* Wave launch override modes */
817enum kfd_dbg_trap_override_mode {
818 KFD_DBG_TRAP_OVERRIDE_OR = 0,
819 KFD_DBG_TRAP_OVERRIDE_REPLACE = 1
820};
821
822/* Wave launch overrides */
823enum kfd_dbg_trap_mask {
824 KFD_DBG_TRAP_MASK_FP_INVALID = 1,
825 KFD_DBG_TRAP_MASK_FP_INPUT_DENORMAL = 2,
826 KFD_DBG_TRAP_MASK_FP_DIVIDE_BY_ZERO = 4,
827 KFD_DBG_TRAP_MASK_FP_OVERFLOW = 8,
828 KFD_DBG_TRAP_MASK_FP_UNDERFLOW = 16,
829 KFD_DBG_TRAP_MASK_FP_INEXACT = 32,
830 KFD_DBG_TRAP_MASK_INT_DIVIDE_BY_ZERO = 64,
831 KFD_DBG_TRAP_MASK_DBG_ADDRESS_WATCH = 128,
832 KFD_DBG_TRAP_MASK_DBG_MEMORY_VIOLATION = 256,
833 KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_START = (1 << 30),
834 KFD_DBG_TRAP_MASK_TRAP_ON_WAVE_END = (1 << 31)
835};
836
837/* Wave launch modes */
838enum kfd_dbg_trap_wave_launch_mode {
839 KFD_DBG_TRAP_WAVE_LAUNCH_MODE_NORMAL = 0,
840 KFD_DBG_TRAP_WAVE_LAUNCH_MODE_HALT = 1,
841 KFD_DBG_TRAP_WAVE_LAUNCH_MODE_DEBUG = 3
842};
843
844/* Address watch modes */
845enum kfd_dbg_trap_address_watch_mode {
846 KFD_DBG_TRAP_ADDRESS_WATCH_MODE_READ = 0,
847 KFD_DBG_TRAP_ADDRESS_WATCH_MODE_NONREAD = 1,
848 KFD_DBG_TRAP_ADDRESS_WATCH_MODE_ATOMIC = 2,
849 KFD_DBG_TRAP_ADDRESS_WATCH_MODE_ALL = 3
850};
851
852/* Additional wave settings */
853enum kfd_dbg_trap_flags {
854 KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP = 1,
855};
856
857/* Trap exceptions */
858enum kfd_dbg_trap_exception_code {
859 EC_NONE = 0,
860 /* per queue */
861 EC_QUEUE_WAVE_ABORT = 1,
862 EC_QUEUE_WAVE_TRAP = 2,
863 EC_QUEUE_WAVE_MATH_ERROR = 3,
864 EC_QUEUE_WAVE_ILLEGAL_INSTRUCTION = 4,
865 EC_QUEUE_WAVE_MEMORY_VIOLATION = 5,
866 EC_QUEUE_WAVE_APERTURE_VIOLATION = 6,
867 EC_QUEUE_PACKET_DISPATCH_DIM_INVALID = 16,
868 EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID = 17,
869 EC_QUEUE_PACKET_DISPATCH_CODE_INVALID = 18,
870 EC_QUEUE_PACKET_RESERVED = 19,
871 EC_QUEUE_PACKET_UNSUPPORTED = 20,
872 EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID = 21,
873 EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID = 22,
874 EC_QUEUE_PACKET_VENDOR_UNSUPPORTED = 23,
875 EC_QUEUE_PREEMPTION_ERROR = 30,
876 EC_QUEUE_NEW = 31,
877 /* per device */
878 EC_DEVICE_QUEUE_DELETE = 32,
879 EC_DEVICE_MEMORY_VIOLATION = 33,
880 EC_DEVICE_RAS_ERROR = 34,
881 EC_DEVICE_FATAL_HALT = 35,
882 EC_DEVICE_NEW = 36,
883 /* per process */
884 EC_PROCESS_RUNTIME = 48,
885 EC_PROCESS_DEVICE_REMOVE = 49,
886 EC_MAX
887};
888
889/* Mask generated by ecode in kfd_dbg_trap_exception_code */
890#define KFD_EC_MASK(ecode) (1ULL << (ecode - 1))
891
892/* Masks for exception code type checks below */
893#define KFD_EC_MASK_QUEUE (KFD_EC_MASK(EC_QUEUE_WAVE_ABORT) | \
894 KFD_EC_MASK(EC_QUEUE_WAVE_TRAP) | \
895 KFD_EC_MASK(EC_QUEUE_WAVE_MATH_ERROR) | \
896 KFD_EC_MASK(EC_QUEUE_WAVE_ILLEGAL_INSTRUCTION) | \
897 KFD_EC_MASK(EC_QUEUE_WAVE_MEMORY_VIOLATION) | \
898 KFD_EC_MASK(EC_QUEUE_WAVE_APERTURE_VIOLATION) | \
899 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_DIM_INVALID) | \
900 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID) | \
901 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_CODE_INVALID) | \
902 KFD_EC_MASK(EC_QUEUE_PACKET_RESERVED) | \
903 KFD_EC_MASK(EC_QUEUE_PACKET_UNSUPPORTED) | \
904 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID) | \
905 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID) | \
906 KFD_EC_MASK(EC_QUEUE_PACKET_VENDOR_UNSUPPORTED) | \
907 KFD_EC_MASK(EC_QUEUE_PREEMPTION_ERROR) | \
908 KFD_EC_MASK(EC_QUEUE_NEW))
909#define KFD_EC_MASK_DEVICE (KFD_EC_MASK(EC_DEVICE_QUEUE_DELETE) | \
910 KFD_EC_MASK(EC_DEVICE_RAS_ERROR) | \
911 KFD_EC_MASK(EC_DEVICE_FATAL_HALT) | \
912 KFD_EC_MASK(EC_DEVICE_MEMORY_VIOLATION) | \
913 KFD_EC_MASK(EC_DEVICE_NEW))
914#define KFD_EC_MASK_PROCESS (KFD_EC_MASK(EC_PROCESS_RUNTIME) | \
915 KFD_EC_MASK(EC_PROCESS_DEVICE_REMOVE))
916#define KFD_EC_MASK_PACKET (KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_DIM_INVALID) | \
917 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_GROUP_SEGMENT_SIZE_INVALID) | \
918 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_CODE_INVALID) | \
919 KFD_EC_MASK(EC_QUEUE_PACKET_RESERVED) | \
920 KFD_EC_MASK(EC_QUEUE_PACKET_UNSUPPORTED) | \
921 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_WORK_GROUP_SIZE_INVALID) | \
922 KFD_EC_MASK(EC_QUEUE_PACKET_DISPATCH_REGISTER_INVALID) | \
923 KFD_EC_MASK(EC_QUEUE_PACKET_VENDOR_UNSUPPORTED))
924
925/* Checks for exception code types for KFD search */
926#define KFD_DBG_EC_IS_VALID(ecode) (ecode > EC_NONE && ecode < EC_MAX)
927#define KFD_DBG_EC_TYPE_IS_QUEUE(ecode) \
928 (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_QUEUE))
929#define KFD_DBG_EC_TYPE_IS_DEVICE(ecode) \
930 (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_DEVICE))
931#define KFD_DBG_EC_TYPE_IS_PROCESS(ecode) \
932 (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_PROCESS))
933#define KFD_DBG_EC_TYPE_IS_PACKET(ecode) \
934 (KFD_DBG_EC_IS_VALID(ecode) && !!(KFD_EC_MASK(ecode) & KFD_EC_MASK_PACKET))
935
936
937/* Runtime enable states */
938enum kfd_dbg_runtime_state {
939 DEBUG_RUNTIME_STATE_DISABLED = 0,
940 DEBUG_RUNTIME_STATE_ENABLED = 1,
941 DEBUG_RUNTIME_STATE_ENABLED_BUSY = 2,
942 DEBUG_RUNTIME_STATE_ENABLED_ERROR = 3
943};
944
945/* Runtime enable status */
946struct kfd_runtime_info {
947 __u64 r_debug;
948 __u32 runtime_state;
949 __u32 ttmp_setup;
950};
951
952/* Enable modes for runtime enable */
953#define KFD_RUNTIME_ENABLE_MODE_ENABLE_MASK 1
954#define KFD_RUNTIME_ENABLE_MODE_TTMP_SAVE_MASK 2
955
956/**
957 * kfd_ioctl_runtime_enable_args - Arguments for runtime enable
958 *
959 * Coordinates debug exception signalling and debug device enablement with runtime.
960 *
961 * @r_debug - pointer to user struct for sharing information between ROCr and the debuggger
962 * @mode_mask - mask to set mode
963 * KFD_RUNTIME_ENABLE_MODE_ENABLE_MASK - enable runtime for debugging, otherwise disable
964 * KFD_RUNTIME_ENABLE_MODE_TTMP_SAVE_MASK - enable trap temporary setup (ignore on disable)
965 * @capabilities_mask - mask to notify runtime on what KFD supports
966 *
967 * Return - 0 on SUCCESS.
968 * - EBUSY if runtime enable call already pending.
969 * - EEXIST if user queues already active prior to call.
970 * If process is debug enabled, runtime enable will enable debug devices and
971 * wait for debugger process to send runtime exception EC_PROCESS_RUNTIME
972 * to unblock - see kfd_ioctl_dbg_trap_args.
973 *
974 */
975struct kfd_ioctl_runtime_enable_args {
976 __u64 r_debug;
977 __u32 mode_mask;
978 __u32 capabilities_mask;
979};
980
981/* Queue information */
982struct kfd_queue_snapshot_entry {
983 __u64 exception_status;
984 __u64 ring_base_address;
985 __u64 write_pointer_address;
986 __u64 read_pointer_address;
987 __u64 ctx_save_restore_address;
988 __u32 queue_id;
989 __u32 gpu_id;
990 __u32 ring_size;
991 __u32 queue_type;
992 __u32 ctx_save_restore_area_size;
993 __u32 reserved;
994};
995
996/* Queue status return for suspend/resume */
997#define KFD_DBG_QUEUE_ERROR_BIT 30
998#define KFD_DBG_QUEUE_INVALID_BIT 31
999#define KFD_DBG_QUEUE_ERROR_MASK (1 << KFD_DBG_QUEUE_ERROR_BIT)
1000#define KFD_DBG_QUEUE_INVALID_MASK (1 << KFD_DBG_QUEUE_INVALID_BIT)
1001
1002/* Context save area header information */
1003struct kfd_context_save_area_header {
1004 struct {
1005 __u32 control_stack_offset;
1006 __u32 control_stack_size;
1007 __u32 wave_state_offset;
1008 __u32 wave_state_size;
1009 } wave_state;
1010 __u32 debug_offset;
1011 __u32 debug_size;
1012 __u64 err_payload_addr;
1013 __u32 err_event_id;
1014 __u32 reserved1;
1015};
1016
1017/*
1018 * Debug operations
1019 *
1020 * For specifics on usage and return values, see documentation per operation
1021 * below. Otherwise, generic error returns apply:
1022 * - ESRCH if the process to debug does not exist.
1023 *
1024 * - EINVAL (with KFD_IOC_DBG_TRAP_ENABLE exempt) if operation
1025 * KFD_IOC_DBG_TRAP_ENABLE has not succeeded prior.
1026 * Also returns this error if GPU hardware scheduling is not supported.
1027 *
1028 * - EPERM (with KFD_IOC_DBG_TRAP_DISABLE exempt) if target process is not
1029 * PTRACE_ATTACHED. KFD_IOC_DBG_TRAP_DISABLE is exempt to allow
1030 * clean up of debug mode as long as process is debug enabled.
1031 *
1032 * - EACCES if any DBG_HW_OP (debug hardware operation) is requested when
1033 * AMDKFD_IOC_RUNTIME_ENABLE has not succeeded prior.
1034 *
1035 * - ENODEV if any GPU does not support debugging on a DBG_HW_OP call.
1036 *
1037 * - Other errors may be returned when a DBG_HW_OP occurs while the GPU
1038 * is in a fatal state.
1039 *
1040 */
1041enum kfd_dbg_trap_operations {
1042 KFD_IOC_DBG_TRAP_ENABLE = 0,
1043 KFD_IOC_DBG_TRAP_DISABLE = 1,
1044 KFD_IOC_DBG_TRAP_SEND_RUNTIME_EVENT = 2,
1045 KFD_IOC_DBG_TRAP_SET_EXCEPTIONS_ENABLED = 3,
1046 KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_OVERRIDE = 4, /* DBG_HW_OP */
1047 KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_MODE = 5, /* DBG_HW_OP */
1048 KFD_IOC_DBG_TRAP_SUSPEND_QUEUES = 6, /* DBG_HW_OP */
1049 KFD_IOC_DBG_TRAP_RESUME_QUEUES = 7, /* DBG_HW_OP */
1050 KFD_IOC_DBG_TRAP_SET_NODE_ADDRESS_WATCH = 8, /* DBG_HW_OP */
1051 KFD_IOC_DBG_TRAP_CLEAR_NODE_ADDRESS_WATCH = 9, /* DBG_HW_OP */
1052 KFD_IOC_DBG_TRAP_SET_FLAGS = 10,
1053 KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT = 11,
1054 KFD_IOC_DBG_TRAP_QUERY_EXCEPTION_INFO = 12,
1055 KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT = 13,
1056 KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT = 14
1057};
1058
1059/**
1060 * kfd_ioctl_dbg_trap_enable_args
1061 *
1062 * Arguments for KFD_IOC_DBG_TRAP_ENABLE.
1063 *
1064 * Enables debug session for target process. Call @op KFD_IOC_DBG_TRAP_DISABLE in
1065 * kfd_ioctl_dbg_trap_args to disable debug session.
1066 *
1067 * @exception_mask (IN) - exceptions to raise to the debugger
1068 * @rinfo_ptr (IN) - pointer to runtime info buffer (see kfd_runtime_info)
1069 * @rinfo_size (IN/OUT) - size of runtime info buffer in bytes
1070 * @dbg_fd (IN) - fd the KFD will nofify the debugger with of raised
1071 * exceptions set in exception_mask.
1072 *
1073 * Generic errors apply (see kfd_dbg_trap_operations).
1074 * Return - 0 on SUCCESS.
1075 * Copies KFD saved kfd_runtime_info to @rinfo_ptr on enable.
1076 * Size of kfd_runtime saved by the KFD returned to @rinfo_size.
1077 * - EBADF if KFD cannot get a reference to dbg_fd.
1078 * - EFAULT if KFD cannot copy runtime info to rinfo_ptr.
1079 * - EINVAL if target process is already debug enabled.
1080 *
1081 */
1082struct kfd_ioctl_dbg_trap_enable_args {
1083 __u64 exception_mask;
1084 __u64 rinfo_ptr;
1085 __u32 rinfo_size;
1086 __u32 dbg_fd;
1087};
1088
1089/**
1090 * kfd_ioctl_dbg_trap_send_runtime_event_args
1091 *
1092 *
1093 * Arguments for KFD_IOC_DBG_TRAP_SEND_RUNTIME_EVENT.
1094 * Raises exceptions to runtime.
1095 *
1096 * @exception_mask (IN) - exceptions to raise to runtime
1097 * @gpu_id (IN) - target device id
1098 * @queue_id (IN) - target queue id
1099 *
1100 * Generic errors apply (see kfd_dbg_trap_operations).
1101 * Return - 0 on SUCCESS.
1102 * - ENODEV if gpu_id not found.
1103 * If exception_mask contains EC_PROCESS_RUNTIME, unblocks pending
1104 * AMDKFD_IOC_RUNTIME_ENABLE call - see kfd_ioctl_runtime_enable_args.
1105 * All other exceptions are raised to runtime through err_payload_addr.
1106 * See kfd_context_save_area_header.
1107 */
1108struct kfd_ioctl_dbg_trap_send_runtime_event_args {
1109 __u64 exception_mask;
1110 __u32 gpu_id;
1111 __u32 queue_id;
1112};
1113
1114/**
1115 * kfd_ioctl_dbg_trap_set_exceptions_enabled_args
1116 *
1117 * Arguments for KFD_IOC_SET_EXCEPTIONS_ENABLED
1118 * Set new exceptions to be raised to the debugger.
1119 *
1120 * @exception_mask (IN) - new exceptions to raise the debugger
1121 *
1122 * Generic errors apply (see kfd_dbg_trap_operations).
1123 * Return - 0 on SUCCESS.
1124 */
1125struct kfd_ioctl_dbg_trap_set_exceptions_enabled_args {
1126 __u64 exception_mask;
1127};
1128
1129/**
1130 * kfd_ioctl_dbg_trap_set_wave_launch_override_args
1131 *
1132 * Arguments for KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_OVERRIDE
1133 * Enable HW exceptions to raise trap.
1134 *
1135 * @override_mode (IN) - see kfd_dbg_trap_override_mode
1136 * @enable_mask (IN/OUT) - reference kfd_dbg_trap_mask.
1137 * IN is the override modes requested to be enabled.
1138 * OUT is referenced in Return below.
1139 * @support_request_mask (IN/OUT) - reference kfd_dbg_trap_mask.
1140 * IN is the override modes requested for support check.
1141 * OUT is referenced in Return below.
1142 *
1143 * Generic errors apply (see kfd_dbg_trap_operations).
1144 * Return - 0 on SUCCESS.
1145 * Previous enablement is returned in @enable_mask.
1146 * Actual override support is returned in @support_request_mask.
1147 * - EINVAL if override mode is not supported.
1148 * - EACCES if trap support requested is not actually supported.
1149 * i.e. enable_mask (IN) is not a subset of support_request_mask (OUT).
1150 * Otherwise it is considered a generic error (see kfd_dbg_trap_operations).
1151 */
1152struct kfd_ioctl_dbg_trap_set_wave_launch_override_args {
1153 __u32 override_mode;
1154 __u32 enable_mask;
1155 __u32 support_request_mask;
1156 __u32 pad;
1157};
1158
1159/**
1160 * kfd_ioctl_dbg_trap_set_wave_launch_mode_args
1161 *
1162 * Arguments for KFD_IOC_DBG_TRAP_SET_WAVE_LAUNCH_MODE
1163 * Set wave launch mode.
1164 *
1165 * @mode (IN) - see kfd_dbg_trap_wave_launch_mode
1166 *
1167 * Generic errors apply (see kfd_dbg_trap_operations).
1168 * Return - 0 on SUCCESS.
1169 */
1170struct kfd_ioctl_dbg_trap_set_wave_launch_mode_args {
1171 __u32 launch_mode;
1172 __u32 pad;
1173};
1174
1175/**
1176 * kfd_ioctl_dbg_trap_suspend_queues_ags
1177 *
1178 * Arguments for KFD_IOC_DBG_TRAP_SUSPEND_QUEUES
1179 * Suspend queues.
1180 *
1181 * @exception_mask (IN) - raised exceptions to clear
1182 * @queue_array_ptr (IN) - pointer to array of queue ids (u32 per queue id)
1183 * to suspend
1184 * @num_queues (IN) - number of queues to suspend in @queue_array_ptr
1185 * @grace_period (IN) - wave time allowance before preemption
1186 * per 1K GPU clock cycle unit
1187 *
1188 * Generic errors apply (see kfd_dbg_trap_operations).
1189 * Destruction of a suspended queue is blocked until the queue is
1190 * resumed. This allows the debugger to access queue information and
1191 * the its context save area without running into a race condition on
1192 * queue destruction.
1193 * Automatically copies per queue context save area header information
1194 * into the save area base
1195 * (see kfd_queue_snapshot_entry and kfd_context_save_area_header).
1196 *
1197 * Return - Number of queues suspended on SUCCESS.
1198 * . KFD_DBG_QUEUE_ERROR_MASK and KFD_DBG_QUEUE_INVALID_MASK masked
1199 * for each queue id in @queue_array_ptr array reports unsuccessful
1200 * suspend reason.
1201 * KFD_DBG_QUEUE_ERROR_MASK = HW failure.
1202 * KFD_DBG_QUEUE_INVALID_MASK = queue does not exist, is new or
1203 * is being destroyed.
1204 */
1205struct kfd_ioctl_dbg_trap_suspend_queues_args {
1206 __u64 exception_mask;
1207 __u64 queue_array_ptr;
1208 __u32 num_queues;
1209 __u32 grace_period;
1210};
1211
1212/**
1213 * kfd_ioctl_dbg_trap_resume_queues_args
1214 *
1215 * Arguments for KFD_IOC_DBG_TRAP_RESUME_QUEUES
1216 * Resume queues.
1217 *
1218 * @queue_array_ptr (IN) - pointer to array of queue ids (u32 per queue id)
1219 * to resume
1220 * @num_queues (IN) - number of queues to resume in @queue_array_ptr
1221 *
1222 * Generic errors apply (see kfd_dbg_trap_operations).
1223 * Return - Number of queues resumed on SUCCESS.
1224 * KFD_DBG_QUEUE_ERROR_MASK and KFD_DBG_QUEUE_INVALID_MASK mask
1225 * for each queue id in @queue_array_ptr array reports unsuccessful
1226 * resume reason.
1227 * KFD_DBG_QUEUE_ERROR_MASK = HW failure.
1228 * KFD_DBG_QUEUE_INVALID_MASK = queue does not exist.
1229 */
1230struct kfd_ioctl_dbg_trap_resume_queues_args {
1231 __u64 queue_array_ptr;
1232 __u32 num_queues;
1233 __u32 pad;
1234};
1235
1236/**
1237 * kfd_ioctl_dbg_trap_set_node_address_watch_args
1238 *
1239 * Arguments for KFD_IOC_DBG_TRAP_SET_NODE_ADDRESS_WATCH
1240 * Sets address watch for device.
1241 *
1242 * @address (IN) - watch address to set
1243 * @mode (IN) - see kfd_dbg_trap_address_watch_mode
1244 * @mask (IN) - watch address mask
1245 * @gpu_id (IN) - target gpu to set watch point
1246 * @id (OUT) - watch id allocated
1247 *
1248 * Generic errors apply (see kfd_dbg_trap_operations).
1249 * Return - 0 on SUCCESS.
1250 * Allocated watch ID returned to @id.
1251 * - ENODEV if gpu_id not found.
1252 * - ENOMEM if watch IDs can be allocated
1253 */
1254struct kfd_ioctl_dbg_trap_set_node_address_watch_args {
1255 __u64 address;
1256 __u32 mode;
1257 __u32 mask;
1258 __u32 gpu_id;
1259 __u32 id;
1260};
1261
1262/**
1263 * kfd_ioctl_dbg_trap_clear_node_address_watch_args
1264 *
1265 * Arguments for KFD_IOC_DBG_TRAP_CLEAR_NODE_ADDRESS_WATCH
1266 * Clear address watch for device.
1267 *
1268 * @gpu_id (IN) - target device to clear watch point
1269 * @id (IN) - allocated watch id to clear
1270 *
1271 * Generic errors apply (see kfd_dbg_trap_operations).
1272 * Return - 0 on SUCCESS.
1273 * - ENODEV if gpu_id not found.
1274 * - EINVAL if watch ID has not been allocated.
1275 */
1276struct kfd_ioctl_dbg_trap_clear_node_address_watch_args {
1277 __u32 gpu_id;
1278 __u32 id;
1279};
1280
1281/**
1282 * kfd_ioctl_dbg_trap_set_flags_args
1283 *
1284 * Arguments for KFD_IOC_DBG_TRAP_SET_FLAGS
1285 * Sets flags for wave behaviour.
1286 *
1287 * @flags (IN/OUT) - IN = flags to enable, OUT = flags previously enabled
1288 *
1289 * Generic errors apply (see kfd_dbg_trap_operations).
1290 * Return - 0 on SUCCESS.
1291 * - EACCESS if any debug device does not allow flag options.
1292 */
1293struct kfd_ioctl_dbg_trap_set_flags_args {
1294 __u32 flags;
1295 __u32 pad;
1296};
1297
1298/**
1299 * kfd_ioctl_dbg_trap_query_debug_event_args
1300 *
1301 * Arguments for KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT
1302 *
1303 * Find one or more raised exceptions. This function can return multiple
1304 * exceptions from a single queue or a single device with one call. To find
1305 * all raised exceptions, this function must be called repeatedly until it
1306 * returns -EAGAIN. Returned exceptions can optionally be cleared by
1307 * setting the corresponding bit in the @exception_mask input parameter.
1308 * However, clearing an exception prevents retrieving further information
1309 * about it with KFD_IOC_DBG_TRAP_QUERY_EXCEPTION_INFO.
1310 *
1311 * @exception_mask (IN/OUT) - exception to clear (IN) and raised (OUT)
1312 * @gpu_id (OUT) - gpu id of exceptions raised
1313 * @queue_id (OUT) - queue id of exceptions raised
1314 *
1315 * Generic errors apply (see kfd_dbg_trap_operations).
1316 * Return - 0 on raised exception found
1317 * Raised exceptions found are returned in @exception mask
1318 * with reported source id returned in @gpu_id or @queue_id.
1319 * - EAGAIN if no raised exception has been found
1320 */
1321struct kfd_ioctl_dbg_trap_query_debug_event_args {
1322 __u64 exception_mask;
1323 __u32 gpu_id;
1324 __u32 queue_id;
1325};
1326
1327/**
1328 * kfd_ioctl_dbg_trap_query_exception_info_args
1329 *
1330 * Arguments KFD_IOC_DBG_TRAP_QUERY_EXCEPTION_INFO
1331 * Get additional info on raised exception.
1332 *
1333 * @info_ptr (IN) - pointer to exception info buffer to copy to
1334 * @info_size (IN/OUT) - exception info buffer size (bytes)
1335 * @source_id (IN) - target gpu or queue id
1336 * @exception_code (IN) - target exception
1337 * @clear_exception (IN) - clear raised @exception_code exception
1338 * (0 = false, 1 = true)
1339 *
1340 * Generic errors apply (see kfd_dbg_trap_operations).
1341 * Return - 0 on SUCCESS.
1342 * If @exception_code is EC_DEVICE_MEMORY_VIOLATION, copy @info_size(OUT)
1343 * bytes of memory exception data to @info_ptr.
1344 * If @exception_code is EC_PROCESS_RUNTIME, copy saved
1345 * kfd_runtime_info to @info_ptr.
1346 * Actual required @info_ptr size (bytes) is returned in @info_size.
1347 */
1348struct kfd_ioctl_dbg_trap_query_exception_info_args {
1349 __u64 info_ptr;
1350 __u32 info_size;
1351 __u32 source_id;
1352 __u32 exception_code;
1353 __u32 clear_exception;
1354};
1355
1356/**
1357 * kfd_ioctl_dbg_trap_get_queue_snapshot_args
1358 *
1359 * Arguments KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT
1360 * Get queue information.
1361 *
1362 * @exception_mask (IN) - exceptions raised to clear
1363 * @snapshot_buf_ptr (IN) - queue snapshot entry buffer (see kfd_queue_snapshot_entry)
1364 * @num_queues (IN/OUT) - number of queue snapshot entries
1365 * The debugger specifies the size of the array allocated in @num_queues.
1366 * KFD returns the number of queues that actually existed. If this is
1367 * larger than the size specified by the debugger, KFD will not overflow
1368 * the array allocated by the debugger.
1369 *
1370 * @entry_size (IN/OUT) - size per entry in bytes
1371 * The debugger specifies sizeof(struct kfd_queue_snapshot_entry) in
1372 * @entry_size. KFD returns the number of bytes actually populated per
1373 * entry. The debugger should use the KFD_IOCTL_MINOR_VERSION to determine,
1374 * which fields in struct kfd_queue_snapshot_entry are valid. This allows
1375 * growing the ABI in a backwards compatible manner.
1376 * Note that entry_size(IN) should still be used to stride the snapshot buffer in the
1377 * event that it's larger than actual kfd_queue_snapshot_entry.
1378 *
1379 * Generic errors apply (see kfd_dbg_trap_operations).
1380 * Return - 0 on SUCCESS.
1381 * Copies @num_queues(IN) queue snapshot entries of size @entry_size(IN)
1382 * into @snapshot_buf_ptr if @num_queues(IN) > 0.
1383 * Otherwise return @num_queues(OUT) queue snapshot entries that exist.
1384 */
1385struct kfd_ioctl_dbg_trap_queue_snapshot_args {
1386 __u64 exception_mask;
1387 __u64 snapshot_buf_ptr;
1388 __u32 num_queues;
1389 __u32 entry_size;
1390};
1391
1392/**
1393 * kfd_ioctl_dbg_trap_get_device_snapshot_args
1394 *
1395 * Arguments for KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT
1396 * Get device information.
1397 *
1398 * @exception_mask (IN) - exceptions raised to clear
1399 * @snapshot_buf_ptr (IN) - pointer to snapshot buffer (see kfd_dbg_device_info_entry)
1400 * @num_devices (IN/OUT) - number of debug devices to snapshot
1401 * The debugger specifies the size of the array allocated in @num_devices.
1402 * KFD returns the number of devices that actually existed. If this is
1403 * larger than the size specified by the debugger, KFD will not overflow
1404 * the array allocated by the debugger.
1405 *
1406 * @entry_size (IN/OUT) - size per entry in bytes
1407 * The debugger specifies sizeof(struct kfd_dbg_device_info_entry) in
1408 * @entry_size. KFD returns the number of bytes actually populated. The
1409 * debugger should use KFD_IOCTL_MINOR_VERSION to determine, which fields
1410 * in struct kfd_dbg_device_info_entry are valid. This allows growing the
1411 * ABI in a backwards compatible manner.
1412 * Note that entry_size(IN) should still be used to stride the snapshot buffer in the
1413 * event that it's larger than actual kfd_dbg_device_info_entry.
1414 *
1415 * Generic errors apply (see kfd_dbg_trap_operations).
1416 * Return - 0 on SUCCESS.
1417 * Copies @num_devices(IN) device snapshot entries of size @entry_size(IN)
1418 * into @snapshot_buf_ptr if @num_devices(IN) > 0.
1419 * Otherwise return @num_devices(OUT) queue snapshot entries that exist.
1420 */
1421struct kfd_ioctl_dbg_trap_device_snapshot_args {
1422 __u64 exception_mask;
1423 __u64 snapshot_buf_ptr;
1424 __u32 num_devices;
1425 __u32 entry_size;
1426};
1427
1428/**
1429 * kfd_ioctl_dbg_trap_args
1430 *
1431 * Arguments to debug target process.
1432 *
1433 * @pid - target process to debug
1434 * @op - debug operation (see kfd_dbg_trap_operations)
1435 *
1436 * @op determines which union struct args to use.
1437 * Refer to kern docs for each kfd_ioctl_dbg_trap_*_args struct.
1438 */
1439struct kfd_ioctl_dbg_trap_args {
1440 __u32 pid;
1441 __u32 op;
1442
1443 union {
1444 struct kfd_ioctl_dbg_trap_enable_args enable;
1445 struct kfd_ioctl_dbg_trap_send_runtime_event_args send_runtime_event;
1446 struct kfd_ioctl_dbg_trap_set_exceptions_enabled_args set_exceptions_enabled;
1447 struct kfd_ioctl_dbg_trap_set_wave_launch_override_args launch_override;
1448 struct kfd_ioctl_dbg_trap_set_wave_launch_mode_args launch_mode;
1449 struct kfd_ioctl_dbg_trap_suspend_queues_args suspend_queues;
1450 struct kfd_ioctl_dbg_trap_resume_queues_args resume_queues;
1451 struct kfd_ioctl_dbg_trap_set_node_address_watch_args set_node_address_watch;
1452 struct kfd_ioctl_dbg_trap_clear_node_address_watch_args clear_node_address_watch;
1453 struct kfd_ioctl_dbg_trap_set_flags_args set_flags;
1454 struct kfd_ioctl_dbg_trap_query_debug_event_args query_debug_event;
1455 struct kfd_ioctl_dbg_trap_query_exception_info_args query_exception_info;
1456 struct kfd_ioctl_dbg_trap_queue_snapshot_args queue_snapshot;
1457 struct kfd_ioctl_dbg_trap_device_snapshot_args device_snapshot;
1458 };
1459};
1460
7691461#define AMDKFD_IOCTL_BASE 'K'
7701462#define AMDKFD_IO(nr) _IO(AMDKFD_IOCTL_BASE, nr)
7711463#define AMDKFD_IOR(nr, type) _IOR(AMDKFD_IOCTL_BASE, nr, type)
......@@ -877,7 +1569,16 @@ struct kfd_ioctl_set_xnack_mode_args {
8771569#define AMDKFD_IOC_AVAILABLE_MEMORY \
8781570 AMDKFD_IOWR(0x23, struct kfd_ioctl_get_available_memory_args)
8791571
1572#define AMDKFD_IOC_EXPORT_DMABUF \
1573 AMDKFD_IOWR(0x24, struct kfd_ioctl_export_dmabuf_args)
1574
1575#define AMDKFD_IOC_RUNTIME_ENABLE \
1576 AMDKFD_IOWR(0x25, struct kfd_ioctl_runtime_enable_args)
1577
1578#define AMDKFD_IOC_DBG_TRAP \
1579 AMDKFD_IOWR(0x26, struct kfd_ioctl_dbg_trap_args)
1580
8801581#define AMDKFD_COMMAND_START 0x01
881#define AMDKFD_COMMAND_END 0x24
1582#define AMDKFD_COMMAND_END 0x27
8821583
8831584#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kfd_sysfs.h+15
......@@ -43,6 +43,11 @@
4343#define HSA_CAP_DOORBELL_TYPE_2_0 0x2
4444#define HSA_CAP_AQL_QUEUE_DOUBLE_MAP 0x00004000
4545
46#define HSA_CAP_TRAP_DEBUG_SUPPORT 0x00008000
47#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_TRAP_OVERRIDE_SUPPORTED 0x00010000
48#define HSA_CAP_TRAP_DEBUG_WAVE_LAUNCH_MODE_SUPPORTED 0x00020000
49#define HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED 0x00040000
50
4651/* Old buggy user mode depends on this being 0 */
4752#define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x00080000
4853
......@@ -53,8 +58,18 @@
5358#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000
5459#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000
5560#define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x10000000
61#define HSA_CAP_TRAP_DEBUG_FIRMWARE_SUPPORTED 0x20000000
5662#define HSA_CAP_RESERVED 0xe00f8000
5763
64/* debug_prop bits in node properties */
65#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f
66#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_SHIFT 0
67#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_MASK 0x000003f0
68#define HSA_DBG_WATCH_ADDR_MASK_HI_BIT_SHIFT 4
69#define HSA_DBG_DISPATCH_INFO_ALWAYS_VALID 0x00000400
70#define HSA_DBG_WATCHPOINTS_EXCLUSIVE 0x00000800
71#define HSA_DBG_RESERVED 0xfffffffffffff000ull
72
5873/* Heap types in memory properties */
5974#define HSA_MEM_HEAP_TYPE_SYSTEM 0
6075#define HSA_MEM_HEAP_TYPE_FB_PUBLIC 1
lib/libc/include/any-linux-any/linux/kvm.h+86-777
......@@ -16,75 +16,10 @@
1616
1717#define KVM_API_VERSION 12
1818
19/* *** Deprecated interfaces *** */
20
21#define KVM_TRC_SHIFT 16
22
23#define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT)
24#define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1))
25
26#define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01)
27#define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02)
28#define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01)
29
30#define KVM_TRC_HEAD_SIZE 12
31#define KVM_TRC_CYCLE_SIZE 8
32#define KVM_TRC_EXTRA_MAX 7
33
34#define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02)
35#define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03)
36#define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04)
37#define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05)
38#define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06)
39#define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07)
40#define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08)
41#define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09)
42#define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A)
43#define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B)
44#define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C)
45#define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D)
46#define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E)
47#define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F)
48#define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10)
49#define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11)
50#define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12)
51#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
52#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
53#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
54#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
55#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
56#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
57#define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19)
58
59struct kvm_user_trace_setup {
60 __u32 buf_size;
61 __u32 buf_nr;
62};
63
64#define __KVM_DEPRECATED_MAIN_W_0x06 \
65 _IOW(KVMIO, 0x06, struct kvm_user_trace_setup)
66#define __KVM_DEPRECATED_MAIN_0x07 _IO(KVMIO, 0x07)
67#define __KVM_DEPRECATED_MAIN_0x08 _IO(KVMIO, 0x08)
68
69#define __KVM_DEPRECATED_VM_R_0x70 _IOR(KVMIO, 0x70, struct kvm_assigned_irq)
70
71struct kvm_breakpoint {
72 __u32 enabled;
73 __u32 padding;
74 __u64 address;
75};
76
77struct kvm_debug_guest {
78 __u32 enabled;
79 __u32 pad;
80 struct kvm_breakpoint breakpoints[4];
81 __u32 singlestep;
82};
83
84#define __KVM_DEPRECATED_VCPU_W_0x87 _IOW(KVMIO, 0x87, struct kvm_debug_guest)
85
86/* *** End of deprecated interfaces *** */
87
19/*
20 * Backwards-compatible definitions.
21 */
22#define __KVM_HAVE_GUEST_DEBUG
8823
8924/* for KVM_SET_USER_MEMORY_REGION */
9025struct kvm_userspace_memory_region {
......@@ -95,6 +30,19 @@ struct kvm_userspace_memory_region {
9530 __u64 userspace_addr; /* start of the userspace allocated memory */
9631};
9732
33/* for KVM_SET_USER_MEMORY_REGION2 */
34struct kvm_userspace_memory_region2 {
35 __u32 slot;
36 __u32 flags;
37 __u64 guest_phys_addr;
38 __u64 memory_size;
39 __u64 userspace_addr;
40 __u64 guest_memfd_offset;
41 __u32 guest_memfd;
42 __u32 pad1;
43 __u64 pad2[14];
44};
45
9846/*
9947 * The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for
10048 * userspace, other bits are reserved for kvm internal use which are defined
......@@ -102,6 +50,7 @@ struct kvm_userspace_memory_region {
10250 */
10351#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
10452#define KVM_MEM_READONLY (1UL << 1)
53#define KVM_MEM_GUEST_MEMFD (1UL << 2)
10554
10655/* for KVM_IRQ_LINE */
10756struct kvm_irq_level {
......@@ -141,43 +90,6 @@ struct kvm_pit_config {
14190
14291#define KVM_PIT_SPEAKER_DUMMY 1
14392
144struct kvm_s390_skeys {
145 __u64 start_gfn;
146 __u64 count;
147 __u64 skeydata_addr;
148 __u32 flags;
149 __u32 reserved[9];
150};
151
152#define KVM_S390_CMMA_PEEK (1 << 0)
153
154/**
155 * kvm_s390_cmma_log - Used for CMMA migration.
156 *
157 * Used both for input and output.
158 *
159 * @start_gfn: Guest page number to start from.
160 * @count: Size of the result buffer.
161 * @flags: Control operation mode via KVM_S390_CMMA_* flags
162 * @remaining: Used with KVM_S390_GET_CMMA_BITS. Indicates how many dirty
163 * pages are still remaining.
164 * @mask: Used with KVM_S390_SET_CMMA_BITS. Bitmap of bits to actually set
165 * in the PGSTE.
166 * @values: Pointer to the values buffer.
167 *
168 * Used in KVM_S390_{G,S}ET_CMMA_BITS ioctls.
169 */
170struct kvm_s390_cmma_log {
171 __u64 start_gfn;
172 __u32 count;
173 __u32 flags;
174 union {
175 __u64 remaining;
176 __u64 mask;
177 };
178 __u64 values;
179};
180
18193struct kvm_hyperv_exit {
18294#define KVM_EXIT_HYPERV_SYNIC 1
18395#define KVM_EXIT_HYPERV_HCALL 2
......@@ -264,6 +176,8 @@ struct kvm_xen_exit {
264176#define KVM_EXIT_RISCV_SBI 35
265177#define KVM_EXIT_RISCV_CSR 36
266178#define KVM_EXIT_NOTIFY 37
179#define KVM_EXIT_LOONGARCH_IOCSR 38
180#define KVM_EXIT_MEMORY_FAULT 39
267181
268182/* For KVM_EXIT_INTERNAL_ERROR */
269183/* Emulate instruction failed. */
......@@ -336,13 +250,23 @@ struct kvm_run {
336250 __u32 len;
337251 __u8 is_write;
338252 } mmio;
253 /* KVM_EXIT_LOONGARCH_IOCSR */
254 struct {
255 __u64 phys_addr;
256 __u8 data[8];
257 __u32 len;
258 __u8 is_write;
259 } iocsr_io;
339260 /* KVM_EXIT_HYPERCALL */
340261 struct {
341262 __u64 nr;
342263 __u64 args[6];
343264 __u64 ret;
344 __u32 longmode;
345 __u32 pad;
265
266 union {
267 __u32 longmode;
268 __u64 flags;
269 };
346270 } hypercall;
347271 /* KVM_EXIT_TPR_ACCESS */
348272 struct {
......@@ -357,11 +281,6 @@ struct kvm_run {
357281 __u32 ipb;
358282 } s390_sieic;
359283 /* KVM_EXIT_S390_RESET */
360#define KVM_S390_RESET_POR 1
361#define KVM_S390_RESET_CLEAR 2
362#define KVM_S390_RESET_SUBSYSTEM 4
363#define KVM_S390_RESET_CPU_INIT 8
364#define KVM_S390_RESET_IPL 16
365284 __u64 s390_reset_flags;
366285 /* KVM_EXIT_S390_UCONTROL */
367286 struct {
......@@ -503,6 +422,13 @@ struct kvm_run {
503422#define KVM_NOTIFY_CONTEXT_INVALID (1 << 0)
504423 __u32 flags;
505424 } notify;
425 /* KVM_EXIT_MEMORY_FAULT */
426 struct {
427#define KVM_MEMORY_EXIT_FLAG_PRIVATE (1ULL << 3)
428 __u64 flags;
429 __u64 gpa;
430 __u64 size;
431 } memory_fault;
506432 /* Fix the size of the union. */
507433 char padding[256];
508434 };
......@@ -569,43 +495,6 @@ struct kvm_translation {
569495 __u8 pad[5];
570496};
571497
572/* for KVM_S390_MEM_OP */
573struct kvm_s390_mem_op {
574 /* in */
575 __u64 gaddr; /* the guest address */
576 __u64 flags; /* flags */
577 __u32 size; /* amount of bytes */
578 __u32 op; /* type of operation */
579 __u64 buf; /* buffer in userspace */
580 union {
581 struct {
582 __u8 ar; /* the access register number */
583 __u8 key; /* access key, ignored if flag unset */
584 __u8 pad1[6]; /* ignored */
585 __u64 old_addr; /* ignored if cmpxchg flag unset */
586 };
587 __u32 sida_offset; /* offset into the sida */
588 __u8 reserved[32]; /* ignored */
589 };
590};
591/* types for kvm_s390_mem_op->op */
592#define KVM_S390_MEMOP_LOGICAL_READ 0
593#define KVM_S390_MEMOP_LOGICAL_WRITE 1
594#define KVM_S390_MEMOP_SIDA_READ 2
595#define KVM_S390_MEMOP_SIDA_WRITE 3
596#define KVM_S390_MEMOP_ABSOLUTE_READ 4
597#define KVM_S390_MEMOP_ABSOLUTE_WRITE 5
598#define KVM_S390_MEMOP_ABSOLUTE_CMPXCHG 6
599
600/* flags for kvm_s390_mem_op->flags */
601#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
602#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
603#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2)
604
605/* flags specifying extension support via KVM_CAP_S390_MEM_OP_EXTENSION */
606#define KVM_S390_MEMOP_EXTENSION_CAP_BASE (1 << 0)
607#define KVM_S390_MEMOP_EXTENSION_CAP_CMPXCHG (1 << 1)
608
609498/* for KVM_INTERRUPT */
610499struct kvm_interrupt {
611500 /* in */
......@@ -670,124 +559,6 @@ struct kvm_mp_state {
670559 __u32 mp_state;
671560};
672561
673struct kvm_s390_psw {
674 __u64 mask;
675 __u64 addr;
676};
677
678/* valid values for type in kvm_s390_interrupt */
679#define KVM_S390_SIGP_STOP 0xfffe0000u
680#define KVM_S390_PROGRAM_INT 0xfffe0001u
681#define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u
682#define KVM_S390_RESTART 0xfffe0003u
683#define KVM_S390_INT_PFAULT_INIT 0xfffe0004u
684#define KVM_S390_INT_PFAULT_DONE 0xfffe0005u
685#define KVM_S390_MCHK 0xfffe1000u
686#define KVM_S390_INT_CLOCK_COMP 0xffff1004u
687#define KVM_S390_INT_CPU_TIMER 0xffff1005u
688#define KVM_S390_INT_VIRTIO 0xffff2603u
689#define KVM_S390_INT_SERVICE 0xffff2401u
690#define KVM_S390_INT_EMERGENCY 0xffff1201u
691#define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u
692/* Anything below 0xfffe0000u is taken by INT_IO */
693#define KVM_S390_INT_IO(ai,cssid,ssid,schid) \
694 (((schid)) | \
695 ((ssid) << 16) | \
696 ((cssid) << 18) | \
697 ((ai) << 26))
698#define KVM_S390_INT_IO_MIN 0x00000000u
699#define KVM_S390_INT_IO_MAX 0xfffdffffu
700#define KVM_S390_INT_IO_AI_MASK 0x04000000u
701
702
703struct kvm_s390_interrupt {
704 __u32 type;
705 __u32 parm;
706 __u64 parm64;
707};
708
709struct kvm_s390_io_info {
710 __u16 subchannel_id;
711 __u16 subchannel_nr;
712 __u32 io_int_parm;
713 __u32 io_int_word;
714};
715
716struct kvm_s390_ext_info {
717 __u32 ext_params;
718 __u32 pad;
719 __u64 ext_params2;
720};
721
722struct kvm_s390_pgm_info {
723 __u64 trans_exc_code;
724 __u64 mon_code;
725 __u64 per_address;
726 __u32 data_exc_code;
727 __u16 code;
728 __u16 mon_class_nr;
729 __u8 per_code;
730 __u8 per_atmid;
731 __u8 exc_access_id;
732 __u8 per_access_id;
733 __u8 op_access_id;
734#define KVM_S390_PGM_FLAGS_ILC_VALID 0x01
735#define KVM_S390_PGM_FLAGS_ILC_0 0x02
736#define KVM_S390_PGM_FLAGS_ILC_1 0x04
737#define KVM_S390_PGM_FLAGS_ILC_MASK 0x06
738#define KVM_S390_PGM_FLAGS_NO_REWIND 0x08
739 __u8 flags;
740 __u8 pad[2];
741};
742
743struct kvm_s390_prefix_info {
744 __u32 address;
745};
746
747struct kvm_s390_extcall_info {
748 __u16 code;
749};
750
751struct kvm_s390_emerg_info {
752 __u16 code;
753};
754
755#define KVM_S390_STOP_FLAG_STORE_STATUS 0x01
756struct kvm_s390_stop_info {
757 __u32 flags;
758};
759
760struct kvm_s390_mchk_info {
761 __u64 cr14;
762 __u64 mcic;
763 __u64 failing_storage_address;
764 __u32 ext_damage_code;
765 __u32 pad;
766 __u8 fixed_logout[16];
767};
768
769struct kvm_s390_irq {
770 __u64 type;
771 union {
772 struct kvm_s390_io_info io;
773 struct kvm_s390_ext_info ext;
774 struct kvm_s390_pgm_info pgm;
775 struct kvm_s390_emerg_info emerg;
776 struct kvm_s390_extcall_info extcall;
777 struct kvm_s390_prefix_info prefix;
778 struct kvm_s390_stop_info stop;
779 struct kvm_s390_mchk_info mchk;
780 char reserved[64];
781 } u;
782};
783
784struct kvm_s390_irq_state {
785 __u64 buf;
786 __u32 flags; /* will stay unused for compatibility reasons */
787 __u32 len;
788 __u32 reserved[4]; /* will stay unused for compatibility reasons */
789};
790
791562/* for KVM_SET_GUEST_DEBUG */
792563
793564#define KVM_GUESTDBG_ENABLE 0x00000001
......@@ -843,50 +614,6 @@ struct kvm_enable_cap {
843614 __u8 pad[64];
844615};
845616
846/* for KVM_PPC_GET_PVINFO */
847
848#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
849
850struct kvm_ppc_pvinfo {
851 /* out */
852 __u32 flags;
853 __u32 hcall[4];
854 __u8 pad[108];
855};
856
857/* for KVM_PPC_GET_SMMU_INFO */
858#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
859
860struct kvm_ppc_one_page_size {
861 __u32 page_shift; /* Page shift (or 0) */
862 __u32 pte_enc; /* Encoding in the HPTE (>>12) */
863};
864
865struct kvm_ppc_one_seg_page_size {
866 __u32 page_shift; /* Base page shift of segment (or 0) */
867 __u32 slb_enc; /* SLB encoding for BookS */
868 struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
869};
870
871#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
872#define KVM_PPC_1T_SEGMENTS 0x00000002
873#define KVM_PPC_NO_HASH 0x00000004
874
875struct kvm_ppc_smmu_info {
876 __u64 flags;
877 __u32 slb_size;
878 __u16 data_keys; /* # storage keys supported for data */
879 __u16 instr_keys; /* # storage keys supported for instructions */
880 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
881};
882
883/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */
884struct kvm_ppc_resize_hpt {
885 __u64 flags;
886 __u32 shift;
887 __u32 pad;
888};
889
890617#define KVMIO 0xAE
891618
892619/* machine type bits, to be used as argument to KVM_CREATE_VM */
......@@ -930,9 +657,6 @@ struct kvm_ppc_resize_hpt {
930657 */
931658#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
932659#define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2)
933#define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06
934#define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07
935#define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08
936660#define KVM_GET_EMULATED_CPUID _IOWR(KVMIO, 0x09, struct kvm_cpuid2)
937661#define KVM_GET_MSR_FEATURE_INDEX_LIST _IOWR(KVMIO, 0x0a, struct kvm_msr_list)
938662
......@@ -959,9 +683,7 @@ struct kvm_ppc_resize_hpt {
959683/* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
960684#define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
961685#define KVM_CAP_USER_NMI 22
962#ifdef __KVM_HAVE_GUEST_DEBUG
963686#define KVM_CAP_SET_GUEST_DEBUG 23
964#endif
965687#ifdef __KVM_HAVE_PIT
966688#define KVM_CAP_REINJECT_CONTROL 24
967689#endif
......@@ -1182,8 +904,15 @@ struct kvm_ppc_resize_hpt {
1182904#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224
1183905#define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225
1184906#define KVM_CAP_PMU_EVENT_MASKED_EVENTS 226
1185
1186#ifdef KVM_CAP_IRQ_ROUTING
907#define KVM_CAP_COUNTER_OFFSET 227
908#define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
909#define KVM_CAP_ARM_SUPPORTED_BLOCK_SIZES 229
910#define KVM_CAP_ARM_SUPPORTED_REG_MASK_RANGES 230
911#define KVM_CAP_USER_MEMORY2 231
912#define KVM_CAP_MEMORY_FAULT_INFO 232
913#define KVM_CAP_MEMORY_ATTRIBUTES 233
914#define KVM_CAP_GUEST_MEMFD 234
915#define KVM_CAP_VM_TYPES 235
1187916
1188917struct kvm_irq_routing_irqchip {
1189918 __u32 irqchip;
......@@ -1249,41 +978,6 @@ struct kvm_irq_routing {
1249978 struct kvm_irq_routing_entry entries[];
1250979};
1251980
1252#endif
1253
1254#ifdef KVM_CAP_MCE
1255/* x86 MCE */
1256struct kvm_x86_mce {
1257 __u64 status;
1258 __u64 addr;
1259 __u64 misc;
1260 __u64 mcg_status;
1261 __u8 bank;
1262 __u8 pad1[7];
1263 __u64 pad2[3];
1264};
1265#endif
1266
1267#ifdef KVM_CAP_XEN_HVM
1268#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR (1 << 0)
1269#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
1270#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
1271#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
1272#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)
1273#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)
1274#define KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG (1 << 6)
1275
1276struct kvm_xen_hvm_config {
1277 __u32 flags;
1278 __u32 msr;
1279 __u64 blob_addr_32;
1280 __u64 blob_addr_64;
1281 __u8 blob_size_32;
1282 __u8 blob_size_64;
1283 __u8 pad2[30];
1284};
1285#endif
1286
1287981#define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
1288982/*
1289983 * Available with KVM_CAP_IRQFD_RESAMPLE
......@@ -1352,6 +1046,7 @@ struct kvm_dirty_tlb {
13521046#define KVM_REG_ARM64 0x6000000000000000ULL
13531047#define KVM_REG_MIPS 0x7000000000000000ULL
13541048#define KVM_REG_RISCV 0x8000000000000000ULL
1049#define KVM_REG_LOONGARCH 0x9000000000000000ULL
13551050
13561051#define KVM_REG_SIZE_SHIFT 52
13571052#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
......@@ -1408,9 +1103,16 @@ struct kvm_device_attr {
14081103 __u64 addr; /* userspace address of attr data */
14091104};
14101105
1411#define KVM_DEV_VFIO_GROUP 1
1412#define KVM_DEV_VFIO_GROUP_ADD 1
1413#define KVM_DEV_VFIO_GROUP_DEL 2
1106#define KVM_DEV_VFIO_FILE 1
1107
1108#define KVM_DEV_VFIO_FILE_ADD 1
1109#define KVM_DEV_VFIO_FILE_DEL 2
1110
1111/* KVM_DEV_VFIO_GROUP aliases are for compile time uapi compatibility */
1112#define KVM_DEV_VFIO_GROUP KVM_DEV_VFIO_FILE
1113
1114#define KVM_DEV_VFIO_GROUP_ADD KVM_DEV_VFIO_FILE_ADD
1115#define KVM_DEV_VFIO_GROUP_DEL KVM_DEV_VFIO_FILE_DEL
14141116#define KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE 3
14151117
14161118enum kvm_device_type {
......@@ -1434,6 +1136,8 @@ enum kvm_device_type {
14341136#define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
14351137 KVM_DEV_TYPE_ARM_PV_TIME,
14361138#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
1139 KVM_DEV_TYPE_RISCV_AIA,
1140#define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA
14371141 KVM_DEV_TYPE_MAX,
14381142};
14391143
......@@ -1449,18 +1153,15 @@ struct kvm_vfio_spapr_tce {
14491153#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
14501154#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
14511155#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
1452#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
1156#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) /* deprecated */
14531157#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
14541158 struct kvm_userspace_memory_region)
14551159#define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47)
14561160#define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64)
1161#define KVM_SET_USER_MEMORY_REGION2 _IOW(KVMIO, 0x49, \
1162 struct kvm_userspace_memory_region2)
14571163
14581164/* enable ucontrol for s390 */
1459struct kvm_s390_ucas_mapping {
1460 __u64 user_addr;
1461 __u64 vcpu_addr;
1462 __u64 length;
1463};
14641165#define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
14651166#define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
14661167#define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
......@@ -1478,20 +1179,8 @@ struct kvm_s390_ucas_mapping {
14781179 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
14791180#define KVM_UNREGISTER_COALESCED_MMIO \
14801181 _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone)
1481#define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \
1482 struct kvm_assigned_pci_dev)
14831182#define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing)
1484/* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */
1485#define KVM_ASSIGN_IRQ __KVM_DEPRECATED_VM_R_0x70
1486#define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq)
14871183#define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71)
1488#define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \
1489 struct kvm_assigned_pci_dev)
1490#define KVM_ASSIGN_SET_MSIX_NR _IOW(KVMIO, 0x73, \
1491 struct kvm_assigned_msix_nr)
1492#define KVM_ASSIGN_SET_MSIX_ENTRY _IOW(KVMIO, 0x74, \
1493 struct kvm_assigned_msix_entry)
1494#define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq)
14951184#define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd)
14961185#define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config)
14971186#define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78)
......@@ -1508,9 +1197,6 @@ struct kvm_s390_ucas_mapping {
15081197* KVM_CAP_VM_TSC_CONTROL to set defaults for a VM */
15091198#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
15101199#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
1511/* Available with KVM_CAP_PCI_2_3 */
1512#define KVM_ASSIGN_SET_INTX_MASK _IOW(KVMIO, 0xa4, \
1513 struct kvm_assigned_pci_dev)
15141200/* Available with KVM_CAP_SIGNAL_MSI */
15151201#define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
15161202/* Available with KVM_CAP_PPC_GET_SMMU_INFO */
......@@ -1531,9 +1217,9 @@ struct kvm_s390_ucas_mapping {
15311217/* Available with KVM_CAP_SPAPR_RESIZE_HPT */
15321218#define KVM_PPC_RESIZE_HPT_PREPARE _IOR(KVMIO, 0xad, struct kvm_ppc_resize_hpt)
15331219#define KVM_PPC_RESIZE_HPT_COMMIT _IOR(KVMIO, 0xae, struct kvm_ppc_resize_hpt)
1534/* Available with KVM_CAP_PPC_RADIX_MMU or KVM_CAP_PPC_HASH_MMU_V3 */
1220/* Available with KVM_CAP_PPC_MMU_RADIX or KVM_CAP_PPC_MMU_HASH_V3 */
15351221#define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_cfg)
1536/* Available with KVM_CAP_PPC_RADIX_MMU */
1222/* Available with KVM_CAP_PPC_MMU_RADIX */
15371223#define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_info)
15381224/* Available with KVM_CAP_PPC_GET_CPU_CHAR */
15391225#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_char)
......@@ -1541,6 +1227,9 @@ struct kvm_s390_ucas_mapping {
15411227#define KVM_SET_PMU_EVENT_FILTER _IOW(KVMIO, 0xb2, struct kvm_pmu_event_filter)
15421228#define KVM_PPC_SVM_OFF _IO(KVMIO, 0xb3)
15431229#define KVM_ARM_MTE_COPY_TAGS _IOR(KVMIO, 0xb4, struct kvm_arm_copy_mte_tags)
1230/* Available with KVM_CAP_COUNTER_OFFSET */
1231#define KVM_ARM_SET_COUNTER_OFFSET _IOW(KVMIO, 0xb5, struct kvm_arm_counter_offset)
1232#define KVM_ARM_GET_REG_WRITABLE_MASKS _IOR(KVMIO, 0xb6, struct reg_mask_range)
15441233
15451234/* ioctl for vm fd */
15461235#define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device)
......@@ -1560,8 +1249,6 @@ struct kvm_s390_ucas_mapping {
15601249#define KVM_SET_SREGS _IOW(KVMIO, 0x84, struct kvm_sregs)
15611250#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
15621251#define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt)
1563/* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */
1564#define KVM_DEBUG_GUEST __KVM_DEPRECATED_VCPU_W_0x87
15651252#define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs)
15661253#define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs)
15671254#define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid)
......@@ -1603,7 +1290,7 @@ struct kvm_s390_ucas_mapping {
16031290#define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
16041291#define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
16051292/*
1606 * vcpu version available with KVM_ENABLE_CAP
1293 * vcpu version available with KVM_CAP_ENABLE_CAP
16071294 * vm version available with KVM_CAP_ENABLE_CAP_VM
16081295 */
16091296#define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
......@@ -1669,89 +1356,6 @@ struct kvm_enc_region {
16691356#define KVM_S390_NORMAL_RESET _IO(KVMIO, 0xc3)
16701357#define KVM_S390_CLEAR_RESET _IO(KVMIO, 0xc4)
16711358
1672struct kvm_s390_pv_sec_parm {
1673 __u64 origin;
1674 __u64 length;
1675};
1676
1677struct kvm_s390_pv_unp {
1678 __u64 addr;
1679 __u64 size;
1680 __u64 tweak;
1681};
1682
1683enum pv_cmd_dmp_id {
1684 KVM_PV_DUMP_INIT,
1685 KVM_PV_DUMP_CONFIG_STOR_STATE,
1686 KVM_PV_DUMP_COMPLETE,
1687 KVM_PV_DUMP_CPU,
1688};
1689
1690struct kvm_s390_pv_dmp {
1691 __u64 subcmd;
1692 __u64 buff_addr;
1693 __u64 buff_len;
1694 __u64 gaddr; /* For dump storage state */
1695 __u64 reserved[4];
1696};
1697
1698enum pv_cmd_info_id {
1699 KVM_PV_INFO_VM,
1700 KVM_PV_INFO_DUMP,
1701};
1702
1703struct kvm_s390_pv_info_dump {
1704 __u64 dump_cpu_buffer_len;
1705 __u64 dump_config_mem_buffer_per_1m;
1706 __u64 dump_config_finalize_len;
1707};
1708
1709struct kvm_s390_pv_info_vm {
1710 __u64 inst_calls_list[4];
1711 __u64 max_cpus;
1712 __u64 max_guests;
1713 __u64 max_guest_addr;
1714 __u64 feature_indication;
1715};
1716
1717struct kvm_s390_pv_info_header {
1718 __u32 id;
1719 __u32 len_max;
1720 __u32 len_written;
1721 __u32 reserved;
1722};
1723
1724struct kvm_s390_pv_info {
1725 struct kvm_s390_pv_info_header header;
1726 union {
1727 struct kvm_s390_pv_info_dump dump;
1728 struct kvm_s390_pv_info_vm vm;
1729 };
1730};
1731
1732enum pv_cmd_id {
1733 KVM_PV_ENABLE,
1734 KVM_PV_DISABLE,
1735 KVM_PV_SET_SEC_PARMS,
1736 KVM_PV_UNPACK,
1737 KVM_PV_VERIFY,
1738 KVM_PV_PREP_RESET,
1739 KVM_PV_UNSHARE_ALL,
1740 KVM_PV_INFO,
1741 KVM_PV_DUMP,
1742 KVM_PV_ASYNC_CLEANUP_PREPARE,
1743 KVM_PV_ASYNC_CLEANUP_PERFORM,
1744};
1745
1746struct kvm_pv_cmd {
1747 __u32 cmd; /* Command to be executed */
1748 __u16 rc; /* Ultravisor return code */
1749 __u16 rrc; /* Ultravisor return reason code */
1750 __u64 data; /* Data or address */
1751 __u32 flags; /* flags for future extensions. Must be 0 for now */
1752 __u32 reserved[3];
1753};
1754
17551359/* Available with KVM_CAP_S390_PROTECTED */
17561360#define KVM_S390_PV_COMMAND _IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
17571361
......@@ -1765,58 +1369,6 @@ struct kvm_pv_cmd {
17651369#define KVM_XEN_HVM_GET_ATTR _IOWR(KVMIO, 0xc8, struct kvm_xen_hvm_attr)
17661370#define KVM_XEN_HVM_SET_ATTR _IOW(KVMIO, 0xc9, struct kvm_xen_hvm_attr)
17671371
1768struct kvm_xen_hvm_attr {
1769 __u16 type;
1770 __u16 pad[3];
1771 union {
1772 __u8 long_mode;
1773 __u8 vector;
1774 __u8 runstate_update_flag;
1775 struct {
1776 __u64 gfn;
1777#define KVM_XEN_INVALID_GFN ((__u64)-1)
1778 } shared_info;
1779 struct {
1780 __u32 send_port;
1781 __u32 type; /* EVTCHNSTAT_ipi / EVTCHNSTAT_interdomain */
1782 __u32 flags;
1783#define KVM_XEN_EVTCHN_DEASSIGN (1 << 0)
1784#define KVM_XEN_EVTCHN_UPDATE (1 << 1)
1785#define KVM_XEN_EVTCHN_RESET (1 << 2)
1786 /*
1787 * Events sent by the guest are either looped back to
1788 * the guest itself (potentially on a different port#)
1789 * or signalled via an eventfd.
1790 */
1791 union {
1792 struct {
1793 __u32 port;
1794 __u32 vcpu;
1795 __u32 priority;
1796 } port;
1797 struct {
1798 __u32 port; /* Zero for eventfd */
1799 __s32 fd;
1800 } eventfd;
1801 __u32 padding[4];
1802 } deliver;
1803 } evtchn;
1804 __u32 xen_version;
1805 __u64 pad[8];
1806 } u;
1807};
1808
1809
1810/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1811#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
1812#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
1813#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2
1814/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
1815#define KVM_XEN_ATTR_TYPE_EVTCHN 0x3
1816#define KVM_XEN_ATTR_TYPE_XEN_VERSION 0x4
1817/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG */
1818#define KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG 0x5
1819
18201372/* Per-vCPU Xen attributes */
18211373#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
18221374#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)
......@@ -1827,242 +1379,6 @@ struct kvm_xen_hvm_attr {
18271379#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)
18281380#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)
18291381
1830struct kvm_xen_vcpu_attr {
1831 __u16 type;
1832 __u16 pad[3];
1833 union {
1834 __u64 gpa;
1835#define KVM_XEN_INVALID_GPA ((__u64)-1)
1836 __u64 pad[8];
1837 struct {
1838 __u64 state;
1839 __u64 state_entry_time;
1840 __u64 time_running;
1841 __u64 time_runnable;
1842 __u64 time_blocked;
1843 __u64 time_offline;
1844 } runstate;
1845 __u32 vcpu_id;
1846 struct {
1847 __u32 port;
1848 __u32 priority;
1849 __u64 expires_ns;
1850 } timer;
1851 __u8 vector;
1852 } u;
1853};
1854
1855/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1856#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO 0x0
1857#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO 0x1
1858#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR 0x2
1859#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
1860#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
1861#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x5
1862/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
1863#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID 0x6
1864#define KVM_XEN_VCPU_ATTR_TYPE_TIMER 0x7
1865#define KVM_XEN_VCPU_ATTR_TYPE_UPCALL_VECTOR 0x8
1866
1867/* Secure Encrypted Virtualization command */
1868enum sev_cmd_id {
1869 /* Guest initialization commands */
1870 KVM_SEV_INIT = 0,
1871 KVM_SEV_ES_INIT,
1872 /* Guest launch commands */
1873 KVM_SEV_LAUNCH_START,
1874 KVM_SEV_LAUNCH_UPDATE_DATA,
1875 KVM_SEV_LAUNCH_UPDATE_VMSA,
1876 KVM_SEV_LAUNCH_SECRET,
1877 KVM_SEV_LAUNCH_MEASURE,
1878 KVM_SEV_LAUNCH_FINISH,
1879 /* Guest migration commands (outgoing) */
1880 KVM_SEV_SEND_START,
1881 KVM_SEV_SEND_UPDATE_DATA,
1882 KVM_SEV_SEND_UPDATE_VMSA,
1883 KVM_SEV_SEND_FINISH,
1884 /* Guest migration commands (incoming) */
1885 KVM_SEV_RECEIVE_START,
1886 KVM_SEV_RECEIVE_UPDATE_DATA,
1887 KVM_SEV_RECEIVE_UPDATE_VMSA,
1888 KVM_SEV_RECEIVE_FINISH,
1889 /* Guest status and debug commands */
1890 KVM_SEV_GUEST_STATUS,
1891 KVM_SEV_DBG_DECRYPT,
1892 KVM_SEV_DBG_ENCRYPT,
1893 /* Guest certificates commands */
1894 KVM_SEV_CERT_EXPORT,
1895 /* Attestation report */
1896 KVM_SEV_GET_ATTESTATION_REPORT,
1897 /* Guest Migration Extension */
1898 KVM_SEV_SEND_CANCEL,
1899
1900 KVM_SEV_NR_MAX,
1901};
1902
1903struct kvm_sev_cmd {
1904 __u32 id;
1905 __u64 data;
1906 __u32 error;
1907 __u32 sev_fd;
1908};
1909
1910struct kvm_sev_launch_start {
1911 __u32 handle;
1912 __u32 policy;
1913 __u64 dh_uaddr;
1914 __u32 dh_len;
1915 __u64 session_uaddr;
1916 __u32 session_len;
1917};
1918
1919struct kvm_sev_launch_update_data {
1920 __u64 uaddr;
1921 __u32 len;
1922};
1923
1924
1925struct kvm_sev_launch_secret {
1926 __u64 hdr_uaddr;
1927 __u32 hdr_len;
1928 __u64 guest_uaddr;
1929 __u32 guest_len;
1930 __u64 trans_uaddr;
1931 __u32 trans_len;
1932};
1933
1934struct kvm_sev_launch_measure {
1935 __u64 uaddr;
1936 __u32 len;
1937};
1938
1939struct kvm_sev_guest_status {
1940 __u32 handle;
1941 __u32 policy;
1942 __u32 state;
1943};
1944
1945struct kvm_sev_dbg {
1946 __u64 src_uaddr;
1947 __u64 dst_uaddr;
1948 __u32 len;
1949};
1950
1951struct kvm_sev_attestation_report {
1952 __u8 mnonce[16];
1953 __u64 uaddr;
1954 __u32 len;
1955};
1956
1957struct kvm_sev_send_start {
1958 __u32 policy;
1959 __u64 pdh_cert_uaddr;
1960 __u32 pdh_cert_len;
1961 __u64 plat_certs_uaddr;
1962 __u32 plat_certs_len;
1963 __u64 amd_certs_uaddr;
1964 __u32 amd_certs_len;
1965 __u64 session_uaddr;
1966 __u32 session_len;
1967};
1968
1969struct kvm_sev_send_update_data {
1970 __u64 hdr_uaddr;
1971 __u32 hdr_len;
1972 __u64 guest_uaddr;
1973 __u32 guest_len;
1974 __u64 trans_uaddr;
1975 __u32 trans_len;
1976};
1977
1978struct kvm_sev_receive_start {
1979 __u32 handle;
1980 __u32 policy;
1981 __u64 pdh_uaddr;
1982 __u32 pdh_len;
1983 __u64 session_uaddr;
1984 __u32 session_len;
1985};
1986
1987struct kvm_sev_receive_update_data {
1988 __u64 hdr_uaddr;
1989 __u32 hdr_len;
1990 __u64 guest_uaddr;
1991 __u32 guest_len;
1992 __u64 trans_uaddr;
1993 __u32 trans_len;
1994};
1995
1996#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1997#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
1998#define KVM_DEV_ASSIGN_MASK_INTX (1 << 2)
1999
2000struct kvm_assigned_pci_dev {
2001 __u32 assigned_dev_id;
2002 __u32 busnr;
2003 __u32 devfn;
2004 __u32 flags;
2005 __u32 segnr;
2006 union {
2007 __u32 reserved[11];
2008 };
2009};
2010
2011#define KVM_DEV_IRQ_HOST_INTX (1 << 0)
2012#define KVM_DEV_IRQ_HOST_MSI (1 << 1)
2013#define KVM_DEV_IRQ_HOST_MSIX (1 << 2)
2014
2015#define KVM_DEV_IRQ_GUEST_INTX (1 << 8)
2016#define KVM_DEV_IRQ_GUEST_MSI (1 << 9)
2017#define KVM_DEV_IRQ_GUEST_MSIX (1 << 10)
2018
2019#define KVM_DEV_IRQ_HOST_MASK 0x00ff
2020#define KVM_DEV_IRQ_GUEST_MASK 0xff00
2021
2022struct kvm_assigned_irq {
2023 __u32 assigned_dev_id;
2024 __u32 host_irq; /* ignored (legacy field) */
2025 __u32 guest_irq;
2026 __u32 flags;
2027 union {
2028 __u32 reserved[12];
2029 };
2030};
2031
2032struct kvm_assigned_msix_nr {
2033 __u32 assigned_dev_id;
2034 __u16 entry_nr;
2035 __u16 padding;
2036};
2037
2038#define KVM_MAX_MSIX_PER_DEV 256
2039struct kvm_assigned_msix_entry {
2040 __u32 assigned_dev_id;
2041 __u32 gsi;
2042 __u16 entry; /* The index of entry in the MSI-X table */
2043 __u16 padding[3];
2044};
2045
2046#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
2047#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
2048
2049/* Available with KVM_CAP_ARM_USER_IRQ */
2050
2051/* Bits for run->s.regs.device_irq_level */
2052#define KVM_ARM_DEV_EL1_VTIMER (1 << 0)
2053#define KVM_ARM_DEV_EL1_PTIMER (1 << 1)
2054#define KVM_ARM_DEV_PMU (1 << 2)
2055
2056struct kvm_hyperv_eventfd {
2057 __u32 conn_id;
2058 __s32 fd;
2059 __u32 flags;
2060 __u32 padding[3];
2061};
2062
2063#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
2064#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
2065
20661382#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE (1 << 0)
20671383#define KVM_DIRTY_LOG_INITIALLY_SET (1 << 1)
20681384
......@@ -2208,31 +1524,24 @@ struct kvm_stats_desc {
22081524/* Available with KVM_CAP_S390_ZPCI_OP */
22091525#define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op)
22101526
2211struct kvm_s390_zpci_op {
2212 /* in */
2213 __u32 fh; /* target device */
2214 __u8 op; /* operation to perform */
2215 __u8 pad[3];
2216 union {
2217 /* for KVM_S390_ZPCIOP_REG_AEN */
2218 struct {
2219 __u64 ibv; /* Guest addr of interrupt bit vector */
2220 __u64 sb; /* Guest addr of summary bit */
2221 __u32 flags;
2222 __u32 noi; /* Number of interrupts */
2223 __u8 isc; /* Guest interrupt subclass */
2224 __u8 sbo; /* Offset of guest summary bit vector */
2225 __u16 pad;
2226 } reg_aen;
2227 __u64 reserved[8];
2228 } u;
1527/* Available with KVM_CAP_MEMORY_ATTRIBUTES */
1528#define KVM_SET_MEMORY_ATTRIBUTES _IOW(KVMIO, 0xd2, struct kvm_memory_attributes)
1529
1530struct kvm_memory_attributes {
1531 __u64 address;
1532 __u64 size;
1533 __u64 attributes;
1534 __u64 flags;
22291535};
22301536
2231/* types for kvm_s390_zpci_op->op */
2232#define KVM_S390_ZPCIOP_REG_AEN 0
2233#define KVM_S390_ZPCIOP_DEREG_AEN 1
1537#define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3)
1538
1539#define KVM_CREATE_GUEST_MEMFD _IOWR(KVMIO, 0xd4, struct kvm_create_guest_memfd)
22341540
2235/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
2236#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
1541struct kvm_create_guest_memfd {
1542 __u64 size;
1543 __u64 flags;
1544 __u64 reserved[6];
1545};
22371546
22381547#endif /* __LINUX_KVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/landlock.h+116-23
......@@ -31,6 +31,12 @@ struct landlock_ruleset_attr {
3131 * this access right.
3232 */
3333 __u64 handled_access_fs;
34 /**
35 * @handled_access_net: Bitmask of actions (cf. `Network flags`_)
36 * that is handled by this ruleset and should then be forbidden if no
37 * rule explicitly allow them.
38 */
39 __u64 handled_access_net;
3440};
3541
3642/*
......@@ -54,6 +60,11 @@ enum landlock_rule_type {
5460 * landlock_path_beneath_attr .
5561 */
5662 LANDLOCK_RULE_PATH_BENEATH = 1,
63 /**
64 * @LANDLOCK_RULE_NET_PORT: Type of a &struct
65 * landlock_net_port_attr .
66 */
67 LANDLOCK_RULE_NET_PORT,
5768};
5869
5970/**
......@@ -79,6 +90,31 @@ struct landlock_path_beneath_attr {
7990 */
8091} __attribute__((packed));
8192
93/**
94 * struct landlock_net_port_attr - Network port definition
95 *
96 * Argument of sys_landlock_add_rule().
97 */
98struct landlock_net_port_attr {
99 /**
100 * @allowed_access: Bitmask of allowed access network for a port
101 * (cf. `Network flags`_).
102 */
103 __u64 allowed_access;
104 /**
105 * @port: Network port in host endianness.
106 *
107 * It should be noted that port 0 passed to :manpage:`bind(2)` will
108 * bind to an available port from a specific port range. This can be
109 * configured thanks to the ``/proc/sys/net/ipv4/ip_local_port_range``
110 * sysctl (also used for IPv6). A Landlock rule with port 0 and the
111 * ``LANDLOCK_ACCESS_NET_BIND_TCP`` right means that requesting to bind
112 * on port 0 is allowed and it will automatically translate to binding
113 * on the related port range.
114 */
115 __u64 port;
116};
117
82118/**
83119 * DOC: fs_access
84120 *
......@@ -92,7 +128,7 @@ struct landlock_path_beneath_attr {
92128 * files and directories. Files or directories opened before the sandboxing
93129 * are not subject to these restrictions.
94130 *
95 * A file can only receive these access rights:
131 * The following access rights apply only to files:
96132 *
97133 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.
98134 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access. Note that
......@@ -102,12 +138,13 @@ struct landlock_path_beneath_attr {
102138 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.
103139 * - %LANDLOCK_ACCESS_FS_TRUNCATE: Truncate a file with :manpage:`truncate(2)`,
104140 * :manpage:`ftruncate(2)`, :manpage:`creat(2)`, or :manpage:`open(2)` with
105 * ``O_TRUNC``. Whether an opened file can be truncated with
106 * :manpage:`ftruncate(2)` is determined during :manpage:`open(2)`, in the
107 * same way as read and write permissions are checked during
108 * :manpage:`open(2)` using %LANDLOCK_ACCESS_FS_READ_FILE and
109 * %LANDLOCK_ACCESS_FS_WRITE_FILE. This access right is available since the
110 * third version of the Landlock ABI.
141 * ``O_TRUNC``. This access right is available since the third version of the
142 * Landlock ABI.
143 *
144 * Whether an opened file can be truncated with :manpage:`ftruncate(2)` or used
145 * with `ioctl(2)` is determined during :manpage:`open(2)`, in the same way as
146 * read and write permissions are checked during :manpage:`open(2)` using
147 * %LANDLOCK_ACCESS_FS_READ_FILE and %LANDLOCK_ACCESS_FS_WRITE_FILE.
111148 *
112149 * A directory can receive access rights related to files or directories. The
113150 * following access right is applied to the directory itself, and the
......@@ -130,21 +167,57 @@ struct landlock_path_beneath_attr {
130167 * - %LANDLOCK_ACCESS_FS_MAKE_BLOCK: Create (or rename or link) a block device.
131168 * - %LANDLOCK_ACCESS_FS_MAKE_SYM: Create (or rename or link) a symbolic link.
132169 * - %LANDLOCK_ACCESS_FS_REFER: Link or rename a file from or to a different
133 * directory (i.e. reparent a file hierarchy). This access right is
134 * available since the second version of the Landlock ABI. This is also the
135 * only access right which is always considered handled by any ruleset in
136 * such a way that reparenting a file hierarchy is always denied by default.
137 * To avoid privilege escalation, it is not enough to add a rule with this
138 * access right. When linking or renaming a file, the destination directory
139 * hierarchy must also always have the same or a superset of restrictions of
140 * the source hierarchy. If it is not the case, or if the domain doesn't
141 * handle this access right, such actions are denied by default with errno
142 * set to ``EXDEV``. Linking also requires a ``LANDLOCK_ACCESS_FS_MAKE_*``
143 * access right on the destination directory, and renaming also requires a
144 * ``LANDLOCK_ACCESS_FS_REMOVE_*`` access right on the source's (file or
145 * directory) parent. Otherwise, such actions are denied with errno set to
146 * ``EACCES``. The ``EACCES`` errno prevails over ``EXDEV`` to let user space
147 * efficiently deal with an unrecoverable error.
170 * directory (i.e. reparent a file hierarchy).
171 *
172 * This access right is available since the second version of the Landlock
173 * ABI.
174 *
175 * This is the only access right which is denied by default by any ruleset,
176 * even if the right is not specified as handled at ruleset creation time.
177 * The only way to make a ruleset grant this right is to explicitly allow it
178 * for a specific directory by adding a matching rule to the ruleset.
179 *
180 * In particular, when using the first Landlock ABI version, Landlock will
181 * always deny attempts to reparent files between different directories.
182 *
183 * In addition to the source and destination directories having the
184 * %LANDLOCK_ACCESS_FS_REFER access right, the attempted link or rename
185 * operation must meet the following constraints:
186 *
187 * * The reparented file may not gain more access rights in the destination
188 * directory than it previously had in the source directory. If this is
189 * attempted, the operation results in an ``EXDEV`` error.
190 *
191 * * When linking or renaming, the ``LANDLOCK_ACCESS_FS_MAKE_*`` right for the
192 * respective file type must be granted for the destination directory.
193 * Otherwise, the operation results in an ``EACCES`` error.
194 *
195 * * When renaming, the ``LANDLOCK_ACCESS_FS_REMOVE_*`` right for the
196 * respective file type must be granted for the source directory. Otherwise,
197 * the operation results in an ``EACCES`` error.
198 *
199 * If multiple requirements are not met, the ``EACCES`` error code takes
200 * precedence over ``EXDEV``.
201 *
202 * The following access right applies both to files and directories:
203 *
204 * - %LANDLOCK_ACCESS_FS_IOCTL_DEV: Invoke :manpage:`ioctl(2)` commands on an opened
205 * character or block device.
206 *
207 * This access right applies to all `ioctl(2)` commands implemented by device
208 * drivers. However, the following common IOCTL commands continue to be
209 * invokable independent of the %LANDLOCK_ACCESS_FS_IOCTL_DEV right:
210 *
211 * * IOCTL commands targeting file descriptors (``FIOCLEX``, ``FIONCLEX``),
212 * * IOCTL commands targeting file descriptions (``FIONBIO``, ``FIOASYNC``),
213 * * IOCTL commands targeting file systems (``FIFREEZE``, ``FITHAW``,
214 * ``FIGETBSZ``, ``FS_IOC_GETFSUUID``, ``FS_IOC_GETFSSYSFSPATH``)
215 * * Some IOCTL commands which do not make sense when used with devices, but
216 * whose implementations are safe and return the right error codes
217 * (``FS_IOC_FIEMAP``, ``FICLONE``, ``FICLONERANGE``, ``FIDEDUPERANGE``)
218 *
219 * This access right is available since the fifth version of the Landlock
220 * ABI.
148221 *
149222 * .. warning::
150223 *
......@@ -152,7 +225,7 @@ struct landlock_path_beneath_attr {
152225 * accessible through these syscall families: :manpage:`chdir(2)`,
153226 * :manpage:`stat(2)`, :manpage:`flock(2)`, :manpage:`chmod(2)`,
154227 * :manpage:`chown(2)`, :manpage:`setxattr(2)`, :manpage:`utime(2)`,
155 * :manpage:`ioctl(2)`, :manpage:`fcntl(2)`, :manpage:`access(2)`.
228 * :manpage:`fcntl(2)`, :manpage:`access(2)`.
156229 * Future Landlock evolutions will enable to restrict them.
157230 */
158231/* clang-format off */
......@@ -171,6 +244,26 @@ struct landlock_path_beneath_attr {
171244#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)
172245#define LANDLOCK_ACCESS_FS_REFER (1ULL << 13)
173246#define LANDLOCK_ACCESS_FS_TRUNCATE (1ULL << 14)
247#define LANDLOCK_ACCESS_FS_IOCTL_DEV (1ULL << 15)
174248/* clang-format on */
175249
250/**
251 * DOC: net_access
252 *
253 * Network flags
254 * ~~~~~~~~~~~~~~~~
255 *
256 * These flags enable to restrict a sandboxed process to a set of network
257 * actions. This is supported since the Landlock ABI version 4.
258 *
259 * TCP sockets with allowed actions:
260 *
261 * - %LANDLOCK_ACCESS_NET_BIND_TCP: Bind a TCP socket to a local port.
262 * - %LANDLOCK_ACCESS_NET_CONNECT_TCP: Connect an active TCP socket to
263 * a remote port.
264 */
265/* clang-format off */
266#define LANDLOCK_ACCESS_NET_BIND_TCP (1ULL << 0)
267#define LANDLOCK_ACCESS_NET_CONNECT_TCP (1ULL << 1)
268/* clang-format on */
176269#endif /* _LINUX_LANDLOCK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/lsm.h created+92
......@@ -0,0 +1,92 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Linux Security Modules (LSM) - User space API
4 *
5 * Copyright (C) 2022 Casey Schaufler <casey@schaufler-ca.com>
6 * Copyright (C) 2022 Intel Corporation
7 */
8
9#ifndef _LINUX_LSM_H
10#define _LINUX_LSM_H
11
12#include <linux/stddef.h>
13#include <linux/types.h>
14#include <linux/unistd.h>
15
16/**
17 * struct lsm_ctx - LSM context information
18 * @id: the LSM id number, see LSM_ID_XXX
19 * @flags: LSM specific flags
20 * @len: length of the lsm_ctx struct, @ctx and any other data or padding
21 * @ctx_len: the size of @ctx
22 * @ctx: the LSM context value
23 *
24 * The @len field MUST be equal to the size of the lsm_ctx struct
25 * plus any additional padding and/or data placed after @ctx.
26 *
27 * In all cases @ctx_len MUST be equal to the length of @ctx.
28 * If @ctx is a string value it should be nul terminated with
29 * @ctx_len equal to `strlen(@ctx) + 1`. Binary values are
30 * supported.
31 *
32 * The @flags and @ctx fields SHOULD only be interpreted by the
33 * LSM specified by @id; they MUST be set to zero/0 when not used.
34 */
35struct lsm_ctx {
36 __u64 id;
37 __u64 flags;
38 __u64 len;
39 __u64 ctx_len;
40 __u8 ctx[] __counted_by(ctx_len);
41};
42
43/*
44 * ID tokens to identify Linux Security Modules (LSMs)
45 *
46 * These token values are used to uniquely identify specific LSMs
47 * in the kernel as well as in the kernel's LSM userspace API.
48 *
49 * A value of zero/0 is considered undefined and should not be used
50 * outside the kernel. Values 1-99 are reserved for potential
51 * future use.
52 */
53#define LSM_ID_UNDEF 0
54#define LSM_ID_CAPABILITY 100
55#define LSM_ID_SELINUX 101
56#define LSM_ID_SMACK 102
57#define LSM_ID_TOMOYO 103
58#define LSM_ID_APPARMOR 104
59#define LSM_ID_YAMA 105
60#define LSM_ID_LOADPIN 106
61#define LSM_ID_SAFESETID 107
62#define LSM_ID_LOCKDOWN 108
63#define LSM_ID_BPF 109
64#define LSM_ID_LANDLOCK 110
65#define LSM_ID_IMA 111
66#define LSM_ID_EVM 112
67
68/*
69 * LSM_ATTR_XXX definitions identify different LSM attributes
70 * which are used in the kernel's LSM userspace API. Support
71 * for these attributes vary across the different LSMs. None
72 * are required.
73 *
74 * A value of zero/0 is considered undefined and should not be used
75 * outside the kernel. Values 1-99 are reserved for potential
76 * future use.
77 */
78#define LSM_ATTR_UNDEF 0
79#define LSM_ATTR_CURRENT 100
80#define LSM_ATTR_EXEC 101
81#define LSM_ATTR_FSCREATE 102
82#define LSM_ATTR_KEYCREATE 103
83#define LSM_ATTR_PREV 104
84#define LSM_ATTR_SOCKCREATE 105
85
86/*
87 * LSM_FLAG_XXX definitions identify special handling instructions
88 * for the API.
89 */
90#define LSM_FLAG_SINGLE 0x0001
91
92#endif /* _LINUX_LSM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/magic.h+2
......@@ -37,6 +37,7 @@
3737#define HOSTFS_SUPER_MAGIC 0x00c0ffee
3838#define OVERLAYFS_SUPER_MAGIC 0x794c7630
3939#define FUSE_SUPER_MAGIC 0x65735546
40#define BCACHEFS_SUPER_MAGIC 0xca451a4e
4041
4142#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
4243#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
......@@ -101,5 +102,6 @@
101102#define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */
102103#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */
103104#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
105#define PID_FS_MAGIC 0x50494446 /* "PIDF" */
104106
105107#endif /* __LINUX_MAGIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mctp.h+32
......@@ -50,7 +50,14 @@ struct sockaddr_mctp_ext {
5050
5151#define SIOCMCTPALLOCTAG (SIOCPROTOPRIVATE + 0)
5252#define SIOCMCTPDROPTAG (SIOCPROTOPRIVATE + 1)
53#define SIOCMCTPALLOCTAG2 (SIOCPROTOPRIVATE + 2)
54#define SIOCMCTPDROPTAG2 (SIOCPROTOPRIVATE + 3)
5355
56/* Deprecated: use mctp_ioc_tag_ctl2 / TAG2 ioctls instead, which defines the
57 * MCTP network ID as part of the allocated tag. Using this assumes the default
58 * net ID for allocated tags, which may not give correct behaviour on system
59 * with multiple networks configured.
60 */
5461struct mctp_ioc_tag_ctl {
5562 mctp_eid_t peer_addr;
5663
......@@ -65,4 +72,29 @@ struct mctp_ioc_tag_ctl {
6572 __u16 flags;
6673};
6774
75struct mctp_ioc_tag_ctl2 {
76 /* Peer details: network ID, peer EID, local EID. All set by the
77 * caller.
78 *
79 * Local EID must be MCTP_ADDR_NULL or MCTP_ADDR_ANY in current
80 * kernels.
81 */
82 unsigned int net;
83 mctp_eid_t peer_addr;
84 mctp_eid_t local_addr;
85
86 /* Set by caller, but no flags defined currently. Must be 0 */
87 __u16 flags;
88
89 /* For SIOCMCTPALLOCTAG2: must be passed as zero, kernel will
90 * populate with the allocated tag value. Returned tag value will
91 * always have TO and PREALLOC set.
92 *
93 * For SIOCMCTPDROPTAG2: userspace provides tag value to drop, from
94 * a prior SIOCMCTPALLOCTAG2 call (and so must have TO and PREALLOC set).
95 */
96 __u8 tag;
97
98};
99
68100#endif /* __UAPI_MCTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mdio.h+45-1
......@@ -82,6 +82,8 @@
8282#define MDIO_AN_10BT1_AN_CTRL 526 /* 10BASE-T1 AN control register */
8383#define MDIO_AN_10BT1_AN_STAT 527 /* 10BASE-T1 AN status register */
8484#define MDIO_PMA_PMD_BT1_CTRL 2100 /* BASE-T1 PMA/PMD control register */
85#define MDIO_PCS_1000BT1_CTRL 2304 /* 1000BASE-T1 PCS control register */
86#define MDIO_PCS_1000BT1_STAT 2305 /* 1000BASE-T1 PCS status register */
8587
8688/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
8789#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
......@@ -136,6 +138,8 @@
136138#define MDIO_PMA_SPEED_1000 0x0010 /* 1000M capable */
137139#define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */
138140#define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */
141#define MDIO_PMA_SPEED_2_5G 0x2000 /* 2.5G capable */
142#define MDIO_PMA_SPEED_5G 0x4000 /* 5G capable */
139143#define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */
140144#define MDIO_PCS_SPEED_2_5G 0x0040 /* 2.5G capable */
141145#define MDIO_PCS_SPEED_5G 0x0080 /* 5G capable */
......@@ -231,6 +235,30 @@
231235#define MDIO_PMA_EXTABLE_BT1 0x0800 /* BASE-T1 ability */
232236#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */
233237
238/* AN Clause 73 linkword */
239#define MDIO_AN_C73_0_S_MASK GENMASK(4, 0)
240#define MDIO_AN_C73_0_E_MASK GENMASK(9, 5)
241#define MDIO_AN_C73_0_PAUSE BIT(10)
242#define MDIO_AN_C73_0_ASM_DIR BIT(11)
243#define MDIO_AN_C73_0_C2 BIT(12)
244#define MDIO_AN_C73_0_RF BIT(13)
245#define MDIO_AN_C73_0_ACK BIT(14)
246#define MDIO_AN_C73_0_NP BIT(15)
247#define MDIO_AN_C73_1_T_MASK GENMASK(4, 0)
248#define MDIO_AN_C73_1_1000BASE_KX BIT(5)
249#define MDIO_AN_C73_1_10GBASE_KX4 BIT(6)
250#define MDIO_AN_C73_1_10GBASE_KR BIT(7)
251#define MDIO_AN_C73_1_40GBASE_KR4 BIT(8)
252#define MDIO_AN_C73_1_40GBASE_CR4 BIT(9)
253#define MDIO_AN_C73_1_100GBASE_CR10 BIT(10)
254#define MDIO_AN_C73_1_100GBASE_KP4 BIT(11)
255#define MDIO_AN_C73_1_100GBASE_KR4 BIT(12)
256#define MDIO_AN_C73_1_100GBASE_CR4 BIT(13)
257#define MDIO_AN_C73_1_25GBASE_R_S BIT(14)
258#define MDIO_AN_C73_1_25GBASE_R BIT(15)
259#define MDIO_AN_C73_2_2500BASE_KX BIT(0)
260#define MDIO_AN_C73_2_5GBASE_KR BIT(1)
261
234262/* PHY XGXS lane state register. */
235263#define MDIO_PHYXS_LNSTAT_SYNC0 0x0001
236264#define MDIO_PHYXS_LNSTAT_SYNC1 0x0002
......@@ -308,6 +336,8 @@
308336#define MDIO_PCS_10T1L_CTRL_RESET 0x8000 /* PCS reset */
309337
310338/* BASE-T1 PMA/PMD extended ability register. */
339#define MDIO_PMA_PMD_BT1_B100_ABLE 0x0001 /* 100BASE-T1 Ability */
340#define MDIO_PMA_PMD_BT1_B1000_ABLE 0x0002 /* 1000BASE-T1 Ability */
311341#define MDIO_PMA_PMD_BT1_B10L_ABLE 0x0004 /* 10BASE-T1L Ability */
312342
313343/* BASE-T1 auto-negotiation advertisement register [15:0] */
......@@ -320,6 +350,8 @@
320350
321351/* BASE-T1 auto-negotiation advertisement register [31:16] */
322352#define MDIO_AN_T1_ADV_M_B10L 0x4000 /* device is compatible with 10BASE-T1L */
353#define MDIO_AN_T1_ADV_M_1000BT1 0x0080 /* advertise 1000BASE-T1 */
354#define MDIO_AN_T1_ADV_M_100BT1 0x0020 /* advertise 100BASE-T1 */
323355#define MDIO_AN_T1_ADV_M_MST 0x0010 /* advertise master preference */
324356
325357/* BASE-T1 auto-negotiation advertisement register [47:32] */
......@@ -349,7 +381,19 @@
349381#define MDIO_AN_10BT1_AN_STAT_LPA_EEE_T1L 0x4000 /* 10BASE-T1L LP EEE ability advertisement */
350382
351383/* BASE-T1 PMA/PMD control register */
352#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
384#define MDIO_PMA_PMD_BT1_CTRL_STRAP 0x000F /* Type selection (Strap) */
385#define MDIO_PMA_PMD_BT1_CTRL_STRAP_B1000 0x0001 /* Select 1000BASE-T1 */
386#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
387
388/* 1000BASE-T1 PCS control register */
389#define MDIO_PCS_1000BT1_CTRL_LOW_POWER 0x0800 /* Low power mode */
390#define MDIO_PCS_1000BT1_CTRL_DISABLE_TX 0x4000 /* Global PMA transmit disable */
391#define MDIO_PCS_1000BT1_CTRL_RESET 0x8000 /* Software reset value */
392
393/* 1000BASE-T1 PCS status register */
394#define MDIO_PCS_1000BT1_STAT_LINK 0x0004 /* PCS Link is up */
395#define MDIO_PCS_1000BT1_STAT_FAULT 0x0080 /* There is a fault condition */
396
353397
354398/* EEE Supported/Advertisement/LP Advertisement registers.
355399 *
lib/libc/include/any-linux-any/linux/media-bus-format.h+11-1
......@@ -34,7 +34,7 @@
3434
3535#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x1025 */
37/* RGB - next is 0x1026 */
3838#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
3939#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
4040#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
......@@ -46,6 +46,7 @@
4646#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
4747#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
4848#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
49#define MEDIA_BUS_FMT_RGB666_2X9_BE 0x1025
4950#define MEDIA_BUS_FMT_BGR666_1X18 0x1023
5051#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
5152#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
......@@ -173,4 +174,13 @@
173174 */
174175#define MEDIA_BUS_FMT_METADATA_FIXED 0x7001
175176
177/* Generic line based metadata formats for serial buses. Next is 0x8008. */
178#define MEDIA_BUS_FMT_META_8 0x8001
179#define MEDIA_BUS_FMT_META_10 0x8002
180#define MEDIA_BUS_FMT_META_12 0x8003
181#define MEDIA_BUS_FMT_META_14 0x8004
182#define MEDIA_BUS_FMT_META_16 0x8005
183#define MEDIA_BUS_FMT_META_20 0x8006
184#define MEDIA_BUS_FMT_META_24 0x8007
185
176186#endif /* __LINUX_MEDIA_BUS_FORMAT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media.h+14-14
......@@ -140,8 +140,8 @@ struct media_device_info {
140140#define MEDIA_ENT_F_DV_ENCODER (MEDIA_ENT_F_BASE + 0x6002)
141141
142142/* Entity flags */
143#define MEDIA_ENT_FL_DEFAULT (1 << 0)
144#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
143#define MEDIA_ENT_FL_DEFAULT (1U << 0)
144#define MEDIA_ENT_FL_CONNECTOR (1U << 1)
145145
146146/* OR with the entity id value to find the next entity */
147147#define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
......@@ -203,9 +203,9 @@ struct media_entity_desc {
203203 };
204204};
205205
206#define MEDIA_PAD_FL_SINK (1 << 0)
207#define MEDIA_PAD_FL_SOURCE (1 << 1)
208#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
206#define MEDIA_PAD_FL_SINK (1U << 0)
207#define MEDIA_PAD_FL_SOURCE (1U << 1)
208#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2)
209209
210210struct media_pad_desc {
211211 __u32 entity; /* entity ID */
......@@ -214,14 +214,14 @@ struct media_pad_desc {
214214 __u32 reserved[2];
215215};
216216
217#define MEDIA_LNK_FL_ENABLED (1 << 0)
218#define MEDIA_LNK_FL_IMMUTABLE (1 << 1)
219#define MEDIA_LNK_FL_DYNAMIC (1 << 2)
217#define MEDIA_LNK_FL_ENABLED (1U << 0)
218#define MEDIA_LNK_FL_IMMUTABLE (1U << 1)
219#define MEDIA_LNK_FL_DYNAMIC (1U << 2)
220220
221221#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
222# define MEDIA_LNK_FL_DATA_LINK (0 << 28)
223# define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
224# define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28)
222# define MEDIA_LNK_FL_DATA_LINK (0U << 28)
223# define MEDIA_LNK_FL_INTERFACE_LINK (1U << 28)
224# define MEDIA_LNK_FL_ANCILLARY_LINK (2U << 28)
225225
226226struct media_link_desc {
227227 struct media_pad_desc source;
......@@ -276,7 +276,7 @@ struct media_links_enum {
276276 * struct media_device_info.
277277 */
278278#define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) \
279 ((media_version) >= ((4 << 16) | (19 << 8) | 0))
279 ((media_version) >= ((4U << 16) | (19U << 8) | 0U))
280280
281281struct media_v2_entity {
282282 __u32 id;
......@@ -311,7 +311,7 @@ struct media_v2_interface {
311311 * struct media_device_info.
312312 */
313313#define MEDIA_V2_PAD_HAS_INDEX(media_version) \
314 ((media_version) >= ((4 << 16) | (19 << 8) | 0))
314 ((media_version) >= ((4U << 16) | (19U << 8) | 0U))
315315
316316struct media_v2_pad {
317317 __u32 id;
......@@ -414,7 +414,7 @@ struct media_v2_topology {
414414#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
415415
416416/* Obsolete symbol for media_version, no longer used in the kernel */
417#define MEDIA_API_VERSION ((0 << 16) | (1 << 8) | 0)
417#define MEDIA_API_VERSION ((0U << 16) | (1U << 8) | 0U)
418418
419419
420420#endif /* __LINUX_MEDIA_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mei.h+10-10
......@@ -7,15 +7,15 @@
77#ifndef _LINUX_MEI_H
88#define _LINUX_MEI_H
99
10#include <linux/uuid.h>
10#include <linux/mei_uuid.h>
1111
1212/*
1313 * This IOCTL is used to associate the current file descriptor with a
1414 * FW Client (given by UUID). This opens a communication channel
1515 * between a host client and a FW client. From this point every read and write
1616 * will communicate with the associated FW client.
17 * Only in close() (file_operation release()) the communication between
18 * the clients is disconnected
17 * Only in close() (file_operation release()) is the communication between
18 * the clients disconnected.
1919 *
2020 * The IOCTL argument is a struct with a union that contains
2121 * the input parameter and the output parameter for this IOCTL.
......@@ -51,7 +51,7 @@ struct mei_connect_client_data {
5151 * DOC: set and unset event notification for a connected client
5252 *
5353 * The IOCTL argument is 1 for enabling event notification and 0 for
54 * disabling the service
54 * disabling the service.
5555 * Return: -EOPNOTSUPP if the devices doesn't support the feature
5656 */
5757#define IOCTL_MEI_NOTIFY_SET _IOW('H', 0x02, __u32)
......@@ -59,8 +59,8 @@ struct mei_connect_client_data {
5959/**
6060 * DOC: retrieve notification
6161 *
62 * The IOCTL output argument is 1 if an event was is pending and 0 otherwise
63 * the ioctl has to be called in order to acknowledge pending event
62 * The IOCTL output argument is 1 if an event was pending and 0 otherwise.
63 * The ioctl has to be called in order to acknowledge pending event.
6464 *
6565 * Return: -EOPNOTSUPP if the devices doesn't support the feature
6666 */
......@@ -98,16 +98,16 @@ struct mei_connect_client_data_vtag {
9898 * FW Client (given by UUID), and virtual tag (vtag).
9999 * The IOCTL opens a communication channel between a host client and
100100 * a FW client on a tagged channel. From this point on, every read
101 * and write will communicate with the associated FW client with
101 * and write will communicate with the associated FW client
102102 * on the tagged channel.
103 * Upone close() the communication is terminated.
103 * Upon close() the communication is terminated.
104104 *
105105 * The IOCTL argument is a struct with a union that contains
106106 * the input parameter and the output parameter for this IOCTL.
107107 *
108 * The input parameter is UUID of the FW Client, a vtag [0,255]
108 * The input parameter is UUID of the FW Client, a vtag [0,255].
109109 * The output parameter is the properties of the FW client
110 * (FW protocool version and max message size).
110 * (FW protocol version and max message size).
111111 *
112112 * Clients that do not support tagged connection
113113 * will respond with -EOPNOTSUPP.
lib/libc/include/any-linux-any/linux/mei_uuid.h created+29
......@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * MEI UUID definition
4 *
5 * Copyright (C) 2010, Intel Corp.
6 * Huang Ying <ying.huang@intel.com>
7 */
8
9#ifndef _LINUX_MEI_UUID_H_
10#define _LINUX_MEI_UUID_H_
11
12#include <linux/types.h>
13
14typedef struct {
15 __u8 b[16];
16} uuid_le;
17
18#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
19((uuid_le) \
20{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
21 (b) & 0xff, ((b) >> 8) & 0xff, \
22 (c) & 0xff, ((c) >> 8) & 0xff, \
23 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
24
25#define NULL_UUID_LE \
26 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
27 0x00, 0x00, 0x00, 0x00)
28
29#endif /* _LINUX_MEI_UUID_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mempolicy.h+2-1
......@@ -23,6 +23,7 @@ enum {
2323 MPOL_INTERLEAVE,
2424 MPOL_LOCAL,
2525 MPOL_PREFERRED_MANY,
26 MPOL_WEIGHTED_INTERLEAVE,
2627 MPOL_MAX, /* always last member of enum */
2728};
2829
......@@ -48,7 +49,7 @@ enum {
4849#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform
4950 to policy */
5051#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to policy */
51#define MPOL_MF_LAZY (1<<3) /* Modifies '_MOVE: lazy migrate on fault */
52#define MPOL_MF_LAZY (1<<3) /* UNSUPPORTED FLAG: Lazy migrate on fault */
5253#define MPOL_MF_INTERNAL (1<<4) /* Internal flags start here */
5354
5455#define MPOL_MF_VALID (MPOL_MF_STRICT | \
lib/libc/include/any-linux-any/linux/mman.h+14
......@@ -4,6 +4,7 @@
44
55#include <asm/mman.h>
66#include <asm-generic/hugetlb_encode.h>
7#include <linux/types.h>
78
89#define MREMAP_MAYMOVE 1
910#define MREMAP_FIXED 2
......@@ -41,4 +42,17 @@
4142#define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
4243#define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
4344
45struct cachestat_range {
46 __u64 off;
47 __u64 len;
48};
49
50struct cachestat {
51 __u64 nr_cache;
52 __u64 nr_dirty;
53 __u64 nr_writeback;
54 __u64 nr_evicted;
55 __u64 nr_recently_evicted;
56};
57
4458#endif /* _LINUX_MMAN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mount.h+74-2
......@@ -74,7 +74,8 @@
7474#define MOVE_MOUNT_T_AUTOMOUNTS 0x00000020 /* Follow automounts on to path */
7575#define MOVE_MOUNT_T_EMPTY_PATH 0x00000040 /* Empty to path permitted */
7676#define MOVE_MOUNT_SET_GROUP 0x00000100 /* Set sharing group instead */
77#define MOVE_MOUNT__MASK 0x00000177
77#define MOVE_MOUNT_BENEATH 0x00000200 /* Mount beneath top mount */
78#define MOVE_MOUNT__MASK 0x00000377
7879
7980/*
8081 * fsopen() flags.
......@@ -99,8 +100,9 @@ enum fsconfig_command {
99100 FSCONFIG_SET_PATH = 3, /* Set parameter, supplying an object by path */
100101 FSCONFIG_SET_PATH_EMPTY = 4, /* Set parameter, supplying an object by (empty) path */
101102 FSCONFIG_SET_FD = 5, /* Set parameter, supplying an object by fd */
102 FSCONFIG_CMD_CREATE = 6, /* Invoke superblock creation */
103 FSCONFIG_CMD_CREATE = 6, /* Create new or reuse existing superblock */
103104 FSCONFIG_CMD_RECONFIGURE = 7, /* Invoke superblock reconfiguration */
105 FSCONFIG_CMD_CREATE_EXCL = 8, /* Create new superblock, fail if reusing existing superblock */
104106};
105107
106108/*
......@@ -136,4 +138,74 @@ struct mount_attr {
136138/* List of all mount_attr versions. */
137139#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
138140
141
142/*
143 * Structure for getting mount/superblock/filesystem info with statmount(2).
144 *
145 * The interface is similar to statx(2): individual fields or groups can be
146 * selected with the @mask argument of statmount(). Kernel will set the @mask
147 * field according to the supported fields.
148 *
149 * If string fields are selected, then the caller needs to pass a buffer that
150 * has space after the fixed part of the structure. Nul terminated strings are
151 * copied there and offsets relative to @str are stored in the relevant fields.
152 * If the buffer is too small, then EOVERFLOW is returned. The actually used
153 * size is returned in @size.
154 */
155struct statmount {
156 __u32 size; /* Total size, including strings */
157 __u32 __spare1;
158 __u64 mask; /* What results were written */
159 __u32 sb_dev_major; /* Device ID */
160 __u32 sb_dev_minor;
161 __u64 sb_magic; /* ..._SUPER_MAGIC */
162 __u32 sb_flags; /* SB_{RDONLY,SYNCHRONOUS,DIRSYNC,LAZYTIME} */
163 __u32 fs_type; /* [str] Filesystem type */
164 __u64 mnt_id; /* Unique ID of mount */
165 __u64 mnt_parent_id; /* Unique ID of parent (for root == mnt_id) */
166 __u32 mnt_id_old; /* Reused IDs used in proc/.../mountinfo */
167 __u32 mnt_parent_id_old;
168 __u64 mnt_attr; /* MOUNT_ATTR_... */
169 __u64 mnt_propagation; /* MS_{SHARED,SLAVE,PRIVATE,UNBINDABLE} */
170 __u64 mnt_peer_group; /* ID of shared peer group */
171 __u64 mnt_master; /* Mount receives propagation from this ID */
172 __u64 propagate_from; /* Propagation from in current namespace */
173 __u32 mnt_root; /* [str] Root of mount relative to root of fs */
174 __u32 mnt_point; /* [str] Mountpoint relative to current root */
175 __u64 __spare2[50];
176 char str[]; /* Variable size part containing strings */
177};
178
179/*
180 * Structure for passing mount ID and miscellaneous parameters to statmount(2)
181 * and listmount(2).
182 *
183 * For statmount(2) @param represents the request mask.
184 * For listmount(2) @param represents the last listed mount id (or zero).
185 */
186struct mnt_id_req {
187 __u32 size;
188 __u32 spare;
189 __u64 mnt_id;
190 __u64 param;
191};
192
193/* List of all mnt_id_req versions. */
194#define MNT_ID_REQ_SIZE_VER0 24 /* sizeof first published struct */
195
196/*
197 * @mask bits for statmount(2)
198 */
199#define STATMOUNT_SB_BASIC 0x00000001U /* Want/got sb_... */
200#define STATMOUNT_MNT_BASIC 0x00000002U /* Want/got mnt_... */
201#define STATMOUNT_PROPAGATE_FROM 0x00000004U /* Want/got propagate_from */
202#define STATMOUNT_MNT_ROOT 0x00000008U /* Want/got mnt_root */
203#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */
204#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */
205
206/*
207 * Special @mnt_id values that can be passed to listmount
208 */
209#define LSMT_ROOT 0xffffffffffffffff /* root mount */
210
139211#endif /* _LINUX_MOUNT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mptcp.h+41-165
......@@ -21,91 +21,20 @@
2121#define MPTCP_SUBFLOW_FLAG_CONNECTED _BITUL(7)
2222#define MPTCP_SUBFLOW_FLAG_MAPVALID _BITUL(8)
2323
24enum {
25 MPTCP_SUBFLOW_ATTR_UNSPEC,
26 MPTCP_SUBFLOW_ATTR_TOKEN_REM,
27 MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
28 MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
29 MPTCP_SUBFLOW_ATTR_MAP_SEQ,
30 MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
31 MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
32 MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
33 MPTCP_SUBFLOW_ATTR_FLAGS,
34 MPTCP_SUBFLOW_ATTR_ID_REM,
35 MPTCP_SUBFLOW_ATTR_ID_LOC,
36 MPTCP_SUBFLOW_ATTR_PAD,
37 __MPTCP_SUBFLOW_ATTR_MAX
38};
39
40#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
41
42/* netlink interface */
43#define MPTCP_PM_NAME "mptcp_pm"
4424#define MPTCP_PM_CMD_GRP_NAME "mptcp_pm_cmds"
4525#define MPTCP_PM_EV_GRP_NAME "mptcp_pm_events"
46#define MPTCP_PM_VER 0x1
47
48/*
49 * ATTR types defined for MPTCP
50 */
51enum {
52 MPTCP_PM_ATTR_UNSPEC,
53
54 MPTCP_PM_ATTR_ADDR, /* nested address */
55 MPTCP_PM_ATTR_RCV_ADD_ADDRS, /* u32 */
56 MPTCP_PM_ATTR_SUBFLOWS, /* u32 */
57 MPTCP_PM_ATTR_TOKEN, /* u32 */
58 MPTCP_PM_ATTR_LOC_ID, /* u8 */
59 MPTCP_PM_ATTR_ADDR_REMOTE, /* nested address */
60
61 __MPTCP_PM_ATTR_MAX
62};
63
64#define MPTCP_PM_ATTR_MAX (__MPTCP_PM_ATTR_MAX - 1)
65
66enum {
67 MPTCP_PM_ADDR_ATTR_UNSPEC,
6826
69 MPTCP_PM_ADDR_ATTR_FAMILY, /* u16 */
70 MPTCP_PM_ADDR_ATTR_ID, /* u8 */
71 MPTCP_PM_ADDR_ATTR_ADDR4, /* struct in_addr */
72 MPTCP_PM_ADDR_ATTR_ADDR6, /* struct in6_addr */
73 MPTCP_PM_ADDR_ATTR_PORT, /* u16 */
74 MPTCP_PM_ADDR_ATTR_FLAGS, /* u32 */
75 MPTCP_PM_ADDR_ATTR_IF_IDX, /* s32 */
76
77 __MPTCP_PM_ADDR_ATTR_MAX
78};
79
80#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
81
82#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
83#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
84#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
85#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
86#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
87
88enum {
89 MPTCP_PM_CMD_UNSPEC,
90
91 MPTCP_PM_CMD_ADD_ADDR,
92 MPTCP_PM_CMD_DEL_ADDR,
93 MPTCP_PM_CMD_GET_ADDR,
94 MPTCP_PM_CMD_FLUSH_ADDRS,
95 MPTCP_PM_CMD_SET_LIMITS,
96 MPTCP_PM_CMD_GET_LIMITS,
97 MPTCP_PM_CMD_SET_FLAGS,
98 MPTCP_PM_CMD_ANNOUNCE,
99 MPTCP_PM_CMD_REMOVE,
100 MPTCP_PM_CMD_SUBFLOW_CREATE,
101 MPTCP_PM_CMD_SUBFLOW_DESTROY,
102
103 __MPTCP_PM_CMD_AFTER_LAST
104};
27#include <linux/mptcp_pm.h>
10528
10629#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
10730#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
10831
32#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
33#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
34#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
35#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
36#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
37
10938struct mptcp_info {
11039 __u8 mptcpi_subflows;
11140 __u8 mptcpi_add_addr_signal;
......@@ -121,95 +50,18 @@ struct mptcp_info {
12150 __u8 mptcpi_local_addr_used;
12251 __u8 mptcpi_local_addr_max;
12352 __u8 mptcpi_csum_enabled;
53 __u32 mptcpi_retransmits;
54 __u64 mptcpi_bytes_retrans;
55 __u64 mptcpi_bytes_sent;
56 __u64 mptcpi_bytes_received;
57 __u64 mptcpi_bytes_acked;
58 __u8 mptcpi_subflows_total;
59 __u8 reserved[3];
60 __u32 mptcpi_last_data_sent;
61 __u32 mptcpi_last_data_recv;
62 __u32 mptcpi_last_ack_recv;
12463};
12564
126/*
127 * MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
128 * sport, dport
129 * A new MPTCP connection has been created. It is the good time to allocate
130 * memory and send ADD_ADDR if needed. Depending on the traffic-patterns
131 * it can take a long time until the MPTCP_EVENT_ESTABLISHED is sent.
132 *
133 * MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
134 * sport, dport
135 * A MPTCP connection is established (can start new subflows).
136 *
137 * MPTCP_EVENT_CLOSED: token
138 * A MPTCP connection has stopped.
139 *
140 * MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport]
141 * A new address has been announced by the peer.
142 *
143 * MPTCP_EVENT_REMOVED: token, rem_id
144 * An address has been lost by the peer.
145 *
146 * MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id,
147 * saddr4 | saddr6, daddr4 | daddr6, sport,
148 * dport, backup, if_idx [, error]
149 * A new subflow has been established. 'error' should not be set.
150 *
151 * MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
152 * daddr4 | daddr6, sport, dport, backup, if_idx
153 * [, error]
154 * A subflow has been closed. An error (copy of sk_err) could be set if an
155 * error has been detected for this subflow.
156 *
157 * MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
158 * daddr4 | daddr6, sport, dport, backup, if_idx
159 * [, error]
160 * The priority of a subflow has changed. 'error' should not be set.
161 *
162 * MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6
163 * A new PM listener is created.
164 *
165 * MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6
166 * A PM listener is closed.
167 */
168enum mptcp_event_type {
169 MPTCP_EVENT_UNSPEC = 0,
170 MPTCP_EVENT_CREATED = 1,
171 MPTCP_EVENT_ESTABLISHED = 2,
172 MPTCP_EVENT_CLOSED = 3,
173
174 MPTCP_EVENT_ANNOUNCED = 6,
175 MPTCP_EVENT_REMOVED = 7,
176
177 MPTCP_EVENT_SUB_ESTABLISHED = 10,
178 MPTCP_EVENT_SUB_CLOSED = 11,
179
180 MPTCP_EVENT_SUB_PRIORITY = 13,
181
182 MPTCP_EVENT_LISTENER_CREATED = 15,
183 MPTCP_EVENT_LISTENER_CLOSED = 16,
184};
185
186enum mptcp_event_attr {
187 MPTCP_ATTR_UNSPEC = 0,
188
189 MPTCP_ATTR_TOKEN, /* u32 */
190 MPTCP_ATTR_FAMILY, /* u16 */
191 MPTCP_ATTR_LOC_ID, /* u8 */
192 MPTCP_ATTR_REM_ID, /* u8 */
193 MPTCP_ATTR_SADDR4, /* be32 */
194 MPTCP_ATTR_SADDR6, /* struct in6_addr */
195 MPTCP_ATTR_DADDR4, /* be32 */
196 MPTCP_ATTR_DADDR6, /* struct in6_addr */
197 MPTCP_ATTR_SPORT, /* be16 */
198 MPTCP_ATTR_DPORT, /* be16 */
199 MPTCP_ATTR_BACKUP, /* u8 */
200 MPTCP_ATTR_ERROR, /* u8 */
201 MPTCP_ATTR_FLAGS, /* u16 */
202 MPTCP_ATTR_TIMEOUT, /* u32 */
203 MPTCP_ATTR_IF_IDX, /* s32 */
204 MPTCP_ATTR_RESET_REASON,/* u32 */
205 MPTCP_ATTR_RESET_FLAGS, /* u32 */
206 MPTCP_ATTR_SERVER_SIDE, /* u8 */
207
208 __MPTCP_ATTR_AFTER_LAST
209};
210
211#define MPTCP_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
212
21365/* MPTCP Reset reason codes, rfc8684 */
21466#define MPTCP_RST_EUNSPEC 0
21567#define MPTCP_RST_EMPTCP 1
......@@ -242,9 +94,33 @@ struct mptcp_subflow_addrs {
24294 };
24395};
24496
97struct mptcp_subflow_info {
98 __u32 id;
99 struct mptcp_subflow_addrs addrs;
100};
101
102struct mptcp_full_info {
103 __u32 size_tcpinfo_kernel; /* must be 0, set by kernel */
104 __u32 size_tcpinfo_user;
105 __u32 size_sfinfo_kernel; /* must be 0, set by kernel */
106 __u32 size_sfinfo_user;
107 __u32 num_subflows; /* must be 0, set by kernel (real subflow count) */
108 __u32 size_arrays_user; /* max subflows that userspace is interested in;
109 * the buffers at subflow_info/tcp_info
110 * are respectively at least:
111 * size_arrays * size_sfinfo_user
112 * size_arrays * size_tcpinfo_user
113 * bytes wide
114 */
115 __aligned_u64 subflow_info;
116 __aligned_u64 tcp_info;
117 struct mptcp_info mptcp_info;
118};
119
245120/* MPTCP socket options */
246121#define MPTCP_INFO 1
247122#define MPTCP_TCPINFO 2
248123#define MPTCP_SUBFLOW_ADDRS 3
124#define MPTCP_FULL_INFO 4
249125
250126#endif /* _MPTCP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mptcp_pm.h created+150
......@@ -0,0 +1,150 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/mptcp_pm.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_MPTCP_PM_H
7#define _LINUX_MPTCP_PM_H
8
9#define MPTCP_PM_NAME "mptcp_pm"
10#define MPTCP_PM_VER 1
11
12/**
13 * enum mptcp_event_type
14 * @MPTCP_EVENT_UNSPEC: unused event
15 * @MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,
16 * sport, dport A new MPTCP connection has been created. It is the good time
17 * to allocate memory and send ADD_ADDR if needed. Depending on the
18 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
19 * is sent.
20 * @MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,
21 * sport, dport A MPTCP connection is established (can start new subflows).
22 * @MPTCP_EVENT_CLOSED: token A MPTCP connection has stopped.
23 * @MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport] A
24 * new address has been announced by the peer.
25 * @MPTCP_EVENT_REMOVED: token, rem_id An address has been lost by the peer.
26 * @MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, saddr4 |
27 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error] A new
28 * subflow has been established. 'error' should not be set.
29 * @MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,
30 * daddr4 | daddr6, sport, dport, backup, if_idx [, error] A subflow has been
31 * closed. An error (copy of sk_err) could be set if an error has been
32 * detected for this subflow.
33 * @MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,
34 * daddr4 | daddr6, sport, dport, backup, if_idx [, error] The priority of a
35 * subflow has changed. 'error' should not be set.
36 * @MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6 A new PM
37 * listener is created.
38 * @MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6 A PM listener
39 * is closed.
40 */
41enum mptcp_event_type {
42 MPTCP_EVENT_UNSPEC,
43 MPTCP_EVENT_CREATED,
44 MPTCP_EVENT_ESTABLISHED,
45 MPTCP_EVENT_CLOSED,
46 MPTCP_EVENT_ANNOUNCED = 6,
47 MPTCP_EVENT_REMOVED,
48 MPTCP_EVENT_SUB_ESTABLISHED = 10,
49 MPTCP_EVENT_SUB_CLOSED,
50 MPTCP_EVENT_SUB_PRIORITY = 13,
51 MPTCP_EVENT_LISTENER_CREATED = 15,
52 MPTCP_EVENT_LISTENER_CLOSED,
53};
54
55enum {
56 MPTCP_PM_ADDR_ATTR_UNSPEC,
57 MPTCP_PM_ADDR_ATTR_FAMILY,
58 MPTCP_PM_ADDR_ATTR_ID,
59 MPTCP_PM_ADDR_ATTR_ADDR4,
60 MPTCP_PM_ADDR_ATTR_ADDR6,
61 MPTCP_PM_ADDR_ATTR_PORT,
62 MPTCP_PM_ADDR_ATTR_FLAGS,
63 MPTCP_PM_ADDR_ATTR_IF_IDX,
64
65 __MPTCP_PM_ADDR_ATTR_MAX
66};
67#define MPTCP_PM_ADDR_ATTR_MAX (__MPTCP_PM_ADDR_ATTR_MAX - 1)
68
69enum {
70 MPTCP_SUBFLOW_ATTR_UNSPEC,
71 MPTCP_SUBFLOW_ATTR_TOKEN_REM,
72 MPTCP_SUBFLOW_ATTR_TOKEN_LOC,
73 MPTCP_SUBFLOW_ATTR_RELWRITE_SEQ,
74 MPTCP_SUBFLOW_ATTR_MAP_SEQ,
75 MPTCP_SUBFLOW_ATTR_MAP_SFSEQ,
76 MPTCP_SUBFLOW_ATTR_SSN_OFFSET,
77 MPTCP_SUBFLOW_ATTR_MAP_DATALEN,
78 MPTCP_SUBFLOW_ATTR_FLAGS,
79 MPTCP_SUBFLOW_ATTR_ID_REM,
80 MPTCP_SUBFLOW_ATTR_ID_LOC,
81 MPTCP_SUBFLOW_ATTR_PAD,
82
83 __MPTCP_SUBFLOW_ATTR_MAX
84};
85#define MPTCP_SUBFLOW_ATTR_MAX (__MPTCP_SUBFLOW_ATTR_MAX - 1)
86
87enum {
88 MPTCP_PM_ENDPOINT_ADDR = 1,
89
90 __MPTCP_PM_ENDPOINT_MAX
91};
92#define MPTCP_PM_ENDPOINT_MAX (__MPTCP_PM_ENDPOINT_MAX - 1)
93
94enum {
95 MPTCP_PM_ATTR_UNSPEC,
96 MPTCP_PM_ATTR_ADDR,
97 MPTCP_PM_ATTR_RCV_ADD_ADDRS,
98 MPTCP_PM_ATTR_SUBFLOWS,
99 MPTCP_PM_ATTR_TOKEN,
100 MPTCP_PM_ATTR_LOC_ID,
101 MPTCP_PM_ATTR_ADDR_REMOTE,
102
103 __MPTCP_ATTR_AFTER_LAST
104};
105#define MPTCP_PM_ATTR_MAX (__MPTCP_ATTR_AFTER_LAST - 1)
106
107enum mptcp_event_attr {
108 MPTCP_ATTR_UNSPEC,
109 MPTCP_ATTR_TOKEN,
110 MPTCP_ATTR_FAMILY,
111 MPTCP_ATTR_LOC_ID,
112 MPTCP_ATTR_REM_ID,
113 MPTCP_ATTR_SADDR4,
114 MPTCP_ATTR_SADDR6,
115 MPTCP_ATTR_DADDR4,
116 MPTCP_ATTR_DADDR6,
117 MPTCP_ATTR_SPORT,
118 MPTCP_ATTR_DPORT,
119 MPTCP_ATTR_BACKUP,
120 MPTCP_ATTR_ERROR,
121 MPTCP_ATTR_FLAGS,
122 MPTCP_ATTR_TIMEOUT,
123 MPTCP_ATTR_IF_IDX,
124 MPTCP_ATTR_RESET_REASON,
125 MPTCP_ATTR_RESET_FLAGS,
126 MPTCP_ATTR_SERVER_SIDE,
127
128 __MPTCP_ATTR_MAX
129};
130#define MPTCP_ATTR_MAX (__MPTCP_ATTR_MAX - 1)
131
132enum {
133 MPTCP_PM_CMD_UNSPEC,
134 MPTCP_PM_CMD_ADD_ADDR,
135 MPTCP_PM_CMD_DEL_ADDR,
136 MPTCP_PM_CMD_GET_ADDR,
137 MPTCP_PM_CMD_FLUSH_ADDRS,
138 MPTCP_PM_CMD_SET_LIMITS,
139 MPTCP_PM_CMD_GET_LIMITS,
140 MPTCP_PM_CMD_SET_FLAGS,
141 MPTCP_PM_CMD_ANNOUNCE,
142 MPTCP_PM_CMD_REMOVE,
143 MPTCP_PM_CMD_SUBFLOW_CREATE,
144 MPTCP_PM_CMD_SUBFLOW_DESTROY,
145
146 __MPTCP_PM_CMD_AFTER_LAST
147};
148#define MPTCP_PM_CMD_MAX (__MPTCP_PM_CMD_AFTER_LAST - 1)
149
150#endif /* _LINUX_MPTCP_PM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nbd.h+20-5
......@@ -11,6 +11,8 @@
1111 * Cleanup PARANOIA usage & code.
1212 * 2004/02/19 Paul Clements
1313 * Removed PARANOIA, plus various cleanup and comments
14 * 2023 Copyright Red Hat
15 * Link to userspace extensions, favor cookie over handle.
1416 */
1517
1618#ifndef LINUX_NBD_H
......@@ -30,12 +32,18 @@
3032#define NBD_SET_TIMEOUT _IO( 0xab, 9 )
3133#define NBD_SET_FLAGS _IO( 0xab, 10)
3234
35/*
36 * See also https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
37 * for additional userspace extensions not yet utilized in the kernel module.
38 */
39
3340enum {
3441 NBD_CMD_READ = 0,
3542 NBD_CMD_WRITE = 1,
3643 NBD_CMD_DISC = 2,
3744 NBD_CMD_FLUSH = 3,
3845 NBD_CMD_TRIM = 4
46 /* userspace defines additional extension commands */
3947};
4048
4149/* values for flags field, these are server interaction specific. */
......@@ -64,15 +72,19 @@ enum {
6472#define NBD_REQUEST_MAGIC 0x25609513
6573#define NBD_REPLY_MAGIC 0x67446698
6674/* Do *not* use magics: 0x12560953 0x96744668. */
75/* magic 0x668e33ef for structured reply not supported by kernel yet */
6776
6877/*
6978 * This is the packet used for communication between client and
7079 * server. All data are in network byte order.
7180 */
7281struct nbd_request {
73 __be32 magic;
74 __be32 type; /* == READ || == WRITE */
75 char handle[8];
82 __be32 magic; /* NBD_REQUEST_MAGIC */
83 __be32 type; /* See NBD_CMD_* */
84 union {
85 __be64 cookie; /* Opaque identifier for request */
86 char handle[8]; /* older spelling of cookie */
87 };
7688 __be64 from;
7789 __be32 len;
7890} __attribute__((packed));
......@@ -82,8 +94,11 @@ struct nbd_request {
8294 * it has completed an I/O request (or an error occurs).
8395 */
8496struct nbd_reply {
85 __be32 magic;
97 __be32 magic; /* NBD_REPLY_MAGIC */
8698 __be32 error; /* 0 = ok, else error */
87 char handle[8]; /* handle you got from request */
99 union {
100 __be64 cookie; /* Opaque identifier from request */
101 char handle[8]; /* older spelling of cookie */
102 };
88103};
89104#endif /* LINUX_NBD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netdev.h+137-1
......@@ -11,7 +11,7 @@
1111
1212/**
1313 * enum netdev_xdp_act
14 * @NETDEV_XDP_ACT_BASIC: XDP feautues set supported by all drivers
14 * @NETDEV_XDP_ACT_BASIC: XDP features set supported by all drivers
1515 * (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
1616 * @NETDEV_XDP_ACT_REDIRECT: The netdev supports XDP_REDIRECT
1717 * @NETDEV_XDP_ACT_NDO_XMIT: This feature informs if netdev implements
......@@ -34,28 +34,164 @@ enum netdev_xdp_act {
3434 NETDEV_XDP_ACT_RX_SG = 32,
3535 NETDEV_XDP_ACT_NDO_XMIT_SG = 64,
3636
37 /* private: */
3738 NETDEV_XDP_ACT_MASK = 127,
3839};
3940
41/**
42 * enum netdev_xdp_rx_metadata
43 * @NETDEV_XDP_RX_METADATA_TIMESTAMP: Device is capable of exposing receive HW
44 * timestamp via bpf_xdp_metadata_rx_timestamp().
45 * @NETDEV_XDP_RX_METADATA_HASH: Device is capable of exposing receive packet
46 * hash via bpf_xdp_metadata_rx_hash().
47 * @NETDEV_XDP_RX_METADATA_VLAN_TAG: Device is capable of exposing receive
48 * packet VLAN tag via bpf_xdp_metadata_rx_vlan_tag().
49 */
50enum netdev_xdp_rx_metadata {
51 NETDEV_XDP_RX_METADATA_TIMESTAMP = 1,
52 NETDEV_XDP_RX_METADATA_HASH = 2,
53 NETDEV_XDP_RX_METADATA_VLAN_TAG = 4,
54};
55
56/**
57 * enum netdev_xsk_flags
58 * @NETDEV_XSK_FLAGS_TX_TIMESTAMP: HW timestamping egress packets is supported
59 * by the driver.
60 * @NETDEV_XSK_FLAGS_TX_CHECKSUM: L3 checksum HW offload is supported by the
61 * driver.
62 */
63enum netdev_xsk_flags {
64 NETDEV_XSK_FLAGS_TX_TIMESTAMP = 1,
65 NETDEV_XSK_FLAGS_TX_CHECKSUM = 2,
66};
67
68enum netdev_queue_type {
69 NETDEV_QUEUE_TYPE_RX,
70 NETDEV_QUEUE_TYPE_TX,
71};
72
73enum netdev_qstats_scope {
74 NETDEV_QSTATS_SCOPE_QUEUE = 1,
75};
76
4077enum {
4178 NETDEV_A_DEV_IFINDEX = 1,
4279 NETDEV_A_DEV_PAD,
4380 NETDEV_A_DEV_XDP_FEATURES,
81 NETDEV_A_DEV_XDP_ZC_MAX_SEGS,
82 NETDEV_A_DEV_XDP_RX_METADATA_FEATURES,
83 NETDEV_A_DEV_XSK_FEATURES,
4484
4585 __NETDEV_A_DEV_MAX,
4686 NETDEV_A_DEV_MAX = (__NETDEV_A_DEV_MAX - 1)
4787};
4888
89enum {
90 NETDEV_A_PAGE_POOL_ID = 1,
91 NETDEV_A_PAGE_POOL_IFINDEX,
92 NETDEV_A_PAGE_POOL_NAPI_ID,
93 NETDEV_A_PAGE_POOL_INFLIGHT,
94 NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
95 NETDEV_A_PAGE_POOL_DETACH_TIME,
96
97 __NETDEV_A_PAGE_POOL_MAX,
98 NETDEV_A_PAGE_POOL_MAX = (__NETDEV_A_PAGE_POOL_MAX - 1)
99};
100
101enum {
102 NETDEV_A_PAGE_POOL_STATS_INFO = 1,
103 NETDEV_A_PAGE_POOL_STATS_ALLOC_FAST = 8,
104 NETDEV_A_PAGE_POOL_STATS_ALLOC_SLOW,
105 NETDEV_A_PAGE_POOL_STATS_ALLOC_SLOW_HIGH_ORDER,
106 NETDEV_A_PAGE_POOL_STATS_ALLOC_EMPTY,
107 NETDEV_A_PAGE_POOL_STATS_ALLOC_REFILL,
108 NETDEV_A_PAGE_POOL_STATS_ALLOC_WAIVE,
109 NETDEV_A_PAGE_POOL_STATS_RECYCLE_CACHED,
110 NETDEV_A_PAGE_POOL_STATS_RECYCLE_CACHE_FULL,
111 NETDEV_A_PAGE_POOL_STATS_RECYCLE_RING,
112 NETDEV_A_PAGE_POOL_STATS_RECYCLE_RING_FULL,
113 NETDEV_A_PAGE_POOL_STATS_RECYCLE_RELEASED_REFCNT,
114
115 __NETDEV_A_PAGE_POOL_STATS_MAX,
116 NETDEV_A_PAGE_POOL_STATS_MAX = (__NETDEV_A_PAGE_POOL_STATS_MAX - 1)
117};
118
119enum {
120 NETDEV_A_NAPI_IFINDEX = 1,
121 NETDEV_A_NAPI_ID,
122 NETDEV_A_NAPI_IRQ,
123 NETDEV_A_NAPI_PID,
124
125 __NETDEV_A_NAPI_MAX,
126 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
127};
128
129enum {
130 NETDEV_A_QUEUE_ID = 1,
131 NETDEV_A_QUEUE_IFINDEX,
132 NETDEV_A_QUEUE_TYPE,
133 NETDEV_A_QUEUE_NAPI_ID,
134
135 __NETDEV_A_QUEUE_MAX,
136 NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
137};
138
139enum {
140 NETDEV_A_QSTATS_IFINDEX = 1,
141 NETDEV_A_QSTATS_QUEUE_TYPE,
142 NETDEV_A_QSTATS_QUEUE_ID,
143 NETDEV_A_QSTATS_SCOPE,
144 NETDEV_A_QSTATS_RX_PACKETS = 8,
145 NETDEV_A_QSTATS_RX_BYTES,
146 NETDEV_A_QSTATS_TX_PACKETS,
147 NETDEV_A_QSTATS_TX_BYTES,
148 NETDEV_A_QSTATS_RX_ALLOC_FAIL,
149 NETDEV_A_QSTATS_RX_HW_DROPS,
150 NETDEV_A_QSTATS_RX_HW_DROP_OVERRUNS,
151 NETDEV_A_QSTATS_RX_CSUM_COMPLETE,
152 NETDEV_A_QSTATS_RX_CSUM_UNNECESSARY,
153 NETDEV_A_QSTATS_RX_CSUM_NONE,
154 NETDEV_A_QSTATS_RX_CSUM_BAD,
155 NETDEV_A_QSTATS_RX_HW_GRO_PACKETS,
156 NETDEV_A_QSTATS_RX_HW_GRO_BYTES,
157 NETDEV_A_QSTATS_RX_HW_GRO_WIRE_PACKETS,
158 NETDEV_A_QSTATS_RX_HW_GRO_WIRE_BYTES,
159 NETDEV_A_QSTATS_RX_HW_DROP_RATELIMITS,
160 NETDEV_A_QSTATS_TX_HW_DROPS,
161 NETDEV_A_QSTATS_TX_HW_DROP_ERRORS,
162 NETDEV_A_QSTATS_TX_CSUM_NONE,
163 NETDEV_A_QSTATS_TX_NEEDS_CSUM,
164 NETDEV_A_QSTATS_TX_HW_GSO_PACKETS,
165 NETDEV_A_QSTATS_TX_HW_GSO_BYTES,
166 NETDEV_A_QSTATS_TX_HW_GSO_WIRE_PACKETS,
167 NETDEV_A_QSTATS_TX_HW_GSO_WIRE_BYTES,
168 NETDEV_A_QSTATS_TX_HW_DROP_RATELIMITS,
169 NETDEV_A_QSTATS_TX_STOP,
170 NETDEV_A_QSTATS_TX_WAKE,
171
172 __NETDEV_A_QSTATS_MAX,
173 NETDEV_A_QSTATS_MAX = (__NETDEV_A_QSTATS_MAX - 1)
174};
175
49176enum {
50177 NETDEV_CMD_DEV_GET = 1,
51178 NETDEV_CMD_DEV_ADD_NTF,
52179 NETDEV_CMD_DEV_DEL_NTF,
53180 NETDEV_CMD_DEV_CHANGE_NTF,
181 NETDEV_CMD_PAGE_POOL_GET,
182 NETDEV_CMD_PAGE_POOL_ADD_NTF,
183 NETDEV_CMD_PAGE_POOL_DEL_NTF,
184 NETDEV_CMD_PAGE_POOL_CHANGE_NTF,
185 NETDEV_CMD_PAGE_POOL_STATS_GET,
186 NETDEV_CMD_QUEUE_GET,
187 NETDEV_CMD_NAPI_GET,
188 NETDEV_CMD_QSTATS_GET,
54189
55190 __NETDEV_CMD_MAX,
56191 NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
57192};
58193
59194#define NETDEV_MCGRP_MGMT "mgmt"
195#define NETDEV_MCGRP_PAGE_POOL "page-pool"
60196
61197#endif /* _LINUX_NETDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+18-5
......@@ -105,6 +105,7 @@ enum nft_verdicts {
105105 * @NFT_MSG_DESTROYSETELEM: destroy a set element (enum nft_set_elem_attributes)
106106 * @NFT_MSG_DESTROYOBJ: destroy a stateful object (enum nft_object_attributes)
107107 * @NFT_MSG_DESTROYFLOWTABLE: destroy flow table (enum nft_flowtable_attributes)
108 * @NFT_MSG_GETSETELEM_RESET: get set elements and reset attached stateful expressions (enum nft_set_elem_attributes)
108109 */
109110enum nf_tables_msg_types {
110111 NFT_MSG_NEWTABLE,
......@@ -140,6 +141,7 @@ enum nf_tables_msg_types {
140141 NFT_MSG_DESTROYSETELEM,
141142 NFT_MSG_DESTROYOBJ,
142143 NFT_MSG_DESTROYFLOWTABLE,
144 NFT_MSG_GETSETELEM_RESET,
143145 NFT_MSG_MAX,
144146};
145147
......@@ -177,13 +179,17 @@ enum nft_hook_attributes {
177179 * enum nft_table_flags - nf_tables table flags
178180 *
179181 * @NFT_TABLE_F_DORMANT: this table is not active
182 * @NFT_TABLE_F_OWNER: this table is owned by a process
183 * @NFT_TABLE_F_PERSIST: this table shall outlive its owner
180184 */
181185enum nft_table_flags {
182186 NFT_TABLE_F_DORMANT = 0x1,
183187 NFT_TABLE_F_OWNER = 0x2,
188 NFT_TABLE_F_PERSIST = 0x4,
184189};
185190#define NFT_TABLE_F_MASK (NFT_TABLE_F_DORMANT | \
186 NFT_TABLE_F_OWNER)
191 NFT_TABLE_F_OWNER | \
192 NFT_TABLE_F_PERSIST)
187193
188194/**
189195 * enum nft_table_attributes - nf_tables table netlink attributes
......@@ -261,6 +267,7 @@ enum nft_chain_attributes {
261267 * @NFTA_RULE_USERDATA: user data (NLA_BINARY, NFT_USERDATA_MAXLEN)
262268 * @NFTA_RULE_ID: uniquely identifies a rule in a transaction (NLA_U32)
263269 * @NFTA_RULE_POSITION_ID: transaction unique identifier of the previous rule (NLA_U32)
270 * @NFTA_RULE_CHAIN_ID: add the rule to chain by ID, alternative to @NFTA_RULE_CHAIN (NLA_U32)
264271 */
265272enum nft_rule_attributes {
266273 NFTA_RULE_UNSPEC,
......@@ -282,9 +289,11 @@ enum nft_rule_attributes {
282289/**
283290 * enum nft_rule_compat_flags - nf_tables rule compat flags
284291 *
292 * @NFT_RULE_COMPAT_F_UNUSED: unused
285293 * @NFT_RULE_COMPAT_F_INV: invert the check result
286294 */
287295enum nft_rule_compat_flags {
296 NFT_RULE_COMPAT_F_UNUSED = (1 << 0),
288297 NFT_RULE_COMPAT_F_INV = (1 << 1),
289298 NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV,
290299};
......@@ -685,7 +694,7 @@ enum nft_range_ops {
685694 * enum nft_range_attributes - nf_tables range expression netlink attributes
686695 *
687696 * @NFTA_RANGE_SREG: source register of data to compare (NLA_U32: nft_registers)
688 * @NFTA_RANGE_OP: cmp operation (NLA_U32: nft_cmp_ops)
697 * @NFTA_RANGE_OP: cmp operation (NLA_U32: nft_range_ops)
689698 * @NFTA_RANGE_FROM_DATA: data range from (NLA_NESTED: nft_data_attributes)
690699 * @NFTA_RANGE_TO_DATA: data range to (NLA_NESTED: nft_data_attributes)
691700 */
......@@ -859,12 +868,14 @@ enum nft_exthdr_flags {
859868 * @NFT_EXTHDR_OP_TCP: match against tcp options
860869 * @NFT_EXTHDR_OP_IPV4: match against ipv4 options
861870 * @NFT_EXTHDR_OP_SCTP: match against sctp chunks
871 * @NFT_EXTHDR_OP_DCCP: match against dccp otions
862872 */
863873enum nft_exthdr_op {
864874 NFT_EXTHDR_OP_IPV6,
865875 NFT_EXTHDR_OP_TCPOPT,
866876 NFT_EXTHDR_OP_IPV4,
867877 NFT_EXTHDR_OP_SCTP,
878 NFT_EXTHDR_OP_DCCP,
868879 __NFT_EXTHDR_OP_MAX
869880};
870881#define NFT_EXTHDR_OP_MAX (__NFT_EXTHDR_OP_MAX - 1)
......@@ -878,7 +889,7 @@ enum nft_exthdr_op {
878889 * @NFTA_EXTHDR_LEN: extension header length (NLA_U32)
879890 * @NFTA_EXTHDR_FLAGS: extension header flags (NLA_U32)
880891 * @NFTA_EXTHDR_OP: option match type (NLA_U32)
881 * @NFTA_EXTHDR_SREG: option match type (NLA_U32)
892 * @NFTA_EXTHDR_SREG: source register (NLA_U32: nft_registers)
882893 */
883894enum nft_exthdr_attributes {
884895 NFTA_EXTHDR_UNSPEC,
......@@ -931,6 +942,7 @@ enum nft_exthdr_attributes {
931942 * @NFT_META_TIME_HOUR: hour of day (in seconds)
932943 * @NFT_META_SDIF: slave device interface index
933944 * @NFT_META_SDIFNAME: slave device interface name
945 * @NFT_META_BRI_BROUTE: packet br_netfilter_broute bit
934946 */
935947enum nft_meta_keys {
936948 NFT_META_LEN,
......@@ -969,6 +981,7 @@ enum nft_meta_keys {
969981 NFT_META_TIME_HOUR,
970982 NFT_META_SDIF,
971983 NFT_META_SDIFNAME,
984 NFT_META_BRI_BROUTE,
972985 __NFT_META_IIFTYPE,
973986};
974987
......@@ -1260,10 +1273,10 @@ enum nft_last_attributes {
12601273/**
12611274 * enum nft_log_attributes - nf_tables log expression netlink attributes
12621275 *
1263 * @NFTA_LOG_GROUP: netlink group to send messages to (NLA_U32)
1276 * @NFTA_LOG_GROUP: netlink group to send messages to (NLA_U16)
12641277 * @NFTA_LOG_PREFIX: prefix to prepend to log messages (NLA_STRING)
12651278 * @NFTA_LOG_SNAPLEN: length of payload to include in netlink message (NLA_U32)
1266 * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U32)
1279 * @NFTA_LOG_QTHRESHOLD: queue threshold (NLA_U16)
12671280 * @NFTA_LOG_LEVEL: log level (NLA_U32)
12681281 * @NFTA_LOG_FLAGS: logging flags (NLA_U32)
12691282 */
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_hook.h+21-3
......@@ -32,8 +32,12 @@ enum nfnl_hook_attributes {
3232/**
3333 * enum nfnl_hook_chain_info_attributes - chain description
3434 *
35 * NFNLA_HOOK_INFO_DESC: nft chain and table name (enum nft_table_attributes) (NLA_NESTED)
36 * NFNLA_HOOK_INFO_TYPE: chain type (enum nfnl_hook_chaintype) (NLA_U32)
35 * @NFNLA_HOOK_INFO_DESC: nft chain and table name (NLA_NESTED)
36 * @NFNLA_HOOK_INFO_TYPE: chain type (enum nfnl_hook_chaintype) (NLA_U32)
37 *
38 * NFNLA_HOOK_INFO_DESC depends on NFNLA_HOOK_INFO_TYPE value:
39 * NFNL_HOOK_TYPE_NFTABLES: enum nft_table_attributes
40 * NFNL_HOOK_TYPE_BPF: enum nfnl_hook_bpf_attributes
3741 */
3842enum nfnl_hook_chain_info_attributes {
3943 NFNLA_HOOK_INFO_UNSPEC,
......@@ -55,10 +59,24 @@ enum nfnl_hook_chain_desc_attributes {
5559/**
5660 * enum nfnl_hook_chaintype - chain type
5761 *
58 * @NFNL_HOOK_TYPE_NFTABLES nf_tables base chain
62 * @NFNL_HOOK_TYPE_NFTABLES: nf_tables base chain
63 * @NFNL_HOOK_TYPE_BPF: bpf program
5964 */
6065enum nfnl_hook_chaintype {
6166 NFNL_HOOK_TYPE_NFTABLES = 0x1,
67 NFNL_HOOK_TYPE_BPF,
68};
69
70/**
71 * enum nfnl_hook_bpf_attributes - bpf prog description
72 *
73 * @NFNLA_HOOK_BPF_ID: bpf program id (NLA_U32)
74 */
75enum nfnl_hook_bpf_attributes {
76 NFNLA_HOOK_BPF_UNSPEC,
77 NFNLA_HOOK_BPF_ID,
78 __NFNLA_HOOK_BPF_MAX,
6279};
80#define NFNLA_HOOK_BPF_MAX (__NFNLA_HOOK_BPF_MAX - 1)
6381
6482#endif /* _NFNL_HOOK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_queue.h+1
......@@ -62,6 +62,7 @@ enum nfqnl_attr_type {
6262 NFQA_VLAN, /* nested attribute: packet vlan info */
6363 NFQA_L2HDR, /* full L2 header */
6464 NFQA_PRIORITY, /* skb->priority */
65 NFQA_CGROUP_CLASSID, /* __u32 cgroup classid */
6566
6667 __NFQA_MAX
6768};
lib/libc/include/any-linux-any/linux/netfilter_bridge/ebtables.h+12-10
......@@ -87,7 +87,7 @@ struct ebt_entries {
8787 /* nr. of entries */
8888 unsigned int nentries;
8989 /* entry list */
90 char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
90 char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
9191};
9292
9393/* used for the bitmask of struct ebt_entry */
......@@ -129,7 +129,7 @@ struct ebt_entry_match {
129129 } u;
130130 /* size of data */
131131 unsigned int match_size;
132 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
132 unsigned char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
133133};
134134
135135struct ebt_entry_watcher {
......@@ -142,7 +142,7 @@ struct ebt_entry_watcher {
142142 } u;
143143 /* size of data */
144144 unsigned int watcher_size;
145 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
145 unsigned char data[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
146146};
147147
148148struct ebt_entry_target {
......@@ -182,13 +182,15 @@ struct ebt_entry {
182182 unsigned char sourcemsk[ETH_ALEN];
183183 unsigned char destmac[ETH_ALEN];
184184 unsigned char destmsk[ETH_ALEN];
185 /* sizeof ebt_entry + matches */
186 unsigned int watchers_offset;
187 /* sizeof ebt_entry + matches + watchers */
188 unsigned int target_offset;
189 /* sizeof ebt_entry + matches + watchers + target */
190 unsigned int next_offset;
191 unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
185 __struct_group(/* no tag */, offsets, /* no attrs */,
186 /* sizeof ebt_entry + matches */
187 unsigned int watchers_offset;
188 /* sizeof ebt_entry + matches + watchers */
189 unsigned int target_offset;
190 /* sizeof ebt_entry + matches + watchers + target */
191 unsigned int next_offset;
192 );
193 unsigned char elems[] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
192194};
193195
194196static __inline__ struct ebt_entry_target *
lib/libc/include/any-linux-any/linux/netlink.h+5
......@@ -294,6 +294,8 @@ struct nla_bitfield32 {
294294 * entry has attributes again, the policy for those inner ones
295295 * and the corresponding maxtype may be specified.
296296 * @NL_ATTR_TYPE_BITFIELD32: &struct nla_bitfield32 attribute
297 * @NL_ATTR_TYPE_SINT: 32-bit or 64-bit signed attribute, aligned to 4B
298 * @NL_ATTR_TYPE_UINT: 32-bit or 64-bit unsigned attribute, aligned to 4B
297299 */
298300enum netlink_attribute_type {
299301 NL_ATTR_TYPE_INVALID,
......@@ -318,6 +320,9 @@ enum netlink_attribute_type {
318320 NL_ATTR_TYPE_NESTED_ARRAY,
319321
320322 NL_ATTR_TYPE_BITFIELD32,
323
324 NL_ATTR_TYPE_SINT,
325 NL_ATTR_TYPE_UINT,
321326};
322327
323328/**
lib/libc/include/any-linux-any/linux/nexthop.h+45
......@@ -30,6 +30,9 @@ enum {
3030
3131#define NEXTHOP_GRP_TYPE_MAX (__NEXTHOP_GRP_TYPE_MAX - 1)
3232
33#define NHA_OP_FLAG_DUMP_STATS BIT(0)
34#define NHA_OP_FLAG_DUMP_HW_STATS BIT(1)
35
3336enum {
3437 NHA_UNSPEC,
3538 NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */
......@@ -60,6 +63,18 @@ enum {
6063 /* nested; nexthop bucket attributes */
6164 NHA_RES_BUCKET,
6265
66 /* u32; operation-specific flags */
67 NHA_OP_FLAGS,
68
69 /* nested; nexthop group stats */
70 NHA_GROUP_STATS,
71
72 /* u32; nexthop hardware stats enable */
73 NHA_HW_STATS_ENABLE,
74
75 /* u32; read-only; whether any driver collects HW stats */
76 NHA_HW_STATS_USED,
77
6378 __NHA_MAX,
6479};
6580
......@@ -101,4 +116,34 @@ enum {
101116
102117#define NHA_RES_BUCKET_MAX (__NHA_RES_BUCKET_MAX - 1)
103118
119enum {
120 NHA_GROUP_STATS_UNSPEC,
121
122 /* nested; nexthop group entry stats */
123 NHA_GROUP_STATS_ENTRY,
124
125 __NHA_GROUP_STATS_MAX,
126};
127
128#define NHA_GROUP_STATS_MAX (__NHA_GROUP_STATS_MAX - 1)
129
130enum {
131 NHA_GROUP_STATS_ENTRY_UNSPEC,
132
133 /* u32; nexthop id of the nexthop group entry */
134 NHA_GROUP_STATS_ENTRY_ID,
135
136 /* uint; number of packets forwarded via the nexthop group entry */
137 NHA_GROUP_STATS_ENTRY_PACKETS,
138
139 /* uint; number of packets forwarded via the nexthop group entry in
140 * hardware
141 */
142 NHA_GROUP_STATS_ENTRY_PACKETS_HW,
143
144 __NHA_GROUP_STATS_ENTRY_MAX,
145};
146
147#define NHA_GROUP_STATS_ENTRY_MAX (__NHA_GROUP_STATS_ENTRY_MAX - 1)
148
104149#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfs.h-1
......@@ -61,7 +61,6 @@
6161 NFSERR_NOSPC = 28, /* v2 v3 v4 */
6262 NFSERR_ROFS = 30, /* v2 v3 v4 */
6363 NFSERR_MLINK = 31, /* v3 v4 */
64 NFSERR_OPNOTSUPP = 45, /* v2 v3 */
6564 NFSERR_NAMETOOLONG = 63, /* v2 v3 v4 */
6665 NFSERR_NOTEMPTY = 66, /* v2 v3 v4 */
6766 NFSERR_DQUOT = 69, /* v2 v3 v4 */
lib/libc/include/any-linux-any/linux/nfsd/export.h+13
......@@ -62,5 +62,18 @@
6262 | NFSEXP_ALLSQUASH \
6363 | NFSEXP_INSECURE_PORT)
6464
65/*
66 * Transport layer security policies that are permitted to access
67 * an export
68 */
69#define NFSEXP_XPRTSEC_NONE 0x0001
70#define NFSEXP_XPRTSEC_TLS 0x0002
71#define NFSEXP_XPRTSEC_MTLS 0x0004
72
73#define NFSEXP_XPRTSEC_NUM (3)
74
75#define NFSEXP_XPRTSEC_ALL (NFSEXP_XPRTSEC_NONE | \
76 NFSEXP_XPRTSEC_TLS | \
77 NFSEXP_XPRTSEC_MTLS)
6578
6679#endif /* NFSD_EXPORT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nfsd_netlink.h created+86
......@@ -0,0 +1,86 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/nfsd.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_NFSD_NETLINK_H
7#define _LINUX_NFSD_NETLINK_H
8
9#define NFSD_FAMILY_NAME "nfsd"
10#define NFSD_FAMILY_VERSION 1
11
12enum {
13 NFSD_A_RPC_STATUS_XID = 1,
14 NFSD_A_RPC_STATUS_FLAGS,
15 NFSD_A_RPC_STATUS_PROG,
16 NFSD_A_RPC_STATUS_VERSION,
17 NFSD_A_RPC_STATUS_PROC,
18 NFSD_A_RPC_STATUS_SERVICE_TIME,
19 NFSD_A_RPC_STATUS_PAD,
20 NFSD_A_RPC_STATUS_SADDR4,
21 NFSD_A_RPC_STATUS_DADDR4,
22 NFSD_A_RPC_STATUS_SADDR6,
23 NFSD_A_RPC_STATUS_DADDR6,
24 NFSD_A_RPC_STATUS_SPORT,
25 NFSD_A_RPC_STATUS_DPORT,
26 NFSD_A_RPC_STATUS_COMPOUND_OPS,
27
28 __NFSD_A_RPC_STATUS_MAX,
29 NFSD_A_RPC_STATUS_MAX = (__NFSD_A_RPC_STATUS_MAX - 1)
30};
31
32enum {
33 NFSD_A_SERVER_THREADS = 1,
34 NFSD_A_SERVER_GRACETIME,
35 NFSD_A_SERVER_LEASETIME,
36 NFSD_A_SERVER_SCOPE,
37
38 __NFSD_A_SERVER_MAX,
39 NFSD_A_SERVER_MAX = (__NFSD_A_SERVER_MAX - 1)
40};
41
42enum {
43 NFSD_A_VERSION_MAJOR = 1,
44 NFSD_A_VERSION_MINOR,
45 NFSD_A_VERSION_ENABLED,
46
47 __NFSD_A_VERSION_MAX,
48 NFSD_A_VERSION_MAX = (__NFSD_A_VERSION_MAX - 1)
49};
50
51enum {
52 NFSD_A_SERVER_PROTO_VERSION = 1,
53
54 __NFSD_A_SERVER_PROTO_MAX,
55 NFSD_A_SERVER_PROTO_MAX = (__NFSD_A_SERVER_PROTO_MAX - 1)
56};
57
58enum {
59 NFSD_A_SOCK_ADDR = 1,
60 NFSD_A_SOCK_TRANSPORT_NAME,
61
62 __NFSD_A_SOCK_MAX,
63 NFSD_A_SOCK_MAX = (__NFSD_A_SOCK_MAX - 1)
64};
65
66enum {
67 NFSD_A_SERVER_SOCK_ADDR = 1,
68
69 __NFSD_A_SERVER_SOCK_MAX,
70 NFSD_A_SERVER_SOCK_MAX = (__NFSD_A_SERVER_SOCK_MAX - 1)
71};
72
73enum {
74 NFSD_CMD_RPC_STATUS_GET = 1,
75 NFSD_CMD_THREADS_SET,
76 NFSD_CMD_THREADS_GET,
77 NFSD_CMD_VERSION_SET,
78 NFSD_CMD_VERSION_GET,
79 NFSD_CMD_LISTENER_SET,
80 NFSD_CMD_LISTENER_GET,
81
82 __NFSD_CMD_MAX,
83 NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1)
84};
85
86#endif /* _LINUX_NFSD_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nl80211.h+418-176
......@@ -11,7 +11,7 @@
1111 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
1212 * Copyright 2008 Colin McCabe <colin@cozybit.com>
1313 * Copyright 2015-2017 Intel Deutschland GmbH
14 * Copyright (C) 2018-2022 Intel Corporation
14 * Copyright (C) 2018-2024 Intel Corporation
1515 *
1616 * Permission to use, copy, modify, and/or distribute this software for any
1717 * purpose with or without fee is hereby granted, provided that the above
......@@ -72,7 +72,7 @@
7272 * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
7373 * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
7474 * - a setup station entry is added, not yet authorized, without any rate
75 * or capability information, this just exists to avoid race conditions
75 * or capability information; this just exists to avoid race conditions
7676 * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
7777 * to add rate and capability information to the station and at the same
7878 * time mark it authorized.
......@@ -87,7 +87,7 @@
8787 * DOC: Frame transmission/registration support
8888 *
8989 * Frame transmission and registration support exists to allow userspace
90 * management entities such as wpa_supplicant react to management frames
90 * management entities such as wpa_supplicant to react to management frames
9191 * that are not being handled by the kernel. This includes, for example,
9292 * certain classes of action frames that cannot be handled in the kernel
9393 * for various reasons.
......@@ -113,7 +113,7 @@
113113 *
114114 * Frame transmission allows userspace to send for example the required
115115 * responses to action frames. It is subject to some sanity checking,
116 * but many frames can be transmitted. When a frame was transmitted, its
116 * but many frames can be transmitted. When a frame is transmitted, its
117117 * status is indicated to the sending socket.
118118 *
119119 * For more technical details, see the corresponding command descriptions
......@@ -123,7 +123,7 @@
123123/**
124124 * DOC: Virtual interface / concurrency capabilities
125125 *
126 * Some devices are able to operate with virtual MACs, they can have
126 * Some devices are able to operate with virtual MACs; they can have
127127 * more than one virtual interface. The capability handling for this
128128 * is a bit complex though, as there may be a number of restrictions
129129 * on the types of concurrency that are supported.
......@@ -135,7 +135,7 @@
135135 * Once concurrency is desired, more attributes must be observed:
136136 * To start with, since some interface types are purely managed in
137137 * software, like the AP-VLAN type in mac80211 for example, there's
138 * an additional list of these, they can be added at any time and
138 * an additional list of these; they can be added at any time and
139139 * are only restricted by some semantic restrictions (e.g. AP-VLAN
140140 * cannot be added without a corresponding AP interface). This list
141141 * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
......@@ -164,17 +164,17 @@
164164 * Packet coalesce feature helps to reduce number of received interrupts
165165 * to host by buffering these packets in firmware/hardware for some
166166 * predefined time. Received interrupt will be generated when one of the
167 * following events occur.
167 * following events occurs.
168168 * a) Expiration of hardware timer whose expiration time is set to maximum
169169 * coalescing delay of matching coalesce rule.
170 * b) Coalescing buffer in hardware reaches it's limit.
170 * b) Coalescing buffer in hardware reaches its limit.
171171 * c) Packet doesn't match any of the configured coalesce rules.
172172 *
173173 * User needs to configure following parameters for creating a coalesce
174174 * rule.
175175 * a) Maximum coalescing delay
176176 * b) List of packet patterns which needs to be matched
177 * c) Condition for coalescence. pattern 'match' or 'no match'
177 * c) Condition for coalescence: pattern 'match' or 'no match'
178178 * Multiple such rules can be created.
179179 */
180180
......@@ -213,7 +213,7 @@
213213/**
214214 * DOC: FILS shared key authentication offload
215215 *
216 * FILS shared key authentication offload can be advertized by drivers by
216 * FILS shared key authentication offload can be advertised by drivers by
217217 * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support
218218 * FILS shared key authentication offload should be able to construct the
219219 * authentication and association frames for FILS shared key authentication and
......@@ -239,7 +239,7 @@
239239 * The PMKSA can be maintained in userspace persistently so that it can be used
240240 * later after reboots or wifi turn off/on also.
241241 *
242 * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS
242 * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertised by a FILS
243243 * capable AP supporting PMK caching. It specifies the scope within which the
244244 * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and
245245 * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based
......@@ -290,12 +290,12 @@
290290 * If the configuration needs to be applied for specific peer then the MAC
291291 * address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
292292 * configuration will be applied for all the connected peers in the vif except
293 * any peers that have peer specific configuration for the TID by default; if
294 * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer specific values
293 * any peers that have peer-specific configuration for the TID by default; if
294 * the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer-specific values
295295 * will be overwritten.
296296 *
297 * All this configuration is valid only for STA's current connection
298 * i.e. the configuration will be reset to default when the STA connects back
297 * All this configuration is valid only for STA's current connection,
298 * i.e., the configuration will be reset to default when the STA connects back
299299 * after disconnection/roaming, and this configuration will be cleared when
300300 * the interface goes down.
301301 */
......@@ -326,7 +326,7 @@
326326/**
327327 * DOC: Multi-Link Operation
328328 *
329 * In Multi-Link Operation, a connection between to MLDs utilizes multiple
329 * In Multi-Link Operation, a connection between two MLDs utilizes multiple
330330 * links. To use this in nl80211, various commands and responses now need
331331 * to or will include the new %NL80211_ATTR_MLO_LINKS attribute.
332332 * Additionally, various commands that need to operate on a specific link
......@@ -334,6 +334,15 @@
334334 * use %NL80211_CMD_START_AP or similar functions.
335335 */
336336
337/**
338 * DOC: OWE DH IE handling offload
339 *
340 * By setting @NL80211_EXT_FEATURE_OWE_OFFLOAD flag, drivers can indicate
341 * kernel/application space to avoid DH IE handling. When this flag is
342 * advertised, the driver/device will take care of DH IE inclusion and
343 * processing of peer DH IE to generate PMK.
344 */
345
337346/**
338347 * enum nl80211_commands - supported nl80211 commands
339348 *
......@@ -404,8 +413,8 @@
404413 * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
405414 * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
406415 * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
407 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
408 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
416 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
417 * %NL80211_ATTR_CIPHER_SUITE_GROUP, %NL80211_ATTR_WPA_VERSIONS,
409418 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
410419 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
411420 * %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
......@@ -429,23 +438,19 @@
429438 * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
430439 * of disconnection indication should be sent to the station
431440 * (Deauthentication or Disassociation frame and reason code for that
432 * frame).
441 * frame). %NL80211_ATTR_MLO_LINK_ID can be used optionally to remove
442 * stations connected and using at least that link as one of its links.
433443 *
434444 * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
435 * destination %NL80211_ATTR_MAC on the interface identified by
436 * %NL80211_ATTR_IFINDEX.
445 * destination %NL80211_ATTR_MAC on the interface identified by
446 * %NL80211_ATTR_IFINDEX.
437447 * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
438 * destination %NL80211_ATTR_MAC on the interface identified by
439 * %NL80211_ATTR_IFINDEX.
448 * destination %NL80211_ATTR_MAC on the interface identified by
449 * %NL80211_ATTR_IFINDEX.
440450 * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
441451 * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
442452 * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
443453 * %NL80211_ATTR_MAC.
444 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
445 * interface identified by %NL80211_ATTR_IFINDEX.
446 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
447 * or, if no MAC address given, all mesh paths, on the interface identified
448 * by %NL80211_ATTR_IFINDEX.
449454 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
450455 * %NL80211_ATTR_IFINDEX.
451456 *
......@@ -466,15 +471,15 @@
466471 * after being queried by the kernel. CRDA replies by sending a regulatory
467472 * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
468473 * current alpha2 if it found a match. It also provides
469 * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
470 * regulatory rule is a nested set of attributes given by
471 * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
472 * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
473 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
474 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
474 * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
475 * regulatory rule is a nested set of attributes given by
476 * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
477 * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
478 * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
479 * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
475480 * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
476 * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
477 * store this as a valid request and then query userspace for it.
481 * to the specified ISO/IEC 3166-1 alpha2 country code. The core will
482 * store this as a valid request and then query userspace for it.
478483 *
479484 * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
480485 * interface identified by %NL80211_ATTR_IFINDEX
......@@ -512,7 +517,7 @@
512517 * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
513518 * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
514519 * scheduled scan will run in an infinite loop with the specified interval.
515 * These attributes are mutually exculsive,
520 * These attributes are mutually exclusive,
516521 * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
517522 * NL80211_ATTR_SCHED_SCAN_PLANS is defined.
518523 * If for some reason scheduled scan is aborted by the driver, all scan
......@@ -543,7 +548,7 @@
543548 * %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
544549 * is brought down while a scheduled scan was running.
545550 *
546 * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation
551 * @NL80211_CMD_GET_SURVEY: get survey results, e.g. channel occupation
547552 * or noise level
548553 * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
549554 * NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
......@@ -554,40 +559,41 @@
554559 * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID,
555560 * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS
556561 * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier
557 * advertized by a FILS capable AP identifying the scope of PMKSA in an
562 * advertised by a FILS capable AP identifying the scope of PMKSA in an
558563 * ESS.
559564 * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
560565 * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID,
561566 * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS
562 * authentication.
567 * authentication. Additionally in case of SAE offload and OWE offloads
568 * PMKSA entry can be deleted using %NL80211_ATTR_SSID.
563569 * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
564570 *
565571 * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
566 * has been changed and provides details of the request information
567 * that caused the change such as who initiated the regulatory request
568 * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
569 * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
570 * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
571 * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
572 * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
573 * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
574 * to (%NL80211_ATTR_REG_ALPHA2).
572 * has been changed and provides details of the request information
573 * that caused the change such as who initiated the regulatory request
574 * (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
575 * (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
576 * the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
577 * %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
578 * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
579 * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
580 * to (%NL80211_ATTR_REG_ALPHA2).
575581 * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
576 * has been found while world roaming thus enabling active scan or
577 * any mode of operation that initiates TX (beacons) on a channel
578 * where we would not have been able to do either before. As an example
579 * if you are world roaming (regulatory domain set to world or if your
580 * driver is using a custom world roaming regulatory domain) and while
581 * doing a passive scan on the 5 GHz band you find an AP there (if not
582 * on a DFS channel) you will now be able to actively scan for that AP
583 * or use AP mode on your card on that same channel. Note that this will
584 * never be used for channels 1-11 on the 2 GHz band as they are always
585 * enabled world wide. This beacon hint is only sent if your device had
586 * either disabled active scanning or beaconing on a channel. We send to
587 * userspace the wiphy on which we removed a restriction from
588 * (%NL80211_ATTR_WIPHY) and the channel on which this occurred
589 * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
590 * the beacon hint was processed.
582 * has been found while world roaming thus enabling active scan or
583 * any mode of operation that initiates TX (beacons) on a channel
584 * where we would not have been able to do either before. As an example
585 * if you are world roaming (regulatory domain set to world or if your
586 * driver is using a custom world roaming regulatory domain) and while
587 * doing a passive scan on the 5 GHz band you find an AP there (if not
588 * on a DFS channel) you will now be able to actively scan for that AP
589 * or use AP mode on your card on that same channel. Note that this will
590 * never be used for channels 1-11 on the 2 GHz band as they are always
591 * enabled world wide. This beacon hint is only sent if your device had
592 * either disabled active scanning or beaconing on a channel. We send to
593 * userspace the wiphy on which we removed a restriction from
594 * (%NL80211_ATTR_WIPHY) and the channel on which this occurred
595 * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
596 * the beacon hint was processed.
591597 *
592598 * @NL80211_CMD_AUTHENTICATE: authentication request and notification.
593599 * This command is used both as a command (request to authenticate) and
......@@ -598,7 +604,7 @@
598604 * BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
599605 * the SSID (mainly for association, but is included in authentication
600606 * request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ +
601 * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequence of the
607 * %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequency of the
602608 * channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the
603609 * authentication type. %NL80211_ATTR_IE is used to define IEs
604610 * (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added
......@@ -807,7 +813,7 @@
807813 * reached.
808814 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
809815 * and the attributes determining channel width) the given interface
810 * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
816 * (identified by %NL80211_ATTR_IFINDEX) shall operate on.
811817 * In case multiple channels are supported by the device, the mechanism
812818 * with which it switches channels is implementation-defined.
813819 * When a monitor interface is given, it can only switch channel while
......@@ -879,7 +885,7 @@
879885 * inform userspace of the new replay counter.
880886 *
881887 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
882 * of PMKSA caching dandidates.
888 * of PMKSA caching candidates.
883889 *
884890 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
885891 * In addition, this can be used as an event to request userspace to take
......@@ -915,7 +921,7 @@
915921 *
916922 * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
917923 * by sending a null data frame to it and reporting when the frame is
918 * acknowleged. This is used to allow timing out inactive clients. Uses
924 * acknowledged. This is used to allow timing out inactive clients. Uses
919925 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
920926 * direct reply with an %NL80211_ATTR_COOKIE that is later used to match
921927 * up the event with the request. The event includes the same data and
......@@ -1109,7 +1115,7 @@
11091115 * current configuration is not changed. If it is present but
11101116 * set to zero, the configuration is changed to don't-care
11111117 * (i.e. the device can decide what to do).
1112 * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported.
1118 * @NL80211_CMD_NAN_MATCH: Notification sent when a match is reported.
11131119 * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
11141120 * %NL80211_ATTR_COOKIE.
11151121 *
......@@ -1126,11 +1132,15 @@
11261132 * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
11271133 * configured PMK for the authenticator address identified by
11281134 * %NL80211_ATTR_MAC.
1129 * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates an 802.1X FT roam was
1130 * completed successfully. Drivers that support 4 way handshake offload
1131 * should send this event after indicating 802.1X FT assocation with
1132 * %NL80211_CMD_ROAM. If the 4 way handshake failed %NL80211_CMD_DISCONNECT
1133 * should be indicated instead.
1135 * @NL80211_CMD_PORT_AUTHORIZED: An event that indicates port is authorized and
1136 * open for regular data traffic. For STA/P2P-client, this event is sent
1137 * with AP MAC address and for AP/P2P-GO, the event carries the STA/P2P-
1138 * client MAC address.
1139 * Drivers that support 4 way handshake offload should send this event for
1140 * STA/P2P-client after successful 4-way HS or after 802.1X FT following
1141 * NL80211_CMD_CONNECT or NL80211_CMD_ROAM. Drivers using AP/P2P-GO 4-way
1142 * handshake offload should send this event on successful completion of
1143 * 4-way handshake with the peer (STA/P2P-client).
11341144 * @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
11351145 * and RX notification. This command is used both as a request to transmit
11361146 * a control port frame and as a notification that a control port frame
......@@ -1299,6 +1309,26 @@
12991309 * @NL80211_CMD_MODIFY_LINK_STA: Modify a link of an MLD station
13001310 * @NL80211_CMD_REMOVE_LINK_STA: Remove a link of an MLD station
13011311 *
1312 * @NL80211_CMD_SET_HW_TIMESTAMP: Enable/disable HW timestamping of Timing
1313 * measurement and Fine timing measurement frames. If %NL80211_ATTR_MAC
1314 * is included, enable/disable HW timestamping only for frames to/from the
1315 * specified MAC address. Otherwise enable/disable HW timestamping for
1316 * all TM/FTM frames (including ones that were enabled with specific MAC
1317 * address). If %NL80211_ATTR_HW_TIMESTAMP_ENABLED is not included, disable
1318 * HW timestamping.
1319 * The number of peers that HW timestamping can be enabled for concurrently
1320 * is indicated by %NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS.
1321 *
1322 * @NL80211_CMD_LINKS_REMOVED: Notify userspace about the removal of STA MLD
1323 * setup links due to AP MLD removing the corresponding affiliated APs with
1324 * Multi-Link reconfiguration. %NL80211_ATTR_MLO_LINKS is used to provide
1325 * information about the removed STA MLD setup links.
1326 *
1327 * @NL80211_CMD_SET_TID_TO_LINK_MAPPING: Set the TID to Link Mapping for a
1328 * non-AP MLD station. The %NL80211_ATTR_MLO_TTLM_DLINK and
1329 * %NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the
1330 * TID to Link mapping for downlink/uplink traffic.
1331 *
13021332 * @NL80211_CMD_MAX: highest used command number
13031333 * @__NL80211_CMD_AFTER_LAST: internal use
13041334 */
......@@ -1550,6 +1580,12 @@ enum nl80211_commands {
15501580 NL80211_CMD_MODIFY_LINK_STA,
15511581 NL80211_CMD_REMOVE_LINK_STA,
15521582
1583 NL80211_CMD_SET_HW_TIMESTAMP,
1584
1585 NL80211_CMD_LINKS_REMOVED,
1586
1587 NL80211_CMD_SET_TID_TO_LINK_MAPPING,
1588
15531589 /* add new commands above here */
15541590
15551591 /* used to define NL80211_CMD_MAX below */
......@@ -1674,21 +1710,21 @@ enum nl80211_commands {
16741710 * (see &enum nl80211_plink_action).
16751711 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
16761712 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
1677 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
1713 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
16781714 * &enum nl80211_mpath_info.
16791715 *
16801716 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
16811717 * &enum nl80211_mntr_flags.
16821718 *
16831719 * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
1684 * current regulatory domain should be set to or is already set to.
1685 * For example, 'CR', for Costa Rica. This attribute is used by the kernel
1686 * to query the CRDA to retrieve one regulatory domain. This attribute can
1687 * also be used by userspace to query the kernel for the currently set
1688 * regulatory domain. We chose an alpha2 as that is also used by the
1689 * IEEE-802.11 country information element to identify a country.
1690 * Users can also simply ask the wireless core to set regulatory domain
1691 * to a specific alpha2.
1720 * current regulatory domain should be set to or is already set to.
1721 * For example, 'CR', for Costa Rica. This attribute is used by the kernel
1722 * to query the CRDA to retrieve one regulatory domain. This attribute can
1723 * also be used by userspace to query the kernel for the currently set
1724 * regulatory domain. We chose an alpha2 as that is also used by the
1725 * IEEE-802.11 country information element to identify a country.
1726 * Users can also simply ask the wireless core to set regulatory domain
1727 * to a specific alpha2.
16921728 * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
16931729 * rules.
16941730 *
......@@ -1731,9 +1767,9 @@ enum nl80211_commands {
17311767 * @NL80211_ATTR_BSS: scan result BSS
17321768 *
17331769 * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
1734 * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
1770 * currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
17351771 * @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
1736 * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
1772 * set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
17371773 *
17381774 * @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
17391775 * an array of command numbers (i.e. a mapping index to command number)
......@@ -1752,15 +1788,15 @@ enum nl80211_commands {
17521788 * a u32
17531789 *
17541790 * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
1755 * due to considerations from a beacon hint. This attribute reflects
1756 * the state of the channel _before_ the beacon hint processing. This
1757 * attributes consists of a nested attribute containing
1758 * NL80211_FREQUENCY_ATTR_*
1791 * due to considerations from a beacon hint. This attribute reflects
1792 * the state of the channel _before_ the beacon hint processing. This
1793 * attributes consists of a nested attribute containing
1794 * NL80211_FREQUENCY_ATTR_*
17591795 * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
1760 * due to considerations from a beacon hint. This attribute reflects
1761 * the state of the channel _after_ the beacon hint processing. This
1762 * attributes consists of a nested attribute containing
1763 * NL80211_FREQUENCY_ATTR_*
1796 * due to considerations from a beacon hint. This attribute reflects
1797 * the state of the channel _after_ the beacon hint processing. This
1798 * attributes consists of a nested attribute containing
1799 * NL80211_FREQUENCY_ATTR_*
17641800 *
17651801 * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
17661802 * cipher suites
......@@ -1807,7 +1843,7 @@ enum nl80211_commands {
18071843 * using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
18081844 * to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
18091845 * flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
1810 * frames are not forwared over the control port.
1846 * frames are not forwarded over the control port.
18111847 *
18121848 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
18131849 * We recommend using nested, driver-specific attributes within this.
......@@ -1821,12 +1857,6 @@ enum nl80211_commands {
18211857 * that protected APs should be used. This is also used with NEW_BEACON to
18221858 * indicate that the BSS is to use protection.
18231859 *
1824 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
1825 * to indicate which unicast key ciphers will be used with the connection
1826 * (an array of u32).
1827 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
1828 * indicate which group key cipher will be used with the connection (a
1829 * u32).
18301860 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
18311861 * indicate which WPA version(s) the AP we want to associate with is using
18321862 * (a u32 with flags from &enum nl80211_wpa_versions).
......@@ -1857,6 +1887,7 @@ enum nl80211_commands {
18571887 * with %NL80211_KEY_* sub-attributes
18581888 *
18591889 * @NL80211_ATTR_PID: Process ID of a network namespace.
1890 * @NL80211_ATTR_NETNS_FD: File descriptor of a network namespace.
18601891 *
18611892 * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
18621893 * dumps. This number increases whenever the object list being
......@@ -1911,6 +1942,7 @@ enum nl80211_commands {
19111942 *
19121943 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
19131944 * acknowledged by the recipient.
1945 * @NL80211_ATTR_ACK_SIGNAL: Station's ack signal strength (s32)
19141946 *
19151947 * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
19161948 *
......@@ -1944,10 +1976,10 @@ enum nl80211_commands {
19441976 * bit. Depending on which antennas are selected in the bitmap, 802.11n
19451977 * drivers can derive which chainmasks to use (if all antennas belonging to
19461978 * a particular chain are disabled this chain should be disabled) and if
1947 * a chain has diversity antennas wether diversity should be used or not.
1979 * a chain has diversity antennas whether diversity should be used or not.
19481980 * HT capabilities (STBC, TX Beamforming, Antenna selection) can be
19491981 * derived from the available chains after applying the antenna mask.
1950 * Non-802.11n drivers can derive wether to use diversity or not.
1982 * Non-802.11n drivers can derive whether to use diversity or not.
19511983 * Drivers may reject configurations or RX/TX mask combinations they cannot
19521984 * support by returning -EINVAL.
19531985 *
......@@ -2108,6 +2140,9 @@ enum nl80211_commands {
21082140 * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable
21092141 * this feature during association. This is a flag attribute.
21102142 * Currently only supported in mac80211 drivers.
2143 * @NL80211_ATTR_DISABLE_EHT: Force EHT capable interfaces to disable
2144 * this feature during association. This is a flag attribute.
2145 * Currently only supported in mac80211 drivers.
21112146 * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
21122147 * ATTR_HT_CAPABILITY to which attention should be paid.
21132148 * Currently, only mac80211 NICs support this feature.
......@@ -2117,6 +2152,12 @@ enum nl80211_commands {
21172152 * All values are treated as suggestions and may be ignored
21182153 * by the driver as required. The actual values may be seen in
21192154 * the station debugfs ht_caps file.
2155 * @NL80211_ATTR_VHT_CAPABILITY_MASK: Specify which bits of the
2156 * ATTR_VHT_CAPABILITY to which attention should be paid.
2157 * Currently, only mac80211 NICs support this feature.
2158 * All values are treated as suggestions and may be ignored
2159 * by the driver as required. The actual values may be seen in
2160 * the station debugfs vht_caps file.
21202161 *
21212162 * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
21222163 * abides to when initiating radiation on DFS channels. A country maps
......@@ -2375,7 +2416,7 @@ enum nl80211_commands {
23752416 * scheduled scan is started. Or the delay before a WoWLAN
23762417 * net-detect scan is started, counting from the moment the
23772418 * system is suspended. This value is a u32, in seconds.
2378
2419 *
23792420 * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
23802421 * is operating in an indoor environment.
23812422 *
......@@ -2517,7 +2558,7 @@ enum nl80211_commands {
25172558 * from successful FILS authentication and is used with
25182559 * %NL80211_CMD_CONNECT.
25192560 *
2520 * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP
2561 * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertised by a FILS AP
25212562 * identifying the scope of PMKSAs. This is used with
25222563 * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA.
25232564 *
......@@ -2671,11 +2712,13 @@ enum nl80211_commands {
26712712 *
26722713 * @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS
26732714 * discovery. It is a nested attribute, see
2674 * &enum nl80211_fils_discovery_attributes.
2715 * &enum nl80211_fils_discovery_attributes. Userspace should pass an empty
2716 * nested attribute to disable this feature and delete the templates.
26752717 *
26762718 * @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure
26772719 * unsolicited broadcast probe response. It is a nested attribute, see
2678 * &enum nl80211_unsol_bcast_probe_resp_attributes.
2720 * &enum nl80211_unsol_bcast_probe_resp_attributes. Userspace should pass an empty
2721 * nested attribute to disable this feature and delete the templates.
26792722 *
26802723 * @NL80211_ATTR_S1G_CAPABILITY: S1G Capability information element (from
26812724 * association request when used with NL80211_CMD_NEW_STATION)
......@@ -2775,6 +2818,44 @@ enum nl80211_commands {
27752818 * indicates that the sub-channel is punctured. Higher 16 bits are
27762819 * reserved.
27772820 *
2821 * @NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS: Maximum number of peers that HW
2822 * timestamping can be enabled for concurrently (u16), a wiphy attribute.
2823 * A value of 0xffff indicates setting for all peers (i.e. not specifying
2824 * an address with %NL80211_CMD_SET_HW_TIMESTAMP) is supported.
2825 * @NL80211_ATTR_HW_TIMESTAMP_ENABLED: Indicates whether HW timestamping should
2826 * be enabled or not (flag attribute).
2827 *
2828 * @NL80211_ATTR_EMA_RNR_ELEMS: Optional nested attribute for
2829 * reduced neighbor report (RNR) elements. This attribute can be used
2830 * only when NL80211_MBSSID_CONFIG_ATTR_EMA is enabled.
2831 * Userspace is responsible for splitting the RNR into multiple
2832 * elements such that each element excludes the non-transmitting
2833 * profiles already included in the MBSSID element
2834 * (%NL80211_ATTR_MBSSID_ELEMS) at the same index. Each EMA beacon
2835 * will be generated by adding MBSSID and RNR elements at the same
2836 * index. If the userspace includes more RNR elements than number of
2837 * MBSSID elements then these will be added in every EMA beacon.
2838 *
2839 * @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
2840 * disabled.
2841 *
2842 * @NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA: Include BSS usage data, i.e.
2843 * include BSSes that can only be used in restricted scenarios and/or
2844 * cannot be used at all.
2845 *
2846 * @NL80211_ATTR_MLO_TTLM_DLINK: Binary attribute specifying the downlink TID to
2847 * link mapping. The length is 8 * sizeof(u16). For each TID the link
2848 * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
2849 * in Draft P802.11be_D4.0.
2850 * @NL80211_ATTR_MLO_TTLM_ULINK: Binary attribute specifying the uplink TID to
2851 * link mapping. The length is 8 * sizeof(u16). For each TID the link
2852 * mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
2853 * in Draft P802.11be_D4.0.
2854 *
2855 * @NL80211_ATTR_ASSOC_SPP_AMSDU: flag attribute used with
2856 * %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs
2857 * are used on this connection
2858 *
27782859 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
27792860 * @NL80211_ATTR_MAX: highest attribute number currently defined
27802861 * @__NL80211_ATTR_AFTER_LAST: internal use
......@@ -3306,6 +3387,20 @@ enum nl80211_attrs {
33063387
33073388 NL80211_ATTR_PUNCT_BITMAP,
33083389
3390 NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS,
3391 NL80211_ATTR_HW_TIMESTAMP_ENABLED,
3392
3393 NL80211_ATTR_EMA_RNR_ELEMS,
3394
3395 NL80211_ATTR_MLO_LINK_DISABLED,
3396
3397 NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA,
3398
3399 NL80211_ATTR_MLO_TTLM_DLINK,
3400 NL80211_ATTR_MLO_TTLM_ULINK,
3401
3402 NL80211_ATTR_ASSOC_SPP_AMSDU,
3403
33093404 /* add attributes here, update the policy in nl80211.c */
33103405
33113406 __NL80211_ATTR_AFTER_LAST,
......@@ -3446,6 +3541,7 @@ enum nl80211_iftype {
34463541 * @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
34473542 * that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
34483543 * previously added station into associated state
3544 * @NL80211_STA_FLAG_SPP_AMSDU: station supports SPP A-MSDUs
34493545 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
34503546 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
34513547 */
......@@ -3458,6 +3554,7 @@ enum nl80211_sta_flags {
34583554 NL80211_STA_FLAG_AUTHENTICATED,
34593555 NL80211_STA_FLAG_TDLS_PEER,
34603556 NL80211_STA_FLAG_ASSOCIATED,
3557 NL80211_STA_FLAG_SPP_AMSDU,
34613558
34623559 /* keep last */
34633560 __NL80211_STA_FLAG_AFTER_LAST,
......@@ -3468,7 +3565,7 @@ enum nl80211_sta_flags {
34683565 * enum nl80211_sta_p2p_ps_status - station support of P2P PS
34693566 *
34703567 * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism
3471 * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
3568 * @NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
34723569 * @NUM_NL80211_P2P_PS_STATUS: number of values
34733570 */
34743571enum nl80211_sta_p2p_ps_status {
......@@ -3506,9 +3603,9 @@ enum nl80211_he_gi {
35063603
35073604/**
35083605 * enum nl80211_he_ltf - HE long training field
3509 * @NL80211_RATE_INFO_HE_1xLTF: 3.2 usec
3510 * @NL80211_RATE_INFO_HE_2xLTF: 6.4 usec
3511 * @NL80211_RATE_INFO_HE_4xLTF: 12.8 usec
3606 * @NL80211_RATE_INFO_HE_1XLTF: 3.2 usec
3607 * @NL80211_RATE_INFO_HE_2XLTF: 6.4 usec
3608 * @NL80211_RATE_INFO_HE_4XLTF: 12.8 usec
35123609 */
35133610enum nl80211_he_ltf {
35143611 NL80211_RATE_INFO_HE_1XLTF,
......@@ -3623,7 +3720,7 @@ enum nl80211_eht_ru_alloc {
36233720 * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier
36243721 * (u8, see &enum nl80211_he_gi)
36253722 * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
3626 * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
3723 * @NL80211_RATE_INFO_HE_RU_ALLOC: HE RU allocation, if not present then
36273724 * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
36283725 * @NL80211_RATE_INFO_320_MHZ_WIDTH: 320 MHz bitrate
36293726 * @NL80211_RATE_INFO_EHT_MCS: EHT MCS index (u8, 0-15)
......@@ -3632,6 +3729,13 @@ enum nl80211_eht_ru_alloc {
36323729 * (u8, see &enum nl80211_eht_gi)
36333730 * @NL80211_RATE_INFO_EHT_RU_ALLOC: EHT RU allocation, if not present then
36343731 * non-OFDMA was used (u8, see &enum nl80211_eht_ru_alloc)
3732 * @NL80211_RATE_INFO_S1G_MCS: S1G MCS index (u8, 0-10)
3733 * @NL80211_RATE_INFO_S1G_NSS: S1G NSS value (u8, 1-4)
3734 * @NL80211_RATE_INFO_1_MHZ_WIDTH: 1 MHz S1G rate
3735 * @NL80211_RATE_INFO_2_MHZ_WIDTH: 2 MHz S1G rate
3736 * @NL80211_RATE_INFO_4_MHZ_WIDTH: 4 MHz S1G rate
3737 * @NL80211_RATE_INFO_8_MHZ_WIDTH: 8 MHz S1G rate
3738 * @NL80211_RATE_INFO_16_MHZ_WIDTH: 16 MHz S1G rate
36353739 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
36363740 */
36373741enum nl80211_rate_info {
......@@ -3658,6 +3762,13 @@ enum nl80211_rate_info {
36583762 NL80211_RATE_INFO_EHT_NSS,
36593763 NL80211_RATE_INFO_EHT_GI,
36603764 NL80211_RATE_INFO_EHT_RU_ALLOC,
3765 NL80211_RATE_INFO_S1G_MCS,
3766 NL80211_RATE_INFO_S1G_NSS,
3767 NL80211_RATE_INFO_1_MHZ_WIDTH,
3768 NL80211_RATE_INFO_2_MHZ_WIDTH,
3769 NL80211_RATE_INFO_4_MHZ_WIDTH,
3770 NL80211_RATE_INFO_8_MHZ_WIDTH,
3771 NL80211_RATE_INFO_16_MHZ_WIDTH,
36613772
36623773 /* keep last */
36633774 __NL80211_RATE_INFO_AFTER_LAST,
......@@ -3712,7 +3823,7 @@ enum nl80211_sta_bss_param {
37123823 * (u64, to this station)
37133824 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
37143825 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
3715 * containing info as possible, see &enum nl80211_rate_info
3826 * containing info as possible, see &enum nl80211_rate_info
37163827 * @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs)
37173828 * (u32, from this station)
37183829 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs)
......@@ -3741,8 +3852,8 @@ enum nl80211_sta_bss_param {
37413852 * Contains a nested array of signal strength attributes (u8, dBm)
37423853 * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
37433854 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
3744 * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput considering also the
3745 * 802.11 header (u32, kbps)
3855 * @NL80211_STA_INFO_EXPECTED_THROUGHPUT: expected throughput considering also
3856 * the 802.11 header (u32, kbps)
37463857 * @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
37473858 * (u64)
37483859 * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
......@@ -3928,7 +4039,7 @@ enum nl80211_mpath_flags {
39284039 * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
39294040 * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
39304041 * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
3931 * &enum nl80211_mpath_flags;
4042 * &enum nl80211_mpath_flags;
39324043 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
39334044 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
39344045 * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
......@@ -4026,6 +4137,10 @@ enum nl80211_band_iftype_attr {
40264137 * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
40274138 * the allowed channel bandwidth configurations.
40284139 * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
4140 * @NL80211_BAND_ATTR_S1G_MCS_NSS_SET: S1G capabilities, supported S1G-MCS and NSS
4141 * set subfield, as in the S1G information IE, 5 bytes
4142 * @NL80211_BAND_ATTR_S1G_CAPA: S1G capabilities information subfield as in the
4143 * S1G information IE, 10 bytes
40294144 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
40304145 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
40314146 */
......@@ -4046,6 +4161,9 @@ enum nl80211_band_attr {
40464161 NL80211_BAND_ATTR_EDMG_CHANNELS,
40474162 NL80211_BAND_ATTR_EDMG_BW_CONFIG,
40484163
4164 NL80211_BAND_ATTR_S1G_MCS_NSS_SET,
4165 NL80211_BAND_ATTR_S1G_CAPA,
4166
40494167 /* keep last */
40504168 __NL80211_BAND_ATTR_AFTER_LAST,
40514169 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
......@@ -4061,7 +4179,7 @@ enum nl80211_band_attr {
40614179 * @NL80211_WMMR_CW_MAX: Maximum contention window slot.
40624180 * @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space.
40634181 * @NL80211_WMMR_TXOP: Maximum allowed tx operation time.
4064 * @nl80211_WMMR_MAX: highest possible wmm rule.
4182 * @NL80211_WMMR_MAX: highest possible wmm rule.
40654183 * @__NL80211_WMMR_LAST: Internal use.
40664184 */
40674185enum nl80211_wmm_rule {
......@@ -4083,15 +4201,16 @@ enum nl80211_wmm_rule {
40834201 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
40844202 * regulatory domain.
40854203 * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
4086 * are permitted on this channel, this includes sending probe
4087 * requests, or modes of operation that require beaconing.
4204 * are permitted on this channel, this includes sending probe
4205 * requests, or modes of operation that require beaconing.
4206 * @__NL80211_FREQUENCY_ATTR_NO_IBSS: obsolete, same as _NO_IR
40884207 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
40894208 * on this channel in current regulatory domain.
40904209 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
40914210 * (100 * dBm).
40924211 * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
40934212 * (enum nl80211_dfs_state)
4094 * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
4213 * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in milliseconds for how long
40954214 * this channel is in this DFS state.
40964215 * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
40974216 * channel as the control channel
......@@ -4145,6 +4264,19 @@ enum nl80211_wmm_rule {
41454264 * as the primary or any of the secondary channels isn't possible
41464265 * @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
41474266 * in current regulatory domain.
4267 * @NL80211_FREQUENCY_ATTR_PSD: Power spectral density (in dBm) that
4268 * is allowed on this channel in current regulatory domain.
4269 * @NL80211_FREQUENCY_ATTR_DFS_CONCURRENT: Operation on this channel is
4270 * allowed for peer-to-peer or adhoc communication under the control
4271 * of a DFS master which operates on the same channel (FCC-594280 D01
4272 * Section B.3). Should be used together with %NL80211_RRF_DFS only.
4273 * @NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP
4274 * not allowed using this channel
4275 * @NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP
4276 * not allowed using this channel
4277 * @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor
4278 * mode despite other (regulatory) restrictions, even if the channel is
4279 * otherwise completely disabled.
41484280 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
41494281 * currently defined
41504282 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
......@@ -4183,6 +4315,11 @@ enum nl80211_frequency_attr {
41834315 NL80211_FREQUENCY_ATTR_16MHZ,
41844316 NL80211_FREQUENCY_ATTR_NO_320MHZ,
41854317 NL80211_FREQUENCY_ATTR_NO_EHT,
4318 NL80211_FREQUENCY_ATTR_PSD,
4319 NL80211_FREQUENCY_ATTR_DFS_CONCURRENT,
4320 NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT,
4321 NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,
4322 NL80211_FREQUENCY_ATTR_CAN_MONITOR,
41864323
41874324 /* keep last */
41884325 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
......@@ -4195,6 +4332,10 @@ enum nl80211_frequency_attr {
41954332#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
41964333#define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \
41974334 NL80211_FREQUENCY_ATTR_IR_CONCURRENT
4335#define NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT \
4336 NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT
4337#define NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT \
4338 NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT
41984339
41994340/**
42004341 * enum nl80211_bitrate_attr - bitrate attributes
......@@ -4217,16 +4358,16 @@ enum nl80211_bitrate_attr {
42174358};
42184359
42194360/**
4220 * enum nl80211_initiator - Indicates the initiator of a reg domain request
4361 * enum nl80211_reg_initiator - Indicates the initiator of a reg domain request
42214362 * @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
4222 * regulatory domain.
4363 * regulatory domain.
42234364 * @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
4224 * regulatory domain.
4365 * regulatory domain.
42254366 * @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
4226 * wireless core it thinks its knows the regulatory domain we should be in.
4367 * wireless core it thinks its knows the regulatory domain we should be in.
42274368 * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
4228 * 802.11 country information element with regulatory information it
4229 * thinks we should consider. cfg80211 only processes the country
4369 * 802.11 country information element with regulatory information it
4370 * thinks we should consider. cfg80211 only processes the country
42304371 * code from the IE, and relies on the regulatory domain information
42314372 * structure passed by userspace (CRDA) from our wireless-regdb.
42324373 * If a channel is enabled but the country code indicates it should
......@@ -4245,11 +4386,11 @@ enum nl80211_reg_initiator {
42454386 * to a specific country. When this is set you can count on the
42464387 * ISO / IEC 3166 alpha2 country code being valid.
42474388 * @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
4248 * domain.
4389 * domain.
42494390 * @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
4250 * driver specific world regulatory domain. These do not apply system-wide
4251 * and are only applicable to the individual devices which have requested
4252 * them to be applied.
4391 * driver specific world regulatory domain. These do not apply system-wide
4392 * and are only applicable to the individual devices which have requested
4393 * them to be applied.
42534394 * @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
42544395 * of an intersection between two regulatory domains -- the previously
42554396 * set regulatory domain on the system and the last accepted regulatory
......@@ -4266,23 +4407,25 @@ enum nl80211_reg_type {
42664407 * enum nl80211_reg_rule_attr - regulatory rule attributes
42674408 * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
42684409 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
4269 * considerations for a given frequency range. These are the
4270 * &enum nl80211_reg_rule_flags.
4410 * considerations for a given frequency range. These are the
4411 * &enum nl80211_reg_rule_flags.
42714412 * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
4272 * rule in KHz. This is not a center of frequency but an actual regulatory
4273 * band edge.
4413 * rule in KHz. This is not a center of frequency but an actual regulatory
4414 * band edge.
42744415 * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
4275 * in KHz. This is not a center a frequency but an actual regulatory
4276 * band edge.
4416 * in KHz. This is not a center a frequency but an actual regulatory
4417 * band edge.
42774418 * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
42784419 * frequency range, in KHz.
42794420 * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
4280 * for a given frequency range. The value is in mBi (100 * dBi).
4281 * If you don't have one then don't send this.
4421 * for a given frequency range. The value is in mBi (100 * dBi).
4422 * If you don't have one then don't send this.
42824423 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
4283 * a given frequency range. The value is in mBm (100 * dBm).
4424 * a given frequency range. The value is in mBm (100 * dBm).
42844425 * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
42854426 * If not present or 0 default CAC time will be used.
4427 * @NL80211_ATTR_POWER_RULE_PSD: power spectral density (in dBm).
4428 * This could be negative.
42864429 * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
42874430 * currently defined
42884431 * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
......@@ -4300,6 +4443,8 @@ enum nl80211_reg_rule_attr {
43004443
43014444 NL80211_ATTR_DFS_CAC_TIME,
43024445
4446 NL80211_ATTR_POWER_RULE_PSD,
4447
43034448 /* keep last */
43044449 __NL80211_REG_RULE_ATTR_AFTER_LAST,
43054450 NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
......@@ -4328,14 +4473,7 @@ enum nl80211_reg_rule_attr {
43284473 * value as specified by &struct nl80211_bss_select_rssi_adjust.
43294474 * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
43304475 * (this cannot be used together with SSID).
4331 * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
4332 * band specific minimum rssi thresholds for the bands defined in
4333 * enum nl80211_band. The minimum rssi threshold value(s32) specific to a
4334 * band shall be encapsulated in attribute with type value equals to one
4335 * of the NL80211_BAND_* defined in enum nl80211_band. For example, the
4336 * minimum rssi threshold value for 2.4GHZ band shall be encapsulated
4337 * within an attribute of type NL80211_BAND_2GHZ. And one or more of such
4338 * attributes will be nested within this attribute.
4476 * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Obsolete
43394477 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
43404478 * attribute number currently defined
43414479 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
......@@ -4348,7 +4486,7 @@ enum nl80211_sched_scan_match_attr {
43484486 NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
43494487 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
43504488 NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
4351 NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
4489 NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI, /* obsolete */
43524490
43534491 /* keep last */
43544492 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
......@@ -4370,8 +4508,9 @@ enum nl80211_sched_scan_match_attr {
43704508 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
43714509 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
43724510 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
4373 * this includes probe requests or modes of operation that require
4374 * beaconing.
4511 * this includes probe requests or modes of operation that require
4512 * beaconing.
4513 * @__NL80211_RRF_NO_IBSS: obsolete, same as NO_IR
43754514 * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
43764515 * base on contiguous rules and wider channels will be allowed to cross
43774516 * multiple contiguous/overlapping frequency ranges.
......@@ -4382,6 +4521,14 @@ enum nl80211_sched_scan_match_attr {
43824521 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
43834522 * @NL80211_RRF_NO_HE: HE operation not allowed
43844523 * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
4524 * @NL80211_RRF_NO_EHT: EHT operation not allowed
4525 * @NL80211_RRF_PSD: Ruleset has power spectral density value
4526 * @NL80211_RRF_DFS_CONCURRENT: Operation on this channel is allowed for
4527 * peer-to-peer or adhoc communication under the control of a DFS master
4528 * which operates on the same channel (FCC-594280 D01 Section B.3).
4529 * Should be used together with %NL80211_RRF_DFS only.
4530 * @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed
4531 * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed
43854532 */
43864533enum nl80211_reg_rule_flags {
43874534 NL80211_RRF_NO_OFDM = 1<<0,
......@@ -4401,6 +4548,11 @@ enum nl80211_reg_rule_flags {
44014548 NL80211_RRF_NO_160MHZ = 1<<16,
44024549 NL80211_RRF_NO_HE = 1<<17,
44034550 NL80211_RRF_NO_320MHZ = 1<<18,
4551 NL80211_RRF_NO_EHT = 1<<19,
4552 NL80211_RRF_PSD = 1<<20,
4553 NL80211_RRF_DFS_CONCURRENT = 1<<21,
4554 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22,
4555 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23,
44044556};
44054557
44064558#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
......@@ -4409,6 +4561,8 @@ enum nl80211_reg_rule_flags {
44094561#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
44104562 NL80211_RRF_NO_HT40PLUS)
44114563#define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT
4564#define NL80211_RRF_NO_UHB_VLP_CLIENT NL80211_RRF_NO_6GHZ_VLP_CLIENT
4565#define NL80211_RRF_NO_UHB_AFC_CLIENT NL80211_RRF_NO_6GHZ_AFC_CLIENT
44124566
44134567/* For backport compatibility with older userspace */
44144568#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
......@@ -4555,8 +4709,8 @@ enum nl80211_mntr_flags {
45554709 * alternate between Active and Doze states, but may not wake up
45564710 * for neighbor's beacons.
45574711 *
4558 * @__NL80211_MESH_POWER_AFTER_LAST - internal use
4559 * @NL80211_MESH_POWER_MAX - highest possible power save level
4712 * @__NL80211_MESH_POWER_AFTER_LAST: internal use
4713 * @NL80211_MESH_POWER_MAX: highest possible power save level
45604714 */
45614715
45624716enum nl80211_mesh_power_mode {
......@@ -4937,6 +5091,36 @@ enum nl80211_bss_scan_width {
49375091 NL80211_BSS_CHAN_WIDTH_2,
49385092};
49395093
5094/**
5095 * enum nl80211_bss_use_for - bitmap indicating possible BSS use
5096 * @NL80211_BSS_USE_FOR_NORMAL: Use this BSS for normal "connection",
5097 * including IBSS/MBSS depending on the type.
5098 * @NL80211_BSS_USE_FOR_MLD_LINK: This BSS can be used as a link in an
5099 * MLO connection. Note that for an MLO connection, all links including
5100 * the assoc link must have this flag set, and the assoc link must
5101 * additionally have %NL80211_BSS_USE_FOR_NORMAL set.
5102 */
5103enum nl80211_bss_use_for {
5104 NL80211_BSS_USE_FOR_NORMAL = 1 << 0,
5105 NL80211_BSS_USE_FOR_MLD_LINK = 1 << 1,
5106};
5107
5108/**
5109 * enum nl80211_bss_cannot_use_reasons - reason(s) connection to a
5110 * BSS isn't possible
5111 * @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't
5112 * supported by the device, and this BSS entry represents one.
5113 * @NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH: STA is not supporting
5114 * the AP power type (SP, VLP, AP) that the AP uses.
5115 */
5116enum nl80211_bss_cannot_use_reasons {
5117 NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0,
5118 NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 1 << 1,
5119};
5120
5121#define NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH \
5122 NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH
5123
49405124/**
49415125 * enum nl80211_bss - netlink attributes for a BSS
49425126 *
......@@ -4968,7 +5152,7 @@ enum nl80211_bss_scan_width {
49685152 * elements from a Beacon frame (bin); not present if no Beacon frame has
49695153 * yet been received
49705154 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
4971 * (u32, enum nl80211_bss_scan_width)
5155 * (u32, enum nl80211_bss_scan_width) - No longer used!
49725156 * @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
49735157 * (not present if no beacon frame has been received yet)
49745158 * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
......@@ -4989,6 +5173,14 @@ enum nl80211_bss_scan_width {
49895173 * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
49905174 * @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
49915175 * @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
5176 * @NL80211_BSS_USE_FOR: u32 bitmap attribute indicating what the BSS can be
5177 * used for, see &enum nl80211_bss_use_for.
5178 * @NL80211_BSS_CANNOT_USE_REASONS: Indicates the reason that this BSS cannot
5179 * be used for all or some of the possible uses by the device reporting it,
5180 * even though its presence was detected.
5181 * This is a u64 attribute containing a bitmap of values from
5182 * &enum nl80211_cannot_use_reasons, note that the attribute may be missing
5183 * if no reasons are specified.
49925184 * @__NL80211_BSS_AFTER_LAST: internal
49935185 * @NL80211_BSS_MAX: highest BSS attribute
49945186 */
......@@ -5016,6 +5208,8 @@ enum nl80211_bss {
50165208 NL80211_BSS_FREQUENCY_OFFSET,
50175209 NL80211_BSS_MLO_LINK_ID,
50185210 NL80211_BSS_MLD_ADDR,
5211 NL80211_BSS_USE_FOR,
5212 NL80211_BSS_CANNOT_USE_REASONS,
50195213
50205214 /* keep last */
50215215 __NL80211_BSS_AFTER_LAST,
......@@ -5364,7 +5558,7 @@ enum nl80211_tx_rate_setting {
53645558 * (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
53655559 * @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
53665560 * per peer instead.
5367 * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribue, if set indicates
5561 * @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribute, if set indicates
53685562 * that the new configuration overrides all previous peer
53695563 * configurations, otherwise previous peer specific configurations
53705564 * should be left untouched.
......@@ -5536,7 +5730,7 @@ struct nl80211_pattern_support {
55365730 * "TCP connection wakeup" for more details. This is a nested attribute
55375731 * containing the exact information for establishing and keeping alive
55385732 * the TCP connection.
5539 * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
5733 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH: For wakeup reporting only, the
55405734 * wakeup packet was received on the TCP connection
55415735 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
55425736 * TCP connection was lost or failed to be established
......@@ -5565,6 +5759,8 @@ struct nl80211_pattern_support {
55655759 * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one
55665760 * frequency, it means that the match occurred in more than one
55675761 * channel.
5762 * @NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC: For wakeup reporting only.
5763 * Wake up happened due to unprotected deauth or disassoc frame in MFP.
55685764 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
55695765 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
55705766 *
......@@ -5592,6 +5788,7 @@ enum nl80211_wowlan_triggers {
55925788 NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
55935789 NL80211_WOWLAN_TRIG_NET_DETECT,
55945790 NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS,
5791 NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC,
55955792
55965793 /* keep last */
55975794 NUM_NL80211_WOWLAN_TRIG,
......@@ -5747,7 +5944,7 @@ enum nl80211_attr_coalesce_rule {
57475944
57485945/**
57495946 * enum nl80211_coalesce_condition - coalesce rule conditions
5750 * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
5947 * @NL80211_COALESCE_CONDITION_MATCH: coalesce Rx packets when patterns
57515948 * in a rule are matched.
57525949 * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
57535950 * in a rule are not matched.
......@@ -5846,7 +6043,7 @@ enum nl80211_if_combination_attrs {
58466043 * enum nl80211_plink_state - state of a mesh peer link finite state machine
58476044 *
58486045 * @NL80211_PLINK_LISTEN: initial state, considered the implicit
5849 * state of non existent mesh peer links
6046 * state of non-existent mesh peer links
58506047 * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
58516048 * this mesh peer
58526049 * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
......@@ -5882,7 +6079,7 @@ enum nl80211_plink_state {
58826079 * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
58836080 * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
58846081 */
5885enum plink_actions {
6082enum nl80211_plink_action {
58866083 NL80211_PLINK_ACTION_NO_ACTION,
58876084 NL80211_PLINK_ACTION_OPEN,
58886085 NL80211_PLINK_ACTION_BLOCK,
......@@ -6139,7 +6336,7 @@ enum nl80211_feature_flags {
61396336 * request to use RRM (see %NL80211_ATTR_USE_RRM) with
61406337 * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
61416338 * the ASSOC_REQ_USE_RRM flag in the association request even if
6142 * NL80211_FEATURE_QUIET is not advertized.
6339 * NL80211_FEATURE_QUIET is not advertised.
61436340 * @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air
61446341 * sniffer which means that it can be configured to hear packets from
61456342 * certain groups which can be configured by the
......@@ -6151,13 +6348,15 @@ enum nl80211_feature_flags {
61516348 * the BSS that the interface that requested the scan is connected to
61526349 * (if available).
61536350 * @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the
6154 * time the last beacon/probe was received. The time is the TSF of the
6155 * BSS that the interface that requested the scan is connected to
6156 * (if available).
6351 * time the last beacon/probe was received. For a non-MLO connection, the
6352 * time is the TSF of the BSS that the interface that requested the scan is
6353 * connected to (if available). For an MLO connection, the time is the TSF
6354 * of the BSS corresponding with link ID specified in the scan request (if
6355 * specified).
61576356 * @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of
61586357 * channel dwell time.
61596358 * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate
6160 * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate.
6359 * configuration (AP/mesh), supporting a legacy (non-HT/VHT) rate.
61616360 * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate
61626361 * configuration (AP/mesh) with HT rates.
61636362 * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate
......@@ -6207,6 +6406,7 @@ enum nl80211_feature_flags {
62076406 * receiving control port frames over nl80211 instead of the netdevice.
62086407 * @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
62096408 * (average) ACK signal strength reporting.
6409 * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: Backward-compatible ID
62106410 * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
62116411 * TXQs.
62126412 * @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
......@@ -6231,8 +6431,7 @@ enum nl80211_feature_flags {
62316431 * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
62326432 * (set/del PMKSA operations) in AP mode.
62336433 *
6234 * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
6235 * filtering of sched scan results using band specific RSSI thresholds.
6434 * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Obsolete
62366435 *
62376436 * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
62386437 * to a station.
......@@ -6326,6 +6525,26 @@ enum nl80211_feature_flags {
63266525 * @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
63276526 * authentication, data encryption and message integrity.
63286527 *
6528 * @NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA: Device supports randomized TA
6529 * in authentication and deauthentication frames sent to unassociated peer
6530 * using @NL80211_CMD_FRAME.
6531 *
6532 * @NL80211_EXT_FEATURE_OWE_OFFLOAD: Driver/Device wants to do OWE DH IE
6533 * handling in station mode.
6534 *
6535 * @NL80211_EXT_FEATURE_OWE_OFFLOAD_AP: Driver/Device wants to do OWE DH IE
6536 * handling in AP mode.
6537 *
6538 * @NL80211_EXT_FEATURE_DFS_CONCURRENT: The device supports peer-to-peer or
6539 * ad hoc operation on DFS channels under the control of a concurrent
6540 * DFS master on the same channel as described in FCC-594280 D01
6541 * (Section B.3). This, for example, allows P2P GO and P2P clients to
6542 * operate on DFS channels as long as there's a concurrent BSS connection.
6543 *
6544 * @NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT: The driver has support for SPP
6545 * (signaling and payload protected) A-MSDUs and this shall be advertised
6546 * in the RSNXE.
6547 *
63296548 * @NUM_NL80211_EXT_FEATURES: number of extended features.
63306549 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
63316550 */
......@@ -6367,7 +6586,7 @@ enum nl80211_ext_feature_index {
63676586 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
63686587 NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
63696588 NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
6370 NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
6589 NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, /* obsolete */
63716590 NL80211_EXT_FEATURE_EXT_KEY_ID,
63726591 NL80211_EXT_FEATURE_STA_TX_PWR,
63736592 NL80211_EXT_FEATURE_SAE_OFFLOAD,
......@@ -6396,6 +6615,11 @@ enum nl80211_ext_feature_index {
63966615 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
63976616 NL80211_EXT_FEATURE_PUNCT,
63986617 NL80211_EXT_FEATURE_SECURE_NAN,
6618 NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
6619 NL80211_EXT_FEATURE_OWE_OFFLOAD,
6620 NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
6621 NL80211_EXT_FEATURE_DFS_CONCURRENT,
6622 NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT,
63996623
64006624 /* add new features before the definition below */
64016625 NUM_NL80211_EXT_FEATURES,
......@@ -6480,7 +6704,7 @@ enum nl80211_timeout_reason {
64806704 * request parameters IE in the probe request
64816705 * @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
64826706 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
6483 * rate of at least 5.5M. In case non OCE AP is discovered in the channel,
6707 * rate of at least 5.5M. In case non-OCE AP is discovered in the channel,
64846708 * only the first probe req in the channel will be sent in high rate.
64856709 * @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
64866710 * tx deferral (dot11FILSProbeDelay shall be set to 15ms)
......@@ -6510,8 +6734,16 @@ enum nl80211_timeout_reason {
65106734 * @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with
65116735 * %NL80211_ATTR_SCAN_FREQ_KHZ. This also means
65126736 * %NL80211_ATTR_SCAN_FREQUENCIES will not be included.
6513 * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for colocated APs reported by
6514 * 2.4/5 GHz APs
6737 * @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for collocated APs reported by
6738 * 2.4/5 GHz APs. When the flag is set, the scan logic will use the
6739 * information from the RNR element found in beacons/probe responses
6740 * received on the 2.4/5 GHz channels to actively scan only the 6GHz
6741 * channels on which APs are expected to be found. Note that when not set,
6742 * the scan logic would scan all 6GHz channels, but since transmission of
6743 * probe requests on non-PSC channels is limited, it is highly likely that
6744 * these channels would passively be scanned. Also note that when the flag
6745 * is set, in addition to the colocated APs, PSC channels would also be
6746 * scanned if the user space has asked for it.
65156747 */
65166748enum nl80211_scan_flags {
65176749 NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
......@@ -6558,6 +6790,8 @@ enum nl80211_acl_policy {
65586790 * @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
65596791 * @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
65606792 * turn on other antennas after CTS/RTS).
6793 * @__NL80211_SMPS_AFTER_LAST: internal
6794 * @NL80211_SMPS_MAX: highest used enumeration
65616795 */
65626796enum nl80211_smps_mode {
65636797 NL80211_SMPS_OFF,
......@@ -6779,6 +7013,8 @@ enum nl80211_bss_select_attr {
67797013 * @NL80211_NAN_FUNC_PUBLISH: function is publish
67807014 * @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe
67817015 * @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up
7016 * @__NL80211_NAN_FUNC_TYPE_AFTER_LAST: internal use
7017 * @NL80211_NAN_FUNC_MAX_TYPE: internal use
67827018 */
67837019enum nl80211_nan_function_type {
67847020 NL80211_NAN_FUNC_PUBLISH,
......@@ -6840,7 +7076,7 @@ enum nl80211_nan_func_term_reason {
68407076 * The instance ID for the follow up Service Discovery Frame. This is u8.
68417077 * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type
68427078 * is follow up. This is a u8.
6843 * The requestor instance ID for the follow up Service Discovery Frame.
7079 * The requester instance ID for the follow up Service Discovery Frame.
68447080 * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the
68457081 * follow up Service Discovery Frame. This is a binary attribute.
68467082 * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a
......@@ -6939,7 +7175,7 @@ enum nl80211_nan_match_attributes {
69397175};
69407176
69417177/**
6942 * nl80211_external_auth_action - Action to perform with external
7178 * enum nl80211_external_auth_action - Action to perform with external
69437179 * authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION.
69447180 * @NL80211_EXTERNAL_AUTH_START: Start the authentication.
69457181 * @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication.
......@@ -6957,7 +7193,7 @@ enum nl80211_external_auth_action {
69577193 * @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element
69587194 * (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10),
69597195 * i.e. starting with the measurement token
6960 * @NL80211_FTM_RESP_ATTR_CIVIC: The content of Measurement Report Element
7196 * @NL80211_FTM_RESP_ATTR_CIVICLOC: The content of Measurement Report Element
69617197 * (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13),
69627198 * i.e. starting with the measurement token
69637199 * @__NL80211_FTM_RESP_ATTR_LAST: Internal
......@@ -7230,7 +7466,7 @@ enum nl80211_peer_measurement_attrs {
72307466 * @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
72317467 * trigger based ranging measurement is supported
72327468 * @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
7233 * if non trigger based ranging measurement is supported
7469 * if non-trigger-based ranging measurement is supported
72347470 *
72357471 * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
72367472 * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
......@@ -7284,7 +7520,7 @@ enum nl80211_peer_measurement_ftm_capa {
72847520 * if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
72857521 * %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
72867522 * ranging will be used.
7287 * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non trigger based
7523 * @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non-trigger-based
72887524 * ranging measurement (flag)
72897525 * This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
72907526 * mutually exclusive.
......@@ -7362,7 +7598,7 @@ enum nl80211_peer_measurement_ftm_failure_reasons {
73627598 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
73637599 * transmitted (u32, optional)
73647600 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
7365 * that were acknowleged (u32, optional)
7601 * that were acknowledged (u32, optional)
73667602 * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
73677603 * busy peer (u32, seconds)
73687604 * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
......@@ -7523,7 +7759,7 @@ enum nl80211_iftype_akm_attributes {
75237759 * @NL80211_FILS_DISCOVERY_ATTR_INT_MIN: Minimum packet interval (u32, TU).
75247760 * Allowed range: 0..10000 (TU = Time Unit)
75257761 * @NL80211_FILS_DISCOVERY_ATTR_INT_MAX: Maximum packet interval (u32, TU).
7526 * Allowed range: 0..10000 (TU = Time Unit)
7762 * Allowed range: 0..10000 (TU = Time Unit). If set to 0, the feature is disabled.
75277763 * @NL80211_FILS_DISCOVERY_ATTR_TMPL: Template data for FILS discovery action
75287764 * frame including the headers.
75297765 *
......@@ -7556,7 +7792,8 @@ enum nl80211_fils_discovery_attributes {
75567792 *
75577793 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU).
75587794 * Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0
7559 * 26.17.2.3.2 (AP behavior for fast passive scanning).
7795 * 26.17.2.3.2 (AP behavior for fast passive scanning). If set to 0, the feature is
7796 * disabled.
75607797 * @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response
75617798 * frame template (binary).
75627799 *
......@@ -7599,6 +7836,7 @@ enum nl80211_sae_pwe_mechanism {
75997836 *
76007837 * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
76017838 *
7839 * @NUM_NL80211_SAR_TYPE: internal
76027840 */
76037841enum nl80211_sar_type {
76047842 NL80211_SAR_TYPE_POWER,
......@@ -7612,6 +7850,8 @@ enum nl80211_sar_type {
76127850/**
76137851 * enum nl80211_sar_attrs - Attributes for SAR spec
76147852 *
7853 * @__NL80211_SAR_ATTR_INVALID: Invalid
7854 *
76157855 * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
76167856 *
76177857 * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
......@@ -7643,6 +7883,8 @@ enum nl80211_sar_attrs {
76437883/**
76447884 * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
76457885 *
7886 * @__NL80211_SAR_ATTR_SPECS_INVALID: Invalid
7887 *
76467888 * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual
76477889 * power limit value in units of 0.25 dBm if type is
76487890 * NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm).
lib/libc/include/any-linux-any/linux/npcm-video.h created+41
......@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Controls header for NPCM video driver
4 *
5 * Copyright (C) 2022 Nuvoton Technologies
6 */
7
8#ifndef _LINUX_NPCM_VIDEO_H
9#define _LINUX_NPCM_VIDEO_H
10
11#include <linux/v4l2-controls.h>
12
13/*
14 * Check Documentation/userspace-api/media/drivers/npcm-video.rst for control
15 * details.
16 */
17
18/*
19 * This control is meant to set the mode of NPCM Video Capture/Differentiation
20 * (VCD) engine.
21 *
22 * The VCD engine supports two modes:
23 * COMPLETE - Capture the next complete frame into memory.
24 * DIFF - Compare the incoming frame with the frame stored in memory, and
25 * updates the differentiated frame in memory.
26 */
27#define V4L2_CID_NPCM_CAPTURE_MODE (V4L2_CID_USER_NPCM_BASE + 0)
28
29enum v4l2_npcm_capture_mode {
30 V4L2_NPCM_CAPTURE_MODE_COMPLETE = 0, /* COMPLETE mode */
31 V4L2_NPCM_CAPTURE_MODE_DIFF = 1, /* DIFF mode */
32};
33
34/*
35 * This control is meant to get the count of compressed HEXTILE rectangles which
36 * is relevant to the number of differentiated frames if VCD is in DIFF mode.
37 * And the count will always be 1 if VCD is in COMPLETE mode.
38 */
39#define V4L2_CID_NPCM_RECT_COUNT (V4L2_CID_USER_NPCM_BASE + 1)
40
41#endif /* _LINUX_NPCM_VIDEO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nsm.h created+31
......@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 */
5
6#ifndef __UAPI_LINUX_NSM_H
7#define __UAPI_LINUX_NSM_H
8
9#include <linux/ioctl.h>
10#include <linux/types.h>
11
12#define NSM_MAGIC 0x0A
13
14#define NSM_REQUEST_MAX_SIZE 0x1000
15#define NSM_RESPONSE_MAX_SIZE 0x3000
16
17struct nsm_iovec {
18 __u64 addr; /* Virtual address of target buffer */
19 __u64 len; /* Length of target buffer */
20};
21
22/* Raw NSM message. Only available with CAP_SYS_ADMIN. */
23struct nsm_raw {
24 /* Request from user */
25 struct nsm_iovec request;
26 /* Response to user */
27 struct nsm_iovec response;
28};
29#define NSM_IOCTL_RAW _IOWR(NSM_MAGIC, 0x0, struct nsm_raw)
30
31#endif /* __UAPI_LINUX_NSM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ntsync.h created+23
......@@ -0,0 +1,23 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Kernel support for NT synchronization primitive emulation
4 *
5 * Copyright (C) 2021-2022 Elizabeth Figura <zfigura@codeweavers.com>
6 */
7
8#ifndef __LINUX_NTSYNC_H
9#define __LINUX_NTSYNC_H
10
11#include <linux/types.h>
12
13struct ntsync_sem_args {
14 __u32 sem;
15 __u32 count;
16 __u32 max;
17};
18
19#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
20
21#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
22
23#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/openvswitch.h+3
......@@ -752,6 +752,7 @@ struct ovs_action_push_vlan {
752752 */
753753enum ovs_hash_alg {
754754 OVS_HASH_ALG_L4,
755 OVS_HASH_ALG_SYM_L4,
755756};
756757
757758/*
......@@ -936,6 +937,7 @@ enum ovs_check_pkt_len_attr {
936937 * start of the packet or at the start of the l3 header depending on the value
937938 * of l3 tunnel flag in the tun_flags field of OVS_ACTION_ATTR_ADD_MPLS
938939 * argument.
940 * @OVS_ACTION_ATTR_DROP: Explicit drop action.
939941 *
940942 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
941943 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
......@@ -973,6 +975,7 @@ enum ovs_action_attr {
973975 OVS_ACTION_ATTR_CHECK_PKT_LEN, /* Nested OVS_CHECK_PKT_LEN_ATTR_*. */
974976 OVS_ACTION_ATTR_ADD_MPLS, /* struct ovs_action_add_mpls. */
975977 OVS_ACTION_ATTR_DEC_TTL, /* Nested OVS_DEC_TTL_ATTR_*. */
978 OVS_ACTION_ATTR_DROP, /* u32 error code. */
976979
977980 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
978981 * from userspace. */
lib/libc/include/any-linux-any/linux/papr_pdsm.h created+165
......@@ -0,0 +1,165 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
4 *
5 * (C) Copyright IBM 2020
6 *
7 * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
8 */
9
10#ifndef _ASM_POWERPC_PAPR_PDSM_H_
11#define _ASM_POWERPC_PAPR_PDSM_H_
12
13#include <linux/types.h>
14#include <linux/ndctl.h>
15
16/*
17 * PDSM Envelope:
18 *
19 * The ioctl ND_CMD_CALL exchange data between user-space and kernel via
20 * envelope which consists of 2 headers sections and payload sections as
21 * illustrated below:
22 * +-----------------+---------------+---------------------------+
23 * | 64-Bytes | 8-Bytes | Max 184-Bytes |
24 * +-----------------+---------------+---------------------------+
25 * | ND-HEADER | PDSM-HEADER | PDSM-PAYLOAD |
26 * +-----------------+---------------+---------------------------+
27 * | nd_family | | |
28 * | nd_size_out | cmd_status | |
29 * | nd_size_in | reserved | nd_pdsm_payload |
30 * | nd_command | payload --> | |
31 * | nd_fw_size | | |
32 * | nd_payload ---> | | |
33 * +---------------+-----------------+---------------------------+
34 *
35 * ND Header:
36 * This is the generic libnvdimm header described as 'struct nd_cmd_pkg'
37 * which is interpreted by libnvdimm before passed on to papr_scm. Important
38 * member fields used are:
39 * 'nd_family' : (In) NVDIMM_FAMILY_PAPR_SCM
40 * 'nd_size_in' : (In) PDSM-HEADER + PDSM-IN-PAYLOAD (usually 0)
41 * 'nd_size_out' : (In) PDSM-HEADER + PDSM-RETURN-PAYLOAD
42 * 'nd_command' : (In) One of PAPR_PDSM_XXX
43 * 'nd_fw_size' : (Out) PDSM-HEADER + size of actual payload returned
44 *
45 * PDSM Header:
46 * This is papr-scm specific header that precedes the payload. This is defined
47 * as nd_cmd_pdsm_pkg. Following fields aare available in this header:
48 *
49 * 'cmd_status' : (Out) Errors if any encountered while servicing PDSM.
50 * 'reserved' : Not used, reserved for future and should be set to 0.
51 * 'payload' : A union of all the possible payload structs
52 *
53 * PDSM Payload:
54 *
55 * The layout of the PDSM Payload is defined by various structs shared between
56 * papr_scm and libndctl so that contents of payload can be interpreted. As such
57 * its defined as a union of all possible payload structs as
58 * 'union nd_pdsm_payload'. Based on the value of 'nd_cmd_pkg.nd_command'
59 * appropriate member of the union is accessed.
60 */
61
62/* Max payload size that we can handle */
63#define ND_PDSM_PAYLOAD_MAX_SIZE 184
64
65/* Max payload size that we can handle */
66#define ND_PDSM_HDR_SIZE \
67 (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
68
69/* Various nvdimm health indicators */
70#define PAPR_PDSM_DIMM_HEALTHY 0
71#define PAPR_PDSM_DIMM_UNHEALTHY 1
72#define PAPR_PDSM_DIMM_CRITICAL 2
73#define PAPR_PDSM_DIMM_FATAL 3
74
75/* struct nd_papr_pdsm_health.extension_flags field flags */
76
77/* Indicate that the 'dimm_fuel_gauge' field is valid */
78#define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
79
80/* Indicate that the 'dimm_dsc' field is valid */
81#define PDSM_DIMM_DSC_VALID 2
82
83/*
84 * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
85 * Various flags indicate the health status of the dimm.
86 *
87 * extension_flags : Any extension fields present in the struct.
88 * dimm_unarmed : Dimm not armed. So contents wont persist.
89 * dimm_bad_shutdown : Previous shutdown did not persist contents.
90 * dimm_bad_restore : Contents from previous shutdown werent restored.
91 * dimm_scrubbed : Contents of the dimm have been scrubbed.
92 * dimm_locked : Contents of the dimm cant be modified until CEC reboot
93 * dimm_encrypted : Contents of dimm are encrypted.
94 * dimm_health : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
95 * dimm_fuel_gauge : Life remaining of DIMM as a percentage from 0-100
96 */
97struct nd_papr_pdsm_health {
98 union {
99 struct {
100 __u32 extension_flags;
101 __u8 dimm_unarmed;
102 __u8 dimm_bad_shutdown;
103 __u8 dimm_bad_restore;
104 __u8 dimm_scrubbed;
105 __u8 dimm_locked;
106 __u8 dimm_encrypted;
107 __u16 dimm_health;
108
109 /* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
110 __u16 dimm_fuel_gauge;
111
112 /* Extension flag PDSM_DIMM_DSC_VALID */
113 __u64 dimm_dsc;
114 };
115 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
116 };
117};
118
119/* Flags for injecting specific smart errors */
120#define PDSM_SMART_INJECT_HEALTH_FATAL (1 << 0)
121#define PDSM_SMART_INJECT_BAD_SHUTDOWN (1 << 1)
122
123struct nd_papr_pdsm_smart_inject {
124 union {
125 struct {
126 /* One or more of PDSM_SMART_INJECT_ */
127 __u32 flags;
128 __u8 fatal_enable;
129 __u8 unsafe_shutdown_enable;
130 };
131 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
132 };
133};
134
135/*
136 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
137 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
138 */
139enum papr_pdsm {
140 PAPR_PDSM_MIN = 0x0,
141 PAPR_PDSM_HEALTH,
142 PAPR_PDSM_SMART_INJECT,
143 PAPR_PDSM_MAX,
144};
145
146/* Maximal union that can hold all possible payload types */
147union nd_pdsm_payload {
148 struct nd_papr_pdsm_health health;
149 struct nd_papr_pdsm_smart_inject smart_inject;
150 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
151} __attribute__((packed));
152
153/*
154 * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
155 * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
156 * that should always precede this struct when sent to papr_scm via CMD_CALL
157 * interface.
158 */
159struct nd_pkg_pdsm {
160 __s32 cmd_status; /* Out: Sub-cmd status returned back */
161 __u16 reserved[2]; /* Ignored and to be set as '0' */
162 union nd_pdsm_payload payload;
163} __attribute__((packed));
164
165#endif /* _ASM_POWERPC_PAPR_PDSM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/parport.h+3
......@@ -90,6 +90,9 @@ typedef enum {
9090/* Flags for block transfer operations. */
9191#define PARPORT_EPP_FAST (1<<0) /* Unreliable counts. */
9292#define PARPORT_W91284PIC (1<<1) /* have a Warp9 w91284pic in the device */
93#define PARPORT_EPP_FAST_32 PARPORT_EPP_FAST /* 32-bit EPP transfers */
94#define PARPORT_EPP_FAST_16 (1<<2) /* 16-bit EPP transfers */
95#define PARPORT_EPP_FAST_8 (1<<3) /* 8-bit EPP transfers */
9396
9497/* The rest is for the kernel only */
9598#endif /* _PARPORT_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pci_regs.h+26-5
......@@ -80,6 +80,7 @@
8080#define PCI_HEADER_TYPE_NORMAL 0
8181#define PCI_HEADER_TYPE_BRIDGE 1
8282#define PCI_HEADER_TYPE_CARDBUS 2
83#define PCI_HEADER_TYPE_MFD 0x80 /* Multi-Function Device (possible) */
8384
8485#define PCI_BIST 0x0f /* 8 bits */
8586#define PCI_BIST_CODE_MASK 0x0f /* Return result */
......@@ -637,6 +638,7 @@
637638#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
638639#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
639640#define PCI_EXP_RTSTA 0x20 /* Root Status */
641#define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */
640642#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
641643#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
642644/*
......@@ -738,6 +740,7 @@
738740#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
739741#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
740742#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
743#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
741744#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
742745#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
743746
......@@ -929,12 +932,13 @@
929932
930933/* Process Address Space ID */
931934#define PCI_PASID_CAP 0x04 /* PASID feature register */
932#define PCI_PASID_CAP_EXEC 0x02 /* Exec permissions Supported */
933#define PCI_PASID_CAP_PRIV 0x04 /* Privilege Mode Supported */
935#define PCI_PASID_CAP_EXEC 0x0002 /* Exec permissions Supported */
936#define PCI_PASID_CAP_PRIV 0x0004 /* Privilege Mode Supported */
937#define PCI_PASID_CAP_WIDTH 0x1f00
934938#define PCI_PASID_CTRL 0x06 /* PASID control register */
935#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
936#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
937#define PCI_PASID_CTRL_PRIV 0x04 /* Privilege Mode Enable */
939#define PCI_PASID_CTRL_ENABLE 0x0001 /* Enable bit */
940#define PCI_PASID_CTRL_EXEC 0x0002 /* Exec permissions Enable */
941#define PCI_PASID_CTRL_PRIV 0x0004 /* Privilege Mode Enable */
938942#define PCI_EXT_CAP_PASID_SIZEOF 8
939943
940944/* Single Root I/O Virtualization */
......@@ -974,6 +978,8 @@
974978#define PCI_LTR_VALUE_MASK 0x000003ff
975979#define PCI_LTR_SCALE_MASK 0x00001c00
976980#define PCI_LTR_SCALE_SHIFT 10
981#define PCI_LTR_NOSNOOP_VALUE 0x03ff0000 /* Max No-Snoop Latency Value */
982#define PCI_LTR_NOSNOOP_SCALE 0x1c000000 /* Scale for Max Value */
977983#define PCI_EXT_CAP_LTR_SIZEOF 8
978984
979985/* Access Control Service */
......@@ -1041,9 +1047,16 @@
10411047#define PCI_EXP_DPC_STATUS 0x08 /* DPC Status */
10421048#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */
10431049#define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */
1050#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_UNCOR 0x0000 /* Uncorrectable error */
1051#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_NFE 0x0002 /* Rcvd ERR_NONFATAL */
1052#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_FE 0x0004 /* Rcvd ERR_FATAL */
1053#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_IN_EXT 0x0006 /* Reason in Trig Reason Extension field */
10441054#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */
10451055#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */
10461056#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */
1057#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_RP_PIO 0x0000 /* RP PIO error */
1058#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_SW_TRIGGER 0x0020 /* DPC SW Trigger bit */
1059#define PCI_EXP_DPC_RP_PIO_FEP 0x1f00 /* RP PIO First Err Ptr */
10471060
10481061#define PCI_EXP_DPC_SOURCE_ID 0x0A /* DPC Source Identifier */
10491062
......@@ -1087,6 +1100,8 @@
10871100#define PCI_L1SS_CTL1_LTR_L12_TH_VALUE 0x03ff0000 /* LTR_L1.2_THRESHOLD_Value */
10881101#define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */
10891102#define PCI_L1SS_CTL2 0x0c /* Control 2 Register */
1103#define PCI_L1SS_CTL2_T_PWR_ON_SCALE 0x00000003 /* T_POWER_ON Scale */
1104#define PCI_L1SS_CTL2_T_PWR_ON_VALUE 0x000000f8 /* T_POWER_ON Value */
10901105
10911106/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */
10921107#define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */
......@@ -1129,8 +1144,14 @@
11291144#define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff
11301145
11311146#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff
1147#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER 0x0000ff00
11321148#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff
11331149#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000
11341150#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000
11351151
1152/* Compute Express Link (CXL r3.1, sec 8.1.5) */
1153#define PCI_DVSEC_CXL_PORT 3
1154#define PCI_DVSEC_CXL_PORT_CTL 0x0c
1155#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001
1156
11361157#endif /* LINUX_PCI_REGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pcitest.h+2-1
......@@ -11,7 +11,8 @@
1111#define __UAPI_LINUX_PCITEST_H
1212
1313#define PCITEST_BAR _IO('P', 0x1)
14#define PCITEST_LEGACY_IRQ _IO('P', 0x2)
14#define PCITEST_INTX_IRQ _IO('P', 0x2)
15#define PCITEST_LEGACY_IRQ PCITEST_INTX_IRQ
1516#define PCITEST_MSI _IOW('P', 0x3, int)
1617#define PCITEST_WRITE _IOW('P', 0x4, unsigned long)
1718#define PCITEST_READ _IOW('P', 0x5, unsigned long)
lib/libc/include/any-linux-any/linux/perf_event.h+15-1
......@@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift {
204204
205205 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */
206206
207 PERF_SAMPLE_BRANCH_COUNTERS_SHIFT = 19, /* save occurrences of events on a branch */
208
207209 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208210};
209211
......@@ -235,6 +237,8 @@ enum perf_branch_sample_type {
235237
236238 PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
237239
240 PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT,
241
238242 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
239243};
240244
......@@ -982,6 +986,12 @@ enum perf_event_type {
982986 * { u64 nr;
983987 * { u64 hw_idx; } && PERF_SAMPLE_BRANCH_HW_INDEX
984988 * { u64 from, to, flags } lbr[nr];
989 * #
990 * # The format of the counters is decided by the
991 * # "branch_counter_nr" and "branch_counter_width",
992 * # which are defined in the ABI.
993 * #
994 * { u64 counters; } cntr[nr] && PERF_SAMPLE_BRANCH_COUNTERS
985995 * } && PERF_SAMPLE_BRANCH_STACK
986996 *
987997 * { u64 abi; # enum perf_sample_regs_abi
......@@ -1339,7 +1349,8 @@ union perf_mem_data_src {
13391349#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
13401350#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
13411351#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
1342/* 5-0x8 available */
1352/* 5-0x7 available */
1353#define PERF_MEM_LVLNUM_UNC 0x08 /* Uncached */
13431354#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */
13441355#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */
13451356#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
......@@ -1426,6 +1437,9 @@ struct perf_branch_entry {
14261437 reserved:31;
14271438};
14281439
1440/* Size of used info bits in struct perf_branch_entry */
1441#define PERF_BRANCH_ENTRY_INFO_BITS_MAX 33
1442
14291443union perf_sample_weight {
14301444 __u64 full;
14311445#if defined(__LITTLE_ENDIAN_BITFIELD)
lib/libc/include/any-linux-any/linux/pidfd.h+7-1
......@@ -7,6 +7,12 @@
77#include <linux/fcntl.h>
88
99/* Flags for pidfd_open(). */
10#define PIDFD_NONBLOCK O_NONBLOCK
10#define PIDFD_NONBLOCK O_NONBLOCK
11#define PIDFD_THREAD O_EXCL
12
13/* Flags for pidfd_send_signal(). */
14#define PIDFD_SIGNAL_THREAD (1UL << 0)
15#define PIDFD_SIGNAL_THREAD_GROUP (1UL << 1)
16#define PIDFD_SIGNAL_PROCESS_GROUP (1UL << 2)
1117
1218#endif /* _LINUX_PIDFD_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pkt_cls.h+32-49
......@@ -99,7 +99,7 @@ enum {
9999 * versions.
100100 */
101101#define TCA_ACT_GACT 5
102#define TCA_ACT_IPT 6
102#define TCA_ACT_IPT 6 /* obsoleted, can be reused */
103103#define TCA_ACT_PEDIT 7
104104#define TCA_ACT_MIRRED 8
105105#define TCA_ACT_NAT 9
......@@ -120,7 +120,7 @@ enum tca_id {
120120 TCA_ID_UNSPEC = 0,
121121 TCA_ID_POLICE = 1,
122122 TCA_ID_GACT = TCA_ACT_GACT,
123 TCA_ID_IPT = TCA_ACT_IPT,
123 TCA_ID_IPT = TCA_ACT_IPT, /* Obsoleted, can be reused */
124124 TCA_ID_PEDIT = TCA_ACT_PEDIT,
125125 TCA_ID_MIRRED = TCA_ACT_MIRRED,
126126 TCA_ID_NAT = TCA_ACT_NAT,
......@@ -280,37 +280,6 @@ struct tc_u32_pcnt {
280280
281281#define TC_U32_MAXDEPTH 8
282282
283
284/* RSVP filter */
285
286enum {
287 TCA_RSVP_UNSPEC,
288 TCA_RSVP_CLASSID,
289 TCA_RSVP_DST,
290 TCA_RSVP_SRC,
291 TCA_RSVP_PINFO,
292 TCA_RSVP_POLICE,
293 TCA_RSVP_ACT,
294 __TCA_RSVP_MAX
295};
296
297#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
298
299struct tc_rsvp_gpi {
300 __u32 key;
301 __u32 mask;
302 int offset;
303};
304
305struct tc_rsvp_pinfo {
306 struct tc_rsvp_gpi dpi;
307 struct tc_rsvp_gpi spi;
308 __u8 protocol;
309 __u8 tunnelid;
310 __u8 tunnelhdr;
311 __u8 pad;
312};
313
314283/* ROUTE filter */
315284
316285enum {
......@@ -341,22 +310,6 @@ enum {
341310
342311#define TCA_FW_MAX (__TCA_FW_MAX - 1)
343312
344/* TC index filter */
345
346enum {
347 TCA_TCINDEX_UNSPEC,
348 TCA_TCINDEX_HASH,
349 TCA_TCINDEX_MASK,
350 TCA_TCINDEX_SHIFT,
351 TCA_TCINDEX_FALL_THROUGH,
352 TCA_TCINDEX_CLASSID,
353 TCA_TCINDEX_POLICE,
354 TCA_TCINDEX_ACT,
355 __TCA_TCINDEX_MAX
356};
357
358#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
359
360313/* Flow filter */
361314
362315enum {
......@@ -594,6 +547,13 @@ enum {
594547
595548 TCA_FLOWER_KEY_L2TPV3_SID, /* be32 */
596549
550 TCA_FLOWER_L2_MISS, /* u8 */
551
552 TCA_FLOWER_KEY_CFM, /* nested */
553
554 TCA_FLOWER_KEY_SPI, /* be32 */
555 TCA_FLOWER_KEY_SPI_MASK, /* be32 */
556
597557 __TCA_FLOWER_MAX,
598558};
599559
......@@ -627,6 +587,10 @@ enum {
627587 * TCA_FLOWER_KEY_ENC_OPT_GTP_
628588 * attributes
629589 */
590 TCA_FLOWER_KEY_ENC_OPTS_PFCP, /* Nested
591 * TCA_FLOWER_KEY_ENC_IPT_PFCP
592 * attributes
593 */
630594 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
631595};
632596
......@@ -676,6 +640,16 @@ enum {
676640#define TCA_FLOWER_KEY_ENC_OPT_GTP_MAX \
677641 (__TCA_FLOWER_KEY_ENC_OPT_GTP_MAX - 1)
678642
643enum {
644 TCA_FLOWER_KEY_ENC_OPT_PFCP_UNSPEC,
645 TCA_FLOWER_KEY_ENC_OPT_PFCP_TYPE, /* u8 */
646 TCA_FLOWER_KEY_ENC_OPT_PFCP_SEID, /* be64 */
647 __TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX,
648};
649
650#define TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX \
651 (__TCA_FLOWER_KEY_ENC_OPT_PFCP_MAX - 1)
652
679653enum {
680654 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
681655 TCA_FLOWER_KEY_MPLS_OPTS_LSE,
......@@ -702,6 +676,15 @@ enum {
702676 TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST = (1 << 1),
703677};
704678
679enum {
680 TCA_FLOWER_KEY_CFM_OPT_UNSPEC,
681 TCA_FLOWER_KEY_CFM_MD_LEVEL,
682 TCA_FLOWER_KEY_CFM_OPCODE,
683 __TCA_FLOWER_KEY_CFM_OPT_MAX,
684};
685
686#define TCA_FLOWER_KEY_CFM_OPT_MAX (__TCA_FLOWER_KEY_CFM_OPT_MAX - 1)
687
705688#define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0) /* Range-based match */
706689
707690/* Match-all classifier */
lib/libc/include/any-linux-any/linux/pkt_sched.h+41-111
......@@ -477,115 +477,6 @@ enum {
477477
478478#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
479479
480
481/* CBQ section */
482
483#define TC_CBQ_MAXPRIO 8
484#define TC_CBQ_MAXLEVEL 8
485#define TC_CBQ_DEF_EWMA 5
486
487struct tc_cbq_lssopt {
488 unsigned char change;
489 unsigned char flags;
490#define TCF_CBQ_LSS_BOUNDED 1
491#define TCF_CBQ_LSS_ISOLATED 2
492 unsigned char ewma_log;
493 unsigned char level;
494#define TCF_CBQ_LSS_FLAGS 1
495#define TCF_CBQ_LSS_EWMA 2
496#define TCF_CBQ_LSS_MAXIDLE 4
497#define TCF_CBQ_LSS_MINIDLE 8
498#define TCF_CBQ_LSS_OFFTIME 0x10
499#define TCF_CBQ_LSS_AVPKT 0x20
500 __u32 maxidle;
501 __u32 minidle;
502 __u32 offtime;
503 __u32 avpkt;
504};
505
506struct tc_cbq_wrropt {
507 unsigned char flags;
508 unsigned char priority;
509 unsigned char cpriority;
510 unsigned char __reserved;
511 __u32 allot;
512 __u32 weight;
513};
514
515struct tc_cbq_ovl {
516 unsigned char strategy;
517#define TC_CBQ_OVL_CLASSIC 0
518#define TC_CBQ_OVL_DELAY 1
519#define TC_CBQ_OVL_LOWPRIO 2
520#define TC_CBQ_OVL_DROP 3
521#define TC_CBQ_OVL_RCLASSIC 4
522 unsigned char priority2;
523 __u16 pad;
524 __u32 penalty;
525};
526
527struct tc_cbq_police {
528 unsigned char police;
529 unsigned char __res1;
530 unsigned short __res2;
531};
532
533struct tc_cbq_fopt {
534 __u32 split;
535 __u32 defmap;
536 __u32 defchange;
537};
538
539struct tc_cbq_xstats {
540 __u32 borrows;
541 __u32 overactions;
542 __s32 avgidle;
543 __s32 undertime;
544};
545
546enum {
547 TCA_CBQ_UNSPEC,
548 TCA_CBQ_LSSOPT,
549 TCA_CBQ_WRROPT,
550 TCA_CBQ_FOPT,
551 TCA_CBQ_OVL_STRATEGY,
552 TCA_CBQ_RATE,
553 TCA_CBQ_RTAB,
554 TCA_CBQ_POLICE,
555 __TCA_CBQ_MAX,
556};
557
558#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
559
560/* dsmark section */
561
562enum {
563 TCA_DSMARK_UNSPEC,
564 TCA_DSMARK_INDICES,
565 TCA_DSMARK_DEFAULT_INDEX,
566 TCA_DSMARK_SET_TC_INDEX,
567 TCA_DSMARK_MASK,
568 TCA_DSMARK_VALUE,
569 __TCA_DSMARK_MAX,
570};
571
572#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
573
574/* ATM section */
575
576enum {
577 TCA_ATM_UNSPEC,
578 TCA_ATM_FD, /* file/socket descriptor */
579 TCA_ATM_PTR, /* pointer to descriptor - later */
580 TCA_ATM_HDR, /* LL header */
581 TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
582 TCA_ATM_ADDR, /* PVC address (for output only) */
583 TCA_ATM_STATE, /* VC state (ATM_VS_*; for output only) */
584 __TCA_ATM_MAX,
585};
586
587#define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
588
589480/* Network emulator */
590481
591482enum {
......@@ -603,6 +494,7 @@ enum {
603494 TCA_NETEM_JITTER64,
604495 TCA_NETEM_SLOT,
605496 TCA_NETEM_SLOT_DIST,
497 TCA_NETEM_PRNG_SEED,
606498 __TCA_NETEM_MAX,
607499};
608500
......@@ -719,6 +611,11 @@ enum {
719611
720612#define __TC_MQPRIO_SHAPER_MAX (__TC_MQPRIO_SHAPER_MAX - 1)
721613
614enum {
615 TC_FP_EXPRESS = 1,
616 TC_FP_PREEMPTIBLE = 2,
617};
618
722619struct tc_mqprio_qopt {
723620 __u8 num_tc;
724621 __u8 prio_tc_map[TC_QOPT_BITMASK + 1];
......@@ -732,12 +629,23 @@ struct tc_mqprio_qopt {
732629#define TC_MQPRIO_F_MIN_RATE 0x4
733630#define TC_MQPRIO_F_MAX_RATE 0x8
734631
632enum {
633 TCA_MQPRIO_TC_ENTRY_UNSPEC,
634 TCA_MQPRIO_TC_ENTRY_INDEX, /* u32 */
635 TCA_MQPRIO_TC_ENTRY_FP, /* u32 */
636
637 /* add new constants above here */
638 __TCA_MQPRIO_TC_ENTRY_CNT,
639 TCA_MQPRIO_TC_ENTRY_MAX = (__TCA_MQPRIO_TC_ENTRY_CNT - 1)
640};
641
735642enum {
736643 TCA_MQPRIO_UNSPEC,
737644 TCA_MQPRIO_MODE,
738645 TCA_MQPRIO_SHAPER,
739646 TCA_MQPRIO_MIN_RATE64,
740647 TCA_MQPRIO_MAX_RATE64,
648 TCA_MQPRIO_TC_ENTRY,
741649 __TCA_MQPRIO_MAX,
742650};
743651
......@@ -924,15 +832,22 @@ enum {
924832
925833 TCA_FQ_HORIZON_DROP, /* drop packets beyond horizon, or cap their EDT */
926834
835 TCA_FQ_PRIOMAP, /* prio2band */
836
837 TCA_FQ_WEIGHTS, /* Weights for each band */
838
927839 __TCA_FQ_MAX
928840};
929841
930842#define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
931843
844#define FQ_BANDS 3
845#define FQ_MIN_WEIGHT 16384
846
932847struct tc_fq_qd_stats {
933848 __u64 gc_flows;
934 __u64 highprio_packets;
935 __u64 tcp_retrans;
849 __u64 highprio_packets; /* obsolete */
850 __u64 tcp_retrans; /* obsolete */
936851 __u64 throttled;
937852 __u64 flows_plimit;
938853 __u64 pkts_too_long;
......@@ -945,6 +860,10 @@ struct tc_fq_qd_stats {
945860 __u64 ce_mark; /* packets above ce_threshold */
946861 __u64 horizon_drops;
947862 __u64 horizon_caps;
863 __u64 fastpath_packets;
864 __u64 band_drops[FQ_BANDS];
865 __u32 band_pkt_count[FQ_BANDS];
866 __u32 pad;
948867};
949868
950869/* Heavy-Hitter Filter */
......@@ -1236,12 +1155,23 @@ enum {
12361155 TCA_TAPRIO_TC_ENTRY_UNSPEC,
12371156 TCA_TAPRIO_TC_ENTRY_INDEX, /* u32 */
12381157 TCA_TAPRIO_TC_ENTRY_MAX_SDU, /* u32 */
1158 TCA_TAPRIO_TC_ENTRY_FP, /* u32 */
12391159
12401160 /* add new constants above here */
12411161 __TCA_TAPRIO_TC_ENTRY_CNT,
12421162 TCA_TAPRIO_TC_ENTRY_MAX = (__TCA_TAPRIO_TC_ENTRY_CNT - 1)
12431163};
12441164
1165enum {
1166 TCA_TAPRIO_OFFLOAD_STATS_PAD = 1, /* u64 */
1167 TCA_TAPRIO_OFFLOAD_STATS_WINDOW_DROPS, /* u64 */
1168 TCA_TAPRIO_OFFLOAD_STATS_TX_OVERRUNS, /* u64 */
1169
1170 /* add new constants above here */
1171 __TCA_TAPRIO_OFFLOAD_STATS_CNT,
1172 TCA_TAPRIO_OFFLOAD_STATS_MAX = (__TCA_TAPRIO_OFFLOAD_STATS_CNT - 1)
1173};
1174
12451175enum {
12461176 TCA_TAPRIO_ATTR_UNSPEC,
12471177 TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */
lib/libc/include/any-linux-any/linux/pktcdvd.h+1-11
......@@ -16,6 +16,7 @@
1616#include <linux/types.h>
1717
1818/*
19 * UNUSED:
1920 * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
2021 */
2122#define PACKET_DEBUG 1
......@@ -29,17 +30,6 @@
2930 */
3031#define PACKET_WAIT_TIME (HZ * 5 / 1000)
3132
32/*
33 * use drive write caching -- we need deferred error handling to be
34 * able to successfully recover with this option (drive will return good
35 * status as soon as the cdb is validated).
36 */
37#if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
38#define USE_WCACHING 1
39#else
40#define USE_WCACHING 0
41#endif
42
4333/*
4434 * No user-servicable parts beyond this point ->
4535 */
lib/libc/include/any-linux-any/linux/prctl.h+39-1
......@@ -283,11 +283,49 @@ struct prctl_mm_map {
283283
284284/* Memory deny write / execute */
285285#define PR_SET_MDWE 65
286# define PR_MDWE_REFUSE_EXEC_GAIN 1
286# define PR_MDWE_REFUSE_EXEC_GAIN (1UL << 0)
287# define PR_MDWE_NO_INHERIT (1UL << 1)
287288
288289#define PR_GET_MDWE 66
289290
290291#define PR_SET_VMA 0x53564d41
291292# define PR_SET_VMA_ANON_NAME 0
292293
294#define PR_GET_AUXV 0x41555856
295
296#define PR_SET_MEMORY_MERGE 67
297#define PR_GET_MEMORY_MERGE 68
298
299#define PR_RISCV_V_SET_CONTROL 69
300#define PR_RISCV_V_GET_CONTROL 70
301# define PR_RISCV_V_VSTATE_CTRL_DEFAULT 0
302# define PR_RISCV_V_VSTATE_CTRL_OFF 1
303# define PR_RISCV_V_VSTATE_CTRL_ON 2
304# define PR_RISCV_V_VSTATE_CTRL_INHERIT (1 << 4)
305# define PR_RISCV_V_VSTATE_CTRL_CUR_MASK 0x3
306# define PR_RISCV_V_VSTATE_CTRL_NEXT_MASK 0xc
307# define PR_RISCV_V_VSTATE_CTRL_MASK 0x1f
308
309#define PR_RISCV_SET_ICACHE_FLUSH_CTX 71
310# define PR_RISCV_CTX_SW_FENCEI_ON 0
311# define PR_RISCV_CTX_SW_FENCEI_OFF 1
312# define PR_RISCV_SCOPE_PER_PROCESS 0
313# define PR_RISCV_SCOPE_PER_THREAD 1
314
315/* PowerPC Dynamic Execution Control Register (DEXCR) controls */
316#define PR_PPC_GET_DEXCR 72
317#define PR_PPC_SET_DEXCR 73
318/* DEXCR aspect to act on */
319# define PR_PPC_DEXCR_SBHE 0 /* Speculative branch hint enable */
320# define PR_PPC_DEXCR_IBRTPD 1 /* Indirect branch recurrent target prediction disable */
321# define PR_PPC_DEXCR_SRAPD 2 /* Subroutine return address prediction disable */
322# define PR_PPC_DEXCR_NPHIE 3 /* Non-privileged hash instruction enable */
323/* Action to apply / return */
324# define PR_PPC_DEXCR_CTRL_EDITABLE 0x1 /* Aspect can be modified with PR_PPC_SET_DEXCR */
325# define PR_PPC_DEXCR_CTRL_SET 0x2 /* Set the aspect for this process */
326# define PR_PPC_DEXCR_CTRL_CLEAR 0x4 /* Clear the aspect for this process */
327# define PR_PPC_DEXCR_CTRL_SET_ONEXEC 0x8 /* Set the aspect on exec */
328# define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC 0x10 /* Clear the aspect on exec */
329# define PR_PPC_DEXCR_CTRL_MASK 0x1f
330
293331#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psp-dbc.h created+147
......@@ -0,0 +1,147 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Userspace interface for AMD Dynamic Boost Control (DBC)
4 *
5 * Copyright (C) 2023 Advanced Micro Devices, Inc.
6 *
7 * Author: Mario Limonciello <mario.limonciello@amd.com>
8 */
9
10#ifndef __PSP_DBC_USER_H__
11#define __PSP_DBC_USER_H__
12
13#include <linux/types.h>
14
15/**
16 * DOC: AMD Dynamic Boost Control (DBC) interface
17 */
18
19#define DBC_NONCE_SIZE 16
20#define DBC_SIG_SIZE 32
21#define DBC_UID_SIZE 16
22
23/**
24 * struct dbc_user_nonce - Nonce exchange structure (input/output).
25 * @auth_needed: Whether the PSP should authenticate this request (input).
26 * 0: no authentication, PSP will return single use nonce.
27 * 1: authentication: PSP will return multi-use nonce.
28 * @nonce: 8 byte value used for future authentication (output).
29 * @signature: Optional 32 byte signature created by software using a
30 * previous nonce (input).
31 */
32struct dbc_user_nonce {
33 __u32 auth_needed;
34 __u8 nonce[DBC_NONCE_SIZE];
35 __u8 signature[DBC_SIG_SIZE];
36} __attribute__((packed));
37
38/**
39 * struct dbc_user_setuid - UID exchange structure (input).
40 * @uid: 16 byte value representing software identity
41 * @signature: 32 byte signature created by software using a previous nonce
42 */
43struct dbc_user_setuid {
44 __u8 uid[DBC_UID_SIZE];
45 __u8 signature[DBC_SIG_SIZE];
46} __attribute__((packed));
47
48/**
49 * struct dbc_user_param - Parameter exchange structure (input/output).
50 * @msg_index: Message indicating what parameter to set or get (input)
51 * @param: 4 byte parameter, units are message specific. (input/output)
52 * @signature: 32 byte signature.
53 * - When sending a message this is to be created by software
54 * using a previous nonce (input)
55 * - For interpreting results, this signature is updated by the
56 * PSP to allow software to validate the authenticity of the
57 * results.
58 */
59struct dbc_user_param {
60 __u32 msg_index;
61 __u32 param;
62 __u8 signature[DBC_SIG_SIZE];
63} __attribute__((packed));
64
65/**
66 * Dynamic Boost Control (DBC) IOC
67 *
68 * possible return codes for all DBC IOCTLs:
69 * 0: success
70 * -EINVAL: invalid input
71 * -E2BIG: excess data passed
72 * -EFAULT: failed to copy to/from userspace
73 * -EBUSY: mailbox in recovery or in use
74 * -ENODEV: driver not bound with PSP device
75 * -EACCES: request isn't authorized
76 * -EINVAL: invalid parameter
77 * -ETIMEDOUT: request timed out
78 * -EAGAIN: invalid request for state machine
79 * -ENOENT: not implemented
80 * -ENFILE: overflow
81 * -EPERM: invalid signature
82 * -EIO: unknown error
83 */
84#define DBC_IOC_TYPE 'D'
85
86/**
87 * DBCIOCNONCE - Fetch a nonce from the PSP for authenticating commands.
88 * If a nonce is fetched without authentication it can only
89 * be utilized for one command.
90 * If a nonce is fetched with authentication it can be used
91 * for multiple requests.
92 */
93#define DBCIOCNONCE _IOWR(DBC_IOC_TYPE, 0x1, struct dbc_user_nonce)
94
95/**
96 * DBCIOCUID - Set the user ID (UID) of a calling process.
97 * The user ID is 8 bytes long. It must be programmed using a
98 * 32 byte signature built using the nonce fetched from
99 * DBCIOCNONCE.
100 * The UID can only be set once until the system is rebooted.
101 */
102#define DBCIOCUID _IOW(DBC_IOC_TYPE, 0x2, struct dbc_user_setuid)
103
104/**
105 * DBCIOCPARAM - Set or get a parameter from the PSP.
106 * This request will only work after DBCIOCUID has successfully
107 * set the UID of the calling process.
108 * Whether the parameter is set or get is controlled by the
109 * message ID in the request.
110 * This command must be sent using a 32 byte signature built
111 * using the nonce fetched from DBCIOCNONCE.
112 * When the command succeeds, the 32 byte signature will be
113 * updated by the PSP for software to authenticate the results.
114 */
115#define DBCIOCPARAM _IOWR(DBC_IOC_TYPE, 0x3, struct dbc_user_param)
116
117/**
118 * enum dbc_cmd_msg - Messages utilized by DBCIOCPARAM
119 * @PARAM_GET_FMAX_CAP: Get frequency cap (MHz)
120 * @PARAM_SET_FMAX_CAP: Set frequency cap (MHz)
121 * @PARAM_GET_PWR_CAP: Get socket power cap (mW)
122 * @PARAM_SET_PWR_CAP: Set socket power cap (mW)
123 * @PARAM_GET_GFX_MODE: Get graphics mode (0/1)
124 * @PARAM_SET_GFX_MODE: Set graphics mode (0/1)
125 * @PARAM_GET_CURR_TEMP: Get current temperature (degrees C)
126 * @PARAM_GET_FMAX_MAX: Get maximum allowed value for frequency (MHz)
127 * @PARAM_GET_FMAX_MIN: Get minimum allowed value for frequency (MHz)
128 * @PARAM_GET_SOC_PWR_MAX: Get maximum allowed value for SoC power (mw)
129 * @PARAM_GET_SOC_PWR_MIN: Get minimum allowed value for SoC power (mw)
130 * @PARAM_GET_SOC_PWR_CUR: Get current value for SoC Power (mW)
131 */
132enum dbc_cmd_msg {
133 PARAM_GET_FMAX_CAP = 0x3,
134 PARAM_SET_FMAX_CAP = 0x4,
135 PARAM_GET_PWR_CAP = 0x5,
136 PARAM_SET_PWR_CAP = 0x6,
137 PARAM_GET_GFX_MODE = 0x7,
138 PARAM_SET_GFX_MODE = 0x8,
139 PARAM_GET_CURR_TEMP = 0x9,
140 PARAM_GET_FMAX_MAX = 0xA,
141 PARAM_GET_FMAX_MIN = 0xB,
142 PARAM_GET_SOC_PWR_MAX = 0xC,
143 PARAM_GET_SOC_PWR_MIN = 0xD,
144 PARAM_GET_SOC_PWR_CUR = 0xE,
145};
146
147#endif /* __PSP_DBC_USER_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psp-sev.h+67
......@@ -28,6 +28,9 @@ enum {
2828 SEV_PEK_CERT_IMPORT,
2929 SEV_GET_ID, /* This command is deprecated, use SEV_GET_ID2 */
3030 SEV_GET_ID2,
31 SNP_PLATFORM_STATUS,
32 SNP_COMMIT,
33 SNP_SET_CONFIG,
3134
3235 SEV_MAX,
3336};
......@@ -36,6 +39,13 @@ enum {
3639 * SEV Firmware status code
3740 */
3841typedef enum {
42 /*
43 * This error code is not in the SEV spec. Its purpose is to convey that
44 * there was an error that prevented the SEV firmware from being called.
45 * The SEV API error codes are 16 bits, so the -1 value will not overlap
46 * with possible values from the specification.
47 */
48 SEV_RET_NO_FW_CALL = -1,
3949 SEV_RET_SUCCESS = 0,
4050 SEV_RET_INVALID_PLATFORM_STATE,
4151 SEV_RET_INVALID_GUEST_STATE,
......@@ -61,6 +71,13 @@ typedef enum {
6171 SEV_RET_INVALID_PARAM,
6272 SEV_RET_RESOURCE_LIMIT,
6373 SEV_RET_SECURE_DATA_INVALID,
74 SEV_RET_INVALID_KEY = 0x27,
75 SEV_RET_INVALID_PAGE_SIZE,
76 SEV_RET_INVALID_PAGE_STATE,
77 SEV_RET_INVALID_MDATA_ENTRY,
78 SEV_RET_INVALID_PAGE_OWNER,
79 SEV_RET_INVALID_PAGE_AEAD_OFLOW,
80 SEV_RET_RMP_INIT_REQUIRED,
6481 SEV_RET_MAX,
6582} sev_ret_code;
6683
......@@ -147,6 +164,56 @@ struct sev_user_data_get_id2 {
147164 __u32 length; /* In/Out */
148165} __attribute__((packed));
149166
167/**
168 * struct sev_user_data_snp_status - SNP status
169 *
170 * @api_major: API major version
171 * @api_minor: API minor version
172 * @state: current platform state
173 * @is_rmp_initialized: whether RMP is initialized or not
174 * @rsvd: reserved
175 * @build_id: firmware build id for the API version
176 * @mask_chip_id: whether chip id is present in attestation reports or not
177 * @mask_chip_key: whether attestation reports are signed or not
178 * @vlek_en: VLEK (Version Loaded Endorsement Key) hashstick is loaded
179 * @rsvd1: reserved
180 * @guest_count: the number of guest currently managed by the firmware
181 * @current_tcb_version: current TCB version
182 * @reported_tcb_version: reported TCB version
183 */
184struct sev_user_data_snp_status {
185 __u8 api_major; /* Out */
186 __u8 api_minor; /* Out */
187 __u8 state; /* Out */
188 __u8 is_rmp_initialized:1; /* Out */
189 __u8 rsvd:7;
190 __u32 build_id; /* Out */
191 __u32 mask_chip_id:1; /* Out */
192 __u32 mask_chip_key:1; /* Out */
193 __u32 vlek_en:1; /* Out */
194 __u32 rsvd1:29;
195 __u32 guest_count; /* Out */
196 __u64 current_tcb_version; /* Out */
197 __u64 reported_tcb_version; /* Out */
198} __attribute__((packed));
199
200/**
201 * struct sev_user_data_snp_config - system wide configuration value for SNP.
202 *
203 * @reported_tcb: the TCB version to report in the guest attestation report.
204 * @mask_chip_id: whether chip id is present in attestation reports or not
205 * @mask_chip_key: whether attestation reports are signed or not
206 * @rsvd: reserved
207 * @rsvd1: reserved
208 */
209struct sev_user_data_snp_config {
210 __u64 reported_tcb ; /* In */
211 __u32 mask_chip_id:1; /* In */
212 __u32 mask_chip_key:1; /* In */
213 __u32 rsvd:30; /* In */
214 __u8 rsvd1[52];
215} __attribute__((packed));
216
150217/**
151218 * struct sev_issue_cmd - SEV ioctl parameters
152219 *
lib/libc/include/any-linux-any/linux/ptp_clock.h+14-4
......@@ -32,6 +32,7 @@
3232#define PTP_RISING_EDGE (1<<1)
3333#define PTP_FALLING_EDGE (1<<2)
3434#define PTP_STRICT_FLAGS (1<<3)
35#define PTP_EXT_OFFSET (1<<4)
3536#define PTP_EXTTS_EDGES (PTP_RISING_EDGE | PTP_FALLING_EDGE)
3637
3738/*
......@@ -40,7 +41,8 @@
4041#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
4142 PTP_RISING_EDGE | \
4243 PTP_FALLING_EDGE | \
43 PTP_STRICT_FLAGS)
44 PTP_STRICT_FLAGS | \
45 PTP_EXT_OFFSET)
4446
4547/*
4648 * flag fields valid for the original PTP_EXTTS_REQUEST ioctl.
......@@ -50,6 +52,11 @@
5052 PTP_RISING_EDGE | \
5153 PTP_FALLING_EDGE)
5254
55/*
56 * flag fields valid for the ptp_extts_event report.
57 */
58#define PTP_EXTTS_EVENT_VALID (PTP_ENABLE_FEATURE)
59
5360/*
5461 * Bits of the ptp_perout_request.flags field:
5562 */
......@@ -95,7 +102,8 @@ struct ptp_clock_caps {
95102 int cross_timestamping;
96103 /* Whether the clock supports adjust phase */
97104 int adjust_phase;
98 int rsv[12]; /* Reserved for future use. */
105 int max_phase_adj; /* Maximum phase adjustment in nanoseconds. */
106 int rsv[11]; /* Reserved for future use. */
99107};
100108
101109struct ptp_extts_request {
......@@ -223,11 +231,13 @@ struct ptp_pin_desc {
223231 _IOWR(PTP_CLK_MAGIC, 17, struct ptp_sys_offset_precise)
224232#define PTP_SYS_OFFSET_EXTENDED2 \
225233 _IOWR(PTP_CLK_MAGIC, 18, struct ptp_sys_offset_extended)
234#define PTP_MASK_CLEAR_ALL _IO(PTP_CLK_MAGIC, 19)
235#define PTP_MASK_EN_SINGLE _IOW(PTP_CLK_MAGIC, 20, unsigned int)
226236
227237struct ptp_extts_event {
228 struct ptp_clock_time t; /* Time event occured. */
238 struct ptp_clock_time t; /* Time event occurred. */
229239 unsigned int index; /* Which channel produced the event. */
230 unsigned int flags; /* Reserved for future use. */
240 unsigned int flags; /* Event type. */
231241 unsigned int rsv[2]; /* Reserved for future use. */
232242};
233243
lib/libc/include/any-linux-any/linux/ptrace.h+30
......@@ -112,6 +112,36 @@ struct ptrace_rseq_configuration {
112112 __u32 pad;
113113};
114114
115#define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG 0x4210
116#define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG 0x4211
117
118/*
119 * struct ptrace_sud_config - Per-task configuration for Syscall User Dispatch
120 * @mode: One of PR_SYS_DISPATCH_ON or PR_SYS_DISPATCH_OFF
121 * @selector: Tracees user virtual address of SUD selector
122 * @offset: SUD exclusion area (virtual address)
123 * @len: Length of SUD exclusion area
124 *
125 * Used to get/set the syscall user dispatch configuration for a tracee.
126 * Selector is optional (may be NULL), and if invalid will produce
127 * a SIGSEGV in the tracee upon first access.
128 *
129 * If mode is PR_SYS_DISPATCH_ON, syscall dispatch will be enabled. If
130 * PR_SYS_DISPATCH_OFF, syscall dispatch will be disabled and all other
131 * parameters must be 0. The value in *selector (if not null), also determines
132 * whether syscall dispatch will occur.
133 *
134 * The Syscall User Dispatch Exclusion area described by offset/len is the
135 * virtual address space from which syscalls will not produce a user
136 * dispatch.
137 */
138struct ptrace_sud_config {
139 __u64 mode;
140 __u64 selector;
141 __u64 offset;
142 __u64 len;
143};
144
115145/*
116146 * These values are stored in task->ptrace_message
117147 * by ptrace_stop to describe the current syscall-stop.
lib/libc/include/any-linux-any/linux/quota.h+1
......@@ -77,6 +77,7 @@
7777#define QFMT_VFS_V0 2
7878#define QFMT_OCFS2 3
7979#define QFMT_VFS_V1 4
80#define QFMT_SHMEM 5
8081
8182/* Size of block in which space limits are passed through the quota
8283 * interface */
lib/libc/include/any-linux-any/linux/raid/md_p.h+2-6
......@@ -2,15 +2,11 @@
22/*
33 md_p.h : physical layout of Linux RAID devices
44 Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
5
5
66 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU General Public License as published by
88 the Free Software Foundation; either version 2, or (at your option)
99 any later version.
10
11 You should have received a copy of the GNU General Public License
12 (for example /usr/src/linux/COPYING); if not, write to the Free
13 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1410*/
1511
1612#ifndef _MD_P_H
......@@ -237,7 +233,7 @@ struct mdp_superblock_1 {
237233 char set_name[32]; /* set and interpreted by user-space */
238234
239235 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
240 __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
236 __le32 level; /* 0,1,4,5 */
241237 __le32 layout; /* only for raid5 and raid10 currently */
242238 __le64 size; /* used size of component devices, in 512byte sectors */
243239
lib/libc/include/any-linux-any/linux/raid/md_u.h+1-10
......@@ -2,15 +2,11 @@
22/*
33 md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
44 Copyright (C) 1998 Ingo Molnar
5
5
66 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU General Public License as published by
88 the Free Software Foundation; either version 2, or (at your option)
99 any later version.
10
11 You should have received a copy of the GNU General Public License
12 (for example /usr/src/linux/COPYING); if not, write to the Free
13 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1410*/
1511
1612#ifndef _MD_U_H
......@@ -107,11 +103,6 @@ typedef struct mdu_array_info_s {
107103
108104} mdu_array_info_t;
109105
110/* non-obvious values for 'level' */
111#define LEVEL_MULTIPATH (-4)
112#define LEVEL_LINEAR (-1)
113#define LEVEL_FAULTY (-5)
114
115106/* we need a value for 'no level specified' and 0
116107 * means 'raid0', so we need something else. This is
117108 * for internal use only
lib/libc/include/any-linux-any/linux/resource.h+1-1
......@@ -2,7 +2,7 @@
22#ifndef _LINUX_RESOURCE_H
33#define _LINUX_RESOURCE_H
44
5#include <linux/time.h>
5#include <linux/time_types.h>
66#include <linux/types.h>
77
88/*
lib/libc/include/any-linux-any/linux/rkisp1-config.h+27-23
......@@ -175,16 +175,21 @@
175175/**
176176 * enum rkisp1_cif_isp_version - ISP variants
177177 *
178 * @RKISP1_V10: used at least in rk3288 and rk3399
179 * @RKISP1_V11: declared in the original vendor code, but not used
180 * @RKISP1_V12: used at least in rk3326 and px30
181 * @RKISP1_V13: used at least in rk1808
178 * @RKISP1_V10: Used at least in RK3288 and RK3399.
179 * @RKISP1_V11: Declared in the original vendor code, but not used. Same number
180 * of entries in grids and histogram as v10.
181 * @RKISP1_V12: Used at least in RK3326 and PX30.
182 * @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and
183 * histogram as v12.
184 * @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids
185 * and histogram as v10.
182186 */
183187enum rkisp1_cif_isp_version {
184188 RKISP1_V10 = 10,
185189 RKISP1_V11,
186190 RKISP1_V12,
187191 RKISP1_V13,
192 RKISP1_V_IMX8MP,
188193};
189194
190195enum rkisp1_cif_isp_histogram_mode {
......@@ -584,10 +589,9 @@ enum rkisp1_cif_isp_goc_mode {
584589 * as is reported by the hw_revision field of the struct media_device_info
585590 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
586591 *
587 * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10
588 * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
589 * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum
590 * of the two.
592 * V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has
593 * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.
594 * RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.
591595 */
592596struct rkisp1_cif_isp_goc_config {
593597 __u32 mode;
......@@ -607,10 +611,10 @@ struct rkisp1_cif_isp_goc_config {
607611 * as is reported by the hw_revision field of the struct media_device_info
608612 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
609613 *
610 * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10
611 * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
612 * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum
613 * of the two.
614 * V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has
615 * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.
616 * RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the
617 * two.
614618 */
615619struct rkisp1_cif_isp_hst_config {
616620 __u32 mode;
......@@ -902,9 +906,9 @@ struct rkisp1_cif_isp_bls_meas_val {
902906 * as is reported by the hw_revision field of the struct media_device_info
903907 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
904908 *
905 * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries,
906 * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries.
907 * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two.
909 * V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has
910 * RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal
911 * to the maximum of the two.
908912 *
909913 * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.
910914 */
......@@ -944,21 +948,21 @@ struct rkisp1_cif_isp_af_stat {
944948 * integer part.
945949 *
946950 * The window of the measurements area is divided to 5x5 sub-windows for
947 * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for
948 * each sub-window independently and the final result is a weighted average of
949 * the histogram measurements on all sub-windows. The window of the
950 * measurements area and the weight of each sub-window are configurable using
951 * V10 and to 9x9 sub-windows for V12. The histogram is then computed for each
952 * sub-window independently and the final result is a weighted average of the
953 * histogram measurements on all sub-windows. The window of the measurements
954 * area and the weight of each sub-window are configurable using
951955 * struct @rkisp1_cif_isp_hst_config.
952956 *
953 * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13.
957 * The histogram contains 16 bins in V10 and 32 bins in V12.
954958 *
955959 * The number of entries of @hist_bins depends on the hardware revision
956960 * as is reported by the hw_revision field of the struct media_device_info
957961 * that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
958962 *
959 * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries,
960 * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries.
961 * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two.
963 * V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has
964 * RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is
965 * equal to the maximum of the two.
962966 */
963967struct rkisp1_cif_isp_hist_stat {
964968 __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];
lib/libc/include/any-linux-any/linux/rpmsg.h+10
......@@ -43,4 +43,14 @@ struct rpmsg_endpoint_info {
4343 */
4444#define RPMSG_RELEASE_DEV_IOCTL _IOW(0xb5, 0x4, struct rpmsg_endpoint_info)
4545
46/**
47 * Get the flow control state of the remote rpmsg char device.
48 */
49#define RPMSG_GET_OUTGOING_FLOWCONTROL _IOR(0xb5, 0x5, int)
50
51/**
52 * Set the flow control state of the local rpmsg char device.
53 */
54#define RPMSG_SET_INCOMING_FLOWCONTROL _IOR(0xb5, 0x6, int)
55
4656#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rtnetlink.h+11-7
......@@ -502,13 +502,17 @@ enum {
502502
503503#define RTAX_MAX (__RTAX_MAX - 1)
504504
505#define RTAX_FEATURE_ECN (1 << 0)
506#define RTAX_FEATURE_SACK (1 << 1)
507#define RTAX_FEATURE_TIMESTAMP (1 << 2)
508#define RTAX_FEATURE_ALLFRAG (1 << 3)
509
510#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | \
511 RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG)
505#define RTAX_FEATURE_ECN (1 << 0)
506#define RTAX_FEATURE_SACK (1 << 1) /* unused */
507#define RTAX_FEATURE_TIMESTAMP (1 << 2) /* unused */
508#define RTAX_FEATURE_ALLFRAG (1 << 3) /* unused */
509#define RTAX_FEATURE_TCP_USEC_TS (1 << 4)
510
511#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | \
512 RTAX_FEATURE_SACK | \
513 RTAX_FEATURE_TIMESTAMP | \
514 RTAX_FEATURE_ALLFRAG | \
515 RTAX_FEATURE_TCP_USEC_TS)
512516
513517struct rta_session {
514518 __u8 proto;
lib/libc/include/any-linux-any/linux/sched/types.h-4
......@@ -4,10 +4,6 @@
44
55#include <linux/types.h>
66
7struct sched_param {
8 int sched_priority;
9};
10
117#define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */
128#define SCHED_ATTR_SIZE_VER1 56 /* add: util_{min,max} */
139
lib/libc/include/any-linux-any/linux/sctp.h+3-1
......@@ -1205,7 +1205,9 @@ enum sctp_sched_type {
12051205 SCTP_SS_DEFAULT = SCTP_SS_FCFS,
12061206 SCTP_SS_PRIO,
12071207 SCTP_SS_RR,
1208 SCTP_SS_MAX = SCTP_SS_RR
1208 SCTP_SS_FC,
1209 SCTP_SS_WFQ,
1210 SCTP_SS_MAX = SCTP_SS_WFQ
12091211};
12101212
12111213/* Probe Interval socket option */
lib/libc/include/any-linux-any/linux/seccomp.h+4
......@@ -115,6 +115,8 @@ struct seccomp_notif_resp {
115115 __u32 flags;
116116};
117117
118#define SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP (1UL << 0)
119
118120/* valid flags for seccomp_notif_addfd */
119121#define SECCOMP_ADDFD_FLAG_SETFD (1UL << 0) /* Specify remote fd */
120122#define SECCOMP_ADDFD_FLAG_SEND (1UL << 1) /* Addfd and return it, atomically */
......@@ -150,4 +152,6 @@ struct seccomp_notif_addfd {
150152#define SECCOMP_IOCTL_NOTIF_ADDFD SECCOMP_IOW(3, \
151153 struct seccomp_notif_addfd)
152154
155#define SECCOMP_IOCTL_NOTIF_SET_FLAGS SECCOMP_IOW(4, __u64)
156
153157#endif /* _LINUX_SECCOMP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sed-opal.h+48-1
......@@ -49,13 +49,23 @@ enum opal_lock_flags {
4949 OPAL_SAVE_FOR_LOCK = 0x01,
5050};
5151
52enum opal_key_type {
53 OPAL_INCLUDED = 0, /* key[] is the key */
54 OPAL_KEYRING, /* key is in keyring */
55};
56
5257struct opal_key {
5358 __u8 lr;
5459 __u8 key_len;
55 __u8 __align[6];
60 __u8 key_type;
61 __u8 __align[5];
5662 __u8 key[OPAL_KEY_MAX];
5763};
5864
65enum opal_revert_lsp_opts {
66 OPAL_PRESERVE = 0x01,
67};
68
5969struct opal_lr_act {
6070 struct opal_key key;
6171 __u32 sum;
......@@ -78,6 +88,16 @@ struct opal_user_lr_setup {
7888 struct opal_session_info session;
7989};
8090
91struct opal_lr_status {
92 struct opal_session_info session;
93 __u64 range_start;
94 __u64 range_length;
95 __u32 RLE; /* Read Lock enabled */
96 __u32 WLE; /* Write Lock Enabled */
97 __u32 l_state;
98 __u8 align[4];
99};
100
81101struct opal_lock_unlock {
82102 struct opal_session_info session;
83103 __u32 l_state;
......@@ -151,6 +171,29 @@ struct opal_status {
151171 __u32 reserved;
152172};
153173
174/*
175 * Geometry Reporting per TCG Storage OPAL SSC
176 * section 3.1.1.4
177 */
178struct opal_geometry {
179 __u8 align;
180 __u32 logical_block_size;
181 __u64 alignment_granularity;
182 __u64 lowest_aligned_lba;
183 __u8 __align[3];
184};
185
186struct opal_discovery {
187 __u64 data;
188 __u64 size;
189};
190
191struct opal_revert_lsp {
192 struct opal_key key;
193 __u32 options;
194 __u32 __pad;
195};
196
154197#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
155198#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
156199#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
......@@ -168,5 +211,9 @@ struct opal_status {
168211#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
169212#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)
170213#define IOC_OPAL_GET_STATUS _IOR('p', 236, struct opal_status)
214#define IOC_OPAL_GET_LR_STATUS _IOW('p', 237, struct opal_lr_status)
215#define IOC_OPAL_GET_GEOMETRY _IOR('p', 238, struct opal_geometry)
216#define IOC_OPAL_DISCOVERY _IOW('p', 239, struct opal_discovery)
217#define IOC_OPAL_REVERT_LSP _IOW('p', 240, struct opal_revert_lsp)
171218
172219#endif /* _SED_OPAL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial.h+12-8
......@@ -11,6 +11,7 @@
1111#ifndef _LINUX_SERIAL_H
1212#define _LINUX_SERIAL_H
1313
14#include <linux/const.h>
1415#include <linux/types.h>
1516
1617#include <linux/tty_flags.h>
......@@ -137,17 +138,20 @@ struct serial_icounter_struct {
137138 * * %SER_RS485_ADDRB - Enable RS485 addressing mode.
138139 * * %SER_RS485_ADDR_RECV - Receive address filter (enables @addr_recv). Requires %SER_RS485_ADDRB.
139140 * * %SER_RS485_ADDR_DEST - Destination address (enables @addr_dest). Requires %SER_RS485_ADDRB.
141 * * %SER_RS485_MODE_RS422 - Enable RS422. Requires %SER_RS485_ENABLED.
140142 */
141143struct serial_rs485 {
142144 __u32 flags;
143#define SER_RS485_ENABLED (1 << 0)
144#define SER_RS485_RTS_ON_SEND (1 << 1)
145#define SER_RS485_RTS_AFTER_SEND (1 << 2)
146#define SER_RS485_RX_DURING_TX (1 << 4)
147#define SER_RS485_TERMINATE_BUS (1 << 5)
148#define SER_RS485_ADDRB (1 << 6)
149#define SER_RS485_ADDR_RECV (1 << 7)
150#define SER_RS485_ADDR_DEST (1 << 8)
145#define SER_RS485_ENABLED _BITUL(0)
146#define SER_RS485_RTS_ON_SEND _BITUL(1)
147#define SER_RS485_RTS_AFTER_SEND _BITUL(2)
148/* Placeholder for bit 3: SER_RS485_RTS_BEFORE_SEND, which isn't used anymore */
149#define SER_RS485_RX_DURING_TX _BITUL(4)
150#define SER_RS485_TERMINATE_BUS _BITUL(5)
151#define SER_RS485_ADDRB _BITUL(6)
152#define SER_RS485_ADDR_RECV _BITUL(7)
153#define SER_RS485_ADDR_DEST _BITUL(8)
154#define SER_RS485_MODE_RS422 _BITUL(9)
151155
152156 __u32 delay_rts_before_send;
153157 __u32 delay_rts_after_send;
lib/libc/include/any-linux-any/linux/serial_core.h+10-55
......@@ -1,22 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
3 * linux/drivers/char/serial_core.h
4 *
53 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
204 */
215#ifndef LINUX_SERIAL_CORE_H
226#define LINUX_SERIAL_CORE_H
......@@ -25,6 +9,10 @@
259
2610/*
2711 * The type definitions. These are from Ted Ts'o's serial.h
12 * By historical reasons the values from 0 to 13 are defined
13 * in the include/uapi/linux/serial.h, do not define them here.
14 * Values 0 to 19 are used by setserial from busybox and must never
15 * be modified.
2816 */
2917#define PORT_NS16550A 14
3018#define PORT_XSCALE 15
......@@ -94,15 +82,9 @@
9482#define PORT_SCIF 53
9583#define PORT_IRDA 54
9684
97/* Samsung S3C2410 SoC and derivatives thereof */
98#define PORT_S3C2410 55
99
10085/* SGI IP22 aka Indy / Challenge S / Indigo 2 */
10186#define PORT_IP22ZILOG 56
10287
103/* Sharp LH7a40x -- an ARM9 SoC series */
104#define PORT_LH7A40X 57
105
10688/* PPC CPM type number */
10789#define PORT_CPM 58
10890
......@@ -112,37 +94,23 @@
11294/* IBM icom */
11395#define PORT_ICOM 60
11496
115/* Samsung S3C2440 SoC */
116#define PORT_S3C2440 61
117
11897/* Motorola i.MX SoC */
11998#define PORT_IMX 62
12099
121/* Marvell MPSC (obsolete unused) */
122#define PORT_MPSC 63
123
124100/* TXX9 type number */
125101#define PORT_TXX9 64
126102
127/* Samsung S3C2400 SoC */
128#define PORT_S3C2400 67
129
130/* M32R SIO */
131#define PORT_M32R_SIO 68
132
133103/*Digi jsm */
134104#define PORT_JSM 69
135105
136106/* SUN4V Hypervisor Console */
137107#define PORT_SUNHV 72
138108
139#define PORT_S3C2412 73
140
141109/* Xilinx uartlite */
142110#define PORT_UARTLITE 74
143111
144/* Blackfin bf5xx */
145#define PORT_BFIN 75
112/* Broadcom BCM7271 UART */
113#define PORT_BCM7271 76
146114
147115/* Broadcom SB1250, etc. SOC */
148116#define PORT_SB1250_DUART 77
......@@ -150,13 +118,6 @@
150118/* Freescale ColdFire */
151119#define PORT_MCF 78
152120
153/* Blackfin SPORT */
154#define PORT_BFIN_SPORT 79
155
156/* MN10300 on-chip UART numbers */
157#define PORT_MN10300 80
158#define PORT_MN10300_CTS 81
159
160121#define PORT_SC26XX 82
161122
162123/* SH-SCI */
......@@ -164,9 +125,6 @@
164125
165126#define PORT_S3C6400 84
166127
167/* NWPSERIAL, now removed */
168#define PORT_NWPSERIAL 85
169
170128/* MAX3100 */
171129#define PORT_MAX3100 86
172130
......@@ -225,13 +183,10 @@
225183/* ST ASC type numbers */
226184#define PORT_ASC 105
227185
228/* Tilera TILE-Gx UART */
229#define PORT_TILEGX 106
230
231186/* MEN 16z135 UART */
232187#define PORT_MEN_Z135 107
233188
234/* SC16IS74xx */
189/* SC16IS7xx */
235190#define PORT_SC16IS7XX 108
236191
237192/* MESON */
......@@ -243,9 +198,6 @@
243198/* SPRD SERIAL */
244199#define PORT_SPRD 111
245200
246/* Cris v10 / v32 SoC */
247#define PORT_CRIS 112
248
249201/* STM32 USART */
250202#define PORT_STM32 113
251203
......@@ -279,4 +231,7 @@
279231/* Sunplus UART */
280232#define PORT_SUNPLUS 123
281233
234/* Generic type identifier for ports which type is not important to userspace. */
235#define PORT_GENERIC (-1)
236
282237#endif /* LINUX_SERIAL_CORE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial_reg.h+1
......@@ -49,6 +49,7 @@
4949#define UART_IIR_FIFO_ENABLED_8250 0x00 /* 8250: no FIFO */
5050#define UART_IIR_FIFO_ENABLED_16550 0x80 /* 16550: (broken/unusable) FIFO */
5151#define UART_IIR_FIFO_ENABLED_16550A 0xc0 /* 16550A: FIFO enabled */
52#define UART_IIR_FIFO_ENABLED_16750 0xe0 /* 16750: 64 bytes FIFO enabled */
5253
5354#define UART_FCR 2 /* Out: FIFO Control Register */
5455#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
lib/libc/include/any-linux-any/linux/sev-guest.h+19-3
......@@ -14,9 +14,11 @@
1414
1515#include <linux/types.h>
1616
17#define SNP_REPORT_USER_DATA_SIZE 64
18
1719struct snp_report_req {
1820 /* user data that should be included in the report */
19 __u8 user_data[64];
21 __u8 user_data[SNP_REPORT_USER_DATA_SIZE];
2022
2123 /* The vmpl level to be included in the report */
2224 __u32 vmpl;
......@@ -52,8 +54,14 @@ struct snp_guest_request_ioctl {
5254 __u64 req_data;
5355 __u64 resp_data;
5456
55 /* firmware error code on failure (see psp-sev.h) */
56 __u64 fw_err;
57 /* bits[63:32]: VMM error code, bits[31:0] firmware error code (see psp-sev.h) */
58 union {
59 __u64 exitinfo2;
60 struct {
61 __u32 fw_error;
62 __u32 vmm_error;
63 };
64 };
5765};
5866
5967struct snp_ext_report_req {
......@@ -77,4 +85,12 @@ struct snp_ext_report_req {
7785/* Get SNP extended report as defined in the GHCB specification version 2. */
7886#define SNP_GET_EXT_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x2, struct snp_guest_request_ioctl)
7987
88/* Guest message request EXIT_INFO_2 constants */
89#define SNP_GUEST_FW_ERR_MASK GENMASK_ULL(31, 0)
90#define SNP_GUEST_VMM_ERR_SHIFT 32
91#define SNP_GUEST_VMM_ERR(x) (((u64)x) << SNP_GUEST_VMM_ERR_SHIFT)
92
93#define SNP_GUEST_VMM_ERR_INVALID_LEN 1
94#define SNP_GUEST_VMM_ERR_BUSY 2
95
8096#endif /* __UAPI_LINUX_SEV_GUEST_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/smc.h+4
......@@ -107,6 +107,8 @@ enum {
107107enum {
108108 SMC_NLA_LGR_R_V2_UNSPEC,
109109 SMC_NLA_LGR_R_V2_DIRECT, /* u8 */
110 SMC_NLA_LGR_R_V2_MAX_CONNS, /* u8 */
111 SMC_NLA_LGR_R_V2_MAX_LINKS, /* u8 */
110112 __SMC_NLA_LGR_R_V2_MAX,
111113 SMC_NLA_LGR_R_V2_MAX = __SMC_NLA_LGR_R_V2_MAX - 1
112114};
......@@ -158,6 +160,8 @@ enum {
158160 SMC_NLA_LGR_D_CHID, /* u16 */
159161 SMC_NLA_LGR_D_PAD, /* flag */
160162 SMC_NLA_LGR_D_V2_COMMON, /* nest */
163 SMC_NLA_LGR_D_EXT_GID, /* u64 */
164 SMC_NLA_LGR_D_PEER_EXT_GID, /* u64 */
161165 __SMC_NLA_LGR_D_MAX,
162166 SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
163167};
lib/libc/include/any-linux-any/linux/smc_diag.h+2
......@@ -107,6 +107,8 @@ struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
107107 __aligned_u64 my_gid; /* My GID */
108108 __aligned_u64 token; /* Token of DMB */
109109 __aligned_u64 peer_token; /* Token of remote DMBE */
110 __aligned_u64 peer_gid_ext; /* Peer GID (extended part) */
111 __aligned_u64 my_gid_ext; /* My GID (extended part) */
110112};
111113
112114#endif /* _SMC_DIAG_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/snmp.h+9-1
......@@ -24,7 +24,7 @@ enum
2424 IPSTATS_MIB_INOCTETS, /* InOctets */
2525 IPSTATS_MIB_INDELIVERS, /* InDelivers */
2626 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
27 IPSTATS_MIB_OUTPKTS, /* OutRequests */
27 IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
2828 IPSTATS_MIB_OUTOCTETS, /* OutOctets */
2929/* other fields */
3030 IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
......@@ -57,6 +57,7 @@ enum
5757 IPSTATS_MIB_ECT0PKTS, /* InECT0Pkts */
5858 IPSTATS_MIB_CEPKTS, /* InCEPkts */
5959 IPSTATS_MIB_REASM_OVERLAPS, /* ReasmOverlaps */
60 IPSTATS_MIB_OUTPKTS, /* OutTransmits */
6061 __IPSTATS_MIB_MAX
6162};
6263
......@@ -296,6 +297,11 @@ enum
296297 LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */
297298 LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */
298299 LINUX_MIB_TCPPLBREHASH, /* TCPPLBRehash */
300 LINUX_MIB_TCPAOREQUIRED, /* TCPAORequired */
301 LINUX_MIB_TCPAOBAD, /* TCPAOBad */
302 LINUX_MIB_TCPAOKEYNOTFOUND, /* TCPAOKeyNotFound */
303 LINUX_MIB_TCPAOGOOD, /* TCPAOGood */
304 LINUX_MIB_TCPAODROPPEDICMPS, /* TCPAODroppedIcmps */
299305 __LINUX_MIB_MAX
300306};
301307
......@@ -331,6 +337,8 @@ enum
331337 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
332338 LINUX_MIB_XFRMOUTSTATEINVALID, /* XfrmOutStateInvalid */
333339 LINUX_MIB_XFRMACQUIREERROR, /* XfrmAcquireError */
340 LINUX_MIB_XFRMOUTSTATEDIRERROR, /* XfrmOutStateDirError */
341 LINUX_MIB_XFRMINSTATEDIRERROR, /* XfrmInStateDirError */
334342 __LINUX_MIB_XFRMMAX
335343};
336344
lib/libc/include/any-linux-any/linux/spi/spi.h+2-1
......@@ -28,6 +28,7 @@
2828#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
2929#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
3030#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */
31#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave mosi line low when idle */
3132
3233/*
3334 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
......@@ -37,6 +38,6 @@
3738 * These bits must not overlap. A static assert check should make sure of that.
3839 * If adding extra bits, make sure to increase the bit index below as well.
3940 */
40#define SPI_MODE_USER_MASK (_BITUL(17) - 1)
41#define SPI_MODE_USER_MASK (_BITUL(18) - 1)
4142
4243#endif /* _SPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stat.h+4-1
......@@ -127,7 +127,8 @@ struct statx {
127127 __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */
128128 __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
129129 /* 0xa0 */
130 __u64 __spare3[12]; /* Spare space for future expansion */
130 __u64 stx_subvol; /* Subvolume identifier */
131 __u64 __spare3[11]; /* Spare space for future expansion */
131132 /* 0x100 */
132133};
133134
......@@ -154,6 +155,8 @@ struct statx {
154155#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
155156#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156157#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
158#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
159#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
157160
158161#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
159162
lib/libc/include/any-linux-any/linux/stddef.h+21-2
......@@ -27,8 +27,13 @@
2727 union { \
2828 struct { MEMBERS } ATTRS; \
2929 struct TAG { MEMBERS } ATTRS NAME; \
30 }
30 } ATTRS
3131
32#ifdef __cplusplus
33/* sizeof(struct{}) is 1 in C++, not 0, can't use C version of the macro. */
34#define __DECLARE_FLEX_ARRAY(T, member) \
35 T member[0]
36#else
3237/**
3338 * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
3439 *
......@@ -44,4 +49,18 @@
4449 struct { } __empty_ ## NAME; \
4550 TYPE NAME[]; \
4651 }
47#endif
\ No newline at end of file
52#endif
53
54#ifndef __counted_by
55#define __counted_by(m)
56#endif
57
58#ifndef __counted_by_le
59#define __counted_by_le(m)
60#endif
61
62#ifndef __counted_by_be
63#define __counted_by_be(m)
64#endif
65
66#endif /* _LINUX_STDDEF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sync_file.h+38-23
......@@ -16,12 +16,16 @@
1616#include <linux/types.h>
1717
1818/**
19 * struct sync_merge_data - data passed to merge ioctl
19 * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
2020 * @name: name of new fence
2121 * @fd2: file descriptor of second fence
2222 * @fence: returns the fd of the new fence to userspace
2323 * @flags: merge_data flags
2424 * @pad: padding for 64-bit alignment, should always be zero
25 *
26 * Creates a new fence containing copies of the sync_pts in both
27 * the calling fd and sync_merge_data.fd2. Returns the new fence's
28 * fd in sync_merge_data.fence
2529 */
2630struct sync_merge_data {
2731 char name[32];
......@@ -34,8 +38,8 @@ struct sync_merge_data {
3438/**
3539 * struct sync_fence_info - detailed fence information
3640 * @obj_name: name of parent sync_timeline
37* @driver_name: name of driver implementing the parent
38* @status: status of the fence 0:active 1:signaled <0:error
41 * @driver_name: name of driver implementing the parent
42 * @status: status of the fence 0:active 1:signaled <0:error
3943 * @flags: fence_info flags
4044 * @timestamp_ns: timestamp of status change in nanoseconds
4145 */
......@@ -48,14 +52,19 @@ struct sync_fence_info {
4852};
4953
5054/**
51 * struct sync_file_info - data returned from fence info ioctl
55 * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
5256 * @name: name of fence
5357 * @status: status of fence. 1: signaled 0:active <0:error
5458 * @flags: sync_file_info flags
55 * @num_fences number of fences in the sync_file
59 * @num_fences: number of fences in the sync_file
5660 * @pad: padding for 64-bit alignment, should always be zero
57 * @sync_fence_info: pointer to array of structs sync_fence_info with all
61 * @sync_fence_info: pointer to array of struct &sync_fence_info with all
5862 * fences in the sync_file
63 *
64 * Takes a struct sync_file_info. If num_fences is 0, the field is updated
65 * with the actual number of fences. If num_fences is > 0, the system will
66 * use the pointer provided on sync_fence_info to return up to num_fences of
67 * struct sync_fence_info, with detailed fence information.
5968 */
6069struct sync_file_info {
6170 char name[32];
......@@ -67,32 +76,38 @@ struct sync_file_info {
6776 __u64 sync_fence_info;
6877};
6978
79/**
80 * struct sync_set_deadline - SYNC_IOC_SET_DEADLINE - set a deadline hint on a fence
81 * @deadline_ns: absolute time of the deadline
82 * @pad: must be zero
83 *
84 * Allows userspace to set a deadline on a fence, see &dma_fence_set_deadline
85 *
86 * The timebase for the deadline is CLOCK_MONOTONIC (same as vblank). For
87 * example
88 *
89 * clock_gettime(CLOCK_MONOTONIC, &t);
90 * deadline_ns = (t.tv_sec * 1000000000L) + t.tv_nsec + ns_until_deadline
91 */
92struct sync_set_deadline {
93 __u64 deadline_ns;
94 /* Not strictly needed for alignment but gives some possibility
95 * for future extension:
96 */
97 __u64 pad;
98};
99
70100#define SYNC_IOC_MAGIC '>'
71101
72/**
102/*
73103 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the
74104 * old API to get weird errors when trying to handling sync_files. The API
75105 * change happened during the de-stage of the Sync Framework when there was
76106 * no upstream users available.
77107 */
78108
79/**
80 * DOC: SYNC_IOC_MERGE - merge two fences
81 *
82 * Takes a struct sync_merge_data. Creates a new fence containing copies of
83 * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
84 * new fence's fd in sync_merge_data.fence
85 */
86109#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
87
88/**
89 * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
90 *
91 * Takes a struct sync_file_info. If num_fences is 0, the field is updated
92 * with the actual number of fences. If num_fences is > 0, the system will
93 * use the pointer provided on sync_fence_info to return up to num_fences of
94 * struct sync_fence_info, with detailed fence information.
95 */
96110#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
111#define SYNC_IOC_SET_DEADLINE _IOW(SYNC_IOC_MAGIC, 5, struct sync_set_deadline)
97112
98113#endif /* _LINUX_SYNC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/target_core_user.h+1-1
......@@ -119,7 +119,7 @@ struct tcmu_cmd_entry {
119119 __u64 cdb_off;
120120 __u64 __pad1;
121121 __u64 __pad2;
122 struct iovec iov[0];
122 __DECLARE_FLEX_ARRAY(struct iovec, iov);
123123 } req;
124124 struct {
125125 __u8 scsi_status;
lib/libc/include/any-linux-any/linux/taskstats.h+5-1
......@@ -34,7 +34,7 @@
3434 */
3535
3636
37#define TASKSTATS_VERSION 13
37#define TASKSTATS_VERSION 14
3838#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939 * in linux/sched.h */
4040
......@@ -198,6 +198,10 @@ struct taskstats {
198198 /* v13: Delay waiting for write-protect copy */
199199 __u64 wpcopy_count;
200200 __u64 wpcopy_delay_total;
201
202 /* v14: Delay waiting for IRQ/SOFTIRQ */
203 __u64 irq_count;
204 __u64 irq_delay_total;
201205};
202206
203207
lib/libc/include/any-linux-any/linux/tc_act/tc_ipt.h deleted-20
......@@ -1,20 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __LINUX_TC_IPT_H
3#define __LINUX_TC_IPT_H
4
5#include <linux/pkt_cls.h>
6
7enum {
8 TCA_IPT_UNSPEC,
9 TCA_IPT_TABLE,
10 TCA_IPT_HOOK,
11 TCA_IPT_INDEX,
12 TCA_IPT_CNT,
13 TCA_IPT_TM,
14 TCA_IPT_TARG,
15 TCA_IPT_PAD,
16 __TCA_IPT_MAX
17};
18#define TCA_IPT_MAX (__TCA_IPT_MAX - 1)
19
20#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tc_act/tc_mirred.h+1
......@@ -21,6 +21,7 @@ enum {
2121 TCA_MIRRED_TM,
2222 TCA_MIRRED_PARMS,
2323 TCA_MIRRED_PAD,
24 TCA_MIRRED_BLOCKID,
2425 __TCA_MIRRED_MAX
2526};
2627#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
lib/libc/include/any-linux-any/linux/tc_act/tc_pedit.h+1-1
......@@ -62,7 +62,7 @@ struct tc_pedit_sel {
6262 tc_gen;
6363 unsigned char nkeys;
6464 unsigned char flags;
65 struct tc_pedit_key keys[0];
65 struct tc_pedit_key keys[] __counted_by(nkeys);
6666};
6767
6868#define tc_pedit tc_pedit_sel
lib/libc/include/any-linux-any/linux/tc_act/tc_tunnel_key.h+1
......@@ -34,6 +34,7 @@ enum {
3434 */
3535 TCA_TUNNEL_KEY_ENC_TOS, /* u8 */
3636 TCA_TUNNEL_KEY_ENC_TTL, /* u8 */
37 TCA_TUNNEL_KEY_NO_FRAG, /* flag */
3738 __TCA_TUNNEL_KEY_MAX,
3839};
3940
lib/libc/include/any-linux-any/linux/tcp.h+120
......@@ -129,6 +129,13 @@ enum {
129129
130130#define TCP_TX_DELAY 37 /* delay outgoing packets by XX usec */
131131
132#define TCP_AO_ADD_KEY 38 /* Add/Set MKT */
133#define TCP_AO_DEL_KEY 39 /* Delete MKT */
134#define TCP_AO_INFO 40 /* Set/list TCP-AO per-socket options */
135#define TCP_AO_GET_KEYS 41 /* List MKT(s) */
136#define TCP_AO_REPAIR 42 /* Get/Set SNEs and ISNs */
137
138#define TCP_IS_MPTCP 43 /* Is MPTCP being used? */
132139
133140#define TCP_REPAIR_ON 1
134141#define TCP_REPAIR_OFF 0
......@@ -170,6 +177,7 @@ enum tcp_fastopen_client_fail {
170177#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
171178#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
172179#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
180#define TCPI_OPT_USEC_TS 64 /* usec timestamps */
173181
174182/*
175183 * Sender's congestion state indicating normal or abnormal situations
......@@ -289,6 +297,18 @@ struct tcp_info {
289297 */
290298
291299 __u32 tcpi_rehash; /* PLB or timeout triggered rehash attempts */
300
301 __u16 tcpi_total_rto; /* Total number of RTO timeouts, including
302 * SYN/SYN-ACK and recurring timeouts.
303 */
304 __u16 tcpi_total_rto_recoveries; /* Total number of RTO
305 * recoveries, including any
306 * unfinished recovery.
307 */
308 __u32 tcpi_total_rto_time; /* Total time spent in RTO recoveries
309 * in milliseconds, including any
310 * unfinished recovery.
311 */
292312};
293313
294314/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
......@@ -348,6 +368,106 @@ struct tcp_diag_md5sig {
348368 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN];
349369};
350370
371#define TCP_AO_MAXKEYLEN 80
372
373#define TCP_AO_KEYF_IFINDEX (1 << 0) /* L3 ifindex for VRF */
374#define TCP_AO_KEYF_EXCLUDE_OPT (1 << 1) /* "Indicates whether TCP
375 * options other than TCP-AO
376 * are included in the MAC
377 * calculation"
378 */
379
380struct tcp_ao_add { /* setsockopt(TCP_AO_ADD_KEY) */
381 struct __kernel_sockaddr_storage addr; /* peer's address for the key */
382 char alg_name[64]; /* crypto hash algorithm to use */
383 __s32 ifindex; /* L3 dev index for VRF */
384 __u32 set_current :1, /* set key as Current_key at once */
385 set_rnext :1, /* request it from peer with RNext_key */
386 reserved :30; /* must be 0 */
387 __u16 reserved2; /* padding, must be 0 */
388 __u8 prefix; /* peer's address prefix */
389 __u8 sndid; /* SendID for outgoing segments */
390 __u8 rcvid; /* RecvID to match for incoming seg */
391 __u8 maclen; /* length of authentication code (hash) */
392 __u8 keyflags; /* see TCP_AO_KEYF_ */
393 __u8 keylen; /* length of ::key */
394 __u8 key[TCP_AO_MAXKEYLEN];
395} __attribute__((aligned(8)));
396
397struct tcp_ao_del { /* setsockopt(TCP_AO_DEL_KEY) */
398 struct __kernel_sockaddr_storage addr; /* peer's address for the key */
399 __s32 ifindex; /* L3 dev index for VRF */
400 __u32 set_current :1, /* corresponding ::current_key */
401 set_rnext :1, /* corresponding ::rnext */
402 del_async :1, /* only valid for listen sockets */
403 reserved :29; /* must be 0 */
404 __u16 reserved2; /* padding, must be 0 */
405 __u8 prefix; /* peer's address prefix */
406 __u8 sndid; /* SendID for outgoing segments */
407 __u8 rcvid; /* RecvID to match for incoming seg */
408 __u8 current_key; /* KeyID to set as Current_key */
409 __u8 rnext; /* KeyID to set as Rnext_key */
410 __u8 keyflags; /* see TCP_AO_KEYF_ */
411} __attribute__((aligned(8)));
412
413struct tcp_ao_info_opt { /* setsockopt(TCP_AO_INFO), getsockopt(TCP_AO_INFO) */
414 /* Here 'in' is for setsockopt(), 'out' is for getsockopt() */
415 __u32 set_current :1, /* in/out: corresponding ::current_key */
416 set_rnext :1, /* in/out: corresponding ::rnext */
417 ao_required :1, /* in/out: don't accept non-AO connects */
418 set_counters :1, /* in: set/clear ::pkt_* counters */
419 accept_icmps :1, /* in/out: accept incoming ICMPs */
420 reserved :27; /* must be 0 */
421 __u16 reserved2; /* padding, must be 0 */
422 __u8 current_key; /* in/out: KeyID of Current_key */
423 __u8 rnext; /* in/out: keyid of RNext_key */
424 __u64 pkt_good; /* in/out: verified segments */
425 __u64 pkt_bad; /* in/out: failed verification */
426 __u64 pkt_key_not_found; /* in/out: could not find a key to verify */
427 __u64 pkt_ao_required; /* in/out: segments missing TCP-AO sign */
428 __u64 pkt_dropped_icmp; /* in/out: ICMPs that were ignored */
429} __attribute__((aligned(8)));
430
431struct tcp_ao_getsockopt { /* getsockopt(TCP_AO_GET_KEYS) */
432 struct __kernel_sockaddr_storage addr; /* in/out: dump keys for peer
433 * with this address/prefix
434 */
435 char alg_name[64]; /* out: crypto hash algorithm */
436 __u8 key[TCP_AO_MAXKEYLEN];
437 __u32 nkeys; /* in: size of the userspace buffer
438 * @optval, measured in @optlen - the
439 * sizeof(struct tcp_ao_getsockopt)
440 * out: number of keys that matched
441 */
442 __u16 is_current :1, /* in: match and dump Current_key,
443 * out: the dumped key is Current_key
444 */
445
446 is_rnext :1, /* in: match and dump RNext_key,
447 * out: the dumped key is RNext_key
448 */
449 get_all :1, /* in: dump all keys */
450 reserved :13; /* padding, must be 0 */
451 __u8 sndid; /* in/out: dump keys with SendID */
452 __u8 rcvid; /* in/out: dump keys with RecvID */
453 __u8 prefix; /* in/out: dump keys with address/prefix */
454 __u8 maclen; /* out: key's length of authentication
455 * code (hash)
456 */
457 __u8 keyflags; /* in/out: see TCP_AO_KEYF_ */
458 __u8 keylen; /* out: length of ::key */
459 __s32 ifindex; /* in/out: L3 dev index for VRF */
460 __u64 pkt_good; /* out: verified segments */
461 __u64 pkt_bad; /* out: segments that failed verification */
462} __attribute__((aligned(8)));
463
464struct tcp_ao_repair { /* {s,g}etsockopt(TCP_AO_REPAIR) */
465 __be32 snt_isn;
466 __be32 rcv_isn;
467 __u32 snd_sne;
468 __u32 rcv_sne;
469} __attribute__((aligned(8)));
470
351471/* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */
352472
353473#define TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT 0x1
lib/libc/include/any-linux-any/linux/tee.h+1
......@@ -56,6 +56,7 @@
5656 */
5757#define TEE_IMPL_ID_OPTEE 1
5858#define TEE_IMPL_ID_AMDTEE 2
59#define TEE_IMPL_ID_TSTEE 3
5960
6061/*
6162 * OP-TEE specific capabilities
lib/libc/include/any-linux-any/linux/thp7312.h created+19
......@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * THine THP7312 user space header file.
4 *
5 * Copyright (C) 2021 THine Electronics, Inc.
6 * Copyright (C) 2023 Ideas on Board Oy
7 */
8
9#ifndef __UAPI_THP7312_H_
10#define __UAPI_THP7312_H_
11
12#include <linux/v4l2-controls.h>
13
14#define V4L2_CID_THP7312_LOW_LIGHT_COMPENSATION (V4L2_CID_USER_THP7312_BASE + 0x01)
15#define V4L2_CID_THP7312_AUTO_FOCUS_METHOD (V4L2_CID_USER_THP7312_BASE + 0x02)
16#define V4L2_CID_THP7312_NOISE_REDUCTION_AUTO (V4L2_CID_USER_THP7312_BASE + 0x03)
17#define V4L2_CID_THP7312_NOISE_REDUCTION_ABSOLUTE (V4L2_CID_USER_THP7312_BASE + 0x04)
18
19#endif /* __UAPI_THP7312_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tps6594_pfsm.h created+37
......@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Userspace ABI for TPS6594 PMIC Pre-configurable Finite State Machine
4 *
5 * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
6 */
7
8#ifndef __TPS6594_PFSM_H
9#define __TPS6594_PFSM_H
10
11#include <linux/const.h>
12#include <linux/ioctl.h>
13#include <linux/types.h>
14
15/**
16 * struct pmic_state_opt - PMIC state options
17 * @gpio_retention: if enabled, power rails associated with GPIO retention remain active
18 * @ddr_retention: if enabled, power rails associated with DDR retention remain active
19 * @mcu_only_startup_dest: if enabled, startup destination state is MCU_ONLY
20 */
21struct pmic_state_opt {
22 __u8 gpio_retention;
23 __u8 ddr_retention;
24 __u8 mcu_only_startup_dest;
25};
26
27/* Commands */
28#define PMIC_BASE 'P'
29
30#define PMIC_GOTO_STANDBY _IO(PMIC_BASE, 0)
31#define PMIC_GOTO_LP_STANDBY _IO(PMIC_BASE, 1)
32#define PMIC_UPDATE_PGM _IO(PMIC_BASE, 2)
33#define PMIC_SET_ACTIVE_STATE _IO(PMIC_BASE, 3)
34#define PMIC_SET_MCU_ONLY_STATE _IOW(PMIC_BASE, 4, struct pmic_state_opt)
35#define PMIC_SET_RETENTION_STATE _IOW(PMIC_BASE, 5, struct pmic_state_opt)
36
37#endif /* __TPS6594_PFSM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/trace_mmap.h created+48
......@@ -0,0 +1,48 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _TRACE_MMAP_H_
3#define _TRACE_MMAP_H_
4
5#include <linux/types.h>
6
7/**
8 * struct trace_buffer_meta - Ring-buffer Meta-page description
9 * @meta_page_size: Size of this meta-page.
10 * @meta_struct_len: Size of this structure.
11 * @subbuf_size: Size of each sub-buffer.
12 * @nr_subbufs: Number of subbfs in the ring-buffer, including the reader.
13 * @reader.lost_events: Number of events lost at the time of the reader swap.
14 * @reader.id: subbuf ID of the current reader. ID range [0 : @nr_subbufs - 1]
15 * @reader.read: Number of bytes read on the reader subbuf.
16 * @flags: Placeholder for now, 0 until new features are supported.
17 * @entries: Number of entries in the ring-buffer.
18 * @overrun: Number of entries lost in the ring-buffer.
19 * @read: Number of entries that have been read.
20 * @Reserved1: Internal use only.
21 * @Reserved2: Internal use only.
22 */
23struct trace_buffer_meta {
24 __u32 meta_page_size;
25 __u32 meta_struct_len;
26
27 __u32 subbuf_size;
28 __u32 nr_subbufs;
29
30 struct {
31 __u64 lost_events;
32 __u32 id;
33 __u32 read;
34 } reader;
35
36 __u64 flags;
37
38 __u64 entries;
39 __u64 overrun;
40 __u64 read;
41
42 __u64 Reserved1;
43 __u64 Reserved2;
44};
45
46#define TRACE_MMAP_IOCTL_GET_READER _IO('R', 0x20)
47
48#endif /* _TRACE_MMAP_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/types.h+4
......@@ -8,6 +8,10 @@
88
99#include <linux/posix_types.h>
1010
11#ifdef __SIZEOF_INT128__
12typedef __signed__ __int128 __s128 __attribute__((aligned(16)));
13typedef unsigned __int128 __u128 __attribute__((aligned(16)));
14#endif
1115
1216/*
1317 * Below are truly Linux-specific types that should never collide with
lib/libc/include/any-linux-any/linux/ublk_cmd.h+132-10
......@@ -8,6 +8,9 @@
88
99/*
1010 * Admin commands, issued by ublk server, and handled by ublk driver.
11 *
12 * Legacy command definition, don't use in new application, and don't
13 * add new such definition any more
1114 */
1215#define UBLK_CMD_GET_QUEUE_AFFINITY 0x01
1316#define UBLK_CMD_GET_DEV_INFO 0x02
......@@ -21,6 +24,40 @@
2124#define UBLK_CMD_END_USER_RECOVERY 0x11
2225#define UBLK_CMD_GET_DEV_INFO2 0x12
2326
27/* Any new ctrl command should encode by __IO*() */
28#define UBLK_U_CMD_GET_QUEUE_AFFINITY \
29 _IOR('u', UBLK_CMD_GET_QUEUE_AFFINITY, struct ublksrv_ctrl_cmd)
30#define UBLK_U_CMD_GET_DEV_INFO \
31 _IOR('u', UBLK_CMD_GET_DEV_INFO, struct ublksrv_ctrl_cmd)
32#define UBLK_U_CMD_ADD_DEV \
33 _IOWR('u', UBLK_CMD_ADD_DEV, struct ublksrv_ctrl_cmd)
34#define UBLK_U_CMD_DEL_DEV \
35 _IOWR('u', UBLK_CMD_DEL_DEV, struct ublksrv_ctrl_cmd)
36#define UBLK_U_CMD_START_DEV \
37 _IOWR('u', UBLK_CMD_START_DEV, struct ublksrv_ctrl_cmd)
38#define UBLK_U_CMD_STOP_DEV \
39 _IOWR('u', UBLK_CMD_STOP_DEV, struct ublksrv_ctrl_cmd)
40#define UBLK_U_CMD_SET_PARAMS \
41 _IOWR('u', UBLK_CMD_SET_PARAMS, struct ublksrv_ctrl_cmd)
42#define UBLK_U_CMD_GET_PARAMS \
43 _IOR('u', UBLK_CMD_GET_PARAMS, struct ublksrv_ctrl_cmd)
44#define UBLK_U_CMD_START_USER_RECOVERY \
45 _IOWR('u', UBLK_CMD_START_USER_RECOVERY, struct ublksrv_ctrl_cmd)
46#define UBLK_U_CMD_END_USER_RECOVERY \
47 _IOWR('u', UBLK_CMD_END_USER_RECOVERY, struct ublksrv_ctrl_cmd)
48#define UBLK_U_CMD_GET_DEV_INFO2 \
49 _IOR('u', UBLK_CMD_GET_DEV_INFO2, struct ublksrv_ctrl_cmd)
50#define UBLK_U_CMD_GET_FEATURES \
51 _IOR('u', 0x13, struct ublksrv_ctrl_cmd)
52#define UBLK_U_CMD_DEL_DEV_ASYNC \
53 _IOR('u', 0x14, struct ublksrv_ctrl_cmd)
54
55/*
56 * 64bits are enough now, and it should be easy to extend in case of
57 * running out of feature flags
58 */
59#define UBLK_FEATURES_LEN 8
60
2461/*
2562 * IO commands, issued by ublk server, and handled by ublk driver.
2663 *
......@@ -41,10 +78,23 @@
4178 * It is only used if ublksrv set UBLK_F_NEED_GET_DATA flag
4279 * while starting a ublk device.
4380 */
81
82/*
83 * Legacy IO command definition, don't use in new application, and don't
84 * add new such definition any more
85 */
4486#define UBLK_IO_FETCH_REQ 0x20
4587#define UBLK_IO_COMMIT_AND_FETCH_REQ 0x21
4688#define UBLK_IO_NEED_GET_DATA 0x22
4789
90/* Any new IO command should encode by __IOWR() */
91#define UBLK_U_IO_FETCH_REQ \
92 _IOWR('u', UBLK_IO_FETCH_REQ, struct ublksrv_io_cmd)
93#define UBLK_U_IO_COMMIT_AND_FETCH_REQ \
94 _IOWR('u', UBLK_IO_COMMIT_AND_FETCH_REQ, struct ublksrv_io_cmd)
95#define UBLK_U_IO_NEED_GET_DATA \
96 _IOWR('u', UBLK_IO_NEED_GET_DATA, struct ublksrv_io_cmd)
97
4898/* only ABORT means that no re-fetch */
4999#define UBLK_IO_RES_OK 0
50100#define UBLK_IO_RES_NEED_GET_DATA 1
......@@ -53,9 +103,29 @@
53103#define UBLKSRV_CMD_BUF_OFFSET 0
54104#define UBLKSRV_IO_BUF_OFFSET 0x80000000
55105
56/* tag bit is 12bit, so at most 4096 IOs for each queue */
106/* tag bit is 16bit, so far limit at most 4096 IOs for each queue */
57107#define UBLK_MAX_QUEUE_DEPTH 4096
58108
109/* single IO buffer max size is 32MB */
110#define UBLK_IO_BUF_OFF 0
111#define UBLK_IO_BUF_BITS 25
112#define UBLK_IO_BUF_BITS_MASK ((1ULL << UBLK_IO_BUF_BITS) - 1)
113
114/* so at most 64K IOs for each queue */
115#define UBLK_TAG_OFF UBLK_IO_BUF_BITS
116#define UBLK_TAG_BITS 16
117#define UBLK_TAG_BITS_MASK ((1ULL << UBLK_TAG_BITS) - 1)
118
119/* max 4096 queues */
120#define UBLK_QID_OFF (UBLK_TAG_OFF + UBLK_TAG_BITS)
121#define UBLK_QID_BITS 12
122#define UBLK_QID_BITS_MASK ((1ULL << UBLK_QID_BITS) - 1)
123
124#define UBLK_MAX_NR_QUEUES (1U << UBLK_QID_BITS)
125
126#define UBLKSRV_IO_BUF_TOTAL_BITS (UBLK_QID_OFF + UBLK_QID_BITS)
127#define UBLKSRV_IO_BUF_TOTAL_SIZE (1ULL << UBLKSRV_IO_BUF_TOTAL_BITS)
128
59129/*
60130 * zero copy requires 4k block size, and can remap ublk driver's io
61131 * request into ublksrv's vm space
......@@ -102,6 +172,18 @@
102172 */
103173#define UBLK_F_UNPRIVILEGED_DEV (1UL << 5)
104174
175/* use ioctl encoding for uring command */
176#define UBLK_F_CMD_IOCTL_ENCODE (1UL << 6)
177
178/* Copy between request and user buffer by pread()/pwrite() */
179#define UBLK_F_USER_COPY (1UL << 7)
180
181/*
182 * User space sets this flag when setting up the device to request zoned storage support. Kernel may
183 * deny the request by returning an error.
184 */
185#define UBLK_F_ZONED (1ULL << 8)
186
105187/* device state */
106188#define UBLK_S_DEV_DEAD 0
107189#define UBLK_S_DEV_LIVE 1
......@@ -158,9 +240,27 @@ struct ublksrv_ctrl_dev_info {
158240#define UBLK_IO_OP_READ 0
159241#define UBLK_IO_OP_WRITE 1
160242#define UBLK_IO_OP_FLUSH 2
161#define UBLK_IO_OP_DISCARD 3
162#define UBLK_IO_OP_WRITE_SAME 4
163#define UBLK_IO_OP_WRITE_ZEROES 5
243#define UBLK_IO_OP_DISCARD 3
244#define UBLK_IO_OP_WRITE_SAME 4
245#define UBLK_IO_OP_WRITE_ZEROES 5
246#define UBLK_IO_OP_ZONE_OPEN 10
247#define UBLK_IO_OP_ZONE_CLOSE 11
248#define UBLK_IO_OP_ZONE_FINISH 12
249#define UBLK_IO_OP_ZONE_APPEND 13
250#define UBLK_IO_OP_ZONE_RESET_ALL 14
251#define UBLK_IO_OP_ZONE_RESET 15
252/*
253 * Construct a zone report. The report request is carried in `struct
254 * ublksrv_io_desc`. The `start_sector` field must be the first sector of a zone
255 * and shall indicate the first zone of the report. The `nr_zones` shall
256 * indicate how many zones should be reported at most. The report shall be
257 * delivered as a `struct blk_zone` array. To report fewer zones than requested,
258 * zero the last entry of the returned array.
259 *
260 * Related definitions(blk_zone, blk_zone_cond, blk_zone_type, ...) in
261 * include/uapi/linux/blkzoned.h are part of ublk UAPI.
262 */
263#define UBLK_IO_OP_REPORT_ZONES 18
164264
165265#define UBLK_IO_F_FAILFAST_DEV (1U << 8)
166266#define UBLK_IO_F_FAILFAST_TRANSPORT (1U << 9)
......@@ -181,7 +281,10 @@ struct ublksrv_io_desc {
181281 /* op: bit 0-7, flags: bit 8-31 */
182282 __u32 op_flags;
183283
184 __u32 nr_sectors;
284 union {
285 __u32 nr_sectors;
286 __u32 nr_zones; /* for UBLK_IO_OP_REPORT_ZONES */
287 };
185288
186289 /* start sector for this io */
187290 __u64 start_sector;
......@@ -210,11 +313,21 @@ struct ublksrv_io_cmd {
210313 /* io result, it is valid for COMMIT* command only */
211314 __s32 result;
212315
213 /*
214 * userspace buffer address in ublksrv daemon process, valid for
215 * FETCH* command only
216 */
217 __u64 addr;
316 union {
317 /*
318 * userspace buffer address in ublksrv daemon process, valid for
319 * FETCH* command only
320 *
321 * `addr` should not be used when UBLK_F_USER_COPY is enabled,
322 * because userspace handles data copy by pread()/pwrite() over
323 * /dev/ublkcN. But in case of UBLK_F_ZONED, this union is
324 * re-used to pass back the allocated LBA for
325 * UBLK_IO_OP_ZONE_APPEND which actually depends on
326 * UBLK_F_USER_COPY
327 */
328 __u64 addr;
329 __u64 zone_append_lba;
330 };
218331};
219332
220333struct ublk_param_basic {
......@@ -257,6 +370,13 @@ struct ublk_param_devt {
257370 __u32 disk_minor;
258371};
259372
373struct ublk_param_zoned {
374 __u32 max_open_zones;
375 __u32 max_active_zones;
376 __u32 max_zone_append_sectors;
377 __u8 reserved[20];
378};
379
260380struct ublk_params {
261381 /*
262382 * Total length of parameters, userspace has to set 'len' for both
......@@ -268,11 +388,13 @@ struct ublk_params {
268388#define UBLK_PARAM_TYPE_BASIC (1 << 0)
269389#define UBLK_PARAM_TYPE_DISCARD (1 << 1)
270390#define UBLK_PARAM_TYPE_DEVT (1 << 2)
391#define UBLK_PARAM_TYPE_ZONED (1 << 3)
271392 __u32 types; /* types of parameter included */
272393
273394 struct ublk_param_basic basic;
274395 struct ublk_param_discard discard;
275396 struct ublk_param_devt devt;
397 struct ublk_param_zoned zoned;
276398};
277399
278400#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/udp.h+1-1
......@@ -36,7 +36,7 @@ struct udphdr {
3636#define UDP_GRO 104 /* This socket can receive UDP GRO packets */
3737
3838/* UDP encapsulation types */
39#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
39#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* unused draft-ietf-ipsec-nat-t-ike-00/01 */
4040#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
4141#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
4242#define UDP_ENCAP_GTP0 4 /* GSM TS 09.60 */
lib/libc/include/any-linux-any/linux/usb/ch11.h+2-4
......@@ -15,10 +15,8 @@
1515/* This is arbitrary.
1616 * From USB 2.0 spec Table 11-13, offset 7, a hub can
1717 * have up to 255 ports. The most yet reported is 10.
18 *
19 * Current Wireless USB host hardware (Intel i1480 for example) allows
20 * up to 22 devices to connect. Upcoming hardware might raise that
21 * limit. Because the arrays need to add a bit for hub status data, we
18 * Upcoming hardware might raise that limit.
19 * Because the arrays need to add a bit for hub status data, we
2220 * use 31, so plus one evens out to four bytes.
2321 */
2422#define USB_MAXCHILDREN 31
lib/libc/include/any-linux-any/linux/usb/ch9.h+12-6
......@@ -3,7 +3,7 @@
33 * This file holds USB constants and structures that are needed for
44 * USB device APIs. These are used by the USB device model, which is
55 * defined in chapter 9 of the USB 2.0 specification and in the
6 * Wireless USB 1.0 (spread around). Linux has several APIs in C that
6 * Wireless USB 1.0 spec (now defunct). Linux has several APIs in C that
77 * need these:
88 *
99 * - the master/host side Linux-USB kernel driver API;
......@@ -14,9 +14,6 @@
1414 * act either as a USB master/host or as a USB slave/device. That means
1515 * the master and slave side APIs benefit from working well together.
1616 *
17 * There's also "Wireless USB", using low power short range radios for
18 * peripheral interconnection but otherwise building on the USB framework.
19 *
2017 * Note all descriptors are declared '__attribute__((packed))' so that:
2118 *
2219 * [a] they never get padded, either internally (USB spec writers
......@@ -376,7 +373,10 @@ struct usb_string_descriptor {
376373 __u8 bLength;
377374 __u8 bDescriptorType;
378375
379 __le16 wData[1]; /* UTF-16LE encoded */
376 union {
377 __le16 legacy_padding;
378 __DECLARE_FLEX_ARRAY(__le16, wData); /* UTF-16LE encoded */
379 };
380380} __attribute__ ((packed));
381381
382382/* note that "string" zero is special, it holds language codes that
......@@ -763,6 +763,8 @@ struct usb_otg20_descriptor {
763763#define USB_OTG_SRP (1 << 0)
764764#define USB_OTG_HNP (1 << 1) /* swap host/device roles */
765765#define USB_OTG_ADP (1 << 2) /* support ADP */
766/* OTG 3.0 */
767#define USB_OTG_RSP (1 << 3) /* support RSP */
766768
767769#define OTG_STS_SELECTOR 0xF000 /* OTG status selector */
768770/*-------------------------------------------------------------------------*/
......@@ -981,7 +983,11 @@ struct usb_ssp_cap_descriptor {
981983#define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8)
982984#define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12)
983985 __le16 wReserved;
984 __le32 bmSublinkSpeedAttr[1]; /* list of sublink speed attrib entries */
986 union {
987 __le32 legacy_padding;
988 /* list of sublink speed attrib entries */
989 __DECLARE_FLEX_ARRAY(__le32, bmSublinkSpeedAttr);
990 };
985991#define USB_SSP_SUBLINK_SPEED_SSID (0xf) /* sublink speed ID */
986992#define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4) /* Lanespeed exponent */
987993#define USB_SSP_SUBLINK_SPEED_LSE_BPS 0
lib/libc/include/any-linux-any/linux/usb/functionfs.h+45-2
......@@ -73,8 +73,10 @@ struct usb_os_desc_header {
7373struct usb_ext_compat_desc {
7474 __u8 bFirstInterfaceNumber;
7575 __u8 Reserved1;
76 __u8 CompatibleID[8];
77 __u8 SubCompatibleID[8];
76 __struct_group(/* no tag */, IDs, /* no attrs */,
77 __u8 CompatibleID[8];
78 __u8 SubCompatibleID[8];
79 );
7880 __u8 Reserved2[6];
7981};
8082
......@@ -84,6 +86,22 @@ struct usb_ext_prop_desc {
8486 __le16 wPropertyNameLength;
8587} __attribute__((packed));
8688
89/* Flags for usb_ffs_dmabuf_transfer_req->flags (none for now) */
90#define USB_FFS_DMABUF_TRANSFER_MASK 0x0
91
92/**
93 * struct usb_ffs_dmabuf_transfer_req - Transfer request for a DMABUF object
94 * @fd: file descriptor of the DMABUF object
95 * @flags: one or more USB_FFS_DMABUF_TRANSFER_* flags
96 * @length: number of bytes used in this DMABUF for the data transfer.
97 * Should generally be set to the DMABUF's size.
98 */
99struct usb_ffs_dmabuf_transfer_req {
100 int fd;
101 __u32 flags;
102 __u64 length;
103} __attribute__((packed));
104
87105
88106/*
89107 * Descriptors format:
......@@ -286,6 +304,31 @@ struct usb_functionfs_event {
286304#define FUNCTIONFS_ENDPOINT_DESC _IOR('g', 130, \
287305 struct usb_endpoint_descriptor)
288306
307/*
308 * Attach the DMABUF object, identified by its file descriptor, to the
309 * data endpoint. Returns zero on success, and a negative errno value
310 * on error.
311 */
312#define FUNCTIONFS_DMABUF_ATTACH _IOW('g', 131, int)
313
314
315/*
316 * Detach the given DMABUF object, identified by its file descriptor,
317 * from the data endpoint. Returns zero on success, and a negative
318 * errno value on error. Note that closing the endpoint's file
319 * descriptor will automatically detach all attached DMABUFs.
320 */
321#define FUNCTIONFS_DMABUF_DETACH _IOW('g', 132, int)
289322
323/*
324 * Enqueue the previously attached DMABUF to the transfer queue.
325 * The argument is a structure that packs the DMABUF's file descriptor,
326 * the size in bytes to transfer (which should generally correspond to
327 * the size of the DMABUF), and a 'flags' field which is unused
328 * for now. Returns zero on success, and a negative errno value on
329 * error.
330 */
331#define FUNCTIONFS_DMABUF_TRANSFER _IOW('g', 133, \
332 struct usb_ffs_dmabuf_transfer_req)
290333
291334#endif /* __LINUX_FUNCTIONFS_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/raw_gadget.h+12-2
......@@ -44,6 +44,16 @@ enum usb_raw_event_type {
4444 /* This event is queued when a new control request arrived to ep0. */
4545 USB_RAW_EVENT_CONTROL = 2,
4646
47 /*
48 * These events are queued when the gadget driver is suspended,
49 * resumed, reset, or disconnected. Note that some UDCs (e.g. dwc2)
50 * report a disconnect event instead of a reset.
51 */
52 USB_RAW_EVENT_SUSPEND = 3,
53 USB_RAW_EVENT_RESUME = 4,
54 USB_RAW_EVENT_RESET = 5,
55 USB_RAW_EVENT_DISCONNECT = 6,
56
4757 /* The list might grow in the future. */
4858};
4959
......@@ -54,8 +64,8 @@ enum usb_raw_event_type {
5464 * actual length of the fetched event data.
5565 * @data: A buffer to store the fetched event data.
5666 *
57 * Currently the fetched data buffer is empty for USB_RAW_EVENT_CONNECT,
58 * and contains struct usb_ctrlrequest for USB_RAW_EVENT_CONTROL.
67 * The fetched event data buffer contains struct usb_ctrlrequest for
68 * USB_RAW_EVENT_CONTROL and is empty for other events.
5969 */
6070struct usb_raw_event {
6171 __u32 type;
lib/libc/include/any-linux-any/linux/user_events.h created+94
......@@ -0,0 +1,94 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2021-2022, Microsoft Corporation.
4 *
5 * Authors:
6 * Beau Belgrave <beaub@linux.microsoft.com>
7 */
8#ifndef _LINUX_USER_EVENTS_H
9#define _LINUX_USER_EVENTS_H
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14#define USER_EVENTS_SYSTEM "user_events"
15#define USER_EVENTS_MULTI_SYSTEM "user_events_multi"
16#define USER_EVENTS_PREFIX "u:"
17
18/* Create dynamic location entry within a 32-bit value */
19#define DYN_LOC(offset, size) ((size) << 16 | (offset))
20
21/* List of supported registration flags */
22enum user_reg_flag {
23 /* Event will not delete upon last reference closing */
24 USER_EVENT_REG_PERSIST = 1U << 0,
25
26 /* Event will be allowed to have multiple formats */
27 USER_EVENT_REG_MULTI_FORMAT = 1U << 1,
28
29 /* This value or above is currently non-ABI */
30 USER_EVENT_REG_MAX = 1U << 2,
31};
32
33/*
34 * Describes an event registration and stores the results of the registration.
35 * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum
36 * must set the size and name_args before invocation.
37 */
38struct user_reg {
39
40 /* Input: Size of the user_reg structure being used */
41 __u32 size;
42
43 /* Input: Bit in enable address to use */
44 __u8 enable_bit;
45
46 /* Input: Enable size in bytes at address */
47 __u8 enable_size;
48
49 /* Input: Flags to use, if any */
50 __u16 flags;
51
52 /* Input: Address to update when enabled */
53 __u64 enable_addr;
54
55 /* Input: Pointer to string with event name, description and flags */
56 __u64 name_args;
57
58 /* Output: Index of the event to use when writing data */
59 __u32 write_index;
60} __attribute__((__packed__));
61
62/*
63 * Describes an event unregister, callers must set the size, address and bit.
64 * This structure is passed to the DIAG_IOCSUNREG ioctl to disable bit updates.
65 */
66struct user_unreg {
67 /* Input: Size of the user_unreg structure being used */
68 __u32 size;
69
70 /* Input: Bit to unregister */
71 __u8 disable_bit;
72
73 /* Input: Reserved, set to 0 */
74 __u8 __reserved;
75
76 /* Input: Reserved, set to 0 */
77 __u16 __reserved2;
78
79 /* Input: Address to unregister */
80 __u64 disable_addr;
81} __attribute__((__packed__));
82
83#define DIAG_IOC_MAGIC '*'
84
85/* Request to register a user_event */
86#define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg *)
87
88/* Request to delete a user_event */
89#define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char *)
90
91/* Requests to unregister a user_event */
92#define DIAG_IOCSUNREG _IOW(DIAG_IOC_MAGIC, 2, struct user_unreg*)
93
94#endif /* _LINUX_USER_EVENTS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/userfaultfd.h+71-3
......@@ -38,7 +38,11 @@
3838 UFFD_FEATURE_MINOR_HUGETLBFS | \
3939 UFFD_FEATURE_MINOR_SHMEM | \
4040 UFFD_FEATURE_EXACT_ADDRESS | \
41 UFFD_FEATURE_WP_HUGETLBFS_SHMEM)
41 UFFD_FEATURE_WP_HUGETLBFS_SHMEM | \
42 UFFD_FEATURE_WP_UNPOPULATED | \
43 UFFD_FEATURE_POISON | \
44 UFFD_FEATURE_WP_ASYNC | \
45 UFFD_FEATURE_MOVE)
4246#define UFFD_API_IOCTLS \
4347 ((__u64)1 << _UFFDIO_REGISTER | \
4448 (__u64)1 << _UFFDIO_UNREGISTER | \
......@@ -47,13 +51,16 @@
4751 ((__u64)1 << _UFFDIO_WAKE | \
4852 (__u64)1 << _UFFDIO_COPY | \
4953 (__u64)1 << _UFFDIO_ZEROPAGE | \
54 (__u64)1 << _UFFDIO_MOVE | \
5055 (__u64)1 << _UFFDIO_WRITEPROTECT | \
51 (__u64)1 << _UFFDIO_CONTINUE)
56 (__u64)1 << _UFFDIO_CONTINUE | \
57 (__u64)1 << _UFFDIO_POISON)
5258#define UFFD_API_RANGE_IOCTLS_BASIC \
5359 ((__u64)1 << _UFFDIO_WAKE | \
5460 (__u64)1 << _UFFDIO_COPY | \
61 (__u64)1 << _UFFDIO_WRITEPROTECT | \
5562 (__u64)1 << _UFFDIO_CONTINUE | \
56 (__u64)1 << _UFFDIO_WRITEPROTECT)
63 (__u64)1 << _UFFDIO_POISON)
5764
5865/*
5966 * Valid ioctl command number range with this API is from 0x00 to
......@@ -68,8 +75,10 @@
6875#define _UFFDIO_WAKE (0x02)
6976#define _UFFDIO_COPY (0x03)
7077#define _UFFDIO_ZEROPAGE (0x04)
78#define _UFFDIO_MOVE (0x05)
7179#define _UFFDIO_WRITEPROTECT (0x06)
7280#define _UFFDIO_CONTINUE (0x07)
81#define _UFFDIO_POISON (0x08)
7382#define _UFFDIO_API (0x3F)
7483
7584/* userfaultfd ioctl ids */
......@@ -86,10 +95,14 @@
8695 struct uffdio_copy)
8796#define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \
8897 struct uffdio_zeropage)
98#define UFFDIO_MOVE _IOWR(UFFDIO, _UFFDIO_MOVE, \
99 struct uffdio_move)
89100#define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
90101 struct uffdio_writeprotect)
91102#define UFFDIO_CONTINUE _IOWR(UFFDIO, _UFFDIO_CONTINUE, \
92103 struct uffdio_continue)
104#define UFFDIO_POISON _IOWR(UFFDIO, _UFFDIO_POISON, \
105 struct uffdio_poison)
93106
94107/* read() structure */
95108struct uffd_msg {
......@@ -203,6 +216,20 @@ struct uffdio_api {
203216 *
204217 * UFFD_FEATURE_WP_HUGETLBFS_SHMEM indicates that userfaultfd
205218 * write-protection mode is supported on both shmem and hugetlbfs.
219 *
220 * UFFD_FEATURE_WP_UNPOPULATED indicates that userfaultfd
221 * write-protection mode will always apply to unpopulated pages
222 * (i.e. empty ptes). This will be the default behavior for shmem
223 * & hugetlbfs, so this flag only affects anonymous memory behavior
224 * when userfault write-protection mode is registered.
225 *
226 * UFFD_FEATURE_WP_ASYNC indicates that userfaultfd write-protection
227 * asynchronous mode is supported in which the write fault is
228 * automatically resolved and write-protection is un-set.
229 * It implies UFFD_FEATURE_WP_UNPOPULATED.
230 *
231 * UFFD_FEATURE_MOVE indicates that the kernel supports moving an
232 * existing page contents from userspace.
206233 */
207234#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
208235#define UFFD_FEATURE_EVENT_FORK (1<<1)
......@@ -217,6 +244,10 @@ struct uffdio_api {
217244#define UFFD_FEATURE_MINOR_SHMEM (1<<10)
218245#define UFFD_FEATURE_EXACT_ADDRESS (1<<11)
219246#define UFFD_FEATURE_WP_HUGETLBFS_SHMEM (1<<12)
247#define UFFD_FEATURE_WP_UNPOPULATED (1<<13)
248#define UFFD_FEATURE_POISON (1<<14)
249#define UFFD_FEATURE_WP_ASYNC (1<<15)
250#define UFFD_FEATURE_MOVE (1<<16)
220251 __u64 features;
221252
222253 __u64 ioctls;
......@@ -297,6 +328,13 @@ struct uffdio_writeprotect {
297328struct uffdio_continue {
298329 struct uffdio_range range;
299330#define UFFDIO_CONTINUE_MODE_DONTWAKE ((__u64)1<<0)
331 /*
332 * UFFDIO_CONTINUE_MODE_WP will map the page write protected on
333 * the fly. UFFDIO_CONTINUE_MODE_WP is available only if the
334 * write protected ioctl is implemented for the range
335 * according to the uffdio_register.ioctls.
336 */
337#define UFFDIO_CONTINUE_MODE_WP ((__u64)1<<1)
300338 __u64 mode;
301339
302340 /*
......@@ -306,6 +344,36 @@ struct uffdio_continue {
306344 __s64 mapped;
307345};
308346
347struct uffdio_poison {
348 struct uffdio_range range;
349#define UFFDIO_POISON_MODE_DONTWAKE ((__u64)1<<0)
350 __u64 mode;
351
352 /*
353 * Fields below here are written by the ioctl and must be at the end:
354 * the copy_from_user will not read past here.
355 */
356 __s64 updated;
357};
358
359struct uffdio_move {
360 __u64 dst;
361 __u64 src;
362 __u64 len;
363 /*
364 * Especially if used to atomically remove memory from the
365 * address space the wake on the dst range is not needed.
366 */
367#define UFFDIO_MOVE_MODE_DONTWAKE ((__u64)1<<0)
368#define UFFDIO_MOVE_MODE_ALLOW_SRC_HOLES ((__u64)1<<1)
369 __u64 mode;
370 /*
371 * "move" is written by the ioctl and must be at the end: the
372 * copy_from_user will not read the last 8 bytes.
373 */
374 __s64 move;
375};
376
309377/*
310378 * Flags for the userfaultfd(2) system call itself.
311379 */
lib/libc/include/any-linux-any/linux/uuid.h+1-30
......@@ -1,30 +1 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* DO NOT USE in new code! This is solely for MEI due to legacy reasons */
3/*
4 * MEI UUID definition
5 *
6 * Copyright (C) 2010, Intel Corp.
7 * Huang Ying <ying.huang@intel.com>
8 */
9
10#ifndef _LINUX_UUID_H_
11#define _LINUX_UUID_H_
12
13#include <linux/types.h>
14
15typedef struct {
16 __u8 b[16];
17} uuid_le;
18
19#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
20((uuid_le) \
21{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
22 (b) & 0xff, ((b) >> 8) & 0xff, \
23 (c) & 0xff, ((c) >> 8) & 0xff, \
24 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
25
26#define NULL_UUID_LE \
27 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
28 0x00, 0x00, 0x00, 0x00)
29
30#endif /* _LINUX_UUID_H_ */
\ No newline at end of file
1#include <linux/mei_uuid.h>
\ No newline at end of file
lib/libc/include/any-linux-any/linux/v4l2-controls.h+738-1
......@@ -201,6 +201,18 @@ enum v4l2_colorfx {
201201 */
202202#define V4L2_CID_USER_ASPEED_BASE (V4L2_CID_USER_BASE + 0x11a0)
203203
204/*
205 * The base for Nuvoton NPCM driver controls.
206 * We reserve 16 controls for this driver.
207 */
208#define V4L2_CID_USER_NPCM_BASE (V4L2_CID_USER_BASE + 0x11b0)
209
210/*
211 * The base for THine THP7312 driver controls.
212 * We reserve 32 controls for this driver.
213 */
214#define V4L2_CID_USER_THP7312_BASE (V4L2_CID_USER_BASE + 0x11c0)
215
204216/* MPEG-class control IDs */
205217/* The MPEG controls are applicable to all codec controls
206218 * and the 'MPEG' part of the define is historical */
......@@ -800,6 +812,88 @@ enum v4l2_mpeg_video_frame_skip_mode {
800812#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653)
801813#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654)
802814
815#define V4L2_CID_MPEG_VIDEO_AV1_PROFILE (V4L2_CID_CODEC_BASE + 655)
816/**
817 * enum v4l2_mpeg_video_av1_profile - AV1 profiles
818 *
819 * @V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN: compliant decoders must be able to decode
820 * streams with seq_profile equal to 0.
821 * @V4L2_MPEG_VIDEO_AV1_PROFILE_HIGH: compliant decoders must be able to decode
822 * streams with seq_profile equal less than or equal to 1.
823 * @V4L2_MPEG_VIDEO_AV1_PROFILE_PROFESSIONAL: compliant decoders must be able to
824 * decode streams with seq_profile less than or equal to 2.
825 *
826 * Conveys the highest profile a decoder can work with.
827 */
828enum v4l2_mpeg_video_av1_profile {
829 V4L2_MPEG_VIDEO_AV1_PROFILE_MAIN = 0,
830 V4L2_MPEG_VIDEO_AV1_PROFILE_HIGH = 1,
831 V4L2_MPEG_VIDEO_AV1_PROFILE_PROFESSIONAL = 2,
832};
833
834#define V4L2_CID_MPEG_VIDEO_AV1_LEVEL (V4L2_CID_CODEC_BASE + 656)
835/**
836 * enum v4l2_mpeg_video_av1_level - AV1 levels
837 *
838 * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_0: Level 2.0.
839 * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_1: Level 2.1.
840 * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_2: Level 2.2.
841 * @V4L2_MPEG_VIDEO_AV1_LEVEL_2_3: Level 2.3.
842 * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_0: Level 3.0.
843 * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_1: Level 3.1.
844 * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_2: Level 3.2.
845 * @V4L2_MPEG_VIDEO_AV1_LEVEL_3_3: Level 3.3.
846 * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_0: Level 4.0.
847 * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_1: Level 4.1.
848 * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_2: Level 4.2.
849 * @V4L2_MPEG_VIDEO_AV1_LEVEL_4_3: Level 4.3.
850 * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_0: Level 5.0.
851 * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_1: Level 5.1.
852 * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_2: Level 5.2.
853 * @V4L2_MPEG_VIDEO_AV1_LEVEL_5_3: Level 5.3.
854 * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_0: Level 6.0.
855 * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_1: Level 6.1.
856 * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_2: Level 6.2.
857 * @V4L2_MPEG_VIDEO_AV1_LEVEL_6_3: Level 6.3.
858 * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_0: Level 7.0.
859 * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_1: Level 7.1.
860 * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_2: Level 7.2.
861 * @V4L2_MPEG_VIDEO_AV1_LEVEL_7_3: Level 7.3.
862 *
863 * Conveys the highest level a decoder can work with.
864 */
865enum v4l2_mpeg_video_av1_level {
866 V4L2_MPEG_VIDEO_AV1_LEVEL_2_0 = 0,
867 V4L2_MPEG_VIDEO_AV1_LEVEL_2_1 = 1,
868 V4L2_MPEG_VIDEO_AV1_LEVEL_2_2 = 2,
869 V4L2_MPEG_VIDEO_AV1_LEVEL_2_3 = 3,
870
871 V4L2_MPEG_VIDEO_AV1_LEVEL_3_0 = 4,
872 V4L2_MPEG_VIDEO_AV1_LEVEL_3_1 = 5,
873 V4L2_MPEG_VIDEO_AV1_LEVEL_3_2 = 6,
874 V4L2_MPEG_VIDEO_AV1_LEVEL_3_3 = 7,
875
876 V4L2_MPEG_VIDEO_AV1_LEVEL_4_0 = 8,
877 V4L2_MPEG_VIDEO_AV1_LEVEL_4_1 = 9,
878 V4L2_MPEG_VIDEO_AV1_LEVEL_4_2 = 10,
879 V4L2_MPEG_VIDEO_AV1_LEVEL_4_3 = 11,
880
881 V4L2_MPEG_VIDEO_AV1_LEVEL_5_0 = 12,
882 V4L2_MPEG_VIDEO_AV1_LEVEL_5_1 = 13,
883 V4L2_MPEG_VIDEO_AV1_LEVEL_5_2 = 14,
884 V4L2_MPEG_VIDEO_AV1_LEVEL_5_3 = 15,
885
886 V4L2_MPEG_VIDEO_AV1_LEVEL_6_0 = 16,
887 V4L2_MPEG_VIDEO_AV1_LEVEL_6_1 = 17,
888 V4L2_MPEG_VIDEO_AV1_LEVEL_6_2 = 18,
889 V4L2_MPEG_VIDEO_AV1_LEVEL_6_3 = 19,
890
891 V4L2_MPEG_VIDEO_AV1_LEVEL_7_0 = 20,
892 V4L2_MPEG_VIDEO_AV1_LEVEL_7_1 = 21,
893 V4L2_MPEG_VIDEO_AV1_LEVEL_7_2 = 22,
894 V4L2_MPEG_VIDEO_AV1_LEVEL_7_3 = 23
895};
896
803897/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
804898#define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000)
805899#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0)
......@@ -2381,6 +2475,9 @@ struct v4l2_ctrl_hevc_slice_params {
23812475 * @poc_st_curr_after: provides the index of the short term after references
23822476 * in DPB array
23832477 * @poc_lt_curr: provides the index of the long term references in DPB array
2478 * @num_delta_pocs_of_ref_rps_idx: same as the derived value NumDeltaPocs[RefRpsIdx],
2479 * can be used to parse the RPS data in slice headers
2480 * instead of skipping it with @short_term_ref_pic_set_size.
23842481 * @reserved: padding field. Should be zeroed by applications.
23852482 * @dpb: the decoded picture buffer, for meta-data about reference frames
23862483 * @flags: see V4L2_HEVC_DECODE_PARAM_FLAG_{}
......@@ -2396,7 +2493,8 @@ struct v4l2_ctrl_hevc_decode_params {
23962493 __u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
23972494 __u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
23982495 __u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2399 __u8 reserved[4];
2496 __u8 num_delta_pocs_of_ref_rps_idx;
2497 __u8 reserved[3];
24002498 struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
24012499 __u64 flags;
24022500};
......@@ -2750,6 +2848,645 @@ struct v4l2_ctrl_vp9_compressed_hdr {
27502848 struct v4l2_vp9_mv_probs mv;
27512849};
27522850
2851/* Stateless AV1 controls */
2852
2853#define V4L2_AV1_TOTAL_REFS_PER_FRAME 8
2854#define V4L2_AV1_CDEF_MAX 8
2855#define V4L2_AV1_NUM_PLANES_MAX 3 /* 1 if monochrome, 3 otherwise */
2856#define V4L2_AV1_MAX_SEGMENTS 8
2857#define V4L2_AV1_MAX_OPERATING_POINTS (1 << 5) /* 5 bits to encode */
2858#define V4L2_AV1_REFS_PER_FRAME 7
2859#define V4L2_AV1_MAX_NUM_Y_POINTS (1 << 4) /* 4 bits to encode */
2860#define V4L2_AV1_MAX_NUM_CB_POINTS (1 << 4) /* 4 bits to encode */
2861#define V4L2_AV1_MAX_NUM_CR_POINTS (1 << 4) /* 4 bits to encode */
2862#define V4L2_AV1_AR_COEFFS_SIZE 25 /* (2 * 3 * (3 + 1)) + 1 */
2863#define V4L2_AV1_MAX_NUM_PLANES 3
2864#define V4L2_AV1_MAX_TILE_COLS 64
2865#define V4L2_AV1_MAX_TILE_ROWS 64
2866#define V4L2_AV1_MAX_TILE_COUNT 512
2867
2868#define V4L2_AV1_SEQUENCE_FLAG_STILL_PICTURE 0x00000001
2869#define V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK 0x00000002
2870#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_FILTER_INTRA 0x00000004
2871#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTRA_EDGE_FILTER 0x00000008
2872#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_INTERINTRA_COMPOUND 0x00000010
2873#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND 0x00000020
2874#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_WARPED_MOTION 0x00000040
2875#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_DUAL_FILTER 0x00000080
2876#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_ORDER_HINT 0x00000100
2877#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_JNT_COMP 0x00000200
2878#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_REF_FRAME_MVS 0x00000400
2879#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_SUPERRES 0x00000800
2880#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF 0x00001000
2881#define V4L2_AV1_SEQUENCE_FLAG_ENABLE_RESTORATION 0x00002000
2882#define V4L2_AV1_SEQUENCE_FLAG_MONO_CHROME 0x00004000
2883#define V4L2_AV1_SEQUENCE_FLAG_COLOR_RANGE 0x00008000
2884#define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_X 0x00010000
2885#define V4L2_AV1_SEQUENCE_FLAG_SUBSAMPLING_Y 0x00020000
2886#define V4L2_AV1_SEQUENCE_FLAG_FILM_GRAIN_PARAMS_PRESENT 0x00040000
2887#define V4L2_AV1_SEQUENCE_FLAG_SEPARATE_UV_DELTA_Q 0x00080000
2888
2889#define V4L2_CID_STATELESS_AV1_SEQUENCE (V4L2_CID_CODEC_STATELESS_BASE + 500)
2890/**
2891 * struct v4l2_ctrl_av1_sequence - AV1 Sequence
2892 *
2893 * Represents an AV1 Sequence OBU. See section 5.5 "Sequence header OBU syntax"
2894 * for more details.
2895 *
2896 * @flags: See V4L2_AV1_SEQUENCE_FLAG_{}.
2897 * @seq_profile: specifies the features that can be used in the coded video
2898 * sequence.
2899 * @order_hint_bits: specifies the number of bits used for the order_hint field
2900 * at each frame.
2901 * @bit_depth: the bitdepth to use for the sequence as described in section
2902 * 5.5.2 "Color config syntax".
2903 * @reserved: padding field. Should be zeroed by applications.
2904 * @max_frame_width_minus_1: specifies the maximum frame width minus 1 for the
2905 * frames represented by this sequence header.
2906 * @max_frame_height_minus_1: specifies the maximum frame height minus 1 for the
2907 * frames represented by this sequence header.
2908 */
2909struct v4l2_ctrl_av1_sequence {
2910 __u32 flags;
2911 __u8 seq_profile;
2912 __u8 order_hint_bits;
2913 __u8 bit_depth;
2914 __u8 reserved;
2915 __u16 max_frame_width_minus_1;
2916 __u16 max_frame_height_minus_1;
2917};
2918
2919#define V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY (V4L2_CID_CODEC_STATELESS_BASE + 501)
2920/**
2921 * struct v4l2_ctrl_av1_tile_group_entry - AV1 Tile Group entry
2922 *
2923 * Represents a single AV1 tile inside an AV1 Tile Group. Note that MiRowStart,
2924 * MiRowEnd, MiColStart and MiColEnd can be retrieved from struct
2925 * v4l2_av1_tile_info in struct v4l2_ctrl_av1_frame using tile_row and
2926 * tile_col. See section 6.10.1 "General tile group OBU semantics" for more
2927 * details.
2928 *
2929 * @tile_offset: offset from the OBU data, i.e. where the coded tile data
2930 * actually starts.
2931 * @tile_size: specifies the size in bytes of the coded tile. Equivalent to
2932 * "TileSize" in the AV1 Specification.
2933 * @tile_row: specifies the row of the current tile. Equivalent to "TileRow" in
2934 * the AV1 Specification.
2935 * @tile_col: specifies the col of the current tile. Equivalent to "TileCol" in
2936 * the AV1 Specification.
2937 */
2938struct v4l2_ctrl_av1_tile_group_entry {
2939 __u32 tile_offset;
2940 __u32 tile_size;
2941 __u32 tile_row;
2942 __u32 tile_col;
2943};
2944
2945/**
2946 * enum v4l2_av1_warp_model - AV1 Warp Model as described in section 3
2947 * "Symbols and abbreviated terms" of the AV1 Specification.
2948 *
2949 * @V4L2_AV1_WARP_MODEL_IDENTITY: Warp model is just an identity transform.
2950 * @V4L2_AV1_WARP_MODEL_TRANSLATION: Warp model is a pure translation.
2951 * @V4L2_AV1_WARP_MODEL_ROTZOOM: Warp model is a rotation + symmetric zoom +
2952 * translation.
2953 * @V4L2_AV1_WARP_MODEL_AFFINE: Warp model is a general affine transform.
2954 */
2955enum v4l2_av1_warp_model {
2956 V4L2_AV1_WARP_MODEL_IDENTITY = 0,
2957 V4L2_AV1_WARP_MODEL_TRANSLATION = 1,
2958 V4L2_AV1_WARP_MODEL_ROTZOOM = 2,
2959 V4L2_AV1_WARP_MODEL_AFFINE = 3,
2960};
2961
2962/**
2963 * enum v4l2_av1_reference_frame - AV1 reference frames
2964 *
2965 * @V4L2_AV1_REF_INTRA_FRAME: Intra Frame Reference
2966 * @V4L2_AV1_REF_LAST_FRAME: Last Reference Frame
2967 * @V4L2_AV1_REF_LAST2_FRAME: Last2 Reference Frame
2968 * @V4L2_AV1_REF_LAST3_FRAME: Last3 Reference Frame
2969 * @V4L2_AV1_REF_GOLDEN_FRAME: Golden Reference Frame
2970 * @V4L2_AV1_REF_BWDREF_FRAME: BWD Reference Frame
2971 * @V4L2_AV1_REF_ALTREF2_FRAME: Alternative2 Reference Frame
2972 * @V4L2_AV1_REF_ALTREF_FRAME: Alternative Reference Frame
2973 */
2974enum v4l2_av1_reference_frame {
2975 V4L2_AV1_REF_INTRA_FRAME = 0,
2976 V4L2_AV1_REF_LAST_FRAME = 1,
2977 V4L2_AV1_REF_LAST2_FRAME = 2,
2978 V4L2_AV1_REF_LAST3_FRAME = 3,
2979 V4L2_AV1_REF_GOLDEN_FRAME = 4,
2980 V4L2_AV1_REF_BWDREF_FRAME = 5,
2981 V4L2_AV1_REF_ALTREF2_FRAME = 6,
2982 V4L2_AV1_REF_ALTREF_FRAME = 7,
2983};
2984
2985#define V4L2_AV1_GLOBAL_MOTION_IS_INVALID(ref) (1 << (ref))
2986
2987#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_GLOBAL 0x1
2988#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_ROT_ZOOM 0x2
2989#define V4L2_AV1_GLOBAL_MOTION_FLAG_IS_TRANSLATION 0x4
2990/**
2991 * struct v4l2_av1_global_motion - AV1 Global Motion parameters as described in
2992 * section 6.8.17 "Global motion params semantics" of the AV1 specification.
2993 *
2994 * @flags: A bitfield containing the flags per reference frame. See
2995 * V4L2_AV1_GLOBAL_MOTION_FLAG_{}
2996 * @type: The type of global motion transform used.
2997 * @params: this field has the same meaning as "gm_params" in the AV1
2998 * specification.
2999 * @invalid: bitfield indicating whether the global motion params are invalid
3000 * for a given reference frame. See section 7.11.3.6 Setup shear process and
3001 * the variable "warpValid". Use V4L2_AV1_GLOBAL_MOTION_IS_INVALID(ref) to
3002 * create a suitable mask.
3003 * @reserved: padding field. Should be zeroed by applications.
3004 */
3005
3006struct v4l2_av1_global_motion {
3007 __u8 flags[V4L2_AV1_TOTAL_REFS_PER_FRAME];
3008 enum v4l2_av1_warp_model type[V4L2_AV1_TOTAL_REFS_PER_FRAME];
3009 __s32 params[V4L2_AV1_TOTAL_REFS_PER_FRAME][6];
3010 __u8 invalid;
3011 __u8 reserved[3];
3012};
3013
3014/**
3015 * enum v4l2_av1_frame_restoration_type - AV1 Frame Restoration Type
3016 * @V4L2_AV1_FRAME_RESTORE_NONE: no filtering is applied.
3017 * @V4L2_AV1_FRAME_RESTORE_WIENER: Wiener filter process is invoked.
3018 * @V4L2_AV1_FRAME_RESTORE_SGRPROJ: self guided filter process is invoked.
3019 * @V4L2_AV1_FRAME_RESTORE_SWITCHABLE: restoration filter is swichtable.
3020 */
3021enum v4l2_av1_frame_restoration_type {
3022 V4L2_AV1_FRAME_RESTORE_NONE = 0,
3023 V4L2_AV1_FRAME_RESTORE_WIENER = 1,
3024 V4L2_AV1_FRAME_RESTORE_SGRPROJ = 2,
3025 V4L2_AV1_FRAME_RESTORE_SWITCHABLE = 3,
3026};
3027
3028#define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_LR 0x1
3029#define V4L2_AV1_LOOP_RESTORATION_FLAG_USES_CHROMA_LR 0x2
3030
3031/**
3032 * struct v4l2_av1_loop_restoration - AV1 Loop Restauration as described in
3033 * section 6.10.15 "Loop restoration params semantics" of the AV1 specification.
3034 *
3035 * @flags: See V4L2_AV1_LOOP_RESTORATION_FLAG_{}.
3036 * @lr_unit_shift: specifies if the luma restoration size should be halved.
3037 * @lr_uv_shift: specifies if the chroma size should be half the luma size.
3038 * @reserved: padding field. Should be zeroed by applications.
3039 * @frame_restoration_type: specifies the type of restoration used for each
3040 * plane. See enum v4l2_av1_frame_restoration_type.
3041 * @loop_restoration_size: specifies the size of loop restoration units in units
3042 * of samples in the current plane.
3043 */
3044struct v4l2_av1_loop_restoration {
3045 __u8 flags;
3046 __u8 lr_unit_shift;
3047 __u8 lr_uv_shift;
3048 __u8 reserved;
3049 enum v4l2_av1_frame_restoration_type frame_restoration_type[V4L2_AV1_NUM_PLANES_MAX];
3050 __u32 loop_restoration_size[V4L2_AV1_MAX_NUM_PLANES];
3051};
3052
3053/**
3054 * struct v4l2_av1_cdef - AV1 CDEF params semantics as described in section
3055 * 6.10.14 "CDEF params semantics" of the AV1 specification
3056 *
3057 * @damping_minus_3: controls the amount of damping in the deringing filter.
3058 * @bits: specifies the number of bits needed to specify which CDEF filter to
3059 * apply.
3060 * @y_pri_strength: specifies the strength of the primary filter.
3061 * @y_sec_strength: specifies the strength of the secondary filter.
3062 * @uv_pri_strength: specifies the strength of the primary filter.
3063 * @uv_sec_strength: specifies the strength of the secondary filter.
3064 */
3065struct v4l2_av1_cdef {
3066 __u8 damping_minus_3;
3067 __u8 bits;
3068 __u8 y_pri_strength[V4L2_AV1_CDEF_MAX];
3069 __u8 y_sec_strength[V4L2_AV1_CDEF_MAX];
3070 __u8 uv_pri_strength[V4L2_AV1_CDEF_MAX];
3071 __u8 uv_sec_strength[V4L2_AV1_CDEF_MAX];
3072};
3073
3074#define V4L2_AV1_SEGMENTATION_FLAG_ENABLED 0x1
3075#define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_MAP 0x2
3076#define V4L2_AV1_SEGMENTATION_FLAG_TEMPORAL_UPDATE 0x4
3077#define V4L2_AV1_SEGMENTATION_FLAG_UPDATE_DATA 0x8
3078#define V4L2_AV1_SEGMENTATION_FLAG_SEG_ID_PRE_SKIP 0x10
3079
3080/**
3081 * enum v4l2_av1_segment_feature - AV1 segment features as described in section
3082 * 3 "Symbols and abbreviated terms" of the AV1 specification.
3083 *
3084 * @V4L2_AV1_SEG_LVL_ALT_Q: Index for quantizer segment feature.
3085 * @V4L2_AV1_SEG_LVL_ALT_LF_Y_V: Index for vertical luma loop filter segment
3086 * feature.
3087 * @V4L2_AV1_SEG_LVL_REF_FRAME: Index for reference frame segment feature.
3088 * @V4L2_AV1_SEG_LVL_REF_SKIP: Index for skip segment feature.
3089 * @V4L2_AV1_SEG_LVL_REF_GLOBALMV: Index for global mv feature.
3090 * @V4L2_AV1_SEG_LVL_MAX: Number of segment features.
3091 */
3092enum v4l2_av1_segment_feature {
3093 V4L2_AV1_SEG_LVL_ALT_Q = 0,
3094 V4L2_AV1_SEG_LVL_ALT_LF_Y_V = 1,
3095 V4L2_AV1_SEG_LVL_REF_FRAME = 5,
3096 V4L2_AV1_SEG_LVL_REF_SKIP = 6,
3097 V4L2_AV1_SEG_LVL_REF_GLOBALMV = 7,
3098 V4L2_AV1_SEG_LVL_MAX = 8
3099};
3100
3101#define V4L2_AV1_SEGMENT_FEATURE_ENABLED(id) (1 << (id))
3102
3103/**
3104 * struct v4l2_av1_segmentation - AV1 Segmentation params as defined in section
3105 * 6.8.13 "Segmentation params semantics" of the AV1 specification.
3106 *
3107 * @flags: see V4L2_AV1_SEGMENTATION_FLAG_{}.
3108 * @last_active_seg_id: indicates the highest numbered segment id that has some
3109 * enabled feature. This is used when decoding the segment id to only decode
3110 * choices corresponding to used segments.
3111 * @feature_enabled: bitmask defining which features are enabled in each
3112 * segment. Use V4L2_AV1_SEGMENT_FEATURE_ENABLED to build a suitable mask.
3113 * @feature_data: data attached to each feature. Data entry is only valid if the
3114 * feature is enabled
3115 */
3116struct v4l2_av1_segmentation {
3117 __u8 flags;
3118 __u8 last_active_seg_id;
3119 __u8 feature_enabled[V4L2_AV1_MAX_SEGMENTS];
3120 __s16 feature_data[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX];
3121};
3122
3123#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
3124#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
3125#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_PRESENT 0x4
3126#define V4L2_AV1_LOOP_FILTER_FLAG_DELTA_LF_MULTI 0x8
3127
3128/**
3129 * struct v4l2_av1_loop_filter - AV1 Loop filter params as defined in section
3130 * 6.8.10 "Loop filter semantics" and 6.8.16 "Loop filter delta parameters
3131 * semantics" of the AV1 specification.
3132 *
3133 * @flags: see V4L2_AV1_LOOP_FILTER_FLAG_{}
3134 * @level: an array containing loop filter strength values. Different loop
3135 * filter strength values from the array are used depending on the image plane
3136 * being filtered, and the edge direction (vertical or horizontal) being
3137 * filtered.
3138 * @sharpness: indicates the sharpness level. The loop_filter_level and
3139 * loop_filter_sharpness together determine when a block edge is filtered, and
3140 * by how much the filtering can change the sample values. The loop filter
3141 * process is described in section 7.14 of the AV1 specification.
3142 * @ref_deltas: contains the adjustment needed for the filter level based on the
3143 * chosen reference frame. If this syntax element is not present, it maintains
3144 * its previous value.
3145 * @mode_deltas: contains the adjustment needed for the filter level based on
3146 * the chosen mode. If this syntax element is not present, it maintains its
3147 * previous value.
3148 * @delta_lf_res: specifies the left shift which should be applied to decoded
3149 * loop filter delta values.
3150 */
3151struct v4l2_av1_loop_filter {
3152 __u8 flags;
3153 __u8 level[4];
3154 __u8 sharpness;
3155 __s8 ref_deltas[V4L2_AV1_TOTAL_REFS_PER_FRAME];
3156 __s8 mode_deltas[2];
3157 __u8 delta_lf_res;
3158};
3159
3160#define V4L2_AV1_QUANTIZATION_FLAG_DIFF_UV_DELTA 0x1
3161#define V4L2_AV1_QUANTIZATION_FLAG_USING_QMATRIX 0x2
3162#define V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT 0x4
3163
3164/**
3165 * struct v4l2_av1_quantization - AV1 Quantization params as defined in section
3166 * 6.8.11 "Quantization params semantics" of the AV1 specification.
3167 *
3168 * @flags: see V4L2_AV1_QUANTIZATION_FLAG_{}
3169 * @base_q_idx: indicates the base frame qindex. This is used for Y AC
3170 * coefficients and as the base value for the other quantizers.
3171 * @delta_q_y_dc: indicates the Y DC quantizer relative to base_q_idx.
3172 * @delta_q_u_dc: indicates the U DC quantizer relative to base_q_idx.
3173 * @delta_q_u_ac: indicates the U AC quantizer relative to base_q_idx.
3174 * @delta_q_v_dc: indicates the V DC quantizer relative to base_q_idx.
3175 * @delta_q_v_ac: indicates the V AC quantizer relative to base_q_idx.
3176 * @qm_y: specifies the level in the quantizer matrix that should be used for
3177 * luma plane decoding.
3178 * @qm_u: specifies the level in the quantizer matrix that should be used for
3179 * chroma U plane decoding.
3180 * @qm_v: specifies the level in the quantizer matrix that should be used for
3181 * chroma V plane decoding.
3182 * @delta_q_res: specifies the left shift which should be applied to decoded
3183 * quantizer index delta values.
3184 */
3185struct v4l2_av1_quantization {
3186 __u8 flags;
3187 __u8 base_q_idx;
3188 __s8 delta_q_y_dc;
3189 __s8 delta_q_u_dc;
3190 __s8 delta_q_u_ac;
3191 __s8 delta_q_v_dc;
3192 __s8 delta_q_v_ac;
3193 __u8 qm_y;
3194 __u8 qm_u;
3195 __u8 qm_v;
3196 __u8 delta_q_res;
3197};
3198
3199#define V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING 0x1
3200
3201/**
3202 * struct v4l2_av1_tile_info - AV1 Tile info as defined in section 6.8.14 "Tile
3203 * info semantics" of the AV1 specification.
3204 *
3205 * @flags: see V4L2_AV1_TILE_INFO_FLAG_{}
3206 * @context_update_tile_id: specifies which tile to use for the CDF update.
3207 * @tile_rows: specifies the number of tiles down the frame.
3208 * @tile_cols: specifies the number of tiles across the frame.
3209 * @mi_col_starts: an array specifying the start column (in units of 4x4 luma
3210 * samples) for each tile across the image.
3211 * @mi_row_starts: an array specifying the start row (in units of 4x4 luma
3212 * samples) for each tile down the image.
3213 * @width_in_sbs_minus_1: specifies the width of a tile minus 1 in units of
3214 * superblocks.
3215 * @height_in_sbs_minus_1: specifies the height of a tile minus 1 in units of
3216 * superblocks.
3217 * @tile_size_bytes: specifies the number of bytes needed to code each tile
3218 * size.
3219 * @reserved: padding field. Should be zeroed by applications.
3220 */
3221struct v4l2_av1_tile_info {
3222 __u8 flags;
3223 __u8 context_update_tile_id;
3224 __u8 tile_cols;
3225 __u8 tile_rows;
3226 __u32 mi_col_starts[V4L2_AV1_MAX_TILE_COLS + 1];
3227 __u32 mi_row_starts[V4L2_AV1_MAX_TILE_ROWS + 1];
3228 __u32 width_in_sbs_minus_1[V4L2_AV1_MAX_TILE_COLS];
3229 __u32 height_in_sbs_minus_1[V4L2_AV1_MAX_TILE_ROWS];
3230 __u8 tile_size_bytes;
3231 __u8 reserved[3];
3232};
3233
3234/**
3235 * enum v4l2_av1_frame_type - AV1 Frame Type
3236 *
3237 * @V4L2_AV1_KEY_FRAME: Key frame
3238 * @V4L2_AV1_INTER_FRAME: Inter frame
3239 * @V4L2_AV1_INTRA_ONLY_FRAME: Intra-only frame
3240 * @V4L2_AV1_SWITCH_FRAME: Switch frame
3241 */
3242enum v4l2_av1_frame_type {
3243 V4L2_AV1_KEY_FRAME = 0,
3244 V4L2_AV1_INTER_FRAME = 1,
3245 V4L2_AV1_INTRA_ONLY_FRAME = 2,
3246 V4L2_AV1_SWITCH_FRAME = 3
3247};
3248
3249/**
3250 * enum v4l2_av1_interpolation_filter - AV1 interpolation filter types
3251 *
3252 * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP: eight tap filter
3253 * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH: eight tap smooth filter
3254 * @V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP: eight tap sharp filter
3255 * @V4L2_AV1_INTERPOLATION_FILTER_BILINEAR: bilinear filter
3256 * @V4L2_AV1_INTERPOLATION_FILTER_SWITCHABLE: filter selection is signaled at
3257 * the block level
3258 *
3259 * See section 6.8.9 "Interpolation filter semantics" of the AV1 specification
3260 * for more details.
3261 */
3262enum v4l2_av1_interpolation_filter {
3263 V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP = 0,
3264 V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
3265 V4L2_AV1_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
3266 V4L2_AV1_INTERPOLATION_FILTER_BILINEAR = 3,
3267 V4L2_AV1_INTERPOLATION_FILTER_SWITCHABLE = 4,
3268};
3269
3270/**
3271 * enum v4l2_av1_tx_mode - AV1 Tx mode as described in section 6.8.21 "TX mode
3272 * semantics" of the AV1 specification.
3273 * @V4L2_AV1_TX_MODE_ONLY_4X4: the inverse transform will use only 4x4
3274 * transforms
3275 * @V4L2_AV1_TX_MODE_LARGEST: the inverse transform will use the largest
3276 * transform size that fits inside the block
3277 * @V4L2_AV1_TX_MODE_SELECT: the choice of transform size is specified
3278 * explicitly for each block.
3279 */
3280enum v4l2_av1_tx_mode {
3281 V4L2_AV1_TX_MODE_ONLY_4X4 = 0,
3282 V4L2_AV1_TX_MODE_LARGEST = 1,
3283 V4L2_AV1_TX_MODE_SELECT = 2
3284};
3285
3286#define V4L2_AV1_FRAME_FLAG_SHOW_FRAME 0x00000001
3287#define V4L2_AV1_FRAME_FLAG_SHOWABLE_FRAME 0x00000002
3288#define V4L2_AV1_FRAME_FLAG_ERROR_RESILIENT_MODE 0x00000004
3289#define V4L2_AV1_FRAME_FLAG_DISABLE_CDF_UPDATE 0x00000008
3290#define V4L2_AV1_FRAME_FLAG_ALLOW_SCREEN_CONTENT_TOOLS 0x00000010
3291#define V4L2_AV1_FRAME_FLAG_FORCE_INTEGER_MV 0x00000020
3292#define V4L2_AV1_FRAME_FLAG_ALLOW_INTRABC 0x00000040
3293#define V4L2_AV1_FRAME_FLAG_USE_SUPERRES 0x00000080
3294#define V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV 0x00000100
3295#define V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE 0x00000200
3296#define V4L2_AV1_FRAME_FLAG_USE_REF_FRAME_MVS 0x00000400
3297#define V4L2_AV1_FRAME_FLAG_DISABLE_FRAME_END_UPDATE_CDF 0x00000800
3298#define V4L2_AV1_FRAME_FLAG_ALLOW_WARPED_MOTION 0x00001000
3299#define V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT 0x00002000
3300#define V4L2_AV1_FRAME_FLAG_REDUCED_TX_SET 0x00004000
3301#define V4L2_AV1_FRAME_FLAG_SKIP_MODE_ALLOWED 0x00008000
3302#define V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT 0x00010000
3303#define V4L2_AV1_FRAME_FLAG_FRAME_SIZE_OVERRIDE 0x00020000
3304#define V4L2_AV1_FRAME_FLAG_BUFFER_REMOVAL_TIME_PRESENT 0x00040000
3305#define V4L2_AV1_FRAME_FLAG_FRAME_REFS_SHORT_SIGNALING 0x00080000
3306
3307#define V4L2_CID_STATELESS_AV1_FRAME (V4L2_CID_CODEC_STATELESS_BASE + 502)
3308/**
3309 * struct v4l2_ctrl_av1_frame - Represents an AV1 Frame Header OBU.
3310 *
3311 * @tile_info: tile info
3312 * @quantization: quantization params
3313 * @segmentation: segmentation params
3314 * @superres_denom: the denominator for the upscaling ratio.
3315 * @loop_filter: loop filter params
3316 * @cdef: cdef params
3317 * @skip_mode_frame: specifies the frames to use for compound prediction when
3318 * skip_mode is equal to 1.
3319 * @primary_ref_frame: specifies which reference frame contains the CDF values
3320 * and other state that should be loaded at the start of the frame.
3321 * @loop_restoration: loop restoration params
3322 * @global_motion: global motion params
3323 * @flags: see V4L2_AV1_FRAME_FLAG_{}
3324 * @frame_type: specifies the AV1 frame type
3325 * @order_hint: specifies OrderHintBits least significant bits of the expected
3326 * output order for this frame.
3327 * @upscaled_width: the upscaled width.
3328 * @interpolation_filter: specifies the filter selection used for performing
3329 * inter prediction.
3330 * @tx_mode: specifies how the transform size is determined.
3331 * @frame_width_minus_1: add 1 to get the frame's width.
3332 * @frame_height_minus_1: add 1 to get the frame's height
3333 * @render_width_minus_1: add 1 to get the render width of the frame in luma
3334 * samples.
3335 * @render_height_minus_1: add 1 to get the render height of the frame in luma
3336 * samples.
3337 * @current_frame_id: specifies the frame id number for the current frame. Frame
3338 * id numbers are additional information that do not affect the decoding
3339 * process, but provide decoders with a way of detecting missing reference
3340 * frames so that appropriate action can be taken.
3341 * @buffer_removal_time: specifies the frame removal time in units of DecCT clock
3342 * ticks counted from the removal time of the last random access point for
3343 * operating point opNum.
3344 * @reserved: padding field. Should be zeroed by applications.
3345 * @order_hints: specifies the expected output order hint for each reference
3346 * frame. This field corresponds to the OrderHints variable from the
3347 * specification (section 5.9.2 "Uncompressed header syntax"). As such, this is
3348 * only used for non-intra frames and ignored otherwise. order_hints[0] is
3349 * always ignored.
3350 * @reference_frame_ts: the V4L2 timestamp of the reference frame slots.
3351 * @ref_frame_idx: used to index into @reference_frame_ts when decoding
3352 * inter-frames. The meaning of this array is the same as in the specification.
3353 * The timestamp refers to the timestamp field in struct v4l2_buffer. Use
3354 * v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
3355 * @refresh_frame_flags: contains a bitmask that specifies which reference frame
3356 * slots will be updated with the current frame after it is decoded.
3357 */
3358struct v4l2_ctrl_av1_frame {
3359 struct v4l2_av1_tile_info tile_info;
3360 struct v4l2_av1_quantization quantization;
3361 __u8 superres_denom;
3362 struct v4l2_av1_segmentation segmentation;
3363 struct v4l2_av1_loop_filter loop_filter;
3364 struct v4l2_av1_cdef cdef;
3365 __u8 skip_mode_frame[2];
3366 __u8 primary_ref_frame;
3367 struct v4l2_av1_loop_restoration loop_restoration;
3368 struct v4l2_av1_global_motion global_motion;
3369 __u32 flags;
3370 enum v4l2_av1_frame_type frame_type;
3371 __u32 order_hint;
3372 __u32 upscaled_width;
3373 enum v4l2_av1_interpolation_filter interpolation_filter;
3374 enum v4l2_av1_tx_mode tx_mode;
3375 __u32 frame_width_minus_1;
3376 __u32 frame_height_minus_1;
3377 __u16 render_width_minus_1;
3378 __u16 render_height_minus_1;
3379
3380 __u32 current_frame_id;
3381 __u32 buffer_removal_time[V4L2_AV1_MAX_OPERATING_POINTS];
3382 __u8 reserved[4];
3383 __u32 order_hints[V4L2_AV1_TOTAL_REFS_PER_FRAME];
3384 __u64 reference_frame_ts[V4L2_AV1_TOTAL_REFS_PER_FRAME];
3385 __s8 ref_frame_idx[V4L2_AV1_REFS_PER_FRAME];
3386 __u8 refresh_frame_flags;
3387};
3388
3389#define V4L2_AV1_FILM_GRAIN_FLAG_APPLY_GRAIN 0x1
3390#define V4L2_AV1_FILM_GRAIN_FLAG_UPDATE_GRAIN 0x2
3391#define V4L2_AV1_FILM_GRAIN_FLAG_CHROMA_SCALING_FROM_LUMA 0x4
3392#define V4L2_AV1_FILM_GRAIN_FLAG_OVERLAP 0x8
3393#define V4L2_AV1_FILM_GRAIN_FLAG_CLIP_TO_RESTRICTED_RANGE 0x10
3394
3395#define V4L2_CID_STATELESS_AV1_FILM_GRAIN (V4L2_CID_CODEC_STATELESS_BASE + 505)
3396/**
3397 * struct v4l2_ctrl_av1_film_grain - AV1 Film Grain parameters.
3398 *
3399 * Film grain parameters as specified by section 6.8.20 of the AV1 Specification.
3400 *
3401 * @flags: see V4L2_AV1_FILM_GRAIN_{}.
3402 * @cr_mult: represents a multiplier for the cr component used in derivation of
3403 * the input index to the cr component scaling function.
3404 * @grain_seed: specifies the starting value for the pseudo-random numbers used
3405 * during film grain synthesis.
3406 * @film_grain_params_ref_idx: indicates which reference frame contains the
3407 * film grain parameters to be used for this frame.
3408 * @num_y_points: specifies the number of points for the piece-wise linear
3409 * scaling function of the luma component.
3410 * @point_y_value: represents the x (luma value) coordinate for the i-th point
3411 * of the piecewise linear scaling function for luma component. The values are
3412 * signaled on the scale of 0..255. In case of 10 bit video, these values
3413 * correspond to luma values divided by 4. In case of 12 bit video, these values
3414 * correspond to luma values divided by 16.
3415 * @point_y_scaling: represents the scaling (output) value for the i-th point
3416 * of the piecewise linear scaling function for luma component.
3417 * @num_cb_points: specifies the number of points for the piece-wise linear
3418 * scaling function of the cb component.
3419 * @point_cb_value: represents the x coordinate for the i-th point of the
3420 * piece-wise linear scaling function for cb component. The values are signaled
3421 * on the scale of 0..255.
3422 * @point_cb_scaling: represents the scaling (output) value for the i-th point
3423 * of the piecewise linear scaling function for cb component.
3424 * @num_cr_points: specifies represents the number of points for the piece-wise
3425 * linear scaling function of the cr component.
3426 * @point_cr_value: represents the x coordinate for the i-th point of the
3427 * piece-wise linear scaling function for cr component. The values are signaled
3428 * on the scale of 0..255.
3429 * @point_cr_scaling: represents the scaling (output) value for the i-th point
3430 * of the piecewise linear scaling function for cr component.
3431 * @grain_scaling_minus_8: represents the shift – 8 applied to the values of the
3432 * chroma component. The grain_scaling_minus_8 can take values of 0..3 and
3433 * determines the range and quantization step of the standard deviation of film
3434 * grain.
3435 * @ar_coeff_lag: specifies the number of auto-regressive coefficients for luma
3436 * and chroma.
3437 * @ar_coeffs_y_plus_128: specifies auto-regressive coefficients used for the Y
3438 * plane.
3439 * @ar_coeffs_cb_plus_128: specifies auto-regressive coefficients used for the U
3440 * plane.
3441 * @ar_coeffs_cr_plus_128: specifies auto-regressive coefficients used for the V
3442 * plane.
3443 * @ar_coeff_shift_minus_6: specifies the range of the auto-regressive
3444 * coefficients. Values of 0, 1, 2, and 3 correspond to the ranges for
3445 * auto-regressive coefficients of [-2, 2), [-1, 1), [-0.5, 0.5) and [-0.25,
3446 * 0.25) respectively.
3447 * @grain_scale_shift: specifies how much the Gaussian random numbers should be
3448 * scaled down during the grain synthesis process.
3449 * @cb_mult: represents a multiplier for the cb component used in derivation of
3450 * the input index to the cb component scaling function.
3451 * @cb_luma_mult: represents a multiplier for the average luma component used in
3452 * derivation of the input index to the cb component scaling function.
3453 * @cr_luma_mult: represents a multiplier for the average luma component used in
3454 * derivation of the input index to the cr component scaling function.
3455 * @cb_offset: represents an offset used in derivation of the input index to the
3456 * cb component scaling function.
3457 * @cr_offset: represents an offset used in derivation of the input index to the
3458 * cr component scaling function.
3459 * @reserved: padding field. Should be zeroed by applications.
3460 */
3461struct v4l2_ctrl_av1_film_grain {
3462 __u8 flags;
3463 __u8 cr_mult;
3464 __u16 grain_seed;
3465 __u8 film_grain_params_ref_idx;
3466 __u8 num_y_points;
3467 __u8 point_y_value[V4L2_AV1_MAX_NUM_Y_POINTS];
3468 __u8 point_y_scaling[V4L2_AV1_MAX_NUM_Y_POINTS];
3469 __u8 num_cb_points;
3470 __u8 point_cb_value[V4L2_AV1_MAX_NUM_CB_POINTS];
3471 __u8 point_cb_scaling[V4L2_AV1_MAX_NUM_CB_POINTS];
3472 __u8 num_cr_points;
3473 __u8 point_cr_value[V4L2_AV1_MAX_NUM_CR_POINTS];
3474 __u8 point_cr_scaling[V4L2_AV1_MAX_NUM_CR_POINTS];
3475 __u8 grain_scaling_minus_8;
3476 __u8 ar_coeff_lag;
3477 __u8 ar_coeffs_y_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
3478 __u8 ar_coeffs_cb_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
3479 __u8 ar_coeffs_cr_plus_128[V4L2_AV1_AR_COEFFS_SIZE];
3480 __u8 ar_coeff_shift_minus_6;
3481 __u8 grain_scale_shift;
3482 __u8 cb_mult;
3483 __u8 cb_luma_mult;
3484 __u8 cr_luma_mult;
3485 __u16 cb_offset;
3486 __u16 cr_offset;
3487 __u8 reserved[4];
3488};
3489
27533490/* MPEG-compression definitions kept for backwards compatibility */
27543491#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
27553492#define V4L2_CID_MPEG_CLASS V4L2_CID_CODEC_CLASS
lib/libc/include/any-linux-any/linux/v4l2-mediabus.h+12-6
......@@ -19,12 +19,18 @@
1919 * @width: image width
2020 * @height: image height
2121 * @code: data format code (from enum v4l2_mbus_pixelcode)
22 * @field: used interlacing type (from enum v4l2_field)
23 * @colorspace: colorspace of the data (from enum v4l2_colorspace)
24 * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)
25 * @hsv_enc: HSV encoding of the data (from enum v4l2_hsv_encoding)
26 * @quantization: quantization of the data (from enum v4l2_quantization)
27 * @xfer_func: transfer function of the data (from enum v4l2_xfer_func)
22 * @field: used interlacing type (from enum v4l2_field), zero for metadata
23 * mbus codes
24 * @colorspace: colorspace of the data (from enum v4l2_colorspace), zero on
25 * metadata mbus codes
26 * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero
27 * for metadata mbus codes
28 * @hsv_enc: HSV encoding of the data (from enum v4l2_hsv_encoding), zero for
29 * metadata mbus codes
30 * @quantization: quantization of the data (from enum v4l2_quantization), zero
31 * for metadata mbus codes
32 * @xfer_func: transfer function of the data (from enum v4l2_xfer_func), zero
33 * for metadata mbus codes
2834 * @flags: flags (V4L2_MBUS_FRAMEFMT_*)
2935 * @reserved: reserved bytes that can be later used
3036 */
lib/libc/include/any-linux-any/linux/v4l2-subdev.h+43-5
......@@ -50,6 +50,10 @@ struct v4l2_subdev_format {
5050 * @rect: pad crop rectangle boundaries
5151 * @stream: stream number, defined in subdev routing
5252 * @reserved: drivers and applications must zero this array
53 *
54 * The subdev crop API is an obsolete interface and may be removed in the
55 * future. It is superseded by the selection API. No new extensions to this
56 * structure will be accepted.
5357 */
5458struct v4l2_subdev_crop {
5559 __u32 which;
......@@ -116,13 +120,15 @@ struct v4l2_subdev_frame_size_enum {
116120 * @pad: pad number, as reported by the media API
117121 * @interval: frame interval in seconds
118122 * @stream: stream number, defined in subdev routing
123 * @which: interval type (from enum v4l2_subdev_format_whence)
119124 * @reserved: drivers and applications must zero this array
120125 */
121126struct v4l2_subdev_frame_interval {
122127 __u32 pad;
123128 struct v4l2_fract interval;
124129 __u32 stream;
125 __u32 reserved[8];
130 __u32 which;
131 __u32 reserved[7];
126132};
127133
128134/**
......@@ -133,7 +139,7 @@ struct v4l2_subdev_frame_interval {
133139 * @width: frame width in pixels
134140 * @height: frame height in pixels
135141 * @interval: frame interval in seconds
136 * @which: format type (from enum v4l2_subdev_format_whence)
142 * @which: interval type (from enum v4l2_subdev_format_whence)
137143 * @stream: stream number, defined in subdev routing
138144 * @reserved: drivers and applications must zero this array
139145 */
......@@ -222,15 +228,44 @@ struct v4l2_subdev_route {
222228 * struct v4l2_subdev_routing - Subdev routing information
223229 *
224230 * @which: configuration type (from enum v4l2_subdev_format_whence)
225 * @num_routes: the total number of routes in the routes array
231 * @len_routes: the length of the routes array, in routes; set by the user, not
232 * modified by the kernel
226233 * @routes: pointer to the routes array
234 * @num_routes: the total number of routes, possibly more than fits in the
235 * routes array
227236 * @reserved: drivers and applications must zero this array
228237 */
229238struct v4l2_subdev_routing {
230239 __u32 which;
231 __u32 num_routes;
240 __u32 len_routes;
232241 __u64 routes;
233 __u32 reserved[6];
242 __u32 num_routes;
243 __u32 reserved[11];
244};
245
246/*
247 * The client is aware of streams. Setting this flag enables the use of 'stream'
248 * fields (referring to the stream number) with various ioctls. If this is not
249 * set (which is the default), the 'stream' fields will be forced to 0 by the
250 * kernel.
251 */
252#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)
253
254/*
255 * The client is aware of the struct v4l2_subdev_frame_interval which field. If
256 * this is not set (which is the default), the which field is forced to
257 * V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.
258 */
259#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH (1ULL << 1)
260
261/**
262 * struct v4l2_subdev_client_capability - Capabilities of the client accessing
263 * the subdev
264 *
265 * @capabilities: A bitmask of V4L2_SUBDEV_CLIENT_CAP_* flags.
266 */
267struct v4l2_subdev_client_capability {
268 __u64 capabilities;
234269};
235270
236271/* Backwards compatibility define --- to be removed */
......@@ -250,6 +285,9 @@ struct v4l2_subdev_routing {
250285#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
251286#define VIDIOC_SUBDEV_G_ROUTING _IOWR('V', 38, struct v4l2_subdev_routing)
252287#define VIDIOC_SUBDEV_S_ROUTING _IOWR('V', 39, struct v4l2_subdev_routing)
288#define VIDIOC_SUBDEV_G_CLIENT_CAP _IOR('V', 101, struct v4l2_subdev_client_capability)
289#define VIDIOC_SUBDEV_S_CLIENT_CAP _IOWR('V', 102, struct v4l2_subdev_client_capability)
290
253291/* The following ioctls are identical to the ioctls in videodev2.h */
254292#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
255293#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
lib/libc/include/any-linux-any/linux/vdpa.h+17
......@@ -56,6 +56,23 @@ enum vdpa_attr {
5656 /* virtio features that are provisioned to the vDPA device */
5757 VDPA_ATTR_DEV_FEATURES, /* u64 */
5858
59 VDPA_ATTR_DEV_BLK_CFG_CAPACITY, /* u64 */
60 VDPA_ATTR_DEV_BLK_CFG_SIZE_MAX, /* u32 */
61 VDPA_ATTR_DEV_BLK_CFG_BLK_SIZE, /* u32 */
62 VDPA_ATTR_DEV_BLK_CFG_SEG_MAX, /* u32 */
63 VDPA_ATTR_DEV_BLK_CFG_NUM_QUEUES, /* u16 */
64 VDPA_ATTR_DEV_BLK_CFG_PHY_BLK_EXP, /* u8 */
65 VDPA_ATTR_DEV_BLK_CFG_ALIGN_OFFSET, /* u8 */
66 VDPA_ATTR_DEV_BLK_CFG_MIN_IO_SIZE, /* u16 */
67 VDPA_ATTR_DEV_BLK_CFG_OPT_IO_SIZE, /* u32 */
68 VDPA_ATTR_DEV_BLK_CFG_MAX_DISCARD_SEC, /* u32 */
69 VDPA_ATTR_DEV_BLK_CFG_MAX_DISCARD_SEG, /* u32 */
70 VDPA_ATTR_DEV_BLK_CFG_DISCARD_SEC_ALIGN,/* u32 */
71 VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEC, /* u32 */
72 VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEG, /* u32 */
73 VDPA_ATTR_DEV_BLK_READ_ONLY, /* u8 */
74 VDPA_ATTR_DEV_BLK_FLUSH, /* u8 */
75
5976 /* new attributes must be added above here */
6077 VDPA_ATTR_MAX,
6178};
lib/libc/include/any-linux-any/linux/version.h+3-3
......@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 393992
1#define LINUX_VERSION_CODE 395776
22#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
33#define LINUX_VERSION_MAJOR 6
4#define LINUX_VERSION_PATCHLEVEL 3
5#define LINUX_VERSION_SUBLEVEL 8
\ No newline at end of file
4#define LINUX_VERSION_PATCHLEVEL 10
5#define LINUX_VERSION_SUBLEVEL 0
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vesa.h created+18
......@@ -0,0 +1,18 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_VESA_H
3#define _LINUX_VESA_H
4
5/* VESA Blanking Levels */
6enum vesa_blank_mode {
7 VESA_NO_BLANKING = 0,
8#define VESA_NO_BLANKING VESA_NO_BLANKING
9 VESA_VSYNC_SUSPEND = 1,
10#define VESA_VSYNC_SUSPEND VESA_VSYNC_SUSPEND
11 VESA_HSYNC_SUSPEND = 2,
12#define VESA_HSYNC_SUSPEND VESA_HSYNC_SUSPEND
13 VESA_POWERDOWN = VESA_VSYNC_SUSPEND | VESA_HSYNC_SUSPEND,
14#define VESA_POWERDOWN VESA_POWERDOWN
15 VESA_BLANK_MAX = VESA_POWERDOWN,
16};
17
18#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+212-13
......@@ -213,9 +213,11 @@ struct vfio_device_info {
213213#define VFIO_DEVICE_FLAGS_AP (1 << 5) /* vfio-ap device */
214214#define VFIO_DEVICE_FLAGS_FSL_MC (1 << 6) /* vfio-fsl-mc device */
215215#define VFIO_DEVICE_FLAGS_CAPS (1 << 7) /* Info supports caps */
216#define VFIO_DEVICE_FLAGS_CDX (1 << 8) /* vfio-cdx device */
216217 __u32 num_regions; /* Max region index + 1 */
217218 __u32 num_irqs; /* Max IRQ index + 1 */
218219 __u32 cap_offset; /* Offset within info struct of first cap */
220 __u32 pad;
219221};
220222#define VFIO_DEVICE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 7)
221223
......@@ -240,6 +242,20 @@ struct vfio_device_info {
240242#define VFIO_DEVICE_INFO_CAP_ZPCI_UTIL 3
241243#define VFIO_DEVICE_INFO_CAP_ZPCI_PFIP 4
242244
245/*
246 * The following VFIO_DEVICE_INFO capability reports support for PCIe AtomicOp
247 * completion to the root bus with supported widths provided via flags.
248 */
249#define VFIO_DEVICE_INFO_CAP_PCI_ATOMIC_COMP 5
250struct vfio_device_info_cap_pci_atomic_comp {
251 struct vfio_info_cap_header header;
252 __u32 flags;
253#define VFIO_PCI_ATOMIC_COMP32 (1 << 0)
254#define VFIO_PCI_ATOMIC_COMP64 (1 << 1)
255#define VFIO_PCI_ATOMIC_COMP128 (1 << 2)
256 __u32 reserved;
257};
258
243259/**
244260 * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8,
245261 * struct vfio_region_info)
......@@ -261,8 +277,8 @@ struct vfio_region_info {
261277#define VFIO_REGION_INFO_FLAG_CAPS (1 << 3) /* Info supports caps */
262278 __u32 index; /* Region index */
263279 __u32 cap_offset; /* Offset within info struct of first cap */
264 __u64 size; /* Region size (bytes) */
265 __u64 offset; /* Region offset from start of device fd */
280 __aligned_u64 size; /* Region size (bytes) */
281 __aligned_u64 offset; /* Region offset from start of device fd */
266282};
267283#define VFIO_DEVICE_GET_REGION_INFO _IO(VFIO_TYPE, VFIO_BASE + 8)
268284
......@@ -278,8 +294,8 @@ struct vfio_region_info {
278294#define VFIO_REGION_INFO_CAP_SPARSE_MMAP 1
279295
280296struct vfio_region_sparse_mmap_area {
281 __u64 offset; /* Offset of mmap'able area within region */
282 __u64 size; /* Size of mmap'able area */
297 __aligned_u64 offset; /* Offset of mmap'able area within region */
298 __aligned_u64 size; /* Size of mmap'able area */
283299};
284300
285301struct vfio_region_info_cap_sparse_mmap {
......@@ -434,9 +450,9 @@ struct vfio_device_migration_info {
434450 VFIO_DEVICE_STATE_V1_RESUMING)
435451
436452 __u32 reserved;
437 __u64 pending_bytes;
438 __u64 data_offset;
439 __u64 data_size;
453 __aligned_u64 pending_bytes;
454 __aligned_u64 data_offset;
455 __aligned_u64 data_size;
440456};
441457
442458/*
......@@ -460,7 +476,7 @@ struct vfio_device_migration_info {
460476
461477struct vfio_region_info_cap_nvlink2_ssatgt {
462478 struct vfio_info_cap_header header;
463 __u64 tgt;
479 __aligned_u64 tgt;
464480};
465481
466482/*
......@@ -511,6 +527,9 @@ struct vfio_region_info_cap_nvlink2_lnkspd {
511527 * then add and unmask vectors, it's up to userspace to make the decision
512528 * whether to allocate the maximum supported number of vectors or tear
513529 * down setup and incrementally increase the vectors as each is enabled.
530 * Absence of the NORESIZE flag indicates that vectors can be enabled
531 * and disabled dynamically without impacting other vectors within the
532 * index.
514533 */
515534struct vfio_irq_info {
516535 __u32 argsz;
......@@ -646,15 +665,73 @@ enum {
646665 VFIO_CCW_NUM_IRQS
647666};
648667
668/*
669 * The vfio-ap bus driver makes use of the following IRQ index mapping.
670 * Unimplemented IRQ types return a count of zero.
671 */
672enum {
673 VFIO_AP_REQ_IRQ_INDEX,
674 VFIO_AP_NUM_IRQS
675};
676
649677/**
650678 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 12,
651679 * struct vfio_pci_hot_reset_info)
652680 *
681 * This command is used to query the affected devices in the hot reset for
682 * a given device.
683 *
684 * This command always reports the segment, bus, and devfn information for
685 * each affected device, and selectively reports the group_id or devid per
686 * the way how the calling device is opened.
687 *
688 * - If the calling device is opened via the traditional group/container
689 * API, group_id is reported. User should check if it has owned all
690 * the affected devices and provides a set of group fds to prove the
691 * ownership in VFIO_DEVICE_PCI_HOT_RESET ioctl.
692 *
693 * - If the calling device is opened as a cdev, devid is reported.
694 * Flag VFIO_PCI_HOT_RESET_FLAG_DEV_ID is set to indicate this
695 * data type. All the affected devices should be represented in
696 * the dev_set, ex. bound to a vfio driver, and also be owned by
697 * this interface which is determined by the following conditions:
698 * 1) Has a valid devid within the iommufd_ctx of the calling device.
699 * Ownership cannot be determined across separate iommufd_ctx and
700 * the cdev calling conventions do not support a proof-of-ownership
701 * model as provided in the legacy group interface. In this case
702 * valid devid with value greater than zero is provided in the return
703 * structure.
704 * 2) Does not have a valid devid within the iommufd_ctx of the calling
705 * device, but belongs to the same IOMMU group as the calling device
706 * or another opened device that has a valid devid within the
707 * iommufd_ctx of the calling device. This provides implicit ownership
708 * for devices within the same DMA isolation context. In this case
709 * the devid value of VFIO_PCI_DEVID_OWNED is provided in the return
710 * structure.
711 *
712 * A devid value of VFIO_PCI_DEVID_NOT_OWNED is provided in the return
713 * structure for affected devices where device is NOT represented in the
714 * dev_set or ownership is not available. Such devices prevent the use
715 * of VFIO_DEVICE_PCI_HOT_RESET ioctl outside of the proof-of-ownership
716 * calling conventions (ie. via legacy group accessed devices). Flag
717 * VFIO_PCI_HOT_RESET_FLAG_DEV_ID_OWNED would be set when all the
718 * affected devices are represented in the dev_set and also owned by
719 * the user. This flag is available only when
720 * flag VFIO_PCI_HOT_RESET_FLAG_DEV_ID is set, otherwise reserved.
721 * When set, user could invoke VFIO_DEVICE_PCI_HOT_RESET with a zero
722 * length fd array on the calling device as the ownership is validated
723 * by iommufd_ctx.
724 *
653725 * Return: 0 on success, -errno on failure:
654726 * -enospc = insufficient buffer, -enodev = unsupported for device.
655727 */
656728struct vfio_pci_dependent_device {
657 __u32 group_id;
729 union {
730 __u32 group_id;
731 __u32 devid;
732#define VFIO_PCI_DEVID_OWNED 0
733#define VFIO_PCI_DEVID_NOT_OWNED -1
734 };
658735 __u16 segment;
659736 __u8 bus;
660737 __u8 devfn; /* Use PCI_SLOT/PCI_FUNC */
......@@ -663,6 +740,8 @@ struct vfio_pci_dependent_device {
663740struct vfio_pci_hot_reset_info {
664741 __u32 argsz;
665742 __u32 flags;
743#define VFIO_PCI_HOT_RESET_FLAG_DEV_ID (1 << 0)
744#define VFIO_PCI_HOT_RESET_FLAG_DEV_ID_OWNED (1 << 1)
666745 __u32 count;
667746 struct vfio_pci_dependent_device devices[];
668747};
......@@ -673,6 +752,24 @@ struct vfio_pci_hot_reset_info {
673752 * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13,
674753 * struct vfio_pci_hot_reset)
675754 *
755 * A PCI hot reset results in either a bus or slot reset which may affect
756 * other devices sharing the bus/slot. The calling user must have
757 * ownership of the full set of affected devices as determined by the
758 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl.
759 *
760 * When called on a device file descriptor acquired through the vfio
761 * group interface, the user is required to provide proof of ownership
762 * of those affected devices via the group_fds array in struct
763 * vfio_pci_hot_reset.
764 *
765 * When called on a direct cdev opened vfio device, the flags field of
766 * struct vfio_pci_hot_reset_info reports the ownership status of the
767 * affected devices and this ioctl must be called with an empty group_fds
768 * array. See above INFO ioctl definition for ownership requirements.
769 *
770 * Mixed usage of legacy groups and cdevs across the set of affected
771 * devices is not supported.
772 *
676773 * Return: 0 on success, -errno on failure.
677774 */
678775struct vfio_pci_hot_reset {
......@@ -719,7 +816,7 @@ struct vfio_device_gfx_plane_info {
719816 __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */
720817 /* out */
721818 __u32 drm_format; /* drm format of plane */
722 __u64 drm_format_mod; /* tiled mode */
819 __aligned_u64 drm_format_mod; /* tiled mode */
723820 __u32 width; /* width of plane */
724821 __u32 height; /* height of plane */
725822 __u32 stride; /* stride of plane */
......@@ -732,6 +829,7 @@ struct vfio_device_gfx_plane_info {
732829 __u32 region_index; /* region index */
733830 __u32 dmabuf_id; /* dma-buf id */
734831 };
832 __u32 reserved;
735833};
736834
737835#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14)
......@@ -766,9 +864,10 @@ struct vfio_device_ioeventfd {
766864#define VFIO_DEVICE_IOEVENTFD_32 (1 << 2) /* 4-byte write */
767865#define VFIO_DEVICE_IOEVENTFD_64 (1 << 3) /* 8-byte write */
768866#define VFIO_DEVICE_IOEVENTFD_SIZE_MASK (0xf)
769 __u64 offset; /* device fd offset of write */
770 __u64 data; /* data to be written */
867 __aligned_u64 offset; /* device fd offset of write */
868 __aligned_u64 data; /* data to be written */
771869 __s32 fd; /* -1 for de-assignment */
870 __u32 reserved;
772871};
773872
774873#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
......@@ -801,6 +900,83 @@ struct vfio_device_feature {
801900
802901#define VFIO_DEVICE_FEATURE _IO(VFIO_TYPE, VFIO_BASE + 17)
803902
903/*
904 * VFIO_DEVICE_BIND_IOMMUFD - _IOR(VFIO_TYPE, VFIO_BASE + 18,
905 * struct vfio_device_bind_iommufd)
906 * @argsz: User filled size of this data.
907 * @flags: Must be 0.
908 * @iommufd: iommufd to bind.
909 * @out_devid: The device id generated by this bind. devid is a handle for
910 * this device/iommufd bond and can be used in IOMMUFD commands.
911 *
912 * Bind a vfio_device to the specified iommufd.
913 *
914 * User is restricted from accessing the device before the binding operation
915 * is completed. Only allowed on cdev fds.
916 *
917 * Unbind is automatically conducted when device fd is closed.
918 *
919 * Return: 0 on success, -errno on failure.
920 */
921struct vfio_device_bind_iommufd {
922 __u32 argsz;
923 __u32 flags;
924 __s32 iommufd;
925 __u32 out_devid;
926};
927
928#define VFIO_DEVICE_BIND_IOMMUFD _IO(VFIO_TYPE, VFIO_BASE + 18)
929
930/*
931 * VFIO_DEVICE_ATTACH_IOMMUFD_PT - _IOW(VFIO_TYPE, VFIO_BASE + 19,
932 * struct vfio_device_attach_iommufd_pt)
933 * @argsz: User filled size of this data.
934 * @flags: Must be 0.
935 * @pt_id: Input the target id which can represent an ioas or a hwpt
936 * allocated via iommufd subsystem.
937 * Output the input ioas id or the attached hwpt id which could
938 * be the specified hwpt itself or a hwpt automatically created
939 * for the specified ioas by kernel during the attachment.
940 *
941 * Associate the device with an address space within the bound iommufd.
942 * Undo by VFIO_DEVICE_DETACH_IOMMUFD_PT or device fd close. This is only
943 * allowed on cdev fds.
944 *
945 * If a vfio device is currently attached to a valid hw_pagetable, without doing
946 * a VFIO_DEVICE_DETACH_IOMMUFD_PT, a second VFIO_DEVICE_ATTACH_IOMMUFD_PT ioctl
947 * passing in another hw_pagetable (hwpt) id is allowed. This action, also known
948 * as a hw_pagetable replacement, will replace the device's currently attached
949 * hw_pagetable with a new hw_pagetable corresponding to the given pt_id.
950 *
951 * Return: 0 on success, -errno on failure.
952 */
953struct vfio_device_attach_iommufd_pt {
954 __u32 argsz;
955 __u32 flags;
956 __u32 pt_id;
957};
958
959#define VFIO_DEVICE_ATTACH_IOMMUFD_PT _IO(VFIO_TYPE, VFIO_BASE + 19)
960
961/*
962 * VFIO_DEVICE_DETACH_IOMMUFD_PT - _IOW(VFIO_TYPE, VFIO_BASE + 20,
963 * struct vfio_device_detach_iommufd_pt)
964 * @argsz: User filled size of this data.
965 * @flags: Must be 0.
966 *
967 * Remove the association of the device and its current associated address
968 * space. After it, the device should be in a blocking DMA state. This is only
969 * allowed on cdev fds.
970 *
971 * Return: 0 on success, -errno on failure.
972 */
973struct vfio_device_detach_iommufd_pt {
974 __u32 argsz;
975 __u32 flags;
976};
977
978#define VFIO_DEVICE_DETACH_IOMMUFD_PT _IO(VFIO_TYPE, VFIO_BASE + 20)
979
804980/*
805981 * Provide support for setting a PCI VF Token, which is used as a shared
806982 * secret between PF and VF drivers. This feature may only be set on a
......@@ -1043,6 +1219,7 @@ enum vfio_device_mig_state {
10431219 VFIO_DEVICE_STATE_RUNNING_P2P = 5,
10441220 VFIO_DEVICE_STATE_PRE_COPY = 6,
10451221 VFIO_DEVICE_STATE_PRE_COPY_P2P = 7,
1222 VFIO_DEVICE_STATE_NR,
10461223};
10471224
10481225/**
......@@ -1260,6 +1437,27 @@ struct vfio_device_feature_mig_data_size {
12601437
12611438#define VFIO_DEVICE_FEATURE_MIG_DATA_SIZE 9
12621439
1440/**
1441 * Upon VFIO_DEVICE_FEATURE_SET, set or clear the BUS mastering for the device
1442 * based on the operation specified in op flag.
1443 *
1444 * The functionality is incorporated for devices that needs bus master control,
1445 * but the in-band device interface lacks the support. Consequently, it is not
1446 * applicable to PCI devices, as bus master control for PCI devices is managed
1447 * in-band through the configuration space. At present, this feature is supported
1448 * only for CDX devices.
1449 * When the device's BUS MASTER setting is configured as CLEAR, it will result in
1450 * blocking all incoming DMA requests from the device. On the other hand, configuring
1451 * the device's BUS MASTER setting as SET (enable) will grant the device the
1452 * capability to perform DMA to the host memory.
1453 */
1454struct vfio_device_feature_bus_master {
1455 __u32 op;
1456#define VFIO_DEVICE_FEATURE_CLEAR_MASTER 0 /* Clear Bus Master */
1457#define VFIO_DEVICE_FEATURE_SET_MASTER 1 /* Set Bus Master */
1458};
1459#define VFIO_DEVICE_FEATURE_BUS_MASTER 10
1460
12631461/* -------- API for Type1 VFIO IOMMU -------- */
12641462
12651463/**
......@@ -1275,8 +1473,9 @@ struct vfio_iommu_type1_info {
12751473 __u32 flags;
12761474#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
12771475#define VFIO_IOMMU_INFO_CAPS (1 << 1) /* Info supports caps */
1278 __u64 iova_pgsizes; /* Bitmap of supported page sizes */
1476 __aligned_u64 iova_pgsizes; /* Bitmap of supported page sizes */
12791477 __u32 cap_offset; /* Offset within info struct of first cap */
1478 __u32 pad;
12801479};
12811480
12821481/*
lib/libc/include/any-linux-any/linux/vhost.h+53-6
......@@ -45,6 +45,25 @@
4545#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
4646/* Specify an eventfd file descriptor to signal on log write. */
4747#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
48/* By default, a device gets one vhost_worker that its virtqueues share. This
49 * command allows the owner of the device to create an additional vhost_worker
50 * for the device. It can later be bound to 1 or more of its virtqueues using
51 * the VHOST_ATTACH_VRING_WORKER command.
52 *
53 * This must be called after VHOST_SET_OWNER and the caller must be the owner
54 * of the device. The new thread will inherit caller's cgroups and namespaces,
55 * and will share the caller's memory space. The new thread will also be
56 * counted against the caller's RLIMIT_NPROC value.
57 *
58 * The worker's ID used in other commands will be returned in
59 * vhost_worker_state.
60 */
61#define VHOST_NEW_WORKER _IOR(VHOST_VIRTIO, 0x8, struct vhost_worker_state)
62/* Free a worker created with VHOST_NEW_WORKER if it's not attached to any
63 * virtqueue. If userspace is not able to call this for workers its created,
64 * the kernel will free all the device's workers when the device is closed.
65 */
66#define VHOST_FREE_WORKER _IOW(VHOST_VIRTIO, 0x9, struct vhost_worker_state)
4867
4968/* Ring setup. */
5069/* Set number of descriptors in ring. This parameter can not
......@@ -70,6 +89,18 @@
7089#define VHOST_VRING_BIG_ENDIAN 1
7190#define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state)
7291#define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state)
92/* Attach a vhost_worker created with VHOST_NEW_WORKER to one of the device's
93 * virtqueues.
94 *
95 * This will replace the virtqueue's existing worker. If the replaced worker
96 * is no longer attached to any virtqueues, it can be freed with
97 * VHOST_FREE_WORKER.
98 */
99#define VHOST_ATTACH_VRING_WORKER _IOW(VHOST_VIRTIO, 0x15, \
100 struct vhost_vring_worker)
101/* Return the vring worker's ID */
102#define VHOST_GET_VRING_WORKER _IOWR(VHOST_VIRTIO, 0x16, \
103 struct vhost_vring_worker)
73104
74105/* The following ioctls use eventfd file descriptors to signal and poll
75106 * for events. */
......@@ -148,12 +179,6 @@
148179/* Get the config size */
149180#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)
150181
151/* Get the count of all virtqueues */
152#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
153
154/* Get the number of virtqueue groups. */
155#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
156
157182/* Get the number of address spaces. */
158183#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
159184
......@@ -188,4 +213,26 @@
188213 */
189214#define VHOST_VDPA_RESUME _IO(VHOST_VIRTIO, 0x7E)
190215
216/* Get the group for the descriptor table including driver & device areas
217 * of a virtqueue: read index, write group in num.
218 * The virtqueue index is stored in the index field of vhost_vring_state.
219 * The group ID of the descriptor table for this specific virtqueue
220 * is returned via num field of vhost_vring_state.
221 */
222#define VHOST_VDPA_GET_VRING_DESC_GROUP _IOWR(VHOST_VIRTIO, 0x7F, \
223 struct vhost_vring_state)
224
225
226/* Get the count of all virtqueues */
227#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
228
229/* Get the number of virtqueue groups. */
230#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
231
232/* Get the queue size of a specific virtqueue.
233 * userspace set the vring index in vhost_vring_state.index
234 * kernel set the queue size in vhost_vring_state.num
235 */
236#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x82, \
237 struct vhost_vring_state)
191238#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vhost_types.h+27
......@@ -47,6 +47,22 @@ struct vhost_vring_addr {
4747 __u64 log_guest_addr;
4848};
4949
50struct vhost_worker_state {
51 /*
52 * For VHOST_NEW_WORKER the kernel will return the new vhost_worker id.
53 * For VHOST_FREE_WORKER this must be set to the id of the vhost_worker
54 * to free.
55 */
56 unsigned int worker_id;
57};
58
59struct vhost_vring_worker {
60 /* vring index */
61 unsigned int index;
62 /* The id of the vhost_worker returned from VHOST_NEW_WORKER */
63 unsigned int worker_id;
64};
65
5066/* no alignment requirement */
5167struct vhost_iotlb_msg {
5268 __u64 iova;
......@@ -165,5 +181,16 @@ struct vhost_vdpa_iova_range {
165181#define VHOST_BACKEND_F_SUSPEND 0x4
166182/* Device can be resumed */
167183#define VHOST_BACKEND_F_RESUME 0x5
184/* Device supports the driver enabling virtqueues both before and after
185 * DRIVER_OK
186 */
187#define VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK 0x6
188/* Device may expose the virtqueue's descriptor area, driver area and
189 * device area to a different group for ASID binding than where its
190 * buffers may reside. Requires VHOST_BACKEND_F_IOTLB_ASID.
191 */
192#define VHOST_BACKEND_F_DESC_ASID 0x7
193/* IOTLB don't flush memory mapping across device reset */
194#define VHOST_BACKEND_F_IOTLB_PERSIST 0x8
168195
169196#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/videodev2.h+83-21
......@@ -553,12 +553,17 @@ struct v4l2_pix_format {
553553#define V4L2_PIX_FMT_RGBA1010102 v4l2_fourcc('R', 'A', '3', '0') /* 32 RGBA-10-10-10-2 */
554554#define V4L2_PIX_FMT_ARGB2101010 v4l2_fourcc('A', 'R', '3', '0') /* 32 ARGB-2-10-10-10 */
555555
556/* RGB formats (6 or 8 bytes per pixel) */
557#define V4L2_PIX_FMT_BGR48_12 v4l2_fourcc('B', '3', '1', '2') /* 48 BGR 12-bit per component */
558#define V4L2_PIX_FMT_ABGR64_12 v4l2_fourcc('B', '4', '1', '2') /* 64 BGRA 12-bit per component */
559
556560/* Grey formats */
557561#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
558562#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
559563#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
560564#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
561565#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
566#define V4L2_PIX_FMT_Y012 v4l2_fourcc('Y', '0', '1', '2') /* 12 Greyscale */
562567#define V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ') /* 14 Greyscale */
563568#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
564569#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */
......@@ -567,6 +572,8 @@ struct v4l2_pix_format {
567572#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
568573#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */
569574#define V4L2_PIX_FMT_IPU3_Y10 v4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */
575#define V4L2_PIX_FMT_Y12P v4l2_fourcc('Y', '1', '2', 'P') /* 12 Greyscale, MIPI RAW12 packed */
576#define V4L2_PIX_FMT_Y14P v4l2_fourcc('Y', '1', '4', 'P') /* 14 Greyscale, MIPI RAW14 packed */
570577
571578/* Palette formats */
572579#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
......@@ -593,6 +600,7 @@ struct v4l2_pix_format {
593600#define V4L2_PIX_FMT_YUVA32 v4l2_fourcc('Y', 'U', 'V', 'A') /* 32 YUVA-8-8-8-8 */
594601#define V4L2_PIX_FMT_YUVX32 v4l2_fourcc('Y', 'U', 'V', 'X') /* 32 YUVX-8-8-8-8 */
595602#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
603#define V4L2_PIX_FMT_YUV48_12 v4l2_fourcc('Y', '3', '1', '2') /* 48 YUV 4:4:4 12-bit per component */
596604
597605/*
598606 * YCbCr packed format. For each Y2xx format, xx bits of valid data occupy the MSBs
......@@ -610,12 +618,14 @@ struct v4l2_pix_format {
610618#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
611619#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
612620#define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */
621#define V4L2_PIX_FMT_P012 v4l2_fourcc('P', '0', '1', '2') /* 24 Y/CbCr 4:2:0 12-bit per component */
613622
614623/* two non contiguous planes - one Y, one Cr + Cb interleaved */
615624#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
616625#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
617626#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
618627#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
628#define V4L2_PIX_FMT_P012M v4l2_fourcc('P', 'M', '1', '2') /* 24 Y/CbCr 4:2:0 12-bit per component */
619629
620630/* three planes - Y Cb, Cr */
621631#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
......@@ -637,6 +647,7 @@ struct v4l2_pix_format {
637647#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */
638648#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
639649#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 32x32 tiles */
650#define V4L2_PIX_FMT_NV15_4L4 v4l2_fourcc('V', 'T', '1', '5') /* 15 Y/CbCr 4:2:0 10-bit 4x4 tiles */
640651#define V4L2_PIX_FMT_P010_4L4 v4l2_fourcc('T', '0', '1', '0') /* 12 Y/CbCr 4:2:0 10-bit 4x4 macroblocks */
641652#define V4L2_PIX_FMT_NV12_8L128 v4l2_fourcc('A', 'T', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
642653#define V4L2_PIX_FMT_NV12_10BE_8L128 v4l2_fourcc_be('A', 'X', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */
......@@ -723,6 +734,10 @@ struct v4l2_pix_format {
723734#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
724735#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
725736#define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
737#define V4L2_PIX_FMT_AV1_FRAME v4l2_fourcc('A', 'V', '1', 'F') /* AV1 parsed frame */
738#define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */
739#define V4L2_PIX_FMT_RV30 v4l2_fourcc('R', 'V', '3', '0') /* RealVideo 8 */
740#define V4L2_PIX_FMT_RV40 v4l2_fourcc('R', 'V', '4', '0') /* RealVideo 9 & 10 */
726741
727742/* Vendor-specific formats */
728743#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
......@@ -756,12 +771,15 @@ struct v4l2_pix_format {
756771#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
757772#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
758773#define V4L2_PIX_FMT_MM21 v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8-bit block mode, two non-contiguous planes */
774#define V4L2_PIX_FMT_MT2110T v4l2_fourcc('M', 'T', '2', 'T') /* Mediatek 10-bit block tile mode */
775#define V4L2_PIX_FMT_MT2110R v4l2_fourcc('M', 'T', '2', 'R') /* Mediatek 10-bit block raster mode */
759776#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
760777#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
761778#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */
762779#define V4L2_PIX_FMT_QC08C v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */
763780#define V4L2_PIX_FMT_QC10C v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */
764781#define V4L2_PIX_FMT_AJPG v4l2_fourcc('A', 'J', 'P', 'G') /* Aspeed JPEG */
782#define V4L2_PIX_FMT_HEXTILE v4l2_fourcc('H', 'X', 'T', 'L') /* Hextile compressed */
765783
766784/* 10bit raw packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
767785#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
......@@ -796,6 +814,7 @@ struct v4l2_pix_format {
796814#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */
797815#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */
798816
817
799818/* priv field value to indicates that subsequent fields are valid. */
800819#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
801820
......@@ -826,6 +845,7 @@ struct v4l2_fmtdesc {
826845#define V4L2_FMT_FLAG_CSC_YCBCR_ENC 0x0080
827846#define V4L2_FMT_FLAG_CSC_HSV_ENC V4L2_FMT_FLAG_CSC_YCBCR_ENC
828847#define V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100
848#define V4L2_FMT_FLAG_META_LINE_BASED 0x0200
829849
830850 /* Frame Size and frame rate enumeration */
831851/*
......@@ -975,18 +995,20 @@ struct v4l2_requestbuffers {
975995#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4)
976996#define V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 5)
977997#define V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS (1 << 6)
998#define V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS (1 << 7)
999#define V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS (1 << 8)
9781000
9791001/**
9801002 * struct v4l2_plane - plane info for multi-planar buffers
9811003 * @bytesused: number of bytes occupied by data in the plane (payload)
9821004 * @length: size of this plane (NOT the payload) in bytes
983 * @mem_offset: when memory in the associated struct v4l2_buffer is
1005 * @m.mem_offset: when memory in the associated struct v4l2_buffer is
9841006 * V4L2_MEMORY_MMAP, equals the offset from the start of
9851007 * the device memory for this plane (or is a "cookie" that
9861008 * should be passed to mmap() called on the video node)
987 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
1009 * @m.userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
9881010 * pointing to this plane
989 * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
1011 * @m.fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
9901012 * descriptor associated with this plane
9911013 * @m: union of @mem_offset, @userptr and @fd
9921014 * @data_offset: offset in the plane to the start of data; usually 0,
......@@ -1024,14 +1046,14 @@ struct v4l2_plane {
10241046 * @sequence: sequence count of this frame
10251047 * @memory: enum v4l2_memory; the method, in which the actual video data is
10261048 * passed
1027 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
1049 * @m.offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
10281050 * offset from the start of the device memory for this plane,
10291051 * (or a "cookie" that should be passed to mmap() as offset)
1030 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
1052 * @m.userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
10311053 * a userspace pointer pointing to this buffer
1032 * @fd: for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
1054 * @m.fd: for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
10331055 * a userspace file descriptor associated with this buffer
1034 * @planes: for multiplanar buffers; userspace pointer to the array of plane
1056 * @m.planes: for multiplanar buffers; userspace pointer to the array of plane
10351057 * info structs for this buffer
10361058 * @m: union of @offset, @userptr, @planes and @fd
10371059 * @length: size in bytes of the buffer (NOT its payload) for single-plane
......@@ -1657,7 +1679,7 @@ struct v4l2_input {
16571679 __u8 name[32]; /* Label */
16581680 __u32 type; /* Type of input */
16591681 __u32 audioset; /* Associated audios (bitfield) */
1660 __u32 tuner; /* enum v4l2_tuner_type */
1682 __u32 tuner; /* Tuner index */
16611683 v4l2_std_id std;
16621684 __u32 status;
16631685 __u32 capabilities;
......@@ -1744,8 +1766,8 @@ struct v4l2_ext_control {
17441766 __u8 *p_u8;
17451767 __u16 *p_u16;
17461768 __u32 *p_u32;
1747 __u32 *p_s32;
1748 __u32 *p_s64;
1769 __s32 *p_s32;
1770 __s64 *p_s64;
17491771 struct v4l2_area *p_area;
17501772 struct v4l2_ctrl_h264_sps *p_h264_sps;
17511773 struct v4l2_ctrl_h264_pps *p_h264_pps;
......@@ -1765,8 +1787,14 @@ struct v4l2_ext_control {
17651787 struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params;
17661788 struct v4l2_ctrl_hevc_scaling_matrix *p_hevc_scaling_matrix;
17671789 struct v4l2_ctrl_hevc_decode_params *p_hevc_decode_params;
1790 struct v4l2_ctrl_av1_sequence *p_av1_sequence;
1791 struct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;
1792 struct v4l2_ctrl_av1_frame *p_av1_frame;
1793 struct v4l2_ctrl_av1_film_grain *p_av1_film_grain;
1794 struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll_info;
1795 struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering_display;
17681796 void *ptr;
1769 };
1797 } __attribute__ ((packed));
17701798} __attribute__ ((packed));
17711799
17721800struct v4l2_ext_controls {
......@@ -1834,6 +1862,11 @@ enum v4l2_ctrl_type {
18341862 V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS = 0x0272,
18351863 V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX = 0x0273,
18361864 V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS = 0x0274,
1865
1866 V4L2_CTRL_TYPE_AV1_SEQUENCE = 0x280,
1867 V4L2_CTRL_TYPE_AV1_TILE_GROUP_ENTRY = 0x281,
1868 V4L2_CTRL_TYPE_AV1_FRAME = 0x282,
1869 V4L2_CTRL_TYPE_AV1_FILM_GRAIN = 0x283,
18371870};
18381871
18391872/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
......@@ -2331,23 +2364,32 @@ struct v4l2_sdr_format {
23312364 * struct v4l2_meta_format - metadata format definition
23322365 * @dataformat: little endian four character code (fourcc)
23332366 * @buffersize: maximum size in bytes required for data
2367 * @width: number of data units of data per line (valid for line
2368 * based formats only, see format documentation)
2369 * @height: number of lines of data per buffer (valid for line based
2370 * formats only)
2371 * @bytesperline: offset between the beginnings of two adjacent lines in
2372 * bytes (valid for line based formats only)
23342373 */
23352374struct v4l2_meta_format {
23362375 __u32 dataformat;
23372376 __u32 buffersize;
2377 __u32 width;
2378 __u32 height;
2379 __u32 bytesperline;
23382380} __attribute__ ((packed));
23392381
23402382/**
23412383 * struct v4l2_format - stream data format
2342 * @type: enum v4l2_buf_type; type of the data stream
2343 * @pix: definition of an image format
2344 * @pix_mp: definition of a multiplanar image format
2345 * @win: definition of an overlaid image
2346 * @vbi: raw VBI capture or output parameters
2347 * @sliced: sliced VBI capture or output parameters
2348 * @raw_data: placeholder for future extensions and custom formats
2349 * @fmt: union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr, @meta
2350 * and @raw_data
2384 * @type: enum v4l2_buf_type; type of the data stream
2385 * @fmt.pix: definition of an image format
2386 * @fmt.pix_mp: definition of a multiplanar image format
2387 * @fmt.win: definition of an overlaid image
2388 * @fmt.vbi: raw VBI capture or output parameters
2389 * @fmt.sliced: sliced VBI capture or output parameters
2390 * @fmt.raw_data: placeholder for future extensions and custom formats
2391 * @fmt: union of @pix, @pix_mp, @win, @vbi, @sliced, @sdr,
2392 * @meta and @raw_data
23512393 */
23522394struct v4l2_format {
23532395 __u32 type;
......@@ -2520,6 +2562,9 @@ struct v4l2_dbg_chip_info {
25202562 * @flags: additional buffer management attributes (ignored unless the
25212563 * queue has V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS capability
25222564 * and configured for MMAP streaming I/O).
2565 * @max_num_buffers: if V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS capability flag is set
2566 * this field indicate the maximum possible number of buffers
2567 * for this queue.
25232568 * @reserved: future extensions
25242569 */
25252570struct v4l2_create_buffers {
......@@ -2529,7 +2574,22 @@ struct v4l2_create_buffers {
25292574 struct v4l2_format format;
25302575 __u32 capabilities;
25312576 __u32 flags;
2532 __u32 reserved[6];
2577 __u32 max_num_buffers;
2578 __u32 reserved[5];
2579};
2580
2581/**
2582 * struct v4l2_remove_buffers - VIDIOC_REMOVE_BUFS argument
2583 * @index: the first buffer to be removed
2584 * @count: number of buffers to removed
2585 * @type: enum v4l2_buf_type
2586 * @reserved: future extensions
2587 */
2588struct v4l2_remove_buffers {
2589 __u32 index;
2590 __u32 count;
2591 __u32 type;
2592 __u32 reserved[13];
25332593};
25342594
25352595/*
......@@ -2631,6 +2691,8 @@ struct v4l2_create_buffers {
26312691#define VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info)
26322692
26332693#define VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct v4l2_query_ext_ctrl)
2694#define VIDIOC_REMOVE_BUFS _IOWR('V', 104, struct v4l2_remove_buffers)
2695
26342696
26352697/* Reminder: when adding new ioctls please add support for them to
26362698 drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */
lib/libc/include/any-linux-any/linux/virtio_bt.h-1
......@@ -13,7 +13,6 @@
1313
1414enum virtio_bt_config_type {
1515 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
16 VIRTIO_BT_CONFIG_TYPE_AMP = 1,
1716};
1817
1918enum virtio_bt_config_vendor {
lib/libc/include/any-linux-any/linux/virtio_config.h+18-1
......@@ -52,7 +52,7 @@
5252 * rest are per-device feature bits.
5353 */
5454#define VIRTIO_TRANSPORT_F_START 28
55#define VIRTIO_TRANSPORT_F_END 41
55#define VIRTIO_TRANSPORT_F_END 42
5656
5757#ifndef VIRTIO_CONFIG_NO_LEGACY
5858/* Do we get callbacks when the ring is completely used, even if we've
......@@ -97,8 +97,25 @@
9797 */
9898#define VIRTIO_F_SR_IOV 37
9999
100/*
101 * This feature indicates that the driver passes extra data (besides
102 * identifying the virtqueue) in its device notifications.
103 */
104#define VIRTIO_F_NOTIFICATION_DATA 38
105
106/* This feature indicates that the driver uses the data provided by the device
107 * as a virtqueue identifier in available buffer notifications.
108 */
109#define VIRTIO_F_NOTIF_CONFIG_DATA 39
110
100111/*
101112 * This feature indicates that the driver can reset a queue individually.
102113 */
103114#define VIRTIO_F_RING_RESET 40
115
116/*
117 * This feature indicates that the device support administration virtqueues.
118 */
119#define VIRTIO_F_ADMIN_VQ 41
120
104121#endif /* _LINUX_VIRTIO_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_gpu.h+2
......@@ -309,6 +309,8 @@ struct virtio_gpu_cmd_submit {
309309
310310#define VIRTIO_GPU_CAPSET_VIRGL 1
311311#define VIRTIO_GPU_CAPSET_VIRGL2 2
312/* 3 is reserved for gfxstream */
313#define VIRTIO_GPU_CAPSET_VENUS 4
312314
313315/* VIRTIO_GPU_CMD_GET_CAPSET_INFO */
314316struct virtio_gpu_get_capset_info {
lib/libc/include/any-linux-any/linux/virtio_mem.h+2
......@@ -90,6 +90,8 @@
9090#define VIRTIO_MEM_F_ACPI_PXM 0
9191/* unplugged memory must not be accessed */
9292#define VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE 1
93/* plugged memory will remain plugged when suspending+resuming */
94#define VIRTIO_MEM_F_PERSISTENT_SUSPEND 2
9395
9496
9597/* --- virtio-mem: guest -> host requests --- */
lib/libc/include/any-linux-any/linux/virtio_net.h+158
......@@ -56,11 +56,14 @@
5656#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
5757 * Steering */
5858#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
59#define VIRTIO_NET_F_DEVICE_STATS 50 /* Device can provide device-level statistics. */
60#define VIRTIO_NET_F_VQ_NOTF_COAL 52 /* Device supports virtqueue notification coalescing */
5961#define VIRTIO_NET_F_NOTF_COAL 53 /* Device supports notifications coalescing */
6062#define VIRTIO_NET_F_GUEST_USO4 54 /* Guest can handle USOv4 in. */
6163#define VIRTIO_NET_F_GUEST_USO6 55 /* Guest can handle USOv6 in. */
6264#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO in. */
6365#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
66#define VIRTIO_NET_F_GUEST_HDRLEN 59 /* Guest provides the exact hdr_len value. */
6467#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
6568#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
6669#define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device
......@@ -390,5 +393,160 @@ struct virtio_net_ctrl_coal_rx {
390393};
391394
392395#define VIRTIO_NET_CTRL_NOTF_COAL_RX_SET 1
396#define VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET 2
397#define VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET 3
398
399struct virtio_net_ctrl_coal {
400 __le32 max_packets;
401 __le32 max_usecs;
402};
403
404struct virtio_net_ctrl_coal_vq {
405 __le16 vqn;
406 __le16 reserved;
407 struct virtio_net_ctrl_coal coal;
408};
409
410/*
411 * Device Statistics
412 */
413#define VIRTIO_NET_CTRL_STATS 8
414#define VIRTIO_NET_CTRL_STATS_QUERY 0
415#define VIRTIO_NET_CTRL_STATS_GET 1
416
417struct virtio_net_stats_capabilities {
418
419#define VIRTIO_NET_STATS_TYPE_CVQ (1ULL << 32)
420
421#define VIRTIO_NET_STATS_TYPE_RX_BASIC (1ULL << 0)
422#define VIRTIO_NET_STATS_TYPE_RX_CSUM (1ULL << 1)
423#define VIRTIO_NET_STATS_TYPE_RX_GSO (1ULL << 2)
424#define VIRTIO_NET_STATS_TYPE_RX_SPEED (1ULL << 3)
425
426#define VIRTIO_NET_STATS_TYPE_TX_BASIC (1ULL << 16)
427#define VIRTIO_NET_STATS_TYPE_TX_CSUM (1ULL << 17)
428#define VIRTIO_NET_STATS_TYPE_TX_GSO (1ULL << 18)
429#define VIRTIO_NET_STATS_TYPE_TX_SPEED (1ULL << 19)
430
431 __le64 supported_stats_types[1];
432};
433
434struct virtio_net_ctrl_queue_stats {
435 struct {
436 __le16 vq_index;
437 __le16 reserved[3];
438 __le64 types_bitmap[1];
439 } stats[1];
440};
441
442struct virtio_net_stats_reply_hdr {
443#define VIRTIO_NET_STATS_TYPE_REPLY_CVQ 32
444
445#define VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC 0
446#define VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM 1
447#define VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO 2
448#define VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED 3
449
450#define VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC 16
451#define VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM 17
452#define VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO 18
453#define VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED 19
454 __u8 type;
455 __u8 reserved;
456 __le16 vq_index;
457 __le16 reserved1;
458 __le16 size;
459};
460
461struct virtio_net_stats_cvq {
462 struct virtio_net_stats_reply_hdr hdr;
463
464 __le64 command_num;
465 __le64 ok_num;
466};
467
468struct virtio_net_stats_rx_basic {
469 struct virtio_net_stats_reply_hdr hdr;
470
471 __le64 rx_notifications;
472
473 __le64 rx_packets;
474 __le64 rx_bytes;
475
476 __le64 rx_interrupts;
477
478 __le64 rx_drops;
479 __le64 rx_drop_overruns;
480};
481
482struct virtio_net_stats_tx_basic {
483 struct virtio_net_stats_reply_hdr hdr;
484
485 __le64 tx_notifications;
486
487 __le64 tx_packets;
488 __le64 tx_bytes;
489
490 __le64 tx_interrupts;
491
492 __le64 tx_drops;
493 __le64 tx_drop_malformed;
494};
495
496struct virtio_net_stats_rx_csum {
497 struct virtio_net_stats_reply_hdr hdr;
498
499 __le64 rx_csum_valid;
500 __le64 rx_needs_csum;
501 __le64 rx_csum_none;
502 __le64 rx_csum_bad;
503};
504
505struct virtio_net_stats_tx_csum {
506 struct virtio_net_stats_reply_hdr hdr;
507
508 __le64 tx_csum_none;
509 __le64 tx_needs_csum;
510};
511
512struct virtio_net_stats_rx_gso {
513 struct virtio_net_stats_reply_hdr hdr;
514
515 __le64 rx_gso_packets;
516 __le64 rx_gso_bytes;
517 __le64 rx_gso_packets_coalesced;
518 __le64 rx_gso_bytes_coalesced;
519};
520
521struct virtio_net_stats_tx_gso {
522 struct virtio_net_stats_reply_hdr hdr;
523
524 __le64 tx_gso_packets;
525 __le64 tx_gso_bytes;
526 __le64 tx_gso_segments;
527 __le64 tx_gso_segments_bytes;
528 __le64 tx_gso_packets_noseg;
529 __le64 tx_gso_bytes_noseg;
530};
531
532struct virtio_net_stats_rx_speed {
533 struct virtio_net_stats_reply_hdr hdr;
534
535 /* rx_{packets,bytes}_allowance_exceeded are too long. So rename to
536 * short name.
537 */
538 __le64 rx_ratelimit_packets;
539 __le64 rx_ratelimit_bytes;
540};
541
542struct virtio_net_stats_tx_speed {
543 struct virtio_net_stats_reply_hdr hdr;
544
545 /* tx_{packets,bytes}_allowance_exceeded are too long. So rename to
546 * short name.
547 */
548 __le64 tx_ratelimit_packets;
549 __le64 tx_ratelimit_bytes;
550};
393551
394552#endif /* _LINUX_VIRTIO_NET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_pci.h+79
......@@ -166,6 +166,20 @@ struct virtio_pci_common_cfg {
166166 __le32 queue_used_hi; /* read-write */
167167};
168168
169/*
170 * Warning: do not use sizeof on this: use offsetofend for
171 * specific fields you need.
172 */
173struct virtio_pci_modern_common_cfg {
174 struct virtio_pci_common_cfg cfg;
175
176 __le16 queue_notify_data; /* read-write */
177 __le16 queue_reset; /* read-write */
178
179 __le16 admin_queue_index; /* read-only */
180 __le16 admin_queue_num; /* read-only */
181};
182
169183/* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
170184struct virtio_pci_cfg_cap {
171185 struct virtio_pci_cap cap;
......@@ -204,7 +218,72 @@ struct virtio_pci_cfg_cap {
204218#define VIRTIO_PCI_COMMON_Q_USEDHI 52
205219#define VIRTIO_PCI_COMMON_Q_NDATA 56
206220#define VIRTIO_PCI_COMMON_Q_RESET 58
221#define VIRTIO_PCI_COMMON_ADM_Q_IDX 60
222#define VIRTIO_PCI_COMMON_ADM_Q_NUM 62
207223
208224#endif /* VIRTIO_PCI_NO_MODERN */
209225
226/* Admin command status. */
227#define VIRTIO_ADMIN_STATUS_OK 0
228
229/* Admin command opcode. */
230#define VIRTIO_ADMIN_CMD_LIST_QUERY 0x0
231#define VIRTIO_ADMIN_CMD_LIST_USE 0x1
232
233/* Admin command group type. */
234#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1
235
236/* Transitional device admin command. */
237#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE 0x2
238#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ 0x3
239#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE 0x4
240#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5
241#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6
242
243struct virtio_admin_cmd_hdr {
244 __le16 opcode;
245 /*
246 * 1 - SR-IOV
247 * 2-65535 - reserved
248 */
249 __le16 group_type;
250 /* Unused, reserved for future extensions. */
251 __u8 reserved1[12];
252 __le64 group_member_id;
253};
254
255struct virtio_admin_cmd_status {
256 __le16 status;
257 __le16 status_qualifier;
258 /* Unused, reserved for future extensions. */
259 __u8 reserved2[4];
260};
261
262struct virtio_admin_cmd_legacy_wr_data {
263 __u8 offset; /* Starting offset of the register(s) to write. */
264 __u8 reserved[7];
265 __u8 registers[];
266};
267
268struct virtio_admin_cmd_legacy_rd_data {
269 __u8 offset; /* Starting offset of the register(s) to read. */
270};
271
272#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_END 0
273#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_DEV 0x1
274#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_MEM 0x2
275
276#define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
277
278struct virtio_admin_cmd_notify_info_data {
279 __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
280 __u8 bar; /* BAR of the member or the owner device */
281 __u8 padding[6];
282 __le64 offset; /* Offset within bar. */
283};
284
285struct virtio_admin_cmd_notify_info_result {
286 struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO];
287};
288
210289#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_pmem.h+7
......@@ -14,6 +14,13 @@
1414#include <linux/virtio_ids.h>
1515#include <linux/virtio_config.h>
1616
17/* Feature bits */
18/* guest physical address range will be indicated as shared memory region 0 */
19#define VIRTIO_PMEM_F_SHMEM_REGION 0
20
21/* shmid of the shared memory region corresponding to the pmem */
22#define VIRTIO_PMEM_SHMEM_REGION_ID 0
23
1724struct virtio_pmem_config {
1825 __le64 start;
1926 __le64 size;
lib/libc/include/any-linux-any/linux/virtio_snd.h+154
......@@ -7,6 +7,14 @@
77
88#include <linux/virtio_types.h>
99
10/*******************************************************************************
11 * FEATURE BITS
12 */
13enum {
14 /* device supports control elements */
15 VIRTIO_SND_F_CTLS = 0
16};
17
1018/*******************************************************************************
1119 * CONFIGURATION SPACE
1220 */
......@@ -17,6 +25,8 @@ struct virtio_snd_config {
1725 __le32 streams;
1826 /* # of available channel maps */
1927 __le32 chmaps;
28 /* # of available control elements */
29 __le32 controls;
2030};
2131
2232enum {
......@@ -55,6 +65,15 @@ enum {
5565 /* channel map control request types */
5666 VIRTIO_SND_R_CHMAP_INFO = 0x0200,
5767
68 /* control element request types */
69 VIRTIO_SND_R_CTL_INFO = 0x0300,
70 VIRTIO_SND_R_CTL_ENUM_ITEMS,
71 VIRTIO_SND_R_CTL_READ,
72 VIRTIO_SND_R_CTL_WRITE,
73 VIRTIO_SND_R_CTL_TLV_READ,
74 VIRTIO_SND_R_CTL_TLV_WRITE,
75 VIRTIO_SND_R_CTL_TLV_COMMAND,
76
5877 /* jack event types */
5978 VIRTIO_SND_EVT_JACK_CONNECTED = 0x1000,
6079 VIRTIO_SND_EVT_JACK_DISCONNECTED,
......@@ -63,6 +82,9 @@ enum {
6382 VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED = 0x1100,
6483 VIRTIO_SND_EVT_PCM_XRUN,
6584
85 /* control element event types */
86 VIRTIO_SND_EVT_CTL_NOTIFY = 0x1200,
87
6688 /* common status codes */
6789 VIRTIO_SND_S_OK = 0x8000,
6890 VIRTIO_SND_S_BAD_MSG,
......@@ -331,4 +353,136 @@ struct virtio_snd_chmap_info {
331353 __u8 positions[VIRTIO_SND_CHMAP_MAX_SIZE];
332354};
333355
356/*******************************************************************************
357 * CONTROL ELEMENTS MESSAGES
358 */
359struct virtio_snd_ctl_hdr {
360 /* VIRTIO_SND_R_CTL_XXX */
361 struct virtio_snd_hdr hdr;
362 /* 0 ... virtio_snd_config::controls - 1 */
363 __le32 control_id;
364};
365
366/* supported roles for control elements */
367enum {
368 VIRTIO_SND_CTL_ROLE_UNDEFINED = 0,
369 VIRTIO_SND_CTL_ROLE_VOLUME,
370 VIRTIO_SND_CTL_ROLE_MUTE,
371 VIRTIO_SND_CTL_ROLE_GAIN
372};
373
374/* supported value types for control elements */
375enum {
376 VIRTIO_SND_CTL_TYPE_BOOLEAN = 0,
377 VIRTIO_SND_CTL_TYPE_INTEGER,
378 VIRTIO_SND_CTL_TYPE_INTEGER64,
379 VIRTIO_SND_CTL_TYPE_ENUMERATED,
380 VIRTIO_SND_CTL_TYPE_BYTES,
381 VIRTIO_SND_CTL_TYPE_IEC958
382};
383
384/* supported access rights for control elements */
385enum {
386 VIRTIO_SND_CTL_ACCESS_READ = 0,
387 VIRTIO_SND_CTL_ACCESS_WRITE,
388 VIRTIO_SND_CTL_ACCESS_VOLATILE,
389 VIRTIO_SND_CTL_ACCESS_INACTIVE,
390 VIRTIO_SND_CTL_ACCESS_TLV_READ,
391 VIRTIO_SND_CTL_ACCESS_TLV_WRITE,
392 VIRTIO_SND_CTL_ACCESS_TLV_COMMAND
393};
394
395struct virtio_snd_ctl_info {
396 /* common header */
397 struct virtio_snd_info hdr;
398 /* element role (VIRTIO_SND_CTL_ROLE_XXX) */
399 __le32 role;
400 /* element value type (VIRTIO_SND_CTL_TYPE_XXX) */
401 __le32 type;
402 /* element access right bit map (1 << VIRTIO_SND_CTL_ACCESS_XXX) */
403 __le32 access;
404 /* # of members in the element value */
405 __le32 count;
406 /* index for an element with a non-unique name */
407 __le32 index;
408 /* name identifier string for the element */
409 __u8 name[44];
410 /* additional information about the element's value */
411 union {
412 /* VIRTIO_SND_CTL_TYPE_INTEGER */
413 struct {
414 /* minimum supported value */
415 __le32 min;
416 /* maximum supported value */
417 __le32 max;
418 /* fixed step size for value (0 = variable size) */
419 __le32 step;
420 } integer;
421 /* VIRTIO_SND_CTL_TYPE_INTEGER64 */
422 struct {
423 /* minimum supported value */
424 __le64 min;
425 /* maximum supported value */
426 __le64 max;
427 /* fixed step size for value (0 = variable size) */
428 __le64 step;
429 } integer64;
430 /* VIRTIO_SND_CTL_TYPE_ENUMERATED */
431 struct {
432 /* # of options supported for value */
433 __le32 items;
434 } enumerated;
435 } value;
436};
437
438struct virtio_snd_ctl_enum_item {
439 /* option name */
440 __u8 item[64];
441};
442
443struct virtio_snd_ctl_iec958 {
444 /* AES/IEC958 channel status bits */
445 __u8 status[24];
446 /* AES/IEC958 subcode bits */
447 __u8 subcode[147];
448 /* nothing */
449 __u8 pad;
450 /* AES/IEC958 subframe bits */
451 __u8 dig_subframe[4];
452};
453
454struct virtio_snd_ctl_value {
455 union {
456 /* VIRTIO_SND_CTL_TYPE_BOOLEAN|INTEGER value */
457 __le32 integer[128];
458 /* VIRTIO_SND_CTL_TYPE_INTEGER64 value */
459 __le64 integer64[64];
460 /* VIRTIO_SND_CTL_TYPE_ENUMERATED value (option indexes) */
461 __le32 enumerated[128];
462 /* VIRTIO_SND_CTL_TYPE_BYTES value */
463 __u8 bytes[512];
464 /* VIRTIO_SND_CTL_TYPE_IEC958 value */
465 struct virtio_snd_ctl_iec958 iec958;
466 } value;
467};
468
469/* supported event reason types */
470enum {
471 /* element's value has changed */
472 VIRTIO_SND_CTL_EVT_MASK_VALUE = 0,
473 /* element's information has changed */
474 VIRTIO_SND_CTL_EVT_MASK_INFO,
475 /* element's metadata has changed */
476 VIRTIO_SND_CTL_EVT_MASK_TLV
477};
478
479struct virtio_snd_ctl_event {
480 /* VIRTIO_SND_EVT_CTL_NOTIFY */
481 struct virtio_snd_hdr hdr;
482 /* 0 ... virtio_snd_config::controls - 1 */
483 __le16 control_id;
484 /* event reason bit map (1 << VIRTIO_SND_CTL_EVT_MASK_XXX) */
485 __le16 mask;
486};
487
334488#endif /* VIRTIO_SND_IF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vm_sockets.h+17
......@@ -189,4 +189,21 @@ struct sockaddr_vm {
189189
190190#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
191191
192/* MSG_ZEROCOPY notifications are encoded in the standard error format,
193 * sock_extended_err. See Documentation/networking/msg_zerocopy.rst in
194 * kernel source tree for more details.
195 */
196
197/* 'cmsg_level' field value of 'struct cmsghdr' for notification parsing
198 * when MSG_ZEROCOPY flag is used on transmissions.
199 */
200
201#define SOL_VSOCK 287
202
203/* 'cmsg_type' field value of 'struct cmsghdr' for notification parsing
204 * when MSG_ZEROCOPY flag is used on transmissions.
205 */
206
207#define VSOCK_RECVERR 1
208
192209#endif /* _VM_SOCKETS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wireless.h+1-1
......@@ -831,7 +831,7 @@ struct iw_encode_ext {
831831 * individual keys */
832832 __u16 alg; /* IW_ENCODE_ALG_* */
833833 __u16 key_len;
834 __u8 key[0];
834 __u8 key[];
835835};
836836
837837/* SIOCSIWMLME data */
lib/libc/include/any-linux-any/linux/xfrm.h+9-2
......@@ -4,6 +4,7 @@
44
55#include <linux/in6.h>
66#include <linux/types.h>
7#include <linux/stddef.h>
78
89/* All of the structures in this file may not change size as they are
910 * passed into the kernel from userspace via netlink sockets.
......@@ -33,7 +34,7 @@ struct xfrm_sec_ctx {
3334 __u8 ctx_alg;
3435 __u16 ctx_len;
3536 __u32 ctx_sid;
36 char ctx_str[];
37 char ctx_str[] __counted_by(ctx_len);
3738};
3839
3940/* Security Context Domains of Interpretation */
......@@ -140,6 +141,11 @@ enum {
140141 XFRM_POLICY_MAX = 3
141142};
142143
144enum xfrm_sa_dir {
145 XFRM_SA_DIR_IN = 1,
146 XFRM_SA_DIR_OUT = 2
147};
148
143149enum {
144150 XFRM_SHARE_ANY, /* No limitations */
145151 XFRM_SHARE_SESSION, /* For this session only */
......@@ -227,7 +233,7 @@ enum {
227233#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
228234
229235/*
230 * Generic LSM security context for comunicating to user space
236 * Generic LSM security context for communicating to user space
231237 * NOTE: Same format as sadb_x_sec_ctx
232238 */
233239struct xfrm_user_sec_ctx {
......@@ -314,6 +320,7 @@ enum xfrm_attr_type_t {
314320 XFRMA_SET_MARK_MASK, /* __u32 */
315321 XFRMA_IF_ID, /* __u32 */
316322 XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */
323 XFRMA_SA_DIR, /* __u8 */
317324 __XFRMA_MAX
318325
319326#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */
lib/libc/include/any-linux-any/misc/fastrpc.h+3
......@@ -8,11 +8,14 @@
88#define FASTRPC_IOCTL_ALLOC_DMA_BUFF _IOWR('R', 1, struct fastrpc_alloc_dma_buf)
99#define FASTRPC_IOCTL_FREE_DMA_BUFF _IOWR('R', 2, __u32)
1010#define FASTRPC_IOCTL_INVOKE _IOWR('R', 3, struct fastrpc_invoke)
11/* This ioctl is only supported with secure device nodes */
1112#define FASTRPC_IOCTL_INIT_ATTACH _IO('R', 4)
1213#define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create)
1314#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
1415#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
16/* This ioctl is only supported with secure device nodes */
1517#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
18/* This ioctl is only supported with secure device nodes */
1619#define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init_create_static)
1720#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)
1821#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)
lib/libc/include/any-linux-any/misc/pvpanic.h+5-2
......@@ -3,7 +3,10 @@
33#ifndef __PVPANIC_H__
44#define __PVPANIC_H__
55
6#define PVPANIC_PANICKED (1 << 0)
7#define PVPANIC_CRASH_LOADED (1 << 1)
6#include <linux/const.h>
7
8#define PVPANIC_PANICKED _BITUL(0)
9#define PVPANIC_CRASH_LOADED _BITUL(1)
10#define PVPANIC_SHUTDOWN _BITUL(2)
811
912#endif /* __PVPANIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/ubi-user.h+3-1
......@@ -248,6 +248,7 @@ enum {
248248 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
249249 * @padding: reserved for future, not used, has to be zeroed
250250 * @disable_fm: whether disable fastmap
251 * @need_resv_pool: whether reserve free pebs for filling pool/wl_pool
251252 *
252253 * This data structure is used to specify MTD device UBI has to attach and the
253254 * parameters it has to use. The number which should be assigned to the new UBI
......@@ -293,7 +294,8 @@ struct ubi_attach_req {
293294 __s32 vid_hdr_offset;
294295 __s16 max_beb_per1024;
295296 __s8 disable_fm;
296 __s8 padding[9];
297 __s8 need_resv_pool;
298 __s8 padding[8];
297299};
298300
299301/*
lib/libc/include/any-linux-any/rdma/bnxt_re-abi.h+79
......@@ -41,6 +41,7 @@
4141#define __BNXT_RE_UVERBS_ABI_H__
4242
4343#include <linux/types.h>
44#include <rdma/ib_user_ioctl_cmds.h>
4445
4546#define BNXT_RE_ABI_VERSION 1
4647
......@@ -51,6 +52,10 @@
5152enum {
5253 BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL,
5354 BNXT_RE_UCNTX_CMASK_HAVE_MODE = 0x02ULL,
55 BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED = 0x04ULL,
56 BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED = 0x08ULL,
57 BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL,
58 BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40,
5459};
5560
5661enum bnxt_re_wqe_mode {
......@@ -59,6 +64,14 @@ enum bnxt_re_wqe_mode {
5964 BNXT_QPLIB_WQE_MODE_INVALID = 0x02,
6065};
6166
67enum {
68 BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT = 0x01,
69};
70
71struct bnxt_re_uctx_req {
72 __aligned_u64 comp_mask;
73};
74
6275struct bnxt_re_uctx_resp {
6376 __u32 dev_id;
6477 __u32 max_qp;
......@@ -89,11 +102,20 @@ struct bnxt_re_cq_req {
89102 __aligned_u64 cq_handle;
90103};
91104
105enum bnxt_re_cq_mask {
106 BNXT_RE_CQ_TOGGLE_PAGE_SUPPORT = 0x1,
107};
108
92109struct bnxt_re_cq_resp {
93110 __u32 cqid;
94111 __u32 tail;
95112 __u32 phase;
96113 __u32 rsvd;
114 __aligned_u64 comp_mask;
115};
116
117struct bnxt_re_resize_cq_req {
118 __aligned_u64 cq_va;
97119};
98120
99121struct bnxt_re_qp_req {
......@@ -123,4 +145,61 @@ enum bnxt_re_shpg_offt {
123145 BNXT_RE_END_RESV_OFFT = 0xFF0
124146};
125147
148enum bnxt_re_objects {
149 BNXT_RE_OBJECT_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT),
150 BNXT_RE_OBJECT_NOTIFY_DRV,
151 BNXT_RE_OBJECT_GET_TOGGLE_MEM,
152};
153
154enum bnxt_re_alloc_page_type {
155 BNXT_RE_ALLOC_WC_PAGE = 0,
156 BNXT_RE_ALLOC_DBR_BAR_PAGE,
157 BNXT_RE_ALLOC_DBR_PAGE,
158};
159
160enum bnxt_re_var_alloc_page_attrs {
161 BNXT_RE_ALLOC_PAGE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
162 BNXT_RE_ALLOC_PAGE_TYPE,
163 BNXT_RE_ALLOC_PAGE_DPI,
164 BNXT_RE_ALLOC_PAGE_MMAP_OFFSET,
165 BNXT_RE_ALLOC_PAGE_MMAP_LENGTH,
166};
167
168enum bnxt_re_alloc_page_attrs {
169 BNXT_RE_DESTROY_PAGE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
170};
171
172enum bnxt_re_alloc_page_methods {
173 BNXT_RE_METHOD_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT),
174 BNXT_RE_METHOD_DESTROY_PAGE,
175};
176
177enum bnxt_re_notify_drv_methods {
178 BNXT_RE_METHOD_NOTIFY_DRV = (1U << UVERBS_ID_NS_SHIFT),
179};
180
181/* Toggle mem */
182
183enum bnxt_re_get_toggle_mem_type {
184 BNXT_RE_CQ_TOGGLE_MEM = 0,
185 BNXT_RE_SRQ_TOGGLE_MEM,
186};
187
188enum bnxt_re_var_toggle_mem_attrs {
189 BNXT_RE_TOGGLE_MEM_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
190 BNXT_RE_TOGGLE_MEM_TYPE,
191 BNXT_RE_TOGGLE_MEM_RES_ID,
192 BNXT_RE_TOGGLE_MEM_MMAP_PAGE,
193 BNXT_RE_TOGGLE_MEM_MMAP_OFFSET,
194 BNXT_RE_TOGGLE_MEM_MMAP_LENGTH,
195};
196
197enum bnxt_re_toggle_mem_attrs {
198 BNXT_RE_RELEASE_TOGGLE_MEM_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
199};
200
201enum bnxt_re_toggle_mem_methods {
202 BNXT_RE_METHOD_GET_TOGGLE_MEM = (1U << UVERBS_ID_NS_SHIFT),
203 BNXT_RE_METHOD_RELEASE_TOGGLE_MEM,
204};
126205#endif /* __BNXT_RE_UVERBS_ABI_H__*/
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/efa-abi.h+29-1
......@@ -1,12 +1,13 @@
11/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
22/*
3 * Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
3 * Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
44 */
55
66#ifndef EFA_ABI_USER_H
77#define EFA_ABI_USER_H
88
99#include <linux/types.h>
10#include <rdma/ib_user_ioctl_cmds.h>
1011
1112/*
1213 * Increment this value if any changes that break userspace ABI
......@@ -84,11 +85,17 @@ enum {
8485 EFA_QP_DRIVER_TYPE_SRD = 0,
8586};
8687
88enum {
89 EFA_CREATE_QP_WITH_UNSOLICITED_WRITE_RECV = 1 << 0,
90};
91
8792struct efa_ibv_create_qp {
8893 __u32 comp_mask;
8994 __u32 rq_ring_size; /* bytes */
9095 __u32 sq_ring_size; /* bytes */
9196 __u32 driver_qp_type;
97 __u16 flags;
98 __u8 reserved_90[6];
9299};
93100
94101struct efa_ibv_create_qp_resp {
......@@ -120,6 +127,9 @@ enum {
120127 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
121128 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
122129 EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
130 EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
131 EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
132 EFA_QUERY_DEVICE_CAPS_UNSOLICITED_WRITE_RECV = 1 << 6,
123133};
124134
125135struct efa_ibv_ex_query_device_resp {
......@@ -132,4 +142,22 @@ struct efa_ibv_ex_query_device_resp {
132142 __u32 device_caps;
133143};
134144
145enum {
146 EFA_QUERY_MR_VALIDITY_RECV_IC_ID = 1 << 0,
147 EFA_QUERY_MR_VALIDITY_RDMA_READ_IC_ID = 1 << 1,
148 EFA_QUERY_MR_VALIDITY_RDMA_RECV_IC_ID = 1 << 2,
149};
150
151enum efa_query_mr_attrs {
152 EFA_IB_ATTR_QUERY_MR_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
153 EFA_IB_ATTR_QUERY_MR_RESP_IC_ID_VALIDITY,
154 EFA_IB_ATTR_QUERY_MR_RESP_RECV_IC_ID,
155 EFA_IB_ATTR_QUERY_MR_RESP_RDMA_READ_IC_ID,
156 EFA_IB_ATTR_QUERY_MR_RESP_RDMA_RECV_IC_ID,
157};
158
159enum efa_mr_methods {
160 EFA_IB_METHOD_MR_QUERY = (1U << UVERBS_ID_NS_SHIFT),
161};
162
135163#endif /* EFA_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/hns-abi.h+39-1
......@@ -52,15 +52,36 @@ struct hns_roce_ib_create_cq_resp {
5252 __aligned_u64 cap_flags;
5353};
5454
55enum hns_roce_srq_cap_flags {
56 HNS_ROCE_SRQ_CAP_RECORD_DB = 1 << 0,
57};
58
59enum hns_roce_srq_cap_flags_resp {
60 HNS_ROCE_RSP_SRQ_CAP_RECORD_DB = 1 << 0,
61};
62
5563struct hns_roce_ib_create_srq {
5664 __aligned_u64 buf_addr;
5765 __aligned_u64 db_addr;
5866 __aligned_u64 que_addr;
67 __u32 req_cap_flags; /* Use enum hns_roce_srq_cap_flags */
68 __u32 reserved;
5969};
6070
6171struct hns_roce_ib_create_srq_resp {
6272 __u32 srqn;
63 __u32 reserved;
73 __u32 cap_flags; /* Use enum hns_roce_srq_cap_flags */
74};
75
76enum hns_roce_congest_type_flags {
77 HNS_ROCE_CREATE_QP_FLAGS_DCQCN,
78 HNS_ROCE_CREATE_QP_FLAGS_LDCP,
79 HNS_ROCE_CREATE_QP_FLAGS_HC3,
80 HNS_ROCE_CREATE_QP_FLAGS_DIP,
81};
82
83enum hns_roce_create_qp_comp_mask {
84 HNS_ROCE_CREATE_QP_MASK_CONGEST_TYPE = 1 << 0,
6485};
6586
6687struct hns_roce_ib_create_qp {
......@@ -71,6 +92,9 @@ struct hns_roce_ib_create_qp {
7192 __u8 sq_no_prefetch;
7293 __u8 reserved[5];
7394 __aligned_u64 sdb_addr;
95 __aligned_u64 comp_mask; /* Use enum hns_roce_create_qp_comp_mask */
96 __aligned_u64 create_flags;
97 __aligned_u64 cong_type_flags;
7498};
7599
76100enum hns_roce_qp_cap_flags {
......@@ -85,6 +109,12 @@ struct hns_roce_ib_create_qp_resp {
85109 __aligned_u64 dwqe_mmap_key;
86110};
87111
112struct hns_roce_ib_modify_qp_resp {
113 __u8 tc_mode;
114 __u8 priority;
115 __u8 reserved[6];
116};
117
88118enum {
89119 HNS_ROCE_EXSGE_FLAGS = 1 << 0,
90120 HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1,
......@@ -104,6 +134,8 @@ struct hns_roce_ib_alloc_ucontext_resp {
104134 __u32 reserved;
105135 __u32 config;
106136 __u32 max_inline_data;
137 __u8 congest_type;
138 __u8 reserved0[7];
107139};
108140
109141struct hns_roce_ib_alloc_ucontext {
......@@ -115,4 +147,10 @@ struct hns_roce_ib_alloc_pd_resp {
115147 __u32 pdn;
116148};
117149
150struct hns_roce_ib_create_ah_resp {
151 __u8 dmac[6];
152 __u8 priority;
153 __u8 tc_mode;
154};
155
118156#endif /* HNS_ABI_USER_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_verbs.h+2-1
......@@ -220,7 +220,8 @@ enum ib_uverbs_advise_mr_flag {
220220struct ib_uverbs_query_port_resp_ex {
221221 struct ib_uverbs_query_port_resp legacy_resp;
222222 __u16 port_cap_flags2;
223 __u8 reserved[6];
223 __u8 reserved[2];
224 __u32 active_speed_ex;
224225};
225226
226227struct ib_uverbs_qp_cap {
lib/libc/include/any-linux-any/rdma/irdma-abi.h+9
......@@ -22,10 +22,16 @@ enum irdma_memreg_type {
2222 IRDMA_MEMREG_TYPE_CQ = 2,
2323};
2424
25enum {
26 IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0,
27 IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1,
28};
29
2530struct irdma_alloc_ucontext_req {
2631 __u32 rsvd32;
2732 __u8 userspace_ver;
2833 __u8 rsvd8[3];
34 __aligned_u64 comp_mask;
2935};
3036
3137struct irdma_alloc_ucontext_resp {
......@@ -46,6 +52,9 @@ struct irdma_alloc_ucontext_resp {
4652 __u16 max_hw_sq_chunk;
4753 __u8 hw_rev;
4854 __u8 rsvd2;
55 __aligned_u64 comp_mask;
56 __u16 min_hw_wq_size;
57 __u8 rsvd3[6];
4958};
5059
5160struct irdma_alloc_pd_resp {
lib/libc/include/any-linux-any/rdma/mana-abi.h+12
......@@ -16,8 +16,20 @@
1616
1717#define MANA_IB_UVERBS_ABI_VERSION 1
1818
19enum mana_ib_create_cq_flags {
20 MANA_IB_CREATE_RNIC_CQ = 1 << 0,
21};
22
1923struct mana_ib_create_cq {
2024 __aligned_u64 buf_addr;
25 __u16 flags;
26 __u16 reserved0;
27 __u32 reserved1;
28};
29
30struct mana_ib_create_cq_resp {
31 __u32 cqid;
32 __u32 reserved;
2133};
2234
2335struct mana_ib_create_qp {
lib/libc/include/any-linux-any/rdma/mlx5-abi.h+2
......@@ -37,6 +37,7 @@
3737#include <linux/types.h>
3838#include <linux/if_ether.h> /* For ETH_ALEN. */
3939#include <rdma/ib_user_ioctl_verbs.h>
40#include <rdma/mlx5_user_ioctl_verbs.h>
4041
4142enum {
4243 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
......@@ -275,6 +276,7 @@ struct mlx5_ib_query_device_resp {
275276 __u32 tunnel_offloads_caps; /* enum mlx5_ib_tunnel_offloads */
276277 struct mlx5_ib_dci_streams_caps dci_streams_caps;
277278 __u16 reserved;
279 struct mlx5_ib_uapi_reg reg_c0;
278280};
279281
280282enum mlx5_ib_create_cq_flags {
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_verbs.h+1
......@@ -64,6 +64,7 @@ enum mlx5_ib_uapi_dm_type {
6464 MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM,
6565 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM,
6666 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM,
67 MLX5_IB_UAPI_DM_TYPE_ENCAP_SW_ICM,
6768};
6869
6970enum mlx5_ib_uapi_devx_create_event_channel_flags {
lib/libc/include/any-linux-any/rdma/rdma_netlink.h+10
......@@ -299,6 +299,8 @@ enum rdma_nldev_command {
299299
300300 RDMA_NLDEV_CMD_STAT_GET_STATUS,
301301
302 RDMA_NLDEV_CMD_RES_SRQ_GET_RAW,
303
302304 RDMA_NLDEV_NUM_OPS
303305};
304306
......@@ -554,6 +556,14 @@ enum rdma_nldev_attr {
554556 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_INDEX, /* u32 */
555557 RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC, /* u8 */
556558
559 RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE, /* u8 */
560
561 RDMA_NLDEV_ATTR_DRIVER_DETAILS, /* u8 */
562 /*
563 * QP subtype string, used for driver QPs
564 */
565 RDMA_NLDEV_ATTR_RES_SUBTYPE, /* string */
566
557567 /*
558568 * Always the end
559569 */
lib/libc/include/any-linux-any/rdma/siw-abi.h+1-1
......@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) or BSD-3-Clause */
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause */
22
33/* Authors: Bernard Metzler <bmt@zurich.ibm.com> */
44/* Copyright (c) 2008-2019, IBM Corporation */
lib/libc/include/any-linux-any/regulator/regulator.h created+86
......@@ -0,0 +1,86 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Regulator uapi header
4 *
5 * Author: Naresh Solanki <Naresh.Solanki@9elements.com>
6 */
7
8#ifndef _REGULATOR_H
9#define _REGULATOR_H
10
11#include <stdint.h>
12
13/*
14 * Regulator notifier events.
15 *
16 * UNDER_VOLTAGE Regulator output is under voltage.
17 * OVER_CURRENT Regulator output current is too high.
18 * REGULATION_OUT Regulator output is out of regulation.
19 * FAIL Regulator output has failed.
20 * OVER_TEMP Regulator over temp.
21 * FORCE_DISABLE Regulator forcibly shut down by software.
22 * VOLTAGE_CHANGE Regulator voltage changed.
23 * Data passed is old voltage cast to (void *).
24 * DISABLE Regulator was disabled.
25 * PRE_VOLTAGE_CHANGE Regulator is about to have voltage changed.
26 * Data passed is "struct pre_voltage_change_data"
27 * ABORT_VOLTAGE_CHANGE Regulator voltage change failed for some reason.
28 * Data passed is old voltage cast to (void *).
29 * PRE_DISABLE Regulator is about to be disabled
30 * ABORT_DISABLE Regulator disable failed for some reason
31 *
32 * NOTE: These events can be OR'ed together when passed into handler.
33 */
34
35#define REGULATOR_EVENT_UNDER_VOLTAGE 0x01
36#define REGULATOR_EVENT_OVER_CURRENT 0x02
37#define REGULATOR_EVENT_REGULATION_OUT 0x04
38#define REGULATOR_EVENT_FAIL 0x08
39#define REGULATOR_EVENT_OVER_TEMP 0x10
40#define REGULATOR_EVENT_FORCE_DISABLE 0x20
41#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
42#define REGULATOR_EVENT_DISABLE 0x80
43#define REGULATOR_EVENT_PRE_VOLTAGE_CHANGE 0x100
44#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
45#define REGULATOR_EVENT_PRE_DISABLE 0x400
46#define REGULATOR_EVENT_ABORT_DISABLE 0x800
47#define REGULATOR_EVENT_ENABLE 0x1000
48/*
49 * Following notifications should be emitted only if detected condition
50 * is such that the HW is likely to still be working but consumers should
51 * take a recovery action to prevent problems escalating into errors.
52 */
53#define REGULATOR_EVENT_UNDER_VOLTAGE_WARN 0x2000
54#define REGULATOR_EVENT_OVER_CURRENT_WARN 0x4000
55#define REGULATOR_EVENT_OVER_VOLTAGE_WARN 0x8000
56#define REGULATOR_EVENT_OVER_TEMP_WARN 0x10000
57#define REGULATOR_EVENT_WARN_MASK 0x1E000
58
59struct reg_genl_event {
60 char reg_name[32];
61 uint64_t event;
62};
63
64/* attributes of reg_genl_family */
65enum {
66 REG_GENL_ATTR_UNSPEC,
67 REG_GENL_ATTR_EVENT, /* reg event info needed by user space */
68 __REG_GENL_ATTR_MAX,
69};
70
71#define REG_GENL_ATTR_MAX (__REG_GENL_ATTR_MAX - 1)
72
73/* commands supported by the reg_genl_family */
74enum {
75 REG_GENL_CMD_UNSPEC,
76 REG_GENL_CMD_EVENT, /* kernel->user notifications for reg events */
77 __REG_GENL_CMD_MAX,
78};
79
80#define REG_GENL_CMD_MAX (__REG_GENL_CMD_MAX - 1)
81
82#define REG_GENL_FAMILY_NAME "reg_event"
83#define REG_GENL_VERSION 0x01
84#define REG_GENL_MCAST_GROUP_NAME "reg_mc_group"
85
86#endif /* _REGULATOR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_bsg_mpi3mr.h+8-4
......@@ -382,7 +382,7 @@ struct mpi3mr_bsg_in_reply_buf {
382382 __u8 mpi_reply_type;
383383 __u8 rsvd1;
384384 __u16 rsvd2;
385 __u8 reply_buf[1];
385 __u8 reply_buf[];
386386};
387387
388388/**
......@@ -401,7 +401,7 @@ struct mpi3mr_buf_entry {
401401 __u32 buf_len;
402402};
403403/**
404 * struct mpi3mr_bsg_buf_entry_list - list of user buffer
404 * struct mpi3mr_buf_entry_list - list of user buffer
405405 * descriptor for MPI Passthrough requests.
406406 *
407407 * @num_of_entries: Number of buffer descriptors
......@@ -424,6 +424,7 @@ struct mpi3mr_buf_entry_list {
424424 * @mrioc_id: Controller ID
425425 * @rsvd1: Reserved
426426 * @timeout: MPI request timeout
427 * @rsvd2: Reserved
427428 * @buf_entry_list: Buffer descriptor list
428429 */
429430struct mpi3mr_bsg_mptcmd {
......@@ -441,8 +442,9 @@ struct mpi3mr_bsg_mptcmd {
441442 * @cmd_type: represents drvrcmd or mptcmd
442443 * @rsvd1: Reserved
443444 * @rsvd2: Reserved
444 * @drvrcmd: driver request structure
445 * @mptcmd: mpt request structure
445 * @rsvd3: Reserved
446 * @cmd.drvrcmd: driver request structure
447 * @cmd.mptcmd: mpt request structure
446448 */
447449struct mpi3mr_bsg_packet {
448450 __u8 cmd_type;
......@@ -491,6 +493,8 @@ struct mpi3_nvme_encapsulated_error_reply {
491493#define MPI3MR_NVME_DATA_FORMAT_PRP 0
492494#define MPI3MR_NVME_DATA_FORMAT_SGL1 1
493495#define MPI3MR_NVME_DATA_FORMAT_SGL2 2
496#define MPI3MR_NVMESGL_DATA_SEGMENT 0x00
497#define MPI3MR_NVMESGL_LAST_SEGMENT 0x03
494498
495499/* MPI3: task management related definitions */
496500struct mpi3_scsi_task_mgmt_request {
lib/libc/include/any-linux-any/scsi/scsi_bsg_ufs.h+77-4
......@@ -8,6 +8,7 @@
88#ifndef SCSI_BSG_UFS_H
99#define SCSI_BSG_UFS_H
1010
11#include <asm/byteorder.h>
1112#include <linux/types.h>
1213/*
1314 * This file intended to be included by both kernel and user space
......@@ -40,11 +41,56 @@ enum ufs_rpmb_op_type {
4041 * @dword_0: UPIU header DW-0
4142 * @dword_1: UPIU header DW-1
4243 * @dword_2: UPIU header DW-2
44 *
45 * @transaction_code: Type of request or response. See also enum
46 * upiu_request_transaction and enum upiu_response_transaction.
47 * @flags: UPIU flags. The meaning of individual flags depends on the
48 * transaction code.
49 * @lun: Logical unit number.
50 * @task_tag: Task tag.
51 * @iid: Initiator ID.
52 * @command_set_type: 0 for SCSI command set; 1 for UFS specific.
53 * @tm_function: Task management function in case of a task management request
54 * UPIU.
55 * @query_function: Query function in case of a query request UPIU.
56 * @response: 0 for success; 1 for failure.
57 * @status: SCSI status if this is the header of a response to a SCSI command.
58 * @ehs_length: EHS length in units of 32 bytes.
59 * @device_information:
60 * @data_segment_length: data segment length.
4361 */
4462struct utp_upiu_header {
45 __be32 dword_0;
46 __be32 dword_1;
47 __be32 dword_2;
63 union {
64 struct {
65 __be32 dword_0;
66 __be32 dword_1;
67 __be32 dword_2;
68 };
69 struct {
70 __u8 transaction_code;
71 __u8 flags;
72 __u8 lun;
73 __u8 task_tag;
74#if defined(__BIG_ENDIAN)
75 __u8 iid: 4;
76 __u8 command_set_type: 4;
77#elif defined(__LITTLE_ENDIAN)
78 __u8 command_set_type: 4;
79 __u8 iid: 4;
80#else
81#error
82#endif
83 union {
84 __u8 tm_function;
85 __u8 query_function;
86 } __attribute__((packed));
87 __u8 response;
88 __u8 status;
89 __u8 ehs_length;
90 __u8 device_information;
91 __be16 data_segment_length;
92 };
93 };
4894};
4995
5096/**
......@@ -70,9 +116,36 @@ struct utp_upiu_query {
70116 __be32 reserved[2];
71117};
72118
119/**
120 * struct utp_upiu_query_v4_0 - upiu request buffer structure for
121 * query request >= UFS 4.0 spec.
122 * @opcode: command to perform B-0
123 * @idn: a value that indicates the particular type of data B-1
124 * @index: Index to further identify data B-2
125 * @selector: Index to further identify data B-3
126 * @osf3: spec field B-4
127 * @osf4: spec field B-5
128 * @osf5: spec field B 6,7
129 * @osf6: spec field DW 8,9
130 * @osf7: spec field DW 10,11
131 */
132struct utp_upiu_query_v4_0 {
133 __u8 opcode;
134 __u8 idn;
135 __u8 index;
136 __u8 selector;
137 __u8 osf3;
138 __u8 osf4;
139 __be16 osf5;
140 __be32 osf6;
141 __be32 osf7;
142 /* private: */
143 __be32 reserved;
144};
145
73146/**
74147 * struct utp_upiu_cmd - Command UPIU structure
75 * @data_transfer_len: Data Transfer Length DW-3
148 * @exp_data_transfer_len: Data Transfer Length DW-3
76149 * @cdb: Command Descriptor Block CDB DW-4 to DW-7
77150 */
78151struct utp_upiu_cmd {
lib/libc/include/any-linux-any/sound/asequencer.h+69-17
......@@ -10,7 +10,7 @@
1010#include <sound/asound.h>
1111
1212/** version of the sequencer */
13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 2)
13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3)
1414
1515/**
1616 * definition of sequencer event types
......@@ -174,6 +174,7 @@ struct snd_seq_connect {
174174#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
175175#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
176176
177#define SNDRV_SEQ_EVENT_UMP (1<<5) /* event holds a UMP packet */
177178
178179 /* note event */
179180struct snd_seq_ev_note {
......@@ -252,6 +253,19 @@ struct snd_seq_ev_quote {
252253 struct snd_seq_event *event; /* quoted event */
253254} __attribute__((packed));
254255
256union snd_seq_event_data { /* event data... */
257 struct snd_seq_ev_note note;
258 struct snd_seq_ev_ctrl control;
259 struct snd_seq_ev_raw8 raw8;
260 struct snd_seq_ev_raw32 raw32;
261 struct snd_seq_ev_ext ext;
262 struct snd_seq_ev_queue_control queue;
263 union snd_seq_timestamp time;
264 struct snd_seq_addr addr;
265 struct snd_seq_connect connect;
266 struct snd_seq_result result;
267 struct snd_seq_ev_quote quote;
268};
255269
256270 /* sequencer event */
257271struct snd_seq_event {
......@@ -262,25 +276,27 @@ struct snd_seq_event {
262276 unsigned char queue; /* schedule queue */
263277 union snd_seq_timestamp time; /* schedule time */
264278
265
266279 struct snd_seq_addr source; /* source address */
267280 struct snd_seq_addr dest; /* destination address */
268281
269 union { /* event data... */
270 struct snd_seq_ev_note note;
271 struct snd_seq_ev_ctrl control;
272 struct snd_seq_ev_raw8 raw8;
273 struct snd_seq_ev_raw32 raw32;
274 struct snd_seq_ev_ext ext;
275 struct snd_seq_ev_queue_control queue;
276 union snd_seq_timestamp time;
277 struct snd_seq_addr addr;
278 struct snd_seq_connect connect;
279 struct snd_seq_result result;
280 struct snd_seq_ev_quote quote;
281 } data;
282 union snd_seq_event_data data;
282283};
283284
285 /* (compatible) event for UMP-capable clients */
286struct snd_seq_ump_event {
287 snd_seq_event_type_t type; /* event type */
288 unsigned char flags; /* event flags */
289 char tag;
290 unsigned char queue; /* schedule queue */
291 union snd_seq_timestamp time; /* schedule time */
292 struct snd_seq_addr source; /* source address */
293 struct snd_seq_addr dest; /* destination address */
294
295 union {
296 union snd_seq_event_data data;
297 unsigned int ump[4];
298 };
299};
284300
285301/*
286302 * bounce event - stored as variable size data
......@@ -331,6 +347,7 @@ typedef int __bitwise snd_seq_client_type_t;
331347#define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */
332348#define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */
333349#define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */
350#define SNDRV_SEQ_FILTER_NO_CONVERT (1U<<30) /* don't convert UMP events */
334351#define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */
335352
336353struct snd_seq_client_info {
......@@ -344,9 +361,18 @@ struct snd_seq_client_info {
344361 int event_lost; /* number of lost events */
345362 int card; /* RO: card number[kernel] */
346363 int pid; /* RO: pid[user] */
347 char reserved[56]; /* for future use */
364 unsigned int midi_version; /* MIDI version */
365 unsigned int group_filter; /* UMP group filter bitmap
366 * (bit 0 = groupless messages,
367 * bit 1-16 = messages for groups 1-16)
368 */
369 char reserved[48]; /* for future use */
348370};
349371
372/* MIDI version numbers in client info */
373#define SNDRV_SEQ_CLIENT_LEGACY_MIDI 0 /* Legacy client */
374#define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0 1 /* UMP MIDI 1.0 */
375#define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0 2 /* UMP MIDI 2.0 */
350376
351377/* client pool size */
352378struct snd_seq_client_pool {
......@@ -406,6 +432,8 @@ struct snd_seq_remove_events {
406432#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
407433#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
408434#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
435#define SNDRV_SEQ_PORT_CAP_INACTIVE (1<<8) /* inactive port */
436#define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT (1<<9) /* MIDI 2.0 UMP Endpoint port */
409437
410438 /* port type */
411439#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
......@@ -415,6 +443,7 @@ struct snd_seq_remove_events {
415443#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
416444#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
417445#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
446#define SNDRV_SEQ_PORT_TYPE_MIDI_UMP (1<<7) /* UMP */
418447
419448/* other standards...*/
420449#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
......@@ -432,6 +461,12 @@ struct snd_seq_remove_events {
432461#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
433462#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
434463
464/* port direction */
465#define SNDRV_SEQ_PORT_DIR_UNKNOWN 0
466#define SNDRV_SEQ_PORT_DIR_INPUT 1
467#define SNDRV_SEQ_PORT_DIR_OUTPUT 2
468#define SNDRV_SEQ_PORT_DIR_BIDIRECTION 3
469
435470struct snd_seq_port_info {
436471 struct snd_seq_addr addr; /* client/port numbers */
437472 char name[64]; /* port name */
......@@ -448,7 +483,9 @@ struct snd_seq_port_info {
448483 void *kernel; /* reserved for kernel use (must be NULL) */
449484 unsigned int flags; /* misc. conditioning */
450485 unsigned char time_queue; /* queue # for timestamping */
451 char reserved[59]; /* for future use */
486 unsigned char direction; /* port usage direction (r/w/bidir) */
487 unsigned char ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */
488 char reserved[57]; /* for future use */
452489};
453490
454491
......@@ -552,6 +589,18 @@ struct snd_seq_query_subs {
552589 char reserved[64]; /* for future use */
553590};
554591
592/*
593 * UMP-specific information
594 */
595/* type of UMP info query */
596#define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT 0
597#define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK 1
598
599struct snd_seq_client_ump_info {
600 int client; /* client number to inquire/set */
601 int type; /* type to inquire/set */
602 unsigned char info[512]; /* info (either UMP ep or block info) */
603} __attribute__((packed));
555604
556605/*
557606 * IOCTL commands
......@@ -561,9 +610,12 @@ struct snd_seq_query_subs {
561610#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
562611#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
563612#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
613#define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int)
564614
565615#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
566616#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
617#define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO _IOWR('S', 0x12, struct snd_seq_client_ump_info)
618#define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO _IOWR('S', 0x13, struct snd_seq_client_ump_info)
567619
568620#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
569621#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
lib/libc/include/any-linux-any/sound/asoc.h+3-59
......@@ -222,9 +222,9 @@ struct snd_soc_tplg_vendor_array {
222222 __le32 type; /* SND_SOC_TPLG_TUPLE_TYPE_ */
223223 __le32 num_elems; /* number of elements in array */
224224 union {
225 struct snd_soc_tplg_vendor_uuid_elem uuid[0];
226 struct snd_soc_tplg_vendor_value_elem value[0];
227 struct snd_soc_tplg_vendor_string_elem string[0];
225 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_uuid_elem, uuid);
226 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_value_elem, value);
227 __DECLARE_FLEX_ARRAY(struct snd_soc_tplg_vendor_string_elem, string);
228228 };
229229} __attribute__((packed));
230230
......@@ -576,60 +576,4 @@ struct snd_soc_tplg_dai {
576576 struct snd_soc_tplg_private priv;
577577} __attribute__((packed));
578578
579/*
580 * Old version of ABI structs, supported for backward compatibility.
581 */
582
583/* Manifest v4 */
584struct snd_soc_tplg_manifest_v4 {
585 __le32 size; /* in bytes of this structure */
586 __le32 control_elems; /* number of control elements */
587 __le32 widget_elems; /* number of widget elements */
588 __le32 graph_elems; /* number of graph elements */
589 __le32 pcm_elems; /* number of PCM elements */
590 __le32 dai_link_elems; /* number of DAI link elements */
591 struct snd_soc_tplg_private priv;
592} __attribute__((packed));
593
594/* Stream Capabilities v4 */
595struct snd_soc_tplg_stream_caps_v4 {
596 __le32 size; /* in bytes of this structure */
597 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
598 __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
599 __le32 rates; /* supported rates SNDRV_PCM_RATE_* */
600 __le32 rate_min; /* min rate */
601 __le32 rate_max; /* max rate */
602 __le32 channels_min; /* min channels */
603 __le32 channels_max; /* max channels */
604 __le32 periods_min; /* min number of periods */
605 __le32 periods_max; /* max number of periods */
606 __le32 period_size_min; /* min period size bytes */
607 __le32 period_size_max; /* max period size bytes */
608 __le32 buffer_size_min; /* min buffer size bytes */
609 __le32 buffer_size_max; /* max buffer size bytes */
610} __attribute__((packed));
611
612/* PCM v4 */
613struct snd_soc_tplg_pcm_v4 {
614 __le32 size; /* in bytes of this structure */
615 char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
616 char dai_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
617 __le32 pcm_id; /* unique ID - used to match with DAI link */
618 __le32 dai_id; /* unique ID - used to match */
619 __le32 playback; /* supports playback mode */
620 __le32 capture; /* supports capture mode */
621 __le32 compress; /* 1 = compressed; 0 = PCM */
622 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
623 __le32 num_streams; /* number of streams */
624 struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
625} __attribute__((packed));
626
627/* Physical link config v4 */
628struct snd_soc_tplg_link_config_v4 {
629 __le32 size; /* in bytes of this structure */
630 __le32 id; /* unique ID - used to match */
631 struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
632 __le32 num_streams; /* number of streams */
633} __attribute__((packed));
634
635579#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asound.h+95-9
......@@ -140,7 +140,7 @@ struct snd_hwdep_dsp_image {
140140 * *
141141 *****************************************************************************/
142142
143#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 15)
143#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 17)
144144
145145typedef unsigned long snd_pcm_uframes_t;
146146typedef signed long snd_pcm_sframes_t;
......@@ -265,13 +265,17 @@ typedef int __bitwise snd_pcm_format_t;
265265
266266typedef int __bitwise snd_pcm_subformat_t;
267267#define SNDRV_PCM_SUBFORMAT_STD ((snd_pcm_subformat_t) 0)
268#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
268#define SNDRV_PCM_SUBFORMAT_MSBITS_MAX ((snd_pcm_subformat_t) 1)
269#define SNDRV_PCM_SUBFORMAT_MSBITS_20 ((snd_pcm_subformat_t) 2)
270#define SNDRV_PCM_SUBFORMAT_MSBITS_24 ((snd_pcm_subformat_t) 3)
271#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_MSBITS_24
269272
270273#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
271274#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
272275#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
273276#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
274277#define SNDRV_PCM_INFO_SYNC_APPLPTR 0x00000020 /* need the explicit sync of appl_ptr update */
278#define SNDRV_PCM_INFO_PERFECT_DRAIN 0x00000040 /* silencing at the end of stream is not required */
275279#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
276280#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
277281#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
......@@ -381,6 +385,9 @@ typedef int snd_pcm_hw_param_t;
381385#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
382386#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
383387#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
388#define SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE (1<<3) /* suppress drain with the filling
389 * of the silence samples
390 */
384391
385392struct snd_interval {
386393 unsigned int min, max;
......@@ -407,7 +414,7 @@ struct snd_pcm_hw_params {
407414 unsigned int rmask; /* W: requested masks */
408415 unsigned int cmask; /* R: changed masks */
409416 unsigned int info; /* R: Info flags for returned setup */
410 unsigned int msbits; /* R: used most significant bits */
417 unsigned int msbits; /* R: used most significant bits (in sample bit-width) */
411418 unsigned int rate_num; /* R: rate numerator */
412419 unsigned int rate_den; /* R: rate denominator */
413420 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
......@@ -427,9 +434,14 @@ struct snd_pcm_sw_params {
427434 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
428435 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
429436 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
430 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
431 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
432 snd_pcm_uframes_t silence_size; /* silence block size */
437 /*
438 * The following two thresholds alleviate playback buffer underruns; when
439 * hw_avail drops below the threshold, the respective action is triggered:
440 */
441 snd_pcm_uframes_t stop_threshold; /* - stop playback */
442 snd_pcm_uframes_t silence_threshold; /* - pre-fill buffer with silence */
443 snd_pcm_uframes_t silence_size; /* max size of silence pre-fill; when >= boundary,
444 * fill played area with silence immediately */
433445 snd_pcm_uframes_t boundary; /* pointers wrap point */
434446 unsigned int proto; /* protocol version */
435447 unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
......@@ -562,7 +574,8 @@ struct __snd_pcm_mmap_status64 {
562574struct __snd_pcm_mmap_control64 {
563575 __pad_before_uframe __pad1;
564576 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
565 __pad_before_uframe __pad2;
577 __pad_before_uframe __pad2; // This should be __pad_after_uframe, but binary
578 // backwards compatibility constraints prevent a fix.
566579
567580 __pad_before_uframe __pad3;
568581 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
......@@ -694,7 +707,7 @@ enum {
694707 * Raw MIDI section - /dev/snd/midi??
695708 */
696709
697#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)
710#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
698711
699712enum {
700713 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
......@@ -705,6 +718,7 @@ enum {
705718#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
706719#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
707720#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
721#define SNDRV_RAWMIDI_INFO_UMP 0x00000008
708722
709723struct snd_rawmidi_info {
710724 unsigned int device; /* RO/WR (control): device number */
......@@ -763,6 +777,72 @@ struct snd_rawmidi_status {
763777 unsigned char reserved[16]; /* reserved for future use */
764778};
765779
780/* UMP EP info flags */
781#define SNDRV_UMP_EP_INFO_STATIC_BLOCKS 0x01
782
783/* UMP EP Protocol / JRTS capability bits */
784#define SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK 0x0300
785#define SNDRV_UMP_EP_INFO_PROTO_MIDI1 0x0100 /* MIDI 1.0 */
786#define SNDRV_UMP_EP_INFO_PROTO_MIDI2 0x0200 /* MIDI 2.0 */
787#define SNDRV_UMP_EP_INFO_PROTO_JRTS_MASK 0x0003
788#define SNDRV_UMP_EP_INFO_PROTO_JRTS_TX 0x0001 /* JRTS Transmit */
789#define SNDRV_UMP_EP_INFO_PROTO_JRTS_RX 0x0002 /* JRTS Receive */
790
791/* UMP Endpoint information */
792struct snd_ump_endpoint_info {
793 int card; /* card number */
794 int device; /* device number */
795 unsigned int flags; /* additional info */
796 unsigned int protocol_caps; /* protocol capabilities */
797 unsigned int protocol; /* current protocol */
798 unsigned int num_blocks; /* # of function blocks */
799 unsigned short version; /* UMP major/minor version */
800 unsigned short family_id; /* MIDI device family ID */
801 unsigned short model_id; /* MIDI family model ID */
802 unsigned int manufacturer_id; /* MIDI manufacturer ID */
803 unsigned char sw_revision[4]; /* software revision */
804 unsigned short padding;
805 unsigned char name[128]; /* endpoint name string */
806 unsigned char product_id[128]; /* unique product id string */
807 unsigned char reserved[32];
808} __attribute__((packed));
809
810/* UMP direction */
811#define SNDRV_UMP_DIR_INPUT 0x01
812#define SNDRV_UMP_DIR_OUTPUT 0x02
813#define SNDRV_UMP_DIR_BIDIRECTION 0x03
814
815/* UMP block info flags */
816#define SNDRV_UMP_BLOCK_IS_MIDI1 (1U << 0) /* MIDI 1.0 port w/o restrict */
817#define SNDRV_UMP_BLOCK_IS_LOWSPEED (1U << 1) /* 31.25Kbps B/W MIDI1 port */
818
819/* UMP block user-interface hint */
820#define SNDRV_UMP_BLOCK_UI_HINT_UNKNOWN 0x00
821#define SNDRV_UMP_BLOCK_UI_HINT_RECEIVER 0x01
822#define SNDRV_UMP_BLOCK_UI_HINT_SENDER 0x02
823#define SNDRV_UMP_BLOCK_UI_HINT_BOTH 0x03
824
825/* UMP groups and blocks */
826#define SNDRV_UMP_MAX_GROUPS 16
827#define SNDRV_UMP_MAX_BLOCKS 32
828
829/* UMP Block information */
830struct snd_ump_block_info {
831 int card; /* card number */
832 int device; /* device number */
833 unsigned char block_id; /* block ID (R/W) */
834 unsigned char direction; /* UMP direction */
835 unsigned char active; /* Activeness */
836 unsigned char first_group; /* first group ID */
837 unsigned char num_groups; /* number of groups */
838 unsigned char midi_ci_version; /* MIDI-CI support version */
839 unsigned char sysex8_streams; /* max number of sysex8 streams */
840 unsigned char ui_hint; /* user interface hint */
841 unsigned int flags; /* various info flags */
842 unsigned char name[128]; /* block name string */
843 unsigned char reserved[32];
844} __attribute__((packed));
845
766846#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
767847#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
768848#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
......@@ -770,6 +850,9 @@ struct snd_rawmidi_status {
770850#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
771851#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
772852#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
853/* Additional ioctls for UMP rawmidi devices */
854#define SNDRV_UMP_IOCTL_ENDPOINT_INFO _IOR('W', 0x40, struct snd_ump_endpoint_info)
855#define SNDRV_UMP_IOCTL_BLOCK_INFO _IOR('W', 0x41, struct snd_ump_block_info)
773856
774857/*
775858 * Timer section - /dev/snd/timer
......@@ -941,7 +1024,7 @@ struct snd_timer_tread {
9411024 * *
9421025 ****************************************************************************/
9431026
944#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
1027#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
9451028
9461029struct snd_ctl_card_info {
9471030 int card; /* card number */
......@@ -1102,6 +1185,9 @@ struct snd_ctl_tlv {
11021185#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
11031186#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
11041187#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
1188#define SNDRV_CTL_IOCTL_UMP_NEXT_DEVICE _IOWR('U', 0x43, int)
1189#define SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO _IOWR('U', 0x44, struct snd_ump_endpoint_info)
1190#define SNDRV_CTL_IOCTL_UMP_BLOCK_INFO _IOWR('U', 0x45, struct snd_ump_block_info)
11051191#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
11061192#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
11071193
lib/libc/include/any-linux-any/sound/emu10k1.h+101-55
......@@ -15,9 +15,6 @@
1515 * ---- FX8010 ----
1616 */
1717
18#define EMU10K1_CARD_CREATIVE 0x00000000
19#define EMU10K1_CARD_EMUAPS 0x00000001
20
2118#define EMU10K1_FX8010_PCM_COUNT 8
2219
2320/*
......@@ -46,6 +43,19 @@
4643#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
4744#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
4845
46#define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */
47#define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */
48#define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */
49#define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */
50#define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */
51
52/* Audigy Soundcards have a different instruction format */
53#define A_LOWORD_OPX_MASK 0x007ff000
54#define A_LOWORD_OPY_MASK 0x000007ff
55#define A_HIWORD_OPCODE_MASK 0x0f000000
56#define A_HIWORD_RESULT_MASK 0x007ff000
57#define A_HIWORD_OPA_MASK 0x000007ff
58
4959/* GPRs */
5060#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
5161#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
......@@ -53,6 +63,16 @@
5363#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
5464 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
5565
66#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
67#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
68#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
69#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
70#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
71#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" */
72#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_01 - _0F" */
73#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x1f "EMU32_IN_00 - _1F" - Only when .device = 0x0008 */
74#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x1f "EMU32_OUT_00 - _1F" - Only when .device = 0x0008 */
75
5676#define C_00000000 0x40
5777#define C_00000001 0x41
5878#define C_00000002 0x42
......@@ -81,12 +101,66 @@
81101#define GPR_NOISE1 0x59 /* noise source */
82102#define GPR_IRQ 0x5a /* IRQ register */
83103#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
104
105/* Audigy constants */
106#define A_C_00000000 0xc0
107#define A_C_00000001 0xc1
108#define A_C_00000002 0xc2
109#define A_C_00000003 0xc3
110#define A_C_00000004 0xc4
111#define A_C_00000008 0xc5
112#define A_C_00000010 0xc6
113#define A_C_00000020 0xc7
114#define A_C_00000100 0xc8
115#define A_C_00010000 0xc9
116#define A_C_00000800 0xca
117#define A_C_10000000 0xcb
118#define A_C_20000000 0xcc
119#define A_C_40000000 0xcd
120#define A_C_80000000 0xce
121#define A_C_7fffffff 0xcf
122#define A_C_ffffffff 0xd0
123#define A_C_fffffffe 0xd1
124#define A_C_c0000000 0xd2
125#define A_C_4f1bbcdc 0xd3
126#define A_C_5a7ef9db 0xd4
127#define A_C_00100000 0xd5
128#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
129#define A_GPR_COND 0xd7 /* CCR, condition register */
130#define A_GPR_NOISE0 0xd8 /* noise source */
131#define A_GPR_NOISE1 0xd9 /* noise source */
132#define A_GPR_IRQ 0xda /* IRQ register */
133#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
134#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
135
136/* Each FX general purpose register is 32 bits in length, all bits are used */
137#define FXGPREGBASE 0x100 /* FX general purpose registers base */
138#define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */
139
140#define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */
141#define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */
142
143/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */
144/* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */
145/* locations are for external TRAM. */
146#define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */
147#define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */
148
149/* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */
150#define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */
151#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
152#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
153#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
154#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
155#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
156
84157#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
85158#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
86159#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
87160#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
88161#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
89162
163#define A_GPR(x) (A_FXGPREGBASE + (x))
90164#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
91165#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
92166#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
......@@ -94,17 +168,6 @@
94168#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
95169#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
96170
97#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
98#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
99#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
100#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
101#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
102#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
103#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
104#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
105#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
106#define A_GPR(x) (A_FXGPREGBASE + (x))
107
108171/* cc_reg constants */
109172#define CC_REG_NORMALIZED C_00000001
110173#define CC_REG_BORROW C_00000002
......@@ -113,7 +176,17 @@
113176#define CC_REG_SATURATE C_00000010
114177#define CC_REG_NONZERO C_00000100
115178
179#define A_CC_REG_NORMALIZED A_C_00000001
180#define A_CC_REG_BORROW A_C_00000002
181#define A_CC_REG_MINUS A_C_00000004
182#define A_CC_REG_ZERO A_C_00000008
183#define A_CC_REG_SATURATE A_C_00000010
184#define A_CC_REG_NONZERO A_C_00000100
185
116186/* FX buses */
187// These are arbitrary mappings; our DSP code simply expects
188// the config files to route the channels this way.
189// The numbers are documented in {audigy,sb-live}-mixer.rst.
117190#define FXBUS_PCM_LEFT 0x00
118191#define FXBUS_PCM_RIGHT 0x01
119192#define FXBUS_PCM_LEFT_REAR 0x02
......@@ -203,38 +276,7 @@
203276#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
204277#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
205278
206/* Audigy constants */
207#define A_C_00000000 0xc0
208#define A_C_00000001 0xc1
209#define A_C_00000002 0xc2
210#define A_C_00000003 0xc3
211#define A_C_00000004 0xc4
212#define A_C_00000008 0xc5
213#define A_C_00000010 0xc6
214#define A_C_00000020 0xc7
215#define A_C_00000100 0xc8
216#define A_C_00010000 0xc9
217#define A_C_00000800 0xca
218#define A_C_10000000 0xcb
219#define A_C_20000000 0xcc
220#define A_C_40000000 0xcd
221#define A_C_80000000 0xce
222#define A_C_7fffffff 0xcf
223#define A_C_ffffffff 0xd0
224#define A_C_fffffffe 0xd1
225#define A_C_c0000000 0xd2
226#define A_C_4f1bbcdc 0xd3
227#define A_C_5a7ef9db 0xd4
228#define A_C_00100000 0xd5
229#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
230#define A_GPR_COND 0xd7 /* CCR, condition register */
231#define A_GPR_NOISE0 0xd8 /* noise source */
232#define A_GPR_NOISE1 0xd9 /* noise source */
233#define A_GPR_IRQ 0xda /* IRQ register */
234#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
235#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
236
237/* definitions for debug register */
279/* Definitions for debug register. Note that these are for emu10k1 ONLY. */
238280#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
239281#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
240282#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
......@@ -243,12 +285,14 @@
243285#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
244286#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
245287
246/* tank memory address line */
247#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
248#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
249#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
250#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
251#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
288/* Definitions for emu10k2 debug register. */
289#define A_DBG_ZC 0x40000000 /* zero tram counter */
290#define A_DBG_SATURATION_OCCURED 0x20000000
291#define A_DBG_SATURATION_ADDR 0x0ffc0000
292#define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */
293#define A_DBG_STEP 0x00010000
294#define A_DBG_CONDITION_CODE 0x0000f800
295#define A_DBG_STEP_ADDR 0x000003ff
252296
253297struct snd_emu10k1_fx8010_info {
254298 unsigned int internal_tram_size; /* in samples */
......@@ -264,6 +308,8 @@ struct snd_emu10k1_fx8010_info {
264308#define EMU10K1_GPR_TRANSLATION_BASS 2
265309#define EMU10K1_GPR_TRANSLATION_TREBLE 3
266310#define EMU10K1_GPR_TRANSLATION_ONOFF 4
311#define EMU10K1_GPR_TRANSLATION_NEGATE 5
312#define EMU10K1_GPR_TRANSLATION_NEG_TABLE100 6
267313
268314enum emu10k1_ctl_elem_iface {
269315 EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */
......@@ -284,9 +330,9 @@ struct snd_emu10k1_fx8010_control_gpr {
284330 unsigned int vcount; /* visible count */
285331 unsigned int count; /* count of GPR (1..16) */
286332 unsigned short gpr[32]; /* GPR number(s) */
287 unsigned int value[32]; /* initial values */
288 unsigned int min; /* minimum range */
289 unsigned int max; /* maximum range */
333 int value[32]; /* initial values */
334 int min; /* minimum range */
335 int max; /* maximum range */
290336 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
291337 const unsigned int *tlv;
292338};
lib/libc/include/any-linux-any/sound/intel/avs/tokens.h+10-1
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22/*
3 * Copyright(c) 2021 Intel Corporation. All rights reserved.
3 * Copyright(c) 2021 Intel Corporation
44 *
55 * Authors: Cezary Rojewski <cezary.rojewski@intel.com>
66 * Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
......@@ -19,6 +19,8 @@ enum avs_tplg_token {
1919 AVS_TKN_MANIFEST_NUM_MODCFGS_EXT_U32 = 6,
2020 AVS_TKN_MANIFEST_NUM_PPLCFGS_U32 = 7,
2121 AVS_TKN_MANIFEST_NUM_BINDINGS_U32 = 8,
22 AVS_TKN_MANIFEST_NUM_CONDPATH_TMPLS_U32 = 9,
23 AVS_TKN_MANIFEST_NUM_INIT_CONFIGS_U32 = 10,
2224
2325 /* struct avs_tplg_library */
2426 AVS_TKN_LIBRARY_ID_U32 = 101,
......@@ -109,6 +111,8 @@ enum avs_tplg_token {
109111 AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705,
110112 AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706,
111113 AVS_TKN_MOD_KCONTROL_ID_U32 = 1707,
114 AVS_TKN_MOD_INIT_CONFIG_NUM_IDS_U32 = 1708,
115 AVS_TKN_MOD_INIT_CONFIG_ID_U32 = 1709,
112116
113117 /* struct avs_tplg_path_template */
114118 AVS_TKN_PATH_TMPL_ID_U32 = 1801,
......@@ -125,6 +129,11 @@ enum avs_tplg_token {
125129
126130 /* struct avs_tplg_kcontrol */
127131 AVS_TKN_KCONTROL_ID_U32 = 2301,
132
133 /* struct avs_tplg_init_config */
134 AVS_TKN_INIT_CONFIG_ID_U32 = 2401,
135 AVS_TKN_INIT_CONFIG_PARAM_U8 = 2402,
136 AVS_TKN_INIT_CONFIG_LENGTH_U32 = 2403,
128137};
129138
130139#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/scarlett2.h created+54
......@@ -0,0 +1,54 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Focusrite Scarlett 2 Protocol Driver for ALSA
4 * (including Scarlett 2nd Gen, 3rd Gen, 4th Gen, Clarett USB, and
5 * Clarett+ series products)
6 *
7 * Copyright (c) 2023 by Geoffrey D. Bennett <g at b4.vu>
8 */
9#ifndef __UAPI_SOUND_SCARLETT2_H
10#define __UAPI_SOUND_SCARLETT2_H
11
12#include <linux/types.h>
13#include <linux/ioctl.h>
14
15#define SCARLETT2_HWDEP_MAJOR 1
16#define SCARLETT2_HWDEP_MINOR 0
17#define SCARLETT2_HWDEP_SUBMINOR 0
18
19#define SCARLETT2_HWDEP_VERSION \
20 ((SCARLETT2_HWDEP_MAJOR << 16) | \
21 (SCARLETT2_HWDEP_MINOR << 8) | \
22 SCARLETT2_HWDEP_SUBMINOR)
23
24#define SCARLETT2_HWDEP_VERSION_MAJOR(v) (((v) >> 16) & 0xFF)
25#define SCARLETT2_HWDEP_VERSION_MINOR(v) (((v) >> 8) & 0xFF)
26#define SCARLETT2_HWDEP_VERSION_SUBMINOR(v) ((v) & 0xFF)
27
28/* Get protocol version */
29#define SCARLETT2_IOCTL_PVERSION _IOR('S', 0x60, int)
30
31/* Reboot */
32#define SCARLETT2_IOCTL_REBOOT _IO('S', 0x61)
33
34/* Select flash segment */
35#define SCARLETT2_SEGMENT_ID_SETTINGS 0
36#define SCARLETT2_SEGMENT_ID_FIRMWARE 1
37#define SCARLETT2_SEGMENT_ID_COUNT 2
38
39#define SCARLETT2_IOCTL_SELECT_FLASH_SEGMENT _IOW('S', 0x62, int)
40
41/* Erase selected flash segment */
42#define SCARLETT2_IOCTL_ERASE_FLASH_SEGMENT _IO('S', 0x63)
43
44/* Get selected flash segment erase progress
45 * 1 through to num_blocks, or 255 for complete
46 */
47struct scarlett2_flash_segment_erase_progress {
48 unsigned char progress;
49 unsigned char num_blocks;
50};
51#define SCARLETT2_IOCTL_GET_ERASE_PROGRESS \
52 _IOR('S', 0x64, struct scarlett2_flash_segment_erase_progress)
53
54#endif /* __UAPI_SOUND_SCARLETT2_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/skl-tplg-interface.h-74
......@@ -165,78 +165,4 @@ enum skl_tuple_type {
165165 SKL_TYPE_DATA
166166};
167167
168/* v4 configuration data */
169
170struct skl_dfw_v4_module_pin {
171 __u16 module_id;
172 __u16 instance_id;
173} __attribute__((packed));
174
175struct skl_dfw_v4_module_fmt {
176 __u32 channels;
177 __u32 freq;
178 __u32 bit_depth;
179 __u32 valid_bit_depth;
180 __u32 ch_cfg;
181 __u32 interleaving_style;
182 __u32 sample_type;
183 __u32 ch_map;
184} __attribute__((packed));
185
186struct skl_dfw_v4_module_caps {
187 __u32 set_params:2;
188 __u32 rsvd:30;
189 __u32 param_id;
190 __u32 caps_size;
191 __u32 caps[HDA_SST_CFG_MAX];
192} __attribute__((packed));
193
194struct skl_dfw_v4_pipe {
195 __u8 pipe_id;
196 __u8 pipe_priority;
197 __u16 conn_type:4;
198 __u16 rsvd:4;
199 __u16 memory_pages:8;
200} __attribute__((packed));
201
202struct skl_dfw_v4_module {
203 char uuid[SKL_UUID_STR_SZ];
204
205 __u16 module_id;
206 __u16 instance_id;
207 __u32 max_mcps;
208 __u32 mem_pages;
209 __u32 obs;
210 __u32 ibs;
211 __u32 vbus_id;
212
213 __u32 max_in_queue:8;
214 __u32 max_out_queue:8;
215 __u32 time_slot:8;
216 __u32 core_id:4;
217 __u32 rsvd1:4;
218
219 __u32 module_type:8;
220 __u32 conn_type:4;
221 __u32 dev_type:4;
222 __u32 hw_conn_type:4;
223 __u32 rsvd2:12;
224
225 __u32 params_fixup:8;
226 __u32 converter:8;
227 __u32 input_pin_type:1;
228 __u32 output_pin_type:1;
229 __u32 is_dynamic_in_pin:1;
230 __u32 is_dynamic_out_pin:1;
231 __u32 is_loadable:1;
232 __u32 rsvd3:11;
233
234 struct skl_dfw_v4_pipe pipe;
235 struct skl_dfw_v4_module_fmt in_fmt[MAX_IN_QUEUE];
236 struct skl_dfw_v4_module_fmt out_fmt[MAX_OUT_QUEUE];
237 struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
238 struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
239 struct skl_dfw_v4_module_caps caps;
240} __attribute__((packed));
241
242168#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/abi.h+3-1
......@@ -3,7 +3,7 @@
33 * This file is provided under a dual BSD/GPLv2 license. When using or
44 * redistributing this file, you may do so under either license.
55 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
6 * Copyright(c) 2018 Intel Corporation
77 */
88
99/**
......@@ -60,5 +60,7 @@
6060
6161/* SOF ABI magic number "SOF\0". */
6262#define SOF_ABI_MAGIC 0x00464F53
63/* SOF IPC4 ABI magic number "SOF4". */
64#define SOF_IPC4_ABI_MAGIC 0x34464F53
6365
6466#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/fw.h+1-1
......@@ -3,7 +3,7 @@
33 * This file is provided under a dual BSD/GPLv2 license. When using or
44 * redistributing this file, you may do so under either license.
55 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
6 * Copyright(c) 2018 Intel Corporation
77 */
88
99/*
lib/libc/include/any-linux-any/sound/sof/header.h+20-9
......@@ -3,7 +3,7 @@
33 * This file is provided under a dual BSD/GPLv2 license. When using or
44 * redistributing this file, you may do so under either license.
55 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
6 * Copyright(c) 2018 Intel Corporation
77 */
88
99#ifndef __INCLUDE_UAPI_SOUND_SOF_USER_HEADER_H__
......@@ -11,19 +11,30 @@
1111
1212#include <linux/types.h>
1313
14/*
15 * Header for all non IPC ABI data.
14/**
15 * struct sof_abi_hdr - Header for all non IPC ABI data.
16 * @magic: Magic number for validation
17 * for IPC3 data: 0x00464F53 ('S', 'O', 'F', '\0')
18 * for IPC4 data: 0x34464F53 ('S', 'O', 'F', '4')
19 * @type: module specific parameter
20 * for IPC3: Component specific type
21 * for IPC4: parameter ID (param_id) of the data
22 * @size: The size in bytes of the data, excluding this struct
23 * @abi: SOF ABI version. The version is valid in scope of the 'magic', IPC3 and
24 * IPC4 ABI version numbers have no relationship.
25 * @reserved: Reserved for future use
26 * @data: Component data - opaque to core
1627 *
1728 * Identifies data type, size and ABI.
1829 * Used by any bespoke component data structures or binary blobs.
1930 */
2031struct sof_abi_hdr {
21 __u32 magic; /**< 'S', 'O', 'F', '\0' */
22 __u32 type; /**< component specific type */
23 __u32 size; /**< size in bytes of data excl. this struct */
24 __u32 abi; /**< SOF ABI version */
25 __u32 reserved[4]; /**< reserved for future use */
26 __u32 data[]; /**< Component data - opaque to core */
32 __u32 magic;
33 __u32 type;
34 __u32 size;
35 __u32 abi;
36 __u32 reserved[4];
37 __u32 data[];
2738} __attribute__((packed));
2839
2940#define SOF_MANIFEST_DATA_TYPE_NHLT 1
lib/libc/include/any-linux-any/sound/sof/tokens.h+29-10
......@@ -3,7 +3,7 @@
33 * This file is provided under a dual BSD/GPLv2 license. When using or
44 * redistributing this file, you may do so under either license.
55 *
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
6 * Copyright(c) 2018 Intel Corporation
77 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
88 * Keyon Jie <yang.jie@linux.intel.com>
99 */
......@@ -35,6 +35,7 @@
3535/* buffers */
3636#define SOF_TKN_BUF_SIZE 100
3737#define SOF_TKN_BUF_CAPS 101
38#define SOF_TKN_BUF_FLAGS 102
3839
3940/* DAI */
4041/* Token retired with ABI 3.2, do not use for new capabilities
......@@ -54,6 +55,7 @@
5455#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 206
5556#define SOF_TKN_SCHED_LP_MODE 207
5657#define SOF_TKN_SCHED_MEM_USAGE 208
58#define SOF_TKN_SCHED_USE_CHAIN_DMA 209
5759
5860/* volume */
5961#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
......@@ -88,15 +90,21 @@
8890#define SOF_TKN_COMP_CPC 406
8991#define SOF_TKN_COMP_IS_PAGES 409
9092#define SOF_TKN_COMP_NUM_AUDIO_FORMATS 410
91#define SOF_TKN_COMP_NUM_SINK_PINS 411
92#define SOF_TKN_COMP_NUM_SOURCE_PINS 412
93#define SOF_TKN_COMP_NUM_INPUT_PINS 411
94#define SOF_TKN_COMP_NUM_OUTPUT_PINS 412
9395/*
94 * The token for sink/source pin binding, it specifies the widget
95 * name that the sink/source pin is connected from/to.
96 * The token for input/output pin binding, it specifies the widget
97 * name that the input/output pin is connected from/to.
9698 */
97#define SOF_TKN_COMP_SINK_PIN_BINDING_WNAME 413
98#define SOF_TKN_COMP_SRC_PIN_BINDING_WNAME 414
99
99#define SOF_TKN_COMP_INPUT_PIN_BINDING_WNAME 413
100#define SOF_TKN_COMP_OUTPUT_PIN_BINDING_WNAME 414
101#define SOF_TKN_COMP_NUM_INPUT_AUDIO_FORMATS 415
102#define SOF_TKN_COMP_NUM_OUTPUT_AUDIO_FORMATS 416
103/*
104 * The token value is copied to the dapm_widget's
105 * no_wname_in_kcontrol_name.
106 */
107#define SOF_TKN_COMP_NO_WNAME_IN_KCONTROL_NAME 417
100108
101109/* SSP */
102110#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
......@@ -173,23 +181,25 @@
173181/* CAVS AUDIO FORMAT */
174182#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_RATE 1900
175183#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_BIT_DEPTH 1901
176#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_VALID_BIT 1902
184#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_VALID_BIT_DEPTH 1902
177185#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CHANNELS 1903
178186#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_MAP 1904
179187#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_CFG 1905
180188#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_INTERLEAVING_STYLE 1906
181189#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_FMT_CFG 1907
182190#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_SAMPLE_TYPE 1908
191#define SOF_TKN_CAVS_AUDIO_FORMAT_INPUT_PIN_INDEX 1909
183192/* intentional token numbering discontinuity, reserved for future use */
184193#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_RATE 1930
185194#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_BIT_DEPTH 1931
186#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_VALID_BIT 1932
195#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_VALID_BIT_DEPTH 1932
187196#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CHANNELS 1933
188197#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_MAP 1934
189198#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_CFG 1935
190199#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_INTERLEAVING_STYLE 1936
191200#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_FMT_CFG 1937
192201#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_SAMPLE_TYPE 1938
202#define SOF_TKN_CAVS_AUDIO_FORMAT_OUTPUT_PIN_INDEX 1939
193203/* intentional token numbering discontinuity, reserved for future use */
194204#define SOF_TKN_CAVS_AUDIO_FORMAT_IBS 1970
195205#define SOF_TKN_CAVS_AUDIO_FORMAT_OBS 1971
......@@ -197,10 +207,19 @@
197207
198208/* COPIER */
199209#define SOF_TKN_INTEL_COPIER_NODE_TYPE 1980
210#define SOF_TKN_INTEL_COPIER_DEEP_BUFFER_DMA_MS 1981
200211
201212/* ACP I2S */
202213#define SOF_TKN_AMD_ACPI2S_RATE 1700
203214#define SOF_TKN_AMD_ACPI2S_CH 1701
204215#define SOF_TKN_AMD_ACPI2S_TDM_MODE 1702
205216
217/* MICFIL PDM */
218#define SOF_TKN_IMX_MICFIL_RATE 2000
219#define SOF_TKN_IMX_MICFIL_CH 2001
220
221/* ACP SDW */
222#define SOF_TKN_AMD_ACP_SDW_RATE 2100
223#define SOF_TKN_AMD_ACP_SDW_CH 2101
224
206225#endif
\ No newline at end of file
lib/libc/include/any-linux-any/xen/evtchn.h+9
......@@ -101,4 +101,13 @@ struct ioctl_evtchn_restrict_domid {
101101 domid_t domid;
102102};
103103
104/*
105 * Bind statically allocated @port.
106 */
107#define IOCTL_EVTCHN_BIND_STATIC \
108 _IOC(_IOC_NONE, 'E', 7, sizeof(struct ioctl_evtchn_bind))
109struct ioctl_evtchn_bind {
110 unsigned int port;
111};
112
104113#endif /* __LINUX_PUBLIC_EVTCHN_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/xen/gntalloc.h+4-1
......@@ -31,7 +31,10 @@ struct ioctl_gntalloc_alloc_gref {
3131 __u64 index;
3232 /* The grant references of the newly created grant, one per page */
3333 /* Variable size, depending on count */
34 __u32 gref_ids[1];
34 union {
35 __u32 gref_ids[1];
36 __DECLARE_FLEX_ARRAY(__u32, gref_ids_flex);
37 };
3538};
3639
3740#define GNTALLOC_FLAG_WRITABLE 1
lib/libc/include/any-linux-any/xen/privcmd.h+32
......@@ -98,6 +98,34 @@ struct privcmd_mmap_resource {
9898 __u64 addr;
9999};
100100
101/* For privcmd_irqfd::flags */
102#define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
103
104struct privcmd_irqfd {
105 __u64 dm_op;
106 __u32 size; /* Size of structure pointed by dm_op */
107 __u32 fd;
108 __u32 flags;
109 domid_t dom;
110 __u8 pad[2];
111};
112
113/* For privcmd_ioeventfd::flags */
114#define PRIVCMD_IOEVENTFD_FLAG_DEASSIGN (1 << 0)
115
116struct privcmd_ioeventfd {
117 __u64 ioreq;
118 __u64 ports;
119 __u64 addr;
120 __u32 addr_len;
121 __u32 event_fd;
122 __u32 vcpus;
123 __u32 vq;
124 __u32 flags;
125 domid_t dom;
126 __u8 pad[2];
127};
128
101129/*
102130 * @cmd: IOCTL_PRIVCMD_HYPERCALL
103131 * @arg: &privcmd_hypercall_t
......@@ -125,5 +153,9 @@ struct privcmd_mmap_resource {
125153 _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
126154#define IOCTL_PRIVCMD_MMAP_RESOURCE \
127155 _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
156#define IOCTL_PRIVCMD_IRQFD \
157 _IOW('P', 8, struct privcmd_irqfd)
158#define IOCTL_PRIVCMD_IOEVENTFD \
159 _IOW('P', 9, struct privcmd_ioeventfd)
128160
129161#endif /* __LINUX_PUBLIC_PRIVCMD_H__ */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/page.h-6
......@@ -13,11 +13,6 @@
1313#include <linux/const.h>
1414
1515/* PAGE_SHIFT determines the page size */
16#if defined(CONFIG_ARC_PAGE_SIZE_16K)
17#define PAGE_SHIFT 14
18#elif defined(CONFIG_ARC_PAGE_SIZE_4K)
19#define PAGE_SHIFT 12
20#else
2116/*
2217 * Default 8k
2318 * done this way (instead of under CONFIG_ARC_PAGE_SIZE_8K) because adhoc
......@@ -26,7 +21,6 @@
2621 * not available
2722 */
2823#define PAGE_SHIFT 13
29#endif
3024
3125#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
3226#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
lib/libc/include/arc-linux-any/asm/swab.h+1-1
......@@ -62,7 +62,7 @@
6262 * 8051fdc4: st r2,[r1,20] ; Mem op : save result back to mem
6363 *
6464 * Joern suggested a better "C" algorithm which is great since
65 * (1) It is portable to any architecure
65 * (1) It is portable to any architecture
6666 * (2) At the same time it takes advantage of ARC ISA (rotate intrns)
6767 */
6868
lib/libc/include/arm-linux-any/asm/setup.h+1-1
......@@ -9,7 +9,7 @@
99 * published by the Free Software Foundation.
1010 *
1111 * Structure passed to kernel to tell it about the
12 * hardware it's running on. See Documentation/arm/setup.rst
12 * hardware it's running on. See Documentation/arch/arm/setup.rst
1313 * for more info.
1414 */
1515#ifndef __ASMARM_SETUP_H
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+12
......@@ -404,5 +404,17 @@
404404#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
405405#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
406406#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
407#define __NR_cachestat (__NR_SYSCALL_BASE + 451)
408#define __NR_fchmodat2 (__NR_SYSCALL_BASE + 452)
409#define __NR_map_shadow_stack (__NR_SYSCALL_BASE + 453)
410#define __NR_futex_wake (__NR_SYSCALL_BASE + 454)
411#define __NR_futex_wait (__NR_SYSCALL_BASE + 455)
412#define __NR_futex_requeue (__NR_SYSCALL_BASE + 456)
413#define __NR_statmount (__NR_SYSCALL_BASE + 457)
414#define __NR_listmount (__NR_SYSCALL_BASE + 458)
415#define __NR_lsm_get_self_attr (__NR_SYSCALL_BASE + 459)
416#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
417#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
418#define __NR_mseal (__NR_SYSCALL_BASE + 462)
407419
408420#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h+12
......@@ -416,5 +416,17 @@
416416#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
417417#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
418418#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
419#define __NR_cachestat (__NR_SYSCALL_BASE + 451)
420#define __NR_fchmodat2 (__NR_SYSCALL_BASE + 452)
421#define __NR_map_shadow_stack (__NR_SYSCALL_BASE + 453)
422#define __NR_futex_wake (__NR_SYSCALL_BASE + 454)
423#define __NR_futex_wait (__NR_SYSCALL_BASE + 455)
424#define __NR_futex_requeue (__NR_SYSCALL_BASE + 456)
425#define __NR_statmount (__NR_SYSCALL_BASE + 457)
426#define __NR_listmount (__NR_SYSCALL_BASE + 458)
427#define __NR_lsm_get_self_attr (__NR_SYSCALL_BASE + 459)
428#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE + 460)
429#define __NR_lsm_list_modules (__NR_SYSCALL_BASE + 461)
430#define __NR_mseal (__NR_SYSCALL_BASE + 462)
419431
420432#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd.h+1
......@@ -6,6 +6,7 @@
66#define __ARCH_WANT_SYS_CLONE3
77#define __ARCH_WANT_SET_GET_RLIMIT
88#define __ARCH_WANT_TIME32_SYSCALLS
9#define __ARCH_WANT_SYNC_FILE_RANGE2
910#include <asm-generic/unistd.h>
1011
1112#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
lib/libc/include/hexagon-linux-any/asm/ptrace.h-13
......@@ -29,17 +29,4 @@
2929
3030#define profile_pc(regs) instruction_pointer(regs)
3131
32/* kprobe-based event tracer support */
33extern int regs_query_register_offset(const char *name);
34extern const char *regs_query_register_name(unsigned int offset);
35
36#define current_pt_regs() \
37 ((struct pt_regs *) \
38 ((unsigned long)current_thread_info() + THREAD_SIZE) - 1)
39
40#if CONFIG_HEXAGON_ARCH_VERSION >= 4
41#define arch_has_single_step() (1)
42#endif
43
44
4532#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd.h+1
......@@ -36,5 +36,6 @@
3636#define __ARCH_WANT_SYS_VFORK
3737#define __ARCH_WANT_SYS_FORK
3838#define __ARCH_WANT_TIME32_SYSCALLS
39#define __ARCH_WANT_SYNC_FILE_RANGE2
3940
4041#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/user.h+1-6
......@@ -56,15 +56,10 @@ struct user_regs_struct {
5656 unsigned long pc;
5757 unsigned long cause;
5858 unsigned long badva;
59#if CONFIG_HEXAGON_ARCH_VERSION < 4
60 unsigned long pad1; /* pad out to 48 words total */
61 unsigned long pad2; /* pad out to 48 words total */
62 unsigned long pad3; /* pad out to 48 words total */
63#else
59 /* cs0 and cs1 are only available with HEXAGON_ARCH_VERSION >= 4 */
6460 unsigned long cs0;
6561 unsigned long cs1;
6662 unsigned long pad1; /* pad out to 48 words total */
67#endif
6863};
6964
7065#endif
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/bitsperlong.h deleted-9
......@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_LOONGARCH_BITSPERLONG_H
3#define __ASM_LOONGARCH_BITSPERLONG_H
4
5#define __BITS_PER_LONG (__SIZEOF_LONG__ * 8)
6
7#include <asm-generic/bitsperlong.h>
8
9#endif /* __ASM_LOONGARCH_BITSPERLONG_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/hwcap.h+1
......@@ -16,5 +16,6 @@
1616#define HWCAP_LOONGARCH_LBT_X86 (1 << 10)
1717#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
1818#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
19#define HWCAP_LOONGARCH_PTW (1 << 13)
1920
2021#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/kvm.h created+111
......@@ -0,0 +1,111 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2020-2023 Loongson Technology Corporation Limited
4 */
5
6#ifndef __UAPI_ASM_LOONGARCH_KVM_H
7#define __UAPI_ASM_LOONGARCH_KVM_H
8
9#include <linux/types.h>
10
11/*
12 * KVM LoongArch specific structures and definitions.
13 *
14 * Some parts derived from the x86 version of this file.
15 */
16
17#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
18#define KVM_DIRTY_LOG_PAGE_OFFSET 64
19
20#define KVM_GUESTDBG_USE_SW_BP 0x00010000
21
22/*
23 * for KVM_GET_REGS and KVM_SET_REGS
24 */
25struct kvm_regs {
26 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
27 __u64 gpr[32];
28 __u64 pc;
29};
30
31/*
32 * for KVM_GET_FPU and KVM_SET_FPU
33 */
34struct kvm_fpu {
35 __u32 fcsr;
36 __u64 fcc; /* 8x8 */
37 struct kvm_fpureg {
38 __u64 val64[4];
39 } fpr[32];
40};
41
42/*
43 * For LoongArch, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access various
44 * registers. The id field is broken down as follows:
45 *
46 * bits[63..52] - As per linux/kvm.h
47 * bits[51..32] - Must be zero.
48 * bits[31..16] - Register set.
49 *
50 * Register set = 0: GP registers from kvm_regs (see definitions below).
51 *
52 * Register set = 1: CSR registers.
53 *
54 * Register set = 2: KVM specific registers (see definitions below).
55 *
56 * Register set = 3: FPU / SIMD registers (see definitions below).
57 *
58 * Other sets registers may be added in the future. Each set would
59 * have its own identifier in bits[31..16].
60 */
61
62#define KVM_REG_LOONGARCH_GPR (KVM_REG_LOONGARCH | 0x00000ULL)
63#define KVM_REG_LOONGARCH_CSR (KVM_REG_LOONGARCH | 0x10000ULL)
64#define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL)
65#define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL)
66#define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL)
67#define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL)
68#define KVM_CSR_IDX_MASK 0x7fff
69#define KVM_CPUCFG_IDX_MASK 0x7fff
70
71/*
72 * KVM_REG_LOONGARCH_KVM - KVM specific control registers.
73 */
74
75#define KVM_REG_LOONGARCH_COUNTER (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 1)
76#define KVM_REG_LOONGARCH_VCPU_RESET (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 2)
77/* Debugging: Special instruction for software breakpoint */
78#define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3)
79
80#define LOONGARCH_REG_SHIFT 3
81#define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT))
82#define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG)
83#define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG)
84#define KVM_LOONGARCH_VCPU_CPUCFG 0
85
86struct kvm_debug_exit_arch {
87};
88
89/* for KVM_SET_GUEST_DEBUG */
90struct kvm_guest_debug_arch {
91};
92
93/* definition of registers in kvm_run */
94struct kvm_sync_regs {
95};
96
97/* dummy definition */
98struct kvm_sregs {
99};
100
101struct kvm_iocsr_entry {
102 __u32 addr;
103 __u32 pad;
104 __u64 data;
105};
106
107#define KVM_NR_IRQCHIPS 1
108#define KVM_IRQCHIP_NUM_PINS 64
109#define KVM_MAX_CORES 256
110
111#endif /* __UAPI_ASM_LOONGARCH_KVM_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/ptrace.h+19-3
......@@ -39,9 +39,25 @@ struct user_pt_regs {
3939} __attribute__((aligned(8)));
4040
4141struct user_fp_state {
42 uint64_t fpr[32];
43 uint64_t fcc;
44 uint32_t fcsr;
42 uint64_t fpr[32];
43 uint64_t fcc;
44 uint32_t fcsr;
45};
46
47struct user_lsx_state {
48 /* 32 registers, 128 bits width per register. */
49 uint64_t vregs[32*2];
50};
51
52struct user_lasx_state {
53 /* 32 registers, 256 bits width per register. */
54 uint64_t vregs[32*4];
55};
56
57struct user_lbt_state {
58 uint64_t scr[4];
59 uint32_t eflags;
60 uint32_t ftop;
4561};
4662
4763struct user_watch_state {
lib/libc/include/loongarch-linux-any/asm/sigcontext.h+28
......@@ -41,4 +41,32 @@ struct fpu_context {
4141 __u32 fcsr;
4242};
4343
44/* LSX context */
45#define LSX_CTX_MAGIC 0x53580001
46#define LSX_CTX_ALIGN 16
47struct lsx_context {
48 __u64 regs[2*32];
49 __u64 fcc;
50 __u32 fcsr;
51};
52
53/* LASX context */
54#define LASX_CTX_MAGIC 0x41535801
55#define LASX_CTX_ALIGN 32
56struct lasx_context {
57 __u64 regs[4*32];
58 __u64 fcc;
59 __u32 fcsr;
60};
61
62/* LBT context */
63#define LBT_CTX_MAGIC 0x42540001
64#define LBT_CTX_ALIGN 8
65struct lbt_context {
66 __u64 regs[4];
67 __u32 eflags;
68 __u32 ftop;
69};
70
71
4472#endif /* _ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/ptrace.h+1-1
......@@ -39,7 +39,7 @@ struct pt_regs {
3939 long d0;
4040 long orig_d0;
4141 long stkadj;
42#ifdef CONFIG_COLDFIRE
42#ifdef __mcoldfire__
4343 unsigned format : 4; /* frame format specifier */
4444 unsigned vector : 12; /* vector offset */
4545 unsigned short sr;
lib/libc/include/m68k-linux-any/asm/unistd_32.h+12
......@@ -423,6 +423,18 @@
423423#define __NR_process_mrelease 448
424424#define __NR_futex_waitv 449
425425#define __NR_set_mempolicy_home_node 450
426#define __NR_cachestat 451
427#define __NR_fchmodat2 452
428#define __NR_map_shadow_stack 453
429#define __NR_futex_wake 454
430#define __NR_futex_wait 455
431#define __NR_futex_requeue 456
432#define __NR_statmount 457
433#define __NR_listmount 458
434#define __NR_lsm_get_self_attr 459
435#define __NR_lsm_set_self_attr 460
436#define __NR_lsm_list_modules 461
437#define __NR_mseal 462
426438
427439
428440#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/inst.h+33
......@@ -272,6 +272,27 @@ enum lx_func {
272272 lbx_op = 0x16,
273273};
274274
275/*
276 * func field for special2 MXU opcodes (Ingenic XBurst MXU).
277 */
278enum mxu_func {
279 /* TODO, other MXU funcs */
280 mxu_lx_op = 0x28,
281};
282
283/*
284 * op field for special2 MXU LX opcodes (Ingenic XBurst MXU).
285 */
286enum lx_ingenic_func {
287 mxu_lxb_op,
288 mxu_lxh_op,
289 /* reserved */
290 mxu_lxw_op = 3,
291 mxu_lxbu_op,
292 mxu_lxhu_op,
293 /* more reserved */
294};
295
275296/*
276297 * BSHFL opcodes
277298 */
......@@ -774,6 +795,17 @@ struct dsp_format { /* SPEC3 DSP format instructions */
774795 ;))))))
775796};
776797
798struct mxu_lx_format { /* SPEC2 MXU LX format instructions */
799 __BITFIELD_FIELD(unsigned int opcode : 6,
800 __BITFIELD_FIELD(unsigned int rs : 5,
801 __BITFIELD_FIELD(unsigned int rt : 5,
802 __BITFIELD_FIELD(unsigned int rd : 5,
803 __BITFIELD_FIELD(unsigned int strd : 2,
804 __BITFIELD_FIELD(unsigned int op : 3,
805 __BITFIELD_FIELD(unsigned int func : 6,
806 ;)))))))
807};
808
777809struct spec3_format { /* SPEC3 */
778810 __BITFIELD_FIELD(unsigned int opcode:6,
779811 __BITFIELD_FIELD(unsigned int rs:5,
......@@ -1125,6 +1157,7 @@ union mips_instruction {
11251157 struct loongson3_lswc2_format loongson3_lswc2_format;
11261158 struct loongson3_lsdc2_format loongson3_lsdc2_format;
11271159 struct loongson3_lscsr_format loongson3_lscsr_format;
1160 struct mxu_lx_format mxu_lx_format;
11281161};
11291162
11301163union mips16e_instruction {
lib/libc/include/mips-linux-any/asm/kvm.h-2
......@@ -20,8 +20,6 @@
2020 * Some parts derived from the x86 version of this file.
2121 */
2222
23#define __KVM_HAVE_READONLY_MEM
24
2523#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
2624
2725/*
lib/libc/include/mips-linux-any/asm/mman.h+1-1
......@@ -88,7 +88,7 @@
8888#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
8989#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
9090
91#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
91#define MADV_DONTDUMP 16 /* Explicitly exclude from core dump,
9292 overrides the coredump filter bits */
9393#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
9494
lib/libc/include/mips-linux-any/asm/msgbuf.h+1-1
......@@ -62,7 +62,7 @@ struct msqid64_ds {
6262 unsigned long __unused5;
6363};
6464#else
65#warning no endianess set
65#warning no endianness set
6666#endif
6767
6868#endif /* _ASM_MSGBUF_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/socket.h+3
......@@ -148,6 +148,9 @@
148148
149149#define SO_RCVMARK 75
150150
151#define SO_PASSPIDFD 76
152#define SO_PEERPIDFD 77
153
151154
152155#if __BITS_PER_LONG == 64
153156#define SO_TIMESTAMP SO_TIMESTAMP_OLD
lib/libc/include/mips-linux-any/asm/unistd_n32.h+12
......@@ -379,5 +379,17 @@
379379#define __NR_process_mrelease (__NR_Linux + 448)
380380#define __NR_futex_waitv (__NR_Linux + 449)
381381#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
382#define __NR_cachestat (__NR_Linux + 451)
383#define __NR_fchmodat2 (__NR_Linux + 452)
384#define __NR_map_shadow_stack (__NR_Linux + 453)
385#define __NR_futex_wake (__NR_Linux + 454)
386#define __NR_futex_wait (__NR_Linux + 455)
387#define __NR_futex_requeue (__NR_Linux + 456)
388#define __NR_statmount (__NR_Linux + 457)
389#define __NR_listmount (__NR_Linux + 458)
390#define __NR_lsm_get_self_attr (__NR_Linux + 459)
391#define __NR_lsm_set_self_attr (__NR_Linux + 460)
392#define __NR_lsm_list_modules (__NR_Linux + 461)
393#define __NR_mseal (__NR_Linux + 462)
382394
383395#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h+12
......@@ -355,5 +355,17 @@
355355#define __NR_process_mrelease (__NR_Linux + 448)
356356#define __NR_futex_waitv (__NR_Linux + 449)
357357#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
358#define __NR_cachestat (__NR_Linux + 451)
359#define __NR_fchmodat2 (__NR_Linux + 452)
360#define __NR_map_shadow_stack (__NR_Linux + 453)
361#define __NR_futex_wake (__NR_Linux + 454)
362#define __NR_futex_wait (__NR_Linux + 455)
363#define __NR_futex_requeue (__NR_Linux + 456)
364#define __NR_statmount (__NR_Linux + 457)
365#define __NR_listmount (__NR_Linux + 458)
366#define __NR_lsm_get_self_attr (__NR_Linux + 459)
367#define __NR_lsm_set_self_attr (__NR_Linux + 460)
368#define __NR_lsm_list_modules (__NR_Linux + 461)
369#define __NR_mseal (__NR_Linux + 462)
358370
359371#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h+12
......@@ -425,5 +425,17 @@
425425#define __NR_process_mrelease (__NR_Linux + 448)
426426#define __NR_futex_waitv (__NR_Linux + 449)
427427#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
428#define __NR_cachestat (__NR_Linux + 451)
429#define __NR_fchmodat2 (__NR_Linux + 452)
430#define __NR_map_shadow_stack (__NR_Linux + 453)
431#define __NR_futex_wake (__NR_Linux + 454)
432#define __NR_futex_wait (__NR_Linux + 455)
433#define __NR_futex_requeue (__NR_Linux + 456)
434#define __NR_statmount (__NR_Linux + 457)
435#define __NR_listmount (__NR_Linux + 458)
436#define __NR_lsm_get_self_attr (__NR_Linux + 459)
437#define __NR_lsm_set_self_attr (__NR_Linux + 460)
438#define __NR_lsm_list_modules (__NR_Linux + 461)
439#define __NR_mseal (__NR_Linux + 462)
428440
429441#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/bootx.h+1-1
......@@ -108,7 +108,7 @@ typedef struct boot_infos
108108 /* ALL BELOW NEW (vers. 4) */
109109
110110 /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
111 (non-PCI) only. On PCI, memory is contiguous and it's size is in the
111 (non-PCI) only. On PCI, memory is contiguous and its size is in the
112112 device-tree. */
113113 boot_info_map_entry_t
114114 physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
lib/libc/include/powerpc-linux-any/asm/elf.h+6
......@@ -98,6 +98,8 @@
9898#define ELF_NEBB 3 /* includes ebbrr, ebbhr, bescr */
9999#define ELF_NPMU 5 /* includes siar, sdar, sier, mmcr2, mmcr0 */
100100#define ELF_NPKEY 3 /* includes amr, iamr, uamor */
101#define ELF_NDEXCR 2 /* includes dexcr, hdexcr */
102#define ELF_NHASHKEYR 1 /* includes hashkeyr */
101103
102104typedef unsigned long elf_greg_t64;
103105typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG];
......@@ -279,8 +281,12 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
279281#define R_PPC64_TLSLD 108
280282#define R_PPC64_TOCSAVE 109
281283
284#define R_PPC64_REL24_NOTOC 116
282285#define R_PPC64_ENTRY 118
283286
287#define R_PPC64_PCREL34 132
288#define R_PPC64_GOT_PCREL34 133
289
284290#define R_PPC64_REL16 249
285291#define R_PPC64_REL16_LO 250
286292#define R_PPC64_REL16_HI 251
lib/libc/include/powerpc-linux-any/asm/kvm.h+44-1
......@@ -28,7 +28,6 @@
2828#define __KVM_HAVE_PPC_SMT
2929#define __KVM_HAVE_IRQCHIP
3030#define __KVM_HAVE_IRQ_LINE
31#define __KVM_HAVE_GUEST_DEBUG
3231
3332/* Not always available, but if it is, this is the correct offset. */
3433#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
......@@ -733,4 +732,48 @@ struct kvm_ppc_xive_eq {
733732#define KVM_XIVE_TIMA_PAGE_OFFSET 0
734733#define KVM_XIVE_ESB_PAGE_OFFSET 4
735734
735/* for KVM_PPC_GET_PVINFO */
736
737#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
738
739struct kvm_ppc_pvinfo {
740 /* out */
741 __u32 flags;
742 __u32 hcall[4];
743 __u8 pad[108];
744};
745
746/* for KVM_PPC_GET_SMMU_INFO */
747#define KVM_PPC_PAGE_SIZES_MAX_SZ 8
748
749struct kvm_ppc_one_page_size {
750 __u32 page_shift; /* Page shift (or 0) */
751 __u32 pte_enc; /* Encoding in the HPTE (>>12) */
752};
753
754struct kvm_ppc_one_seg_page_size {
755 __u32 page_shift; /* Base page shift of segment (or 0) */
756 __u32 slb_enc; /* SLB encoding for BookS */
757 struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
758};
759
760#define KVM_PPC_PAGE_SIZES_REAL 0x00000001
761#define KVM_PPC_1T_SEGMENTS 0x00000002
762#define KVM_PPC_NO_HASH 0x00000004
763
764struct kvm_ppc_smmu_info {
765 __u64 flags;
766 __u32 slb_size;
767 __u16 data_keys; /* # storage keys supported for data */
768 __u16 instr_keys; /* # storage keys supported for instructions */
769 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
770};
771
772/* for KVM_PPC_RESIZE_HPT_{PREPARE,COMMIT} */
773struct kvm_ppc_resize_hpt {
774 __u64 flags;
775 __u32 shift;
776 __u32 pad;
777};
778
736779#endif /* __LINUX_KVM_POWERPC_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-miscdev.h created+9
......@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_MISCDEV_H_
3#define _PAPR_MISCDEV_H_
4
5enum {
6 PAPR_MISCDEV_IOC_ID = 0xb2,
7};
8
9#endif /* _PAPR_MISCDEV_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-sysparm.h created+58
......@@ -0,0 +1,58 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_SYSPARM_H_
3#define _PAPR_SYSPARM_H_
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7#include <asm/papr-miscdev.h>
8
9enum {
10 PAPR_SYSPARM_MAX_INPUT = 1024,
11 PAPR_SYSPARM_MAX_OUTPUT = 4000,
12};
13
14struct papr_sysparm_io_block {
15 __u32 parameter;
16 __u16 length;
17 __u8 data[PAPR_SYSPARM_MAX_OUTPUT];
18};
19
20/**
21 * PAPR_SYSPARM_IOC_GET - Retrieve the value of a PAPR system parameter.
22 *
23 * Uses _IOWR because of one corner case: Retrieving the value of the
24 * "OS Service Entitlement Status" parameter (60) requires the caller
25 * to supply input data (a date string) in the buffer passed to
26 * firmware. So the @length and @data of the incoming
27 * papr_sysparm_io_block are always used to initialize the work area
28 * supplied to ibm,get-system-parameter. No other parameters are known
29 * to parameterize the result this way, and callers are encouraged
30 * (but not required) to zero-initialize @length and @data in the
31 * common case.
32 *
33 * On error the contents of the ioblock are indeterminate.
34 *
35 * Return:
36 * 0: Success; @length is the length of valid data in @data, not to exceed @PAPR_SYSPARM_MAX_OUTPUT.
37 * -EIO: Platform error. (-1)
38 * -EINVAL: Incorrect data length or format. (-9999)
39 * -EPERM: The calling partition is not allowed to access this parameter. (-9002)
40 * -EOPNOTSUPP: Parameter not supported on this platform (-3)
41 */
42#define PAPR_SYSPARM_IOC_GET _IOWR(PAPR_MISCDEV_IOC_ID, 1, struct papr_sysparm_io_block)
43
44/**
45 * PAPR_SYSPARM_IOC_SET - Update the value of a PAPR system parameter.
46 *
47 * The contents of the ioblock are unchanged regardless of success.
48 *
49 * Return:
50 * 0: Success; the parameter has been updated.
51 * -EIO: Platform error. (-1)
52 * -EINVAL: Incorrect data length or format. (-9999)
53 * -EPERM: The calling partition is not allowed to access this parameter. (-9002)
54 * -EOPNOTSUPP: Parameter not supported on this platform (-3)
55 */
56#define PAPR_SYSPARM_IOC_SET _IOW(PAPR_MISCDEV_IOC_ID, 2, struct papr_sysparm_io_block)
57
58#endif /* _PAPR_SYSPARM_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-vpd.h created+22
......@@ -0,0 +1,22 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_VPD_H_
3#define _PAPR_VPD_H_
4
5#include <asm/ioctl.h>
6#include <asm/papr-miscdev.h>
7
8struct papr_location_code {
9 /*
10 * PAPR+ v2.13 12.3.2.4 Converged Location Code Rules - Length
11 * Restrictions. 79 characters plus nul.
12 */
13 char str[80];
14};
15
16/*
17 * ioctl for /dev/papr-vpd. Returns a VPD handle fd corresponding to
18 * the location code.
19 */
20#define PAPR_VPD_IOC_CREATE_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 0, struct papr_location_code)
21
22#endif /* _PAPR_VPD_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr_pdsm.h deleted-165
......@@ -1,165 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
4 *
5 * (C) Copyright IBM 2020
6 *
7 * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
8 */
9
10#ifndef _ASM_POWERPC_PAPR_PDSM_H_
11#define _ASM_POWERPC_PAPR_PDSM_H_
12
13#include <linux/types.h>
14#include <linux/ndctl.h>
15
16/*
17 * PDSM Envelope:
18 *
19 * The ioctl ND_CMD_CALL exchange data between user-space and kernel via
20 * envelope which consists of 2 headers sections and payload sections as
21 * illustrated below:
22 * +-----------------+---------------+---------------------------+
23 * | 64-Bytes | 8-Bytes | Max 184-Bytes |
24 * +-----------------+---------------+---------------------------+
25 * | ND-HEADER | PDSM-HEADER | PDSM-PAYLOAD |
26 * +-----------------+---------------+---------------------------+
27 * | nd_family | | |
28 * | nd_size_out | cmd_status | |
29 * | nd_size_in | reserved | nd_pdsm_payload |
30 * | nd_command | payload --> | |
31 * | nd_fw_size | | |
32 * | nd_payload ---> | | |
33 * +---------------+-----------------+---------------------------+
34 *
35 * ND Header:
36 * This is the generic libnvdimm header described as 'struct nd_cmd_pkg'
37 * which is interpreted by libnvdimm before passed on to papr_scm. Important
38 * member fields used are:
39 * 'nd_family' : (In) NVDIMM_FAMILY_PAPR_SCM
40 * 'nd_size_in' : (In) PDSM-HEADER + PDSM-IN-PAYLOAD (usually 0)
41 * 'nd_size_out' : (In) PDSM-HEADER + PDSM-RETURN-PAYLOAD
42 * 'nd_command' : (In) One of PAPR_PDSM_XXX
43 * 'nd_fw_size' : (Out) PDSM-HEADER + size of actual payload returned
44 *
45 * PDSM Header:
46 * This is papr-scm specific header that precedes the payload. This is defined
47 * as nd_cmd_pdsm_pkg. Following fields aare available in this header:
48 *
49 * 'cmd_status' : (Out) Errors if any encountered while servicing PDSM.
50 * 'reserved' : Not used, reserved for future and should be set to 0.
51 * 'payload' : A union of all the possible payload structs
52 *
53 * PDSM Payload:
54 *
55 * The layout of the PDSM Payload is defined by various structs shared between
56 * papr_scm and libndctl so that contents of payload can be interpreted. As such
57 * its defined as a union of all possible payload structs as
58 * 'union nd_pdsm_payload'. Based on the value of 'nd_cmd_pkg.nd_command'
59 * appropriate member of the union is accessed.
60 */
61
62/* Max payload size that we can handle */
63#define ND_PDSM_PAYLOAD_MAX_SIZE 184
64
65/* Max payload size that we can handle */
66#define ND_PDSM_HDR_SIZE \
67 (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
68
69/* Various nvdimm health indicators */
70#define PAPR_PDSM_DIMM_HEALTHY 0
71#define PAPR_PDSM_DIMM_UNHEALTHY 1
72#define PAPR_PDSM_DIMM_CRITICAL 2
73#define PAPR_PDSM_DIMM_FATAL 3
74
75/* struct nd_papr_pdsm_health.extension_flags field flags */
76
77/* Indicate that the 'dimm_fuel_gauge' field is valid */
78#define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
79
80/* Indicate that the 'dimm_dsc' field is valid */
81#define PDSM_DIMM_DSC_VALID 2
82
83/*
84 * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
85 * Various flags indicate the health status of the dimm.
86 *
87 * extension_flags : Any extension fields present in the struct.
88 * dimm_unarmed : Dimm not armed. So contents wont persist.
89 * dimm_bad_shutdown : Previous shutdown did not persist contents.
90 * dimm_bad_restore : Contents from previous shutdown werent restored.
91 * dimm_scrubbed : Contents of the dimm have been scrubbed.
92 * dimm_locked : Contents of the dimm cant be modified until CEC reboot
93 * dimm_encrypted : Contents of dimm are encrypted.
94 * dimm_health : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
95 * dimm_fuel_gauge : Life remaining of DIMM as a percentage from 0-100
96 */
97struct nd_papr_pdsm_health {
98 union {
99 struct {
100 __u32 extension_flags;
101 __u8 dimm_unarmed;
102 __u8 dimm_bad_shutdown;
103 __u8 dimm_bad_restore;
104 __u8 dimm_scrubbed;
105 __u8 dimm_locked;
106 __u8 dimm_encrypted;
107 __u16 dimm_health;
108
109 /* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
110 __u16 dimm_fuel_gauge;
111
112 /* Extension flag PDSM_DIMM_DSC_VALID */
113 __u64 dimm_dsc;
114 };
115 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
116 };
117};
118
119/* Flags for injecting specific smart errors */
120#define PDSM_SMART_INJECT_HEALTH_FATAL (1 << 0)
121#define PDSM_SMART_INJECT_BAD_SHUTDOWN (1 << 1)
122
123struct nd_papr_pdsm_smart_inject {
124 union {
125 struct {
126 /* One or more of PDSM_SMART_INJECT_ */
127 __u32 flags;
128 __u8 fatal_enable;
129 __u8 unsafe_shutdown_enable;
130 };
131 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
132 };
133};
134
135/*
136 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
137 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
138 */
139enum papr_pdsm {
140 PAPR_PDSM_MIN = 0x0,
141 PAPR_PDSM_HEALTH,
142 PAPR_PDSM_SMART_INJECT,
143 PAPR_PDSM_MAX,
144};
145
146/* Maximal union that can hold all possible payload types */
147union nd_pdsm_payload {
148 struct nd_papr_pdsm_health health;
149 struct nd_papr_pdsm_smart_inject smart_inject;
150 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
151} __attribute__((packed));
152
153/*
154 * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
155 * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
156 * that should always precede this struct when sent to papr_scm via CMD_CALL
157 * interface.
158 */
159struct nd_pkg_pdsm {
160 __s32 cmd_status; /* Out: Sub-cmd status returned back */
161 __u16 reserved[2]; /* Ignored and to be set as '0' */
162 union nd_pdsm_payload payload;
163} __attribute__((packed));
164
165#endif /* _ASM_POWERPC_PAPR_PDSM_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+12
......@@ -432,6 +432,18 @@
432432#define __NR_process_mrelease 448
433433#define __NR_futex_waitv 449
434434#define __NR_set_mempolicy_home_node 450
435#define __NR_cachestat 451
436#define __NR_fchmodat2 452
437#define __NR_map_shadow_stack 453
438#define __NR_futex_wake 454
439#define __NR_futex_wait 455
440#define __NR_futex_requeue 456
441#define __NR_statmount 457
442#define __NR_listmount 458
443#define __NR_lsm_get_self_attr 459
444#define __NR_lsm_set_self_attr 460
445#define __NR_lsm_list_modules 461
446#define __NR_mseal 462
435447
436448
437449#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h+12
......@@ -404,6 +404,18 @@
404404#define __NR_process_mrelease 448
405405#define __NR_futex_waitv 449
406406#define __NR_set_mempolicy_home_node 450
407#define __NR_cachestat 451
408#define __NR_fchmodat2 452
409#define __NR_map_shadow_stack 453
410#define __NR_futex_wake 454
411#define __NR_futex_wait 455
412#define __NR_futex_requeue 456
413#define __NR_statmount 457
414#define __NR_listmount 458
415#define __NR_lsm_get_self_attr 459
416#define __NR_lsm_set_self_attr 460
417#define __NR_lsm_list_modules 461
418#define __NR_mseal 462
407419
408420
409421#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/auxvec.h+2-1
......@@ -34,6 +34,7 @@
3434#define AT_L3_CACHEGEOMETRY 47
3535
3636/* entries in ARCH_DLINFO */
37#define AT_VECTOR_SIZE_ARCH 9
37#define AT_VECTOR_SIZE_ARCH 10
38#define AT_MINSIGSTKSZ 51
3839
3940#endif /* _ASM_RISCV_AUXVEC_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/elf.h+4-1
......@@ -49,6 +49,7 @@ typedef union __riscv_fp_state elf_fpregset_t;
4949#define R_RISCV_TLS_DTPREL64 9
5050#define R_RISCV_TLS_TPREL32 10
5151#define R_RISCV_TLS_TPREL64 11
52#define R_RISCV_IRELATIVE 58
5253
5354/* Relocation types not used by the dynamic linker */
5455#define R_RISCV_BRANCH 16
......@@ -81,7 +82,6 @@ typedef union __riscv_fp_state elf_fpregset_t;
8182#define R_RISCV_ALIGN 43
8283#define R_RISCV_RVC_BRANCH 44
8384#define R_RISCV_RVC_JUMP 45
84#define R_RISCV_LUI 46
8585#define R_RISCV_GPREL_I 47
8686#define R_RISCV_GPREL_S 48
8787#define R_RISCV_TPREL_I 49
......@@ -93,6 +93,9 @@ typedef union __riscv_fp_state elf_fpregset_t;
9393#define R_RISCV_SET16 55
9494#define R_RISCV_SET32 56
9595#define R_RISCV_32_PCREL 57
96#define R_RISCV_PLT32 59
97#define R_RISCV_SET_ULEB128 60
98#define R_RISCV_SUB_ULEB128 61
9699
97100
98101#endif /* _ASM_RISCV_ELF_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwcap.h+1
......@@ -21,5 +21,6 @@
2121#define COMPAT_HWCAP_ISA_F (1 << ('F' - 'A'))
2222#define COMPAT_HWCAP_ISA_D (1 << ('D' - 'A'))
2323#define COMPAT_HWCAP_ISA_C (1 << ('C' - 'A'))
24#define COMPAT_HWCAP_ISA_V (1 << ('V' - 'A'))
2425
2526#endif /* _ASM_RISCV_HWCAP_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwprobe.h created+76
......@@ -0,0 +1,76 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright 2023 Rivos, Inc
4 */
5
6#ifndef _ASM_HWPROBE_H
7#define _ASM_HWPROBE_H
8
9#include <linux/types.h>
10
11/*
12 * Interface for probing hardware capabilities from userspace, see
13 * Documentation/arch/riscv/hwprobe.rst for more information.
14 */
15struct riscv_hwprobe {
16 __s64 key;
17 __u64 value;
18};
19
20#define RISCV_HWPROBE_KEY_MVENDORID 0
21#define RISCV_HWPROBE_KEY_MARCHID 1
22#define RISCV_HWPROBE_KEY_MIMPID 2
23#define RISCV_HWPROBE_KEY_BASE_BEHAVIOR 3
24#define RISCV_HWPROBE_BASE_BEHAVIOR_IMA (1 << 0)
25#define RISCV_HWPROBE_KEY_IMA_EXT_0 4
26#define RISCV_HWPROBE_IMA_FD (1 << 0)
27#define RISCV_HWPROBE_IMA_C (1 << 1)
28#define RISCV_HWPROBE_IMA_V (1 << 2)
29#define RISCV_HWPROBE_EXT_ZBA (1 << 3)
30#define RISCV_HWPROBE_EXT_ZBB (1 << 4)
31#define RISCV_HWPROBE_EXT_ZBS (1 << 5)
32#define RISCV_HWPROBE_EXT_ZICBOZ (1 << 6)
33#define RISCV_HWPROBE_EXT_ZBC (1 << 7)
34#define RISCV_HWPROBE_EXT_ZBKB (1 << 8)
35#define RISCV_HWPROBE_EXT_ZBKC (1 << 9)
36#define RISCV_HWPROBE_EXT_ZBKX (1 << 10)
37#define RISCV_HWPROBE_EXT_ZKND (1 << 11)
38#define RISCV_HWPROBE_EXT_ZKNE (1 << 12)
39#define RISCV_HWPROBE_EXT_ZKNH (1 << 13)
40#define RISCV_HWPROBE_EXT_ZKSED (1 << 14)
41#define RISCV_HWPROBE_EXT_ZKSH (1 << 15)
42#define RISCV_HWPROBE_EXT_ZKT (1 << 16)
43#define RISCV_HWPROBE_EXT_ZVBB (1 << 17)
44#define RISCV_HWPROBE_EXT_ZVBC (1 << 18)
45#define RISCV_HWPROBE_EXT_ZVKB (1 << 19)
46#define RISCV_HWPROBE_EXT_ZVKG (1 << 20)
47#define RISCV_HWPROBE_EXT_ZVKNED (1 << 21)
48#define RISCV_HWPROBE_EXT_ZVKNHA (1 << 22)
49#define RISCV_HWPROBE_EXT_ZVKNHB (1 << 23)
50#define RISCV_HWPROBE_EXT_ZVKSED (1 << 24)
51#define RISCV_HWPROBE_EXT_ZVKSH (1 << 25)
52#define RISCV_HWPROBE_EXT_ZVKT (1 << 26)
53#define RISCV_HWPROBE_EXT_ZFH (1 << 27)
54#define RISCV_HWPROBE_EXT_ZFHMIN (1 << 28)
55#define RISCV_HWPROBE_EXT_ZIHINTNTL (1 << 29)
56#define RISCV_HWPROBE_EXT_ZVFH (1 << 30)
57#define RISCV_HWPROBE_EXT_ZVFHMIN (1ULL << 31)
58#define RISCV_HWPROBE_EXT_ZFA (1ULL << 32)
59#define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33)
60#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
61#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
62#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
63#define RISCV_HWPROBE_KEY_CPUPERF_0 5
64#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
65#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
66#define RISCV_HWPROBE_MISALIGNED_SLOW (2 << 0)
67#define RISCV_HWPROBE_MISALIGNED_FAST (3 << 0)
68#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0)
69#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0)
70#define RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE 6
71/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
72
73/* Flags */
74#define RISCV_HWPROBE_WHICH_CPUS (1 << 0)
75
76#endif
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/kvm.h+204-2
......@@ -12,9 +12,10 @@
1212#ifndef __ASSEMBLY__
1313
1414#include <linux/types.h>
15#include <asm/bitsperlong.h>
1516#include <asm/ptrace.h>
1617
17#define __KVM_HAVE_READONLY_MEM
18#define __KVM_HAVE_IRQ_LINE
1819
1920#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
2021
......@@ -52,6 +53,8 @@ struct kvm_riscv_config {
5253 unsigned long mvendorid;
5354 unsigned long marchid;
5455 unsigned long mimpid;
56 unsigned long zicboz_block_size;
57 unsigned long satp_mode;
5558};
5659
5760/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
......@@ -64,7 +67,7 @@ struct kvm_riscv_core {
6467#define KVM_RISCV_MODE_S 1
6568#define KVM_RISCV_MODE_U 0
6669
67/* CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
70/* General CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
6871struct kvm_riscv_csr {
6972 unsigned long sstatus;
7073 unsigned long sie;
......@@ -76,6 +79,23 @@ struct kvm_riscv_csr {
7679 unsigned long sip;
7780 unsigned long satp;
7881 unsigned long scounteren;
82 unsigned long senvcfg;
83};
84
85/* AIA CSR registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
86struct kvm_riscv_aia_csr {
87 unsigned long siselect;
88 unsigned long iprio1;
89 unsigned long iprio2;
90 unsigned long sieh;
91 unsigned long siph;
92 unsigned long iprio1h;
93 unsigned long iprio2h;
94};
95
96/* Smstateen CSR for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
97struct kvm_riscv_smstateen_csr {
98 unsigned long sstateen0;
7999};
80100
81101/* TIMER registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
......@@ -105,9 +125,77 @@ enum KVM_RISCV_ISA_EXT_ID {
105125 KVM_RISCV_ISA_EXT_SVINVAL,
106126 KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
107127 KVM_RISCV_ISA_EXT_ZICBOM,
128 KVM_RISCV_ISA_EXT_ZICBOZ,
129 KVM_RISCV_ISA_EXT_ZBB,
130 KVM_RISCV_ISA_EXT_SSAIA,
131 KVM_RISCV_ISA_EXT_V,
132 KVM_RISCV_ISA_EXT_SVNAPOT,
133 KVM_RISCV_ISA_EXT_ZBA,
134 KVM_RISCV_ISA_EXT_ZBS,
135 KVM_RISCV_ISA_EXT_ZICNTR,
136 KVM_RISCV_ISA_EXT_ZICSR,
137 KVM_RISCV_ISA_EXT_ZIFENCEI,
138 KVM_RISCV_ISA_EXT_ZIHPM,
139 KVM_RISCV_ISA_EXT_SMSTATEEN,
140 KVM_RISCV_ISA_EXT_ZICOND,
141 KVM_RISCV_ISA_EXT_ZBC,
142 KVM_RISCV_ISA_EXT_ZBKB,
143 KVM_RISCV_ISA_EXT_ZBKC,
144 KVM_RISCV_ISA_EXT_ZBKX,
145 KVM_RISCV_ISA_EXT_ZKND,
146 KVM_RISCV_ISA_EXT_ZKNE,
147 KVM_RISCV_ISA_EXT_ZKNH,
148 KVM_RISCV_ISA_EXT_ZKR,
149 KVM_RISCV_ISA_EXT_ZKSED,
150 KVM_RISCV_ISA_EXT_ZKSH,
151 KVM_RISCV_ISA_EXT_ZKT,
152 KVM_RISCV_ISA_EXT_ZVBB,
153 KVM_RISCV_ISA_EXT_ZVBC,
154 KVM_RISCV_ISA_EXT_ZVKB,
155 KVM_RISCV_ISA_EXT_ZVKG,
156 KVM_RISCV_ISA_EXT_ZVKNED,
157 KVM_RISCV_ISA_EXT_ZVKNHA,
158 KVM_RISCV_ISA_EXT_ZVKNHB,
159 KVM_RISCV_ISA_EXT_ZVKSED,
160 KVM_RISCV_ISA_EXT_ZVKSH,
161 KVM_RISCV_ISA_EXT_ZVKT,
162 KVM_RISCV_ISA_EXT_ZFH,
163 KVM_RISCV_ISA_EXT_ZFHMIN,
164 KVM_RISCV_ISA_EXT_ZIHINTNTL,
165 KVM_RISCV_ISA_EXT_ZVFH,
166 KVM_RISCV_ISA_EXT_ZVFHMIN,
167 KVM_RISCV_ISA_EXT_ZFA,
168 KVM_RISCV_ISA_EXT_ZTSO,
169 KVM_RISCV_ISA_EXT_ZACAS,
170 KVM_RISCV_ISA_EXT_SSCOFPMF,
108171 KVM_RISCV_ISA_EXT_MAX,
109172};
110173
174/*
175 * SBI extension IDs specific to KVM. This is not the same as the SBI
176 * extension IDs defined by the RISC-V SBI specification.
177 */
178enum KVM_RISCV_SBI_EXT_ID {
179 KVM_RISCV_SBI_EXT_V01 = 0,
180 KVM_RISCV_SBI_EXT_TIME,
181 KVM_RISCV_SBI_EXT_IPI,
182 KVM_RISCV_SBI_EXT_RFENCE,
183 KVM_RISCV_SBI_EXT_SRST,
184 KVM_RISCV_SBI_EXT_HSM,
185 KVM_RISCV_SBI_EXT_PMU,
186 KVM_RISCV_SBI_EXT_EXPERIMENTAL,
187 KVM_RISCV_SBI_EXT_VENDOR,
188 KVM_RISCV_SBI_EXT_DBCN,
189 KVM_RISCV_SBI_EXT_STA,
190 KVM_RISCV_SBI_EXT_MAX,
191};
192
193/* SBI STA extension registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
194struct kvm_riscv_sbi_sta {
195 unsigned long shmem_lo;
196 unsigned long shmem_hi;
197};
198
111199/* Possible states for kvm_riscv_timer */
112200#define KVM_RISCV_TIMER_STATE_OFF 0
113201#define KVM_RISCV_TIMER_STATE_ON 1
......@@ -118,6 +206,8 @@ enum KVM_RISCV_ISA_EXT_ID {
118206/* If you need to interpret the index values, here is the key: */
119207#define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
120208#define KVM_REG_RISCV_TYPE_SHIFT 24
209#define KVM_REG_RISCV_SUBTYPE_MASK 0x0000000000FF0000
210#define KVM_REG_RISCV_SUBTYPE_SHIFT 16
121211
122212/* Config registers are mapped as type 1 */
123213#define KVM_REG_RISCV_CONFIG (0x01 << KVM_REG_RISCV_TYPE_SHIFT)
......@@ -131,8 +221,15 @@ enum KVM_RISCV_ISA_EXT_ID {
131221
132222/* Control and status registers are mapped as type 3 */
133223#define KVM_REG_RISCV_CSR (0x03 << KVM_REG_RISCV_TYPE_SHIFT)
224#define KVM_REG_RISCV_CSR_GENERAL (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
225#define KVM_REG_RISCV_CSR_AIA (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
226#define KVM_REG_RISCV_CSR_SMSTATEEN (0x2 << KVM_REG_RISCV_SUBTYPE_SHIFT)
134227#define KVM_REG_RISCV_CSR_REG(name) \
135228 (offsetof(struct kvm_riscv_csr, name) / sizeof(unsigned long))
229#define KVM_REG_RISCV_CSR_AIA_REG(name) \
230 (offsetof(struct kvm_riscv_aia_csr, name) / sizeof(unsigned long))
231#define KVM_REG_RISCV_CSR_SMSTATEEN_REG(name) \
232 (offsetof(struct kvm_riscv_smstateen_csr, name) / sizeof(unsigned long))
136233
137234/* Timer registers are mapped as type 4 */
138235#define KVM_REG_RISCV_TIMER (0x04 << KVM_REG_RISCV_TYPE_SHIFT)
......@@ -151,6 +248,111 @@ enum KVM_RISCV_ISA_EXT_ID {
151248
152249/* ISA Extension registers are mapped as type 7 */
153250#define KVM_REG_RISCV_ISA_EXT (0x07 << KVM_REG_RISCV_TYPE_SHIFT)
251#define KVM_REG_RISCV_ISA_SINGLE (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
252#define KVM_REG_RISCV_ISA_MULTI_EN (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
253#define KVM_REG_RISCV_ISA_MULTI_DIS (0x2 << KVM_REG_RISCV_SUBTYPE_SHIFT)
254#define KVM_REG_RISCV_ISA_MULTI_REG(__ext_id) \
255 ((__ext_id) / __BITS_PER_LONG)
256#define KVM_REG_RISCV_ISA_MULTI_MASK(__ext_id) \
257 (1UL << ((__ext_id) % __BITS_PER_LONG))
258#define KVM_REG_RISCV_ISA_MULTI_REG_LAST \
259 KVM_REG_RISCV_ISA_MULTI_REG(KVM_RISCV_ISA_EXT_MAX - 1)
260
261/* SBI extension registers are mapped as type 8 */
262#define KVM_REG_RISCV_SBI_EXT (0x08 << KVM_REG_RISCV_TYPE_SHIFT)
263#define KVM_REG_RISCV_SBI_SINGLE (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
264#define KVM_REG_RISCV_SBI_MULTI_EN (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
265#define KVM_REG_RISCV_SBI_MULTI_DIS (0x2 << KVM_REG_RISCV_SUBTYPE_SHIFT)
266#define KVM_REG_RISCV_SBI_MULTI_REG(__ext_id) \
267 ((__ext_id) / __BITS_PER_LONG)
268#define KVM_REG_RISCV_SBI_MULTI_MASK(__ext_id) \
269 (1UL << ((__ext_id) % __BITS_PER_LONG))
270#define KVM_REG_RISCV_SBI_MULTI_REG_LAST \
271 KVM_REG_RISCV_SBI_MULTI_REG(KVM_RISCV_SBI_EXT_MAX - 1)
272
273/* V extension registers are mapped as type 9 */
274#define KVM_REG_RISCV_VECTOR (0x09 << KVM_REG_RISCV_TYPE_SHIFT)
275#define KVM_REG_RISCV_VECTOR_CSR_REG(name) \
276 (offsetof(struct __riscv_v_ext_state, name) / sizeof(unsigned long))
277#define KVM_REG_RISCV_VECTOR_REG(n) \
278 ((n) + sizeof(struct __riscv_v_ext_state) / sizeof(unsigned long))
279
280/* Registers for specific SBI extensions are mapped as type 10 */
281#define KVM_REG_RISCV_SBI_STATE (0x0a << KVM_REG_RISCV_TYPE_SHIFT)
282#define KVM_REG_RISCV_SBI_STA (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
283#define KVM_REG_RISCV_SBI_STA_REG(name) \
284 (offsetof(struct kvm_riscv_sbi_sta, name) / sizeof(unsigned long))
285
286/* Device Control API: RISC-V AIA */
287#define KVM_DEV_RISCV_APLIC_ALIGN 0x1000
288#define KVM_DEV_RISCV_APLIC_SIZE 0x4000
289#define KVM_DEV_RISCV_APLIC_MAX_HARTS 0x4000
290#define KVM_DEV_RISCV_IMSIC_ALIGN 0x1000
291#define KVM_DEV_RISCV_IMSIC_SIZE 0x1000
292
293#define KVM_DEV_RISCV_AIA_GRP_CONFIG 0
294#define KVM_DEV_RISCV_AIA_CONFIG_MODE 0
295#define KVM_DEV_RISCV_AIA_CONFIG_IDS 1
296#define KVM_DEV_RISCV_AIA_CONFIG_SRCS 2
297#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_BITS 3
298#define KVM_DEV_RISCV_AIA_CONFIG_GROUP_SHIFT 4
299#define KVM_DEV_RISCV_AIA_CONFIG_HART_BITS 5
300#define KVM_DEV_RISCV_AIA_CONFIG_GUEST_BITS 6
301
302/*
303 * Modes of RISC-V AIA device:
304 * 1) EMUL (aka Emulation): Trap-n-emulate IMSIC
305 * 2) HWACCEL (aka HW Acceleration): Virtualize IMSIC using IMSIC guest files
306 * 3) AUTO (aka Automatic): Virtualize IMSIC using IMSIC guest files whenever
307 * available otherwise fallback to trap-n-emulation
308 */
309#define KVM_DEV_RISCV_AIA_MODE_EMUL 0
310#define KVM_DEV_RISCV_AIA_MODE_HWACCEL 1
311#define KVM_DEV_RISCV_AIA_MODE_AUTO 2
312
313#define KVM_DEV_RISCV_AIA_IDS_MIN 63
314#define KVM_DEV_RISCV_AIA_IDS_MAX 2048
315#define KVM_DEV_RISCV_AIA_SRCS_MAX 1024
316#define KVM_DEV_RISCV_AIA_GROUP_BITS_MAX 8
317#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MIN 24
318#define KVM_DEV_RISCV_AIA_GROUP_SHIFT_MAX 56
319#define KVM_DEV_RISCV_AIA_HART_BITS_MAX 16
320#define KVM_DEV_RISCV_AIA_GUEST_BITS_MAX 8
321
322#define KVM_DEV_RISCV_AIA_GRP_ADDR 1
323#define KVM_DEV_RISCV_AIA_ADDR_APLIC 0
324#define KVM_DEV_RISCV_AIA_ADDR_IMSIC(__vcpu) (1 + (__vcpu))
325#define KVM_DEV_RISCV_AIA_ADDR_MAX \
326 (1 + KVM_DEV_RISCV_APLIC_MAX_HARTS)
327
328#define KVM_DEV_RISCV_AIA_GRP_CTRL 2
329#define KVM_DEV_RISCV_AIA_CTRL_INIT 0
330
331/*
332 * The device attribute type contains the memory mapped offset of the
333 * APLIC register (range 0x0000-0x3FFF) and it must be 4-byte aligned.
334 */
335#define KVM_DEV_RISCV_AIA_GRP_APLIC 3
336
337/*
338 * The lower 12-bits of the device attribute type contains the iselect
339 * value of the IMSIC register (range 0x70-0xFF) whereas the higher order
340 * bits contains the VCPU id.
341 */
342#define KVM_DEV_RISCV_AIA_GRP_IMSIC 4
343#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS 12
344#define KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK \
345 ((1U << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) - 1)
346#define KVM_DEV_RISCV_AIA_IMSIC_MKATTR(__vcpu, __isel) \
347 (((__vcpu) << KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS) | \
348 ((__isel) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK))
349#define KVM_DEV_RISCV_AIA_IMSIC_GET_ISEL(__attr) \
350 ((__attr) & KVM_DEV_RISCV_AIA_IMSIC_ISEL_MASK)
351#define KVM_DEV_RISCV_AIA_IMSIC_GET_VCPU(__attr) \
352 ((__attr) >> KVM_DEV_RISCV_AIA_IMSIC_ISEL_BITS)
353
354/* One single KVM irqchip, ie. the AIA */
355#define KVM_NR_IRQCHIPS 1
154356
155357#endif
156358
lib/libc/include/riscv-linux-any/asm/ptrace.h+50
......@@ -10,6 +10,11 @@
1010
1111#include <linux/types.h>
1212
13#define PTRACE_GETFDPIC 33
14
15#define PTRACE_GETFDPIC_EXEC 0
16#define PTRACE_GETFDPIC_INTERP 1
17
1318/*
1419 * User-mode register state for core dumps, ptrace, sigcontext
1520 *
......@@ -71,12 +76,57 @@ struct __riscv_q_ext_state {
7176 __u32 reserved[3];
7277};
7378
79struct __riscv_ctx_hdr {
80 __u32 magic;
81 __u32 size;
82};
83
84struct __riscv_extra_ext_header {
85 __u32 __padding[129] __attribute__((aligned(16)));
86 /*
87 * Reserved for expansion of sigcontext structure. Currently zeroed
88 * upon signal, and must be zero upon sigreturn.
89 */
90 __u32 reserved;
91 struct __riscv_ctx_hdr hdr;
92};
93
7494union __riscv_fp_state {
7595 struct __riscv_f_ext_state f;
7696 struct __riscv_d_ext_state d;
7797 struct __riscv_q_ext_state q;
7898};
7999
100struct __riscv_v_ext_state {
101 unsigned long vstart;
102 unsigned long vl;
103 unsigned long vtype;
104 unsigned long vcsr;
105 unsigned long vlenb;
106 void *datap;
107 /*
108 * In signal handler, datap will be set a correct user stack offset
109 * and vector registers will be copied to the address of datap
110 * pointer.
111 */
112};
113
114struct __riscv_v_regset_state {
115 unsigned long vstart;
116 unsigned long vl;
117 unsigned long vtype;
118 unsigned long vcsr;
119 unsigned long vlenb;
120 char vreg[];
121};
122
123/*
124 * According to spec: The number of bits in a single vector register,
125 * VLEN >= ELEN, which must be a power of 2, and must be no greater than
126 * 2^16 = 65536bits = 8192bytes
127 */
128#define RISCV_MAX_VLENB (8192)
129
80130#endif /* __ASSEMBLY__ */
81131
82132#endif /* _ASM_RISCV_PTRACE_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/sigcontext.h+20-2
......@@ -8,15 +8,33 @@
88
99#include <asm/ptrace.h>
1010
11/* The Magic number for signal context frame header. */
12#define RISCV_V_MAGIC 0x53465457
13#define END_MAGIC 0x0
14
15/* The size of END signal context header. */
16#define END_HDR_SIZE 0x0
17
18#ifndef __ASSEMBLY__
19
20struct __sc_riscv_v_state {
21 struct __riscv_v_ext_state v_state;
22} __attribute__((aligned(16)));
23
1124/*
1225 * Signal context structure
1326 *
1427 * This contains the context saved before a signal handler is invoked;
15 * it is restored by sys_sigreturn / sys_rt_sigreturn.
28 * it is restored by sys_rt_sigreturn.
1629 */
1730struct sigcontext {
1831 struct user_regs_struct sc_regs;
19 union __riscv_fp_state sc_fpregs;
32 union {
33 union __riscv_fp_state sc_fpregs;
34 struct __riscv_extra_ext_header sc_extdesc;
35 };
2036};
2137
38#endif /*!__ASSEMBLY__*/
39
2240#endif /* _ASM_RISCV_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd.h+10-1
......@@ -42,4 +42,13 @@
4242#ifndef __NR_riscv_flush_icache
4343#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15)
4444#endif
45__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
\ No newline at end of file
45__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache)
46
47/*
48 * Allows userspace to query the kernel for CPU architecture and
49 * microarchitecture details across a given set of CPUs.
50 */
51#ifndef __NR_riscv_hwprobe
52#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14)
53#endif
54__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe)
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/cmb.h+1-1
......@@ -31,7 +31,7 @@
3131struct cmbdata {
3232 __u64 size;
3333 __u64 elapsed_time;
34 /* basic and exended format: */
34 /* basic and extended format: */
3535 __u64 ssch_rsch_count;
3636 __u64 sample_count;
3737 __u64 device_connect_time;
lib/libc/include/s390x-linux-any/asm/dasd.h+3-1
......@@ -24,7 +24,7 @@
2424/*
2525 * struct dasd_information2_t
2626 * represents any data about the device, which is visible to userspace.
27 * including foramt and featueres.
27 * including format and featueres.
2828 */
2929typedef struct dasd_information2_t {
3030 unsigned int devno; /* S/390 devno */
......@@ -78,6 +78,7 @@ typedef struct dasd_information2_t {
7878 * 0x040: give access to raw eckd data
7979 * 0x080: enable discard support
8080 * 0x100: enable autodisable for IFCC errors (default)
81 * 0x200: enable requeue of all requests on autoquiesce
8182 */
8283#define DASD_FEATURE_READONLY 0x001
8384#define DASD_FEATURE_USEDIAG 0x002
......@@ -88,6 +89,7 @@ typedef struct dasd_information2_t {
8889#define DASD_FEATURE_USERAW 0x040
8990#define DASD_FEATURE_DISCARD 0x080
9091#define DASD_FEATURE_PATH_AUTODISABLE 0x100
92#define DASD_FEATURE_REQUEUEQUIESCE 0x200
9193#define DASD_FEATURE_DEFAULT DASD_FEATURE_PATH_AUTODISABLE
9294
9395#define DASD_PARTN_BITS 2
lib/libc/include/s390x-linux-any/asm/kvm.h+330-1
......@@ -12,7 +12,320 @@
1212#include <linux/types.h>
1313
1414#define __KVM_S390
15#define __KVM_HAVE_GUEST_DEBUG
15
16struct kvm_s390_skeys {
17 __u64 start_gfn;
18 __u64 count;
19 __u64 skeydata_addr;
20 __u32 flags;
21 __u32 reserved[9];
22};
23
24#define KVM_S390_CMMA_PEEK (1 << 0)
25
26/**
27 * kvm_s390_cmma_log - Used for CMMA migration.
28 *
29 * Used both for input and output.
30 *
31 * @start_gfn: Guest page number to start from.
32 * @count: Size of the result buffer.
33 * @flags: Control operation mode via KVM_S390_CMMA_* flags
34 * @remaining: Used with KVM_S390_GET_CMMA_BITS. Indicates how many dirty
35 * pages are still remaining.
36 * @mask: Used with KVM_S390_SET_CMMA_BITS. Bitmap of bits to actually set
37 * in the PGSTE.
38 * @values: Pointer to the values buffer.
39 *
40 * Used in KVM_S390_{G,S}ET_CMMA_BITS ioctls.
41 */
42struct kvm_s390_cmma_log {
43 __u64 start_gfn;
44 __u32 count;
45 __u32 flags;
46 union {
47 __u64 remaining;
48 __u64 mask;
49 };
50 __u64 values;
51};
52
53#define KVM_S390_RESET_POR 1
54#define KVM_S390_RESET_CLEAR 2
55#define KVM_S390_RESET_SUBSYSTEM 4
56#define KVM_S390_RESET_CPU_INIT 8
57#define KVM_S390_RESET_IPL 16
58
59/* for KVM_S390_MEM_OP */
60struct kvm_s390_mem_op {
61 /* in */
62 __u64 gaddr; /* the guest address */
63 __u64 flags; /* flags */
64 __u32 size; /* amount of bytes */
65 __u32 op; /* type of operation */
66 __u64 buf; /* buffer in userspace */
67 union {
68 struct {
69 __u8 ar; /* the access register number */
70 __u8 key; /* access key, ignored if flag unset */
71 __u8 pad1[6]; /* ignored */
72 __u64 old_addr; /* ignored if cmpxchg flag unset */
73 };
74 __u32 sida_offset; /* offset into the sida */
75 __u8 reserved[32]; /* ignored */
76 };
77};
78/* types for kvm_s390_mem_op->op */
79#define KVM_S390_MEMOP_LOGICAL_READ 0
80#define KVM_S390_MEMOP_LOGICAL_WRITE 1
81#define KVM_S390_MEMOP_SIDA_READ 2
82#define KVM_S390_MEMOP_SIDA_WRITE 3
83#define KVM_S390_MEMOP_ABSOLUTE_READ 4
84#define KVM_S390_MEMOP_ABSOLUTE_WRITE 5
85#define KVM_S390_MEMOP_ABSOLUTE_CMPXCHG 6
86
87/* flags for kvm_s390_mem_op->flags */
88#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
89#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
90#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2)
91
92/* flags specifying extension support via KVM_CAP_S390_MEM_OP_EXTENSION */
93#define KVM_S390_MEMOP_EXTENSION_CAP_BASE (1 << 0)
94#define KVM_S390_MEMOP_EXTENSION_CAP_CMPXCHG (1 << 1)
95
96struct kvm_s390_psw {
97 __u64 mask;
98 __u64 addr;
99};
100
101/* valid values for type in kvm_s390_interrupt */
102#define KVM_S390_SIGP_STOP 0xfffe0000u
103#define KVM_S390_PROGRAM_INT 0xfffe0001u
104#define KVM_S390_SIGP_SET_PREFIX 0xfffe0002u
105#define KVM_S390_RESTART 0xfffe0003u
106#define KVM_S390_INT_PFAULT_INIT 0xfffe0004u
107#define KVM_S390_INT_PFAULT_DONE 0xfffe0005u
108#define KVM_S390_MCHK 0xfffe1000u
109#define KVM_S390_INT_CLOCK_COMP 0xffff1004u
110#define KVM_S390_INT_CPU_TIMER 0xffff1005u
111#define KVM_S390_INT_VIRTIO 0xffff2603u
112#define KVM_S390_INT_SERVICE 0xffff2401u
113#define KVM_S390_INT_EMERGENCY 0xffff1201u
114#define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u
115/* Anything below 0xfffe0000u is taken by INT_IO */
116#define KVM_S390_INT_IO(ai,cssid,ssid,schid) \
117 (((schid)) | \
118 ((ssid) << 16) | \
119 ((cssid) << 18) | \
120 ((ai) << 26))
121#define KVM_S390_INT_IO_MIN 0x00000000u
122#define KVM_S390_INT_IO_MAX 0xfffdffffu
123#define KVM_S390_INT_IO_AI_MASK 0x04000000u
124
125
126struct kvm_s390_interrupt {
127 __u32 type;
128 __u32 parm;
129 __u64 parm64;
130};
131
132struct kvm_s390_io_info {
133 __u16 subchannel_id;
134 __u16 subchannel_nr;
135 __u32 io_int_parm;
136 __u32 io_int_word;
137};
138
139struct kvm_s390_ext_info {
140 __u32 ext_params;
141 __u32 pad;
142 __u64 ext_params2;
143};
144
145struct kvm_s390_pgm_info {
146 __u64 trans_exc_code;
147 __u64 mon_code;
148 __u64 per_address;
149 __u32 data_exc_code;
150 __u16 code;
151 __u16 mon_class_nr;
152 __u8 per_code;
153 __u8 per_atmid;
154 __u8 exc_access_id;
155 __u8 per_access_id;
156 __u8 op_access_id;
157#define KVM_S390_PGM_FLAGS_ILC_VALID 0x01
158#define KVM_S390_PGM_FLAGS_ILC_0 0x02
159#define KVM_S390_PGM_FLAGS_ILC_1 0x04
160#define KVM_S390_PGM_FLAGS_ILC_MASK 0x06
161#define KVM_S390_PGM_FLAGS_NO_REWIND 0x08
162 __u8 flags;
163 __u8 pad[2];
164};
165
166struct kvm_s390_prefix_info {
167 __u32 address;
168};
169
170struct kvm_s390_extcall_info {
171 __u16 code;
172};
173
174struct kvm_s390_emerg_info {
175 __u16 code;
176};
177
178#define KVM_S390_STOP_FLAG_STORE_STATUS 0x01
179struct kvm_s390_stop_info {
180 __u32 flags;
181};
182
183struct kvm_s390_mchk_info {
184 __u64 cr14;
185 __u64 mcic;
186 __u64 failing_storage_address;
187 __u32 ext_damage_code;
188 __u32 pad;
189 __u8 fixed_logout[16];
190};
191
192struct kvm_s390_irq {
193 __u64 type;
194 union {
195 struct kvm_s390_io_info io;
196 struct kvm_s390_ext_info ext;
197 struct kvm_s390_pgm_info pgm;
198 struct kvm_s390_emerg_info emerg;
199 struct kvm_s390_extcall_info extcall;
200 struct kvm_s390_prefix_info prefix;
201 struct kvm_s390_stop_info stop;
202 struct kvm_s390_mchk_info mchk;
203 char reserved[64];
204 } u;
205};
206
207struct kvm_s390_irq_state {
208 __u64 buf;
209 __u32 flags; /* will stay unused for compatibility reasons */
210 __u32 len;
211 __u32 reserved[4]; /* will stay unused for compatibility reasons */
212};
213
214struct kvm_s390_ucas_mapping {
215 __u64 user_addr;
216 __u64 vcpu_addr;
217 __u64 length;
218};
219
220struct kvm_s390_pv_sec_parm {
221 __u64 origin;
222 __u64 length;
223};
224
225struct kvm_s390_pv_unp {
226 __u64 addr;
227 __u64 size;
228 __u64 tweak;
229};
230
231enum pv_cmd_dmp_id {
232 KVM_PV_DUMP_INIT,
233 KVM_PV_DUMP_CONFIG_STOR_STATE,
234 KVM_PV_DUMP_COMPLETE,
235 KVM_PV_DUMP_CPU,
236};
237
238struct kvm_s390_pv_dmp {
239 __u64 subcmd;
240 __u64 buff_addr;
241 __u64 buff_len;
242 __u64 gaddr; /* For dump storage state */
243 __u64 reserved[4];
244};
245
246enum pv_cmd_info_id {
247 KVM_PV_INFO_VM,
248 KVM_PV_INFO_DUMP,
249};
250
251struct kvm_s390_pv_info_dump {
252 __u64 dump_cpu_buffer_len;
253 __u64 dump_config_mem_buffer_per_1m;
254 __u64 dump_config_finalize_len;
255};
256
257struct kvm_s390_pv_info_vm {
258 __u64 inst_calls_list[4];
259 __u64 max_cpus;
260 __u64 max_guests;
261 __u64 max_guest_addr;
262 __u64 feature_indication;
263};
264
265struct kvm_s390_pv_info_header {
266 __u32 id;
267 __u32 len_max;
268 __u32 len_written;
269 __u32 reserved;
270};
271
272struct kvm_s390_pv_info {
273 struct kvm_s390_pv_info_header header;
274 union {
275 struct kvm_s390_pv_info_dump dump;
276 struct kvm_s390_pv_info_vm vm;
277 };
278};
279
280enum pv_cmd_id {
281 KVM_PV_ENABLE,
282 KVM_PV_DISABLE,
283 KVM_PV_SET_SEC_PARMS,
284 KVM_PV_UNPACK,
285 KVM_PV_VERIFY,
286 KVM_PV_PREP_RESET,
287 KVM_PV_UNSHARE_ALL,
288 KVM_PV_INFO,
289 KVM_PV_DUMP,
290 KVM_PV_ASYNC_CLEANUP_PREPARE,
291 KVM_PV_ASYNC_CLEANUP_PERFORM,
292};
293
294struct kvm_pv_cmd {
295 __u32 cmd; /* Command to be executed */
296 __u16 rc; /* Ultravisor return code */
297 __u16 rrc; /* Ultravisor return reason code */
298 __u64 data; /* Data or address */
299 __u32 flags; /* flags for future extensions. Must be 0 for now */
300 __u32 reserved[3];
301};
302
303struct kvm_s390_zpci_op {
304 /* in */
305 __u32 fh; /* target device */
306 __u8 op; /* operation to perform */
307 __u8 pad[3];
308 union {
309 /* for KVM_S390_ZPCIOP_REG_AEN */
310 struct {
311 __u64 ibv; /* Guest addr of interrupt bit vector */
312 __u64 sb; /* Guest addr of summary bit */
313 __u32 flags;
314 __u32 noi; /* Number of interrupts */
315 __u8 isc; /* Guest interrupt subclass */
316 __u8 sbo; /* Offset of guest summary bit vector */
317 __u16 pad;
318 } reg_aen;
319 __u64 reserved[8];
320 } u;
321};
322
323/* types for kvm_s390_zpci_op->op */
324#define KVM_S390_ZPCIOP_REG_AEN 0
325#define KVM_S390_ZPCIOP_DEREG_AEN 1
326
327/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
328#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
16329
17330/* Device control API: s390-specific devices */
18331#define KVM_DEV_FLIC_GET_ALL_IRQS 1
......@@ -159,6 +472,22 @@ struct kvm_s390_vm_cpu_subfunc {
159472 __u8 reserved[1728];
160473};
161474
475#define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6
476#define KVM_S390_VM_CPU_MACHINE_UV_FEAT_GUEST 7
477
478#define KVM_S390_VM_CPU_UV_FEAT_NR_BITS 64
479struct kvm_s390_vm_cpu_uv_feat {
480 union {
481 struct {
482 __u64 : 4;
483 __u64 ap : 1; /* bit 4 */
484 __u64 ap_intr : 1; /* bit 5 */
485 __u64 : 58;
486 };
487 __u64 feat;
488 };
489};
490
162491/* kvm attributes for crypto */
163492#define KVM_S390_VM_CRYPTO_ENABLE_AES_KW 0
164493#define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1
lib/libc/include/s390x-linux-any/asm/pkey.h+14-9
......@@ -2,7 +2,7 @@
22/*
33 * Userspace interface to the pkey device driver
44 *
5 * Copyright IBM Corp. 2017, 2019
5 * Copyright IBM Corp. 2017, 2023
66 *
77 * Author: Harald Freudenberger <freude@de.ibm.com>
88 *
......@@ -26,16 +26,21 @@
2626#define MAXCLRKEYSIZE 32 /* a clear key value may be up to 32 bytes */
2727#define MAXAESCIPHERKEYSIZE 136 /* our aes cipher keys have always 136 bytes */
2828#define MINEP11AESKEYBLOBSIZE 256 /* min EP11 AES key blob size */
29#define MAXEP11AESKEYBLOBSIZE 320 /* max EP11 AES key blob size */
29#define MAXEP11AESKEYBLOBSIZE 336 /* max EP11 AES key blob size */
3030
3131/* Minimum size of a key blob */
3232#define MINKEYBLOBSIZE SECKEYBLOBSIZE
3333
3434/* defines for the type field within the pkey_protkey struct */
35#define PKEY_KEYTYPE_AES_128 1
36#define PKEY_KEYTYPE_AES_192 2
37#define PKEY_KEYTYPE_AES_256 3
38#define PKEY_KEYTYPE_ECC 4
35#define PKEY_KEYTYPE_AES_128 1
36#define PKEY_KEYTYPE_AES_192 2
37#define PKEY_KEYTYPE_AES_256 3
38#define PKEY_KEYTYPE_ECC 4
39#define PKEY_KEYTYPE_ECC_P256 5
40#define PKEY_KEYTYPE_ECC_P384 6
41#define PKEY_KEYTYPE_ECC_P521 7
42#define PKEY_KEYTYPE_ECC_ED25519 8
43#define PKEY_KEYTYPE_ECC_ED448 9
3944
4045/* the newer ioctls use a pkey_key_type enum for type information */
4146enum pkey_key_type {
......@@ -348,7 +353,7 @@ struct pkey_kblob2pkey2 {
348353 * Is able to find out which type of secure key is given (CCA AES secure
349354 * key, CCA AES cipher key, CCA ECC private key, EP11 AES key, EP11 ECC private
350355 * key) and tries to find all matching crypto cards based on the MKVP and maybe
351 * other criterias (like CCA AES cipher keys need a CEX5C or higher, EP11 keys
356 * other criteria (like CCA AES cipher keys need a CEX5C or higher, EP11 keys
352357 * with BLOB_PKEY_EXTRACTABLE need a CEX7 and EP11 api version 4). The list of
353358 * APQNs is further filtered by the key's mkvp which needs to match to either
354359 * the current mkvp (CCA and EP11) or the alternate mkvp (old mkvp, CCA adapters
......@@ -365,7 +370,7 @@ struct pkey_kblob2pkey2 {
365370 * is empty (apqn_entries is 0) the apqn_entries field is updated to the number
366371 * of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
367372 * but the number of apqn targets does not fit into the list, the apqn_targets
368 * field is updatedd with the number of reqired entries but there are no apqn
373 * field is updated with the number of required entries but there are no apqn
369374 * values stored in the list and the ioctl returns with ENOSPC. If no matching
370375 * APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
371376 */
......@@ -403,7 +408,7 @@ struct pkey_apqns4key {
403408 * is empty (apqn_entries is 0) the apqn_entries field is updated to the number
404409 * of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
405410 * but the number of apqn targets does not fit into the list, the apqn_targets
406 * field is updatedd with the number of reqired entries but there are no apqn
411 * field is updated with the number of required entries but there are no apqn
407412 * values stored in the list and the ioctl returns with ENOSPC. If no matching
408413 * APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
409414 */
lib/libc/include/s390x-linux-any/asm/ptrace.h+60-63
......@@ -8,6 +8,8 @@
88#ifndef _S390_PTRACE_H
99#define _S390_PTRACE_H
1010
11#include <linux/const.h>
12
1113/*
1214 * Offsets in the user_regs_struct. They are used for the ptrace
1315 * system call and in entry.S
......@@ -166,6 +168,64 @@
166168
167169#endif /* __s390x__ */
168170
171#ifndef __s390x__
172
173#define PSW_MASK_PER _AC(0x40000000, UL)
174#define PSW_MASK_DAT _AC(0x04000000, UL)
175#define PSW_MASK_IO _AC(0x02000000, UL)
176#define PSW_MASK_EXT _AC(0x01000000, UL)
177#define PSW_MASK_KEY _AC(0x00F00000, UL)
178#define PSW_MASK_BASE _AC(0x00080000, UL) /* always one */
179#define PSW_MASK_MCHECK _AC(0x00040000, UL)
180#define PSW_MASK_WAIT _AC(0x00020000, UL)
181#define PSW_MASK_PSTATE _AC(0x00010000, UL)
182#define PSW_MASK_ASC _AC(0x0000C000, UL)
183#define PSW_MASK_CC _AC(0x00003000, UL)
184#define PSW_MASK_PM _AC(0x00000F00, UL)
185#define PSW_MASK_RI _AC(0x00000000, UL)
186#define PSW_MASK_EA _AC(0x00000000, UL)
187#define PSW_MASK_BA _AC(0x00000000, UL)
188
189#define PSW_MASK_USER _AC(0x0000FF00, UL)
190
191#define PSW_ADDR_AMODE _AC(0x80000000, UL)
192#define PSW_ADDR_INSN _AC(0x7FFFFFFF, UL)
193
194#define PSW_ASC_PRIMARY _AC(0x00000000, UL)
195#define PSW_ASC_ACCREG _AC(0x00004000, UL)
196#define PSW_ASC_SECONDARY _AC(0x00008000, UL)
197#define PSW_ASC_HOME _AC(0x0000C000, UL)
198
199#else /* __s390x__ */
200
201#define PSW_MASK_PER _AC(0x4000000000000000, UL)
202#define PSW_MASK_DAT _AC(0x0400000000000000, UL)
203#define PSW_MASK_IO _AC(0x0200000000000000, UL)
204#define PSW_MASK_EXT _AC(0x0100000000000000, UL)
205#define PSW_MASK_BASE _AC(0x0000000000000000, UL)
206#define PSW_MASK_KEY _AC(0x00F0000000000000, UL)
207#define PSW_MASK_MCHECK _AC(0x0004000000000000, UL)
208#define PSW_MASK_WAIT _AC(0x0002000000000000, UL)
209#define PSW_MASK_PSTATE _AC(0x0001000000000000, UL)
210#define PSW_MASK_ASC _AC(0x0000C00000000000, UL)
211#define PSW_MASK_CC _AC(0x0000300000000000, UL)
212#define PSW_MASK_PM _AC(0x00000F0000000000, UL)
213#define PSW_MASK_RI _AC(0x0000008000000000, UL)
214#define PSW_MASK_EA _AC(0x0000000100000000, UL)
215#define PSW_MASK_BA _AC(0x0000000080000000, UL)
216
217#define PSW_MASK_USER _AC(0x0000FF0180000000, UL)
218
219#define PSW_ADDR_AMODE _AC(0x0000000000000000, UL)
220#define PSW_ADDR_INSN _AC(0xFFFFFFFFFFFFFFFF, UL)
221
222#define PSW_ASC_PRIMARY _AC(0x0000000000000000, UL)
223#define PSW_ASC_ACCREG _AC(0x0000400000000000, UL)
224#define PSW_ASC_SECONDARY _AC(0x0000800000000000, UL)
225#define PSW_ASC_HOME _AC(0x0000C00000000000, UL)
226
227#endif /* __s390x__ */
228
169229#define NUM_GPRS 16
170230#define NUM_FPRS 16
171231#define NUM_CRS 16
......@@ -214,69 +274,6 @@ typedef struct {
214274 unsigned long addr;
215275} __attribute__ ((aligned(8))) psw_t;
216276
217#ifndef __s390x__
218
219#define PSW_MASK_PER 0x40000000UL
220#define PSW_MASK_DAT 0x04000000UL
221#define PSW_MASK_IO 0x02000000UL
222#define PSW_MASK_EXT 0x01000000UL
223#define PSW_MASK_KEY 0x00F00000UL
224#define PSW_MASK_BASE 0x00080000UL /* always one */
225#define PSW_MASK_MCHECK 0x00040000UL
226#define PSW_MASK_WAIT 0x00020000UL
227#define PSW_MASK_PSTATE 0x00010000UL
228#define PSW_MASK_ASC 0x0000C000UL
229#define PSW_MASK_CC 0x00003000UL
230#define PSW_MASK_PM 0x00000F00UL
231#define PSW_MASK_RI 0x00000000UL
232#define PSW_MASK_EA 0x00000000UL
233#define PSW_MASK_BA 0x00000000UL
234
235#define PSW_MASK_USER 0x0000FF00UL
236
237#define PSW_ADDR_AMODE 0x80000000UL
238#define PSW_ADDR_INSN 0x7FFFFFFFUL
239
240#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20)
241
242#define PSW_ASC_PRIMARY 0x00000000UL
243#define PSW_ASC_ACCREG 0x00004000UL
244#define PSW_ASC_SECONDARY 0x00008000UL
245#define PSW_ASC_HOME 0x0000C000UL
246
247#else /* __s390x__ */
248
249#define PSW_MASK_PER 0x4000000000000000UL
250#define PSW_MASK_DAT 0x0400000000000000UL
251#define PSW_MASK_IO 0x0200000000000000UL
252#define PSW_MASK_EXT 0x0100000000000000UL
253#define PSW_MASK_BASE 0x0000000000000000UL
254#define PSW_MASK_KEY 0x00F0000000000000UL
255#define PSW_MASK_MCHECK 0x0004000000000000UL
256#define PSW_MASK_WAIT 0x0002000000000000UL
257#define PSW_MASK_PSTATE 0x0001000000000000UL
258#define PSW_MASK_ASC 0x0000C00000000000UL
259#define PSW_MASK_CC 0x0000300000000000UL
260#define PSW_MASK_PM 0x00000F0000000000UL
261#define PSW_MASK_RI 0x0000008000000000UL
262#define PSW_MASK_EA 0x0000000100000000UL
263#define PSW_MASK_BA 0x0000000080000000UL
264
265#define PSW_MASK_USER 0x0000FF0180000000UL
266
267#define PSW_ADDR_AMODE 0x0000000000000000UL
268#define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL
269
270#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52)
271
272#define PSW_ASC_PRIMARY 0x0000000000000000UL
273#define PSW_ASC_ACCREG 0x0000400000000000UL
274#define PSW_ASC_SECONDARY 0x0000800000000000UL
275#define PSW_ASC_HOME 0x0000C00000000000UL
276
277#endif /* __s390x__ */
278
279
280277/*
281278 * The s390_regs structure is used to define the elf_gregset_t.
282279 */
lib/libc/include/s390x-linux-any/asm/statfs.h+2-2
......@@ -30,7 +30,7 @@ struct statfs {
3030 unsigned int f_namelen;
3131 unsigned int f_frsize;
3232 unsigned int f_flags;
33 unsigned int f_spare[4];
33 unsigned int f_spare[5];
3434};
3535
3636struct statfs64 {
......@@ -45,7 +45,7 @@ struct statfs64 {
4545 unsigned int f_namelen;
4646 unsigned int f_frsize;
4747 unsigned int f_flags;
48 unsigned int f_spare[4];
48 unsigned int f_spare[5];
4949};
5050
5151#endif
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_32.h+13
......@@ -419,8 +419,21 @@
419419#define __NR_landlock_create_ruleset 444
420420#define __NR_landlock_add_rule 445
421421#define __NR_landlock_restrict_self 446
422#define __NR_memfd_secret 447
422423#define __NR_process_mrelease 448
423424#define __NR_futex_waitv 449
424425#define __NR_set_mempolicy_home_node 450
426#define __NR_cachestat 451
427#define __NR_fchmodat2 452
428#define __NR_map_shadow_stack 453
429#define __NR_futex_wake 454
430#define __NR_futex_wait 455
431#define __NR_futex_requeue 456
432#define __NR_statmount 457
433#define __NR_listmount 458
434#define __NR_lsm_get_self_attr 459
435#define __NR_lsm_set_self_attr 460
436#define __NR_lsm_list_modules 461
437#define __NR_mseal 462
425438
426439#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+13
......@@ -367,8 +367,21 @@
367367#define __NR_landlock_create_ruleset 444
368368#define __NR_landlock_add_rule 445
369369#define __NR_landlock_restrict_self 446
370#define __NR_memfd_secret 447
370371#define __NR_process_mrelease 448
371372#define __NR_futex_waitv 449
372373#define __NR_set_mempolicy_home_node 450
374#define __NR_cachestat 451
375#define __NR_fchmodat2 452
376#define __NR_map_shadow_stack 453
377#define __NR_futex_wake 454
378#define __NR_futex_wait 455
379#define __NR_futex_requeue 456
380#define __NR_statmount 457
381#define __NR_listmount 458
382#define __NR_lsm_get_self_attr 459
383#define __NR_lsm_set_self_attr 460
384#define __NR_lsm_list_modules 461
385#define __NR_mseal 462
373386
374387#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/uvdevice.h+52-1
......@@ -32,6 +32,33 @@ struct uvio_attest {
3232 __u16 reserved136; /* 0x0136 */
3333};
3434
35/**
36 * uvio_uvdev_info - Information of supported functions
37 * @supp_uvio_cmds - supported IOCTLs by this device
38 * @supp_uv_cmds - supported UVCs corresponding to the IOCTL
39 *
40 * UVIO request to get information about supported request types by this
41 * uvdevice and the Ultravisor. Everything is output. Bits are in LSB0
42 * ordering. If the bit is set in both, @supp_uvio_cmds and @supp_uv_cmds, the
43 * uvdevice and the Ultravisor support that call.
44 *
45 * Note that bit 0 (UVIO_IOCTL_UVDEV_INFO_NR) is always zero for `supp_uv_cmds`
46 * as there is no corresponding UV-call.
47 */
48struct uvio_uvdev_info {
49 /*
50 * If bit `n` is set, this device supports the IOCTL with nr `n`.
51 */
52 __u64 supp_uvio_cmds;
53 /*
54 * If bit `n` is set, the Ultravisor(UV) supports the UV-call
55 * corresponding to the IOCTL with nr `n` in the calling contextx (host
56 * or guest). The value is only valid if the corresponding bit in
57 * @supp_uvio_cmds is set as well.
58 */
59 __u64 supp_uv_cmds;
60};
61
3562/*
3663 * The following max values define an upper length for the IOCTL in/out buffers.
3764 * However, they do not represent the maximum the Ultravisor allows which is
......@@ -42,10 +69,34 @@ struct uvio_attest {
4269#define UVIO_ATT_ARCB_MAX_LEN 0x100000
4370#define UVIO_ATT_MEASUREMENT_MAX_LEN 0x8000
4471#define UVIO_ATT_ADDITIONAL_MAX_LEN 0x8000
72#define UVIO_ADD_SECRET_MAX_LEN 0x100000
73#define UVIO_LIST_SECRETS_LEN 0x1000
4574
4675#define UVIO_DEVICE_NAME "uv"
4776#define UVIO_TYPE_UVC 'u'
4877
49#define UVIO_IOCTL_ATT _IOWR(UVIO_TYPE_UVC, 0x01, struct uvio_ioctl_cb)
78enum UVIO_IOCTL_NR {
79 UVIO_IOCTL_UVDEV_INFO_NR = 0x00,
80 UVIO_IOCTL_ATT_NR,
81 UVIO_IOCTL_ADD_SECRET_NR,
82 UVIO_IOCTL_LIST_SECRETS_NR,
83 UVIO_IOCTL_LOCK_SECRETS_NR,
84 /* must be the last entry */
85 UVIO_IOCTL_NUM_IOCTLS
86};
87
88#define UVIO_IOCTL(nr) _IOWR(UVIO_TYPE_UVC, nr, struct uvio_ioctl_cb)
89#define UVIO_IOCTL_UVDEV_INFO UVIO_IOCTL(UVIO_IOCTL_UVDEV_INFO_NR)
90#define UVIO_IOCTL_ATT UVIO_IOCTL(UVIO_IOCTL_ATT_NR)
91#define UVIO_IOCTL_ADD_SECRET UVIO_IOCTL(UVIO_IOCTL_ADD_SECRET_NR)
92#define UVIO_IOCTL_LIST_SECRETS UVIO_IOCTL(UVIO_IOCTL_LIST_SECRETS_NR)
93#define UVIO_IOCTL_LOCK_SECRETS UVIO_IOCTL(UVIO_IOCTL_LOCK_SECRETS_NR)
94
95#define UVIO_SUPP_CALL(nr) (1ULL << (nr))
96#define UVIO_SUPP_UDEV_INFO UVIO_SUPP_CALL(UVIO_IOCTL_UDEV_INFO_NR)
97#define UVIO_SUPP_ATT UVIO_SUPP_CALL(UVIO_IOCTL_ATT_NR)
98#define UVIO_SUPP_ADD_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_ADD_SECRET_NR)
99#define UVIO_SUPP_LIST_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LIST_SECRETS_NR)
100#define UVIO_SUPP_LOCK_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LOCK_SECRETS_NR)
50101
51102#endif /* __S390_ASM_UVDEVICE_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/openpromio.h+2-3
......@@ -10,10 +10,9 @@
1010 * were chosen to be exactly equal to the SunOS equivalents.
1111 */
1212
13struct openpromio
14{
13struct openpromio {
1514 unsigned int oprom_size; /* Actual size of the oprom_array. */
16 char oprom_array[1]; /* Holds property names and values. */
15 char oprom_array[]; /* Holds property names and values. */
1716};
1817
1918#define OPROMMAXPARAM 4096 /* Maximum size of oprom_array. */
lib/libc/include/sparc-linux-any/asm/socket.h+3
......@@ -130,6 +130,9 @@
130130
131131#define SO_RCVMARK 0x0054
132132
133#define SO_PASSPIDFD 0x0055
134#define SO_PEERPIDFD 0x0056
135
133136
134137
135138#if __BITS_PER_LONG == 64
lib/libc/include/sparc-linux-any/asm/termbits.h-10
......@@ -10,16 +10,6 @@ typedef unsigned int tcflag_t;
1010typedef unsigned long tcflag_t;
1111#endif
1212
13#define NCC 8
14struct termio {
15 unsigned short c_iflag; /* input mode flags */
16 unsigned short c_oflag; /* output mode flags */
17 unsigned short c_cflag; /* control mode flags */
18 unsigned short c_lflag; /* local mode flags */
19 unsigned char c_line; /* line discipline */
20 unsigned char c_cc[NCC]; /* control characters */
21};
22
2313#define NCCS 17
2414struct termios {
2515 tcflag_t c_iflag; /* input mode flags */
lib/libc/include/sparc-linux-any/asm/termios.h+9
......@@ -40,5 +40,14 @@ struct winsize {
4040 unsigned short ws_ypixel;
4141};
4242
43#define NCC 8
44struct termio {
45 unsigned short c_iflag; /* input mode flags */
46 unsigned short c_oflag; /* output mode flags */
47 unsigned short c_cflag; /* control mode flags */
48 unsigned short c_lflag; /* local mode flags */
49 unsigned char c_line; /* line discipline */
50 unsigned char c_cc[NCC]; /* control characters */
51};
4352
4453#endif /* _SPARC_TERMIOS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_32.h+12
......@@ -420,6 +420,18 @@
420420#define __NR_process_mrelease 448
421421#define __NR_futex_waitv 449
422422#define __NR_set_mempolicy_home_node 450
423#define __NR_cachestat 451
424#define __NR_fchmodat2 452
425#define __NR_map_shadow_stack 453
426#define __NR_futex_wake 454
427#define __NR_futex_wait 455
428#define __NR_futex_requeue 456
429#define __NR_statmount 457
430#define __NR_listmount 458
431#define __NR_lsm_get_self_attr 459
432#define __NR_lsm_set_self_attr 460
433#define __NR_lsm_list_modules 461
434#define __NR_mseal 462
423435
424436
425437#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h+12
......@@ -383,6 +383,18 @@
383383#define __NR_process_mrelease 448
384384#define __NR_futex_waitv 449
385385#define __NR_set_mempolicy_home_node 450
386#define __NR_cachestat 451
387#define __NR_fchmodat2 452
388#define __NR_map_shadow_stack 453
389#define __NR_futex_wake 454
390#define __NR_futex_wait 455
391#define __NR_futex_requeue 456
392#define __NR_statmount 457
393#define __NR_listmount 458
394#define __NR_lsm_get_self_attr 459
395#define __NR_lsm_set_self_attr 460
396#define __NR_lsm_list_modules 461
397#define __NR_mseal 462
386398
387399
388400#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/amd_hsmp.h+110-1
......@@ -47,6 +47,9 @@ enum hsmp_message_ids {
4747 HSMP_SET_PCI_RATE, /* 20h Control link rate on PCIe devices */
4848 HSMP_SET_POWER_MODE, /* 21h Select power efficiency profile policy */
4949 HSMP_SET_PSTATE_MAX_MIN, /* 22h Set the max and min DF P-State */
50 HSMP_GET_METRIC_TABLE_VER, /* 23h Get metrics table version */
51 HSMP_GET_METRIC_TABLE, /* 24h Get metrics table */
52 HSMP_GET_METRIC_TABLE_DRAM_ADDR,/* 25h Get metrics table dram address */
5053 HSMP_MSG_ID_MAX,
5154};
5255
......@@ -64,6 +67,14 @@ enum hsmp_msg_type {
6467 HSMP_GET = 1,
6568};
6669
70enum hsmp_proto_versions {
71 HSMP_PROTO_VER2 = 2,
72 HSMP_PROTO_VER3,
73 HSMP_PROTO_VER4,
74 HSMP_PROTO_VER5,
75 HSMP_PROTO_VER6
76};
77
6778struct hsmp_msg_desc {
6879 int num_args;
6980 int response_sz;
......@@ -227,7 +238,7 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
227238 /*
228239 * HSMP_GET_DIMM_THERMAL, num_args = 1, response_sz = 1
229240 * input: args[0] = DIMM address[7:0]
230 * output: args[0] = temperature in degree celcius[31:21] + update rate in ms[16:8] +
241 * output: args[0] = temperature in degree celsius[31:21] + update rate in ms[16:8] +
231242 * DIMM address[7:0]
232243 */
233244 {1, 1, HSMP_GET},
......@@ -295,6 +306,104 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
295306 * input: args[0] = min df pstate[15:8] + max df pstate[7:0]
296307 */
297308 {1, 0, HSMP_SET},
309
310 /*
311 * HSMP_GET_METRIC_TABLE_VER, num_args = 0, response_sz = 1
312 * output: args[0] = metrics table version
313 */
314 {0, 1, HSMP_GET},
315
316 /*
317 * HSMP_GET_METRIC_TABLE, num_args = 0, response_sz = 0
318 */
319 {0, 0, HSMP_GET},
320
321 /*
322 * HSMP_GET_METRIC_TABLE_DRAM_ADDR, num_args = 0, response_sz = 2
323 * output: args[0] = lower 32 bits of the address
324 * output: args[1] = upper 32 bits of the address
325 */
326 {0, 2, HSMP_GET},
327};
328
329/* Metrics table (supported only with proto version 6) */
330struct hsmp_metric_table {
331 __u32 accumulation_counter;
332
333 /* TEMPERATURE */
334 __u32 max_socket_temperature;
335 __u32 max_vr_temperature;
336 __u32 max_hbm_temperature;
337 __u64 max_socket_temperature_acc;
338 __u64 max_vr_temperature_acc;
339 __u64 max_hbm_temperature_acc;
340
341 /* POWER */
342 __u32 socket_power_limit;
343 __u32 max_socket_power_limit;
344 __u32 socket_power;
345
346 /* ENERGY */
347 __u64 timestamp;
348 __u64 socket_energy_acc;
349 __u64 ccd_energy_acc;
350 __u64 xcd_energy_acc;
351 __u64 aid_energy_acc;
352 __u64 hbm_energy_acc;
353
354 /* FREQUENCY */
355 __u32 cclk_frequency_limit;
356 __u32 gfxclk_frequency_limit;
357 __u32 fclk_frequency;
358 __u32 uclk_frequency;
359 __u32 socclk_frequency[4];
360 __u32 vclk_frequency[4];
361 __u32 dclk_frequency[4];
362 __u32 lclk_frequency[4];
363 __u64 gfxclk_frequency_acc[8];
364 __u64 cclk_frequency_acc[96];
365
366 /* FREQUENCY RANGE */
367 __u32 max_cclk_frequency;
368 __u32 min_cclk_frequency;
369 __u32 max_gfxclk_frequency;
370 __u32 min_gfxclk_frequency;
371 __u32 fclk_frequency_table[4];
372 __u32 uclk_frequency_table[4];
373 __u32 socclk_frequency_table[4];
374 __u32 vclk_frequency_table[4];
375 __u32 dclk_frequency_table[4];
376 __u32 lclk_frequency_table[4];
377 __u32 max_lclk_dpm_range;
378 __u32 min_lclk_dpm_range;
379
380 /* XGMI */
381 __u32 xgmi_width;
382 __u32 xgmi_bitrate;
383 __u64 xgmi_read_bandwidth_acc[8];
384 __u64 xgmi_write_bandwidth_acc[8];
385
386 /* ACTIVITY */
387 __u32 socket_c0_residency;
388 __u32 socket_gfx_busy;
389 __u32 dram_bandwidth_utilization;
390 __u64 socket_c0_residency_acc;
391 __u64 socket_gfx_busy_acc;
392 __u64 dram_bandwidth_acc;
393 __u32 max_dram_bandwidth;
394 __u64 dram_bandwidth_utilization_acc;
395 __u64 pcie_bandwidth_acc[4];
396
397 /* THROTTLERS */
398 __u32 prochot_residency_acc;
399 __u32 ppt_residency_acc;
400 __u32 socket_thm_residency_acc;
401 __u32 vr_thm_residency_acc;
402 __u32 hbm_thm_residency_acc;
403 __u32 spare;
404
405 /* New items at the end to maintain driver compatibility */
406 __u32 gfxclk_frequency[8];
298407};
299408
300409/* Reset to default packing */
lib/libc/include/x86-linux-any/asm/bootparam.h+2-71
......@@ -2,21 +2,7 @@
22#ifndef _ASM_X86_BOOTPARAM_H
33#define _ASM_X86_BOOTPARAM_H
44
5/* setup_data/setup_indirect types */
6#define SETUP_NONE 0
7#define SETUP_E820_EXT 1
8#define SETUP_DTB 2
9#define SETUP_PCI 3
10#define SETUP_EFI 4
11#define SETUP_APPLE_PROPERTIES 5
12#define SETUP_JAILHOUSE 6
13#define SETUP_CC_BLOB 7
14#define SETUP_IMA 8
15#define SETUP_RNG_SEED 9
16#define SETUP_ENUM_MAX SETUP_RNG_SEED
17
18#define SETUP_INDIRECT (1<<31)
19#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
5#include <asm/setup_data.h>
206
217/* ram_size flags */
228#define RAMDISK_IMAGE_START_MASK 0x07FF
......@@ -38,6 +24,7 @@
3824#define XLF_EFI_KEXEC (1<<4)
3925#define XLF_5LEVEL (1<<5)
4026#define XLF_5LEVEL_ENABLED (1<<6)
27#define XLF_MEM_ENCRYPTION (1<<7)
4128
4229#ifndef __ASSEMBLY__
4330
......@@ -48,22 +35,6 @@
4835#include <asm/ist.h>
4936#include <video/edid.h>
5037
51/* extensible setup data list node */
52struct setup_data {
53 __u64 next;
54 __u32 type;
55 __u32 len;
56 __u8 data[];
57};
58
59/* extensible setup indirect data node */
60struct setup_indirect {
61 __u32 type;
62 __u32 reserved; /* Reserved, must be set to zero. */
63 __u64 len;
64 __u64 addr;
65};
66
6738struct setup_header {
6839 __u8 setup_sects;
6940 __u16 root_flags;
......@@ -136,51 +107,11 @@ struct efi_info {
136107 */
137108#define E820_MAX_ENTRIES_ZEROPAGE 128
138109
139/*
140 * The E820 memory region entry of the boot protocol ABI:
141 */
142struct boot_e820_entry {
143 __u64 addr;
144 __u64 size;
145 __u32 type;
146} __attribute__((packed));
147
148110/*
149111 * Smallest compatible version of jailhouse_setup_data required by this kernel.
150112 */
151113#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
152114
153/*
154 * The boot loader is passing platform information via this Jailhouse-specific
155 * setup data structure.
156 */
157struct jailhouse_setup_data {
158 struct {
159 __u16 version;
160 __u16 compatible_version;
161 } __attribute__((packed)) hdr;
162 struct {
163 __u16 pm_timer_address;
164 __u16 num_cpus;
165 __u64 pci_mmconfig_base;
166 __u32 tsc_khz;
167 __u32 apic_khz;
168 __u8 standard_ioapic;
169 __u8 cpu_ids[255];
170 } __attribute__((packed)) v1;
171 struct {
172 __u32 flags;
173 } __attribute__((packed)) v2;
174} __attribute__((packed));
175
176/*
177 * IMA buffer setup data information from the previous kernel during kexec
178 */
179struct ima_setup_data {
180 __u64 addr;
181 __u64 size;
182} __attribute__((packed));
183
184115/* The so-called "zeropage" */
185116struct boot_params {
186117 struct screen_info screen_info; /* 0x000 */
lib/libc/include/x86-linux-any/asm/kvm.h+325-9
......@@ -7,6 +7,8 @@
77 *
88 */
99
10#include <linux/const.h>
11#include <linux/bits.h>
1012#include <linux/types.h>
1113#include <linux/ioctl.h>
1214#include <linux/stddef.h>
......@@ -40,7 +42,6 @@
4042#define __KVM_HAVE_IRQ_LINE
4143#define __KVM_HAVE_MSI
4244#define __KVM_HAVE_USER_NMI
43#define __KVM_HAVE_GUEST_DEBUG
4445#define __KVM_HAVE_MSIX
4546#define __KVM_HAVE_MCE
4647#define __KVM_HAVE_PIT_STATE2
......@@ -49,7 +50,6 @@
4950#define __KVM_HAVE_DEBUGREGS
5051#define __KVM_HAVE_XSAVE
5152#define __KVM_HAVE_XCRS
52#define __KVM_HAVE_READONLY_MEM
5353
5454/* Architectural interrupt line count. */
5555#define KVM_NR_INTERRUPTS 256
......@@ -455,8 +455,13 @@ struct kvm_sync_regs {
455455
456456#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
457457
458/* attributes for system fd (group 0) */
459#define KVM_X86_XCOMP_GUEST_SUPP 0
458/* vendor-independent attributes for system fd (group 0) */
459#define KVM_X86_GRP_SYSTEM 0
460# define KVM_X86_XCOMP_GUEST_SUPP 0
461
462/* vendor-specific groups and attributes for system fd */
463#define KVM_X86_GRP_SEV 1
464# define KVM_X86_SEV_VMSA_FEATURES 0
460465
461466struct kvm_vmx_nested_state_data {
462467 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
......@@ -524,9 +529,312 @@ struct kvm_pmu_event_filter {
524529#define KVM_PMU_EVENT_ALLOW 0
525530#define KVM_PMU_EVENT_DENY 1
526531
527#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS BIT(0)
532#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS _BITUL(0)
528533#define KVM_PMU_EVENT_FLAGS_VALID_MASK (KVM_PMU_EVENT_FLAG_MASKED_EVENTS)
529534
535/* for KVM_CAP_MCE */
536struct kvm_x86_mce {
537 __u64 status;
538 __u64 addr;
539 __u64 misc;
540 __u64 mcg_status;
541 __u8 bank;
542 __u8 pad1[7];
543 __u64 pad2[3];
544};
545
546/* for KVM_CAP_XEN_HVM */
547#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR (1 << 0)
548#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
549#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
550#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
551#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)
552#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)
553#define KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG (1 << 6)
554#define KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE (1 << 7)
555#define KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA (1 << 8)
556
557struct kvm_xen_hvm_config {
558 __u32 flags;
559 __u32 msr;
560 __u64 blob_addr_32;
561 __u64 blob_addr_64;
562 __u8 blob_size_32;
563 __u8 blob_size_64;
564 __u8 pad2[30];
565};
566
567struct kvm_xen_hvm_attr {
568 __u16 type;
569 __u16 pad[3];
570 union {
571 __u8 long_mode;
572 __u8 vector;
573 __u8 runstate_update_flag;
574 union {
575 __u64 gfn;
576#define KVM_XEN_INVALID_GFN ((__u64)-1)
577 __u64 hva;
578 } shared_info;
579 struct {
580 __u32 send_port;
581 __u32 type; /* EVTCHNSTAT_ipi / EVTCHNSTAT_interdomain */
582 __u32 flags;
583#define KVM_XEN_EVTCHN_DEASSIGN (1 << 0)
584#define KVM_XEN_EVTCHN_UPDATE (1 << 1)
585#define KVM_XEN_EVTCHN_RESET (1 << 2)
586 /*
587 * Events sent by the guest are either looped back to
588 * the guest itself (potentially on a different port#)
589 * or signalled via an eventfd.
590 */
591 union {
592 struct {
593 __u32 port;
594 __u32 vcpu;
595 __u32 priority;
596 } port;
597 struct {
598 __u32 port; /* Zero for eventfd */
599 __s32 fd;
600 } eventfd;
601 __u32 padding[4];
602 } deliver;
603 } evtchn;
604 __u32 xen_version;
605 __u64 pad[8];
606 } u;
607};
608
609
610/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
611#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
612#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
613#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2
614/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
615#define KVM_XEN_ATTR_TYPE_EVTCHN 0x3
616#define KVM_XEN_ATTR_TYPE_XEN_VERSION 0x4
617/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG */
618#define KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG 0x5
619/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA */
620#define KVM_XEN_ATTR_TYPE_SHARED_INFO_HVA 0x6
621
622struct kvm_xen_vcpu_attr {
623 __u16 type;
624 __u16 pad[3];
625 union {
626 __u64 gpa;
627#define KVM_XEN_INVALID_GPA ((__u64)-1)
628 __u64 hva;
629 __u64 pad[8];
630 struct {
631 __u64 state;
632 __u64 state_entry_time;
633 __u64 time_running;
634 __u64 time_runnable;
635 __u64 time_blocked;
636 __u64 time_offline;
637 } runstate;
638 __u32 vcpu_id;
639 struct {
640 __u32 port;
641 __u32 priority;
642 __u64 expires_ns;
643 } timer;
644 __u8 vector;
645 } u;
646};
647
648/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
649#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO 0x0
650#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO 0x1
651#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR 0x2
652#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
653#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
654#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x5
655/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
656#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID 0x6
657#define KVM_XEN_VCPU_ATTR_TYPE_TIMER 0x7
658#define KVM_XEN_VCPU_ATTR_TYPE_UPCALL_VECTOR 0x8
659/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA */
660#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO_HVA 0x9
661
662/* Secure Encrypted Virtualization command */
663enum sev_cmd_id {
664 /* Guest initialization commands */
665 KVM_SEV_INIT = 0,
666 KVM_SEV_ES_INIT,
667 /* Guest launch commands */
668 KVM_SEV_LAUNCH_START,
669 KVM_SEV_LAUNCH_UPDATE_DATA,
670 KVM_SEV_LAUNCH_UPDATE_VMSA,
671 KVM_SEV_LAUNCH_SECRET,
672 KVM_SEV_LAUNCH_MEASURE,
673 KVM_SEV_LAUNCH_FINISH,
674 /* Guest migration commands (outgoing) */
675 KVM_SEV_SEND_START,
676 KVM_SEV_SEND_UPDATE_DATA,
677 KVM_SEV_SEND_UPDATE_VMSA,
678 KVM_SEV_SEND_FINISH,
679 /* Guest migration commands (incoming) */
680 KVM_SEV_RECEIVE_START,
681 KVM_SEV_RECEIVE_UPDATE_DATA,
682 KVM_SEV_RECEIVE_UPDATE_VMSA,
683 KVM_SEV_RECEIVE_FINISH,
684 /* Guest status and debug commands */
685 KVM_SEV_GUEST_STATUS,
686 KVM_SEV_DBG_DECRYPT,
687 KVM_SEV_DBG_ENCRYPT,
688 /* Guest certificates commands */
689 KVM_SEV_CERT_EXPORT,
690 /* Attestation report */
691 KVM_SEV_GET_ATTESTATION_REPORT,
692 /* Guest Migration Extension */
693 KVM_SEV_SEND_CANCEL,
694
695 /* Second time is the charm; improved versions of the above ioctls. */
696 KVM_SEV_INIT2,
697
698 KVM_SEV_NR_MAX,
699};
700
701struct kvm_sev_cmd {
702 __u32 id;
703 __u32 pad0;
704 __u64 data;
705 __u32 error;
706 __u32 sev_fd;
707};
708
709struct kvm_sev_init {
710 __u64 vmsa_features;
711 __u32 flags;
712 __u16 ghcb_version;
713 __u16 pad1;
714 __u32 pad2[8];
715};
716
717struct kvm_sev_launch_start {
718 __u32 handle;
719 __u32 policy;
720 __u64 dh_uaddr;
721 __u32 dh_len;
722 __u32 pad0;
723 __u64 session_uaddr;
724 __u32 session_len;
725 __u32 pad1;
726};
727
728struct kvm_sev_launch_update_data {
729 __u64 uaddr;
730 __u32 len;
731 __u32 pad0;
732};
733
734
735struct kvm_sev_launch_secret {
736 __u64 hdr_uaddr;
737 __u32 hdr_len;
738 __u32 pad0;
739 __u64 guest_uaddr;
740 __u32 guest_len;
741 __u32 pad1;
742 __u64 trans_uaddr;
743 __u32 trans_len;
744 __u32 pad2;
745};
746
747struct kvm_sev_launch_measure {
748 __u64 uaddr;
749 __u32 len;
750 __u32 pad0;
751};
752
753struct kvm_sev_guest_status {
754 __u32 handle;
755 __u32 policy;
756 __u32 state;
757};
758
759struct kvm_sev_dbg {
760 __u64 src_uaddr;
761 __u64 dst_uaddr;
762 __u32 len;
763 __u32 pad0;
764};
765
766struct kvm_sev_attestation_report {
767 __u8 mnonce[16];
768 __u64 uaddr;
769 __u32 len;
770 __u32 pad0;
771};
772
773struct kvm_sev_send_start {
774 __u32 policy;
775 __u32 pad0;
776 __u64 pdh_cert_uaddr;
777 __u32 pdh_cert_len;
778 __u32 pad1;
779 __u64 plat_certs_uaddr;
780 __u32 plat_certs_len;
781 __u32 pad2;
782 __u64 amd_certs_uaddr;
783 __u32 amd_certs_len;
784 __u32 pad3;
785 __u64 session_uaddr;
786 __u32 session_len;
787 __u32 pad4;
788};
789
790struct kvm_sev_send_update_data {
791 __u64 hdr_uaddr;
792 __u32 hdr_len;
793 __u32 pad0;
794 __u64 guest_uaddr;
795 __u32 guest_len;
796 __u32 pad1;
797 __u64 trans_uaddr;
798 __u32 trans_len;
799 __u32 pad2;
800};
801
802struct kvm_sev_receive_start {
803 __u32 handle;
804 __u32 policy;
805 __u64 pdh_uaddr;
806 __u32 pdh_len;
807 __u32 pad0;
808 __u64 session_uaddr;
809 __u32 session_len;
810 __u32 pad1;
811};
812
813struct kvm_sev_receive_update_data {
814 __u64 hdr_uaddr;
815 __u32 hdr_len;
816 __u32 pad0;
817 __u64 guest_uaddr;
818 __u32 guest_len;
819 __u32 pad1;
820 __u64 trans_uaddr;
821 __u32 trans_len;
822 __u32 pad2;
823};
824
825#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
826#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
827
828struct kvm_hyperv_eventfd {
829 __u32 conn_id;
830 __s32 fd;
831 __u32 flags;
832 __u32 padding[3];
833};
834
835#define KVM_HYPERV_CONN_ID_MASK 0x00ffffff
836#define KVM_HYPERV_EVENTFD_DEASSIGN (1 << 0)
837
530838/*
531839 * Masked event layout.
532840 * Bits Description
......@@ -547,14 +855,22 @@ struct kvm_pmu_event_filter {
547855 ((__u64)(!!(exclude)) << 55))
548856
549857#define KVM_PMU_MASKED_ENTRY_EVENT_SELECT \
550 (GENMASK_ULL(7, 0) | GENMASK_ULL(35, 32))
551#define KVM_PMU_MASKED_ENTRY_UMASK_MASK (GENMASK_ULL(63, 56))
552#define KVM_PMU_MASKED_ENTRY_UMASK_MATCH (GENMASK_ULL(15, 8))
553#define KVM_PMU_MASKED_ENTRY_EXCLUDE (BIT_ULL(55))
858 (__GENMASK_ULL(7, 0) | __GENMASK_ULL(35, 32))
859#define KVM_PMU_MASKED_ENTRY_UMASK_MASK (__GENMASK_ULL(63, 56))
860#define KVM_PMU_MASKED_ENTRY_UMASK_MATCH (__GENMASK_ULL(15, 8))
861#define KVM_PMU_MASKED_ENTRY_EXCLUDE (_BITULL(55))
554862#define KVM_PMU_MASKED_ENTRY_UMASK_MASK_SHIFT (56)
555863
556864/* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
557865#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
558866#define KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */
559867
868/* x86-specific KVM_EXIT_HYPERCALL flags. */
869#define KVM_EXIT_HYPERCALL_LONG_MODE _BITULL(0)
870
871#define KVM_X86_DEFAULT_VM 0
872#define KVM_X86_SW_PROTECTED_VM 1
873#define KVM_X86_SEV_VM 2
874#define KVM_X86_SEV_ES_VM 3
875
560876#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm_para.h+1-2
......@@ -92,7 +92,7 @@ struct kvm_clock_pairing {
9292#define KVM_ASYNC_PF_DELIVERY_AS_INT (1 << 3)
9393
9494/* MSR_KVM_ASYNC_PF_INT */
95#define KVM_ASYNC_PF_VEC_MASK GENMASK(7, 0)
95#define KVM_ASYNC_PF_VEC_MASK __GENMASK(7, 0)
9696
9797/* MSR_KVM_MIGRATION_CONTROL */
9898#define KVM_MIGRATION_READY (1 << 0)
......@@ -142,7 +142,6 @@ struct kvm_vcpu_pv_apf_data {
142142 __u32 token;
143143
144144 __u8 pad[56];
145 __u32 enabled;
146145};
147146
148147#define KVM_PV_EOI_BIT 0
lib/libc/include/x86-linux-any/asm/mman.h+3-7
......@@ -3,14 +3,10 @@
33#define _ASM_X86_MMAN_H
44
55#define MAP_32BIT 0x40 /* only give out 32bit addresses */
6#define MAP_ABOVE4G 0x80 /* only map above 4GB */
67
7#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8#define arch_calc_vm_prot_bits(prot, key) ( \
9 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
10 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
11 ((key) & 0x4 ? VM_PKEY_BIT2 : 0) | \
12 ((key) & 0x8 ? VM_PKEY_BIT3 : 0))
13#endif
8/* Flags for map_shadow_stack(2) */
9#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */
1410
1511#include <asm-generic/mman.h>
1612
lib/libc/include/x86-linux-any/asm/mtrr.h+3-11
......@@ -81,14 +81,6 @@ typedef __u8 mtrr_type;
8181#define MTRR_NUM_FIXED_RANGES 88
8282#define MTRR_MAX_VAR_RANGES 256
8383
84struct mtrr_state_type {
85 struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
86 mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
87 unsigned char enabled;
88 unsigned char have_fixed;
89 mtrr_type def_type;
90};
91
9284#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
9385#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
9486
......@@ -115,9 +107,9 @@ struct mtrr_state_type {
115107#define MTRR_NUM_TYPES 7
116108
117109/*
118 * Invalid MTRR memory type. mtrr_type_lookup() returns this value when
119 * MTRRs are disabled. Note, this value is allocated from the reserved
120 * values (0x7-0xff) of the MTRR memory types.
110 * Invalid MTRR memory type. No longer used outside of MTRR code.
111 * Note, this value is allocated from the reserved values (0x7-0xff) of
112 * the MTRR memory types.
121113 */
122114#define MTRR_TYPE_INVALID 0xff
123115
lib/libc/include/x86-linux-any/asm/prctl.h+20
......@@ -16,8 +16,28 @@
1616#define ARCH_GET_XCOMP_GUEST_PERM 0x1024
1717#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025
1818
19#define ARCH_XCOMP_TILECFG 17
20#define ARCH_XCOMP_TILEDATA 18
21
1922#define ARCH_MAP_VDSO_X32 0x2001
2023#define ARCH_MAP_VDSO_32 0x2002
2124#define ARCH_MAP_VDSO_64 0x2003
2225
26/* Don't use 0x3001-0x3004 because of old glibcs */
27
28#define ARCH_GET_UNTAG_MASK 0x4001
29#define ARCH_ENABLE_TAGGED_ADDR 0x4002
30#define ARCH_GET_MAX_TAG_BITS 0x4003
31#define ARCH_FORCE_TAGGED_SVA 0x4004
32
33#define ARCH_SHSTK_ENABLE 0x5001
34#define ARCH_SHSTK_DISABLE 0x5002
35#define ARCH_SHSTK_LOCK 0x5003
36#define ARCH_SHSTK_UNLOCK 0x5004
37#define ARCH_SHSTK_STATUS 0x5005
38
39/* ARCH_SHSTK_ features bits */
40#define ARCH_SHSTK_SHSTK (1ULL << 0)
41#define ARCH_SHSTK_WRSS (1ULL << 1)
42
2343#endif /* _ASM_X86_PRCTL_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/processor-flags.h+13
......@@ -82,6 +82,10 @@
8282#define X86_CR3_PCID_BITS 12
8383#define X86_CR3_PCID_MASK (_AC((1UL << X86_CR3_PCID_BITS) - 1, UL))
8484
85#define X86_CR3_LAM_U57_BIT 61 /* Activate LAM for userspace, 62:57 bits masked */
86#define X86_CR3_LAM_U57 _BITULL(X86_CR3_LAM_U57_BIT)
87#define X86_CR3_LAM_U48_BIT 62 /* Activate LAM for userspace, 62:48 bits masked */
88#define X86_CR3_LAM_U48 _BITULL(X86_CR3_LAM_U48_BIT)
8589#define X86_CR3_PCID_NOFLUSH_BIT 63 /* Preserve old PCID */
8690#define X86_CR3_PCID_NOFLUSH _BITULL(X86_CR3_PCID_NOFLUSH_BIT)
8791
......@@ -132,6 +136,15 @@
132136#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
133137#define X86_CR4_CET_BIT 23 /* enable Control-flow Enforcement Technology */
134138#define X86_CR4_CET _BITUL(X86_CR4_CET_BIT)
139#define X86_CR4_LAM_SUP_BIT 28 /* LAM for supervisor pointers */
140#define X86_CR4_LAM_SUP _BITUL(X86_CR4_LAM_SUP_BIT)
141
142#ifdef __x86_64__
143#define X86_CR4_FRED_BIT 32 /* enable FRED kernel entry */
144#define X86_CR4_FRED _BITUL(X86_CR4_FRED_BIT)
145#else
146#define X86_CR4_FRED (0)
147#endif
135148
136149/*
137150 * x86-64 Task Priority Register, CR8
lib/libc/include/x86-linux-any/asm/setup_data.h created+83
......@@ -0,0 +1,83 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_X86_SETUP_DATA_H
3#define _ASM_X86_SETUP_DATA_H
4
5/* setup_data/setup_indirect types */
6#define SETUP_NONE 0
7#define SETUP_E820_EXT 1
8#define SETUP_DTB 2
9#define SETUP_PCI 3
10#define SETUP_EFI 4
11#define SETUP_APPLE_PROPERTIES 5
12#define SETUP_JAILHOUSE 6
13#define SETUP_CC_BLOB 7
14#define SETUP_IMA 8
15#define SETUP_RNG_SEED 9
16#define SETUP_ENUM_MAX SETUP_RNG_SEED
17
18#define SETUP_INDIRECT (1<<31)
19#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
20
21#ifndef __ASSEMBLY__
22
23#include <linux/types.h>
24
25/* extensible setup data list node */
26struct setup_data {
27 __u64 next;
28 __u32 type;
29 __u32 len;
30 __u8 data[];
31};
32
33/* extensible setup indirect data node */
34struct setup_indirect {
35 __u32 type;
36 __u32 reserved; /* Reserved, must be set to zero. */
37 __u64 len;
38 __u64 addr;
39};
40
41/*
42 * The E820 memory region entry of the boot protocol ABI:
43 */
44struct boot_e820_entry {
45 __u64 addr;
46 __u64 size;
47 __u32 type;
48} __attribute__((packed));
49
50/*
51 * The boot loader is passing platform information via this Jailhouse-specific
52 * setup data structure.
53 */
54struct jailhouse_setup_data {
55 struct {
56 __u16 version;
57 __u16 compatible_version;
58 } __attribute__((packed)) hdr;
59 struct {
60 __u16 pm_timer_address;
61 __u16 num_cpus;
62 __u64 pci_mmconfig_base;
63 __u32 tsc_khz;
64 __u32 apic_khz;
65 __u8 standard_ioapic;
66 __u8 cpu_ids[255];
67 } __attribute__((packed)) v1;
68 struct {
69 __u32 flags;
70 } __attribute__((packed)) v2;
71} __attribute__((packed));
72
73/*
74 * IMA buffer setup data information from the previous kernel during kexec
75 */
76struct ima_setup_data {
77 __u64 addr;
78 __u64 size;
79} __attribute__((packed));
80
81#endif /* __ASSEMBLY__ */
82
83#endif /* _ASM_X86_SETUP_DATA_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/signal.h-1
......@@ -4,7 +4,6 @@
44
55#ifndef __ASSEMBLY__
66#include <linux/types.h>
7#include <linux/time.h>
87
98
109/* Avoid too many header ordering problems. */
lib/libc/include/x86-linux-any/asm/unistd_32.h+12
......@@ -441,6 +441,18 @@
441441#define __NR_process_mrelease 448
442442#define __NR_futex_waitv 449
443443#define __NR_set_mempolicy_home_node 450
444#define __NR_cachestat 451
445#define __NR_fchmodat2 452
446#define __NR_map_shadow_stack 453
447#define __NR_futex_wake 454
448#define __NR_futex_wait 455
449#define __NR_futex_requeue 456
450#define __NR_statmount 457
451#define __NR_listmount 458
452#define __NR_lsm_get_self_attr 459
453#define __NR_lsm_set_self_attr 460
454#define __NR_lsm_list_modules 461
455#define __NR_mseal 462
444456
445457
446458#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h+12
......@@ -363,6 +363,18 @@
363363#define __NR_process_mrelease 448
364364#define __NR_futex_waitv 449
365365#define __NR_set_mempolicy_home_node 450
366#define __NR_cachestat 451
367#define __NR_fchmodat2 452
368#define __NR_map_shadow_stack 453
369#define __NR_futex_wake 454
370#define __NR_futex_wait 455
371#define __NR_futex_requeue 456
372#define __NR_statmount 457
373#define __NR_listmount 458
374#define __NR_lsm_get_self_attr 459
375#define __NR_lsm_set_self_attr 460
376#define __NR_lsm_list_modules 461
377#define __NR_mseal 462
366378
367379
368380#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h+12
......@@ -316,6 +316,18 @@
316316#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)
317317#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)
318318#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)
319#define __NR_cachestat (__X32_SYSCALL_BIT + 451)
320#define __NR_fchmodat2 (__X32_SYSCALL_BIT + 452)
321#define __NR_map_shadow_stack (__X32_SYSCALL_BIT + 453)
322#define __NR_futex_wake (__X32_SYSCALL_BIT + 454)
323#define __NR_futex_wait (__X32_SYSCALL_BIT + 455)
324#define __NR_futex_requeue (__X32_SYSCALL_BIT + 456)
325#define __NR_statmount (__X32_SYSCALL_BIT + 457)
326#define __NR_listmount (__X32_SYSCALL_BIT + 458)
327#define __NR_lsm_get_self_attr (__X32_SYSCALL_BIT + 459)
328#define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460)
329#define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461)
330#define __NR_mseal (__X32_SYSCALL_BIT + 462)
319331#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
320332#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
321333#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/xtensa-linux-any/asm/unistd_32.h+12
......@@ -397,6 +397,18 @@
397397#define __NR_process_mrelease 448
398398#define __NR_futex_waitv 449
399399#define __NR_set_mempolicy_home_node 450
400#define __NR_cachestat 451
401#define __NR_fchmodat2 452
402#define __NR_map_shadow_stack 453
403#define __NR_futex_wake 454
404#define __NR_futex_wait 455
405#define __NR_futex_requeue 456
406#define __NR_statmount 457
407#define __NR_listmount 458
408#define __NR_lsm_get_self_attr 459
409#define __NR_lsm_set_self_attr 460
410#define __NR_lsm_list_modules 461
411#define __NR_mseal 462
400412
401413
402414#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/std/Target.zig+1-1
......@@ -481,7 +481,7 @@ pub const Os = struct {
481481 .linux = .{
482482 .range = .{
483483 .min = .{ .major = 4, .minor = 19, .patch = 0 },
484 .max = .{ .major = 6, .minor = 5, .patch = 7 },
484 .max = .{ .major = 6, .minor = 10, .patch = 3 },
485485 },
486486 .glibc = blk: {
487487 const default_min = .{ .major = 2, .minor = 28, .patch = 0 };
lib/std/os/linux/syscalls.zig+120
......@@ -448,6 +448,12 @@ pub const X86 = enum(usize) {
448448 futex_wake = 454,
449449 futex_wait = 455,
450450 futex_requeue = 456,
451 statmount = 457,
452 listmount = 458,
453 lsm_get_self_attr = 459,
454 lsm_set_self_attr = 460,
455 lsm_list_modules = 461,
456 mseal = 462,
451457};
452458
453459pub const X64 = enum(usize) {
......@@ -819,6 +825,12 @@ pub const X64 = enum(usize) {
819825 futex_wake = 454,
820826 futex_wait = 455,
821827 futex_requeue = 456,
828 statmount = 457,
829 listmount = 458,
830 lsm_get_self_attr = 459,
831 lsm_set_self_attr = 460,
832 lsm_list_modules = 461,
833 mseal = 462,
822834};
823835
824836pub const Arm = enum(usize) {
......@@ -1233,6 +1245,12 @@ pub const Arm = enum(usize) {
12331245 futex_wake = 454,
12341246 futex_wait = 455,
12351247 futex_requeue = 456,
1248 statmount = 457,
1249 listmount = 458,
1250 lsm_get_self_attr = 459,
1251 lsm_set_self_attr = 460,
1252 lsm_list_modules = 461,
1253 mseal = 462,
12361254
12371255 breakpoint = arm_base + 1,
12381256 cacheflush = arm_base + 2,
......@@ -1668,6 +1686,12 @@ pub const Sparc = enum(usize) {
16681686 futex_wake = 454,
16691687 futex_wait = 455,
16701688 futex_requeue = 456,
1689 statmount = 457,
1690 listmount = 458,
1691 lsm_get_self_attr = 459,
1692 lsm_set_self_attr = 460,
1693 lsm_list_modules = 461,
1694 mseal = 462,
16711695};
16721696
16731697pub const Sparc64 = enum(usize) {
......@@ -2059,6 +2083,12 @@ pub const Sparc64 = enum(usize) {
20592083 futex_wake = 454,
20602084 futex_wait = 455,
20612085 futex_requeue = 456,
2086 statmount = 457,
2087 listmount = 458,
2088 lsm_get_self_attr = 459,
2089 lsm_set_self_attr = 460,
2090 lsm_list_modules = 461,
2091 mseal = 462,
20622092};
20632093
20642094pub const M68k = enum(usize) {
......@@ -2490,6 +2520,12 @@ pub const M68k = enum(usize) {
24902520 futex_wake = 454,
24912521 futex_wait = 455,
24922522 futex_requeue = 456,
2523 statmount = 457,
2524 listmount = 458,
2525 lsm_get_self_attr = 459,
2526 lsm_set_self_attr = 460,
2527 lsm_list_modules = 461,
2528 mseal = 462,
24932529};
24942530
24952531pub const MipsO32 = enum(usize) {
......@@ -2917,6 +2953,12 @@ pub const MipsO32 = enum(usize) {
29172953 futex_wake = linux_base + 454,
29182954 futex_wait = linux_base + 455,
29192955 futex_requeue = linux_base + 456,
2956 statmount = linux_base + 457,
2957 listmount = linux_base + 458,
2958 lsm_get_self_attr = linux_base + 459,
2959 lsm_set_self_attr = linux_base + 460,
2960 lsm_list_modules = linux_base + 461,
2961 mseal = linux_base + 462,
29202962};
29212963
29222964pub const MipsN64 = enum(usize) {
......@@ -3280,6 +3322,12 @@ pub const MipsN64 = enum(usize) {
32803322 futex_wake = linux_base + 454,
32813323 futex_wait = linux_base + 455,
32823324 futex_requeue = linux_base + 456,
3325 statmount = linux_base + 457,
3326 listmount = linux_base + 458,
3327 lsm_get_self_attr = linux_base + 459,
3328 lsm_set_self_attr = linux_base + 460,
3329 lsm_list_modules = linux_base + 461,
3330 mseal = linux_base + 462,
32833331};
32843332
32853333pub const MipsN32 = enum(usize) {
......@@ -3667,6 +3715,12 @@ pub const MipsN32 = enum(usize) {
36673715 futex_wake = linux_base + 454,
36683716 futex_wait = linux_base + 455,
36693717 futex_requeue = linux_base + 456,
3718 statmount = linux_base + 457,
3719 listmount = linux_base + 458,
3720 lsm_get_self_attr = linux_base + 459,
3721 lsm_set_self_attr = linux_base + 460,
3722 lsm_list_modules = linux_base + 461,
3723 mseal = linux_base + 462,
36703724};
36713725
36723726pub const PowerPC = enum(usize) {
......@@ -4107,6 +4161,12 @@ pub const PowerPC = enum(usize) {
41074161 futex_wake = 454,
41084162 futex_wait = 455,
41094163 futex_requeue = 456,
4164 statmount = 457,
4165 listmount = 458,
4166 lsm_get_self_attr = 459,
4167 lsm_set_self_attr = 460,
4168 lsm_list_modules = 461,
4169 mseal = 462,
41104170};
41114171
41124172pub const PowerPC64 = enum(usize) {
......@@ -4519,6 +4579,12 @@ pub const PowerPC64 = enum(usize) {
45194579 futex_wake = 454,
45204580 futex_wait = 455,
45214581 futex_requeue = 456,
4582 statmount = 457,
4583 listmount = 458,
4584 lsm_get_self_attr = 459,
4585 lsm_set_self_attr = 460,
4586 lsm_list_modules = 461,
4587 mseal = 462,
45224588};
45234589
45244590pub const S390x = enum(usize) {
......@@ -4897,6 +4963,12 @@ pub const S390x = enum(usize) {
48974963 futex_wake = 454,
48984964 futex_wait = 455,
48994965 futex_requeue = 456,
4966 statmount = 457,
4967 listmount = 458,
4968 lsm_get_self_attr = 459,
4969 lsm_set_self_attr = 460,
4970 lsm_list_modules = 461,
4971 mseal = 462,
49004972};
49014973
49024974pub const Xtensa = enum(usize) {
......@@ -5279,6 +5351,12 @@ pub const Xtensa = enum(usize) {
52795351 futex_wake = 454,
52805352 futex_wait = 455,
52815353 futex_requeue = 456,
5354 statmount = 457,
5355 listmount = 458,
5356 lsm_get_self_attr = 459,
5357 lsm_set_self_attr = 460,
5358 lsm_list_modules = 461,
5359 mseal = 462,
52825360};
52835361
52845362pub const Arm64 = enum(usize) {
......@@ -5594,6 +5672,12 @@ pub const Arm64 = enum(usize) {
55945672 futex_wake = 454,
55955673 futex_wait = 455,
55965674 futex_requeue = 456,
5675 statmount = 457,
5676 listmount = 458,
5677 lsm_get_self_attr = 459,
5678 lsm_set_self_attr = 460,
5679 lsm_list_modules = 461,
5680 mseal = 462,
55975681};
55985682
55995683pub const RiscV32 = enum(usize) {
......@@ -5898,6 +5982,12 @@ pub const RiscV32 = enum(usize) {
58985982 futex_wake = 454,
58995983 futex_wait = 455,
59005984 futex_requeue = 456,
5985 statmount = 457,
5986 listmount = 458,
5987 lsm_get_self_attr = 459,
5988 lsm_set_self_attr = 460,
5989 lsm_list_modules = 461,
5990 mseal = 462,
59015991 riscv_flush_icache = (244 + 15),
59025992 riscv_hwprobe = (244 + 14),
59035993};
......@@ -6214,6 +6304,12 @@ pub const RiscV64 = enum(usize) {
62146304 futex_wake = 454,
62156305 futex_wait = 455,
62166306 futex_requeue = 456,
6307 statmount = 457,
6308 listmount = 458,
6309 lsm_get_self_attr = 459,
6310 lsm_set_self_attr = 460,
6311 lsm_list_modules = 461,
6312 mseal = 462,
62176313 riscv_flush_icache = (244 + 15),
62186314 riscv_hwprobe = (244 + 14),
62196315};
......@@ -6525,6 +6621,12 @@ pub const LoongArch64 = enum(usize) {
65256621 futex_wake = 454,
65266622 futex_wait = 455,
65276623 futex_requeue = 456,
6624 statmount = 457,
6625 listmount = 458,
6626 lsm_get_self_attr = 459,
6627 lsm_set_self_attr = 460,
6628 lsm_list_modules = 461,
6629 mseal = 462,
65286630};
65296631
65306632pub const Arc = enum(usize) {
......@@ -6859,6 +6961,12 @@ pub const Arc = enum(usize) {
68596961 futex_wake = 454,
68606962 futex_wait = 455,
68616963 futex_requeue = 456,
6964 statmount = 457,
6965 listmount = 458,
6966 lsm_get_self_attr = 459,
6967 lsm_set_self_attr = 460,
6968 lsm_list_modules = 461,
6969 mseal = 462,
68626970 cacheflush = (244 + 0),
68636971 arc_settls = (244 + 1),
68646972 arc_gettls = (244 + 2),
......@@ -7197,6 +7305,12 @@ pub const CSky = enum(usize) {
71977305 futex_wake = 454,
71987306 futex_wait = 455,
71997307 futex_requeue = 456,
7308 statmount = 457,
7309 listmount = 458,
7310 lsm_get_self_attr = 459,
7311 lsm_set_self_attr = 460,
7312 lsm_list_modules = 461,
7313 mseal = 462,
72007314 set_thread_area = (244 + 0),
72017315 cacheflush = (244 + 1),
72027316};
......@@ -7532,4 +7646,10 @@ pub const Hexagon = enum(usize) {
75327646 futex_wake = 454,
75337647 futex_wait = 455,
75347648 futex_requeue = 456,
7649 statmount = 457,
7650 listmount = 458,
7651 lsm_get_self_attr = 459,
7652 lsm_set_self_attr = 460,
7653 lsm_list_modules = 461,
7654 mseal = 462,
75357655};