authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-15 23:58:05-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-06-15 23:58:05-07:00
log5d9e8f27d0dc131e0b4154c5f65376f2fb9f3500
tree915c1c904f853f6207bd151417170ea3351d81b8
parenta2f54fce53d1c2414cf307a23f99fc9e8d736c7e
parent6bd93ef4eb4c80c2e38d17de118ef049d93a3f77
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #16053 from ziglang/update-linux-headers

update linux kernel headers to 6.3.8

433 files changed, 18133 insertions(+), 6298 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+26
......@@ -19,6 +19,9 @@
1919
2020/*
2121 * HWCAP flags - for AT_HWCAP
22 *
23 * Bits 62 and 63 are reserved for use by libc.
24 * Bits 32-61 are unallocated for potential use by libc.
2225 */
2326#define HWCAP_FP (1 << 0)
2427#define HWCAP_ASIMD (1 << 1)
......@@ -76,5 +79,28 @@
7679#define HWCAP2_BTI (1 << 17)
7780#define HWCAP2_MTE (1 << 18)
7881#define HWCAP2_ECV (1 << 19)
82#define HWCAP2_AFP (1 << 20)
83#define HWCAP2_RPRES (1 << 21)
84#define HWCAP2_MTE3 (1 << 22)
85#define HWCAP2_SME (1 << 23)
86#define HWCAP2_SME_I16I64 (1 << 24)
87#define HWCAP2_SME_F64F64 (1 << 25)
88#define HWCAP2_SME_I8I32 (1 << 26)
89#define HWCAP2_SME_F16F32 (1 << 27)
90#define HWCAP2_SME_B16F32 (1 << 28)
91#define HWCAP2_SME_F32F32 (1 << 29)
92#define HWCAP2_SME_FA64 (1 << 30)
93#define HWCAP2_WFXT (1UL << 31)
94#define HWCAP2_EBF16 (1UL << 32)
95#define HWCAP2_SVE_EBF16 (1UL << 33)
96#define HWCAP2_CSSC (1UL << 34)
97#define HWCAP2_RPRFM (1UL << 35)
98#define HWCAP2_SVE2P1 (1UL << 36)
99#define HWCAP2_SME2 (1UL << 37)
100#define HWCAP2_SME2P1 (1UL << 38)
101#define HWCAP2_SME_I16I32 (1UL << 39)
102#define HWCAP2_SME_BI32I32 (1UL << 40)
103#define HWCAP2_SME_B16B16 (1UL << 41)
104#define HWCAP2_SME_F16F16 (1UL << 42)
79105
80106#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h+49-2
......@@ -43,6 +43,7 @@
4343#define __KVM_HAVE_VCPU_EVENTS
4444
4545#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
46#define KVM_DIRTY_LOG_PAGE_OFFSET 64
4647
4748#define KVM_REG_SIZE(id) \
4849 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
......@@ -75,9 +76,11 @@ struct kvm_regs {
7576
7677/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
7778#define KVM_ARM_DEVICE_TYPE_SHIFT 0
78#define KVM_ARM_DEVICE_TYPE_MASK (0xffff << KVM_ARM_DEVICE_TYPE_SHIFT)
79#define KVM_ARM_DEVICE_TYPE_MASK GENMASK(KVM_ARM_DEVICE_TYPE_SHIFT + 15, \
80 KVM_ARM_DEVICE_TYPE_SHIFT)
7981#define KVM_ARM_DEVICE_ID_SHIFT 16
80#define KVM_ARM_DEVICE_ID_MASK (0xffff << KVM_ARM_DEVICE_ID_SHIFT)
82#define KVM_ARM_DEVICE_ID_MASK GENMASK(KVM_ARM_DEVICE_ID_SHIFT + 15, \
83 KVM_ARM_DEVICE_ID_SHIFT)
8184
8285/* Supported device IDs */
8386#define KVM_ARM_DEVICE_VGIC_V2 0
......@@ -106,6 +109,7 @@ struct kvm_regs {
106109#define KVM_ARM_VCPU_SVE 4 /* enable SVE for this CPU */
107110#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */
108111#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */
112#define KVM_ARM_VCPU_HAS_EL2 7 /* Support nested virtualization */
109113
110114struct kvm_vcpu_init {
111115 __u32 target;
......@@ -139,8 +143,10 @@ struct kvm_guest_debug_arch {
139143 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
140144};
141145
146#define KVM_DEBUG_ARCH_HSR_HIGH_VALID (1 << 0)
142147struct kvm_debug_exit_arch {
143148 __u32 hsr;
149 __u32 hsr_high; /* ESR_EL2[61:32] */
144150 __u64 far; /* used for watchpoints */
145151};
146152
......@@ -281,6 +287,11 @@ struct kvm_arm_copy_mte_tags {
281287#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3
282288#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4)
283289
290#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 KVM_REG_ARM_FW_REG(3)
291#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_AVAIL 0
292#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_AVAIL 1
293#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_REQUIRED 2
294
284295/* SVE registers */
285296#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT)
286297
......@@ -327,6 +338,31 @@ struct kvm_arm_copy_mte_tags {
327338#define KVM_ARM64_SVE_VLS_WORDS \
328339 ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)
329340
341/* Bitmap feature firmware registers */
342#define KVM_REG_ARM_FW_FEAT_BMAP (0x0016 << KVM_REG_ARM_COPROC_SHIFT)
343#define KVM_REG_ARM_FW_FEAT_BMAP_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
344 KVM_REG_ARM_FW_FEAT_BMAP | \
345 ((r) & 0xffff))
346
347#define KVM_REG_ARM_STD_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(0)
348
349enum {
350 KVM_REG_ARM_STD_BIT_TRNG_V1_0 = 0,
351};
352
353#define KVM_REG_ARM_STD_HYP_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(1)
354
355enum {
356 KVM_REG_ARM_STD_HYP_BIT_PV_TIME = 0,
357};
358
359#define KVM_REG_ARM_VENDOR_HYP_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(2)
360
361enum {
362 KVM_REG_ARM_VENDOR_HYP_BIT_FUNC_FEAT = 0,
363 KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
364};
365
330366/* Device Control API: ARM VGIC */
331367#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
332368#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
......@@ -362,6 +398,7 @@ struct kvm_arm_copy_mte_tags {
362398#define KVM_ARM_VCPU_PMU_V3_IRQ 0
363399#define KVM_ARM_VCPU_PMU_V3_INIT 1
364400#define KVM_ARM_VCPU_PMU_V3_FILTER 2
401#define KVM_ARM_VCPU_PMU_V3_SET_PMU 3
365402#define KVM_ARM_VCPU_TIMER_CTRL 1
366403#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
367404#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
......@@ -411,6 +448,16 @@ struct kvm_arm_copy_mte_tags {
411448#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
412449#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED
413450
451/* arm64-specific kvm_run::system_event flags */
452/*
453 * Reset caused by a PSCI v1.1 SYSTEM_RESET2 call.
454 * Valid only when the system event has a type of KVM_SYSTEM_EVENT_RESET.
455 */
456#define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0)
457
458/* run->fail_entry.hardware_entry_failure_reason codes. */
459#define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0)
460
414461#endif
415462
416463#endif /* __ARM_KVM_H__ */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/perf_regs.h+7
......@@ -37,5 +37,12 @@ enum perf_event_arm_regs {
3737 PERF_REG_ARM64_SP,
3838 PERF_REG_ARM64_PC,
3939 PERF_REG_ARM64_MAX,
40
41 /* Extended/pseudo registers */
42 PERF_REG_ARM64_VG = 46, /* SVE Vector Granule */
43 PERF_REG_ARM64_EXTENDED_MAX
4044};
45
46#define PERF_REG_EXTENDED_MASK (1ULL << PERF_REG_ARM64_VG)
47
4148#endif /* _ASM_ARM64_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/ptrace.h+64-5
......@@ -109,7 +109,7 @@ struct user_hwdebug_state {
109109 } dbg_regs[16];
110110};
111111
112/* SVE/FP/SIMD state (NT_ARM_SVE) */
112/* SVE/FP/SIMD state (NT_ARM_SVE & NT_ARM_SSVE) */
113113
114114struct user_sve_header {
115115 __u32 size; /* total meaningful regset content in bytes */
......@@ -220,6 +220,7 @@ struct user_sve_header {
220220 (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \
221221 SVE_PT_SVE_PREGS_OFFSET(vq))
222222
223/* For streaming mode SVE (SSVE) FFR must be read and written as zero */
223224#define SVE_PT_SVE_FFR_OFFSET(vq) \
224225 (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
225226
......@@ -240,10 +241,12 @@ struct user_sve_header {
240241 - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) \
241242 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
242243
243#define SVE_PT_SIZE(vq, flags) \
244 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
245 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
246 : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags))
244#define SVE_PT_SIZE(vq, flags) \
245 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
246 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
247 : ((((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_FPSIMD ? \
248 SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags) \
249 : SVE_PT_REGS_OFFSET)))
247250
248251/* pointer authentication masks (NT_ARM_PAC_MASK) */
249252
......@@ -265,6 +268,62 @@ struct user_pac_generic_keys {
265268 __uint128_t apgakey;
266269};
267270
271/* ZA state (NT_ARM_ZA) */
272
273struct user_za_header {
274 __u32 size; /* total meaningful regset content in bytes */
275 __u32 max_size; /* maxmium possible size for this thread */
276 __u16 vl; /* current vector length */
277 __u16 max_vl; /* maximum possible vector length */
278 __u16 flags;
279 __u16 __reserved;
280};
281
282/*
283 * Common ZA_PT_* flags:
284 * These must be kept in sync with prctl interface in <linux/prctl.h>
285 */
286#define ZA_PT_VL_INHERIT ((1 << 17) /* PR_SME_VL_INHERIT */ >> 16)
287#define ZA_PT_VL_ONEXEC ((1 << 18) /* PR_SME_SET_VL_ONEXEC */ >> 16)
288
289
290/*
291 * The remainder of the ZA state follows struct user_za_header. The
292 * total size of the ZA state (including header) depends on the
293 * metadata in the header: ZA_PT_SIZE(vq, flags) gives the total size
294 * of the state in bytes, including the header.
295 *
296 * Refer to <asm/sigcontext.h> for details of how to pass the correct
297 * "vq" argument to these macros.
298 */
299
300/* Offset from the start of struct user_za_header to the register data */
301#define ZA_PT_ZA_OFFSET \
302 ((sizeof(struct user_za_header) + (__SVE_VQ_BYTES - 1)) \
303 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
304
305/*
306 * The payload starts at offset ZA_PT_ZA_OFFSET, and is of size
307 * ZA_PT_ZA_SIZE(vq, flags).
308 *
309 * The ZA array is stored as a sequence of horizontal vectors ZAV of SVL/8
310 * bytes each, starting from vector 0.
311 *
312 * Additional data might be appended in the future.
313 *
314 * The ZA matrix is represented in memory in an endianness-invariant layout
315 * which differs from the layout used for the FPSIMD V-registers on big-endian
316 * systems: see sigcontext.h for more explanation.
317 */
318
319#define ZA_PT_ZAV_OFFSET(vq, n) \
320 (ZA_PT_ZA_OFFSET + ((vq * __SVE_VQ_BYTES) * n))
321
322#define ZA_PT_ZA_SIZE(vq) ((vq * __SVE_VQ_BYTES) * (vq * __SVE_VQ_BYTES))
323
324#define ZA_PT_SIZE(vq) \
325 (ZA_PT_ZA_OFFSET + ZA_PT_ZA_SIZE(vq))
326
268327#endif /* __ASSEMBLY__ */
269328
270329#endif /* __ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/sigcontext.h+84-2
......@@ -62,6 +62,10 @@ struct sigcontext {
6262 * context. Such structures must be placed after the rt_sigframe on the stack
6363 * and be 16-byte aligned. The last structure must be a dummy one with the
6464 * magic and size set to 0.
65 *
66 * Note that the values allocated for use as magic should be chosen to
67 * be meaningful in ASCII to aid manual parsing, ZA doesn't follow this
68 * convention due to oversight but it should be observed for future additions.
6569 */
6670struct _aarch64_ctx {
6771 __u32 magic;
......@@ -132,11 +136,38 @@ struct extra_context {
132136#define SVE_MAGIC 0x53564501
133137
134138struct sve_context {
139 struct _aarch64_ctx head;
140 __u16 vl;
141 __u16 flags;
142 __u16 __reserved[2];
143};
144
145#define SVE_SIG_FLAG_SM 0x1 /* Context describes streaming mode */
146
147/* TPIDR2_EL0 context */
148#define TPIDR2_MAGIC 0x54504902
149
150struct tpidr2_context {
151 struct _aarch64_ctx head;
152 __u64 tpidr2;
153};
154
155#define ZA_MAGIC 0x54366345
156
157struct za_context {
135158 struct _aarch64_ctx head;
136159 __u16 vl;
137160 __u16 __reserved[3];
138161};
139162
163#define ZT_MAGIC 0x5a544e01
164
165struct zt_context {
166 struct _aarch64_ctx head;
167 __u16 nregs;
168 __u16 __reserved[3];
169};
170
140171#endif /* !__ASSEMBLY__ */
141172
142173#include <asm/sve_context.h>
......@@ -186,9 +217,16 @@ struct sve_context {
186217 * sve_context.vl must equal the thread's current vector length when
187218 * doing a sigreturn.
188219 *
220 * On systems with support for SME the SVE register state may reflect either
221 * streaming or non-streaming mode. In streaming mode the streaming mode
222 * vector length will be used and the flag SVE_SIG_FLAG_SM will be set in
223 * the flags field. It is permitted to enter or leave streaming mode in
224 * a signal return, applications should take care to ensure that any difference
225 * in vector length between the two modes is handled, including any resizing
226 * and movement of context blocks.
189227 *
190 * Note: for all these macros, the "vq" argument denotes the SVE
191 * vector length in quadwords (i.e., units of 128 bits).
228 * Note: for all these macros, the "vq" argument denotes the vector length
229 * in quadwords (i.e., units of 128 bits).
192230 *
193231 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The
194232 * result is valid if and only if sve_vl_valid(vl) is true. This is
......@@ -249,4 +287,48 @@ struct sve_context {
249287#define SVE_SIG_CONTEXT_SIZE(vq) \
250288 (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
251289
290/*
291 * If the ZA register is enabled for the thread at signal delivery then,
292 * za_context.head.size >= ZA_SIG_CONTEXT_SIZE(sve_vq_from_vl(za_context.vl))
293 * and the register data may be accessed using the ZA_SIG_*() macros.
294 *
295 * If za_context.head.size < ZA_SIG_CONTEXT_SIZE(sve_vq_from_vl(za_context.vl))
296 * then ZA was not enabled and no register data was included in which case
297 * ZA register was not enabled for the thread and no register data
298 * the ZA_SIG_*() macros should not be used except for this check.
299 *
300 * The same convention applies when returning from a signal: a caller
301 * will need to remove or resize the za_context block if it wants to
302 * enable the ZA register when it was previously non-live or vice-versa.
303 * This may require the caller to allocate fresh memory and/or move other
304 * context blocks in the signal frame.
305 *
306 * Changing the vector length during signal return is not permitted:
307 * za_context.vl must equal the thread's current SME vector length when
308 * doing a sigreturn.
309 */
310
311#define ZA_SIG_REGS_OFFSET \
312 ((sizeof(struct za_context) + (__SVE_VQ_BYTES - 1)) \
313 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
314
315#define ZA_SIG_REGS_SIZE(vq) ((vq * __SVE_VQ_BYTES) * (vq * __SVE_VQ_BYTES))
316
317#define ZA_SIG_ZAV_OFFSET(vq, n) (ZA_SIG_REGS_OFFSET + \
318 (SVE_SIG_ZREG_SIZE(vq) * n))
319
320#define ZA_SIG_CONTEXT_SIZE(vq) \
321 (ZA_SIG_REGS_OFFSET + ZA_SIG_REGS_SIZE(vq))
322
323#define ZT_SIG_REG_SIZE 512
324
325#define ZT_SIG_REG_BYTES (ZT_SIG_REG_SIZE / 8)
326
327#define ZT_SIG_REGS_OFFSET sizeof(struct zt_context)
328
329#define ZT_SIG_REGS_SIZE(n) (ZT_SIG_REG_BYTES * n)
330
331#define ZT_SIG_CONTEXT_SIZE(n) \
332 (sizeof(struct zt_context) + ZT_SIG_REGS_SIZE(n))
333
252334#endif /* __ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/fcntl.h+10-14
......@@ -91,7 +91,6 @@
9191
9292/* a horrid kludge trying to make sure that this will fail on old kernels */
9393#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
94#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
9594
9695#ifndef O_NDELAY
9796#define O_NDELAY O_NONBLOCK
......@@ -116,13 +115,13 @@
116115#define F_GETSIG 11 /* for sockets. */
117116#endif
118117
119#ifndef CONFIG_64BIT
118#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
120119#ifndef F_GETLK64
121120#define F_GETLK64 12 /* using 'struct flock64' */
122121#define F_SETLK64 13
123122#define F_SETLKW64 14
124123#endif
125#endif
124#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
126125
127126#ifndef F_SETOWN_EX
128127#define F_SETOWN_EX 15
......@@ -193,24 +192,19 @@ struct f_owner_ex {
193192#define F_LINUX_SPECIFIC_BASE 1024
194193
195194#ifndef HAVE_ARCH_STRUCT_FLOCK
196#ifndef __ARCH_FLOCK_PAD
197#define __ARCH_FLOCK_PAD
198#endif
199
200195struct flock {
201196 short l_type;
202197 short l_whence;
203198 __kernel_off_t l_start;
204199 __kernel_off_t l_len;
205200 __kernel_pid_t l_pid;
206 __ARCH_FLOCK_PAD
207};
201#ifdef __ARCH_FLOCK_EXTRA_SYSID
202 __ARCH_FLOCK_EXTRA_SYSID
208203#endif
209
210#ifndef HAVE_ARCH_STRUCT_FLOCK64
211#ifndef __ARCH_FLOCK64_PAD
212#define __ARCH_FLOCK64_PAD
204#ifdef __ARCH_FLOCK_PAD
205 __ARCH_FLOCK_PAD
213206#endif
207};
214208
215209struct flock64 {
216210 short l_type;
......@@ -218,8 +212,10 @@ struct flock64 {
218212 __kernel_loff_t l_start;
219213 __kernel_loff_t l_len;
220214 __kernel_pid_t l_pid;
215#ifdef __ARCH_FLOCK64_PAD
221216 __ARCH_FLOCK64_PAD
222};
223217#endif
218};
219#endif /* HAVE_ARCH_STRUCT_FLOCK */
224220
225221#endif /* _ASM_GENERIC_FCNTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/hugetlb_encode.h+13-13
......@@ -20,18 +20,18 @@
2020#define HUGETLB_FLAG_ENCODE_SHIFT 26
2121#define HUGETLB_FLAG_ENCODE_MASK 0x3f
2222
23#define HUGETLB_FLAG_ENCODE_16KB (14 << HUGETLB_FLAG_ENCODE_SHIFT)
24#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)
25#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)
26#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)
27#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT)
28#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT)
29#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT)
30#define HUGETLB_FLAG_ENCODE_32MB (25 << HUGETLB_FLAG_ENCODE_SHIFT)
31#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT)
32#define HUGETLB_FLAG_ENCODE_512MB (29 << HUGETLB_FLAG_ENCODE_SHIFT)
33#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT)
34#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT)
35#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT)
23#define HUGETLB_FLAG_ENCODE_16KB (14U << HUGETLB_FLAG_ENCODE_SHIFT)
24#define HUGETLB_FLAG_ENCODE_64KB (16U << HUGETLB_FLAG_ENCODE_SHIFT)
25#define HUGETLB_FLAG_ENCODE_512KB (19U << HUGETLB_FLAG_ENCODE_SHIFT)
26#define HUGETLB_FLAG_ENCODE_1MB (20U << HUGETLB_FLAG_ENCODE_SHIFT)
27#define HUGETLB_FLAG_ENCODE_2MB (21U << HUGETLB_FLAG_ENCODE_SHIFT)
28#define HUGETLB_FLAG_ENCODE_8MB (23U << HUGETLB_FLAG_ENCODE_SHIFT)
29#define HUGETLB_FLAG_ENCODE_16MB (24U << HUGETLB_FLAG_ENCODE_SHIFT)
30#define HUGETLB_FLAG_ENCODE_32MB (25U << HUGETLB_FLAG_ENCODE_SHIFT)
31#define HUGETLB_FLAG_ENCODE_256MB (28U << HUGETLB_FLAG_ENCODE_SHIFT)
32#define HUGETLB_FLAG_ENCODE_512MB (29U << HUGETLB_FLAG_ENCODE_SHIFT)
33#define HUGETLB_FLAG_ENCODE_1GB (30U << HUGETLB_FLAG_ENCODE_SHIFT)
34#define HUGETLB_FLAG_ENCODE_2GB (31U << HUGETLB_FLAG_ENCODE_SHIFT)
35#define HUGETLB_FLAG_ENCODE_16GB (34U << HUGETLB_FLAG_ENCODE_SHIFT)
3636
3737#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/mman-common.h+4
......@@ -75,6 +75,10 @@
7575#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
7676#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
7777
78#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
79
80#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
81
7882/* compatibility flags */
7983#define MAP_FILE 0
8084
lib/libc/include/any-linux-any/asm-generic/shmbuf.h+3-1
......@@ -3,6 +3,8 @@
33#define __ASM_GENERIC_SHMBUF_H
44
55#include <asm/bitsperlong.h>
6#include <asm/ipcbuf.h>
7#include <asm/posix_types.h>
68
79/*
810 * The shmid64_ds structure for x86 architecture.
......@@ -24,7 +26,7 @@
2426
2527struct shmid64_ds {
2628 struct ipc64_perm shm_perm; /* operation perms */
27 size_t shm_segsz; /* size of segment (bytes) */
29 __kernel_size_t shm_segsz; /* size of segment (bytes) */
2830#if __BITS_PER_LONG == 64
2931 long shm_atime; /* last attach time */
3032 long shm_dtime; /* last detach time */
lib/libc/include/any-linux-any/asm-generic/siginfo.h+7
......@@ -99,6 +99,7 @@ union __sifields {
9999 struct {
100100 unsigned long _data;
101101 __u32 _type;
102 __u32 _flags;
102103 } _perf;
103104 };
104105 } _sigfault;
......@@ -164,6 +165,7 @@ typedef struct siginfo {
164165#define si_pkey _sifields._sigfault._addr_pkey._pkey
165166#define si_perf_data _sifields._sigfault._perf._data
166167#define si_perf_type _sifields._sigfault._perf._type
168#define si_perf_flags _sifields._sigfault._perf._flags
167169#define si_band _sifields._sigpoll._band
168170#define si_fd _sifields._sigpoll._fd
169171#define si_call_addr _sifields._sigsys._call_addr
......@@ -270,6 +272,11 @@ typedef struct siginfo {
270272 * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
271273 */
272274
275/*
276 * Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
277 */
278#define TRAP_PERF_FLAG_ASYNC (1u << 0)
279
273280/*
274281 * SIGCHLD si_codes
275282 */
lib/libc/include/any-linux-any/asm-generic/signal.h+1-1
......@@ -83,7 +83,7 @@ struct sigaction {
8383typedef struct sigaltstack {
8484 void *ss_sp;
8585 int ss_flags;
86 size_t ss_size;
86 __kernel_size_t ss_size;
8787} stack_t;
8888
8989#endif /* __ASSEMBLY__ */
lib/libc/include/any-linux-any/asm-generic/socket.h+4
......@@ -128,6 +128,10 @@
128128
129129#define SO_RESERVE_MEM 73
130130
131#define SO_TXREHASH 74
132
133#define SO_RCVMARK 75
134
131135
132136#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
133137/* on 64-bit and x32, avoid the ?: operator */
lib/libc/include/any-linux-any/asm-generic/termbits-common.h created+66
......@@ -0,0 +1,66 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_GENERIC_TERMBITS_COMMON_H
3#define __ASM_GENERIC_TERMBITS_COMMON_H
4
5typedef unsigned char cc_t;
6typedef unsigned int speed_t;
7
8/* c_iflag bits */
9#define IGNBRK 0x001 /* Ignore break condition */
10#define BRKINT 0x002 /* Signal interrupt on break */
11#define IGNPAR 0x004 /* Ignore characters with parity errors */
12#define PARMRK 0x008 /* Mark parity and framing errors */
13#define INPCK 0x010 /* Enable input parity check */
14#define ISTRIP 0x020 /* Strip 8th bit off characters */
15#define INLCR 0x040 /* Map NL to CR on input */
16#define IGNCR 0x080 /* Ignore CR */
17#define ICRNL 0x100 /* Map CR to NL on input */
18#define IXANY 0x800 /* Any character will restart after stop */
19
20/* c_oflag bits */
21#define OPOST 0x01 /* Perform output processing */
22#define OCRNL 0x08
23#define ONOCR 0x10
24#define ONLRET 0x20
25#define OFILL 0x40
26#define OFDEL 0x80
27
28/* c_cflag bit meaning */
29/* Common CBAUD rates */
30#define B0 0x00000000 /* hang up */
31#define B50 0x00000001
32#define B75 0x00000002
33#define B110 0x00000003
34#define B134 0x00000004
35#define B150 0x00000005
36#define B200 0x00000006
37#define B300 0x00000007
38#define B600 0x00000008
39#define B1200 0x00000009
40#define B1800 0x0000000a
41#define B2400 0x0000000b
42#define B4800 0x0000000c
43#define B9600 0x0000000d
44#define B19200 0x0000000e
45#define B38400 0x0000000f
46#define EXTA B19200
47#define EXTB B38400
48
49#define ADDRB 0x20000000 /* address bit */
50#define CMSPAR 0x40000000 /* mark or space (stick) parity */
51#define CRTSCTS 0x80000000 /* flow control */
52
53#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
54
55/* tcflow() ACTION argument and TCXONC use these */
56#define TCOOFF 0 /* Suspend output */
57#define TCOON 1 /* Restart suspended output */
58#define TCIOFF 2 /* Send a STOP character */
59#define TCION 3 /* Send a START character */
60
61/* tcflush() QUEUE_SELECTOR argument and TCFLSH use these */
62#define TCIFLUSH 0 /* Discard data received but not yet read */
63#define TCOFLUSH 1 /* Discard data written but not yet sent */
64#define TCIOFLUSH 2 /* Discard all pending data */
65
66#endif /* __ASM_GENERIC_TERMBITS_COMMON_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/termbits.h+94-145
......@@ -2,10 +2,8 @@
22#ifndef __ASM_GENERIC_TERMBITS_H
33#define __ASM_GENERIC_TERMBITS_H
44
5#include <linux/posix_types.h>
5#include <asm-generic/termbits-common.h>
66
7typedef unsigned char cc_t;
8typedef unsigned int speed_t;
97typedef unsigned int tcflag_t;
108
119#define NCCS 19
......@@ -41,156 +39,107 @@ struct ktermios {
4139};
4240
4341/* c_cc characters */
44#define VINTR 0
45#define VQUIT 1
46#define VERASE 2
47#define VKILL 3
48#define VEOF 4
49#define VTIME 5
50#define VMIN 6
51#define VSWTC 7
52#define VSTART 8
53#define VSTOP 9
54#define VSUSP 10
55#define VEOL 11
56#define VREPRINT 12
57#define VDISCARD 13
58#define VWERASE 14
59#define VLNEXT 15
60#define VEOL2 16
42#define VINTR 0
43#define VQUIT 1
44#define VERASE 2
45#define VKILL 3
46#define VEOF 4
47#define VTIME 5
48#define VMIN 6
49#define VSWTC 7
50#define VSTART 8
51#define VSTOP 9
52#define VSUSP 10
53#define VEOL 11
54#define VREPRINT 12
55#define VDISCARD 13
56#define VWERASE 14
57#define VLNEXT 15
58#define VEOL2 16
6159
6260/* c_iflag bits */
63#define IGNBRK 0000001
64#define BRKINT 0000002
65#define IGNPAR 0000004
66#define PARMRK 0000010
67#define INPCK 0000020
68#define ISTRIP 0000040
69#define INLCR 0000100
70#define IGNCR 0000200
71#define ICRNL 0000400
72#define IUCLC 0001000
73#define IXON 0002000
74#define IXANY 0004000
75#define IXOFF 0010000
76#define IMAXBEL 0020000
77#define IUTF8 0040000
61#define IUCLC 0x0200
62#define IXON 0x0400
63#define IXOFF 0x1000
64#define IMAXBEL 0x2000
65#define IUTF8 0x4000
7866
7967/* c_oflag bits */
80#define OPOST 0000001
81#define OLCUC 0000002
82#define ONLCR 0000004
83#define OCRNL 0000010
84#define ONOCR 0000020
85#define ONLRET 0000040
86#define OFILL 0000100
87#define OFDEL 0000200
88#define NLDLY 0000400
89#define NL0 0000000
90#define NL1 0000400
91#define CRDLY 0003000
92#define CR0 0000000
93#define CR1 0001000
94#define CR2 0002000
95#define CR3 0003000
96#define TABDLY 0014000
97#define TAB0 0000000
98#define TAB1 0004000
99#define TAB2 0010000
100#define TAB3 0014000
101#define XTABS 0014000
102#define BSDLY 0020000
103#define BS0 0000000
104#define BS1 0020000
105#define VTDLY 0040000
106#define VT0 0000000
107#define VT1 0040000
108#define FFDLY 0100000
109#define FF0 0000000
110#define FF1 0100000
68#define OLCUC 0x00002
69#define ONLCR 0x00004
70#define NLDLY 0x00100
71#define NL0 0x00000
72#define NL1 0x00100
73#define CRDLY 0x00600
74#define CR0 0x00000
75#define CR1 0x00200
76#define CR2 0x00400
77#define CR3 0x00600
78#define TABDLY 0x01800
79#define TAB0 0x00000
80#define TAB1 0x00800
81#define TAB2 0x01000
82#define TAB3 0x01800
83#define XTABS 0x01800
84#define BSDLY 0x02000
85#define BS0 0x00000
86#define BS1 0x02000
87#define VTDLY 0x04000
88#define VT0 0x00000
89#define VT1 0x04000
90#define FFDLY 0x08000
91#define FF0 0x00000
92#define FF1 0x08000
11193
11294/* c_cflag bit meaning */
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define BOTHER 0010000
145#define B57600 0010001
146#define B115200 0010002
147#define B230400 0010003
148#define B460800 0010004
149#define B500000 0010005
150#define B576000 0010006
151#define B921600 0010007
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
95#define CBAUD 0x0000100f
96#define CSIZE 0x00000030
97#define CS5 0x00000000
98#define CS6 0x00000010
99#define CS7 0x00000020
100#define CS8 0x00000030
101#define CSTOPB 0x00000040
102#define CREAD 0x00000080
103#define PARENB 0x00000100
104#define PARODD 0x00000200
105#define HUPCL 0x00000400
106#define CLOCAL 0x00000800
107#define CBAUDEX 0x00001000
108#define BOTHER 0x00001000
109#define B57600 0x00001001
110#define B115200 0x00001002
111#define B230400 0x00001003
112#define B460800 0x00001004
113#define B500000 0x00001005
114#define B576000 0x00001006
115#define B921600 0x00001007
116#define B1000000 0x00001008
117#define B1152000 0x00001009
118#define B1500000 0x0000100a
119#define B2000000 0x0000100b
120#define B2500000 0x0000100c
121#define B3000000 0x0000100d
122#define B3500000 0x0000100e
123#define B4000000 0x0000100f
124#define CIBAUD 0x100f0000 /* input baud rate */
165125
166126/* c_lflag bits */
167#define ISIG 0000001
168#define ICANON 0000002
169#define XCASE 0000004
170#define ECHO 0000010
171#define ECHOE 0000020
172#define ECHOK 0000040
173#define ECHONL 0000100
174#define NOFLSH 0000200
175#define TOSTOP 0000400
176#define ECHOCTL 0001000
177#define ECHOPRT 0002000
178#define ECHOKE 0004000
179#define FLUSHO 0010000
180#define PENDIN 0040000
181#define IEXTEN 0100000
182#define EXTPROC 0200000
183
184/* tcflow() and TCXONC use these */
185#define TCOOFF 0
186#define TCOON 1
187#define TCIOFF 2
188#define TCION 3
189
190/* tcflush() and TCFLSH use these */
191#define TCIFLUSH 0
192#define TCOFLUSH 1
193#define TCIOFLUSH 2
127#define ISIG 0x00001
128#define ICANON 0x00002
129#define XCASE 0x00004
130#define ECHO 0x00008
131#define ECHOE 0x00010
132#define ECHOK 0x00020
133#define ECHONL 0x00040
134#define NOFLSH 0x00080
135#define TOSTOP 0x00100
136#define ECHOCTL 0x00200
137#define ECHOPRT 0x00400
138#define ECHOKE 0x00800
139#define FLUSHO 0x01000
140#define PENDIN 0x04000
141#define IEXTEN 0x08000
142#define EXTPROC 0x10000
194143
195144/* tcsetattr uses these */
196145#define TCSANOW 0
lib/libc/include/any-linux-any/asm-generic/unistd.h+6-3
......@@ -383,7 +383,7 @@ __SYSCALL(__NR_syslog, sys_syslog)
383383
384384/* kernel/ptrace.c */
385385#define __NR_ptrace 117
386__SYSCALL(__NR_ptrace, sys_ptrace)
386__SC_COMP(__NR_ptrace, sys_ptrace, compat_sys_ptrace)
387387
388388/* kernel/sched/core.c */
389389#define __NR_sched_setparam 118
......@@ -779,7 +779,7 @@ __SYSCALL(__NR_rseq, sys_rseq)
779779#define __NR_kexec_file_load 294
780780__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
781781/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
782#if __BITS_PER_LONG == 32
782#if defined(__SYSCALL_COMPAT) || __BITS_PER_LONG == 32
783783#define __NR_clock_gettime64 403
784784__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
785785#define __NR_clock_settime64 404
......@@ -883,8 +883,11 @@ __SYSCALL(__NR_process_mrelease, sys_process_mrelease)
883883#define __NR_futex_waitv 449
884884__SYSCALL(__NR_futex_waitv, sys_futex_waitv)
885885
886#define __NR_set_mempolicy_home_node 450
887__SYSCALL(__NR_set_mempolicy_home_node, sys_set_mempolicy_home_node)
888
886889#undef __NR_syscalls
887#define __NR_syscalls 450
890#define __NR_syscalls 451
888891
889892/*
890893 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+82-5
......@@ -80,7 +80,7 @@ extern "C" {
8080 *
8181 * %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the
8282 * GPU's virtual address space via gart. Gart memory linearizes non-contiguous
83 * pages of system memory, allows GPU access system memory in a linezrized
83 * pages of system memory, allows GPU access system memory in a linearized
8484 * fashion.
8585 *
8686 * %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory
......@@ -140,6 +140,24 @@ extern "C" {
140140 * not require GTT memory accounting
141141 */
142142#define AMDGPU_GEM_CREATE_PREEMPTIBLE (1 << 11)
143/* Flag that BO can be discarded under memory pressure without keeping the
144 * content.
145 */
146#define AMDGPU_GEM_CREATE_DISCARDABLE (1 << 12)
147/* Flag that BO is shared coherently between multiple devices or CPU threads.
148 * May depend on GPU instructions to flush caches explicitly
149 *
150 * This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
151 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
152 */
153#define AMDGPU_GEM_CREATE_COHERENT (1 << 13)
154/* Flag that BO should not be cached by GPU. Coherent without having to flush
155 * GPU caches explicitly
156 *
157 * This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
158 * may override the MTYPE selected in AMDGPU_VA_OP_MAP.
159 */
160#define AMDGPU_GEM_CREATE_UNCACHED (1 << 14)
143161
144162struct drm_amdgpu_gem_create_in {
145163 /** the requested memory size */
......@@ -206,6 +224,8 @@ union drm_amdgpu_bo_list {
206224#define AMDGPU_CTX_OP_FREE_CTX 2
207225#define AMDGPU_CTX_OP_QUERY_STATE 3
208226#define AMDGPU_CTX_OP_QUERY_STATE2 4
227#define AMDGPU_CTX_OP_GET_STABLE_PSTATE 5
228#define AMDGPU_CTX_OP_SET_STABLE_PSTATE 6
209229
210230/* GPU reset status */
211231#define AMDGPU_CTX_NO_RESET 0
......@@ -238,10 +258,18 @@ union drm_amdgpu_bo_list {
238258#define AMDGPU_CTX_PRIORITY_HIGH 512
239259#define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023
240260
261/* select a stable profiling pstate for perfmon tools */
262#define AMDGPU_CTX_STABLE_PSTATE_FLAGS_MASK 0xf
263#define AMDGPU_CTX_STABLE_PSTATE_NONE 0
264#define AMDGPU_CTX_STABLE_PSTATE_STANDARD 1
265#define AMDGPU_CTX_STABLE_PSTATE_MIN_SCLK 2
266#define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK 3
267#define AMDGPU_CTX_STABLE_PSTATE_PEAK 4
268
241269struct drm_amdgpu_ctx_in {
242270 /** AMDGPU_CTX_OP_* */
243271 __u32 op;
244 /** For future use, no flags defined so far */
272 /** Flags */
245273 __u32 flags;
246274 __u32 ctx_id;
247275 /** AMDGPU_CTX_PRIORITY_* */
......@@ -262,6 +290,11 @@ union drm_amdgpu_ctx_out {
262290 /** Reset status since the last call of the ioctl. */
263291 __u32 reset_status;
264292 } state;
293
294 struct {
295 __u32 flags;
296 __u32 _pad;
297 } pstate;
265298};
266299
267300union drm_amdgpu_ctx {
......@@ -514,6 +547,8 @@ struct drm_amdgpu_gem_op {
514547#define AMDGPU_VM_MTYPE_UC (4 << 5)
515548/* Use Read Write MTYPE instead of default MTYPE */
516549#define AMDGPU_VM_MTYPE_RW (5 << 5)
550/* don't allocate MALL */
551#define AMDGPU_VM_PAGE_NOALLOC (1 << 9)
517552
518553struct drm_amdgpu_gem_va {
519554 /** GEM object handle */
......@@ -538,6 +573,10 @@ struct drm_amdgpu_gem_va {
538573#define AMDGPU_HW_IP_VCE 4
539574#define AMDGPU_HW_IP_UVD_ENC 5
540575#define AMDGPU_HW_IP_VCN_DEC 6
576/*
577 * From VCN4, AMDGPU_HW_IP_VCN_ENC is re-used to support
578 * both encoding and decoding jobs.
579 */
541580#define AMDGPU_HW_IP_VCN_ENC 7
542581#define AMDGPU_HW_IP_VCN_JPEG 8
543582#define AMDGPU_HW_IP_NUM 9
......@@ -676,6 +715,7 @@ struct drm_amdgpu_cs_chunk_data {
676715#define AMDGPU_IDS_FLAGS_FUSION 0x1
677716#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
678717#define AMDGPU_IDS_FLAGS_TMZ 0x4
718#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
679719
680720/* indicate if acceleration can be working */
681721#define AMDGPU_INFO_ACCEL_WORKING 0x00
......@@ -728,6 +768,18 @@ struct drm_amdgpu_cs_chunk_data {
728768 #define AMDGPU_INFO_FW_DMCUB 0x14
729769 /* Subquery id: Query TOC firmware version */
730770 #define AMDGPU_INFO_FW_TOC 0x15
771 /* Subquery id: Query CAP firmware version */
772 #define AMDGPU_INFO_FW_CAP 0x16
773 /* Subquery id: Query GFX RLCP firmware version */
774 #define AMDGPU_INFO_FW_GFX_RLCP 0x17
775 /* Subquery id: Query GFX RLCV firmware version */
776 #define AMDGPU_INFO_FW_GFX_RLCV 0x18
777 /* Subquery id: Query MES_KIQ firmware version */
778 #define AMDGPU_INFO_FW_MES_KIQ 0x19
779 /* Subquery id: Query MES firmware version */
780 #define AMDGPU_INFO_FW_MES 0x1a
781 /* Subquery id: Query IMU firmware version */
782 #define AMDGPU_INFO_FW_IMU 0x1b
731783
732784/* number of bytes moved for TTM migration */
733785#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
......@@ -781,6 +833,10 @@ struct drm_amdgpu_cs_chunk_data {
781833 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
782834 /* Subquery id: Query GPU stable pstate memory clock */
783835 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
836 /* Subquery id: Query GPU peak pstate shader clock */
837 #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa
838 /* Subquery id: Query GPU peak pstate memory clock */
839 #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb
784840/* Number of VRAM page faults on CPU access. */
785841#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
786842#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
......@@ -971,6 +1027,8 @@ struct drm_amdgpu_info_vbios {
9711027#define AMDGPU_VRAM_TYPE_DDR4 8
9721028#define AMDGPU_VRAM_TYPE_GDDR6 9
9731029#define AMDGPU_VRAM_TYPE_DDR5 10
1030#define AMDGPU_VRAM_TYPE_LPDDR4 11
1031#define AMDGPU_VRAM_TYPE_LPDDR5 12
9741032
9751033struct drm_amdgpu_info_device {
9761034 /** PCI Device ID */
......@@ -996,7 +1054,8 @@ struct drm_amdgpu_info_device {
9961054 __u32 enabled_rb_pipes_mask;
9971055 __u32 num_rb_pipes;
9981056 __u32 num_hw_gfx_contexts;
999 __u32 _pad;
1057 /* PCIe version (the smaller of the GPU and the CPU/motherboard) */
1058 __u32 pcie_gen;
10001059 __u64 ids_flags;
10011060 /** Starting virtual address for UMDs. */
10021061 __u64 virtual_address_offset;
......@@ -1043,7 +1102,8 @@ struct drm_amdgpu_info_device {
10431102 __u32 gs_prim_buffer_depth;
10441103 /* max gs wavefront per vgt*/
10451104 __u32 max_gs_waves_per_vgt;
1046 __u32 _pad1;
1105 /* PCIe number of lanes (the smaller of the GPU and the CPU/motherboard) */
1106 __u32 pcie_num_lanes;
10471107 /* always on cu bitmap */
10481108 __u32 cu_ao_bitmap[4][4];
10491109 /** Starting high virtual address for UMDs. */
......@@ -1054,6 +1114,18 @@ struct drm_amdgpu_info_device {
10541114 __u32 pa_sc_tile_steering_override;
10551115 /* disabled TCCs */
10561116 __u64 tcc_disabled_mask;
1117 __u64 min_engine_clock;
1118 __u64 min_memory_clock;
1119 /* The following fields are only set on gfx11+, older chips set 0. */
1120 __u32 tcp_cache_size; /* AKA GL0, VMEM cache */
1121 __u32 num_sqc_per_wgp;
1122 __u32 sqc_data_cache_size; /* AKA SMEM cache */
1123 __u32 sqc_inst_cache_size;
1124 __u32 gl1c_cache_size;
1125 __u32 gl2c_cache_size;
1126 __u64 mall_size; /* AKA infinity cache */
1127 /* high 32 bits of the rb pipes mask */
1128 __u32 enabled_rb_pipes_mask_hi;
10571129};
10581130
10591131struct drm_amdgpu_info_hw_ip {
......@@ -1068,7 +1140,8 @@ struct drm_amdgpu_info_hw_ip {
10681140 __u32 ib_size_alignment;
10691141 /** Bitmask of available rings. Bit 0 means ring 0, etc. */
10701142 __u32 available_rings;
1071 __u32 _pad;
1143 /** version info: bits 23:16 major, 15:8 minor, 7:0 revision */
1144 __u32 ip_discovery_version;
10721145};
10731146
10741147struct drm_amdgpu_info_num_handles {
......@@ -1133,7 +1206,11 @@ struct drm_amdgpu_info_video_caps {
11331206#define AMDGPU_FAMILY_RV 142 /* Raven */
11341207#define AMDGPU_FAMILY_NV 143 /* Navi10 */
11351208#define AMDGPU_FAMILY_VGH 144 /* Van Gogh */
1209#define AMDGPU_FAMILY_GC_11_0_0 145 /* GC 11.0.0 */
11361210#define AMDGPU_FAMILY_YC 146 /* Yellow Carp */
1211#define AMDGPU_FAMILY_GC_11_0_1 148 /* GC 11.0.1 */
1212#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */
1213#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */
11371214
11381215#if defined(__cplusplus)
11391216}
lib/libc/include/any-linux-any/drm/drm.h+18
......@@ -1090,6 +1090,24 @@ extern "C" {
10901090#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
10911091#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
10921092
1093/**
1094 * DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.
1095 *
1096 * This queries metadata about a framebuffer. User-space fills
1097 * &drm_mode_fb_cmd2.fb_id as the input, and the kernels fills the rest of the
1098 * struct as the output.
1099 *
1100 * 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.
1103 *
1104 * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid
1105 * until one has a zero &drm_mode_fb_cmd2.pitches.
1106 *
1107 * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set
1108 * in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the
1109 * modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.
1110 */
10931111#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
10941112
10951113/*
lib/libc/include/any-linux-any/drm/drm_fourcc.h+156-7
......@@ -88,6 +88,18 @@ extern "C" {
8888 *
8989 * The authoritative list of format modifier codes is found in
9090 * `include/uapi/drm/drm_fourcc.h`
91 *
92 * Open Source User Waiver
93 * -----------------------
94 *
95 * Because this is the authoritative source for pixel formats and modifiers
96 * referenced by GL, Vulkan extensions and other standards and hence used both
97 * by open source and closed source driver stacks, the usual requirement for an
98 * upstream in-kernel or open source userspace user does not apply.
99 *
100 * To ensure, as much as feasible, compatibility across stacks and avoid
101 * confusion with incompatible enumerations stakeholders for all relevant driver
102 * stacks should approve additions.
91103 */
92104
93105#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
......@@ -99,18 +111,42 @@ extern "C" {
99111#define DRM_FORMAT_INVALID 0
100112
101113/* color index */
114#define DRM_FORMAT_C1 fourcc_code('C', '1', ' ', ' ') /* [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte */
115#define DRM_FORMAT_C2 fourcc_code('C', '2', ' ', ' ') /* [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte */
116#define DRM_FORMAT_C4 fourcc_code('C', '4', ' ', ' ') /* [7:0] C0:C1 4:4 two pixels/byte */
102117#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
103118
104/* 8 bpp Red */
119/* 1 bpp Darkness (inverse relationship between channel value and brightness) */
120#define DRM_FORMAT_D1 fourcc_code('D', '1', ' ', ' ') /* [7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte */
121
122/* 2 bpp Darkness (inverse relationship between channel value and brightness) */
123#define DRM_FORMAT_D2 fourcc_code('D', '2', ' ', ' ') /* [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte */
124
125/* 4 bpp Darkness (inverse relationship between channel value and brightness) */
126#define DRM_FORMAT_D4 fourcc_code('D', '4', ' ', ' ') /* [7:0] D0:D1 4:4 two pixels/byte */
127
128/* 8 bpp Darkness (inverse relationship between channel value and brightness) */
129#define DRM_FORMAT_D8 fourcc_code('D', '8', ' ', ' ') /* [7:0] D */
130
131/* 1 bpp Red (direct relationship between channel value and brightness) */
132#define DRM_FORMAT_R1 fourcc_code('R', '1', ' ', ' ') /* [7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte */
133
134/* 2 bpp Red (direct relationship between channel value and brightness) */
135#define DRM_FORMAT_R2 fourcc_code('R', '2', ' ', ' ') /* [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte */
136
137/* 4 bpp Red (direct relationship between channel value and brightness) */
138#define DRM_FORMAT_R4 fourcc_code('R', '4', ' ', ' ') /* [7:0] R0:R1 4:4 two pixels/byte */
139
140/* 8 bpp Red (direct relationship between channel value and brightness) */
105141#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
106142
107/* 10 bpp Red */
143/* 10 bpp Red (direct relationship between channel value and brightness) */
108144#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */
109145
110/* 12 bpp Red */
146/* 12 bpp Red (direct relationship between channel value and brightness) */
111147#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */
112148
113/* 16 bpp Red */
149/* 16 bpp Red (direct relationship between channel value and brightness) */
114150#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
115151
116152/* 16 bpp RG */
......@@ -205,7 +241,9 @@ extern "C" {
205241#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
206242
207243#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
244#define DRM_FORMAT_AVUY8888 fourcc_code('A', 'V', 'U', 'Y') /* [31:0] A:Cr:Cb:Y 8:8:8:8 little endian */
208245#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
246#define DRM_FORMAT_XVUY8888 fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
209247#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
210248#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
211249
......@@ -314,6 +352,13 @@ extern "C" {
314352 */
315353#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
316354
355/* 2 plane YCbCr420.
356 * 3 10 bit components and 2 padding bits packed into 4 bytes.
357 * index 0 = Y plane, [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian
358 * index 1 = Cr:Cb plane, [63:0] x:Cr2:Cb2:Cr1:x:Cb1:Cr0:Cb0 [2:10:10:10:2:10:10:10] little endian
359 */
360#define DRM_FORMAT_P030 fourcc_code('P', '0', '3', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel packed */
361
317362/* 3 plane non-subsampled (444) YCbCr
318363 * 16 bits per component, but only 10 bits are used and 6 bits are padded
319364 * index 0: Y plane, [15:0] Y:x [10:6] little endian
......@@ -552,7 +597,7 @@ extern "C" {
552597 *
553598 * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
554599 * and at index 1. The clear color is stored at index 2, and the pitch should
555 * be ignored. The clear color structure is 256 bits. The first 128 bits
600 * be 64 bytes aligned. The clear color structure is 256 bits. The first 128 bits
556601 * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
557602 * by 32 bits. The raw clear color is consumed by the 3d engine and generates
558603 * the converted clear color of size 64 bits. The first 32 bits store the Lower
......@@ -565,6 +610,53 @@ extern "C" {
565610 */
566611#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)
567612
613/*
614 * Intel Tile 4 layout
615 *
616 * This is a tiled layout using 4KB tiles in a row-major layout. It has the same
617 * shape as Tile Y at two granularities: 4KB (128B x 32) and 64B (16B x 4). It
618 * only differs from Tile Y at the 256B granularity in between. At this
619 * granularity, Tile Y has a shape of 16B x 32 rows, but this tiling has a shape
620 * of 64B x 8 rows.
621 */
622#define I915_FORMAT_MOD_4_TILED fourcc_mod_code(INTEL, 9)
623
624/*
625 * Intel color control surfaces (CCS) for DG2 render compression.
626 *
627 * The main surface is Tile 4 and at plane index 0. The CCS data is stored
628 * outside of the GEM object in a reserved memory area dedicated for the
629 * storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
630 * main surface pitch is required to be a multiple of four Tile 4 widths.
631 */
632#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS fourcc_mod_code(INTEL, 10)
633
634/*
635 * Intel color control surfaces (CCS) for DG2 media compression.
636 *
637 * The main surface is Tile 4 and at plane index 0. For semi-planar formats
638 * like NV12, the Y and UV planes are Tile 4 and are located at plane indices
639 * 0 and 1, respectively. The CCS for all planes are stored outside of the
640 * GEM object in a reserved memory area dedicated for the storage of the
641 * CCS data for all RC/RC_CC/MC compressible GEM objects. The main surface
642 * pitch is required to be a multiple of four Tile 4 widths.
643 */
644#define I915_FORMAT_MOD_4_TILED_DG2_MC_CCS fourcc_mod_code(INTEL, 11)
645
646/*
647 * Intel Color Control Surface with Clear Color (CCS) for DG2 render compression.
648 *
649 * The main surface is Tile 4 and at plane index 0. The CCS data is stored
650 * outside of the GEM object in a reserved memory area dedicated for the
651 * storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
652 * main surface pitch is required to be a multiple of four Tile 4 widths. The
653 * clear color is stored at plane index 1 and the pitch should be 64 bytes
654 * aligned. The format of the 256 bits of clear color data matches the one used
655 * for the I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC modifier, see its description
656 * for details.
657 */
658#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
659
568660/*
569661 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
570662 *
......@@ -602,6 +694,28 @@ extern "C" {
602694 */
603695#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
604696
697/*
698 * Qualcomm Tiled Format
699 *
700 * Similar to DRM_FORMAT_MOD_QCOM_COMPRESSED but not compressed.
701 * Implementation may be platform and base-format specific.
702 *
703 * Each macrotile consists of m x n (mostly 4 x 4) tiles.
704 * Pixel data pitch/stride is aligned with macrotile width.
705 * Pixel data height is aligned with macrotile height.
706 * Entire pixel data buffer is aligned with 4k(bytes).
707 */
708#define DRM_FORMAT_MOD_QCOM_TILED3 fourcc_mod_code(QCOM, 3)
709
710/*
711 * Qualcomm Alternate Tiled Format
712 *
713 * Alternate tiled format typically only used within GMEM.
714 * Implementation may be platform and base-format specific.
715 */
716#define DRM_FORMAT_MOD_QCOM_TILED2 fourcc_mod_code(QCOM, 2)
717
718
605719/* Vivante framebuffer modifiers */
606720
607721/*
......@@ -642,6 +756,35 @@ extern "C" {
642756 */
643757#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
644758
759/*
760 * Vivante TS (tile-status) buffer modifiers. They can be combined with all of
761 * the color buffer tiling modifiers defined above. When TS is present it's a
762 * separate buffer containing the clear/compression status of each tile. The
763 * modifiers are defined as VIVANTE_MOD_TS_c_s, where c is the color buffer
764 * tile size in bytes covered by one entry in the status buffer and s is the
765 * number of status bits per entry.
766 * We reserve the top 8 bits of the Vivante modifier space for tile status
767 * clear/compression modifiers, as future cores might add some more TS layout
768 * variations.
769 */
770#define VIVANTE_MOD_TS_64_4 (1ULL << 48)
771#define VIVANTE_MOD_TS_64_2 (2ULL << 48)
772#define VIVANTE_MOD_TS_128_4 (3ULL << 48)
773#define VIVANTE_MOD_TS_256_4 (4ULL << 48)
774#define VIVANTE_MOD_TS_MASK (0xfULL << 48)
775
776/*
777 * Vivante compression modifiers. Those depend on a TS modifier being present
778 * as the TS bits get reinterpreted as compression tags instead of simple
779 * clear markers when compression is enabled.
780 */
781#define VIVANTE_MOD_COMP_DEC400 (1ULL << 52)
782#define VIVANTE_MOD_COMP_MASK (0xfULL << 52)
783
784/* Masking out the extension bits will yield the base modifier. */
785#define VIVANTE_MOD_EXT_MASK (VIVANTE_MOD_TS_MASK | \
786 VIVANTE_MOD_COMP_MASK)
787
645788/* NVIDIA frame buffer modifiers */
646789
647790/*
......@@ -854,6 +997,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
854997 * and UV. Some SAND-using hardware stores UV in a separate tiled
855998 * image from Y to reduce the column height, which is not supported
856999 * with these modifiers.
1000 *
1001 * The DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT modifier is also
1002 * supported for DRM_FORMAT_P030 where the columns remain as 128 bytes
1003 * wide, but as this is a 10 bpp format that translates to 96 pixels.
8571004 */
8581005
8591006#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \
......@@ -1283,6 +1430,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
12831430#define AMD_FMT_MOD_TILE_VER_GFX9 1
12841431#define AMD_FMT_MOD_TILE_VER_GFX10 2
12851432#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
1433#define AMD_FMT_MOD_TILE_VER_GFX11 4
12861434
12871435/*
12881436 * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
......@@ -1298,6 +1446,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
12981446#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
12991447#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
13001448#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
1449#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31
13011450
13021451#define AMD_FMT_MOD_DCC_BLOCK_64B 0
13031452#define AMD_FMT_MOD_DCC_BLOCK_128B 1
......@@ -1364,11 +1513,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
13641513#define AMD_FMT_MOD_PIPE_MASK 0x7
13651514
13661515#define AMD_FMT_MOD_SET(field, value) \
1367 ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
1516 ((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT)
13681517#define AMD_FMT_MOD_GET(field, value) \
13691518 (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
13701519#define AMD_FMT_MOD_CLEAR(field) \
1371 (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
1520 (~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
13721521
13731522#if defined(__cplusplus)
13741523}
lib/libc/include/any-linux-any/drm/drm_mode.h+122-29
......@@ -663,41 +663,73 @@ struct drm_mode_fb_cmd {
663663#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
664664#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
665665
666/**
667 * struct drm_mode_fb_cmd2 - Frame-buffer metadata.
668 *
669 * This struct holds frame-buffer metadata. There are two ways to use it:
670 *
671 * - User-space can fill this struct and perform a &DRM_IOCTL_MODE_ADDFB2
672 * ioctl to register a new frame-buffer. The new frame-buffer object ID will
673 * be set by the kernel in @fb_id.
674 * - User-space can set @fb_id and perform a &DRM_IOCTL_MODE_GETFB2 ioctl to
675 * fetch metadata about an existing frame-buffer.
676 *
677 * In case of planar formats, this struct allows up to 4 buffer objects with
678 * offsets and pitches per plane. The pitch and offset order are dictated by
679 * the format FourCC as defined by ``drm_fourcc.h``, e.g. NV12 is described as:
680 *
681 * YUV 4:2:0 image with a plane of 8-bit Y samples followed by an
682 * interleaved U/V plane containing 8-bit 2x2 subsampled colour difference
683 * samples.
684 *
685 * So it would consist of a Y plane at ``offsets[0]`` and a UV plane at
686 * ``offsets[1]``.
687 *
688 * To accommodate tiled, compressed, etc formats, a modifier can be specified.
689 * For more information see the "Format Modifiers" section. Note that even
690 * though it looks like we have a modifier per-plane, we in fact do not. The
691 * modifier for each plane must be identical. Thus all combinations of
692 * different data layouts for multi-plane formats must be enumerated as
693 * separate modifiers.
694 *
695 * All of the entries in @handles, @pitches, @offsets and @modifier must be
696 * zero when unused. Warning, for @offsets and @modifier zero can't be used to
697 * figure out whether the entry is used or not since it's a valid value (a zero
698 * offset is common, and a zero modifier is &DRM_FORMAT_MOD_LINEAR).
699 */
666700struct drm_mode_fb_cmd2 {
701 /** @fb_id: Object ID of the frame-buffer. */
667702 __u32 fb_id;
703 /** @width: Width of the frame-buffer. */
668704 __u32 width;
705 /** @height: Height of the frame-buffer. */
669706 __u32 height;
670 __u32 pixel_format; /* fourcc code from drm_fourcc.h */
671 __u32 flags; /* see above flags */
707 /**
708 * @pixel_format: FourCC format code, see ``DRM_FORMAT_*`` constants in
709 * ``drm_fourcc.h``.
710 */
711 __u32 pixel_format;
712 /**
713 * @flags: Frame-buffer flags (see &DRM_MODE_FB_INTERLACED and
714 * &DRM_MODE_FB_MODIFIERS).
715 */
716 __u32 flags;
672717
673 /*
674 * In case of planar formats, this ioctl allows up to 4
675 * buffer objects with offsets and pitches per plane.
676 * The pitch and offset order is dictated by the fourcc,
677 * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:
678 *
679 * YUV 4:2:0 image with a plane of 8 bit Y samples
680 * followed by an interleaved U/V plane containing
681 * 8 bit 2x2 subsampled colour difference samples.
682 *
683 * So it would consist of Y as offsets[0] and UV as
684 * offsets[1]. Note that offsets[0] will generally
685 * be 0 (but this is not required).
686 *
687 * To accommodate tiled, compressed, etc formats, a
688 * modifier can be specified. The default value of zero
689 * indicates "native" format as specified by the fourcc.
690 * Vendor specific modifier token. Note that even though
691 * it looks like we have a modifier per-plane, we in fact
692 * do not. The modifier for each plane must be identical.
693 * Thus all combinations of different data layouts for
694 * multi plane formats must be enumerated as separate
695 * modifiers.
718 /**
719 * @handles: GEM buffer handle, one per plane. Set to 0 if the plane is
720 * unused. The same handle can be used for multiple planes.
696721 */
697722 __u32 handles[4];
698 __u32 pitches[4]; /* pitch for each plane */
699 __u32 offsets[4]; /* offset of each plane */
700 __u64 modifier[4]; /* ie, tiling, compress */
723 /** @pitches: Pitch (aka. stride) in bytes, one per plane. */
724 __u32 pitches[4];
725 /** @offsets: Offset into the buffer in bytes, one per plane. */
726 __u32 offsets[4];
727 /**
728 * @modifier: Format modifier, one per plane. See ``DRM_FORMAT_MOD_*``
729 * constants in ``drm_fourcc.h``. All planes must use the same
730 * modifier. Ignored unless &DRM_MODE_FB_MODIFIERS is set in @flags.
731 */
732 __u64 modifier[4];
701733};
702734
703735#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
......@@ -903,12 +935,31 @@ struct hdr_output_metadata {
903935 };
904936};
905937
938/**
939 * DRM_MODE_PAGE_FLIP_EVENT
940 *
941 * Request that the kernel sends back a vblank event (see
942 * struct drm_event_vblank) with the &DRM_EVENT_FLIP_COMPLETE type when the
943 * page-flip is done.
944 */
906945#define DRM_MODE_PAGE_FLIP_EVENT 0x01
946/**
947 * DRM_MODE_PAGE_FLIP_ASYNC
948 *
949 * Request that the page-flip is performed as soon as possible, ie. with no
950 * delay due to waiting for vblank. This may cause tearing to be visible on
951 * the screen.
952 */
907953#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
908954#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
909955#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
910956#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
911957 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
958/**
959 * DRM_MODE_PAGE_FLIP_FLAGS
960 *
961 * Bitmask of flags suitable for &drm_mode_crtc_page_flip_target.flags.
962 */
912963#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
913964 DRM_MODE_PAGE_FLIP_ASYNC | \
914965 DRM_MODE_PAGE_FLIP_TARGET)
......@@ -1002,11 +1053,53 @@ struct drm_mode_destroy_dumb {
10021053 __u32 handle;
10031054};
10041055
1005/* page-flip flags are valid, plus: */
1056/**
1057 * DRM_MODE_ATOMIC_TEST_ONLY
1058 *
1059 * Do not apply the atomic commit, instead check whether the hardware supports
1060 * this configuration.
1061 *
1062 * See &drm_mode_config_funcs.atomic_check for more details on test-only
1063 * commits.
1064 */
10061065#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
1066/**
1067 * DRM_MODE_ATOMIC_NONBLOCK
1068 *
1069 * Do not block while applying the atomic commit. The &DRM_IOCTL_MODE_ATOMIC
1070 * IOCTL returns immediately instead of waiting for the changes to be applied
1071 * in hardware. Note, the driver will still check that the update can be
1072 * applied before retuning.
1073 */
10071074#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
1075/**
1076 * DRM_MODE_ATOMIC_ALLOW_MODESET
1077 *
1078 * Allow the update to result in temporary or transient visible artifacts while
1079 * the update is being applied. Applying the update may also take significantly
1080 * more time than a page flip. All visual artifacts will disappear by the time
1081 * the update is completed, as signalled through the vblank event's timestamp
1082 * (see struct drm_event_vblank).
1083 *
1084 * This flag must be set when the KMS update might cause visible artifacts.
1085 * Without this flag such KMS update will return a EINVAL error. What kind of
1086 * update may cause visible artifacts depends on the driver and the hardware.
1087 * User-space that needs to know beforehand if an update might cause visible
1088 * artifacts can use &DRM_MODE_ATOMIC_TEST_ONLY without
1089 * &DRM_MODE_ATOMIC_ALLOW_MODESET to see if it fails.
1090 *
1091 * To the best of the driver's knowledge, visual artifacts are guaranteed to
1092 * not appear when this flag is not set. Some sinks might display visual
1093 * artifacts outside of the driver's control.
1094 */
10081095#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
10091096
1097/**
1098 * DRM_MODE_ATOMIC_FLAGS
1099 *
1100 * Bitfield of flags accepted by the &DRM_IOCTL_MODE_ATOMIC IOCTL in
1101 * &drm_mode_atomic.flags.
1102 */
10101103#define DRM_MODE_ATOMIC_FLAGS (\
10111104 DRM_MODE_PAGE_FLIP_EVENT |\
10121105 DRM_MODE_PAGE_FLIP_ASYNC |\
lib/libc/include/any-linux-any/drm/habanalabs_accel.h created+2233
......@@ -0,0 +1,2233 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2 *
3 * Copyright 2016-2022 HabanaLabs, Ltd.
4 * All Rights Reserved.
5 *
6 */
7
8#ifndef HABANALABS_H_
9#define HABANALABS_H_
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14/*
15 * Defines that are asic-specific but constitutes as ABI between kernel driver
16 * and userspace
17 */
18#define GOYA_KMD_SRAM_RESERVED_SIZE_FROM_START 0x8000 /* 32KB */
19#define GAUDI_DRIVER_SRAM_RESERVED_SIZE_FROM_START 0x80 /* 128 bytes */
20
21/*
22 * 128 SOBs reserved for collective wait
23 * 16 SOBs reserved for sync stream
24 */
25#define GAUDI_FIRST_AVAILABLE_W_S_SYNC_OBJECT 144
26
27/*
28 * 64 monitors reserved for collective wait
29 * 8 monitors reserved for sync stream
30 */
31#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
32
33/* Max number of elements in timestamps registration buffers */
34#define TS_MAX_ELEMENTS_NUM (1 << 20) /* 1MB */
35
36/*
37 * Goya queue Numbering
38 *
39 * The external queues (PCI DMA channels) MUST be before the internal queues
40 * and each group (PCI DMA channels and internal) must be contiguous inside
41 * itself but there can be a gap between the two groups (although not
42 * recommended)
43 */
44
45enum goya_queue_id {
46 GOYA_QUEUE_ID_DMA_0 = 0,
47 GOYA_QUEUE_ID_DMA_1 = 1,
48 GOYA_QUEUE_ID_DMA_2 = 2,
49 GOYA_QUEUE_ID_DMA_3 = 3,
50 GOYA_QUEUE_ID_DMA_4 = 4,
51 GOYA_QUEUE_ID_CPU_PQ = 5,
52 GOYA_QUEUE_ID_MME = 6, /* Internal queues start here */
53 GOYA_QUEUE_ID_TPC0 = 7,
54 GOYA_QUEUE_ID_TPC1 = 8,
55 GOYA_QUEUE_ID_TPC2 = 9,
56 GOYA_QUEUE_ID_TPC3 = 10,
57 GOYA_QUEUE_ID_TPC4 = 11,
58 GOYA_QUEUE_ID_TPC5 = 12,
59 GOYA_QUEUE_ID_TPC6 = 13,
60 GOYA_QUEUE_ID_TPC7 = 14,
61 GOYA_QUEUE_ID_SIZE
62};
63
64/*
65 * Gaudi queue Numbering
66 * External queues (PCI DMA channels) are DMA_0_*, DMA_1_* and DMA_5_*.
67 * Except one CPU queue, all the rest are internal queues.
68 */
69
70enum gaudi_queue_id {
71 GAUDI_QUEUE_ID_DMA_0_0 = 0, /* external */
72 GAUDI_QUEUE_ID_DMA_0_1 = 1, /* external */
73 GAUDI_QUEUE_ID_DMA_0_2 = 2, /* external */
74 GAUDI_QUEUE_ID_DMA_0_3 = 3, /* external */
75 GAUDI_QUEUE_ID_DMA_1_0 = 4, /* external */
76 GAUDI_QUEUE_ID_DMA_1_1 = 5, /* external */
77 GAUDI_QUEUE_ID_DMA_1_2 = 6, /* external */
78 GAUDI_QUEUE_ID_DMA_1_3 = 7, /* external */
79 GAUDI_QUEUE_ID_CPU_PQ = 8, /* CPU */
80 GAUDI_QUEUE_ID_DMA_2_0 = 9, /* internal */
81 GAUDI_QUEUE_ID_DMA_2_1 = 10, /* internal */
82 GAUDI_QUEUE_ID_DMA_2_2 = 11, /* internal */
83 GAUDI_QUEUE_ID_DMA_2_3 = 12, /* internal */
84 GAUDI_QUEUE_ID_DMA_3_0 = 13, /* internal */
85 GAUDI_QUEUE_ID_DMA_3_1 = 14, /* internal */
86 GAUDI_QUEUE_ID_DMA_3_2 = 15, /* internal */
87 GAUDI_QUEUE_ID_DMA_3_3 = 16, /* internal */
88 GAUDI_QUEUE_ID_DMA_4_0 = 17, /* internal */
89 GAUDI_QUEUE_ID_DMA_4_1 = 18, /* internal */
90 GAUDI_QUEUE_ID_DMA_4_2 = 19, /* internal */
91 GAUDI_QUEUE_ID_DMA_4_3 = 20, /* internal */
92 GAUDI_QUEUE_ID_DMA_5_0 = 21, /* internal */
93 GAUDI_QUEUE_ID_DMA_5_1 = 22, /* internal */
94 GAUDI_QUEUE_ID_DMA_5_2 = 23, /* internal */
95 GAUDI_QUEUE_ID_DMA_5_3 = 24, /* internal */
96 GAUDI_QUEUE_ID_DMA_6_0 = 25, /* internal */
97 GAUDI_QUEUE_ID_DMA_6_1 = 26, /* internal */
98 GAUDI_QUEUE_ID_DMA_6_2 = 27, /* internal */
99 GAUDI_QUEUE_ID_DMA_6_3 = 28, /* internal */
100 GAUDI_QUEUE_ID_DMA_7_0 = 29, /* internal */
101 GAUDI_QUEUE_ID_DMA_7_1 = 30, /* internal */
102 GAUDI_QUEUE_ID_DMA_7_2 = 31, /* internal */
103 GAUDI_QUEUE_ID_DMA_7_3 = 32, /* internal */
104 GAUDI_QUEUE_ID_MME_0_0 = 33, /* internal */
105 GAUDI_QUEUE_ID_MME_0_1 = 34, /* internal */
106 GAUDI_QUEUE_ID_MME_0_2 = 35, /* internal */
107 GAUDI_QUEUE_ID_MME_0_3 = 36, /* internal */
108 GAUDI_QUEUE_ID_MME_1_0 = 37, /* internal */
109 GAUDI_QUEUE_ID_MME_1_1 = 38, /* internal */
110 GAUDI_QUEUE_ID_MME_1_2 = 39, /* internal */
111 GAUDI_QUEUE_ID_MME_1_3 = 40, /* internal */
112 GAUDI_QUEUE_ID_TPC_0_0 = 41, /* internal */
113 GAUDI_QUEUE_ID_TPC_0_1 = 42, /* internal */
114 GAUDI_QUEUE_ID_TPC_0_2 = 43, /* internal */
115 GAUDI_QUEUE_ID_TPC_0_3 = 44, /* internal */
116 GAUDI_QUEUE_ID_TPC_1_0 = 45, /* internal */
117 GAUDI_QUEUE_ID_TPC_1_1 = 46, /* internal */
118 GAUDI_QUEUE_ID_TPC_1_2 = 47, /* internal */
119 GAUDI_QUEUE_ID_TPC_1_3 = 48, /* internal */
120 GAUDI_QUEUE_ID_TPC_2_0 = 49, /* internal */
121 GAUDI_QUEUE_ID_TPC_2_1 = 50, /* internal */
122 GAUDI_QUEUE_ID_TPC_2_2 = 51, /* internal */
123 GAUDI_QUEUE_ID_TPC_2_3 = 52, /* internal */
124 GAUDI_QUEUE_ID_TPC_3_0 = 53, /* internal */
125 GAUDI_QUEUE_ID_TPC_3_1 = 54, /* internal */
126 GAUDI_QUEUE_ID_TPC_3_2 = 55, /* internal */
127 GAUDI_QUEUE_ID_TPC_3_3 = 56, /* internal */
128 GAUDI_QUEUE_ID_TPC_4_0 = 57, /* internal */
129 GAUDI_QUEUE_ID_TPC_4_1 = 58, /* internal */
130 GAUDI_QUEUE_ID_TPC_4_2 = 59, /* internal */
131 GAUDI_QUEUE_ID_TPC_4_3 = 60, /* internal */
132 GAUDI_QUEUE_ID_TPC_5_0 = 61, /* internal */
133 GAUDI_QUEUE_ID_TPC_5_1 = 62, /* internal */
134 GAUDI_QUEUE_ID_TPC_5_2 = 63, /* internal */
135 GAUDI_QUEUE_ID_TPC_5_3 = 64, /* internal */
136 GAUDI_QUEUE_ID_TPC_6_0 = 65, /* internal */
137 GAUDI_QUEUE_ID_TPC_6_1 = 66, /* internal */
138 GAUDI_QUEUE_ID_TPC_6_2 = 67, /* internal */
139 GAUDI_QUEUE_ID_TPC_6_3 = 68, /* internal */
140 GAUDI_QUEUE_ID_TPC_7_0 = 69, /* internal */
141 GAUDI_QUEUE_ID_TPC_7_1 = 70, /* internal */
142 GAUDI_QUEUE_ID_TPC_7_2 = 71, /* internal */
143 GAUDI_QUEUE_ID_TPC_7_3 = 72, /* internal */
144 GAUDI_QUEUE_ID_NIC_0_0 = 73, /* internal */
145 GAUDI_QUEUE_ID_NIC_0_1 = 74, /* internal */
146 GAUDI_QUEUE_ID_NIC_0_2 = 75, /* internal */
147 GAUDI_QUEUE_ID_NIC_0_3 = 76, /* internal */
148 GAUDI_QUEUE_ID_NIC_1_0 = 77, /* internal */
149 GAUDI_QUEUE_ID_NIC_1_1 = 78, /* internal */
150 GAUDI_QUEUE_ID_NIC_1_2 = 79, /* internal */
151 GAUDI_QUEUE_ID_NIC_1_3 = 80, /* internal */
152 GAUDI_QUEUE_ID_NIC_2_0 = 81, /* internal */
153 GAUDI_QUEUE_ID_NIC_2_1 = 82, /* internal */
154 GAUDI_QUEUE_ID_NIC_2_2 = 83, /* internal */
155 GAUDI_QUEUE_ID_NIC_2_3 = 84, /* internal */
156 GAUDI_QUEUE_ID_NIC_3_0 = 85, /* internal */
157 GAUDI_QUEUE_ID_NIC_3_1 = 86, /* internal */
158 GAUDI_QUEUE_ID_NIC_3_2 = 87, /* internal */
159 GAUDI_QUEUE_ID_NIC_3_3 = 88, /* internal */
160 GAUDI_QUEUE_ID_NIC_4_0 = 89, /* internal */
161 GAUDI_QUEUE_ID_NIC_4_1 = 90, /* internal */
162 GAUDI_QUEUE_ID_NIC_4_2 = 91, /* internal */
163 GAUDI_QUEUE_ID_NIC_4_3 = 92, /* internal */
164 GAUDI_QUEUE_ID_NIC_5_0 = 93, /* internal */
165 GAUDI_QUEUE_ID_NIC_5_1 = 94, /* internal */
166 GAUDI_QUEUE_ID_NIC_5_2 = 95, /* internal */
167 GAUDI_QUEUE_ID_NIC_5_3 = 96, /* internal */
168 GAUDI_QUEUE_ID_NIC_6_0 = 97, /* internal */
169 GAUDI_QUEUE_ID_NIC_6_1 = 98, /* internal */
170 GAUDI_QUEUE_ID_NIC_6_2 = 99, /* internal */
171 GAUDI_QUEUE_ID_NIC_6_3 = 100, /* internal */
172 GAUDI_QUEUE_ID_NIC_7_0 = 101, /* internal */
173 GAUDI_QUEUE_ID_NIC_7_1 = 102, /* internal */
174 GAUDI_QUEUE_ID_NIC_7_2 = 103, /* internal */
175 GAUDI_QUEUE_ID_NIC_7_3 = 104, /* internal */
176 GAUDI_QUEUE_ID_NIC_8_0 = 105, /* internal */
177 GAUDI_QUEUE_ID_NIC_8_1 = 106, /* internal */
178 GAUDI_QUEUE_ID_NIC_8_2 = 107, /* internal */
179 GAUDI_QUEUE_ID_NIC_8_3 = 108, /* internal */
180 GAUDI_QUEUE_ID_NIC_9_0 = 109, /* internal */
181 GAUDI_QUEUE_ID_NIC_9_1 = 110, /* internal */
182 GAUDI_QUEUE_ID_NIC_9_2 = 111, /* internal */
183 GAUDI_QUEUE_ID_NIC_9_3 = 112, /* internal */
184 GAUDI_QUEUE_ID_SIZE
185};
186
187/*
188 * In GAUDI2 we have two modes of operation in regard to queues:
189 * 1. Legacy mode, where each QMAN exposes 4 streams to the user
190 * 2. F/W mode, where we use F/W to schedule the JOBS to the different queues.
191 *
192 * When in legacy mode, the user sends the queue id per JOB according to
193 * enum gaudi2_queue_id below.
194 *
195 * When in F/W mode, the user sends a stream id per Command Submission. The
196 * stream id is a running number from 0 up to (N-1), where N is the number
197 * of streams the F/W exposes and is passed to the user in
198 * struct hl_info_hw_ip_info
199 */
200
201enum gaudi2_queue_id {
202 GAUDI2_QUEUE_ID_PDMA_0_0 = 0,
203 GAUDI2_QUEUE_ID_PDMA_0_1 = 1,
204 GAUDI2_QUEUE_ID_PDMA_0_2 = 2,
205 GAUDI2_QUEUE_ID_PDMA_0_3 = 3,
206 GAUDI2_QUEUE_ID_PDMA_1_0 = 4,
207 GAUDI2_QUEUE_ID_PDMA_1_1 = 5,
208 GAUDI2_QUEUE_ID_PDMA_1_2 = 6,
209 GAUDI2_QUEUE_ID_PDMA_1_3 = 7,
210 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_0 = 8,
211 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_1 = 9,
212 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_2 = 10,
213 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_3 = 11,
214 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_0 = 12,
215 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_1 = 13,
216 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_2 = 14,
217 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_3 = 15,
218 GAUDI2_QUEUE_ID_DCORE0_MME_0_0 = 16,
219 GAUDI2_QUEUE_ID_DCORE0_MME_0_1 = 17,
220 GAUDI2_QUEUE_ID_DCORE0_MME_0_2 = 18,
221 GAUDI2_QUEUE_ID_DCORE0_MME_0_3 = 19,
222 GAUDI2_QUEUE_ID_DCORE0_TPC_0_0 = 20,
223 GAUDI2_QUEUE_ID_DCORE0_TPC_0_1 = 21,
224 GAUDI2_QUEUE_ID_DCORE0_TPC_0_2 = 22,
225 GAUDI2_QUEUE_ID_DCORE0_TPC_0_3 = 23,
226 GAUDI2_QUEUE_ID_DCORE0_TPC_1_0 = 24,
227 GAUDI2_QUEUE_ID_DCORE0_TPC_1_1 = 25,
228 GAUDI2_QUEUE_ID_DCORE0_TPC_1_2 = 26,
229 GAUDI2_QUEUE_ID_DCORE0_TPC_1_3 = 27,
230 GAUDI2_QUEUE_ID_DCORE0_TPC_2_0 = 28,
231 GAUDI2_QUEUE_ID_DCORE0_TPC_2_1 = 29,
232 GAUDI2_QUEUE_ID_DCORE0_TPC_2_2 = 30,
233 GAUDI2_QUEUE_ID_DCORE0_TPC_2_3 = 31,
234 GAUDI2_QUEUE_ID_DCORE0_TPC_3_0 = 32,
235 GAUDI2_QUEUE_ID_DCORE0_TPC_3_1 = 33,
236 GAUDI2_QUEUE_ID_DCORE0_TPC_3_2 = 34,
237 GAUDI2_QUEUE_ID_DCORE0_TPC_3_3 = 35,
238 GAUDI2_QUEUE_ID_DCORE0_TPC_4_0 = 36,
239 GAUDI2_QUEUE_ID_DCORE0_TPC_4_1 = 37,
240 GAUDI2_QUEUE_ID_DCORE0_TPC_4_2 = 38,
241 GAUDI2_QUEUE_ID_DCORE0_TPC_4_3 = 39,
242 GAUDI2_QUEUE_ID_DCORE0_TPC_5_0 = 40,
243 GAUDI2_QUEUE_ID_DCORE0_TPC_5_1 = 41,
244 GAUDI2_QUEUE_ID_DCORE0_TPC_5_2 = 42,
245 GAUDI2_QUEUE_ID_DCORE0_TPC_5_3 = 43,
246 GAUDI2_QUEUE_ID_DCORE0_TPC_6_0 = 44,
247 GAUDI2_QUEUE_ID_DCORE0_TPC_6_1 = 45,
248 GAUDI2_QUEUE_ID_DCORE0_TPC_6_2 = 46,
249 GAUDI2_QUEUE_ID_DCORE0_TPC_6_3 = 47,
250 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_0 = 48,
251 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_1 = 49,
252 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_2 = 50,
253 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_3 = 51,
254 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_0 = 52,
255 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_1 = 53,
256 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_2 = 54,
257 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_3 = 55,
258 GAUDI2_QUEUE_ID_DCORE1_MME_0_0 = 56,
259 GAUDI2_QUEUE_ID_DCORE1_MME_0_1 = 57,
260 GAUDI2_QUEUE_ID_DCORE1_MME_0_2 = 58,
261 GAUDI2_QUEUE_ID_DCORE1_MME_0_3 = 59,
262 GAUDI2_QUEUE_ID_DCORE1_TPC_0_0 = 60,
263 GAUDI2_QUEUE_ID_DCORE1_TPC_0_1 = 61,
264 GAUDI2_QUEUE_ID_DCORE1_TPC_0_2 = 62,
265 GAUDI2_QUEUE_ID_DCORE1_TPC_0_3 = 63,
266 GAUDI2_QUEUE_ID_DCORE1_TPC_1_0 = 64,
267 GAUDI2_QUEUE_ID_DCORE1_TPC_1_1 = 65,
268 GAUDI2_QUEUE_ID_DCORE1_TPC_1_2 = 66,
269 GAUDI2_QUEUE_ID_DCORE1_TPC_1_3 = 67,
270 GAUDI2_QUEUE_ID_DCORE1_TPC_2_0 = 68,
271 GAUDI2_QUEUE_ID_DCORE1_TPC_2_1 = 69,
272 GAUDI2_QUEUE_ID_DCORE1_TPC_2_2 = 70,
273 GAUDI2_QUEUE_ID_DCORE1_TPC_2_3 = 71,
274 GAUDI2_QUEUE_ID_DCORE1_TPC_3_0 = 72,
275 GAUDI2_QUEUE_ID_DCORE1_TPC_3_1 = 73,
276 GAUDI2_QUEUE_ID_DCORE1_TPC_3_2 = 74,
277 GAUDI2_QUEUE_ID_DCORE1_TPC_3_3 = 75,
278 GAUDI2_QUEUE_ID_DCORE1_TPC_4_0 = 76,
279 GAUDI2_QUEUE_ID_DCORE1_TPC_4_1 = 77,
280 GAUDI2_QUEUE_ID_DCORE1_TPC_4_2 = 78,
281 GAUDI2_QUEUE_ID_DCORE1_TPC_4_3 = 79,
282 GAUDI2_QUEUE_ID_DCORE1_TPC_5_0 = 80,
283 GAUDI2_QUEUE_ID_DCORE1_TPC_5_1 = 81,
284 GAUDI2_QUEUE_ID_DCORE1_TPC_5_2 = 82,
285 GAUDI2_QUEUE_ID_DCORE1_TPC_5_3 = 83,
286 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_0 = 84,
287 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_1 = 85,
288 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_2 = 86,
289 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_3 = 87,
290 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_0 = 88,
291 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_1 = 89,
292 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_2 = 90,
293 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_3 = 91,
294 GAUDI2_QUEUE_ID_DCORE2_MME_0_0 = 92,
295 GAUDI2_QUEUE_ID_DCORE2_MME_0_1 = 93,
296 GAUDI2_QUEUE_ID_DCORE2_MME_0_2 = 94,
297 GAUDI2_QUEUE_ID_DCORE2_MME_0_3 = 95,
298 GAUDI2_QUEUE_ID_DCORE2_TPC_0_0 = 96,
299 GAUDI2_QUEUE_ID_DCORE2_TPC_0_1 = 97,
300 GAUDI2_QUEUE_ID_DCORE2_TPC_0_2 = 98,
301 GAUDI2_QUEUE_ID_DCORE2_TPC_0_3 = 99,
302 GAUDI2_QUEUE_ID_DCORE2_TPC_1_0 = 100,
303 GAUDI2_QUEUE_ID_DCORE2_TPC_1_1 = 101,
304 GAUDI2_QUEUE_ID_DCORE2_TPC_1_2 = 102,
305 GAUDI2_QUEUE_ID_DCORE2_TPC_1_3 = 103,
306 GAUDI2_QUEUE_ID_DCORE2_TPC_2_0 = 104,
307 GAUDI2_QUEUE_ID_DCORE2_TPC_2_1 = 105,
308 GAUDI2_QUEUE_ID_DCORE2_TPC_2_2 = 106,
309 GAUDI2_QUEUE_ID_DCORE2_TPC_2_3 = 107,
310 GAUDI2_QUEUE_ID_DCORE2_TPC_3_0 = 108,
311 GAUDI2_QUEUE_ID_DCORE2_TPC_3_1 = 109,
312 GAUDI2_QUEUE_ID_DCORE2_TPC_3_2 = 110,
313 GAUDI2_QUEUE_ID_DCORE2_TPC_3_3 = 111,
314 GAUDI2_QUEUE_ID_DCORE2_TPC_4_0 = 112,
315 GAUDI2_QUEUE_ID_DCORE2_TPC_4_1 = 113,
316 GAUDI2_QUEUE_ID_DCORE2_TPC_4_2 = 114,
317 GAUDI2_QUEUE_ID_DCORE2_TPC_4_3 = 115,
318 GAUDI2_QUEUE_ID_DCORE2_TPC_5_0 = 116,
319 GAUDI2_QUEUE_ID_DCORE2_TPC_5_1 = 117,
320 GAUDI2_QUEUE_ID_DCORE2_TPC_5_2 = 118,
321 GAUDI2_QUEUE_ID_DCORE2_TPC_5_3 = 119,
322 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_0 = 120,
323 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_1 = 121,
324 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_2 = 122,
325 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_3 = 123,
326 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_0 = 124,
327 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_1 = 125,
328 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_2 = 126,
329 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_3 = 127,
330 GAUDI2_QUEUE_ID_DCORE3_MME_0_0 = 128,
331 GAUDI2_QUEUE_ID_DCORE3_MME_0_1 = 129,
332 GAUDI2_QUEUE_ID_DCORE3_MME_0_2 = 130,
333 GAUDI2_QUEUE_ID_DCORE3_MME_0_3 = 131,
334 GAUDI2_QUEUE_ID_DCORE3_TPC_0_0 = 132,
335 GAUDI2_QUEUE_ID_DCORE3_TPC_0_1 = 133,
336 GAUDI2_QUEUE_ID_DCORE3_TPC_0_2 = 134,
337 GAUDI2_QUEUE_ID_DCORE3_TPC_0_3 = 135,
338 GAUDI2_QUEUE_ID_DCORE3_TPC_1_0 = 136,
339 GAUDI2_QUEUE_ID_DCORE3_TPC_1_1 = 137,
340 GAUDI2_QUEUE_ID_DCORE3_TPC_1_2 = 138,
341 GAUDI2_QUEUE_ID_DCORE3_TPC_1_3 = 139,
342 GAUDI2_QUEUE_ID_DCORE3_TPC_2_0 = 140,
343 GAUDI2_QUEUE_ID_DCORE3_TPC_2_1 = 141,
344 GAUDI2_QUEUE_ID_DCORE3_TPC_2_2 = 142,
345 GAUDI2_QUEUE_ID_DCORE3_TPC_2_3 = 143,
346 GAUDI2_QUEUE_ID_DCORE3_TPC_3_0 = 144,
347 GAUDI2_QUEUE_ID_DCORE3_TPC_3_1 = 145,
348 GAUDI2_QUEUE_ID_DCORE3_TPC_3_2 = 146,
349 GAUDI2_QUEUE_ID_DCORE3_TPC_3_3 = 147,
350 GAUDI2_QUEUE_ID_DCORE3_TPC_4_0 = 148,
351 GAUDI2_QUEUE_ID_DCORE3_TPC_4_1 = 149,
352 GAUDI2_QUEUE_ID_DCORE3_TPC_4_2 = 150,
353 GAUDI2_QUEUE_ID_DCORE3_TPC_4_3 = 151,
354 GAUDI2_QUEUE_ID_DCORE3_TPC_5_0 = 152,
355 GAUDI2_QUEUE_ID_DCORE3_TPC_5_1 = 153,
356 GAUDI2_QUEUE_ID_DCORE3_TPC_5_2 = 154,
357 GAUDI2_QUEUE_ID_DCORE3_TPC_5_3 = 155,
358 GAUDI2_QUEUE_ID_NIC_0_0 = 156,
359 GAUDI2_QUEUE_ID_NIC_0_1 = 157,
360 GAUDI2_QUEUE_ID_NIC_0_2 = 158,
361 GAUDI2_QUEUE_ID_NIC_0_3 = 159,
362 GAUDI2_QUEUE_ID_NIC_1_0 = 160,
363 GAUDI2_QUEUE_ID_NIC_1_1 = 161,
364 GAUDI2_QUEUE_ID_NIC_1_2 = 162,
365 GAUDI2_QUEUE_ID_NIC_1_3 = 163,
366 GAUDI2_QUEUE_ID_NIC_2_0 = 164,
367 GAUDI2_QUEUE_ID_NIC_2_1 = 165,
368 GAUDI2_QUEUE_ID_NIC_2_2 = 166,
369 GAUDI2_QUEUE_ID_NIC_2_3 = 167,
370 GAUDI2_QUEUE_ID_NIC_3_0 = 168,
371 GAUDI2_QUEUE_ID_NIC_3_1 = 169,
372 GAUDI2_QUEUE_ID_NIC_3_2 = 170,
373 GAUDI2_QUEUE_ID_NIC_3_3 = 171,
374 GAUDI2_QUEUE_ID_NIC_4_0 = 172,
375 GAUDI2_QUEUE_ID_NIC_4_1 = 173,
376 GAUDI2_QUEUE_ID_NIC_4_2 = 174,
377 GAUDI2_QUEUE_ID_NIC_4_3 = 175,
378 GAUDI2_QUEUE_ID_NIC_5_0 = 176,
379 GAUDI2_QUEUE_ID_NIC_5_1 = 177,
380 GAUDI2_QUEUE_ID_NIC_5_2 = 178,
381 GAUDI2_QUEUE_ID_NIC_5_3 = 179,
382 GAUDI2_QUEUE_ID_NIC_6_0 = 180,
383 GAUDI2_QUEUE_ID_NIC_6_1 = 181,
384 GAUDI2_QUEUE_ID_NIC_6_2 = 182,
385 GAUDI2_QUEUE_ID_NIC_6_3 = 183,
386 GAUDI2_QUEUE_ID_NIC_7_0 = 184,
387 GAUDI2_QUEUE_ID_NIC_7_1 = 185,
388 GAUDI2_QUEUE_ID_NIC_7_2 = 186,
389 GAUDI2_QUEUE_ID_NIC_7_3 = 187,
390 GAUDI2_QUEUE_ID_NIC_8_0 = 188,
391 GAUDI2_QUEUE_ID_NIC_8_1 = 189,
392 GAUDI2_QUEUE_ID_NIC_8_2 = 190,
393 GAUDI2_QUEUE_ID_NIC_8_3 = 191,
394 GAUDI2_QUEUE_ID_NIC_9_0 = 192,
395 GAUDI2_QUEUE_ID_NIC_9_1 = 193,
396 GAUDI2_QUEUE_ID_NIC_9_2 = 194,
397 GAUDI2_QUEUE_ID_NIC_9_3 = 195,
398 GAUDI2_QUEUE_ID_NIC_10_0 = 196,
399 GAUDI2_QUEUE_ID_NIC_10_1 = 197,
400 GAUDI2_QUEUE_ID_NIC_10_2 = 198,
401 GAUDI2_QUEUE_ID_NIC_10_3 = 199,
402 GAUDI2_QUEUE_ID_NIC_11_0 = 200,
403 GAUDI2_QUEUE_ID_NIC_11_1 = 201,
404 GAUDI2_QUEUE_ID_NIC_11_2 = 202,
405 GAUDI2_QUEUE_ID_NIC_11_3 = 203,
406 GAUDI2_QUEUE_ID_NIC_12_0 = 204,
407 GAUDI2_QUEUE_ID_NIC_12_1 = 205,
408 GAUDI2_QUEUE_ID_NIC_12_2 = 206,
409 GAUDI2_QUEUE_ID_NIC_12_3 = 207,
410 GAUDI2_QUEUE_ID_NIC_13_0 = 208,
411 GAUDI2_QUEUE_ID_NIC_13_1 = 209,
412 GAUDI2_QUEUE_ID_NIC_13_2 = 210,
413 GAUDI2_QUEUE_ID_NIC_13_3 = 211,
414 GAUDI2_QUEUE_ID_NIC_14_0 = 212,
415 GAUDI2_QUEUE_ID_NIC_14_1 = 213,
416 GAUDI2_QUEUE_ID_NIC_14_2 = 214,
417 GAUDI2_QUEUE_ID_NIC_14_3 = 215,
418 GAUDI2_QUEUE_ID_NIC_15_0 = 216,
419 GAUDI2_QUEUE_ID_NIC_15_1 = 217,
420 GAUDI2_QUEUE_ID_NIC_15_2 = 218,
421 GAUDI2_QUEUE_ID_NIC_15_3 = 219,
422 GAUDI2_QUEUE_ID_NIC_16_0 = 220,
423 GAUDI2_QUEUE_ID_NIC_16_1 = 221,
424 GAUDI2_QUEUE_ID_NIC_16_2 = 222,
425 GAUDI2_QUEUE_ID_NIC_16_3 = 223,
426 GAUDI2_QUEUE_ID_NIC_17_0 = 224,
427 GAUDI2_QUEUE_ID_NIC_17_1 = 225,
428 GAUDI2_QUEUE_ID_NIC_17_2 = 226,
429 GAUDI2_QUEUE_ID_NIC_17_3 = 227,
430 GAUDI2_QUEUE_ID_NIC_18_0 = 228,
431 GAUDI2_QUEUE_ID_NIC_18_1 = 229,
432 GAUDI2_QUEUE_ID_NIC_18_2 = 230,
433 GAUDI2_QUEUE_ID_NIC_18_3 = 231,
434 GAUDI2_QUEUE_ID_NIC_19_0 = 232,
435 GAUDI2_QUEUE_ID_NIC_19_1 = 233,
436 GAUDI2_QUEUE_ID_NIC_19_2 = 234,
437 GAUDI2_QUEUE_ID_NIC_19_3 = 235,
438 GAUDI2_QUEUE_ID_NIC_20_0 = 236,
439 GAUDI2_QUEUE_ID_NIC_20_1 = 237,
440 GAUDI2_QUEUE_ID_NIC_20_2 = 238,
441 GAUDI2_QUEUE_ID_NIC_20_3 = 239,
442 GAUDI2_QUEUE_ID_NIC_21_0 = 240,
443 GAUDI2_QUEUE_ID_NIC_21_1 = 241,
444 GAUDI2_QUEUE_ID_NIC_21_2 = 242,
445 GAUDI2_QUEUE_ID_NIC_21_3 = 243,
446 GAUDI2_QUEUE_ID_NIC_22_0 = 244,
447 GAUDI2_QUEUE_ID_NIC_22_1 = 245,
448 GAUDI2_QUEUE_ID_NIC_22_2 = 246,
449 GAUDI2_QUEUE_ID_NIC_22_3 = 247,
450 GAUDI2_QUEUE_ID_NIC_23_0 = 248,
451 GAUDI2_QUEUE_ID_NIC_23_1 = 249,
452 GAUDI2_QUEUE_ID_NIC_23_2 = 250,
453 GAUDI2_QUEUE_ID_NIC_23_3 = 251,
454 GAUDI2_QUEUE_ID_ROT_0_0 = 252,
455 GAUDI2_QUEUE_ID_ROT_0_1 = 253,
456 GAUDI2_QUEUE_ID_ROT_0_2 = 254,
457 GAUDI2_QUEUE_ID_ROT_0_3 = 255,
458 GAUDI2_QUEUE_ID_ROT_1_0 = 256,
459 GAUDI2_QUEUE_ID_ROT_1_1 = 257,
460 GAUDI2_QUEUE_ID_ROT_1_2 = 258,
461 GAUDI2_QUEUE_ID_ROT_1_3 = 259,
462 GAUDI2_QUEUE_ID_CPU_PQ = 260,
463 GAUDI2_QUEUE_ID_SIZE
464};
465
466/*
467 * Engine Numbering
468 *
469 * Used in the "busy_engines_mask" field in `struct hl_info_hw_idle'
470 */
471
472enum goya_engine_id {
473 GOYA_ENGINE_ID_DMA_0 = 0,
474 GOYA_ENGINE_ID_DMA_1,
475 GOYA_ENGINE_ID_DMA_2,
476 GOYA_ENGINE_ID_DMA_3,
477 GOYA_ENGINE_ID_DMA_4,
478 GOYA_ENGINE_ID_MME_0,
479 GOYA_ENGINE_ID_TPC_0,
480 GOYA_ENGINE_ID_TPC_1,
481 GOYA_ENGINE_ID_TPC_2,
482 GOYA_ENGINE_ID_TPC_3,
483 GOYA_ENGINE_ID_TPC_4,
484 GOYA_ENGINE_ID_TPC_5,
485 GOYA_ENGINE_ID_TPC_6,
486 GOYA_ENGINE_ID_TPC_7,
487 GOYA_ENGINE_ID_SIZE
488};
489
490enum gaudi_engine_id {
491 GAUDI_ENGINE_ID_DMA_0 = 0,
492 GAUDI_ENGINE_ID_DMA_1,
493 GAUDI_ENGINE_ID_DMA_2,
494 GAUDI_ENGINE_ID_DMA_3,
495 GAUDI_ENGINE_ID_DMA_4,
496 GAUDI_ENGINE_ID_DMA_5,
497 GAUDI_ENGINE_ID_DMA_6,
498 GAUDI_ENGINE_ID_DMA_7,
499 GAUDI_ENGINE_ID_MME_0,
500 GAUDI_ENGINE_ID_MME_1,
501 GAUDI_ENGINE_ID_MME_2,
502 GAUDI_ENGINE_ID_MME_3,
503 GAUDI_ENGINE_ID_TPC_0,
504 GAUDI_ENGINE_ID_TPC_1,
505 GAUDI_ENGINE_ID_TPC_2,
506 GAUDI_ENGINE_ID_TPC_3,
507 GAUDI_ENGINE_ID_TPC_4,
508 GAUDI_ENGINE_ID_TPC_5,
509 GAUDI_ENGINE_ID_TPC_6,
510 GAUDI_ENGINE_ID_TPC_7,
511 GAUDI_ENGINE_ID_NIC_0,
512 GAUDI_ENGINE_ID_NIC_1,
513 GAUDI_ENGINE_ID_NIC_2,
514 GAUDI_ENGINE_ID_NIC_3,
515 GAUDI_ENGINE_ID_NIC_4,
516 GAUDI_ENGINE_ID_NIC_5,
517 GAUDI_ENGINE_ID_NIC_6,
518 GAUDI_ENGINE_ID_NIC_7,
519 GAUDI_ENGINE_ID_NIC_8,
520 GAUDI_ENGINE_ID_NIC_9,
521 GAUDI_ENGINE_ID_SIZE
522};
523
524enum gaudi2_engine_id {
525 GAUDI2_DCORE0_ENGINE_ID_EDMA_0 = 0,
526 GAUDI2_DCORE0_ENGINE_ID_EDMA_1,
527 GAUDI2_DCORE0_ENGINE_ID_MME,
528 GAUDI2_DCORE0_ENGINE_ID_TPC_0,
529 GAUDI2_DCORE0_ENGINE_ID_TPC_1,
530 GAUDI2_DCORE0_ENGINE_ID_TPC_2,
531 GAUDI2_DCORE0_ENGINE_ID_TPC_3,
532 GAUDI2_DCORE0_ENGINE_ID_TPC_4,
533 GAUDI2_DCORE0_ENGINE_ID_TPC_5,
534 GAUDI2_DCORE0_ENGINE_ID_DEC_0,
535 GAUDI2_DCORE0_ENGINE_ID_DEC_1,
536 GAUDI2_DCORE1_ENGINE_ID_EDMA_0,
537 GAUDI2_DCORE1_ENGINE_ID_EDMA_1,
538 GAUDI2_DCORE1_ENGINE_ID_MME,
539 GAUDI2_DCORE1_ENGINE_ID_TPC_0,
540 GAUDI2_DCORE1_ENGINE_ID_TPC_1,
541 GAUDI2_DCORE1_ENGINE_ID_TPC_2,
542 GAUDI2_DCORE1_ENGINE_ID_TPC_3,
543 GAUDI2_DCORE1_ENGINE_ID_TPC_4,
544 GAUDI2_DCORE1_ENGINE_ID_TPC_5,
545 GAUDI2_DCORE1_ENGINE_ID_DEC_0,
546 GAUDI2_DCORE1_ENGINE_ID_DEC_1,
547 GAUDI2_DCORE2_ENGINE_ID_EDMA_0,
548 GAUDI2_DCORE2_ENGINE_ID_EDMA_1,
549 GAUDI2_DCORE2_ENGINE_ID_MME,
550 GAUDI2_DCORE2_ENGINE_ID_TPC_0,
551 GAUDI2_DCORE2_ENGINE_ID_TPC_1,
552 GAUDI2_DCORE2_ENGINE_ID_TPC_2,
553 GAUDI2_DCORE2_ENGINE_ID_TPC_3,
554 GAUDI2_DCORE2_ENGINE_ID_TPC_4,
555 GAUDI2_DCORE2_ENGINE_ID_TPC_5,
556 GAUDI2_DCORE2_ENGINE_ID_DEC_0,
557 GAUDI2_DCORE2_ENGINE_ID_DEC_1,
558 GAUDI2_DCORE3_ENGINE_ID_EDMA_0,
559 GAUDI2_DCORE3_ENGINE_ID_EDMA_1,
560 GAUDI2_DCORE3_ENGINE_ID_MME,
561 GAUDI2_DCORE3_ENGINE_ID_TPC_0,
562 GAUDI2_DCORE3_ENGINE_ID_TPC_1,
563 GAUDI2_DCORE3_ENGINE_ID_TPC_2,
564 GAUDI2_DCORE3_ENGINE_ID_TPC_3,
565 GAUDI2_DCORE3_ENGINE_ID_TPC_4,
566 GAUDI2_DCORE3_ENGINE_ID_TPC_5,
567 GAUDI2_DCORE3_ENGINE_ID_DEC_0,
568 GAUDI2_DCORE3_ENGINE_ID_DEC_1,
569 GAUDI2_DCORE0_ENGINE_ID_TPC_6,
570 GAUDI2_ENGINE_ID_PDMA_0,
571 GAUDI2_ENGINE_ID_PDMA_1,
572 GAUDI2_ENGINE_ID_ROT_0,
573 GAUDI2_ENGINE_ID_ROT_1,
574 GAUDI2_PCIE_ENGINE_ID_DEC_0,
575 GAUDI2_PCIE_ENGINE_ID_DEC_1,
576 GAUDI2_ENGINE_ID_NIC0_0,
577 GAUDI2_ENGINE_ID_NIC0_1,
578 GAUDI2_ENGINE_ID_NIC1_0,
579 GAUDI2_ENGINE_ID_NIC1_1,
580 GAUDI2_ENGINE_ID_NIC2_0,
581 GAUDI2_ENGINE_ID_NIC2_1,
582 GAUDI2_ENGINE_ID_NIC3_0,
583 GAUDI2_ENGINE_ID_NIC3_1,
584 GAUDI2_ENGINE_ID_NIC4_0,
585 GAUDI2_ENGINE_ID_NIC4_1,
586 GAUDI2_ENGINE_ID_NIC5_0,
587 GAUDI2_ENGINE_ID_NIC5_1,
588 GAUDI2_ENGINE_ID_NIC6_0,
589 GAUDI2_ENGINE_ID_NIC6_1,
590 GAUDI2_ENGINE_ID_NIC7_0,
591 GAUDI2_ENGINE_ID_NIC7_1,
592 GAUDI2_ENGINE_ID_NIC8_0,
593 GAUDI2_ENGINE_ID_NIC8_1,
594 GAUDI2_ENGINE_ID_NIC9_0,
595 GAUDI2_ENGINE_ID_NIC9_1,
596 GAUDI2_ENGINE_ID_NIC10_0,
597 GAUDI2_ENGINE_ID_NIC10_1,
598 GAUDI2_ENGINE_ID_NIC11_0,
599 GAUDI2_ENGINE_ID_NIC11_1,
600 GAUDI2_ENGINE_ID_PCIE,
601 GAUDI2_ENGINE_ID_PSOC,
602 GAUDI2_ENGINE_ID_ARC_FARM,
603 GAUDI2_ENGINE_ID_KDMA,
604 GAUDI2_ENGINE_ID_SIZE
605};
606
607/*
608 * ASIC specific PLL index
609 *
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
613 */
614
615enum hl_goya_pll_index {
616 HL_GOYA_CPU_PLL = 0,
617 HL_GOYA_IC_PLL,
618 HL_GOYA_MC_PLL,
619 HL_GOYA_MME_PLL,
620 HL_GOYA_PCI_PLL,
621 HL_GOYA_EMMC_PLL,
622 HL_GOYA_TPC_PLL,
623 HL_GOYA_PLL_MAX
624};
625
626enum hl_gaudi_pll_index {
627 HL_GAUDI_CPU_PLL = 0,
628 HL_GAUDI_PCI_PLL,
629 HL_GAUDI_SRAM_PLL,
630 HL_GAUDI_HBM_PLL,
631 HL_GAUDI_NIC_PLL,
632 HL_GAUDI_DMA_PLL,
633 HL_GAUDI_MESH_PLL,
634 HL_GAUDI_MME_PLL,
635 HL_GAUDI_TPC_PLL,
636 HL_GAUDI_IF_PLL,
637 HL_GAUDI_PLL_MAX
638};
639
640enum hl_gaudi2_pll_index {
641 HL_GAUDI2_CPU_PLL = 0,
642 HL_GAUDI2_PCI_PLL,
643 HL_GAUDI2_SRAM_PLL,
644 HL_GAUDI2_HBM_PLL,
645 HL_GAUDI2_NIC_PLL,
646 HL_GAUDI2_DMA_PLL,
647 HL_GAUDI2_MESH_PLL,
648 HL_GAUDI2_MME_PLL,
649 HL_GAUDI2_TPC_PLL,
650 HL_GAUDI2_IF_PLL,
651 HL_GAUDI2_VID_PLL,
652 HL_GAUDI2_MSS_PLL,
653 HL_GAUDI2_PLL_MAX
654};
655
656/**
657 * enum hl_goya_dma_direction - Direction of DMA operation inside a LIN_DMA packet that is
658 * submitted to the GOYA's DMA QMAN. This attribute is not relevant
659 * to the H/W but the kernel driver use it to parse the packet's
660 * addresses and patch/validate them.
661 * @HL_DMA_HOST_TO_DRAM: DMA operation from Host memory to GOYA's DDR.
662 * @HL_DMA_HOST_TO_SRAM: DMA operation from Host memory to GOYA's SRAM.
663 * @HL_DMA_DRAM_TO_SRAM: DMA operation from GOYA's DDR to GOYA's SRAM.
664 * @HL_DMA_SRAM_TO_DRAM: DMA operation from GOYA's SRAM to GOYA's DDR.
665 * @HL_DMA_SRAM_TO_HOST: DMA operation from GOYA's SRAM to Host memory.
666 * @HL_DMA_DRAM_TO_HOST: DMA operation from GOYA's DDR to Host memory.
667 * @HL_DMA_DRAM_TO_DRAM: DMA operation from GOYA's DDR to GOYA's DDR.
668 * @HL_DMA_SRAM_TO_SRAM: DMA operation from GOYA's SRAM to GOYA's SRAM.
669 * @HL_DMA_ENUM_MAX: number of values in enum
670 */
671enum hl_goya_dma_direction {
672 HL_DMA_HOST_TO_DRAM,
673 HL_DMA_HOST_TO_SRAM,
674 HL_DMA_DRAM_TO_SRAM,
675 HL_DMA_SRAM_TO_DRAM,
676 HL_DMA_SRAM_TO_HOST,
677 HL_DMA_DRAM_TO_HOST,
678 HL_DMA_DRAM_TO_DRAM,
679 HL_DMA_SRAM_TO_SRAM,
680 HL_DMA_ENUM_MAX
681};
682
683/**
684 * enum hl_device_status - Device status information.
685 * @HL_DEVICE_STATUS_OPERATIONAL: Device is operational.
686 * @HL_DEVICE_STATUS_IN_RESET: Device is currently during reset.
687 * @HL_DEVICE_STATUS_MALFUNCTION: Device is unusable.
688 * @HL_DEVICE_STATUS_NEEDS_RESET: Device needs reset because auto reset was disabled.
689 * @HL_DEVICE_STATUS_IN_DEVICE_CREATION: Device is operational but its creation is still in
690 * progress.
691 * @HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE: Device is currently during reset that was
692 * triggered because the user released the device
693 * @HL_DEVICE_STATUS_LAST: Last status.
694 */
695enum hl_device_status {
696 HL_DEVICE_STATUS_OPERATIONAL,
697 HL_DEVICE_STATUS_IN_RESET,
698 HL_DEVICE_STATUS_MALFUNCTION,
699 HL_DEVICE_STATUS_NEEDS_RESET,
700 HL_DEVICE_STATUS_IN_DEVICE_CREATION,
701 HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE,
702 HL_DEVICE_STATUS_LAST = HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE
703};
704
705enum hl_server_type {
706 HL_SERVER_TYPE_UNKNOWN = 0,
707 HL_SERVER_GAUDI_HLS1 = 1,
708 HL_SERVER_GAUDI_HLS1H = 2,
709 HL_SERVER_GAUDI_TYPE1 = 3,
710 HL_SERVER_GAUDI_TYPE2 = 4,
711 HL_SERVER_GAUDI2_HLS2 = 5
712};
713
714/*
715 * Notifier event values - for the notification mechanism and the HL_INFO_GET_EVENTS command
716 *
717 * HL_NOTIFIER_EVENT_TPC_ASSERT - Indicates TPC assert event
718 * HL_NOTIFIER_EVENT_UNDEFINED_OPCODE - Indicates undefined operation code
719 * HL_NOTIFIER_EVENT_DEVICE_RESET - Indicates device requires a reset
720 * HL_NOTIFIER_EVENT_CS_TIMEOUT - Indicates CS timeout error
721 * HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE - Indicates device is unavailable
722 * HL_NOTIFIER_EVENT_USER_ENGINE_ERR - Indicates device engine in error state
723 * HL_NOTIFIER_EVENT_GENERAL_HW_ERR - Indicates device HW error
724 * HL_NOTIFIER_EVENT_RAZWI - Indicates razwi happened
725 * HL_NOTIFIER_EVENT_PAGE_FAULT - Indicates page fault happened
726 */
727#define HL_NOTIFIER_EVENT_TPC_ASSERT (1ULL << 0)
728#define HL_NOTIFIER_EVENT_UNDEFINED_OPCODE (1ULL << 1)
729#define HL_NOTIFIER_EVENT_DEVICE_RESET (1ULL << 2)
730#define HL_NOTIFIER_EVENT_CS_TIMEOUT (1ULL << 3)
731#define HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE (1ULL << 4)
732#define HL_NOTIFIER_EVENT_USER_ENGINE_ERR (1ULL << 5)
733#define HL_NOTIFIER_EVENT_GENERAL_HW_ERR (1ULL << 6)
734#define HL_NOTIFIER_EVENT_RAZWI (1ULL << 7)
735#define HL_NOTIFIER_EVENT_PAGE_FAULT (1ULL << 8)
736
737/* Opcode for management ioctl
738 *
739 * HW_IP_INFO - Receive information about different IP blocks in the
740 * device.
741 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
742 * occurred since the last hard reset.
743 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
744 * specific context. This is relevant only for devices
745 * where the dram is managed by the kernel driver
746 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
747 * internal engine.
748 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
749 * require an open context.
750 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
751 * over the last period specified by the user.
752 * The period can be between 100ms to 1s, in
753 * resolution of 100ms. The return value is a
754 * percentage of the utilization rate.
755 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
756 * event occurred since the driver was loaded.
757 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
758 * of the device in MHz. The maximum clock rate is
759 * configurable via sysfs parameter
760 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
761 * operations performed on the device since the last
762 * time the driver was loaded.
763 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
764 * for synchronization.
765 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
766 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
767 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
768 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
769 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
770 * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency
771 * HL_INFO_POWER - Retrieve power information
772 * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls
773 * HL_INFO_DRAM_REPLACED_ROWS - Retrieve DRAM replaced rows info
774 * HL_INFO_DRAM_PENDING_ROWS - Retrieve DRAM pending rows num
775 * HL_INFO_LAST_ERR_OPEN_DEV_TIME - Retrieve timestamp of the last time the device was opened
776 * and CS timeout or razwi error occurred.
777 * HL_INFO_CS_TIMEOUT_EVENT - Retrieve CS timeout timestamp and its related CS sequence number.
778 * HL_INFO_RAZWI_EVENT - Retrieve parameters of razwi:
779 * Timestamp of razwi.
780 * The address which accessing it caused the razwi.
781 * Razwi initiator.
782 * Razwi cause, was it a page fault or MMU access error.
783 * HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES - Retrieve valid page sizes for device memory allocation
784 * HL_INFO_SECURED_ATTESTATION - Retrieve attestation report of the boot.
785 * HL_INFO_REGISTER_EVENTFD - Register eventfd for event notifications.
786 * HL_INFO_UNREGISTER_EVENTFD - Unregister eventfd
787 * HL_INFO_GET_EVENTS - Retrieve the last occurred events
788 * HL_INFO_UNDEFINED_OPCODE_EVENT - Retrieve last undefined opcode error information.
789 * HL_INFO_ENGINE_STATUS - Retrieve the status of all the h/w engines in the asic.
790 * HL_INFO_PAGE_FAULT_EVENT - Retrieve parameters of captured page fault.
791 * HL_INFO_USER_MAPPINGS - Retrieve user mappings, captured after page fault event.
792 * HL_INFO_FW_GENERIC_REQ - Send generic request to FW.
793 */
794#define HL_INFO_HW_IP_INFO 0
795#define HL_INFO_HW_EVENTS 1
796#define HL_INFO_DRAM_USAGE 2
797#define HL_INFO_HW_IDLE 3
798#define HL_INFO_DEVICE_STATUS 4
799#define HL_INFO_DEVICE_UTILIZATION 6
800#define HL_INFO_HW_EVENTS_AGGREGATE 7
801#define HL_INFO_CLK_RATE 8
802#define HL_INFO_RESET_COUNT 9
803#define HL_INFO_TIME_SYNC 10
804#define HL_INFO_CS_COUNTERS 11
805#define HL_INFO_PCI_COUNTERS 12
806#define HL_INFO_CLK_THROTTLE_REASON 13
807#define HL_INFO_SYNC_MANAGER 14
808#define HL_INFO_TOTAL_ENERGY 15
809#define HL_INFO_PLL_FREQUENCY 16
810#define HL_INFO_POWER 17
811#define HL_INFO_OPEN_STATS 18
812#define HL_INFO_DRAM_REPLACED_ROWS 21
813#define HL_INFO_DRAM_PENDING_ROWS 22
814#define HL_INFO_LAST_ERR_OPEN_DEV_TIME 23
815#define HL_INFO_CS_TIMEOUT_EVENT 24
816#define HL_INFO_RAZWI_EVENT 25
817#define HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES 26
818#define HL_INFO_SECURED_ATTESTATION 27
819#define HL_INFO_REGISTER_EVENTFD 28
820#define HL_INFO_UNREGISTER_EVENTFD 29
821#define HL_INFO_GET_EVENTS 30
822#define HL_INFO_UNDEFINED_OPCODE_EVENT 31
823#define HL_INFO_ENGINE_STATUS 32
824#define HL_INFO_PAGE_FAULT_EVENT 33
825#define HL_INFO_USER_MAPPINGS 34
826#define HL_INFO_FW_GENERIC_REQ 35
827
828#define HL_INFO_VERSION_MAX_LEN 128
829#define HL_INFO_CARD_NAME_MAX_LEN 16
830
831/* Maximum buffer size for retrieving engines status */
832#define HL_ENGINES_DATA_MAX_SIZE SZ_1M
833
834/**
835 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
836 * @sram_base_address: The first SRAM physical base address that is free to be
837 * used by the user.
838 * @dram_base_address: The first DRAM virtual or physical base address that is
839 * free to be used by the user.
840 * @dram_size: The DRAM size that is available to the user.
841 * @sram_size: The SRAM size that is available to the user.
842 * @num_of_events: The number of events that can be received from the f/w. This
843 * is needed so the user can what is the size of the h/w events
844 * array he needs to pass to the kernel when he wants to fetch
845 * the event counters.
846 * @device_id: PCI device ID of the ASIC.
847 * @module_id: Module ID of the ASIC for mezzanine cards in servers
848 * (From OCP spec).
849 * @decoder_enabled_mask: Bit-mask that represents which decoders are enabled.
850 * @first_available_interrupt_id: The first available interrupt ID for the user
851 * to be used when it works with user interrupts.
852 * Relevant for Gaudi2 and later.
853 * @server_type: Server type that the Gaudi ASIC is currently installed in.
854 * The value is according to enum hl_server_type
855 * @cpld_version: CPLD version on the board.
856 * @psoc_pci_pll_nr: PCI PLL NR value. Needed by the profiler in some ASICs.
857 * @psoc_pci_pll_nf: PCI PLL NF value. Needed by the profiler in some ASICs.
858 * @psoc_pci_pll_od: PCI PLL OD value. Needed by the profiler in some ASICs.
859 * @psoc_pci_pll_div_factor: PCI PLL DIV factor value. Needed by the profiler
860 * in some ASICs.
861 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
862 * for Goya/Gaudi only.
863 * @dram_enabled: Whether the DRAM is enabled.
864 * @security_enabled: Whether security is enabled on device.
865 * @mme_master_slave_mode: Indicate whether the MME is working in master/slave
866 * configuration. Relevant for Greco and later.
867 * @cpucp_version: The CPUCP f/w version.
868 * @card_name: The card name as passed by the f/w.
869 * @tpc_enabled_mask_ext: Bit-mask that represents which TPCs are enabled.
870 * Relevant for Greco and later.
871 * @dram_page_size: The DRAM physical page size.
872 * @edma_enabled_mask: Bit-mask that represents which EDMAs are enabled.
873 * Relevant for Gaudi2 and later.
874 * @number_of_user_interrupts: The number of interrupts that are available to the userspace
875 * application to use. Relevant for Gaudi2 and later.
876 * @device_mem_alloc_default_page_size: default page size used in device memory allocation.
877 * @revision_id: PCI revision ID of the ASIC.
878 */
879struct hl_info_hw_ip_info {
880 __u64 sram_base_address;
881 __u64 dram_base_address;
882 __u64 dram_size;
883 __u32 sram_size;
884 __u32 num_of_events;
885 __u32 device_id;
886 __u32 module_id;
887 __u32 decoder_enabled_mask;
888 __u16 first_available_interrupt_id;
889 __u16 server_type;
890 __u32 cpld_version;
891 __u32 psoc_pci_pll_nr;
892 __u32 psoc_pci_pll_nf;
893 __u32 psoc_pci_pll_od;
894 __u32 psoc_pci_pll_div_factor;
895 __u8 tpc_enabled_mask;
896 __u8 dram_enabled;
897 __u8 security_enabled;
898 __u8 mme_master_slave_mode;
899 __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN];
900 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
901 __u64 tpc_enabled_mask_ext;
902 __u64 dram_page_size;
903 __u32 edma_enabled_mask;
904 __u16 number_of_user_interrupts;
905 __u16 pad2;
906 __u64 reserved4;
907 __u64 device_mem_alloc_default_page_size;
908 __u64 reserved5;
909 __u64 reserved6;
910 __u32 reserved7;
911 __u8 reserved8;
912 __u8 revision_id;
913 __u8 pad[2];
914};
915
916struct hl_info_dram_usage {
917 __u64 dram_free_mem;
918 __u64 ctx_dram_mem;
919};
920
921#define HL_BUSY_ENGINES_MASK_EXT_SIZE 4
922
923struct hl_info_hw_idle {
924 __u32 is_idle;
925 /*
926 * Bitmask of busy engines.
927 * Bits definition is according to `enum <chip>_engine_id'.
928 */
929 __u32 busy_engines_mask;
930
931 /*
932 * Extended Bitmask of busy engines.
933 * Bits definition is according to `enum <chip>_engine_id'.
934 */
935 __u64 busy_engines_mask_ext[HL_BUSY_ENGINES_MASK_EXT_SIZE];
936};
937
938struct hl_info_device_status {
939 __u32 status;
940 __u32 pad;
941};
942
943struct hl_info_device_utilization {
944 __u32 utilization;
945 __u32 pad;
946};
947
948struct hl_info_clk_rate {
949 __u32 cur_clk_rate_mhz;
950 __u32 max_clk_rate_mhz;
951};
952
953struct hl_info_reset_count {
954 __u32 hard_reset_cnt;
955 __u32 soft_reset_cnt;
956};
957
958struct hl_info_time_sync {
959 __u64 device_time;
960 __u64 host_time;
961};
962
963/**
964 * struct hl_info_pci_counters - pci counters
965 * @rx_throughput: PCI rx throughput KBps
966 * @tx_throughput: PCI tx throughput KBps
967 * @replay_cnt: PCI replay counter
968 */
969struct hl_info_pci_counters {
970 __u64 rx_throughput;
971 __u64 tx_throughput;
972 __u64 replay_cnt;
973};
974
975enum hl_clk_throttling_type {
976 HL_CLK_THROTTLE_TYPE_POWER,
977 HL_CLK_THROTTLE_TYPE_THERMAL,
978 HL_CLK_THROTTLE_TYPE_MAX
979};
980
981/* clk_throttling_reason masks */
982#define HL_CLK_THROTTLE_POWER (1 << HL_CLK_THROTTLE_TYPE_POWER)
983#define HL_CLK_THROTTLE_THERMAL (1 << HL_CLK_THROTTLE_TYPE_THERMAL)
984
985/**
986 * struct hl_info_clk_throttle - clock throttling reason
987 * @clk_throttling_reason: each bit represents a clk throttling reason
988 * @clk_throttling_timestamp_us: represents CPU timestamp in microseconds of the start-event
989 * @clk_throttling_duration_ns: the clock throttle time in nanosec
990 */
991struct hl_info_clk_throttle {
992 __u32 clk_throttling_reason;
993 __u32 pad;
994 __u64 clk_throttling_timestamp_us[HL_CLK_THROTTLE_TYPE_MAX];
995 __u64 clk_throttling_duration_ns[HL_CLK_THROTTLE_TYPE_MAX];
996};
997
998/**
999 * struct hl_info_energy - device energy information
1000 * @total_energy_consumption: total device energy consumption
1001 */
1002struct hl_info_energy {
1003 __u64 total_energy_consumption;
1004};
1005
1006#define HL_PLL_NUM_OUTPUTS 4
1007
1008struct hl_pll_frequency_info {
1009 __u16 output[HL_PLL_NUM_OUTPUTS];
1010};
1011
1012/**
1013 * struct hl_open_stats_info - device open statistics information
1014 * @open_counter: ever growing counter, increased on each successful dev open
1015 * @last_open_period_ms: duration (ms) device was open last time
1016 * @is_compute_ctx_active: Whether there is an active compute context executing
1017 * @compute_ctx_in_release: true if the current compute context is being released
1018 */
1019struct hl_open_stats_info {
1020 __u64 open_counter;
1021 __u64 last_open_period_ms;
1022 __u8 is_compute_ctx_active;
1023 __u8 compute_ctx_in_release;
1024 __u8 pad[6];
1025};
1026
1027/**
1028 * struct hl_power_info - power information
1029 * @power: power consumption
1030 */
1031struct hl_power_info {
1032 __u64 power;
1033};
1034
1035/**
1036 * struct hl_info_sync_manager - sync manager information
1037 * @first_available_sync_object: first available sob
1038 * @first_available_monitor: first available monitor
1039 * @first_available_cq: first available cq
1040 */
1041struct hl_info_sync_manager {
1042 __u32 first_available_sync_object;
1043 __u32 first_available_monitor;
1044 __u32 first_available_cq;
1045 __u32 reserved;
1046};
1047
1048/**
1049 * struct hl_info_cs_counters - command submission counters
1050 * @total_out_of_mem_drop_cnt: total dropped due to memory allocation issue
1051 * @ctx_out_of_mem_drop_cnt: context dropped due to memory allocation issue
1052 * @total_parsing_drop_cnt: total dropped due to error in packet parsing
1053 * @ctx_parsing_drop_cnt: context dropped due to error in packet parsing
1054 * @total_queue_full_drop_cnt: total dropped due to queue full
1055 * @ctx_queue_full_drop_cnt: context dropped due to queue full
1056 * @total_device_in_reset_drop_cnt: total dropped due to device in reset
1057 * @ctx_device_in_reset_drop_cnt: context dropped due to device in reset
1058 * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight
1059 * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight
1060 * @total_validation_drop_cnt: total dropped due to validation error
1061 * @ctx_validation_drop_cnt: context dropped due to validation error
1062 */
1063struct hl_info_cs_counters {
1064 __u64 total_out_of_mem_drop_cnt;
1065 __u64 ctx_out_of_mem_drop_cnt;
1066 __u64 total_parsing_drop_cnt;
1067 __u64 ctx_parsing_drop_cnt;
1068 __u64 total_queue_full_drop_cnt;
1069 __u64 ctx_queue_full_drop_cnt;
1070 __u64 total_device_in_reset_drop_cnt;
1071 __u64 ctx_device_in_reset_drop_cnt;
1072 __u64 total_max_cs_in_flight_drop_cnt;
1073 __u64 ctx_max_cs_in_flight_drop_cnt;
1074 __u64 total_validation_drop_cnt;
1075 __u64 ctx_validation_drop_cnt;
1076};
1077
1078/**
1079 * struct hl_info_last_err_open_dev_time - last error boot information.
1080 * @timestamp: timestamp of last time the device was opened and error occurred.
1081 */
1082struct hl_info_last_err_open_dev_time {
1083 __s64 timestamp;
1084};
1085
1086/**
1087 * struct hl_info_cs_timeout_event - last CS timeout information.
1088 * @timestamp: timestamp when last CS timeout event occurred.
1089 * @seq: sequence number of last CS timeout event.
1090 */
1091struct hl_info_cs_timeout_event {
1092 __s64 timestamp;
1093 __u64 seq;
1094};
1095
1096#define HL_RAZWI_NA_ENG_ID U16_MAX
1097#define HL_RAZWI_MAX_NUM_OF_ENGINES_PER_RTR 128
1098#define HL_RAZWI_READ BIT(0)
1099#define HL_RAZWI_WRITE BIT(1)
1100#define HL_RAZWI_LBW BIT(2)
1101#define HL_RAZWI_HBW BIT(3)
1102#define HL_RAZWI_RR BIT(4)
1103#define HL_RAZWI_ADDR_DEC BIT(5)
1104
1105/**
1106 * struct hl_info_razwi_event - razwi information.
1107 * @timestamp: timestamp of razwi.
1108 * @addr: address which accessing it caused razwi.
1109 * @engine_id: engine id of the razwi initiator, if it was initiated by engine that does not
1110 * have engine id it will be set to HL_RAZWI_NA_ENG_ID. If there are several possible
1111 * engines which caused the razwi, it will hold all of them.
1112 * @num_of_possible_engines: contains number of possible engine ids. In some asics, razwi indication
1113 * might be common for several engines and there is no way to get the
1114 * exact engine. In this way, engine_id array will be filled with all
1115 * possible engines caused this razwi. Also, there might be possibility
1116 * in gaudi, where we don't indication on specific engine, in that case
1117 * the value of this parameter will be zero.
1118 * @flags: bitmask for additional data: HL_RAZWI_READ - razwi caused by read operation
1119 * HL_RAZWI_WRITE - razwi caused by write operation
1120 * HL_RAZWI_LBW - razwi caused by lbw fabric transaction
1121 * HL_RAZWI_HBW - razwi caused by hbw fabric transaction
1122 * HL_RAZWI_RR - razwi caused by range register
1123 * HL_RAZWI_ADDR_DEC - razwi caused by address decode error
1124 * Note: this data is not supported by all asics, in that case the relevant bits will not
1125 * be set.
1126 */
1127struct hl_info_razwi_event {
1128 __s64 timestamp;
1129 __u64 addr;
1130 __u16 engine_id[HL_RAZWI_MAX_NUM_OF_ENGINES_PER_RTR];
1131 __u16 num_of_possible_engines;
1132 __u8 flags;
1133 __u8 pad[5];
1134};
1135
1136#define MAX_QMAN_STREAMS_INFO 4
1137#define OPCODE_INFO_MAX_ADDR_SIZE 8
1138/**
1139 * struct hl_info_undefined_opcode_event - info about last undefined opcode error
1140 * @timestamp: timestamp of the undefined opcode error
1141 * @cb_addr_streams: CB addresses (per stream) that are currently exists in the PQ
1142 * entries. In case all streams array entries are
1143 * filled with values, it means the execution was in Lower-CP.
1144 * @cq_addr: the address of the current handled command buffer
1145 * @cq_size: the size of the current handled command buffer
1146 * @cb_addr_streams_len: num of streams - actual len of cb_addr_streams array.
1147 * should be equal to 1 in case of undefined opcode
1148 * in Upper-CP (specific stream) and equal to 4 incase
1149 * of undefined opcode in Lower-CP.
1150 * @engine_id: engine-id that the error occurred on
1151 * @stream_id: the stream id the error occurred on. In case the stream equals to
1152 * MAX_QMAN_STREAMS_INFO it means the error occurred on a Lower-CP.
1153 */
1154struct hl_info_undefined_opcode_event {
1155 __s64 timestamp;
1156 __u64 cb_addr_streams[MAX_QMAN_STREAMS_INFO][OPCODE_INFO_MAX_ADDR_SIZE];
1157 __u64 cq_addr;
1158 __u32 cq_size;
1159 __u32 cb_addr_streams_len;
1160 __u32 engine_id;
1161 __u32 stream_id;
1162};
1163
1164/**
1165 * struct hl_info_dev_memalloc_page_sizes - valid page sizes in device mem alloc information.
1166 * @page_order_bitmask: bitmap in which a set bit represents the order of the supported page size
1167 * (e.g. 0x2100000 means that 1MB and 32MB pages are supported).
1168 */
1169struct hl_info_dev_memalloc_page_sizes {
1170 __u64 page_order_bitmask;
1171};
1172
1173#define SEC_PCR_DATA_BUF_SZ 256
1174#define SEC_PCR_QUOTE_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1175#define SEC_SIGNATURE_BUF_SZ 255 /* (256 - 1) 1 byte used for size */
1176#define SEC_PUB_DATA_BUF_SZ 510 /* (512 - 2) 2 bytes used for size */
1177#define SEC_CERTIFICATE_BUF_SZ 2046 /* (2048 - 2) 2 bytes used for size */
1178
1179/*
1180 * struct hl_info_sec_attest - attestation report of the boot
1181 * @nonce: number only used once. random number provided by host. this also passed to the quote
1182 * command as a qualifying data.
1183 * @pcr_quote_len: length of the attestation quote data (bytes)
1184 * @pub_data_len: length of the public data (bytes)
1185 * @certificate_len: length of the certificate (bytes)
1186 * @pcr_num_reg: number of PCR registers in the pcr_data array
1187 * @pcr_reg_len: length of each PCR register in the pcr_data array (bytes)
1188 * @quote_sig_len: length of the attestation report signature (bytes)
1189 * @pcr_data: raw values of the PCR registers
1190 * @pcr_quote: attestation report data structure
1191 * @quote_sig: signature structure of the attestation report
1192 * @public_data: public key for the signed attestation
1193 * (outPublic + name + qualifiedName)
1194 * @certificate: certificate for the attestation signing key
1195 */
1196struct hl_info_sec_attest {
1197 __u32 nonce;
1198 __u16 pcr_quote_len;
1199 __u16 pub_data_len;
1200 __u16 certificate_len;
1201 __u8 pcr_num_reg;
1202 __u8 pcr_reg_len;
1203 __u8 quote_sig_len;
1204 __u8 pcr_data[SEC_PCR_DATA_BUF_SZ];
1205 __u8 pcr_quote[SEC_PCR_QUOTE_BUF_SZ];
1206 __u8 quote_sig[SEC_SIGNATURE_BUF_SZ];
1207 __u8 public_data[SEC_PUB_DATA_BUF_SZ];
1208 __u8 certificate[SEC_CERTIFICATE_BUF_SZ];
1209 __u8 pad0[2];
1210};
1211
1212/**
1213 * struct hl_page_fault_info - page fault information.
1214 * @timestamp: timestamp of page fault.
1215 * @addr: address which accessing it caused page fault.
1216 * @engine_id: engine id which caused the page fault, supported only in gaudi3.
1217 */
1218struct hl_page_fault_info {
1219 __s64 timestamp;
1220 __u64 addr;
1221 __u16 engine_id;
1222 __u8 pad[6];
1223};
1224
1225/**
1226 * struct hl_user_mapping - user mapping information.
1227 * @dev_va: device virtual address.
1228 * @size: virtual address mapping size.
1229 */
1230struct hl_user_mapping {
1231 __u64 dev_va;
1232 __u64 size;
1233};
1234
1235enum gaudi_dcores {
1236 HL_GAUDI_WS_DCORE,
1237 HL_GAUDI_WN_DCORE,
1238 HL_GAUDI_EN_DCORE,
1239 HL_GAUDI_ES_DCORE
1240};
1241
1242/**
1243 * struct hl_info_args - Main structure to retrieve device related information.
1244 * @return_pointer: User space address of the relevant structure related to HL_INFO_* operation
1245 * mentioned in @op.
1246 * @return_size: Size of the structure used in @return_pointer, just like "size" in "snprintf", it
1247 * limits how many bytes the kernel can write. For hw_events array, the size should be
1248 * hl_info_hw_ip_info.num_of_events * sizeof(__u32).
1249 * @op: Defines which type of information to be retrieved. Refer HL_INFO_* for details.
1250 * @dcore_id: DCORE id for which the information is relevant (for Gaudi refer to enum gaudi_dcores).
1251 * @ctx_id: Context ID of the user. Currently not in use.
1252 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
1253 * resolution. Currently not in use.
1254 * @pll_index: Index as defined in hl_<asic type>_pll_index enumeration.
1255 * @eventfd: event file descriptor for event notifications.
1256 * @user_buffer_actual_size: Actual data size which was copied to user allocated buffer by the
1257 * driver. It is possible for the user to allocate buffer larger than
1258 * needed, hence updating this variable so user will know the exact amount
1259 * of bytes copied by the kernel to the buffer.
1260 * @sec_attest_nonce: Nonce number used for attestation report.
1261 * @array_size: Number of array members copied to user buffer.
1262 * Relevant for HL_INFO_USER_MAPPINGS info ioctl.
1263 * @fw_sub_opcode: generic requests sub opcodes.
1264 * @pad: Padding to 64 bit.
1265 */
1266struct hl_info_args {
1267 __u64 return_pointer;
1268 __u32 return_size;
1269 __u32 op;
1270
1271 union {
1272 __u32 dcore_id;
1273 __u32 ctx_id;
1274 __u32 period_ms;
1275 __u32 pll_index;
1276 __u32 eventfd;
1277 __u32 user_buffer_actual_size;
1278 __u32 sec_attest_nonce;
1279 __u32 array_size;
1280 __u32 fw_sub_opcode;
1281 };
1282
1283 __u32 pad;
1284};
1285
1286/* Opcode to create a new command buffer */
1287#define HL_CB_OP_CREATE 0
1288/* Opcode to destroy previously created command buffer */
1289#define HL_CB_OP_DESTROY 1
1290/* Opcode to retrieve information about a command buffer */
1291#define HL_CB_OP_INFO 2
1292
1293/* 2MB minus 32 bytes for 2xMSG_PROT */
1294#define HL_MAX_CB_SIZE (0x200000 - 32)
1295
1296/* Indicates whether the command buffer should be mapped to the device's MMU */
1297#define HL_CB_FLAGS_MAP 0x1
1298
1299/* Used with HL_CB_OP_INFO opcode to get the device va address for kernel mapped CB */
1300#define HL_CB_FLAGS_GET_DEVICE_VA 0x2
1301
1302struct hl_cb_in {
1303 /* Handle of CB or 0 if we want to create one */
1304 __u64 cb_handle;
1305 /* HL_CB_OP_* */
1306 __u32 op;
1307
1308 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
1309 * will be allocated, regardless of this parameter's value, is PAGE_SIZE
1310 */
1311 __u32 cb_size;
1312
1313 /* Context ID - Currently not in use */
1314 __u32 ctx_id;
1315 /* HL_CB_FLAGS_* */
1316 __u32 flags;
1317};
1318
1319struct hl_cb_out {
1320 union {
1321 /* Handle of CB */
1322 __u64 cb_handle;
1323
1324 union {
1325 /* Information about CB */
1326 struct {
1327 /* Usage count of CB */
1328 __u32 usage_cnt;
1329 __u32 pad;
1330 };
1331
1332 /* CB mapped address to device MMU */
1333 __u64 device_va;
1334 };
1335 };
1336};
1337
1338union hl_cb_args {
1339 struct hl_cb_in in;
1340 struct hl_cb_out out;
1341};
1342
1343/* HL_CS_CHUNK_FLAGS_ values
1344 *
1345 * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB:
1346 * Indicates if the CB was allocated and mapped by userspace
1347 * (relevant to greco and above). User allocated CB is a command buffer,
1348 * allocated by the user, via malloc (or similar). After allocating the
1349 * CB, the user invokes - “memory ioctl” to map the user memory into a
1350 * device virtual address. The user provides this address via the
1351 * cb_handle field. The interface provides the ability to create a
1352 * large CBs, Which aren’t limited to “HL_MAX_CB_SIZE”. Therefore, it
1353 * increases the PCI-DMA queues throughput. This CB allocation method
1354 * also reduces the use of Linux DMA-able memory pool. Which are limited
1355 * and used by other Linux sub-systems.
1356 */
1357#define HL_CS_CHUNK_FLAGS_USER_ALLOC_CB 0x1
1358
1359/*
1360 * This structure size must always be fixed to 64-bytes for backward
1361 * compatibility
1362 */
1363struct hl_cs_chunk {
1364 union {
1365 /* Goya/Gaudi:
1366 * For external queue, this represents a Handle of CB on the
1367 * Host.
1368 * For internal queue in Goya, this represents an SRAM or
1369 * a DRAM address of the internal CB. In Gaudi, this might also
1370 * represent a mapped host address of the CB.
1371 *
1372 * Greco onwards:
1373 * For H/W queue, this represents either a Handle of CB on the
1374 * Host, or an SRAM, a DRAM, or a mapped host address of the CB.
1375 *
1376 * A mapped host address is in the device address space, after
1377 * a host address was mapped by the device MMU.
1378 */
1379 __u64 cb_handle;
1380
1381 /* Relevant only when HL_CS_FLAGS_WAIT or
1382 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
1383 * This holds address of array of u64 values that contain
1384 * signal CS sequence numbers. The wait described by
1385 * this job will listen on all those signals
1386 * (wait event per signal)
1387 */
1388 __u64 signal_seq_arr;
1389
1390 /*
1391 * Relevant only when HL_CS_FLAGS_WAIT or
1392 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
1393 * along with HL_CS_FLAGS_ENCAP_SIGNALS.
1394 * This is the CS sequence which has the encapsulated signals.
1395 */
1396 __u64 encaps_signal_seq;
1397 };
1398
1399 /* Index of queue to put the CB on */
1400 __u32 queue_index;
1401
1402 union {
1403 /*
1404 * Size of command buffer with valid packets
1405 * Can be smaller then actual CB size
1406 */
1407 __u32 cb_size;
1408
1409 /* Relevant only when HL_CS_FLAGS_WAIT or
1410 * HL_CS_FLAGS_COLLECTIVE_WAIT is set.
1411 * Number of entries in signal_seq_arr
1412 */
1413 __u32 num_signal_seq_arr;
1414
1415 /* Relevant only when HL_CS_FLAGS_WAIT or
1416 * HL_CS_FLAGS_COLLECTIVE_WAIT is set along
1417 * with HL_CS_FLAGS_ENCAP_SIGNALS
1418 * This set the signals range that the user want to wait for
1419 * out of the whole reserved signals range.
1420 * e.g if the signals range is 20, and user don't want
1421 * to wait for signal 8, so he set this offset to 7, then
1422 * he call the API again with 9 and so on till 20.
1423 */
1424 __u32 encaps_signal_offset;
1425 };
1426
1427 /* HL_CS_CHUNK_FLAGS_* */
1428 __u32 cs_chunk_flags;
1429
1430 /* Relevant only when HL_CS_FLAGS_COLLECTIVE_WAIT is set.
1431 * This holds the collective engine ID. The wait described by this job
1432 * will sync with this engine and with all NICs before completion.
1433 */
1434 __u32 collective_engine_id;
1435
1436 /* Align structure to 64 bytes */
1437 __u32 pad[10];
1438};
1439
1440/* SIGNAL/WAIT/COLLECTIVE_WAIT flags are mutually exclusive */
1441#define HL_CS_FLAGS_FORCE_RESTORE 0x1
1442#define HL_CS_FLAGS_SIGNAL 0x2
1443#define HL_CS_FLAGS_WAIT 0x4
1444#define HL_CS_FLAGS_COLLECTIVE_WAIT 0x8
1445
1446#define HL_CS_FLAGS_TIMESTAMP 0x20
1447#define HL_CS_FLAGS_STAGED_SUBMISSION 0x40
1448#define HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 0x80
1449#define HL_CS_FLAGS_STAGED_SUBMISSION_LAST 0x100
1450#define HL_CS_FLAGS_CUSTOM_TIMEOUT 0x200
1451#define HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT 0x400
1452
1453/*
1454 * The encapsulated signals CS is merged into the existing CS ioctls.
1455 * In order to use this feature need to follow the below procedure:
1456 * 1. Reserve signals, set the CS type to HL_CS_FLAGS_RESERVE_SIGNALS_ONLY
1457 * the output of this API will be the SOB offset from CFG_BASE.
1458 * this address will be used to patch CB cmds to do the signaling for this
1459 * SOB by incrementing it's value.
1460 * for reverting the reservation use HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY
1461 * CS type, note that this might fail if out-of-sync happened to the SOB
1462 * value, in case other signaling request to the same SOB occurred between
1463 * reserve-unreserve calls.
1464 * 2. Use the staged CS to do the encapsulated signaling jobs.
1465 * use HL_CS_FLAGS_STAGED_SUBMISSION and HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
1466 * along with HL_CS_FLAGS_ENCAP_SIGNALS flag, and set encaps_signal_offset
1467 * field. This offset allows app to wait on part of the reserved signals.
1468 * 3. Use WAIT/COLLECTIVE WAIT CS along with HL_CS_FLAGS_ENCAP_SIGNALS flag
1469 * to wait for the encapsulated signals.
1470 */
1471#define HL_CS_FLAGS_ENCAP_SIGNALS 0x800
1472#define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000
1473#define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000
1474
1475/*
1476 * The engine cores CS is merged into the existing CS ioctls.
1477 * Use it to control the engine cores mode.
1478 */
1479#define HL_CS_FLAGS_ENGINE_CORE_COMMAND 0x4000
1480
1481/*
1482 * The flush HBW PCI writes is merged into the existing CS ioctls.
1483 * Used to flush all HBW PCI writes.
1484 * This is a blocking operation and for this reason the user shall not use
1485 * the return sequence number (which will be invalid anyway)
1486 */
1487#define HL_CS_FLAGS_FLUSH_PCI_HBW_WRITES 0x8000
1488
1489#define HL_CS_STATUS_SUCCESS 0
1490
1491#define HL_MAX_JOBS_PER_CS 512
1492
1493/* HL_ENGINE_CORE_ values
1494 *
1495 * HL_ENGINE_CORE_HALT: engine core halt
1496 * HL_ENGINE_CORE_RUN: engine core run
1497 */
1498#define HL_ENGINE_CORE_HALT (1 << 0)
1499#define HL_ENGINE_CORE_RUN (1 << 1)
1500
1501struct hl_cs_in {
1502
1503 union {
1504 struct {
1505 /* this holds address of array of hl_cs_chunk for restore phase */
1506 __u64 chunks_restore;
1507
1508 /* holds address of array of hl_cs_chunk for execution phase */
1509 __u64 chunks_execute;
1510 };
1511
1512 /* Valid only when HL_CS_FLAGS_ENGINE_CORE_COMMAND is set */
1513 struct {
1514 /* this holds address of array of uint32 for engine_cores */
1515 __u64 engine_cores;
1516
1517 /* number of engine cores in engine_cores array */
1518 __u32 num_engine_cores;
1519
1520 /* the core command to be sent towards engine cores */
1521 __u32 core_command;
1522 };
1523 };
1524
1525 union {
1526 /*
1527 * Sequence number of a staged submission CS
1528 * valid only if HL_CS_FLAGS_STAGED_SUBMISSION is set and
1529 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST is unset.
1530 */
1531 __u64 seq;
1532
1533 /*
1534 * Encapsulated signals handle id
1535 * Valid for two flows:
1536 * 1. CS with encapsulated signals:
1537 * when HL_CS_FLAGS_STAGED_SUBMISSION and
1538 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
1539 * and HL_CS_FLAGS_ENCAP_SIGNALS are set.
1540 * 2. unreserve signals:
1541 * valid when HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY is set.
1542 */
1543 __u32 encaps_sig_handle_id;
1544
1545 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
1546 struct {
1547 /* Encapsulated signals number */
1548 __u32 encaps_signals_count;
1549
1550 /* Encapsulated signals queue index (stream) */
1551 __u32 encaps_signals_q_idx;
1552 };
1553 };
1554
1555 /* Number of chunks in restore phase array. Maximum number is
1556 * HL_MAX_JOBS_PER_CS
1557 */
1558 __u32 num_chunks_restore;
1559
1560 /* Number of chunks in execution array. Maximum number is
1561 * HL_MAX_JOBS_PER_CS
1562 */
1563 __u32 num_chunks_execute;
1564
1565 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
1566 * is set
1567 */
1568 __u32 timeout;
1569
1570 /* HL_CS_FLAGS_* */
1571 __u32 cs_flags;
1572
1573 /* Context ID - Currently not in use */
1574 __u32 ctx_id;
1575 __u8 pad[4];
1576};
1577
1578struct hl_cs_out {
1579 union {
1580 /*
1581 * seq holds the sequence number of the CS to pass to wait
1582 * ioctl. All values are valid except for 0 and ULLONG_MAX
1583 */
1584 __u64 seq;
1585
1586 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
1587 struct {
1588 /* This is the reserved signal handle id */
1589 __u32 handle_id;
1590
1591 /* This is the signals count */
1592 __u32 count;
1593 };
1594 };
1595
1596 /* HL_CS_STATUS */
1597 __u32 status;
1598
1599 /*
1600 * SOB base address offset
1601 * Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY or HL_CS_FLAGS_SIGNAL is set
1602 */
1603 __u32 sob_base_addr_offset;
1604
1605 /*
1606 * Count of completed signals in SOB before current signal submission.
1607 * Valid only when (HL_CS_FLAGS_ENCAP_SIGNALS & HL_CS_FLAGS_STAGED_SUBMISSION)
1608 * or HL_CS_FLAGS_SIGNAL is set
1609 */
1610 __u16 sob_count_before_submission;
1611 __u16 pad[3];
1612};
1613
1614union hl_cs_args {
1615 struct hl_cs_in in;
1616 struct hl_cs_out out;
1617};
1618
1619#define HL_WAIT_CS_FLAGS_INTERRUPT 0x2
1620#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
1621#define HL_WAIT_CS_FLAGS_ANY_CQ_INTERRUPT 0xFFF00000
1622#define HL_WAIT_CS_FLAGS_ANY_DEC_INTERRUPT 0xFFE00000
1623#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
1624#define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10
1625#define HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT 0x20
1626
1627#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
1628
1629struct hl_wait_cs_in {
1630 union {
1631 struct {
1632 /*
1633 * In case of wait_cs holds the CS sequence number.
1634 * In case of wait for multi CS hold a user pointer to
1635 * an array of CS sequence numbers
1636 */
1637 __u64 seq;
1638 /* Absolute timeout to wait for command submission
1639 * in microseconds
1640 */
1641 __u64 timeout_us;
1642 };
1643
1644 struct {
1645 union {
1646 /* User address for completion comparison.
1647 * upon interrupt, driver will compare the value pointed
1648 * by this address with the supplied target value.
1649 * in order not to perform any comparison, set address
1650 * to all 1s.
1651 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
1652 */
1653 __u64 addr;
1654
1655 /* cq_counters_handle to a kernel mapped cb which contains
1656 * cq counters.
1657 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set
1658 */
1659 __u64 cq_counters_handle;
1660 };
1661
1662 /* Target value for completion comparison */
1663 __u64 target;
1664 };
1665 };
1666
1667 /* Context ID - Currently not in use */
1668 __u32 ctx_id;
1669
1670 /* HL_WAIT_CS_FLAGS_*
1671 * If HL_WAIT_CS_FLAGS_INTERRUPT is set, this field should include
1672 * interrupt id according to HL_WAIT_CS_FLAGS_INTERRUPT_MASK
1673 *
1674 * in order to wait for any CQ interrupt, set interrupt value to
1675 * HL_WAIT_CS_FLAGS_ANY_CQ_INTERRUPT.
1676 *
1677 * in order to wait for any decoder interrupt, set interrupt value to
1678 * HL_WAIT_CS_FLAGS_ANY_DEC_INTERRUPT.
1679 */
1680 __u32 flags;
1681
1682 union {
1683 struct {
1684 /* Multi CS API info- valid entries in multi-CS array */
1685 __u8 seq_arr_len;
1686 __u8 pad[7];
1687 };
1688
1689 /* Absolute timeout to wait for an interrupt in microseconds.
1690 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
1691 */
1692 __u64 interrupt_timeout_us;
1693 };
1694
1695 /*
1696 * cq counter offset inside the counters cb pointed by cq_counters_handle above.
1697 * upon interrupt, driver will compare the value pointed
1698 * by this address (cq_counters_handle + cq_counters_offset)
1699 * with the supplied target value.
1700 * relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set
1701 */
1702 __u64 cq_counters_offset;
1703
1704 /*
1705 * Timestamp_handle timestamps buffer handle.
1706 * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set
1707 */
1708 __u64 timestamp_handle;
1709
1710 /*
1711 * Timestamp_offset is offset inside the timestamp buffer pointed by timestamp_handle above.
1712 * upon interrupt, if the cq reached the target value then driver will write
1713 * timestamp to this offset.
1714 * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set
1715 */
1716 __u64 timestamp_offset;
1717};
1718
1719#define HL_WAIT_CS_STATUS_COMPLETED 0
1720#define HL_WAIT_CS_STATUS_BUSY 1
1721#define HL_WAIT_CS_STATUS_TIMEDOUT 2
1722#define HL_WAIT_CS_STATUS_ABORTED 3
1723
1724#define HL_WAIT_CS_STATUS_FLAG_GONE 0x1
1725#define HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD 0x2
1726
1727struct hl_wait_cs_out {
1728 /* HL_WAIT_CS_STATUS_* */
1729 __u32 status;
1730 /* HL_WAIT_CS_STATUS_FLAG* */
1731 __u32 flags;
1732 /*
1733 * valid only if HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD is set
1734 * for wait_cs: timestamp of CS completion
1735 * for wait_multi_cs: timestamp of FIRST CS completion
1736 */
1737 __s64 timestamp_nsec;
1738 /* multi CS completion bitmap */
1739 __u32 cs_completion_map;
1740 __u32 pad;
1741};
1742
1743union hl_wait_cs_args {
1744 struct hl_wait_cs_in in;
1745 struct hl_wait_cs_out out;
1746};
1747
1748/* Opcode to allocate device memory */
1749#define HL_MEM_OP_ALLOC 0
1750
1751/* Opcode to free previously allocated device memory */
1752#define HL_MEM_OP_FREE 1
1753
1754/* Opcode to map host and device memory */
1755#define HL_MEM_OP_MAP 2
1756
1757/* Opcode to unmap previously mapped host and device memory */
1758#define HL_MEM_OP_UNMAP 3
1759
1760/* Opcode to map a hw block */
1761#define HL_MEM_OP_MAP_BLOCK 4
1762
1763/* Opcode to create DMA-BUF object for an existing device memory allocation
1764 * and to export an FD of that DMA-BUF back to the caller
1765 */
1766#define HL_MEM_OP_EXPORT_DMABUF_FD 5
1767
1768/* Opcode to create timestamps pool for user interrupts registration support
1769 * The memory will be allocated by the kernel driver, A timestamp buffer which the user
1770 * will get handle to it for mmap, and another internal buffer used by the
1771 * driver for registration management
1772 * The memory will be freed when the user closes the file descriptor(ctx close)
1773 */
1774#define HL_MEM_OP_TS_ALLOC 6
1775
1776/* Memory flags */
1777#define HL_MEM_CONTIGUOUS 0x1
1778#define HL_MEM_SHARED 0x2
1779#define HL_MEM_USERPTR 0x4
1780#define HL_MEM_FORCE_HINT 0x8
1781#define HL_MEM_PREFETCH 0x40
1782
1783/**
1784 * structure hl_mem_in - structure that handle input args for memory IOCTL
1785 * @union arg: union of structures to be used based on the input operation
1786 * @op: specify the requested memory operation (one of the HL_MEM_OP_* definitions).
1787 * @flags: flags for the memory operation (one of the HL_MEM_* definitions).
1788 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the DMA-BUF file/FD flags.
1789 * @ctx_id: context ID - currently not in use.
1790 * @num_of_elements: number of timestamp elements used only with HL_MEM_OP_TS_ALLOC opcode.
1791 */
1792struct hl_mem_in {
1793 union {
1794 /**
1795 * structure for device memory allocation (used with the HL_MEM_OP_ALLOC op)
1796 * @mem_size: memory size to allocate
1797 * @page_size: page size to use on allocation. when the value is 0 the default page
1798 * size will be taken.
1799 */
1800 struct {
1801 __u64 mem_size;
1802 __u64 page_size;
1803 } alloc;
1804
1805 /**
1806 * structure for free-ing device memory (used with the HL_MEM_OP_FREE op)
1807 * @handle: handle returned from HL_MEM_OP_ALLOC
1808 */
1809 struct {
1810 __u64 handle;
1811 } free;
1812
1813 /**
1814 * structure for mapping device memory (used with the HL_MEM_OP_MAP op)
1815 * @hint_addr: requested virtual address of mapped memory.
1816 * the driver will try to map the requested region to this hint
1817 * address, as long as the address is valid and not already mapped.
1818 * the user should check the returned address of the IOCTL to make
1819 * sure he got the hint address.
1820 * passing 0 here means that the driver will choose the address itself.
1821 * @handle: handle returned from HL_MEM_OP_ALLOC.
1822 */
1823 struct {
1824 __u64 hint_addr;
1825 __u64 handle;
1826 } map_device;
1827
1828 /**
1829 * structure for mapping host memory (used with the HL_MEM_OP_MAP op)
1830 * @host_virt_addr: address of allocated host memory.
1831 * @hint_addr: requested virtual address of mapped memory.
1832 * the driver will try to map the requested region to this hint
1833 * address, as long as the address is valid and not already mapped.
1834 * the user should check the returned address of the IOCTL to make
1835 * sure he got the hint address.
1836 * passing 0 here means that the driver will choose the address itself.
1837 * @size: size of allocated host memory.
1838 */
1839 struct {
1840 __u64 host_virt_addr;
1841 __u64 hint_addr;
1842 __u64 mem_size;
1843 } map_host;
1844
1845 /**
1846 * structure for mapping hw block (used with the HL_MEM_OP_MAP_BLOCK op)
1847 * @block_addr:HW block address to map, a handle and size will be returned
1848 * to the user and will be used to mmap the relevant block.
1849 * only addresses from configuration space are allowed.
1850 */
1851 struct {
1852 __u64 block_addr;
1853 } map_block;
1854
1855 /**
1856 * structure for unmapping host memory (used with the HL_MEM_OP_UNMAP op)
1857 * @device_virt_addr: virtual address returned from HL_MEM_OP_MAP
1858 */
1859 struct {
1860 __u64 device_virt_addr;
1861 } unmap;
1862
1863 /**
1864 * structure for exporting DMABUF object (used with
1865 * the HL_MEM_OP_EXPORT_DMABUF_FD op)
1866 * @addr: for Gaudi1, the driver expects a physical address
1867 * inside the device's DRAM. this is because in Gaudi1
1868 * we don't have MMU that covers the device's DRAM.
1869 * for all other ASICs, the driver expects a device
1870 * virtual address that represents the start address of
1871 * a mapped DRAM memory area inside the device.
1872 * the address must be the same as was received from the
1873 * driver during a previous HL_MEM_OP_MAP operation.
1874 * @mem_size: size of memory to export.
1875 * @offset: for Gaudi1, this value must be 0. For all other ASICs,
1876 * the driver expects an offset inside of the memory area
1877 * describe by addr. the offset represents the start
1878 * address of that the exported dma-buf object describes.
1879 */
1880 struct {
1881 __u64 addr;
1882 __u64 mem_size;
1883 __u64 offset;
1884 } export_dmabuf_fd;
1885 };
1886
1887 __u32 op;
1888 __u32 flags;
1889 __u32 ctx_id;
1890 __u32 num_of_elements;
1891};
1892
1893struct hl_mem_out {
1894 union {
1895 /*
1896 * Used for HL_MEM_OP_MAP as the virtual address that was
1897 * assigned in the device VA space.
1898 * A value of 0 means the requested operation failed.
1899 */
1900 __u64 device_virt_addr;
1901
1902 /*
1903 * Used in HL_MEM_OP_ALLOC
1904 * This is the assigned handle for the allocated memory
1905 */
1906 __u64 handle;
1907
1908 struct {
1909 /*
1910 * Used in HL_MEM_OP_MAP_BLOCK.
1911 * This is the assigned handle for the mapped block
1912 */
1913 __u64 block_handle;
1914
1915 /*
1916 * Used in HL_MEM_OP_MAP_BLOCK
1917 * This is the size of the mapped block
1918 */
1919 __u32 block_size;
1920
1921 __u32 pad;
1922 };
1923
1924 /* Returned in HL_MEM_OP_EXPORT_DMABUF_FD. Represents the
1925 * DMA-BUF object that was created to describe a memory
1926 * allocation on the device's memory space. The FD should be
1927 * passed to the importer driver
1928 */
1929 __s32 fd;
1930 };
1931};
1932
1933union hl_mem_args {
1934 struct hl_mem_in in;
1935 struct hl_mem_out out;
1936};
1937
1938#define HL_DEBUG_MAX_AUX_VALUES 10
1939
1940struct hl_debug_params_etr {
1941 /* Address in memory to allocate buffer */
1942 __u64 buffer_address;
1943
1944 /* Size of buffer to allocate */
1945 __u64 buffer_size;
1946
1947 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1948 __u32 sink_mode;
1949 __u32 pad;
1950};
1951
1952struct hl_debug_params_etf {
1953 /* Address in memory to allocate buffer */
1954 __u64 buffer_address;
1955
1956 /* Size of buffer to allocate */
1957 __u64 buffer_size;
1958
1959 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1960 __u32 sink_mode;
1961 __u32 pad;
1962};
1963
1964struct hl_debug_params_stm {
1965 /* Two bit masks for HW event and Stimulus Port */
1966 __u64 he_mask;
1967 __u64 sp_mask;
1968
1969 /* Trace source ID */
1970 __u32 id;
1971
1972 /* Frequency for the timestamp register */
1973 __u32 frequency;
1974};
1975
1976struct hl_debug_params_bmon {
1977 /* Two address ranges that the user can request to filter */
1978 __u64 start_addr0;
1979 __u64 addr_mask0;
1980
1981 __u64 start_addr1;
1982 __u64 addr_mask1;
1983
1984 /* Capture window configuration */
1985 __u32 bw_win;
1986 __u32 win_capture;
1987
1988 /* Trace source ID */
1989 __u32 id;
1990
1991 /* Control register */
1992 __u32 control;
1993
1994 /* Two more address ranges that the user can request to filter */
1995 __u64 start_addr2;
1996 __u64 end_addr2;
1997
1998 __u64 start_addr3;
1999 __u64 end_addr3;
2000};
2001
2002struct hl_debug_params_spmu {
2003 /* Event types selection */
2004 __u64 event_types[HL_DEBUG_MAX_AUX_VALUES];
2005
2006 /* Number of event types selection */
2007 __u32 event_types_num;
2008
2009 /* TRC configuration register values */
2010 __u32 pmtrc_val;
2011 __u32 trc_ctrl_host_val;
2012 __u32 trc_en_host_val;
2013};
2014
2015/* Opcode for ETR component */
2016#define HL_DEBUG_OP_ETR 0
2017/* Opcode for ETF component */
2018#define HL_DEBUG_OP_ETF 1
2019/* Opcode for STM component */
2020#define HL_DEBUG_OP_STM 2
2021/* Opcode for FUNNEL component */
2022#define HL_DEBUG_OP_FUNNEL 3
2023/* Opcode for BMON component */
2024#define HL_DEBUG_OP_BMON 4
2025/* Opcode for SPMU component */
2026#define HL_DEBUG_OP_SPMU 5
2027/* Opcode for timestamp (deprecated) */
2028#define HL_DEBUG_OP_TIMESTAMP 6
2029/* Opcode for setting the device into or out of debug mode. The enable
2030 * variable should be 1 for enabling debug mode and 0 for disabling it
2031 */
2032#define HL_DEBUG_OP_SET_MODE 7
2033
2034struct hl_debug_args {
2035 /*
2036 * Pointer to user input structure.
2037 * This field is relevant to specific opcodes.
2038 */
2039 __u64 input_ptr;
2040 /* Pointer to user output structure */
2041 __u64 output_ptr;
2042 /* Size of user input structure */
2043 __u32 input_size;
2044 /* Size of user output structure */
2045 __u32 output_size;
2046 /* HL_DEBUG_OP_* */
2047 __u32 op;
2048 /*
2049 * Register index in the component, taken from the debug_regs_index enum
2050 * in the various ASIC header files
2051 */
2052 __u32 reg_idx;
2053 /* Enable/disable */
2054 __u32 enable;
2055 /* Context ID - Currently not in use */
2056 __u32 ctx_id;
2057};
2058
2059/*
2060 * Various information operations such as:
2061 * - H/W IP information
2062 * - Current dram usage
2063 *
2064 * The user calls this IOCTL with an opcode that describes the required
2065 * information. The user should supply a pointer to a user-allocated memory
2066 * chunk, which will be filled by the driver with the requested information.
2067 *
2068 * The user supplies the maximum amount of size to copy into the user's memory,
2069 * in order to prevent data corruption in case of differences between the
2070 * definitions of structures in kernel and userspace, e.g. in case of old
2071 * userspace and new kernel driver
2072 */
2073#define HL_IOCTL_INFO \
2074 _IOWR('H', 0x01, struct hl_info_args)
2075
2076/*
2077 * Command Buffer
2078 * - Request a Command Buffer
2079 * - Destroy a Command Buffer
2080 *
2081 * The command buffers are memory blocks that reside in DMA-able address
2082 * space and are physically contiguous so they can be accessed by the device
2083 * directly. They are allocated using the coherent DMA API.
2084 *
2085 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
2086 * process needs to use that handle to mmap the buffer so it can access them.
2087 *
2088 * In some instances, the device must access the command buffer through the
2089 * device's MMU, and thus its memory should be mapped. In these cases, user can
2090 * indicate the driver that such a mapping is required.
2091 * The resulting device virtual address will be used internally by the driver,
2092 * and won't be returned to user.
2093 *
2094 */
2095#define HL_IOCTL_CB \
2096 _IOWR('H', 0x02, union hl_cb_args)
2097
2098/*
2099 * Command Submission
2100 *
2101 * To submit work to the device, the user need to call this IOCTL with a set
2102 * of JOBS. That set of JOBS constitutes a CS object.
2103 * Each JOB will be enqueued on a specific queue, according to the user's input.
2104 * There can be more then one JOB per queue.
2105 *
2106 * The CS IOCTL will receive two sets of JOBS. One set is for "restore" phase
2107 * and a second set is for "execution" phase.
2108 * The JOBS on the "restore" phase are enqueued only after context-switch
2109 * (or if its the first CS for this context). The user can also order the
2110 * driver to run the "restore" phase explicitly
2111 *
2112 * Goya/Gaudi:
2113 * There are two types of queues - external and internal. External queues
2114 * are DMA queues which transfer data from/to the Host. All other queues are
2115 * internal. The driver will get completion notifications from the device only
2116 * on JOBS which are enqueued in the external queues.
2117 *
2118 * Greco onwards:
2119 * There is a single type of queue for all types of engines, either DMA engines
2120 * for transfers from/to the host or inside the device, or compute engines.
2121 * The driver will get completion notifications from the device for all queues.
2122 *
2123 * For jobs on external queues, the user needs to create command buffers
2124 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
2125 * internal queues, the user needs to prepare a "command buffer" with packets
2126 * on either the device SRAM/DRAM or the host, and give the device address of
2127 * that buffer to the CS ioctl.
2128 * For jobs on H/W queues both options of command buffers are valid.
2129 *
2130 * This IOCTL is asynchronous in regard to the actual execution of the CS. This
2131 * means it returns immediately after ALL the JOBS were enqueued on their
2132 * relevant queues. Therefore, the user mustn't assume the CS has been completed
2133 * or has even started to execute.
2134 *
2135 * Upon successful enqueue, the IOCTL returns a sequence number which the user
2136 * can use with the "Wait for CS" IOCTL to check whether the handle's CS
2137 * non-internal JOBS have been completed. Note that if the CS has internal JOBS
2138 * which can execute AFTER the external JOBS have finished, the driver might
2139 * report that the CS has finished executing BEFORE the internal JOBS have
2140 * actually finished executing.
2141 *
2142 * Even though the sequence number increments per CS, the user can NOT
2143 * automatically assume that if CS with sequence number N finished, then CS
2144 * with sequence number N-1 also finished. The user can make this assumption if
2145 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
2146 * queues).
2147 */
2148#define HL_IOCTL_CS \
2149 _IOWR('H', 0x03, union hl_cs_args)
2150
2151/*
2152 * Wait for Command Submission
2153 *
2154 * The user can call this IOCTL with a handle it received from the CS IOCTL
2155 * to wait until the handle's CS has finished executing. The user will wait
2156 * inside the kernel until the CS has finished or until the user-requested
2157 * timeout has expired.
2158 *
2159 * If the timeout value is 0, the driver won't sleep at all. It will check
2160 * the status of the CS and return immediately
2161 *
2162 * The return value of the IOCTL is a standard Linux error code. The possible
2163 * values are:
2164 *
2165 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
2166 * that the user process received
2167 * ETIMEDOUT - The CS has caused a timeout on the device
2168 * EIO - The CS was aborted (usually because the device was reset)
2169 * ENODEV - The device wants to do hard-reset (so user need to close FD)
2170 *
2171 * The driver also returns a custom define in case the IOCTL call returned 0.
2172 * The define can be one of the following:
2173 *
2174 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
2175 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
2176 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
2177 * (ETIMEDOUT)
2178 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
2179 * device was reset (EIO)
2180 */
2181
2182#define HL_IOCTL_WAIT_CS \
2183 _IOWR('H', 0x04, union hl_wait_cs_args)
2184
2185/*
2186 * Memory
2187 * - Map host memory to device MMU
2188 * - Unmap host memory from device MMU
2189 *
2190 * This IOCTL allows the user to map host memory to the device MMU
2191 *
2192 * For host memory, the IOCTL doesn't allocate memory. The user is supposed
2193 * to allocate the memory in user-space (malloc/new). The driver pins the
2194 * physical pages (up to the allowed limit by the OS), assigns a virtual
2195 * address in the device VA space and initializes the device MMU.
2196 *
2197 * There is an option for the user to specify the requested virtual address.
2198 *
2199 */
2200#define HL_IOCTL_MEMORY \
2201 _IOWR('H', 0x05, union hl_mem_args)
2202
2203/*
2204 * Debug
2205 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
2206 *
2207 * This IOCTL allows the user to get debug traces from the chip.
2208 *
2209 * Before the user can send configuration requests of the various
2210 * debug/profile engines, it needs to set the device into debug mode.
2211 * This is because the debug/profile infrastructure is shared component in the
2212 * device and we can't allow multiple users to access it at the same time.
2213 *
2214 * Once a user set the device into debug mode, the driver won't allow other
2215 * users to "work" with the device, i.e. open a FD. If there are multiple users
2216 * opened on the device, the driver won't allow any user to debug the device.
2217 *
2218 * For each configuration request, the user needs to provide the register index
2219 * and essential data such as buffer address and size.
2220 *
2221 * Once the user has finished using the debug/profile engines, he should
2222 * set the device into non-debug mode, i.e. disable debug mode.
2223 *
2224 * The driver can decide to "kick out" the user if he abuses this interface.
2225 *
2226 */
2227#define HL_IOCTL_DEBUG \
2228 _IOWR('H', 0x06, struct hl_debug_args)
2229
2230#define HL_COMMAND_START 0x01
2231#define HL_COMMAND_END 0x07
2232
2233#endif /* HABANALABS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/i810_drm.h deleted-292
......@@ -1,292 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _I810_DRM_H_
3#define _I810_DRM_H_
4
5#include "drm.h"
6
7#if defined(__cplusplus)
8extern "C" {
9#endif
10
11/* WARNING: These defines must be the same as what the Xserver uses.
12 * if you change them, you must change the defines in the Xserver.
13 */
14
15#ifndef _I810_DEFINES_
16#define _I810_DEFINES_
17
18#define I810_DMA_BUF_ORDER 12
19#define I810_DMA_BUF_SZ (1<<I810_DMA_BUF_ORDER)
20#define I810_DMA_BUF_NR 256
21#define I810_NR_SAREA_CLIPRECTS 8
22
23/* Each region is a minimum of 64k, and there are at most 64 of them.
24 */
25#define I810_NR_TEX_REGIONS 64
26#define I810_LOG_MIN_TEX_REGION_SIZE 16
27#endif
28
29#define I810_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
30#define I810_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
31#define I810_UPLOAD_CTX 0x4
32#define I810_UPLOAD_BUFFERS 0x8
33#define I810_UPLOAD_TEX0 0x10
34#define I810_UPLOAD_TEX1 0x20
35#define I810_UPLOAD_CLIPRECTS 0x40
36
37/* Indices into buf.Setup where various bits of state are mirrored per
38 * context and per buffer. These can be fired at the card as a unit,
39 * or in a piecewise fashion as required.
40 */
41
42/* Destbuffer state
43 * - backbuffer linear offset and pitch -- invarient in the current dri
44 * - zbuffer linear offset and pitch -- also invarient
45 * - drawing origin in back and depth buffers.
46 *
47 * Keep the depth/back buffer state here to accommodate private buffers
48 * in the future.
49 */
50#define I810_DESTREG_DI0 0 /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
51#define I810_DESTREG_DI1 1
52#define I810_DESTREG_DV0 2 /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
53#define I810_DESTREG_DV1 3
54#define I810_DESTREG_DR0 4 /* GFX_OP_DRAWRECT_INFO (4 dwords) */
55#define I810_DESTREG_DR1 5
56#define I810_DESTREG_DR2 6
57#define I810_DESTREG_DR3 7
58#define I810_DESTREG_DR4 8
59#define I810_DEST_SETUP_SIZE 10
60
61/* Context state
62 */
63#define I810_CTXREG_CF0 0 /* GFX_OP_COLOR_FACTOR */
64#define I810_CTXREG_CF1 1
65#define I810_CTXREG_ST0 2 /* GFX_OP_STIPPLE */
66#define I810_CTXREG_ST1 3
67#define I810_CTXREG_VF 4 /* GFX_OP_VERTEX_FMT */
68#define I810_CTXREG_MT 5 /* GFX_OP_MAP_TEXELS */
69#define I810_CTXREG_MC0 6 /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
70#define I810_CTXREG_MC1 7 /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
71#define I810_CTXREG_MC2 8 /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
72#define I810_CTXREG_MA0 9 /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
73#define I810_CTXREG_MA1 10 /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
74#define I810_CTXREG_MA2 11 /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
75#define I810_CTXREG_SDM 12 /* GFX_OP_SRC_DEST_MONO */
76#define I810_CTXREG_FOG 13 /* GFX_OP_FOG_COLOR */
77#define I810_CTXREG_B1 14 /* GFX_OP_BOOL_1 */
78#define I810_CTXREG_B2 15 /* GFX_OP_BOOL_2 */
79#define I810_CTXREG_LCS 16 /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
80#define I810_CTXREG_PV 17 /* GFX_OP_PV_RULE -- Invarient! */
81#define I810_CTXREG_ZA 18 /* GFX_OP_ZBIAS_ALPHAFUNC */
82#define I810_CTXREG_AA 19 /* GFX_OP_ANTIALIAS */
83#define I810_CTX_SETUP_SIZE 20
84
85/* Texture state (per tex unit)
86 */
87#define I810_TEXREG_MI0 0 /* GFX_OP_MAP_INFO (4 dwords) */
88#define I810_TEXREG_MI1 1
89#define I810_TEXREG_MI2 2
90#define I810_TEXREG_MI3 3
91#define I810_TEXREG_MF 4 /* GFX_OP_MAP_FILTER */
92#define I810_TEXREG_MLC 5 /* GFX_OP_MAP_LOD_CTL */
93#define I810_TEXREG_MLL 6 /* GFX_OP_MAP_LOD_LIMITS */
94#define I810_TEXREG_MCS 7 /* GFX_OP_MAP_COORD_SETS ??? */
95#define I810_TEX_SETUP_SIZE 8
96
97/* Flags for clear ioctl
98 */
99#define I810_FRONT 0x1
100#define I810_BACK 0x2
101#define I810_DEPTH 0x4
102
103typedef enum _drm_i810_init_func {
104 I810_INIT_DMA = 0x01,
105 I810_CLEANUP_DMA = 0x02,
106 I810_INIT_DMA_1_4 = 0x03
107} drm_i810_init_func_t;
108
109/* This is the init structure after v1.2 */
110typedef struct _drm_i810_init {
111 drm_i810_init_func_t func;
112 unsigned int mmio_offset;
113 unsigned int buffers_offset;
114 int sarea_priv_offset;
115 unsigned int ring_start;
116 unsigned int ring_end;
117 unsigned int ring_size;
118 unsigned int front_offset;
119 unsigned int back_offset;
120 unsigned int depth_offset;
121 unsigned int overlay_offset;
122 unsigned int overlay_physical;
123 unsigned int w;
124 unsigned int h;
125 unsigned int pitch;
126 unsigned int pitch_bits;
127} drm_i810_init_t;
128
129/* This is the init structure prior to v1.2 */
130typedef struct _drm_i810_pre12_init {
131 drm_i810_init_func_t func;
132 unsigned int mmio_offset;
133 unsigned int buffers_offset;
134 int sarea_priv_offset;
135 unsigned int ring_start;
136 unsigned int ring_end;
137 unsigned int ring_size;
138 unsigned int front_offset;
139 unsigned int back_offset;
140 unsigned int depth_offset;
141 unsigned int w;
142 unsigned int h;
143 unsigned int pitch;
144 unsigned int pitch_bits;
145} drm_i810_pre12_init_t;
146
147/* Warning: If you change the SAREA structure you must change the Xserver
148 * structure as well */
149
150typedef struct _drm_i810_tex_region {
151 unsigned char next, prev; /* indices to form a circular LRU */
152 unsigned char in_use; /* owned by a client, or free? */
153 int age; /* tracked by clients to update local LRU's */
154} drm_i810_tex_region_t;
155
156typedef struct _drm_i810_sarea {
157 unsigned int ContextState[I810_CTX_SETUP_SIZE];
158 unsigned int BufferState[I810_DEST_SETUP_SIZE];
159 unsigned int TexState[2][I810_TEX_SETUP_SIZE];
160 unsigned int dirty;
161
162 unsigned int nbox;
163 struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
164
165 /* Maintain an LRU of contiguous regions of texture space. If
166 * you think you own a region of texture memory, and it has an
167 * age different to the one you set, then you are mistaken and
168 * it has been stolen by another client. If global texAge
169 * hasn't changed, there is no need to walk the list.
170 *
171 * These regions can be used as a proxy for the fine-grained
172 * texture information of other clients - by maintaining them
173 * in the same lru which is used to age their own textures,
174 * clients have an approximate lru for the whole of global
175 * texture space, and can make informed decisions as to which
176 * areas to kick out. There is no need to choose whether to
177 * kick out your own texture or someone else's - simply eject
178 * them all in LRU order.
179 */
180
181 drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
182 /* Last elt is sentinal */
183 int texAge; /* last time texture was uploaded */
184 int last_enqueue; /* last time a buffer was enqueued */
185 int last_dispatch; /* age of the most recently dispatched buffer */
186 int last_quiescent; /* */
187 int ctxOwner; /* last context to upload state */
188
189 int vertex_prim;
190
191 int pf_enabled; /* is pageflipping allowed? */
192 int pf_active;
193 int pf_current_page; /* which buffer is being displayed? */
194} drm_i810_sarea_t;
195
196/* WARNING: If you change any of these defines, make sure to change the
197 * defines in the Xserver file (xf86drmMga.h)
198 */
199
200/* i810 specific ioctls
201 * The device specific ioctl range is 0x40 to 0x79.
202 */
203#define DRM_I810_INIT 0x00
204#define DRM_I810_VERTEX 0x01
205#define DRM_I810_CLEAR 0x02
206#define DRM_I810_FLUSH 0x03
207#define DRM_I810_GETAGE 0x04
208#define DRM_I810_GETBUF 0x05
209#define DRM_I810_SWAP 0x06
210#define DRM_I810_COPY 0x07
211#define DRM_I810_DOCOPY 0x08
212#define DRM_I810_OV0INFO 0x09
213#define DRM_I810_FSTATUS 0x0a
214#define DRM_I810_OV0FLIP 0x0b
215#define DRM_I810_MC 0x0c
216#define DRM_I810_RSTATUS 0x0d
217#define DRM_I810_FLIP 0x0e
218
219#define DRM_IOCTL_I810_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
220#define DRM_IOCTL_I810_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
221#define DRM_IOCTL_I810_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
222#define DRM_IOCTL_I810_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_I810_FLUSH)
223#define DRM_IOCTL_I810_GETAGE DRM_IO( DRM_COMMAND_BASE + DRM_I810_GETAGE)
224#define DRM_IOCTL_I810_GETBUF DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
225#define DRM_IOCTL_I810_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_I810_SWAP)
226#define DRM_IOCTL_I810_COPY DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
227#define DRM_IOCTL_I810_DOCOPY DRM_IO( DRM_COMMAND_BASE + DRM_I810_DOCOPY)
228#define DRM_IOCTL_I810_OV0INFO DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
229#define DRM_IOCTL_I810_FSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS)
230#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
231#define DRM_IOCTL_I810_MC DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
232#define DRM_IOCTL_I810_RSTATUS DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS)
233#define DRM_IOCTL_I810_FLIP DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP)
234
235typedef struct _drm_i810_clear {
236 int clear_color;
237 int clear_depth;
238 int flags;
239} drm_i810_clear_t;
240
241/* These may be placeholders if we have more cliprects than
242 * I810_NR_SAREA_CLIPRECTS. In that case, the client sets discard to
243 * false, indicating that the buffer will be dispatched again with a
244 * new set of cliprects.
245 */
246typedef struct _drm_i810_vertex {
247 int idx; /* buffer index */
248 int used; /* nr bytes in use */
249 int discard; /* client is finished with the buffer? */
250} drm_i810_vertex_t;
251
252typedef struct _drm_i810_copy_t {
253 int idx; /* buffer index */
254 int used; /* nr bytes in use */
255 void *address; /* Address to copy from */
256} drm_i810_copy_t;
257
258#define PR_TRIANGLES (0x0<<18)
259#define PR_TRISTRIP_0 (0x1<<18)
260#define PR_TRISTRIP_1 (0x2<<18)
261#define PR_TRIFAN (0x3<<18)
262#define PR_POLYGON (0x4<<18)
263#define PR_LINES (0x5<<18)
264#define PR_LINESTRIP (0x6<<18)
265#define PR_RECTS (0x7<<18)
266#define PR_MASK (0x7<<18)
267
268typedef struct drm_i810_dma {
269 void *virtual;
270 int request_idx;
271 int request_size;
272 int granted;
273} drm_i810_dma_t;
274
275typedef struct _drm_i810_overlay_t {
276 unsigned int offset; /* Address of the Overlay Regs */
277 unsigned int physical;
278} drm_i810_overlay_t;
279
280typedef struct _drm_i810_mc {
281 int idx; /* buffer index */
282 int used; /* nr bytes in use */
283 int num_blocks; /* number of GFXBlocks */
284 int *length; /* List of lengths for GFXBlocks (FUTURE) */
285 unsigned int last_render; /* Last Render Request */
286} drm_i810_mc_t;
287
288#if defined(__cplusplus)
289}
290#endif
291
292#endif /* _I810_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/i915_drm.h+623-174
......@@ -154,25 +154,77 @@ enum i915_mocs_table_index {
154154 I915_MOCS_CACHED,
155155};
156156
157/*
157/**
158 * enum drm_i915_gem_engine_class - uapi engine type enumeration
159 *
158160 * Different engines serve different roles, and there may be more than one
159 * engine serving each role. enum drm_i915_gem_engine_class provides a
160 * classification of the role of the engine, which may be used when requesting
161 * operations to be performed on a certain subset of engines, or for providing
162 * information about that group.
161 * engine serving each role. This enum provides a classification of the role
162 * of the engine, which may be used when requesting operations to be performed
163 * on a certain subset of engines, or for providing information about that
164 * group.
163165 */
164166enum drm_i915_gem_engine_class {
167 /**
168 * @I915_ENGINE_CLASS_RENDER:
169 *
170 * Render engines support instructions used for 3D, Compute (GPGPU),
171 * and programmable media workloads. These instructions fetch data and
172 * dispatch individual work items to threads that operate in parallel.
173 * The threads run small programs (called "kernels" or "shaders") on
174 * the GPU's execution units (EUs).
175 */
165176 I915_ENGINE_CLASS_RENDER = 0,
177
178 /**
179 * @I915_ENGINE_CLASS_COPY:
180 *
181 * Copy engines (also referred to as "blitters") support instructions
182 * that move blocks of data from one location in memory to another,
183 * or that fill a specified location of memory with fixed data.
184 * Copy engines can perform pre-defined logical or bitwise operations
185 * on the source, destination, or pattern data.
186 */
166187 I915_ENGINE_CLASS_COPY = 1,
188
189 /**
190 * @I915_ENGINE_CLASS_VIDEO:
191 *
192 * Video engines (also referred to as "bit stream decode" (BSD) or
193 * "vdbox") support instructions that perform fixed-function media
194 * decode and encode.
195 */
167196 I915_ENGINE_CLASS_VIDEO = 2,
197
198 /**
199 * @I915_ENGINE_CLASS_VIDEO_ENHANCE:
200 *
201 * Video enhancement engines (also referred to as "vebox") support
202 * instructions related to image enhancement.
203 */
168204 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
169205
170 /* should be kept compact */
206 /**
207 * @I915_ENGINE_CLASS_COMPUTE:
208 *
209 * Compute engines support a subset of the instructions available
210 * on render engines: compute engines support Compute (GPGPU) and
211 * programmable media workloads, but do not support the 3D pipeline.
212 */
213 I915_ENGINE_CLASS_COMPUTE = 4,
171214
215 /* Values in this enum should be kept compact. */
216
217 /**
218 * @I915_ENGINE_CLASS_INVALID:
219 *
220 * Placeholder value to represent an invalid engine class assignment.
221 */
172222 I915_ENGINE_CLASS_INVALID = -1
173223};
174224
175/*
225/**
226 * struct i915_engine_class_instance - Engine class/instance identifier
227 *
176228 * There may be more than one engine fulfilling any role within the system.
177229 * Each engine of a class is given a unique instance number and therefore
178230 * any engine can be specified by its class:instance tuplet. APIs that allow
......@@ -180,10 +232,21 @@ enum drm_i915_gem_engine_class {
180232 * for this identification.
181233 */
182234struct i915_engine_class_instance {
183 __u16 engine_class; /* see enum drm_i915_gem_engine_class */
184 __u16 engine_instance;
235 /**
236 * @engine_class:
237 *
238 * Engine class from enum drm_i915_gem_engine_class
239 */
240 __u16 engine_class;
185241#define I915_ENGINE_CLASS_INVALID_NONE -1
186242#define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
243
244 /**
245 * @engine_instance:
246 *
247 * Engine instance.
248 */
249 __u16 engine_instance;
187250};
188251
189252/**
......@@ -582,6 +645,22 @@ typedef struct drm_i915_irq_wait {
582645 */
583646#define I915_SCHEDULER_CAP_STATIC_PRIORITY_MAP (1ul << 5)
584647
648/*
649 * Query the status of HuC load.
650 *
651 * The query can fail in the following scenarios with the listed error codes:
652 * -ENODEV if HuC is not present on this platform,
653 * -EOPNOTSUPP if HuC firmware usage is disabled,
654 * -ENOPKG if HuC firmware fetch failed,
655 * -ENOEXEC if HuC firmware is invalid or mismatched,
656 * -ENOMEM if i915 failed to prepare the FW objects for transfer to the uC,
657 * -EIO if the FW transfer or the FW authentication failed.
658 *
659 * If the IOCTL is successful, the returned parameter will be set to one of the
660 * following values:
661 * * 0 if HuC firmware load is not complete,
662 * * 1 if HuC firmware is authenticated and running.
663 */
585664#define I915_PARAM_HUC_STATUS 42
586665
587666/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of
......@@ -686,16 +765,35 @@ typedef struct drm_i915_irq_wait {
686765/* Query if the kernel supports the I915_USERPTR_PROBE flag. */
687766#define I915_PARAM_HAS_USERPTR_PROBE 56
688767
768/*
769 * Frequency of the timestamps in OA reports. This used to be the same as the CS
770 * timestamp frequency, but differs on some platforms.
771 */
772#define I915_PARAM_OA_TIMESTAMP_FREQUENCY 57
773
689774/* Must be kept compact -- no holes and well documented */
690775
691typedef struct drm_i915_getparam {
776/**
777 * struct drm_i915_getparam - Driver parameter query structure.
778 */
779struct drm_i915_getparam {
780 /** @param: Driver parameter to query. */
692781 __s32 param;
693 /*
782
783 /**
784 * @value: Address of memory where queried value should be put.
785 *
694786 * WARNING: Using pointers instead of fixed-size u64 means we need to write
695787 * compat32 code. Don't repeat this mistake.
696788 */
697789 int *value;
698} drm_i915_getparam_t;
790};
791
792/**
793 * typedef drm_i915_getparam_t - Driver parameter query structure.
794 * See struct drm_i915_getparam.
795 */
796typedef struct drm_i915_getparam drm_i915_getparam_t;
699797
700798/* Ioctl to set kernel params:
701799 */
......@@ -1118,10 +1216,16 @@ struct drm_i915_gem_exec_object2 {
11181216 /**
11191217 * When the EXEC_OBJECT_PINNED flag is specified this is populated by
11201218 * the user with the GTT offset at which this object will be pinned.
1219 *
11211220 * When the I915_EXEC_NO_RELOC flag is specified this must contain the
11221221 * presumed_offset of the object.
1222 *
11231223 * During execbuffer2 the kernel populates it with the value of the
11241224 * current GTT offset of the object, for future presumed_offset writes.
1225 *
1226 * See struct drm_i915_gem_create_ext for the rules when dealing with
1227 * alignment restrictions with I915_MEMORY_CLASS_DEVICE, on devices with
1228 * minimum page sizes, like DG2.
11251229 */
11261230 __u64 offset;
11271231
......@@ -1170,76 +1274,119 @@ struct drm_i915_gem_exec_object2 {
11701274 __u64 rsvd2;
11711275};
11721276
1277/**
1278 * struct drm_i915_gem_exec_fence - An input or output fence for the execbuf
1279 * ioctl.
1280 *
1281 * The request will wait for input fence to signal before submission.
1282 *
1283 * The returned output fence will be signaled after the completion of the
1284 * request.
1285 */
11731286struct drm_i915_gem_exec_fence {
1174 /**
1175 * User's handle for a drm_syncobj to wait on or signal.
1176 */
1287 /** @handle: User's handle for a drm_syncobj to wait on or signal. */
11771288 __u32 handle;
11781289
1290 /**
1291 * @flags: Supported flags are:
1292 *
1293 * I915_EXEC_FENCE_WAIT:
1294 * Wait for the input fence before request submission.
1295 *
1296 * I915_EXEC_FENCE_SIGNAL:
1297 * Return request completion fence as output
1298 */
1299 __u32 flags;
11791300#define I915_EXEC_FENCE_WAIT (1<<0)
11801301#define I915_EXEC_FENCE_SIGNAL (1<<1)
11811302#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
1182 __u32 flags;
11831303};
11841304
1185/*
1186 * See drm_i915_gem_execbuffer_ext_timeline_fences.
1187 */
1188#define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
1189
1190/*
1305/**
1306 * struct drm_i915_gem_execbuffer_ext_timeline_fences - Timeline fences
1307 * for execbuf ioctl.
1308 *
11911309 * This structure describes an array of drm_syncobj and associated points for
11921310 * timeline variants of drm_syncobj. It is invalid to append this structure to
11931311 * the execbuf if I915_EXEC_FENCE_ARRAY is set.
11941312 */
11951313struct drm_i915_gem_execbuffer_ext_timeline_fences {
1314#define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 0
1315 /** @base: Extension link. See struct i915_user_extension. */
11961316 struct i915_user_extension base;
11971317
11981318 /**
1199 * Number of element in the handles_ptr & value_ptr arrays.
1319 * @fence_count: Number of elements in the @handles_ptr & @value_ptr
1320 * arrays.
12001321 */
12011322 __u64 fence_count;
12021323
12031324 /**
1204 * Pointer to an array of struct drm_i915_gem_exec_fence of length
1205 * fence_count.
1325 * @handles_ptr: Pointer to an array of struct drm_i915_gem_exec_fence
1326 * of length @fence_count.
12061327 */
12071328 __u64 handles_ptr;
12081329
12091330 /**
1210 * Pointer to an array of u64 values of length fence_count. Values
1211 * must be 0 for a binary drm_syncobj. A Value of 0 for a timeline
1212 * drm_syncobj is invalid as it turns a drm_syncobj into a binary one.
1331 * @values_ptr: Pointer to an array of u64 values of length
1332 * @fence_count.
1333 * Values must be 0 for a binary drm_syncobj. A Value of 0 for a
1334 * timeline drm_syncobj is invalid as it turns a drm_syncobj into a
1335 * binary one.
12131336 */
12141337 __u64 values_ptr;
12151338};
12161339
1340/**
1341 * struct drm_i915_gem_execbuffer2 - Structure for DRM_I915_GEM_EXECBUFFER2
1342 * ioctl.
1343 */
12171344struct drm_i915_gem_execbuffer2 {
1218 /**
1219 * List of gem_exec_object2 structs
1220 */
1345 /** @buffers_ptr: Pointer to a list of gem_exec_object2 structs */
12211346 __u64 buffers_ptr;
1347
1348 /** @buffer_count: Number of elements in @buffers_ptr array */
12221349 __u32 buffer_count;
12231350
1224 /** Offset in the batchbuffer to start execution from. */
1351 /**
1352 * @batch_start_offset: Offset in the batchbuffer to start execution
1353 * from.
1354 */
12251355 __u32 batch_start_offset;
1226 /** Bytes used in batchbuffer from batch_start_offset */
1356
1357 /**
1358 * @batch_len: Length in bytes of the batch buffer, starting from the
1359 * @batch_start_offset. If 0, length is assumed to be the batch buffer
1360 * object size.
1361 */
12271362 __u32 batch_len;
1363
1364 /** @DR1: deprecated */
12281365 __u32 DR1;
1366
1367 /** @DR4: deprecated */
12291368 __u32 DR4;
1369
1370 /** @num_cliprects: See @cliprects_ptr */
12301371 __u32 num_cliprects;
1372
12311373 /**
1232 * This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY
1233 * & I915_EXEC_USE_EXTENSIONS are not set.
1374 * @cliprects_ptr: Kernel clipping was a DRI1 misfeature.
1375 *
1376 * It is invalid to use this field if I915_EXEC_FENCE_ARRAY or
1377 * I915_EXEC_USE_EXTENSIONS flags are not set.
12341378 *
12351379 * If I915_EXEC_FENCE_ARRAY is set, then this is a pointer to an array
1236 * of struct drm_i915_gem_exec_fence and num_cliprects is the length
1237 * of the array.
1380 * of &drm_i915_gem_exec_fence and @num_cliprects is the length of the
1381 * array.
12381382 *
12391383 * If I915_EXEC_USE_EXTENSIONS is set, then this is a pointer to a
1240 * single struct i915_user_extension and num_cliprects is 0.
1384 * single &i915_user_extension and num_cliprects is 0.
12411385 */
12421386 __u64 cliprects_ptr;
1387
1388 /** @flags: Execbuf flags */
1389 __u64 flags;
12431390#define I915_EXEC_RING_MASK (0x3f)
12441391#define I915_EXEC_DEFAULT (0<<0)
12451392#define I915_EXEC_RENDER (1<<0)
......@@ -1257,10 +1404,6 @@ struct drm_i915_gem_execbuffer2 {
12571404#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
12581405#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
12591406#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
1260 __u64 flags;
1261 __u64 rsvd1; /* now used for context info */
1262 __u64 rsvd2;
1263};
12641407
12651408/** Resets the SO write offset registers for transform feedback on gen7. */
12661409#define I915_EXEC_GEN7_SOL_RESET (1<<8)
......@@ -1363,9 +1506,23 @@ struct drm_i915_gem_execbuffer2 {
13631506 * drm_i915_gem_execbuffer_ext enum.
13641507 */
13651508#define I915_EXEC_USE_EXTENSIONS (1 << 21)
1366
13671509#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_USE_EXTENSIONS << 1))
13681510
1511 /** @rsvd1: Context id */
1512 __u64 rsvd1;
1513
1514 /**
1515 * @rsvd2: in and out sync_file file descriptors.
1516 *
1517 * When I915_EXEC_FENCE_IN or I915_EXEC_FENCE_SUBMIT flag is set, the
1518 * lower 32 bits of this field will have the in sync_file fd (input).
1519 *
1520 * When I915_EXEC_FENCE_OUT flag is set, the upper 32 bits of this
1521 * field will have the out sync_file fd (output).
1522 */
1523 __u64 rsvd2;
1524};
1525
13691526#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
13701527#define i915_execbuffer2_set_context_id(eb2, context) \
13711528 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
......@@ -1745,19 +1902,58 @@ struct drm_i915_gem_context_create {
17451902 __u32 pad;
17461903};
17471904
1905/**
1906 * struct drm_i915_gem_context_create_ext - Structure for creating contexts.
1907 */
17481908struct drm_i915_gem_context_create_ext {
1749 __u32 ctx_id; /* output: id of new context*/
1909 /** @ctx_id: Id of the created context (output) */
1910 __u32 ctx_id;
1911
1912 /**
1913 * @flags: Supported flags are:
1914 *
1915 * I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS:
1916 *
1917 * Extensions may be appended to this structure and driver must check
1918 * for those. See @extensions.
1919 *
1920 * I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE
1921 *
1922 * Created context will have single timeline.
1923 */
17501924 __u32 flags;
17511925#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
17521926#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
17531927#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
17541928 (-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))
1929
1930 /**
1931 * @extensions: Zero-terminated chain of extensions.
1932 *
1933 * I915_CONTEXT_CREATE_EXT_SETPARAM:
1934 * Context parameter to set or query during context creation.
1935 * See struct drm_i915_gem_context_create_ext_setparam.
1936 *
1937 * I915_CONTEXT_CREATE_EXT_CLONE:
1938 * This extension has been removed. On the off chance someone somewhere
1939 * has attempted to use it, never re-use this extension number.
1940 */
17551941 __u64 extensions;
1942#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
1943#define I915_CONTEXT_CREATE_EXT_CLONE 1
17561944};
17571945
1946/**
1947 * struct drm_i915_gem_context_param - Context parameter to set or query.
1948 */
17581949struct drm_i915_gem_context_param {
1950 /** @ctx_id: Context id */
17591951 __u32 ctx_id;
1952
1953 /** @size: Size of the parameter @value */
17601954 __u32 size;
1955
1956 /** @param: Parameter to set or query */
17611957 __u64 param;
17621958#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
17631959/* I915_CONTEXT_PARAM_NO_ZEROMAP has been removed. On the off chance
......@@ -1904,6 +2100,7 @@ struct drm_i915_gem_context_param {
19042100#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
19052101/* Must be kept compact -- no holes and well documented */
19062102
2103 /** @value: Context parameter value to be set or queried */
19072104 __u64 value;
19082105};
19092106
......@@ -2054,7 +2251,7 @@ struct i915_context_engines_load_balance {
20542251
20552252 __u64 mbz64; /* reserved for future use; must be zero */
20562253
2057 struct i915_engine_class_instance engines[0];
2254 struct i915_engine_class_instance engines[];
20582255} __attribute__((packed));
20592256
20602257#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
......@@ -2092,7 +2289,7 @@ struct i915_context_engines_bond {
20922289 __u64 flags; /* all undefined flags must be zero */
20932290 __u64 mbz64[4]; /* reserved for future use; must be zero */
20942291
2095 struct i915_engine_class_instance engines[0];
2292 struct i915_engine_class_instance engines[];
20962293} __attribute__((packed));
20972294
20982295#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
......@@ -2219,7 +2416,7 @@ struct i915_context_engines_parallel_submit {
22192416 * length = width (i) * num_siblings (j)
22202417 * index = j + i * num_siblings
22212418 */
2222 struct i915_engine_class_instance engines[0];
2419 struct i915_engine_class_instance engines[];
22232420
22242421} __attribute__((packed));
22252422
......@@ -2302,23 +2499,29 @@ struct i915_context_param_engines {
23022499 struct i915_engine_class_instance engines[N__]; \
23032500} __attribute__((packed)) name__
23042501
2502/**
2503 * struct drm_i915_gem_context_create_ext_setparam - Context parameter
2504 * to set or query during context creation.
2505 */
23052506struct drm_i915_gem_context_create_ext_setparam {
2306#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
2507 /** @base: Extension link. See struct i915_user_extension. */
23072508 struct i915_user_extension base;
2509
2510 /**
2511 * @param: Context parameter to set or query.
2512 * See struct drm_i915_gem_context_param.
2513 */
23082514 struct drm_i915_gem_context_param param;
23092515};
23102516
2311/* This API has been removed. On the off chance someone somewhere has
2312 * attempted to use it, never re-use this extension number.
2313 */
2314#define I915_CONTEXT_CREATE_EXT_CLONE 1
2315
23162517struct drm_i915_gem_context_destroy {
23172518 __u32 ctx_id;
23182519 __u32 pad;
23192520};
23202521
2321/*
2522/**
2523 * struct drm_i915_gem_vm_control - Structure to create or destroy VM.
2524 *
23222525 * DRM_I915_GEM_VM_CREATE -
23232526 *
23242527 * Create a new virtual memory address space (ppGTT) for use within a context
......@@ -2328,20 +2531,23 @@ struct drm_i915_gem_context_destroy {
23282531 * The id of new VM (bound to the fd) for use with I915_CONTEXT_PARAM_VM is
23292532 * returned in the outparam @id.
23302533 *
2331 * No flags are defined, with all bits reserved and must be zero.
2332 *
23332534 * An extension chain maybe provided, starting with @extensions, and terminated
23342535 * by the @next_extension being 0. Currently, no extensions are defined.
23352536 *
23362537 * DRM_I915_GEM_VM_DESTROY -
23372538 *
2338 * Destroys a previously created VM id, specified in @id.
2539 * Destroys a previously created VM id, specified in @vm_id.
23392540 *
23402541 * No extensions or flags are allowed currently, and so must be zero.
23412542 */
23422543struct drm_i915_gem_vm_control {
2544 /** @extensions: Zero-terminated chain of extensions. */
23432545 __u64 extensions;
2546
2547 /** @flags: reserved for future usage, currently MBZ */
23442548 __u32 flags;
2549
2550 /** @vm_id: Id of the VM created or to be destroyed */
23452551 __u32 vm_id;
23462552};
23472553
......@@ -2466,6 +2672,10 @@ enum drm_i915_oa_format {
24662672 I915_OA_FORMAT_A12_B8_C8,
24672673 I915_OA_FORMAT_A32u40_A4u32_B8_C8,
24682674
2675 /* DG2 */
2676 I915_OAR_FORMAT_A32u40_A4u32_B8_C8,
2677 I915_OA_FORMAT_A24u40_A14u32_B8_C8,
2678
24692679 I915_OA_FORMAT_MAX /* non-ABI */
24702680};
24712681
......@@ -2651,24 +2861,65 @@ enum drm_i915_perf_record_type {
26512861 DRM_I915_PERF_RECORD_MAX /* non-ABI */
26522862};
26532863
2654/*
2864/**
2865 * struct drm_i915_perf_oa_config
2866 *
26552867 * Structure to upload perf dynamic configuration into the kernel.
26562868 */
26572869struct drm_i915_perf_oa_config {
2658 /** String formatted like "%08x-%04x-%04x-%04x-%012x" */
2870 /**
2871 * @uuid:
2872 *
2873 * String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x"
2874 */
26592875 char uuid[36];
26602876
2877 /**
2878 * @n_mux_regs:
2879 *
2880 * Number of mux regs in &mux_regs_ptr.
2881 */
26612882 __u32 n_mux_regs;
2883
2884 /**
2885 * @n_boolean_regs:
2886 *
2887 * Number of boolean regs in &boolean_regs_ptr.
2888 */
26622889 __u32 n_boolean_regs;
2890
2891 /**
2892 * @n_flex_regs:
2893 *
2894 * Number of flex regs in &flex_regs_ptr.
2895 */
26632896 __u32 n_flex_regs;
26642897
2665 /*
2666 * These fields are pointers to tuples of u32 values (register address,
2667 * value). For example the expected length of the buffer pointed by
2668 * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).
2898 /**
2899 * @mux_regs_ptr:
2900 *
2901 * Pointer to tuples of u32 values (register address, value) for mux
2902 * registers. Expected length of buffer is (2 * sizeof(u32) *
2903 * &n_mux_regs).
26692904 */
26702905 __u64 mux_regs_ptr;
2906
2907 /**
2908 * @boolean_regs_ptr:
2909 *
2910 * Pointer to tuples of u32 values (register address, value) for mux
2911 * registers. Expected length of buffer is (2 * sizeof(u32) *
2912 * &n_boolean_regs).
2913 */
26712914 __u64 boolean_regs_ptr;
2915
2916 /**
2917 * @flex_regs_ptr:
2918 *
2919 * Pointer to tuples of u32 values (register address, value) for mux
2920 * registers. Expected length of buffer is (2 * sizeof(u32) *
2921 * &n_flex_regs).
2922 */
26722923 __u64 flex_regs_ptr;
26732924};
26742925
......@@ -2679,12 +2930,24 @@ struct drm_i915_perf_oa_config {
26792930 * @data_ptr is also depends on the specific @query_id.
26802931 */
26812932struct drm_i915_query_item {
2682 /** @query_id: The id for this query */
2933 /**
2934 * @query_id:
2935 *
2936 * The id for this query. Currently accepted query IDs are:
2937 * - %DRM_I915_QUERY_TOPOLOGY_INFO (see struct drm_i915_query_topology_info)
2938 * - %DRM_I915_QUERY_ENGINE_INFO (see struct drm_i915_engine_info)
2939 * - %DRM_I915_QUERY_PERF_CONFIG (see struct drm_i915_query_perf_config)
2940 * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions)
2941 * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`)
2942 * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info)
2943 */
26832944 __u64 query_id;
2684#define DRM_I915_QUERY_TOPOLOGY_INFO 1
2685#define DRM_I915_QUERY_ENGINE_INFO 2
2686#define DRM_I915_QUERY_PERF_CONFIG 3
2687#define DRM_I915_QUERY_MEMORY_REGIONS 4
2945#define DRM_I915_QUERY_TOPOLOGY_INFO 1
2946#define DRM_I915_QUERY_ENGINE_INFO 2
2947#define DRM_I915_QUERY_PERF_CONFIG 3
2948#define DRM_I915_QUERY_MEMORY_REGIONS 4
2949#define DRM_I915_QUERY_HWCONFIG_BLOB 5
2950#define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6
26882951/* Must be kept compact -- no holes and well documented */
26892952
26902953 /**
......@@ -2700,14 +2963,17 @@ struct drm_i915_query_item {
27002963 /**
27012964 * @flags:
27022965 *
2703 * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
2966 * When &query_id == %DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
27042967 *
2705 * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
2968 * When &query_id == %DRM_I915_QUERY_PERF_CONFIG, must be one of the
27062969 * following:
27072970 *
2708 * - DRM_I915_QUERY_PERF_CONFIG_LIST
2709 * - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
2710 * - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
2971 * - %DRM_I915_QUERY_PERF_CONFIG_LIST
2972 * - %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
2973 * - %DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
2974 *
2975 * When &query_id == %DRM_I915_QUERY_GEOMETRY_SUBSLICES must contain
2976 * a struct i915_engine_class_instance that references a render engine.
27112977 */
27122978 __u32 flags;
27132979#define DRM_I915_QUERY_PERF_CONFIG_LIST 1
......@@ -2765,66 +3031,112 @@ struct drm_i915_query {
27653031 __u64 items_ptr;
27663032};
27673033
2768/*
2769 * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :
2770 *
2771 * data: contains the 3 pieces of information :
2772 *
2773 * - the slice mask with one bit per slice telling whether a slice is
2774 * available. The availability of slice X can be queried with the following
2775 * formula :
2776 *
2777 * (data[X / 8] >> (X % 8)) & 1
2778 *
2779 * - the subslice mask for each slice with one bit per subslice telling
2780 * whether a subslice is available. Gen12 has dual-subslices, which are
2781 * similar to two gen11 subslices. For gen12, this array represents dual-
2782 * subslices. The availability of subslice Y in slice X can be queried
2783 * with the following formula :
2784 *
2785 * (data[subslice_offset +
2786 * X * subslice_stride +
2787 * Y / 8] >> (Y % 8)) & 1
2788 *
2789 * - the EU mask for each subslice in each slice with one bit per EU telling
2790 * whether an EU is available. The availability of EU Z in subslice Y in
2791 * slice X can be queried with the following formula :
3034/**
3035 * struct drm_i915_query_topology_info
27923036 *
2793 * (data[eu_offset +
2794 * (X * max_subslices + Y) * eu_stride +
2795 * Z / 8] >> (Z % 8)) & 1
3037 * Describes slice/subslice/EU information queried by
3038 * %DRM_I915_QUERY_TOPOLOGY_INFO
27963039 */
27973040struct drm_i915_query_topology_info {
2798 /*
3041 /**
3042 * @flags:
3043 *
27993044 * Unused for now. Must be cleared to zero.
28003045 */
28013046 __u16 flags;
28023047
3048 /**
3049 * @max_slices:
3050 *
3051 * The number of bits used to express the slice mask.
3052 */
28033053 __u16 max_slices;
3054
3055 /**
3056 * @max_subslices:
3057 *
3058 * The number of bits used to express the subslice mask.
3059 */
28043060 __u16 max_subslices;
3061
3062 /**
3063 * @max_eus_per_subslice:
3064 *
3065 * The number of bits in the EU mask that correspond to a single
3066 * subslice's EUs.
3067 */
28053068 __u16 max_eus_per_subslice;
28063069
2807 /*
3070 /**
3071 * @subslice_offset:
3072 *
28083073 * Offset in data[] at which the subslice masks are stored.
28093074 */
28103075 __u16 subslice_offset;
28113076
2812 /*
3077 /**
3078 * @subslice_stride:
3079 *
28133080 * Stride at which each of the subslice masks for each slice are
28143081 * stored.
28153082 */
28163083 __u16 subslice_stride;
28173084
2818 /*
3085 /**
3086 * @eu_offset:
3087 *
28193088 * Offset in data[] at which the EU masks are stored.
28203089 */
28213090 __u16 eu_offset;
28223091
2823 /*
3092 /**
3093 * @eu_stride:
3094 *
28243095 * Stride at which each of the EU masks for each subslice are stored.
28253096 */
28263097 __u16 eu_stride;
28273098
3099 /**
3100 * @data:
3101 *
3102 * Contains 3 pieces of information :
3103 *
3104 * - The slice mask with one bit per slice telling whether a slice is
3105 * available. The availability of slice X can be queried with the
3106 * following formula :
3107 *
3108 * .. code:: c
3109 *
3110 * (data[X / 8] >> (X % 8)) & 1
3111 *
3112 * Starting with Xe_HP platforms, Intel hardware no longer has
3113 * traditional slices so i915 will always report a single slice
3114 * (hardcoded slicemask = 0x1) which contains all of the platform's
3115 * subslices. I.e., the mask here does not reflect any of the newer
3116 * hardware concepts such as "gslices" or "cslices" since userspace
3117 * is capable of inferring those from the subslice mask.
3118 *
3119 * - The subslice mask for each slice with one bit per subslice telling
3120 * whether a subslice is available. Starting with Gen12 we use the
3121 * term "subslice" to refer to what the hardware documentation
3122 * describes as a "dual-subslices." The availability of subslice Y
3123 * in slice X can be queried with the following formula :
3124 *
3125 * .. code:: c
3126 *
3127 * (data[subslice_offset + X * subslice_stride + Y / 8] >> (Y % 8)) & 1
3128 *
3129 * - The EU mask for each subslice in each slice, with one bit per EU
3130 * telling whether an EU is available. The availability of EU Z in
3131 * subslice Y in slice X can be queried with the following formula :
3132 *
3133 * .. code:: c
3134 *
3135 * (data[eu_offset +
3136 * (X * max_subslices + Y) * eu_stride +
3137 * Z / 8
3138 * ] >> (Z % 8)) & 1
3139 */
28283140 __u8 data[];
28293141};
28303142
......@@ -2945,52 +3257,68 @@ struct drm_i915_query_engine_info {
29453257 struct drm_i915_engine_info engines[];
29463258};
29473259
2948/*
2949 * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG.
3260/**
3261 * struct drm_i915_query_perf_config
3262 *
3263 * Data written by the kernel with query %DRM_I915_QUERY_PERF_CONFIG and
3264 * %DRM_I915_QUERY_GEOMETRY_SUBSLICES.
29503265 */
29513266struct drm_i915_query_perf_config {
29523267 union {
2953 /*
2954 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets
2955 * this fields to the number of configurations available.
3268 /**
3269 * @n_configs:
3270 *
3271 * When &drm_i915_query_item.flags ==
3272 * %DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets this fields to
3273 * the number of configurations available.
29563274 */
29573275 __u64 n_configs;
29583276
2959 /*
2960 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID,
2961 * i915 will use the value in this field as configuration
2962 * identifier to decide what data to write into config_ptr.
3277 /**
3278 * @config:
3279 *
3280 * When &drm_i915_query_item.flags ==
3281 * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, i915 will use the
3282 * value in this field as configuration identifier to decide
3283 * what data to write into config_ptr.
29633284 */
29643285 __u64 config;
29653286
2966 /*
2967 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
2968 * i915 will use the value in this field as configuration
2969 * identifier to decide what data to write into config_ptr.
3287 /**
3288 * @uuid:
3289 *
3290 * When &drm_i915_query_item.flags ==
3291 * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, i915 will use the
3292 * value in this field as configuration identifier to decide
3293 * what data to write into config_ptr.
29703294 *
29713295 * String formatted like "%08x-%04x-%04x-%04x-%012x"
29723296 */
29733297 char uuid[36];
29743298 };
29753299
2976 /*
3300 /**
3301 * @flags:
3302 *
29773303 * Unused for now. Must be cleared to zero.
29783304 */
29793305 __u32 flags;
29803306
2981 /*
2982 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will
2983 * write an array of __u64 of configuration identifiers.
3307 /**
3308 * @data:
3309 *
3310 * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_LIST,
3311 * i915 will write an array of __u64 of configuration identifiers.
29843312 *
2985 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will
2986 * write a struct drm_i915_perf_oa_config. If the following fields of
2987 * drm_i915_perf_oa_config are set not set to 0, i915 will write into
2988 * the associated pointers the values of submitted when the
3313 * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_DATA,
3314 * i915 will write a struct drm_i915_perf_oa_config. If the following
3315 * fields of struct drm_i915_perf_oa_config are not set to 0, i915 will
3316 * write into the associated pointers the values of submitted when the
29893317 * configuration was created :
29903318 *
2991 * - n_mux_regs
2992 * - n_boolean_regs
2993 * - n_flex_regs
3319 * - &drm_i915_perf_oa_config.n_mux_regs
3320 * - &drm_i915_perf_oa_config.n_boolean_regs
3321 * - &drm_i915_perf_oa_config.n_flex_regs
29943322 */
29953323 __u8 data[];
29963324};
......@@ -3020,36 +3348,6 @@ struct drm_i915_gem_memory_class_instance {
30203348 * struct drm_i915_memory_region_info - Describes one region as known to the
30213349 * driver.
30223350 *
3023 * Note that we reserve some stuff here for potential future work. As an example
3024 * we might want expose the capabilities for a given region, which could include
3025 * things like if the region is CPU mappable/accessible, what are the supported
3026 * mapping types etc.
3027 *
3028 * Note that to extend struct drm_i915_memory_region_info and struct
3029 * drm_i915_query_memory_regions in the future the plan is to do the following:
3030 *
3031 * .. code-block:: C
3032 *
3033 * struct drm_i915_memory_region_info {
3034 * struct drm_i915_gem_memory_class_instance region;
3035 * union {
3036 * __u32 rsvd0;
3037 * __u32 new_thing1;
3038 * };
3039 * ...
3040 * union {
3041 * __u64 rsvd1[8];
3042 * struct {
3043 * __u64 new_thing2;
3044 * __u64 new_thing3;
3045 * ...
3046 * };
3047 * };
3048 * };
3049 *
3050 * With this things should remain source compatible between versions for
3051 * userspace, even as we add new fields.
3052 *
30533351 * Note this is using both struct drm_i915_query_item and struct drm_i915_query.
30543352 * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS
30553353 * at &drm_i915_query_item.query_id.
......@@ -3061,14 +3359,81 @@ struct drm_i915_memory_region_info {
30613359 /** @rsvd0: MBZ */
30623360 __u32 rsvd0;
30633361
3064 /** @probed_size: Memory probed by the driver (-1 = unknown) */
3362 /**
3363 * @probed_size: Memory probed by the driver
3364 *
3365 * Note that it should not be possible to ever encounter a zero value
3366 * here, also note that no current region type will ever return -1 here.
3367 * Although for future region types, this might be a possibility. The
3368 * same applies to the other size fields.
3369 */
30653370 __u64 probed_size;
30663371
3067 /** @unallocated_size: Estimate of memory remaining (-1 = unknown) */
3372 /**
3373 * @unallocated_size: Estimate of memory remaining
3374 *
3375 * Requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable accounting.
3376 * Without this (or if this is an older kernel) the value here will
3377 * always equal the @probed_size. Note this is only currently tracked
3378 * for I915_MEMORY_CLASS_DEVICE regions (for other types the value here
3379 * will always equal the @probed_size).
3380 */
30683381 __u64 unallocated_size;
30693382
3070 /** @rsvd1: MBZ */
3071 __u64 rsvd1[8];
3383 union {
3384 /** @rsvd1: MBZ */
3385 __u64 rsvd1[8];
3386 struct {
3387 /**
3388 * @probed_cpu_visible_size: Memory probed by the driver
3389 * that is CPU accessible.
3390 *
3391 * This will be always be <= @probed_size, and the
3392 * remainder (if there is any) will not be CPU
3393 * accessible.
3394 *
3395 * On systems without small BAR, the @probed_size will
3396 * always equal the @probed_cpu_visible_size, since all
3397 * of it will be CPU accessible.
3398 *
3399 * Note this is only tracked for
3400 * I915_MEMORY_CLASS_DEVICE regions (for other types the
3401 * value here will always equal the @probed_size).
3402 *
3403 * Note that if the value returned here is zero, then
3404 * this must be an old kernel which lacks the relevant
3405 * small-bar uAPI support (including
3406 * I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS), but on
3407 * such systems we should never actually end up with a
3408 * small BAR configuration, assuming we are able to load
3409 * the kernel module. Hence it should be safe to treat
3410 * this the same as when @probed_cpu_visible_size ==
3411 * @probed_size.
3412 */
3413 __u64 probed_cpu_visible_size;
3414
3415 /**
3416 * @unallocated_cpu_visible_size: Estimate of CPU
3417 * visible memory remaining.
3418 *
3419 * Note this is only tracked for
3420 * I915_MEMORY_CLASS_DEVICE regions (for other types the
3421 * value here will always equal the
3422 * @probed_cpu_visible_size).
3423 *
3424 * Requires CAP_PERFMON or CAP_SYS_ADMIN to get reliable
3425 * accounting. Without this the value here will always
3426 * equal the @probed_cpu_visible_size. Note this is only
3427 * currently tracked for I915_MEMORY_CLASS_DEVICE
3428 * regions (for other types the value here will also
3429 * always equal the @probed_cpu_visible_size).
3430 *
3431 * If this is an older kernel the value here will be
3432 * zero, see also @probed_cpu_visible_size.
3433 */
3434 __u64 unallocated_cpu_visible_size;
3435 };
3436 };
30723437};
30733438
30743439/**
......@@ -3128,15 +3493,25 @@ struct drm_i915_query_memory_regions {
31283493 struct drm_i915_memory_region_info regions[];
31293494};
31303495
3496/**
3497 * DOC: GuC HWCONFIG blob uAPI
3498 *
3499 * The GuC produces a blob with information about the current device.
3500 * i915 reads this blob from GuC and makes it available via this uAPI.
3501 *
3502 * The format and meaning of the blob content are documented in the
3503 * Programmer's Reference Manual.
3504 */
3505
31313506/**
31323507 * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
31333508 * extension support using struct i915_user_extension.
31343509 *
3135 * Note that in the future we want to have our buffer flags here, at least for
3136 * the stuff that is immutable. Previously we would have two ioctls, one to
3137 * create the object with gem_create, and another to apply various parameters,
3138 * however this creates some ambiguity for the params which are considered
3139 * immutable. Also in general we're phasing out the various SET/GET ioctls.
3510 * Note that new buffer flags should be added here, at least for the stuff that
3511 * is immutable. Previously we would have two ioctls, one to create the object
3512 * with gem_create, and another to apply various parameters, however this
3513 * creates some ambiguity for the params which are considered immutable. Also in
3514 * general we're phasing out the various SET/GET ioctls.
31403515 */
31413516struct drm_i915_gem_create_ext {
31423517 /**
......@@ -3144,21 +3519,79 @@ struct drm_i915_gem_create_ext {
31443519 *
31453520 * The (page-aligned) allocated size for the object will be returned.
31463521 *
3147 * Note that for some devices we have might have further minimum
3148 * page-size restrictions(larger than 4K), like for device local-memory.
3149 * However in general the final size here should always reflect any
3150 * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS
3151 * extension to place the object in device local-memory.
3522 * On platforms like DG2/ATS the kernel will always use 64K or larger
3523 * pages for I915_MEMORY_CLASS_DEVICE. The kernel also requires a
3524 * minimum of 64K GTT alignment for such objects.
3525 *
3526 * NOTE: Previously the ABI here required a minimum GTT alignment of 2M
3527 * on DG2/ATS, due to how the hardware implemented 64K GTT page support,
3528 * where we had the following complications:
3529 *
3530 * 1) The entire PDE (which covers a 2MB virtual address range), must
3531 * contain only 64K PTEs, i.e mixing 4K and 64K PTEs in the same
3532 * PDE is forbidden by the hardware.
3533 *
3534 * 2) We still need to support 4K PTEs for I915_MEMORY_CLASS_SYSTEM
3535 * objects.
3536 *
3537 * However on actual production HW this was completely changed to now
3538 * allow setting a TLB hint at the PTE level (see PS64), which is a lot
3539 * more flexible than the above. With this the 2M restriction was
3540 * dropped where we now only require 64K.
31523541 */
31533542 __u64 size;
3543
31543544 /**
31553545 * @handle: Returned handle for the object.
31563546 *
31573547 * Object handles are nonzero.
31583548 */
31593549 __u32 handle;
3160 /** @flags: MBZ */
3550
3551 /**
3552 * @flags: Optional flags.
3553 *
3554 * Supported values:
3555 *
3556 * I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS - Signal to the kernel that
3557 * the object will need to be accessed via the CPU.
3558 *
3559 * Only valid when placing objects in I915_MEMORY_CLASS_DEVICE, and only
3560 * strictly required on configurations where some subset of the device
3561 * memory is directly visible/mappable through the CPU (which we also
3562 * call small BAR), like on some DG2+ systems. Note that this is quite
3563 * undesirable, but due to various factors like the client CPU, BIOS etc
3564 * it's something we can expect to see in the wild. See
3565 * &drm_i915_memory_region_info.probed_cpu_visible_size for how to
3566 * determine if this system applies.
3567 *
3568 * Note that one of the placements MUST be I915_MEMORY_CLASS_SYSTEM, to
3569 * ensure the kernel can always spill the allocation to system memory,
3570 * if the object can't be allocated in the mappable part of
3571 * I915_MEMORY_CLASS_DEVICE.
3572 *
3573 * Also note that since the kernel only supports flat-CCS on objects
3574 * that can *only* be placed in I915_MEMORY_CLASS_DEVICE, we therefore
3575 * don't support I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS together with
3576 * flat-CCS.
3577 *
3578 * Without this hint, the kernel will assume that non-mappable
3579 * I915_MEMORY_CLASS_DEVICE is preferred for this object. Note that the
3580 * kernel can still migrate the object to the mappable part, as a last
3581 * resort, if userspace ever CPU faults this object, but this might be
3582 * expensive, and so ideally should be avoided.
3583 *
3584 * On older kernels which lack the relevant small-bar uAPI support (see
3585 * also &drm_i915_memory_region_info.probed_cpu_visible_size),
3586 * usage of the flag will result in an error, but it should NEVER be
3587 * possible to end up with a small BAR configuration, assuming we can
3588 * also successfully load the i915 kernel module. In such cases the
3589 * entire I915_MEMORY_CLASS_DEVICE region will be CPU accessible, and as
3590 * such there are zero restrictions on where the object can be placed.
3591 */
3592#define I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS (1 << 0)
31613593 __u32 flags;
3594
31623595 /**
31633596 * @extensions: The chain of extensions to apply to this object.
31643597 *
......@@ -3217,6 +3650,22 @@ struct drm_i915_gem_create_ext {
32173650 * At which point we get the object handle in &drm_i915_gem_create_ext.handle,
32183651 * along with the final object size in &drm_i915_gem_create_ext.size, which
32193652 * should account for any rounding up, if required.
3653 *
3654 * Note that userspace has no means of knowing the current backing region
3655 * for objects where @num_regions is larger than one. The kernel will only
3656 * ensure that the priority order of the @regions array is honoured, either
3657 * when initially placing the object, or when moving memory around due to
3658 * memory pressure
3659 *
3660 * On Flat-CCS capable HW, compression is supported for the objects residing
3661 * in I915_MEMORY_CLASS_DEVICE. When such objects (compressed) have other
3662 * memory class in @regions and migrated (by i915, due to memory
3663 * constraints) to the non I915_MEMORY_CLASS_DEVICE region, then i915 needs to
3664 * decompress the content. But i915 doesn't have the required information to
3665 * decompress the userspace compressed objects.
3666 *
3667 * So i915 supports Flat-CCS, on the objects which can reside only on
3668 * I915_MEMORY_CLASS_DEVICE regions.
32203669 */
32213670struct drm_i915_gem_create_ext_memory_regions {
32223671 /** @base: Extension link. See struct i915_user_extension. */
lib/libc/include/any-linux-any/drm/ivpu_accel.h created+306
......@@ -0,0 +1,306 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2020-2023 Intel Corporation
4 */
5
6#ifndef __UAPI_IVPU_DRM_H__
7#define __UAPI_IVPU_DRM_H__
8
9#include "drm.h"
10
11#if defined(__cplusplus)
12extern "C" {
13#endif
14
15#define DRM_IVPU_DRIVER_MAJOR 1
16#define DRM_IVPU_DRIVER_MINOR 0
17
18#define DRM_IVPU_GET_PARAM 0x00
19#define DRM_IVPU_SET_PARAM 0x01
20#define DRM_IVPU_BO_CREATE 0x02
21#define DRM_IVPU_BO_INFO 0x03
22#define DRM_IVPU_SUBMIT 0x05
23#define DRM_IVPU_BO_WAIT 0x06
24
25#define DRM_IOCTL_IVPU_GET_PARAM \
26 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
27
28#define DRM_IOCTL_IVPU_SET_PARAM \
29 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SET_PARAM, struct drm_ivpu_param)
30
31#define DRM_IOCTL_IVPU_BO_CREATE \
32 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_CREATE, struct drm_ivpu_bo_create)
33
34#define DRM_IOCTL_IVPU_BO_INFO \
35 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_INFO, struct drm_ivpu_bo_info)
36
37#define DRM_IOCTL_IVPU_SUBMIT \
38 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_SUBMIT, struct drm_ivpu_submit)
39
40#define DRM_IOCTL_IVPU_BO_WAIT \
41 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_BO_WAIT, struct drm_ivpu_bo_wait)
42
43/**
44 * DOC: contexts
45 *
46 * VPU contexts have private virtual address space, job queues and priority.
47 * Each context is identified by an unique ID. Context is created on open().
48 */
49
50#define DRM_IVPU_PARAM_DEVICE_ID 0
51#define DRM_IVPU_PARAM_DEVICE_REVISION 1
52#define DRM_IVPU_PARAM_PLATFORM_TYPE 2
53#define DRM_IVPU_PARAM_CORE_CLOCK_RATE 3
54#define DRM_IVPU_PARAM_NUM_CONTEXTS 4
55#define DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS 5
56#define DRM_IVPU_PARAM_CONTEXT_PRIORITY 6
57#define DRM_IVPU_PARAM_CONTEXT_ID 7
58#define DRM_IVPU_PARAM_FW_API_VERSION 8
59#define DRM_IVPU_PARAM_ENGINE_HEARTBEAT 9
60#define DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID 10
61#define DRM_IVPU_PARAM_TILE_CONFIG 11
62#define DRM_IVPU_PARAM_SKU 12
63
64#define DRM_IVPU_PLATFORM_TYPE_SILICON 0
65
66#define DRM_IVPU_CONTEXT_PRIORITY_IDLE 0
67#define DRM_IVPU_CONTEXT_PRIORITY_NORMAL 1
68#define DRM_IVPU_CONTEXT_PRIORITY_FOCUS 2
69#define DRM_IVPU_CONTEXT_PRIORITY_REALTIME 3
70
71/**
72 * struct drm_ivpu_param - Get/Set VPU parameters
73 */
74struct drm_ivpu_param {
75 /**
76 * @param:
77 *
78 * Supported params:
79 *
80 * %DRM_IVPU_PARAM_DEVICE_ID:
81 * PCI Device ID of the VPU device (read-only)
82 *
83 * %DRM_IVPU_PARAM_DEVICE_REVISION:
84 * VPU device revision (read-only)
85 *
86 * %DRM_IVPU_PARAM_PLATFORM_TYPE:
87 * Returns %DRM_IVPU_PLATFORM_TYPE_SILICON on real hardware or device specific
88 * platform type when executing on a simulator or emulator (read-only)
89 *
90 * %DRM_IVPU_PARAM_CORE_CLOCK_RATE:
91 * Current PLL frequency (read-only)
92 *
93 * %DRM_IVPU_PARAM_NUM_CONTEXTS:
94 * Maximum number of simultaneously existing contexts (read-only)
95 *
96 * %DRM_IVPU_PARAM_CONTEXT_BASE_ADDRESS:
97 * Lowest VPU virtual address available in the current context (read-only)
98 *
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 *
103 * %DRM_IVPU_PARAM_CONTEXT_ID:
104 * Current context ID, always greater than 0 (read-only)
105 *
106 * %DRM_IVPU_PARAM_FW_API_VERSION:
107 * Firmware API version array (read-only)
108 *
109 * %DRM_IVPU_PARAM_ENGINE_HEARTBEAT:
110 * Heartbeat value from an engine (read-only).
111 * Engine ID (i.e. DRM_IVPU_ENGINE_COMPUTE) is given via index.
112 *
113 * %DRM_IVPU_PARAM_UNIQUE_INFERENCE_ID:
114 * Device-unique inference ID (read-only)
115 *
116 * %DRM_IVPU_PARAM_TILE_CONFIG:
117 * VPU tile configuration (read-only)
118 *
119 * %DRM_IVPU_PARAM_SKU:
120 * VPU SKU ID (read-only)
121 *
122 */
123 __u32 param;
124
125 /** @index: Index for params that have multiple instances */
126 __u32 index;
127
128 /** @value: Param value */
129 __u64 value;
130};
131
132#define DRM_IVPU_BO_HIGH_MEM 0x00000001
133#define DRM_IVPU_BO_MAPPABLE 0x00000002
134
135#define DRM_IVPU_BO_CACHED 0x00000000
136#define DRM_IVPU_BO_UNCACHED 0x00010000
137#define DRM_IVPU_BO_WC 0x00020000
138#define DRM_IVPU_BO_CACHE_MASK 0x00030000
139
140#define DRM_IVPU_BO_FLAGS \
141 (DRM_IVPU_BO_HIGH_MEM | \
142 DRM_IVPU_BO_MAPPABLE | \
143 DRM_IVPU_BO_CACHE_MASK)
144
145/**
146 * struct drm_ivpu_bo_create - Create BO backed by SHMEM
147 *
148 * Create GEM buffer object allocated in SHMEM memory.
149 */
150struct drm_ivpu_bo_create {
151 /** @size: The size in bytes of the allocated memory */
152 __u64 size;
153
154 /**
155 * @flags:
156 *
157 * Supported flags:
158 *
159 * %DRM_IVPU_BO_HIGH_MEM:
160 *
161 * Allocate VPU address from >4GB range.
162 * Buffer object with vpu address >4GB can be always accessed by the
163 * VPU DMA engine, but some HW generation may not be able to access
164 * this memory from then firmware running on the VPU management processor.
165 * Suitable for input, output and some scratch buffers.
166 *
167 * %DRM_IVPU_BO_MAPPABLE:
168 *
169 * Buffer object can be mapped using mmap().
170 *
171 * %DRM_IVPU_BO_CACHED:
172 *
173 * Allocated BO will be cached on host side (WB) and snooped on the VPU side.
174 * This is the default caching mode.
175 *
176 * %DRM_IVPU_BO_UNCACHED:
177 *
178 * Allocated BO will not be cached on host side nor snooped on the VPU side.
179 *
180 * %DRM_IVPU_BO_WC:
181 *
182 * Allocated BO will use write combining buffer for writes but reads will be
183 * uncached.
184 */
185 __u32 flags;
186
187 /** @handle: Returned GEM object handle */
188 __u32 handle;
189
190 /** @vpu_addr: Returned VPU virtual address */
191 __u64 vpu_addr;
192};
193
194/**
195 * struct drm_ivpu_bo_info - Query buffer object info
196 */
197struct drm_ivpu_bo_info {
198 /** @handle: Handle of the queried BO */
199 __u32 handle;
200
201 /** @flags: Returned flags used to create the BO */
202 __u32 flags;
203
204 /** @vpu_addr: Returned VPU virtual address */
205 __u64 vpu_addr;
206
207 /**
208 * @mmap_offset:
209 *
210 * Returned offset to be used in mmap(). 0 in case the BO is not mappable.
211 */
212 __u64 mmap_offset;
213
214 /** @size: Returned GEM object size, aligned to PAGE_SIZE */
215 __u64 size;
216};
217
218/* drm_ivpu_submit engines */
219#define DRM_IVPU_ENGINE_COMPUTE 0
220#define DRM_IVPU_ENGINE_COPY 1
221
222/**
223 * struct drm_ivpu_submit - Submit commands to the VPU
224 *
225 * Execute a single command buffer on a given VPU engine.
226 * Handles to all referenced buffer objects have to be provided in @buffers_ptr.
227 *
228 * User space may wait on job completion using %DRM_IVPU_BO_WAIT ioctl.
229 */
230struct drm_ivpu_submit {
231 /**
232 * @buffers_ptr:
233 *
234 * A pointer to an u32 array of GEM handles of the BOs required for this job.
235 * The number of elements in the array must be equal to the value given by @buffer_count.
236 *
237 * The first BO is the command buffer. The rest of array has to contain all
238 * BOs referenced from the command buffer.
239 */
240 __u64 buffers_ptr;
241
242 /** @buffer_count: Number of elements in the @buffers_ptr */
243 __u32 buffer_count;
244
245 /**
246 * @engine: Select the engine this job should be executed on
247 *
248 * %DRM_IVPU_ENGINE_COMPUTE:
249 *
250 * Performs Deep Learning Neural Compute Inference Operations
251 *
252 * %DRM_IVPU_ENGINE_COPY:
253 *
254 * Performs memory copy operations to/from system memory allocated for VPU
255 */
256 __u32 engine;
257
258 /** @flags: Reserved for future use - must be zero */
259 __u32 flags;
260
261 /**
262 * @commands_offset:
263 *
264 * Offset inside the first buffer in @buffers_ptr containing commands
265 * to be executed. The offset has to be 8-byte aligned.
266 */
267 __u32 commands_offset;
268};
269
270/* drm_ivpu_bo_wait job status codes */
271#define DRM_IVPU_JOB_STATUS_SUCCESS 0
272
273/**
274 * struct drm_ivpu_bo_wait - Wait for BO to become inactive
275 *
276 * Blocks until a given buffer object becomes inactive.
277 * With @timeout_ms set to 0 returns immediately.
278 */
279struct drm_ivpu_bo_wait {
280 /** @handle: Handle to the buffer object to be waited on */
281 __u32 handle;
282
283 /** @flags: Reserved for future use - must be zero */
284 __u32 flags;
285
286 /** @timeout_ns: Absolute timeout in nanoseconds (may be zero) */
287 __s64 timeout_ns;
288
289 /**
290 * @job_status:
291 *
292 * Job status code which is updated after the job is completed.
293 * &DRM_IVPU_JOB_STATUS_SUCCESS or device specific error otherwise.
294 * Valid only if @handle points to a command buffer.
295 */
296 __u32 job_status;
297
298 /** @pad: Padding - must be zero */
299 __u32 pad;
300};
301
302#if defined(__cplusplus)
303}
304#endif
305
306#endif /* __UAPI_IVPU_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/mga_drm.h deleted-429
......@@ -1,429 +0,0 @@
1/* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*-
2 * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
3 *
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Jeff Hartmann <jhartmann@valinux.com>
29 * Keith Whitwell <keith@tungstengraphics.com>
30 *
31 * Rewritten by:
32 * Gareth Hughes <gareth@valinux.com>
33 */
34
35#ifndef __MGA_DRM_H__
36#define __MGA_DRM_H__
37
38#include "drm.h"
39
40#if defined(__cplusplus)
41extern "C" {
42#endif
43
44/* WARNING: If you change any of these defines, make sure to change the
45 * defines in the Xserver file (mga_sarea.h)
46 */
47
48#ifndef __MGA_SAREA_DEFINES__
49#define __MGA_SAREA_DEFINES__
50
51/* WARP pipe flags
52 */
53#define MGA_F 0x1 /* fog */
54#define MGA_A 0x2 /* alpha */
55#define MGA_S 0x4 /* specular */
56#define MGA_T2 0x8 /* multitexture */
57
58#define MGA_WARP_TGZ 0
59#define MGA_WARP_TGZF (MGA_F)
60#define MGA_WARP_TGZA (MGA_A)
61#define MGA_WARP_TGZAF (MGA_F|MGA_A)
62#define MGA_WARP_TGZS (MGA_S)
63#define MGA_WARP_TGZSF (MGA_S|MGA_F)
64#define MGA_WARP_TGZSA (MGA_S|MGA_A)
65#define MGA_WARP_TGZSAF (MGA_S|MGA_F|MGA_A)
66#define MGA_WARP_T2GZ (MGA_T2)
67#define MGA_WARP_T2GZF (MGA_T2|MGA_F)
68#define MGA_WARP_T2GZA (MGA_T2|MGA_A)
69#define MGA_WARP_T2GZAF (MGA_T2|MGA_A|MGA_F)
70#define MGA_WARP_T2GZS (MGA_T2|MGA_S)
71#define MGA_WARP_T2GZSF (MGA_T2|MGA_S|MGA_F)
72#define MGA_WARP_T2GZSA (MGA_T2|MGA_S|MGA_A)
73#define MGA_WARP_T2GZSAF (MGA_T2|MGA_S|MGA_F|MGA_A)
74
75#define MGA_MAX_G200_PIPES 8 /* no multitex */
76#define MGA_MAX_G400_PIPES 16
77#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
78#define MGA_WARP_UCODE_SIZE 32768 /* in bytes */
79
80#define MGA_CARD_TYPE_G200 1
81#define MGA_CARD_TYPE_G400 2
82#define MGA_CARD_TYPE_G450 3 /* not currently used */
83#define MGA_CARD_TYPE_G550 4
84
85#define MGA_FRONT 0x1
86#define MGA_BACK 0x2
87#define MGA_DEPTH 0x4
88
89/* What needs to be changed for the current vertex dma buffer?
90 */
91#define MGA_UPLOAD_CONTEXT 0x1
92#define MGA_UPLOAD_TEX0 0x2
93#define MGA_UPLOAD_TEX1 0x4
94#define MGA_UPLOAD_PIPE 0x8
95#define MGA_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
96#define MGA_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
97#define MGA_UPLOAD_2D 0x40
98#define MGA_WAIT_AGE 0x80 /* handled client-side */
99#define MGA_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
100#if 0
101#define MGA_DMA_FLUSH 0x200 /* set when someone gets the lock
102 quiescent */
103#endif
104
105/* 32 buffers of 64k each, total 2 meg.
106 */
107#define MGA_BUFFER_SIZE (1 << 16)
108#define MGA_NUM_BUFFERS 128
109
110/* Keep these small for testing.
111 */
112#define MGA_NR_SAREA_CLIPRECTS 8
113
114/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
115 * regions, subject to a minimum region size of (1<<16) == 64k.
116 *
117 * Clients may subdivide regions internally, but when sharing between
118 * clients, the region size is the minimum granularity.
119 */
120
121#define MGA_CARD_HEAP 0
122#define MGA_AGP_HEAP 1
123#define MGA_NR_TEX_HEAPS 2
124#define MGA_NR_TEX_REGIONS 16
125#define MGA_LOG_MIN_TEX_REGION_SIZE 16
126
127#define DRM_MGA_IDLE_RETRY 2048
128
129#endif /* __MGA_SAREA_DEFINES__ */
130
131/* Setup registers for 3D context
132 */
133typedef struct {
134 unsigned int dstorg;
135 unsigned int maccess;
136 unsigned int plnwt;
137 unsigned int dwgctl;
138 unsigned int alphactrl;
139 unsigned int fogcolor;
140 unsigned int wflag;
141 unsigned int tdualstage0;
142 unsigned int tdualstage1;
143 unsigned int fcol;
144 unsigned int stencil;
145 unsigned int stencilctl;
146} drm_mga_context_regs_t;
147
148/* Setup registers for 2D, X server
149 */
150typedef struct {
151 unsigned int pitch;
152} drm_mga_server_regs_t;
153
154/* Setup registers for each texture unit
155 */
156typedef struct {
157 unsigned int texctl;
158 unsigned int texctl2;
159 unsigned int texfilter;
160 unsigned int texbordercol;
161 unsigned int texorg;
162 unsigned int texwidth;
163 unsigned int texheight;
164 unsigned int texorg1;
165 unsigned int texorg2;
166 unsigned int texorg3;
167 unsigned int texorg4;
168} drm_mga_texture_regs_t;
169
170/* General aging mechanism
171 */
172typedef struct {
173 unsigned int head; /* Position of head pointer */
174 unsigned int wrap; /* Primary DMA wrap count */
175} drm_mga_age_t;
176
177typedef struct _drm_mga_sarea {
178 /* The channel for communication of state information to the kernel
179 * on firing a vertex dma buffer.
180 */
181 drm_mga_context_regs_t context_state;
182 drm_mga_server_regs_t server_state;
183 drm_mga_texture_regs_t tex_state[2];
184 unsigned int warp_pipe;
185 unsigned int dirty;
186 unsigned int vertsize;
187
188 /* The current cliprects, or a subset thereof.
189 */
190 struct drm_clip_rect boxes[MGA_NR_SAREA_CLIPRECTS];
191 unsigned int nbox;
192
193 /* Information about the most recently used 3d drawable. The
194 * client fills in the req_* fields, the server fills in the
195 * exported_ fields and puts the cliprects into boxes, above.
196 *
197 * The client clears the exported_drawable field before
198 * clobbering the boxes data.
199 */
200 unsigned int req_drawable; /* the X drawable id */
201 unsigned int req_draw_buffer; /* MGA_FRONT or MGA_BACK */
202
203 unsigned int exported_drawable;
204 unsigned int exported_index;
205 unsigned int exported_stamp;
206 unsigned int exported_buffers;
207 unsigned int exported_nfront;
208 unsigned int exported_nback;
209 int exported_back_x, exported_front_x, exported_w;
210 int exported_back_y, exported_front_y, exported_h;
211 struct drm_clip_rect exported_boxes[MGA_NR_SAREA_CLIPRECTS];
212
213 /* Counters for aging textures and for client-side throttling.
214 */
215 unsigned int status[4];
216 unsigned int last_wrap;
217
218 drm_mga_age_t last_frame;
219 unsigned int last_enqueue; /* last time a buffer was enqueued */
220 unsigned int last_dispatch; /* age of the most recently dispatched buffer */
221 unsigned int last_quiescent; /* */
222
223 /* LRU lists for texture memory in agp space and on the card.
224 */
225 struct drm_tex_region texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS + 1];
226 unsigned int texAge[MGA_NR_TEX_HEAPS];
227
228 /* Mechanism to validate card state.
229 */
230 int ctxOwner;
231} drm_mga_sarea_t;
232
233/* MGA specific ioctls
234 * The device specific ioctl range is 0x40 to 0x79.
235 */
236#define DRM_MGA_INIT 0x00
237#define DRM_MGA_FLUSH 0x01
238#define DRM_MGA_RESET 0x02
239#define DRM_MGA_SWAP 0x03
240#define DRM_MGA_CLEAR 0x04
241#define DRM_MGA_VERTEX 0x05
242#define DRM_MGA_INDICES 0x06
243#define DRM_MGA_ILOAD 0x07
244#define DRM_MGA_BLIT 0x08
245#define DRM_MGA_GETPARAM 0x09
246
247/* 3.2:
248 * ioctls for operating on fences.
249 */
250#define DRM_MGA_SET_FENCE 0x0a
251#define DRM_MGA_WAIT_FENCE 0x0b
252#define DRM_MGA_DMA_BOOTSTRAP 0x0c
253
254#define DRM_IOCTL_MGA_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INIT, drm_mga_init_t)
255#define DRM_IOCTL_MGA_FLUSH DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_FLUSH, struct drm_lock)
256#define DRM_IOCTL_MGA_RESET DRM_IO( DRM_COMMAND_BASE + DRM_MGA_RESET)
257#define DRM_IOCTL_MGA_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_MGA_SWAP)
258#define DRM_IOCTL_MGA_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_CLEAR, drm_mga_clear_t)
259#define DRM_IOCTL_MGA_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_VERTEX, drm_mga_vertex_t)
260#define DRM_IOCTL_MGA_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_INDICES, drm_mga_indices_t)
261#define DRM_IOCTL_MGA_ILOAD DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_ILOAD, drm_mga_iload_t)
262#define DRM_IOCTL_MGA_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_BLIT, drm_mga_blit_t)
263#define DRM_IOCTL_MGA_GETPARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_GETPARAM, drm_mga_getparam_t)
264#define DRM_IOCTL_MGA_SET_FENCE DRM_IOW( DRM_COMMAND_BASE + DRM_MGA_SET_FENCE, __u32)
265#define DRM_IOCTL_MGA_WAIT_FENCE DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_WAIT_FENCE, __u32)
266#define DRM_IOCTL_MGA_DMA_BOOTSTRAP DRM_IOWR(DRM_COMMAND_BASE + DRM_MGA_DMA_BOOTSTRAP, drm_mga_dma_bootstrap_t)
267
268typedef struct _drm_mga_warp_index {
269 int installed;
270 unsigned long phys_addr;
271 int size;
272} drm_mga_warp_index_t;
273
274typedef struct drm_mga_init {
275 enum {
276 MGA_INIT_DMA = 0x01,
277 MGA_CLEANUP_DMA = 0x02
278 } func;
279
280 unsigned long sarea_priv_offset;
281
282 __struct_group(/* no tag */, always32bit, /* no attrs */,
283 int chipset;
284 int sgram;
285
286 unsigned int maccess;
287
288 unsigned int fb_cpp;
289 unsigned int front_offset, front_pitch;
290 unsigned int back_offset, back_pitch;
291
292 unsigned int depth_cpp;
293 unsigned int depth_offset, depth_pitch;
294
295 unsigned int texture_offset[MGA_NR_TEX_HEAPS];
296 unsigned int texture_size[MGA_NR_TEX_HEAPS];
297 );
298
299 unsigned long fb_offset;
300 unsigned long mmio_offset;
301 unsigned long status_offset;
302 unsigned long warp_offset;
303 unsigned long primary_offset;
304 unsigned long buffers_offset;
305} drm_mga_init_t;
306
307typedef struct drm_mga_dma_bootstrap {
308 /**
309 * \name AGP texture region
310 *
311 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, these fields will
312 * be filled in with the actual AGP texture settings.
313 *
314 * \warning
315 * If these fields are non-zero, but dma_mga_dma_bootstrap::agp_mode
316 * is zero, it means that PCI memory (most likely through the use of
317 * an IOMMU) is being used for "AGP" textures.
318 */
319 /*@{ */
320 unsigned long texture_handle; /**< Handle used to map AGP textures. */
321 __u32 texture_size; /**< Size of the AGP texture region. */
322 /*@} */
323
324 /**
325 * Requested size of the primary DMA region.
326 *
327 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
328 * filled in with the actual AGP mode. If AGP was not available
329 */
330 __u32 primary_size;
331
332 /**
333 * Requested number of secondary DMA buffers.
334 *
335 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
336 * filled in with the actual number of secondary DMA buffers
337 * allocated. Particularly when PCI DMA is used, this may be
338 * (subtantially) less than the number requested.
339 */
340 __u32 secondary_bin_count;
341
342 /**
343 * Requested size of each secondary DMA buffer.
344 *
345 * While the kernel \b is free to reduce
346 * dma_mga_dma_bootstrap::secondary_bin_count, it is \b not allowed
347 * to reduce dma_mga_dma_bootstrap::secondary_bin_size.
348 */
349 __u32 secondary_bin_size;
350
351 /**
352 * Bit-wise mask of AGPSTAT2_* values. Currently only \c AGPSTAT2_1X,
353 * \c AGPSTAT2_2X, and \c AGPSTAT2_4X are supported. If this value is
354 * zero, it means that PCI DMA should be used, even if AGP is
355 * possible.
356 *
357 * On return from the DRM_MGA_DMA_BOOTSTRAP ioctl, this field will be
358 * filled in with the actual AGP mode. If AGP was not available
359 * (i.e., PCI DMA was used), this value will be zero.
360 */
361 __u32 agp_mode;
362
363 /**
364 * Desired AGP GART size, measured in megabytes.
365 */
366 __u8 agp_size;
367} drm_mga_dma_bootstrap_t;
368
369typedef struct drm_mga_clear {
370 unsigned int flags;
371 unsigned int clear_color;
372 unsigned int clear_depth;
373 unsigned int color_mask;
374 unsigned int depth_mask;
375} drm_mga_clear_t;
376
377typedef struct drm_mga_vertex {
378 int idx; /* buffer to queue */
379 int used; /* bytes in use */
380 int discard; /* client finished with buffer? */
381} drm_mga_vertex_t;
382
383typedef struct drm_mga_indices {
384 int idx; /* buffer to queue */
385 unsigned int start;
386 unsigned int end;
387 int discard; /* client finished with buffer? */
388} drm_mga_indices_t;
389
390typedef struct drm_mga_iload {
391 int idx;
392 unsigned int dstorg;
393 unsigned int length;
394} drm_mga_iload_t;
395
396typedef struct _drm_mga_blit {
397 unsigned int planemask;
398 unsigned int srcorg;
399 unsigned int dstorg;
400 int src_pitch, dst_pitch;
401 int delta_sx, delta_sy;
402 int delta_dx, delta_dy;
403 int height, ydir; /* flip image vertically */
404 int source_pitch, dest_pitch;
405} drm_mga_blit_t;
406
407/* 3.1: An ioctl to get parameters that aren't available to the 3d
408 * client any other way.
409 */
410#define MGA_PARAM_IRQ_NR 1
411
412/* 3.2: Query the actual card type. The DDX only distinguishes between
413 * G200 chips and non-G200 chips, which it calls G400. It turns out that
414 * there are some very sublte differences between the G4x0 chips and the G550
415 * chips. Using this parameter query, a client-side driver can detect the
416 * difference between a G4x0 and a G550.
417 */
418#define MGA_PARAM_CARD_TYPE 2
419
420typedef struct drm_mga_getparam {
421 int param;
422 void *value;
423} drm_mga_getparam_t;
424
425#if defined(__cplusplus)
426}
427#endif
428
429#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/msm_drm.h+30-14
......@@ -67,16 +67,25 @@ struct drm_msm_timespec {
6767 __s64 tv_nsec; /* nanoseconds */
6868};
6969
70#define MSM_PARAM_GPU_ID 0x01
71#define MSM_PARAM_GMEM_SIZE 0x02
72#define MSM_PARAM_CHIP_ID 0x03
73#define MSM_PARAM_MAX_FREQ 0x04
74#define MSM_PARAM_TIMESTAMP 0x05
75#define MSM_PARAM_GMEM_BASE 0x06
76#define MSM_PARAM_PRIORITIES 0x07 /* The # of priority levels */
77#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
78#define MSM_PARAM_FAULTS 0x09
79#define MSM_PARAM_SUSPENDS 0x0a
70/* Below "RO" indicates a read-only param, "WO" indicates write-only, and
71 * "RW" indicates a param that can be both read (GET_PARAM) and written
72 * (SET_PARAM)
73 */
74#define MSM_PARAM_GPU_ID 0x01 /* RO */
75#define MSM_PARAM_GMEM_SIZE 0x02 /* RO */
76#define MSM_PARAM_CHIP_ID 0x03 /* RO */
77#define MSM_PARAM_MAX_FREQ 0x04 /* RO */
78#define MSM_PARAM_TIMESTAMP 0x05 /* RO */
79#define MSM_PARAM_GMEM_BASE 0x06 /* RO */
80#define MSM_PARAM_PRIORITIES 0x07 /* RO: The # of priority levels */
81#define MSM_PARAM_PP_PGTABLE 0x08 /* RO: Deprecated, always returns zero */
82#define MSM_PARAM_FAULTS 0x09 /* RO */
83#define MSM_PARAM_SUSPENDS 0x0a /* RO */
84#define MSM_PARAM_SYSPROF 0x0b /* WO: 1 preserves perfcntrs, 2 also disables suspend */
85#define MSM_PARAM_COMM 0x0c /* WO: override for task->comm */
86#define MSM_PARAM_CMDLINE 0x0d /* WO: override for task cmdline */
87#define MSM_PARAM_VA_START 0x0e /* RO: start of valid GPU iova range */
88#define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */
8089
8190/* For backwards compat. The original support for preemption was based on
8291 * a single ring per priority level so # of priority levels equals the #
......@@ -90,6 +99,8 @@ struct drm_msm_param {
9099 __u32 pipe; /* in, MSM_PIPE_x */
91100 __u32 param; /* in, MSM_PARAM_x */
92101 __u64 value; /* out (get_param) or in (set_param) */
102 __u32 len; /* zero for non-pointer params */
103 __u32 pad; /* must be zero */
93104};
94105
95106/*
......@@ -126,6 +137,8 @@ struct drm_msm_gem_new {
126137#define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */
127138#define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */
128139#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */
140#define MSM_INFO_SET_IOVA 0x04 /* set the iova, passed by value */
141#define MSM_INFO_GET_FLAGS 0x05 /* get the MSM_BO_x flags */
129142
130143struct drm_msm_gem_info {
131144 __u32 handle; /* in */
......@@ -209,10 +222,12 @@ struct drm_msm_gem_submit_cmd {
209222#define MSM_SUBMIT_BO_READ 0x0001
210223#define MSM_SUBMIT_BO_WRITE 0x0002
211224#define MSM_SUBMIT_BO_DUMP 0x0004
225#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
212226
213227#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \
214228 MSM_SUBMIT_BO_WRITE | \
215 MSM_SUBMIT_BO_DUMP)
229 MSM_SUBMIT_BO_DUMP | \
230 MSM_SUBMIT_BO_NO_IMPLICIT)
216231
217232struct drm_msm_gem_submit_bo {
218233 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
......@@ -227,6 +242,7 @@ struct drm_msm_gem_submit_bo {
227242#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */
228243#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */
229244#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */
245#define MSM_SUBMIT_FENCE_SN_IN 0x02000000 /* userspace passes in seqno fence */
230246#define MSM_SUBMIT_FLAGS ( \
231247 MSM_SUBMIT_NO_IMPLICIT | \
232248 MSM_SUBMIT_FENCE_FD_IN | \
......@@ -234,6 +250,7 @@ struct drm_msm_gem_submit_bo {
234250 MSM_SUBMIT_SUDO | \
235251 MSM_SUBMIT_SYNCOBJ_IN | \
236252 MSM_SUBMIT_SYNCOBJ_OUT | \
253 MSM_SUBMIT_FENCE_SN_IN | \
237254 0)
238255
239256#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
......@@ -253,7 +270,7 @@ struct drm_msm_gem_submit_syncobj {
253270 */
254271struct drm_msm_gem_submit {
255272 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */
256 __u32 fence; /* out */
273 __u32 fence; /* out (or in with MSM_SUBMIT_FENCE_SN_IN flag) */
257274 __u32 nr_bos; /* in, number of submit_bo's */
258275 __u32 nr_cmds; /* in, number of submit_cmd's */
259276 __u64 bos; /* in, ptr to array of submit_bo's */
......@@ -333,9 +350,7 @@ struct drm_msm_submitqueue_query {
333350};
334351
335352#define DRM_MSM_GET_PARAM 0x00
336/* placeholder:
337353#define DRM_MSM_SET_PARAM 0x01
338 */
339354#define DRM_MSM_GEM_NEW 0x02
340355#define DRM_MSM_GEM_INFO 0x03
341356#define DRM_MSM_GEM_CPU_PREP 0x04
......@@ -351,6 +366,7 @@ struct drm_msm_submitqueue_query {
351366#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
352367
353368#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
369#define DRM_IOCTL_MSM_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param)
354370#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
355371#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
356372#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
lib/libc/include/any-linux-any/drm/panfrost_drm.h+53-2
......@@ -84,14 +84,14 @@ struct drm_panfrost_wait_bo {
8484 __s64 timeout_ns; /* absolute */
8585};
8686
87/* Valid flags to pass to drm_panfrost_create_bo */
8788#define PANFROST_BO_NOEXEC 1
8889#define PANFROST_BO_HEAP 2
8990
9091/**
9192 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
9293 *
93 * There are currently no values for the flags argument, but it may be
94 * used in a future extension.
94 * The flags argument is a bit mask of PANFROST_BO_* flags.
9595 */
9696struct drm_panfrost_create_bo {
9797 __u32 size;
......@@ -224,6 +224,57 @@ struct drm_panfrost_madvise {
224224 __u32 retained; /* out, whether backing store still exists */
225225};
226226
227/* Definitions for coredump decoding in user space */
228#define PANFROSTDUMP_MAJOR 1
229#define PANFROSTDUMP_MINOR 0
230
231#define PANFROSTDUMP_MAGIC 0x464E4150 /* PANF */
232
233#define PANFROSTDUMP_BUF_REG 0
234#define PANFROSTDUMP_BUF_BOMAP (PANFROSTDUMP_BUF_REG + 1)
235#define PANFROSTDUMP_BUF_BO (PANFROSTDUMP_BUF_BOMAP + 1)
236#define PANFROSTDUMP_BUF_TRAILER (PANFROSTDUMP_BUF_BO + 1)
237
238/*
239 * This structure is the native endianness of the dumping machine, tools can
240 * detect the endianness by looking at the value in 'magic'.
241 */
242struct panfrost_dump_object_header {
243 __u32 magic;
244 __u32 type;
245 __u32 file_size;
246 __u32 file_offset;
247
248 union {
249 struct {
250 __u64 jc;
251 __u32 gpu_id;
252 __u32 major;
253 __u32 minor;
254 __u64 nbos;
255 } reghdr;
256
257 struct {
258 __u32 valid;
259 __u64 iova;
260 __u32 data[2];
261 } bomap;
262
263 /*
264 * Force same size in case we want to expand the header
265 * with new fields and also keep it 512-byte aligned
266 */
267
268 __u32 sizer[496];
269 };
270};
271
272/* Registers object, an array of these */
273struct panfrost_dump_registers {
274 __u32 reg;
275 __u32 value;
276};
277
227278#if defined(__cplusplus)
228279}
229280#endif
lib/libc/include/any-linux-any/drm/r128_drm.h deleted-336
......@@ -1,336 +0,0 @@
1/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
2 * Created: Wed Apr 5 19:24:19 2000 by kevin@precisioninsight.com
3 */
4/*
5 * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
7 * All rights reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
27 *
28 * Authors:
29 * Gareth Hughes <gareth@valinux.com>
30 * Kevin E. Martin <martin@valinux.com>
31 */
32
33#ifndef __R128_DRM_H__
34#define __R128_DRM_H__
35
36#include "drm.h"
37
38#if defined(__cplusplus)
39extern "C" {
40#endif
41
42/* WARNING: If you change any of these defines, make sure to change the
43 * defines in the X server file (r128_sarea.h)
44 */
45#ifndef __R128_SAREA_DEFINES__
46#define __R128_SAREA_DEFINES__
47
48/* What needs to be changed for the current vertex buffer?
49 */
50#define R128_UPLOAD_CONTEXT 0x001
51#define R128_UPLOAD_SETUP 0x002
52#define R128_UPLOAD_TEX0 0x004
53#define R128_UPLOAD_TEX1 0x008
54#define R128_UPLOAD_TEX0IMAGES 0x010
55#define R128_UPLOAD_TEX1IMAGES 0x020
56#define R128_UPLOAD_CORE 0x040
57#define R128_UPLOAD_MASKS 0x080
58#define R128_UPLOAD_WINDOW 0x100
59#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
60#define R128_REQUIRE_QUIESCENCE 0x400
61#define R128_UPLOAD_ALL 0x7ff
62
63#define R128_FRONT 0x1
64#define R128_BACK 0x2
65#define R128_DEPTH 0x4
66
67/* Primitive types
68 */
69#define R128_POINTS 0x1
70#define R128_LINES 0x2
71#define R128_LINE_STRIP 0x3
72#define R128_TRIANGLES 0x4
73#define R128_TRIANGLE_FAN 0x5
74#define R128_TRIANGLE_STRIP 0x6
75
76/* Vertex/indirect buffer size
77 */
78#define R128_BUFFER_SIZE 16384
79
80/* Byte offsets for indirect buffer data
81 */
82#define R128_INDEX_PRIM_OFFSET 20
83#define R128_HOSTDATA_BLIT_OFFSET 32
84
85/* Keep these small for testing.
86 */
87#define R128_NR_SAREA_CLIPRECTS 12
88
89/* There are 2 heaps (local/AGP). Each region within a heap is a
90 * minimum of 64k, and there are at most 64 of them per heap.
91 */
92#define R128_LOCAL_TEX_HEAP 0
93#define R128_AGP_TEX_HEAP 1
94#define R128_NR_TEX_HEAPS 2
95#define R128_NR_TEX_REGIONS 64
96#define R128_LOG_TEX_GRANULARITY 16
97
98#define R128_NR_CONTEXT_REGS 12
99
100#define R128_MAX_TEXTURE_LEVELS 11
101#define R128_MAX_TEXTURE_UNITS 2
102
103#endif /* __R128_SAREA_DEFINES__ */
104
105typedef struct {
106 /* Context state - can be written in one large chunk */
107 unsigned int dst_pitch_offset_c;
108 unsigned int dp_gui_master_cntl_c;
109 unsigned int sc_top_left_c;
110 unsigned int sc_bottom_right_c;
111 unsigned int z_offset_c;
112 unsigned int z_pitch_c;
113 unsigned int z_sten_cntl_c;
114 unsigned int tex_cntl_c;
115 unsigned int misc_3d_state_cntl_reg;
116 unsigned int texture_clr_cmp_clr_c;
117 unsigned int texture_clr_cmp_msk_c;
118 unsigned int fog_color_c;
119
120 /* Texture state */
121 unsigned int tex_size_pitch_c;
122 unsigned int constant_color_c;
123
124 /* Setup state */
125 unsigned int pm4_vc_fpu_setup;
126 unsigned int setup_cntl;
127
128 /* Mask state */
129 unsigned int dp_write_mask;
130 unsigned int sten_ref_mask_c;
131 unsigned int plane_3d_mask_c;
132
133 /* Window state */
134 unsigned int window_xy_offset;
135
136 /* Core state */
137 unsigned int scale_3d_cntl;
138} drm_r128_context_regs_t;
139
140/* Setup registers for each texture unit
141 */
142typedef struct {
143 unsigned int tex_cntl;
144 unsigned int tex_combine_cntl;
145 unsigned int tex_size_pitch;
146 unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
147 unsigned int tex_border_color;
148} drm_r128_texture_regs_t;
149
150typedef struct drm_r128_sarea {
151 /* The channel for communication of state information to the kernel
152 * on firing a vertex buffer.
153 */
154 drm_r128_context_regs_t context_state;
155 drm_r128_texture_regs_t tex_state[R128_MAX_TEXTURE_UNITS];
156 unsigned int dirty;
157 unsigned int vertsize;
158 unsigned int vc_format;
159
160 /* The current cliprects, or a subset thereof.
161 */
162 struct drm_clip_rect boxes[R128_NR_SAREA_CLIPRECTS];
163 unsigned int nbox;
164
165 /* Counters for client-side throttling of rendering clients.
166 */
167 unsigned int last_frame;
168 unsigned int last_dispatch;
169
170 struct drm_tex_region tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
171 unsigned int tex_age[R128_NR_TEX_HEAPS];
172 int ctx_owner;
173 int pfAllowPageFlip; /* number of 3d windows (0,1,2 or more) */
174 int pfCurrentPage; /* which buffer is being displayed? */
175} drm_r128_sarea_t;
176
177/* WARNING: If you change any of these defines, make sure to change the
178 * defines in the Xserver file (xf86drmR128.h)
179 */
180
181/* Rage 128 specific ioctls
182 * The device specific ioctl range is 0x40 to 0x79.
183 */
184#define DRM_R128_INIT 0x00
185#define DRM_R128_CCE_START 0x01
186#define DRM_R128_CCE_STOP 0x02
187#define DRM_R128_CCE_RESET 0x03
188#define DRM_R128_CCE_IDLE 0x04
189/* 0x05 not used */
190#define DRM_R128_RESET 0x06
191#define DRM_R128_SWAP 0x07
192#define DRM_R128_CLEAR 0x08
193#define DRM_R128_VERTEX 0x09
194#define DRM_R128_INDICES 0x0a
195#define DRM_R128_BLIT 0x0b
196#define DRM_R128_DEPTH 0x0c
197#define DRM_R128_STIPPLE 0x0d
198/* 0x0e not used */
199#define DRM_R128_INDIRECT 0x0f
200#define DRM_R128_FULLSCREEN 0x10
201#define DRM_R128_CLEAR2 0x11
202#define DRM_R128_GETPARAM 0x12
203#define DRM_R128_FLIP 0x13
204
205#define DRM_IOCTL_R128_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
206#define DRM_IOCTL_R128_CCE_START DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_START)
207#define DRM_IOCTL_R128_CCE_STOP DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
208#define DRM_IOCTL_R128_CCE_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
209#define DRM_IOCTL_R128_CCE_IDLE DRM_IO( DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
210/* 0x05 not used */
211#define DRM_IOCTL_R128_RESET DRM_IO( DRM_COMMAND_BASE + DRM_R128_RESET)
212#define DRM_IOCTL_R128_SWAP DRM_IO( DRM_COMMAND_BASE + DRM_R128_SWAP)
213#define DRM_IOCTL_R128_CLEAR DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
214#define DRM_IOCTL_R128_VERTEX DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
215#define DRM_IOCTL_R128_INDICES DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
216#define DRM_IOCTL_R128_BLIT DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
217#define DRM_IOCTL_R128_DEPTH DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
218#define DRM_IOCTL_R128_STIPPLE DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
219/* 0x0e not used */
220#define DRM_IOCTL_R128_INDIRECT DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
221#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
222#define DRM_IOCTL_R128_CLEAR2 DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
223#define DRM_IOCTL_R128_GETPARAM DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
224#define DRM_IOCTL_R128_FLIP DRM_IO( DRM_COMMAND_BASE + DRM_R128_FLIP)
225
226typedef struct drm_r128_init {
227 enum {
228 R128_INIT_CCE = 0x01,
229 R128_CLEANUP_CCE = 0x02
230 } func;
231 unsigned long sarea_priv_offset;
232 int is_pci;
233 int cce_mode;
234 int cce_secure;
235 int ring_size;
236 int usec_timeout;
237
238 unsigned int fb_bpp;
239 unsigned int front_offset, front_pitch;
240 unsigned int back_offset, back_pitch;
241 unsigned int depth_bpp;
242 unsigned int depth_offset, depth_pitch;
243 unsigned int span_offset;
244
245 unsigned long fb_offset;
246 unsigned long mmio_offset;
247 unsigned long ring_offset;
248 unsigned long ring_rptr_offset;
249 unsigned long buffers_offset;
250 unsigned long agp_textures_offset;
251} drm_r128_init_t;
252
253typedef struct drm_r128_cce_stop {
254 int flush;
255 int idle;
256} drm_r128_cce_stop_t;
257
258typedef struct drm_r128_clear {
259 unsigned int flags;
260 unsigned int clear_color;
261 unsigned int clear_depth;
262 unsigned int color_mask;
263 unsigned int depth_mask;
264} drm_r128_clear_t;
265
266typedef struct drm_r128_vertex {
267 int prim;
268 int idx; /* Index of vertex buffer */
269 int count; /* Number of vertices in buffer */
270 int discard; /* Client finished with buffer? */
271} drm_r128_vertex_t;
272
273typedef struct drm_r128_indices {
274 int prim;
275 int idx;
276 int start;
277 int end;
278 int discard; /* Client finished with buffer? */
279} drm_r128_indices_t;
280
281typedef struct drm_r128_blit {
282 int idx;
283 int pitch;
284 int offset;
285 int format;
286 unsigned short x, y;
287 unsigned short width, height;
288} drm_r128_blit_t;
289
290typedef struct drm_r128_depth {
291 enum {
292 R128_WRITE_SPAN = 0x01,
293 R128_WRITE_PIXELS = 0x02,
294 R128_READ_SPAN = 0x03,
295 R128_READ_PIXELS = 0x04
296 } func;
297 int n;
298 int *x;
299 int *y;
300 unsigned int *buffer;
301 unsigned char *mask;
302} drm_r128_depth_t;
303
304typedef struct drm_r128_stipple {
305 unsigned int *mask;
306} drm_r128_stipple_t;
307
308typedef struct drm_r128_indirect {
309 int idx;
310 int start;
311 int end;
312 int discard;
313} drm_r128_indirect_t;
314
315typedef struct drm_r128_fullscreen {
316 enum {
317 R128_INIT_FULLSCREEN = 0x01,
318 R128_CLEANUP_FULLSCREEN = 0x02
319 } func;
320} drm_r128_fullscreen_t;
321
322/* 2.3: An ioctl to get parameters that aren't available to the 3d
323 * client any other way.
324 */
325#define R128_PARAM_IRQ_NR 1
326
327typedef struct drm_r128_getparam {
328 int param;
329 void *value;
330} drm_r128_getparam_t;
331
332#if defined(__cplusplus)
333}
334#endif
335
336#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/savage_drm.h deleted-220
......@@ -1,220 +0,0 @@
1/* savage_drm.h -- Public header for the savage driver
2 *
3 * Copyright 2004 Felix Kuehling
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sub license,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26#ifndef __SAVAGE_DRM_H__
27#define __SAVAGE_DRM_H__
28
29#include "drm.h"
30
31#if defined(__cplusplus)
32extern "C" {
33#endif
34
35#ifndef __SAVAGE_SAREA_DEFINES__
36#define __SAVAGE_SAREA_DEFINES__
37
38/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
39 * regions, subject to a minimum region size of (1<<16) == 64k.
40 *
41 * Clients may subdivide regions internally, but when sharing between
42 * clients, the region size is the minimum granularity.
43 */
44
45#define SAVAGE_CARD_HEAP 0
46#define SAVAGE_AGP_HEAP 1
47#define SAVAGE_NR_TEX_HEAPS 2
48#define SAVAGE_NR_TEX_REGIONS 16
49#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16
50
51#endif /* __SAVAGE_SAREA_DEFINES__ */
52
53typedef struct _drm_savage_sarea {
54 /* LRU lists for texture memory in agp space and on the card.
55 */
56 struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
57 1];
58 unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
59
60 /* Mechanism to validate card state.
61 */
62 int ctxOwner;
63} drm_savage_sarea_t, *drm_savage_sarea_ptr;
64
65/* Savage-specific ioctls
66 */
67#define DRM_SAVAGE_BCI_INIT 0x00
68#define DRM_SAVAGE_BCI_CMDBUF 0x01
69#define DRM_SAVAGE_BCI_EVENT_EMIT 0x02
70#define DRM_SAVAGE_BCI_EVENT_WAIT 0x03
71
72#define DRM_IOCTL_SAVAGE_BCI_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
73#define DRM_IOCTL_SAVAGE_BCI_CMDBUF DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
74#define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
75#define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
76
77#define SAVAGE_DMA_PCI 1
78#define SAVAGE_DMA_AGP 3
79typedef struct drm_savage_init {
80 enum {
81 SAVAGE_INIT_BCI = 1,
82 SAVAGE_CLEANUP_BCI = 2
83 } func;
84 unsigned int sarea_priv_offset;
85
86 /* some parameters */
87 unsigned int cob_size;
88 unsigned int bci_threshold_lo, bci_threshold_hi;
89 unsigned int dma_type;
90
91 /* frame buffer layout */
92 unsigned int fb_bpp;
93 unsigned int front_offset, front_pitch;
94 unsigned int back_offset, back_pitch;
95 unsigned int depth_bpp;
96 unsigned int depth_offset, depth_pitch;
97
98 /* local textures */
99 unsigned int texture_offset;
100 unsigned int texture_size;
101
102 /* physical locations of non-permanent maps */
103 unsigned long status_offset;
104 unsigned long buffers_offset;
105 unsigned long agp_textures_offset;
106 unsigned long cmd_dma_offset;
107} drm_savage_init_t;
108
109typedef union drm_savage_cmd_header drm_savage_cmd_header_t;
110typedef struct drm_savage_cmdbuf {
111 /* command buffer in client's address space */
112 drm_savage_cmd_header_t *cmd_addr;
113 unsigned int size; /* size of the command buffer in 64bit units */
114
115 unsigned int dma_idx; /* DMA buffer index to use */
116 int discard; /* discard DMA buffer when done */
117 /* vertex buffer in client's address space */
118 unsigned int *vb_addr;
119 unsigned int vb_size; /* size of client vertex buffer in bytes */
120 unsigned int vb_stride; /* stride of vertices in 32bit words */
121 /* boxes in client's address space */
122 struct drm_clip_rect *box_addr;
123 unsigned int nbox; /* number of clipping boxes */
124} drm_savage_cmdbuf_t;
125
126#define SAVAGE_WAIT_2D 0x1 /* wait for 2D idle before updating event tag */
127#define SAVAGE_WAIT_3D 0x2 /* wait for 3D idle before updating event tag */
128#define SAVAGE_WAIT_IRQ 0x4 /* emit or wait for IRQ, not implemented yet */
129typedef struct drm_savage_event {
130 unsigned int count;
131 unsigned int flags;
132} drm_savage_event_emit_t, drm_savage_event_wait_t;
133
134/* Commands for the cmdbuf ioctl
135 */
136#define SAVAGE_CMD_STATE 0 /* a range of state registers */
137#define SAVAGE_CMD_DMA_PRIM 1 /* vertices from DMA buffer */
138#define SAVAGE_CMD_VB_PRIM 2 /* vertices from client vertex buffer */
139#define SAVAGE_CMD_DMA_IDX 3 /* indexed vertices from DMA buffer */
140#define SAVAGE_CMD_VB_IDX 4 /* indexed vertices client vertex buffer */
141#define SAVAGE_CMD_CLEAR 5 /* clear buffers */
142#define SAVAGE_CMD_SWAP 6 /* swap buffers */
143
144/* Primitive types
145*/
146#define SAVAGE_PRIM_TRILIST 0 /* triangle list */
147#define SAVAGE_PRIM_TRISTRIP 1 /* triangle strip */
148#define SAVAGE_PRIM_TRIFAN 2 /* triangle fan */
149#define SAVAGE_PRIM_TRILIST_201 3 /* reorder verts for correct flat
150 * shading on s3d */
151
152/* Skip flags (vertex format)
153 */
154#define SAVAGE_SKIP_Z 0x01
155#define SAVAGE_SKIP_W 0x02
156#define SAVAGE_SKIP_C0 0x04
157#define SAVAGE_SKIP_C1 0x08
158#define SAVAGE_SKIP_S0 0x10
159#define SAVAGE_SKIP_T0 0x20
160#define SAVAGE_SKIP_ST0 0x30
161#define SAVAGE_SKIP_S1 0x40
162#define SAVAGE_SKIP_T1 0x80
163#define SAVAGE_SKIP_ST1 0xc0
164#define SAVAGE_SKIP_ALL_S3D 0x3f
165#define SAVAGE_SKIP_ALL_S4 0xff
166
167/* Buffer names for clear command
168 */
169#define SAVAGE_FRONT 0x1
170#define SAVAGE_BACK 0x2
171#define SAVAGE_DEPTH 0x4
172
173/* 64-bit command header
174 */
175union drm_savage_cmd_header {
176 struct {
177 unsigned char cmd; /* command */
178 unsigned char pad0;
179 unsigned short pad1;
180 unsigned short pad2;
181 unsigned short pad3;
182 } cmd; /* generic */
183 struct {
184 unsigned char cmd;
185 unsigned char global; /* need idle engine? */
186 unsigned short count; /* number of consecutive registers */
187 unsigned short start; /* first register */
188 unsigned short pad3;
189 } state; /* SAVAGE_CMD_STATE */
190 struct {
191 unsigned char cmd;
192 unsigned char prim; /* primitive type */
193 unsigned short skip; /* vertex format (skip flags) */
194 unsigned short count; /* number of vertices */
195 unsigned short start; /* first vertex in DMA/vertex buffer */
196 } prim; /* SAVAGE_CMD_DMA_PRIM, SAVAGE_CMD_VB_PRIM */
197 struct {
198 unsigned char cmd;
199 unsigned char prim;
200 unsigned short skip;
201 unsigned short count; /* number of indices that follow */
202 unsigned short pad3;
203 } idx; /* SAVAGE_CMD_DMA_IDX, SAVAGE_CMD_VB_IDX */
204 struct {
205 unsigned char cmd;
206 unsigned char pad0;
207 unsigned short pad1;
208 unsigned int flags;
209 } clear0; /* SAVAGE_CMD_CLEAR */
210 struct {
211 unsigned int mask;
212 unsigned int value;
213 } clear1; /* SAVAGE_CMD_CLEAR data */
214};
215
216#if defined(__cplusplus)
217}
218#endif
219
220#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/sis_drm.h deleted-77
......@@ -1,77 +0,0 @@
1/* sis_drv.h -- Private header for sis driver -*- linux-c -*- */
2/*
3 * Copyright 2005 Eric Anholt
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27#ifndef __SIS_DRM_H__
28#define __SIS_DRM_H__
29
30#include "drm.h"
31
32#if defined(__cplusplus)
33extern "C" {
34#endif
35
36/* SiS specific ioctls */
37#define NOT_USED_0_3
38#define DRM_SIS_FB_ALLOC 0x04
39#define DRM_SIS_FB_FREE 0x05
40#define NOT_USED_6_12
41#define DRM_SIS_AGP_INIT 0x13
42#define DRM_SIS_AGP_ALLOC 0x14
43#define DRM_SIS_AGP_FREE 0x15
44#define DRM_SIS_FB_INIT 0x16
45
46#define DRM_IOCTL_SIS_FB_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_FB_ALLOC, drm_sis_mem_t)
47#define DRM_IOCTL_SIS_FB_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_FREE, drm_sis_mem_t)
48#define DRM_IOCTL_SIS_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_INIT, drm_sis_agp_t)
49#define DRM_IOCTL_SIS_AGP_ALLOC DRM_IOWR(DRM_COMMAND_BASE + DRM_SIS_AGP_ALLOC, drm_sis_mem_t)
50#define DRM_IOCTL_SIS_AGP_FREE DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_AGP_FREE, drm_sis_mem_t)
51#define DRM_IOCTL_SIS_FB_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_SIS_FB_INIT, drm_sis_fb_t)
52/*
53#define DRM_IOCTL_SIS_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
54#define DRM_IOCTL_SIS_FLIP_INIT DRM_IO( 0x49)
55#define DRM_IOCTL_SIS_FLIP_FINAL DRM_IO( 0x50)
56*/
57
58typedef struct {
59 int context;
60 unsigned long offset;
61 unsigned long size;
62 unsigned long free;
63} drm_sis_mem_t;
64
65typedef struct {
66 unsigned long offset, size;
67} drm_sis_agp_t;
68
69typedef struct {
70 unsigned long offset, size;
71} drm_sis_fb_t;
72
73#if defined(__cplusplus)
74}
75#endif
76
77#endif /* __SIS_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/via_drm.h deleted-282
......@@ -1,282 +0,0 @@
1/*
2 * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24#ifndef _VIA_DRM_H_
25#define _VIA_DRM_H_
26
27#include "drm.h"
28
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33/* WARNING: These defines must be the same as what the Xserver uses.
34 * if you change them, you must change the defines in the Xserver.
35 */
36
37#ifndef _VIA_DEFINES_
38#define _VIA_DEFINES_
39
40
41#define VIA_NR_SAREA_CLIPRECTS 8
42#define VIA_NR_XVMC_PORTS 10
43#define VIA_NR_XVMC_LOCKS 5
44#define VIA_MAX_CACHELINE_SIZE 64
45#define XVMCLOCKPTR(saPriv,lockNo) \
46 ((__volatile__ struct drm_hw_lock *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
47 (VIA_MAX_CACHELINE_SIZE - 1)) & \
48 ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
49 VIA_MAX_CACHELINE_SIZE*(lockNo)))
50
51/* Each region is a minimum of 64k, and there are at most 64 of them.
52 */
53#define VIA_NR_TEX_REGIONS 64
54#define VIA_LOG_MIN_TEX_REGION_SIZE 16
55#endif
56
57#define VIA_UPLOAD_TEX0IMAGE 0x1 /* handled clientside */
58#define VIA_UPLOAD_TEX1IMAGE 0x2 /* handled clientside */
59#define VIA_UPLOAD_CTX 0x4
60#define VIA_UPLOAD_BUFFERS 0x8
61#define VIA_UPLOAD_TEX0 0x10
62#define VIA_UPLOAD_TEX1 0x20
63#define VIA_UPLOAD_CLIPRECTS 0x40
64#define VIA_UPLOAD_ALL 0xff
65
66/* VIA specific ioctls */
67#define DRM_VIA_ALLOCMEM 0x00
68#define DRM_VIA_FREEMEM 0x01
69#define DRM_VIA_AGP_INIT 0x02
70#define DRM_VIA_FB_INIT 0x03
71#define DRM_VIA_MAP_INIT 0x04
72#define DRM_VIA_DEC_FUTEX 0x05
73#define NOT_USED
74#define DRM_VIA_DMA_INIT 0x07
75#define DRM_VIA_CMDBUFFER 0x08
76#define DRM_VIA_FLUSH 0x09
77#define DRM_VIA_PCICMD 0x0a
78#define DRM_VIA_CMDBUF_SIZE 0x0b
79#define NOT_USED
80#define DRM_VIA_WAIT_IRQ 0x0d
81#define DRM_VIA_DMA_BLIT 0x0e
82#define DRM_VIA_BLIT_SYNC 0x0f
83
84#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
85#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
86#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
87#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
88#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
89#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
90#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
91#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
92#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
93#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
94#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
95 drm_via_cmdbuf_size_t)
96#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
97#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
98#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
99
100/* Indices into buf.Setup where various bits of state are mirrored per
101 * context and per buffer. These can be fired at the card as a unit,
102 * or in a piecewise fashion as required.
103 */
104
105#define VIA_TEX_SETUP_SIZE 8
106
107/* Flags for clear ioctl
108 */
109#define VIA_FRONT 0x1
110#define VIA_BACK 0x2
111#define VIA_DEPTH 0x4
112#define VIA_STENCIL 0x8
113#define VIA_MEM_VIDEO 0 /* matches drm constant */
114#define VIA_MEM_AGP 1 /* matches drm constant */
115#define VIA_MEM_SYSTEM 2
116#define VIA_MEM_MIXED 3
117#define VIA_MEM_UNKNOWN 4
118
119typedef struct {
120 __u32 offset;
121 __u32 size;
122} drm_via_agp_t;
123
124typedef struct {
125 __u32 offset;
126 __u32 size;
127} drm_via_fb_t;
128
129typedef struct {
130 __u32 context;
131 __u32 type;
132 __u32 size;
133 unsigned long index;
134 unsigned long offset;
135} drm_via_mem_t;
136
137typedef struct _drm_via_init {
138 enum {
139 VIA_INIT_MAP = 0x01,
140 VIA_CLEANUP_MAP = 0x02
141 } func;
142
143 unsigned long sarea_priv_offset;
144 unsigned long fb_offset;
145 unsigned long mmio_offset;
146 unsigned long agpAddr;
147} drm_via_init_t;
148
149typedef struct _drm_via_futex {
150 enum {
151 VIA_FUTEX_WAIT = 0x00,
152 VIA_FUTEX_WAKE = 0X01
153 } func;
154 __u32 ms;
155 __u32 lock;
156 __u32 val;
157} drm_via_futex_t;
158
159typedef struct _drm_via_dma_init {
160 enum {
161 VIA_INIT_DMA = 0x01,
162 VIA_CLEANUP_DMA = 0x02,
163 VIA_DMA_INITIALIZED = 0x03
164 } func;
165
166 unsigned long offset;
167 unsigned long size;
168 unsigned long reg_pause_addr;
169} drm_via_dma_init_t;
170
171typedef struct _drm_via_cmdbuffer {
172 char *buf;
173 unsigned long size;
174} drm_via_cmdbuffer_t;
175
176/* Warning: If you change the SAREA structure you must change the Xserver
177 * structure as well */
178
179typedef struct _drm_via_tex_region {
180 unsigned char next, prev; /* indices to form a circular LRU */
181 unsigned char inUse; /* owned by a client, or free? */
182 int age; /* tracked by clients to update local LRU's */
183} drm_via_tex_region_t;
184
185typedef struct _drm_via_sarea {
186 unsigned int dirty;
187 unsigned int nbox;
188 struct drm_clip_rect boxes[VIA_NR_SAREA_CLIPRECTS];
189 drm_via_tex_region_t texList[VIA_NR_TEX_REGIONS + 1];
190 int texAge; /* last time texture was uploaded */
191 int ctxOwner; /* last context to upload state */
192 int vertexPrim;
193
194 /*
195 * Below is for XvMC.
196 * We want the lock integers alone on, and aligned to, a cache line.
197 * Therefore this somewhat strange construct.
198 */
199
200 char XvMCLockArea[VIA_MAX_CACHELINE_SIZE * (VIA_NR_XVMC_LOCKS + 1)];
201
202 unsigned int XvMCDisplaying[VIA_NR_XVMC_PORTS];
203 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
204 unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
205
206 /* Used by the 3d driver only at this point, for pageflipping:
207 */
208 unsigned int pfCurrentOffset;
209} drm_via_sarea_t;
210
211typedef struct _drm_via_cmdbuf_size {
212 enum {
213 VIA_CMDBUF_SPACE = 0x01,
214 VIA_CMDBUF_LAG = 0x02
215 } func;
216 int wait;
217 __u32 size;
218} drm_via_cmdbuf_size_t;
219
220typedef enum {
221 VIA_IRQ_ABSOLUTE = 0x0,
222 VIA_IRQ_RELATIVE = 0x1,
223 VIA_IRQ_SIGNAL = 0x10000000,
224 VIA_IRQ_FORCE_SEQUENCE = 0x20000000
225} via_irq_seq_type_t;
226
227#define VIA_IRQ_FLAGS_MASK 0xF0000000
228
229enum drm_via_irqs {
230 drm_via_irq_hqv0 = 0,
231 drm_via_irq_hqv1,
232 drm_via_irq_dma0_dd,
233 drm_via_irq_dma0_td,
234 drm_via_irq_dma1_dd,
235 drm_via_irq_dma1_td,
236 drm_via_irq_num
237};
238
239struct drm_via_wait_irq_request {
240 unsigned irq;
241 via_irq_seq_type_t type;
242 __u32 sequence;
243 __u32 signal;
244};
245
246typedef union drm_via_irqwait {
247 struct drm_via_wait_irq_request request;
248 struct drm_wait_vblank_reply reply;
249} drm_via_irqwait_t;
250
251typedef struct drm_via_blitsync {
252 __u32 sync_handle;
253 unsigned engine;
254} drm_via_blitsync_t;
255
256/* - * Below,"flags" is currently unused but will be used for possible future
257 * extensions like kernel space bounce buffers for bad alignments and
258 * blit engine busy-wait polling for better latency in the absence of
259 * interrupts.
260 */
261
262typedef struct drm_via_dmablit {
263 __u32 num_lines;
264 __u32 line_length;
265
266 __u32 fb_addr;
267 __u32 fb_stride;
268
269 unsigned char *mem_addr;
270 __u32 mem_stride;
271
272 __u32 flags;
273 int to_fb;
274
275 drm_via_blitsync_t sync;
276} drm_via_dmablit_t;
277
278#if defined(__cplusplus)
279}
280#endif
281
282#endif /* _VIA_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/virtgpu_drm.h+1
......@@ -64,6 +64,7 @@ struct drm_virtgpu_map {
6464 __u32 pad;
6565};
6666
67/* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */
6768struct drm_virtgpu_execbuffer {
6869 __u32 flags;
6970 __u32 size;
lib/libc/include/any-linux-any/drm/vmwgfx_drm.h+9-1
......@@ -1,6 +1,6 @@
11/**************************************************************************
22 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
3 * Copyright © 2009-2022 VMware, Inc., Palo Alto, CA., USA
44 * All Rights Reserved.
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a
......@@ -92,6 +92,12 @@ extern "C" {
9292 *
9393 * DRM_VMW_PARAM_SM5
9494 * SM5 support is enabled.
95 *
96 * DRM_VMW_PARAM_GL43
97 * SM5.1+GL4.3 support is enabled.
98 *
99 * DRM_VMW_PARAM_DEVICE_ID
100 * PCI ID of the underlying SVGA device.
95101 */
96102
97103#define DRM_VMW_PARAM_NUM_STREAMS 0
......@@ -110,6 +116,8 @@ extern "C" {
110116#define DRM_VMW_PARAM_HW_CAPS2 13
111117#define DRM_VMW_PARAM_SM4_1 14
112118#define DRM_VMW_PARAM_SM5 15
119#define DRM_VMW_PARAM_GL43 16
120#define DRM_VMW_PARAM_DEVICE_ID 17
113121
114122/**
115123 * enum drm_vmw_handle_type - handle type for ref ioctls
lib/libc/include/any-linux-any/linux/acct.h+2-1
......@@ -97,12 +97,13 @@ struct acct_v3
9797/*
9898 * accounting flags
9999 */
100 /* bit set when the process ... */
100 /* bit set when the process/task ... */
101101#define AFORK 0x01 /* ... executed fork, but did not exec */
102102#define ASU 0x02 /* ... used super-user privileges */
103103#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
104104#define ACORE 0x08 /* ... dumped core */
105105#define AXSIG 0x10 /* ... was killed by a signal */
106#define AGROUP 0x20 /* ... was the last task of the process (task group) */
106107
107108#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
108109#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
lib/libc/include/any-linux-any/linux/acrn.h+2-3
......@@ -12,7 +12,6 @@
1212#define _ACRN_H
1313
1414#include <linux/types.h>
15#include <linux/uuid.h>
1615
1716#define ACRN_IO_REQUEST_MAX 16
1817
......@@ -186,7 +185,7 @@ struct acrn_ioreq_notify {
186185 * @reserved0: Reserved and must be 0
187186 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor.
188187 * @reserved1: Reserved and must be 0
189 * @uuid: UUID of the VM. Pass to hypervisor directly.
188 * @uuid: Empty space never to be used again (used to be UUID of the VM)
190189 * @vm_flag: Flag of the VM creating. Pass to hypervisor directly.
191190 * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to
192191 * hypervisor directly.
......@@ -198,7 +197,7 @@ struct acrn_vm_creation {
198197 __u16 reserved0;
199198 __u16 vcpu_num;
200199 __u16 reserved1;
201 guid_t uuid;
200 __u8 uuid[16];
202201 __u64 vm_flag;
203202 __u64 ioreq_buf;
204203 __u64 cpu_affinity;
lib/libc/include/any-linux-any/linux/agpgart.h+4-5
......@@ -51,7 +51,6 @@
5151#endif
5252
5353#include <linux/types.h>
54#include <stdlib.h>
5554
5655struct agp_version {
5756 __u16 major;
......@@ -63,10 +62,10 @@ typedef struct _agp_info {
6362 __u32 bridge_id; /* bridge vendor/device */
6463 __u32 agp_mode; /* mode info of bridge */
6564 unsigned long aper_base;/* base of aperture */
66 size_t aper_size; /* size of aperture */
67 size_t pg_total; /* max pages (swap + system) */
68 size_t pg_system; /* max pages (system) */
69 size_t pg_used; /* current pages used */
65 __kernel_size_t aper_size; /* size of aperture */
66 __kernel_size_t pg_total; /* max pages (swap + system) */
67 __kernel_size_t pg_system; /* max pages (system) */
68 __kernel_size_t pg_used; /* current pages used */
7069} agp_info;
7170
7271typedef struct _agp_setup {
lib/libc/include/any-linux-any/linux/android/binder.h+25-3
......@@ -236,6 +236,21 @@ struct binder_frozen_status_info {
236236 __u32 async_recv;
237237};
238238
239/* struct binder_extened_error - extended error information
240 * @id: identifier for the failed operation
241 * @command: command as defined by binder_driver_return_protocol
242 * @param: parameter holding a negative errno value
243 *
244 * Used with BINDER_GET_EXTENDED_ERROR. This extends the error information
245 * returned by the driver upon a failed operation. Userspace can pull this
246 * data to properly handle specific error scenarios.
247 */
248struct binder_extended_error {
249 __u32 id;
250 __u32 command;
251 __s32 param;
252};
253
239254#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
240255#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
241256#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
......@@ -249,6 +264,7 @@ struct binder_frozen_status_info {
249264#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
250265#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
251266#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
267#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error)
252268
253269/*
254270 * NOTE: Two special error codes you should check for when calling
......@@ -271,6 +287,7 @@ enum transaction_flags {
271287 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
272288 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
273289 TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */
290 TF_UPDATE_TXN = 0x40, /* update the outdated pending async txn */
274291};
275292
276293struct binder_transaction_data {
......@@ -288,8 +305,8 @@ struct binder_transaction_data {
288305
289306 /* General information about the transaction. */
290307 __u32 flags;
291 pid_t sender_pid;
292 uid_t sender_euid;
308 __kernel_pid_t sender_pid;
309 __kernel_uid32_t sender_euid;
293310 binder_size_t data_size; /* number of bytes of data */
294311 binder_size_t offsets_size; /* number of bytes of offsets */
295312
......@@ -433,7 +450,7 @@ enum binder_driver_return_protocol {
433450
434451 BR_FROZEN_REPLY = _IO('r', 18),
435452 /*
436 * The target of the last transaction (either a bcTRANSACTION or
453 * The target of the last sync transaction (either a bcTRANSACTION or
437454 * a bcATTEMPT_ACQUIRE) is frozen. No parameters.
438455 */
439456
......@@ -443,6 +460,11 @@ enum binder_driver_return_protocol {
443460 * asynchronous transaction makes the allocated async buffer size exceed
444461 * detection threshold. No parameters.
445462 */
463
464 BR_TRANSACTION_PENDING_FROZEN = _IO('r', 20),
465 /*
466 * The target of the last async transaction is frozen. No parameters.
467 */
446468};
447469
448470enum binder_driver_command_protocol {
lib/libc/include/any-linux-any/linux/aspeed-video.h created+14
......@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2021 ASPEED Technology Inc.
4 */
5
6#ifndef _LINUX_ASPEED_VIDEO_H
7#define _LINUX_ASPEED_VIDEO_H
8
9#include <linux/v4l2-controls.h>
10
11#define V4L2_CID_ASPEED_HQ_MODE (V4L2_CID_USER_ASPEED_BASE + 1)
12#define V4L2_CID_ASPEED_HQ_JPEG_QUALITY (V4L2_CID_USER_ASPEED_BASE + 2)
13
14#endif /* _LINUX_ASPEED_VIDEO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/atmbr2684.h+1-1
......@@ -38,7 +38,7 @@
3838 */
3939#define BR2684_ENCAPS_VC (0) /* VC-mux */
4040#define BR2684_ENCAPS_LLC (1)
41#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
41#define BR2684_ENCAPS_AUTODETECT (2) /* Unsupported */
4242
4343/*
4444 * Is this VC bridged or routed?
lib/libc/include/any-linux-any/linux/audit.h+4-2
......@@ -187,7 +187,7 @@
187187#define AUDIT_MAX_KEY_LEN 256
188188#define AUDIT_BITMASK_SIZE 64
189189#define AUDIT_WORD(nr) ((__u32)((nr)/32))
190#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
190#define AUDIT_BIT(nr) (1U << ((nr) - AUDIT_WORD(nr)*32))
191191
192192#define AUDIT_SYSCALL_CLASSES 16
193193#define AUDIT_CLASS_DIR_WRITE 0
......@@ -439,6 +439,8 @@ enum {
439439#define AUDIT_ARCH_UNICORE (EM_UNICORE|__AUDIT_ARCH_LE)
440440#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
441441#define AUDIT_ARCH_XTENSA (EM_XTENSA)
442#define AUDIT_ARCH_LOONGARCH32 (EM_LOONGARCH|__AUDIT_ARCH_LE)
443#define AUDIT_ARCH_LOONGARCH64 (EM_LOONGARCH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
442444
443445#define AUDIT_PERM_EXEC 1
444446#define AUDIT_PERM_WRITE 2
......@@ -514,7 +516,7 @@ struct audit_rule_data {
514516 __u32 values[AUDIT_MAX_FIELDS];
515517 __u32 fieldflags[AUDIT_MAX_FIELDS];
516518 __u32 buflen; /* total length of string fields */
517 char buf[0]; /* string fields buffer */
519 char buf[]; /* string fields buffer */
518520};
519521
520522#endif /* _LINUX_AUDIT_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/auxvec.h+2
......@@ -30,6 +30,8 @@
3030 * differ from AT_PLATFORM. */
3131#define AT_RANDOM 25 /* address of 16 random bytes */
3232#define AT_HWCAP2 26 /* extension of AT_HWCAP */
33#define AT_RSEQ_FEATURE_SIZE 27 /* rseq supported feature size */
34#define AT_RSEQ_ALIGN 28 /* rseq allocation alignment */
3335
3436#define AT_EXECFN 31 /* filename of program */
3537
lib/libc/include/any-linux-any/linux/batadv_packet.h+2
......@@ -26,6 +26,7 @@
2626 * @BATADV_CODED: network coded packets
2727 * @BATADV_ELP: echo location packets for B.A.T.M.A.N. V
2828 * @BATADV_OGM2: originator messages for B.A.T.M.A.N. V
29 * @BATADV_MCAST: multicast packet with multiple destination addresses
2930 *
3031 * @BATADV_UNICAST: unicast packets carrying unicast payload traffic
3132 * @BATADV_UNICAST_FRAG: unicast packets carrying a fragment of the original
......@@ -42,6 +43,7 @@ enum batadv_packettype {
4243 BATADV_CODED = 0x02,
4344 BATADV_ELP = 0x03,
4445 BATADV_OGM2 = 0x04,
46 BATADV_MCAST = 0x05,
4547 /* 0x40 - 0x7f: unicast */
4648#define BATADV_UNICAST_MIN 0x40
4749 BATADV_UNICAST = 0x40,
lib/libc/include/any-linux-any/linux/blkzoned.h+1-1
......@@ -130,7 +130,7 @@ struct blk_zone_report {
130130 __u64 sector;
131131 __u32 nr_zones;
132132 __u32 flags;
133 struct blk_zone zones[0];
133 struct blk_zone zones[];
134134};
135135
136136/**
lib/libc/include/any-linux-any/linux/bpf.h+980-225
......@@ -87,10 +87,35 @@ struct bpf_cgroup_storage_key {
8787 __u32 attach_type; /* program attach type (enum bpf_attach_type) */
8888};
8989
90enum bpf_cgroup_iter_order {
91 BPF_CGROUP_ITER_ORDER_UNSPEC = 0,
92 BPF_CGROUP_ITER_SELF_ONLY, /* process only a single object. */
93 BPF_CGROUP_ITER_DESCENDANTS_PRE, /* walk descendants in pre-order. */
94 BPF_CGROUP_ITER_DESCENDANTS_POST, /* walk descendants in post-order. */
95 BPF_CGROUP_ITER_ANCESTORS_UP, /* walk ancestors upward. */
96};
97
9098union bpf_iter_link_info {
9199 struct {
92100 __u32 map_fd;
93101 } map;
102 struct {
103 enum bpf_cgroup_iter_order order;
104
105 /* At most one of cgroup_fd and cgroup_id can be non-zero. If
106 * both are zero, the walk starts from the default cgroup v2
107 * root. For walking v1 hierarchy, one should always explicitly
108 * specify cgroup_fd.
109 */
110 __u32 cgroup_fd;
111 __u64 cgroup_id;
112 } cgroup;
113 /* Parameters of task iterators. */
114 struct {
115 __u32 tid;
116 __u32 pid;
117 __u32 pid_fd;
118 } task;
94119};
95120
96121/* BPF syscall commands, see bpf(2) man-page for more details. */
......@@ -330,6 +355,8 @@ union bpf_iter_link_info {
330355 * *ctx_out*, *data_in* and *data_out* must be NULL.
331356 * *repeat* must be zero.
332357 *
358 * BPF_PROG_RUN is an alias for BPF_PROG_TEST_RUN.
359 *
333360 * Return
334361 * Returns zero on success. On error, -1 is returned and *errno*
335362 * is set appropriately.
......@@ -895,7 +922,14 @@ enum bpf_map_type {
895922 BPF_MAP_TYPE_CPUMAP,
896923 BPF_MAP_TYPE_XSKMAP,
897924 BPF_MAP_TYPE_SOCKHASH,
898 BPF_MAP_TYPE_CGROUP_STORAGE,
925 BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED,
926 /* BPF_MAP_TYPE_CGROUP_STORAGE is available to bpf programs attaching
927 * to a cgroup. The newer BPF_MAP_TYPE_CGRP_STORAGE is available to
928 * both cgroup-attached and other progs and supports all functionality
929 * provided by BPF_MAP_TYPE_CGROUP_STORAGE. So mark
930 * BPF_MAP_TYPE_CGROUP_STORAGE deprecated.
931 */
932 BPF_MAP_TYPE_CGROUP_STORAGE = BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED,
899933 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
900934 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
901935 BPF_MAP_TYPE_QUEUE,
......@@ -907,6 +941,8 @@ enum bpf_map_type {
907941 BPF_MAP_TYPE_INODE_STORAGE,
908942 BPF_MAP_TYPE_TASK_STORAGE,
909943 BPF_MAP_TYPE_BLOOM_FILTER,
944 BPF_MAP_TYPE_USER_RINGBUF,
945 BPF_MAP_TYPE_CGRP_STORAGE,
910946};
911947
912948/* Note that tracing related programs such as
......@@ -995,6 +1031,8 @@ enum bpf_attach_type {
9951031 BPF_SK_REUSEPORT_SELECT,
9961032 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE,
9971033 BPF_PERF_EVENT,
1034 BPF_TRACE_KPROBE_MULTI,
1035 BPF_LSM_CGROUP,
9981036 __MAX_BPF_ATTACH_TYPE
9991037};
10001038
......@@ -1009,6 +1047,8 @@ enum bpf_link_type {
10091047 BPF_LINK_TYPE_NETNS = 5,
10101048 BPF_LINK_TYPE_XDP = 6,
10111049 BPF_LINK_TYPE_PERF_EVENT = 7,
1050 BPF_LINK_TYPE_KPROBE_MULTI = 8,
1051 BPF_LINK_TYPE_STRUCT_OPS = 9,
10121052
10131053 MAX_BPF_LINK_TYPE,
10141054};
......@@ -1111,6 +1151,21 @@ enum bpf_link_type {
11111151 */
11121152#define BPF_F_SLEEPABLE (1U << 4)
11131153
1154/* If BPF_F_XDP_HAS_FRAGS is used in BPF_PROG_LOAD command, the loaded program
1155 * fully support xdp frags.
1156 */
1157#define BPF_F_XDP_HAS_FRAGS (1U << 5)
1158
1159/* If BPF_F_XDP_DEV_BOUND_ONLY is used in BPF_PROG_LOAD command, the loaded
1160 * program becomes device-bound but can access XDP metadata.
1161 */
1162#define BPF_F_XDP_DEV_BOUND_ONLY (1U << 6)
1163
1164/* link_create.kprobe_multi.flags used in LINK_CREATE command for
1165 * BPF_TRACE_KPROBE_MULTI attach type to create return probe.
1166 */
1167#define BPF_F_KPROBE_MULTI_RETURN (1U << 0)
1168
11141169/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
11151170 * the following extensions:
11161171 *
......@@ -1217,7 +1272,7 @@ enum {
12171272
12181273/* Query effective (directly attached + inherited from ancestor cgroups)
12191274 * programs that will be executed for events within a cgroup.
1220 * attach_flags with this flag are returned only for directly attached programs.
1275 * attach_flags with this flag are always returned 0.
12211276 */
12221277#define BPF_F_QUERY_EFFECTIVE (1U << 0)
12231278
......@@ -1225,6 +1280,8 @@ enum {
12251280
12261281/* If set, run the test on the cpu specified by bpf_attr.test.cpu */
12271282#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
1283/* If set, XDP frames will be transmitted after processing */
1284#define BPF_F_TEST_XDP_LIVE_FRAMES (1U << 1)
12281285
12291286/* type for BPF_ENABLE_STATS */
12301287enum bpf_stats_type {
......@@ -1342,8 +1399,10 @@ union bpf_attr {
13421399 /* or valid module BTF object fd or 0 to attach to vmlinux */
13431400 __u32 attach_btf_obj_fd;
13441401 };
1345 __u32 :32; /* pad */
1402 __u32 core_relo_cnt; /* number of bpf_core_relo */
13461403 __aligned_u64 fd_array; /* array of FDs */
1404 __aligned_u64 core_relos;
1405 __u32 core_relo_rec_size; /* sizeof(struct bpf_core_relo) */
13471406 };
13481407
13491408 struct { /* anonymous struct used by BPF_OBJ_* commands */
......@@ -1384,6 +1443,7 @@ union bpf_attr {
13841443 __aligned_u64 ctx_out;
13851444 __u32 flags;
13861445 __u32 cpu;
1446 __u32 batch_size;
13871447 } test;
13881448
13891449 struct { /* anonymous struct used by BPF_*_GET_*_ID */
......@@ -1411,6 +1471,10 @@ union bpf_attr {
14111471 __u32 attach_flags;
14121472 __aligned_u64 prog_ids;
14131473 __u32 prog_cnt;
1474 /* output: per-program attach_flags.
1475 * not allowed to be set during effective query.
1476 */
1477 __aligned_u64 prog_attach_flags;
14141478 } query;
14151479
14161480 struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */
......@@ -1463,6 +1527,22 @@ union bpf_attr {
14631527 */
14641528 __u64 bpf_cookie;
14651529 } perf_event;
1530 struct {
1531 __u32 flags;
1532 __u32 cnt;
1533 __aligned_u64 syms;
1534 __aligned_u64 addrs;
1535 __aligned_u64 cookies;
1536 } kprobe_multi;
1537 struct {
1538 /* this is overlaid with the target_btf_id above. */
1539 __u32 target_btf_id;
1540 /* black box user-provided value passed through
1541 * to BPF program at the execution time and
1542 * accessible through bpf_get_attach_cookie() BPF helper
1543 */
1544 __u64 cookie;
1545 } tracing;
14661546 };
14671547 } link_create;
14681548
......@@ -1744,7 +1824,7 @@ union bpf_attr {
17441824 * if the maximum number of tail calls has been reached for this
17451825 * chain of programs. This limit is defined in the kernel by the
17461826 * macro **MAX_TAIL_CALL_CNT** (not accessible to user space),
1747 * which is currently set to 32.
1827 * which is currently set to 33.
17481828 * Return
17491829 * 0 on success, or a negative error in case of failure.
17501830 *
......@@ -1773,6 +1853,8 @@ union bpf_attr {
17731853 * 0 on success, or a negative error in case of failure.
17741854 *
17751855 * u64 bpf_get_current_pid_tgid(void)
1856 * Description
1857 * Get the current pid and tgid.
17761858 * Return
17771859 * A 64-bit integer containing the current tgid and pid, and
17781860 * created as such:
......@@ -1780,6 +1862,8 @@ union bpf_attr {
17801862 * *current_task*\ **->pid**.
17811863 *
17821864 * u64 bpf_get_current_uid_gid(void)
1865 * Description
1866 * Get the current uid and gid.
17831867 * Return
17841868 * A 64-bit integer containing the current GID and UID, and
17851869 * created as such: *current_gid* **<< 32 \|** *current_uid*.
......@@ -1922,6 +2006,9 @@ union bpf_attr {
19222006 * sending the packet. This flag was added for GRE
19232007 * encapsulation, but might be used with other protocols
19242008 * as well in the future.
2009 * **BPF_F_NO_TUNNEL_KEY**
2010 * Add a flag to tunnel metadata indicating that no tunnel
2011 * key should be set in the resulting tunnel header.
19252012 *
19262013 * Here is a typical usage on the transmit path:
19272014 *
......@@ -2254,6 +2341,8 @@ union bpf_attr {
22542341 * The 32-bit hash.
22552342 *
22562343 * u64 bpf_get_current_task(void)
2344 * Description
2345 * Get the current task.
22572346 * Return
22582347 * A pointer to the current task struct.
22592348 *
......@@ -2284,8 +2373,8 @@ union bpf_attr {
22842373 * Return
22852374 * The return value depends on the result of the test, and can be:
22862375 *
2287 * * 0, if current task belongs to the cgroup2.
2288 * * 1, if current task does not belong to the cgroup2.
2376 * * 1, if current task belongs to the cgroup2.
2377 * * 0, if current task does not belong to the cgroup2.
22892378 * * A negative error code, if an error occurred.
22902379 *
22912380 * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
......@@ -2317,7 +2406,8 @@ union bpf_attr {
23172406 * Pull in non-linear data in case the *skb* is non-linear and not
23182407 * all of *len* are part of the linear section. Make *len* bytes
23192408 * from *skb* readable and writable. If a zero value is passed for
2320 * *len*, then the whole length of the *skb* is pulled.
2409 * *len*, then all bytes in the linear part of *skb* will be made
2410 * readable and writable.
23212411 *
23222412 * This helper is only needed for reading and writing with direct
23232413 * packet access.
......@@ -2367,6 +2457,8 @@ union bpf_attr {
23672457 * indicate that the hash is outdated and to trigger a
23682458 * recalculation the next time the kernel tries to access this
23692459 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
2460 * Return
2461 * void.
23702462 *
23712463 * long bpf_get_numa_node_id(void)
23722464 * Description
......@@ -2464,6 +2556,8 @@ union bpf_attr {
24642556 * A 8-byte long unique number or 0 if *sk* is NULL.
24652557 *
24662558 * u32 bpf_get_socket_uid(struct sk_buff *skb)
2559 * Description
2560 * Get the owner UID of the socked associated to *skb*.
24672561 * Return
24682562 * The owner UID of the socket associated to *skb*. If the socket
24692563 * is **NULL**, or if it is not a full socket (i.e. if it is a
......@@ -2498,14 +2592,19 @@ union bpf_attr {
24982592 * * **SOL_SOCKET**, which supports the following *optname*\ s:
24992593 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
25002594 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
2501 * **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
2595 * **SO_BINDTODEVICE**, **SO_KEEPALIVE**, **SO_REUSEADDR**,
2596 * **SO_REUSEPORT**, **SO_BINDTOIFINDEX**, **SO_TXREHASH**.
25022597 * * **IPPROTO_TCP**, which supports the following *optname*\ s:
25032598 * **TCP_CONGESTION**, **TCP_BPF_IW**,
25042599 * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
25052600 * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
2506 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
2601 * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
2602 * **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
2603 * **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
2604 * **TCP_BPF_RTO_MIN**.
25072605 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2508 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
2606 * * **IPPROTO_IPV6**, which supports the following *optname*\ s:
2607 * **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
25092608 * Return
25102609 * 0 on success, or a negative error in case of failure.
25112610 *
......@@ -2524,10 +2623,12 @@ union bpf_attr {
25242623 * There are two supported modes at this time:
25252624 *
25262625 * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer
2527 * (room space is added or removed below the layer 2 header).
2626 * (room space is added or removed between the layer 2 and
2627 * layer 3 headers).
25282628 *
25292629 * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer
2530 * (room space is added or removed below the layer 3 header).
2630 * (room space is added or removed between the layer 3 and
2631 * layer 4 headers).
25312632 *
25322633 * The following flags are supported at this time:
25332634 *
......@@ -2551,6 +2652,11 @@ union bpf_attr {
25512652 * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
25522653 * L2 type as Ethernet.
25532654 *
2655 * * **BPF_F_ADJ_ROOM_DECAP_L3_IPV4**,
2656 * **BPF_F_ADJ_ROOM_DECAP_L3_IPV6**:
2657 * Indicate the new IP header version after decapsulating the outer
2658 * IP header. Used when the inner and outer IP versions are different.
2659 *
25542660 * A call to this helper is susceptible to change the underlying
25552661 * packet buffer. Therefore, at load time, all checks on pointers
25562662 * previously done by the verifier are invalidated and must be
......@@ -2559,7 +2665,7 @@ union bpf_attr {
25592665 * Return
25602666 * 0 on success, or a negative error in case of failure.
25612667 *
2562 * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
2668 * long bpf_redirect_map(struct bpf_map *map, u64 key, u64 flags)
25632669 * Description
25642670 * Redirect the packet to the endpoint referenced by *map* at
25652671 * index *key*. Depending on its type, this *map* can contain
......@@ -2695,7 +2801,7 @@ union bpf_attr {
26952801 *
26962802 * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)
26972803 * Description
2698 * For en eBPF program attached to a perf event, retrieve the
2804 * For an eBPF program attached to a perf event, retrieve the
26992805 * value of the event counter associated to *ctx* and store it in
27002806 * the structure pointed by *buf* and of size *buf_size*. Enabled
27012807 * and running times are also stored in the structure (see
......@@ -2720,12 +2826,10 @@ union bpf_attr {
27202826 * and **BPF_CGROUP_INET6_CONNECT**.
27212827 *
27222828 * This helper actually implements a subset of **getsockopt()**.
2723 * It supports the following *level*\ s:
2724 *
2725 * * **IPPROTO_TCP**, which supports *optname*
2726 * **TCP_CONGESTION**.
2727 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2728 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
2829 * It supports the same set of *optname*\ s that is supported by
2830 * the **bpf_setsockopt**\ () helper. The exceptions are
2831 * **TCP_BPF_*** is **bpf_setsockopt**\ () only and
2832 * **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only.
27292833 * Return
27302834 * 0 on success, or a negative error in case of failure.
27312835 *
......@@ -2959,8 +3063,18 @@ union bpf_attr {
29593063 * **BPF_F_USER_STACK**
29603064 * Collect a user space stack instead of a kernel stack.
29613065 * **BPF_F_USER_BUILD_ID**
2962 * Collect buildid+offset instead of ips for user stack,
2963 * only valid if **BPF_F_USER_STACK** is also specified.
3066 * Collect (build_id, file_offset) instead of ips for user
3067 * stack, only valid if **BPF_F_USER_STACK** is also
3068 * specified.
3069 *
3070 * *file_offset* is an offset relative to the beginning
3071 * of the executable or shared object file backing the vma
3072 * which the *ip* falls in. It is *not* an offset relative
3073 * to that object's base address. Accordingly, it must be
3074 * adjusted by adding (sh_addr - sh_offset), where
3075 * sh_{addr,offset} correspond to the executable section
3076 * containing *file_offset* in the object, for comparisons
3077 * to symbols' st_value to be valid.
29643078 *
29653079 * **bpf_get_stack**\ () can collect up to
29663080 * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject
......@@ -2973,8 +3087,8 @@ union bpf_attr {
29733087 *
29743088 * # sysctl kernel.perf_event_max_stack=<new value>
29753089 * Return
2976 * A non-negative value equal to or less than *size* on success,
2977 * or a negative error in case of failure.
3090 * The non-negative copied *buf* length equal to or less than
3091 * *size* on success, or a negative error in case of failure.
29783092 *
29793093 * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)
29803094 * Description
......@@ -3020,6 +3134,11 @@ union bpf_attr {
30203134 * **BPF_FIB_LOOKUP_OUTPUT**
30213135 * Perform lookup from an egress perspective (default is
30223136 * ingress).
3137 * **BPF_FIB_LOOKUP_SKIP_NEIGH**
3138 * Skip the neighbour table lookup. *params*->dmac
3139 * and *params*->smac will not be set as output. A common
3140 * use case is to call **bpf_redirect_neigh**\ () after
3141 * doing **bpf_fib_lookup**\ ().
30233142 *
30243143 * *ctx* is either **struct xdp_md** for XDP programs or
30253144 * **struct sk_buff** tc cls_act programs.
......@@ -3238,6 +3357,9 @@ union bpf_attr {
32383357 * The id is returned or 0 in case the id could not be retrieved.
32393358 *
32403359 * u64 bpf_get_current_cgroup_id(void)
3360 * Description
3361 * Get the current cgroup id based on the cgroup within which
3362 * the current task is running.
32413363 * Return
32423364 * A 64-bit integer containing the current cgroup id based
32433365 * on the cgroup within which the current task is running.
......@@ -3548,10 +3670,11 @@ union bpf_attr {
35483670 *
35493671 * *iph* points to the start of the IPv4 or IPv6 header, while
35503672 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3551 * **sizeof**\ (**struct ip6hdr**).
3673 * **sizeof**\ (**struct ipv6hdr**).
35523674 *
35533675 * *th* points to the start of the TCP header, while *th_len*
3554 * contains **sizeof**\ (**struct tcphdr**).
3676 * contains the length of the TCP header (at least
3677 * **sizeof**\ (**struct tcphdr**)).
35553678 * Return
35563679 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative
35573680 * error otherwise.
......@@ -3734,10 +3857,11 @@ union bpf_attr {
37343857 *
37353858 * *iph* points to the start of the IPv4 or IPv6 header, while
37363859 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3737 * **sizeof**\ (**struct ip6hdr**).
3860 * **sizeof**\ (**struct ipv6hdr**).
37383861 *
37393862 * *th* points to the start of the TCP header, while *th_len*
3740 * contains the length of the TCP header.
3863 * contains the length of the TCP header with options (at least
3864 * **sizeof**\ (**struct tcphdr**)).
37413865 * Return
37423866 * On success, lower 32 bits hold the generated SYN cookie in
37433867 * followed by 16 bits which hold the MSS value for that cookie,
......@@ -4277,8 +4401,8 @@ union bpf_attr {
42774401 *
42784402 * # sysctl kernel.perf_event_max_stack=<new value>
42794403 * Return
4280 * A non-negative value equal to or less than *size* on success,
4281 * or a negative error in case of failure.
4404 * The non-negative copied *buf* length equal to or less than
4405 * *size* on success, or a negative error in case of failure.
42824406 *
42834407 * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags)
42844408 * Description
......@@ -4371,7 +4495,7 @@ union bpf_attr {
43714495 *
43724496 * **-EEXIST** if the option already exists.
43734497 *
4374 * **-EFAULT** on failrue to parse the existing header options.
4498 * **-EFAULT** on failure to parse the existing header options.
43754499 *
43764500 * **-EPERM** if the helper cannot be used under the current
43774501 * *skops*\ **->op**.
......@@ -4580,7 +4704,7 @@ union bpf_attr {
45804704 * a *map* with *task* as the **key**. From this
45814705 * perspective, the usage is not much different from
45824706 * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this
4583 * helper enforces the key must be an task_struct and the map must also
4707 * helper enforces the key must be a task_struct and the map must also
45844708 * be a **BPF_MAP_TYPE_TASK_STORAGE**.
45854709 *
45864710 * Underneath, the value is stored locally at *task* instead of
......@@ -4638,7 +4762,7 @@ union bpf_attr {
46384762 *
46394763 * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)
46404764 * Description
4641 * Returns the stored IMA hash of the *inode* (if it's avaialable).
4765 * Returns the stored IMA hash of the *inode* (if it's available).
46424766 * If the hash is larger than *size*, then only *size*
46434767 * bytes will be copied to *dst*
46444768 * Return
......@@ -4662,12 +4786,12 @@ union bpf_attr {
46624786 *
46634787 * The argument *len_diff* can be used for querying with a planned
46644788 * size change. This allows to check MTU prior to changing packet
4665 * ctx. Providing an *len_diff* adjustment that is larger than the
4789 * ctx. Providing a *len_diff* adjustment that is larger than the
46664790 * actual packet size (resulting in negative packet size) will in
4667 * principle not exceed the MTU, why it is not considered a
4668 * failure. Other BPF-helpers are needed for performing the
4669 * planned size change, why the responsability for catch a negative
4670 * packet size belong in those helpers.
4791 * principle not exceed the MTU, which is why it is not considered
4792 * a failure. Other BPF helpers are needed for performing the
4793 * planned size change; therefore the responsibility for catching
4794 * a negative packet size belongs in those helpers.
46714795 *
46724796 * Specifying *ifindex* zero means the MTU check is performed
46734797 * against the current net device. This is practical if this isn't
......@@ -4865,6 +4989,7 @@ union bpf_attr {
48654989 * Get address of the traced function (for tracing and kprobe programs).
48664990 * Return
48674991 * Address of the traced function.
4992 * 0 for kprobes placed within the function (not at the entry).
48684993 *
48694994 * u64 bpf_get_attach_cookie(void *ctx)
48704995 * Description
......@@ -4938,196 +5063,673 @@ union bpf_attr {
49385063 * **-ENOENT** if symbol is not found.
49395064 *
49405065 * **-EPERM** if caller does not have permission to obtain kernel address.
5066 *
5067 * long bpf_find_vma(struct task_struct *task, u64 addr, void *callback_fn, void *callback_ctx, u64 flags)
5068 * Description
5069 * Find vma of *task* that contains *addr*, call *callback_fn*
5070 * function with *task*, *vma*, and *callback_ctx*.
5071 * The *callback_fn* should be a static function and
5072 * the *callback_ctx* should be a pointer to the stack.
5073 * The *flags* is used to control certain aspects of the helper.
5074 * Currently, the *flags* must be 0.
5075 *
5076 * The expected callback signature is
5077 *
5078 * long (\*callback_fn)(struct task_struct \*task, struct vm_area_struct \*vma, void \*callback_ctx);
5079 *
5080 * Return
5081 * 0 on success.
5082 * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*.
5083 * **-EBUSY** if failed to try lock mmap_lock.
5084 * **-EINVAL** for invalid **flags**.
5085 *
5086 * long bpf_loop(u32 nr_loops, void *callback_fn, void *callback_ctx, u64 flags)
5087 * Description
5088 * For **nr_loops**, call **callback_fn** function
5089 * with **callback_ctx** as the context parameter.
5090 * The **callback_fn** should be a static function and
5091 * the **callback_ctx** should be a pointer to the stack.
5092 * The **flags** is used to control certain aspects of the helper.
5093 * Currently, the **flags** must be 0. Currently, nr_loops is
5094 * limited to 1 << 23 (~8 million) loops.
5095 *
5096 * long (\*callback_fn)(u32 index, void \*ctx);
5097 *
5098 * where **index** is the current index in the loop. The index
5099 * is zero-indexed.
5100 *
5101 * If **callback_fn** returns 0, the helper will continue to the next
5102 * loop. If return value is 1, the helper will skip the rest of
5103 * the loops and return. Other return values are not used now,
5104 * and will be rejected by the verifier.
5105 *
5106 * Return
5107 * The number of loops performed, **-EINVAL** for invalid **flags**,
5108 * **-E2BIG** if **nr_loops** exceeds the maximum number of loops.
5109 *
5110 * long bpf_strncmp(const char *s1, u32 s1_sz, const char *s2)
5111 * Description
5112 * Do strncmp() between **s1** and **s2**. **s1** doesn't need
5113 * to be null-terminated and **s1_sz** is the maximum storage
5114 * size of **s1**. **s2** must be a read-only string.
5115 * Return
5116 * An integer less than, equal to, or greater than zero
5117 * if the first **s1_sz** bytes of **s1** is found to be
5118 * less than, to match, or be greater than **s2**.
5119 *
5120 * long bpf_get_func_arg(void *ctx, u32 n, u64 *value)
5121 * Description
5122 * Get **n**-th argument register (zero based) of the traced function (for tracing programs)
5123 * returned in **value**.
5124 *
5125 * Return
5126 * 0 on success.
5127 * **-EINVAL** if n >= argument register count of traced function.
5128 *
5129 * long bpf_get_func_ret(void *ctx, u64 *value)
5130 * Description
5131 * Get return value of the traced function (for tracing programs)
5132 * in **value**.
5133 *
5134 * Return
5135 * 0 on success.
5136 * **-EOPNOTSUPP** for tracing programs other than BPF_TRACE_FEXIT or BPF_MODIFY_RETURN.
5137 *
5138 * long bpf_get_func_arg_cnt(void *ctx)
5139 * Description
5140 * Get number of registers of the traced function (for tracing programs) where
5141 * function arguments are stored in these registers.
5142 *
5143 * Return
5144 * The number of argument registers of the traced function.
5145 *
5146 * int bpf_get_retval(void)
5147 * Description
5148 * Get the BPF program's return value that will be returned to the upper layers.
5149 *
5150 * This helper is currently supported by cgroup programs and only by the hooks
5151 * where BPF program's return value is returned to the userspace via errno.
5152 * Return
5153 * The BPF program's return value.
5154 *
5155 * int bpf_set_retval(int retval)
5156 * Description
5157 * Set the BPF program's return value that will be returned to the upper layers.
5158 *
5159 * This helper is currently supported by cgroup programs and only by the hooks
5160 * where BPF program's return value is returned to the userspace via errno.
5161 *
5162 * Note that there is the following corner case where the program exports an error
5163 * via bpf_set_retval but signals success via 'return 1':
5164 *
5165 * bpf_set_retval(-EPERM);
5166 * return 1;
5167 *
5168 * In this case, the BPF program's return value will use helper's -EPERM. This
5169 * still holds true for cgroup/bind{4,6} which supports extra 'return 3' success case.
5170 *
5171 * Return
5172 * 0 on success, or a negative error in case of failure.
5173 *
5174 * u64 bpf_xdp_get_buff_len(struct xdp_buff *xdp_md)
5175 * Description
5176 * Get the total size of a given xdp buff (linear and paged area)
5177 * Return
5178 * The total size of a given xdp buffer.
5179 *
5180 * long bpf_xdp_load_bytes(struct xdp_buff *xdp_md, u32 offset, void *buf, u32 len)
5181 * Description
5182 * This helper is provided as an easy way to load data from a
5183 * xdp buffer. It can be used to load *len* bytes from *offset* from
5184 * the frame associated to *xdp_md*, into the buffer pointed by
5185 * *buf*.
5186 * Return
5187 * 0 on success, or a negative error in case of failure.
5188 *
5189 * long bpf_xdp_store_bytes(struct xdp_buff *xdp_md, u32 offset, void *buf, u32 len)
5190 * Description
5191 * Store *len* bytes from buffer *buf* into the frame
5192 * associated to *xdp_md*, at *offset*.
5193 * Return
5194 * 0 on success, or a negative error in case of failure.
5195 *
5196 * long bpf_copy_from_user_task(void *dst, u32 size, const void *user_ptr, struct task_struct *tsk, u64 flags)
5197 * Description
5198 * Read *size* bytes from user space address *user_ptr* in *tsk*'s
5199 * address space, and stores the data in *dst*. *flags* is not
5200 * used yet and is provided for future extensibility. This helper
5201 * can only be used by sleepable programs.
5202 * Return
5203 * 0 on success, or a negative error in case of failure. On error
5204 * *dst* buffer is zeroed out.
5205 *
5206 * long bpf_skb_set_tstamp(struct sk_buff *skb, u64 tstamp, u32 tstamp_type)
5207 * Description
5208 * Change the __sk_buff->tstamp_type to *tstamp_type*
5209 * and set *tstamp* to the __sk_buff->tstamp together.
5210 *
5211 * If there is no need to change the __sk_buff->tstamp_type,
5212 * the tstamp value can be directly written to __sk_buff->tstamp
5213 * instead.
5214 *
5215 * BPF_SKB_TSTAMP_DELIVERY_MONO is the only tstamp that
5216 * will be kept during bpf_redirect_*(). A non zero
5217 * *tstamp* must be used with the BPF_SKB_TSTAMP_DELIVERY_MONO
5218 * *tstamp_type*.
5219 *
5220 * A BPF_SKB_TSTAMP_UNSPEC *tstamp_type* can only be used
5221 * with a zero *tstamp*.
5222 *
5223 * Only IPv4 and IPv6 skb->protocol are supported.
5224 *
5225 * This function is most useful when it needs to set a
5226 * mono delivery time to __sk_buff->tstamp and then
5227 * bpf_redirect_*() to the egress of an iface. For example,
5228 * changing the (rcv) timestamp in __sk_buff->tstamp at
5229 * ingress to a mono delivery time and then bpf_redirect_*()
5230 * to sch_fq@phy-dev.
5231 * Return
5232 * 0 on success.
5233 * **-EINVAL** for invalid input
5234 * **-EOPNOTSUPP** for unsupported protocol
5235 *
5236 * long bpf_ima_file_hash(struct file *file, void *dst, u32 size)
5237 * Description
5238 * Returns a calculated IMA hash of the *file*.
5239 * If the hash is larger than *size*, then only *size*
5240 * bytes will be copied to *dst*
5241 * Return
5242 * The **hash_algo** is returned on success,
5243 * **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
5244 * invalid arguments are passed.
5245 *
5246 * void *bpf_kptr_xchg(void *map_value, void *ptr)
5247 * Description
5248 * Exchange kptr at pointer *map_value* with *ptr*, and return the
5249 * old value. *ptr* can be NULL, otherwise it must be a referenced
5250 * pointer which will be released when this helper is called.
5251 * Return
5252 * The old value of kptr (which can be NULL). The returned pointer
5253 * if not NULL, is a reference which must be released using its
5254 * corresponding release function, or moved into a BPF map before
5255 * program exit.
5256 *
5257 * void *bpf_map_lookup_percpu_elem(struct bpf_map *map, const void *key, u32 cpu)
5258 * Description
5259 * Perform a lookup in *percpu map* for an entry associated to
5260 * *key* on *cpu*.
5261 * Return
5262 * Map value associated to *key* on *cpu*, or **NULL** if no entry
5263 * was found or *cpu* is invalid.
5264 *
5265 * struct mptcp_sock *bpf_skc_to_mptcp_sock(void *sk)
5266 * Description
5267 * Dynamically cast a *sk* pointer to a *mptcp_sock* pointer.
5268 * Return
5269 * *sk* if casting is valid, or **NULL** otherwise.
5270 *
5271 * long bpf_dynptr_from_mem(void *data, u32 size, u64 flags, struct bpf_dynptr *ptr)
5272 * Description
5273 * Get a dynptr to local memory *data*.
5274 *
5275 * *data* must be a ptr to a map value.
5276 * The maximum *size* supported is DYNPTR_MAX_SIZE.
5277 * *flags* is currently unused.
5278 * Return
5279 * 0 on success, -E2BIG if the size exceeds DYNPTR_MAX_SIZE,
5280 * -EINVAL if flags is not 0.
5281 *
5282 * long bpf_ringbuf_reserve_dynptr(void *ringbuf, u32 size, u64 flags, struct bpf_dynptr *ptr)
5283 * Description
5284 * Reserve *size* bytes of payload in a ring buffer *ringbuf*
5285 * through the dynptr interface. *flags* must be 0.
5286 *
5287 * Please note that a corresponding bpf_ringbuf_submit_dynptr or
5288 * bpf_ringbuf_discard_dynptr must be called on *ptr*, even if the
5289 * reservation fails. This is enforced by the verifier.
5290 * Return
5291 * 0 on success, or a negative error in case of failure.
5292 *
5293 * void bpf_ringbuf_submit_dynptr(struct bpf_dynptr *ptr, u64 flags)
5294 * Description
5295 * Submit reserved ring buffer sample, pointed to by *data*,
5296 * through the dynptr interface. This is a no-op if the dynptr is
5297 * invalid/null.
5298 *
5299 * For more information on *flags*, please see
5300 * 'bpf_ringbuf_submit'.
5301 * Return
5302 * Nothing. Always succeeds.
5303 *
5304 * void bpf_ringbuf_discard_dynptr(struct bpf_dynptr *ptr, u64 flags)
5305 * Description
5306 * Discard reserved ring buffer sample through the dynptr
5307 * interface. This is a no-op if the dynptr is invalid/null.
5308 *
5309 * For more information on *flags*, please see
5310 * 'bpf_ringbuf_discard'.
5311 * Return
5312 * Nothing. Always succeeds.
5313 *
5314 * long bpf_dynptr_read(void *dst, u32 len, const struct bpf_dynptr *src, u32 offset, u64 flags)
5315 * Description
5316 * Read *len* bytes from *src* into *dst*, starting from *offset*
5317 * into *src*.
5318 * *flags* is currently unused.
5319 * Return
5320 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5321 * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
5322 * *flags* is not 0.
5323 *
5324 * long bpf_dynptr_write(const struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags)
5325 * Description
5326 * Write *len* bytes from *src* into *dst*, starting from *offset*
5327 * into *dst*.
5328 * *flags* is currently unused.
5329 * Return
5330 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5331 * 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.
5333 *
5334 * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len)
5335 * Description
5336 * Get a pointer to the underlying dynptr data.
5337 *
5338 * *len* must be a statically known value. The returned data slice
5339 * is invalidated whenever the dynptr is invalidated.
5340 * Return
5341 * Pointer to the underlying dynptr data, NULL if the dynptr is
5342 * read-only, if the dynptr is invalid, or if the offset and length
5343 * is out of bounds.
5344 *
5345 * s64 bpf_tcp_raw_gen_syncookie_ipv4(struct iphdr *iph, struct tcphdr *th, u32 th_len)
5346 * Description
5347 * Try to issue a SYN cookie for the packet with corresponding
5348 * IPv4/TCP headers, *iph* and *th*, without depending on a
5349 * listening socket.
5350 *
5351 * *iph* points to the IPv4 header.
5352 *
5353 * *th* points to the start of the TCP header, while *th_len*
5354 * contains the length of the TCP header (at least
5355 * **sizeof**\ (**struct tcphdr**)).
5356 * Return
5357 * On success, lower 32 bits hold the generated SYN cookie in
5358 * followed by 16 bits which hold the MSS value for that cookie,
5359 * and the top 16 bits are unused.
5360 *
5361 * On failure, the returned value is one of the following:
5362 *
5363 * **-EINVAL** if *th_len* is invalid.
5364 *
5365 * s64 bpf_tcp_raw_gen_syncookie_ipv6(struct ipv6hdr *iph, struct tcphdr *th, u32 th_len)
5366 * Description
5367 * Try to issue a SYN cookie for the packet with corresponding
5368 * IPv6/TCP headers, *iph* and *th*, without depending on a
5369 * listening socket.
5370 *
5371 * *iph* points to the IPv6 header.
5372 *
5373 * *th* points to the start of the TCP header, while *th_len*
5374 * contains the length of the TCP header (at least
5375 * **sizeof**\ (**struct tcphdr**)).
5376 * Return
5377 * On success, lower 32 bits hold the generated SYN cookie in
5378 * followed by 16 bits which hold the MSS value for that cookie,
5379 * and the top 16 bits are unused.
5380 *
5381 * On failure, the returned value is one of the following:
5382 *
5383 * **-EINVAL** if *th_len* is invalid.
5384 *
5385 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5386 *
5387 * long bpf_tcp_raw_check_syncookie_ipv4(struct iphdr *iph, struct tcphdr *th)
5388 * Description
5389 * Check whether *iph* and *th* contain a valid SYN cookie ACK
5390 * without depending on a listening socket.
5391 *
5392 * *iph* points to the IPv4 header.
5393 *
5394 * *th* points to the TCP header.
5395 * Return
5396 * 0 if *iph* and *th* are a valid SYN cookie ACK.
5397 *
5398 * On failure, the returned value is one of the following:
5399 *
5400 * **-EACCES** if the SYN cookie is not valid.
5401 *
5402 * long bpf_tcp_raw_check_syncookie_ipv6(struct ipv6hdr *iph, struct tcphdr *th)
5403 * Description
5404 * Check whether *iph* and *th* contain a valid SYN cookie ACK
5405 * without depending on a listening socket.
5406 *
5407 * *iph* points to the IPv6 header.
5408 *
5409 * *th* points to the TCP header.
5410 * Return
5411 * 0 if *iph* and *th* are a valid SYN cookie ACK.
5412 *
5413 * On failure, the returned value is one of the following:
5414 *
5415 * **-EACCES** if the SYN cookie is not valid.
5416 *
5417 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5418 *
5419 * u64 bpf_ktime_get_tai_ns(void)
5420 * Description
5421 * A nonsettable system-wide clock derived from wall-clock time but
5422 * ignoring leap seconds. This clock does not experience
5423 * discontinuities and backwards jumps caused by NTP inserting leap
5424 * seconds as CLOCK_REALTIME does.
5425 *
5426 * See: **clock_gettime**\ (**CLOCK_TAI**)
5427 * Return
5428 * Current *ktime*.
5429 *
5430 * long bpf_user_ringbuf_drain(struct bpf_map *map, void *callback_fn, void *ctx, u64 flags)
5431 * Description
5432 * Drain samples from the specified user ring buffer, and invoke
5433 * the provided callback for each such sample:
5434 *
5435 * long (\*callback_fn)(const struct bpf_dynptr \*dynptr, void \*ctx);
5436 *
5437 * If **callback_fn** returns 0, the helper will continue to try
5438 * and drain the next sample, up to a maximum of
5439 * BPF_MAX_USER_RINGBUF_SAMPLES samples. If the return value is 1,
5440 * the helper will skip the rest of the samples and return. Other
5441 * return values are not used now, and will be rejected by the
5442 * verifier.
5443 * Return
5444 * The number of drained samples if no error was encountered while
5445 * draining samples, or 0 if no samples were present in the ring
5446 * buffer. If a user-space producer was epoll-waiting on this map,
5447 * and at least one sample was drained, they will receive an event
5448 * notification notifying them of available space in the ring
5449 * buffer. If the BPF_RB_NO_WAKEUP flag is passed to this
5450 * function, no wakeup notification will be sent. If the
5451 * BPF_RB_FORCE_WAKEUP flag is passed, a wakeup notification will
5452 * be sent even if no sample was drained.
5453 *
5454 * On failure, the returned value is one of the following:
5455 *
5456 * **-EBUSY** if the ring buffer is contended, and another calling
5457 * context was concurrently draining the ring buffer.
5458 *
5459 * **-EINVAL** if user-space is not properly tracking the ring
5460 * buffer due to the producer position not being aligned to 8
5461 * bytes, a sample not being aligned to 8 bytes, or the producer
5462 * position not matching the advertised length of a sample.
5463 *
5464 * **-E2BIG** if user-space has tried to publish a sample which is
5465 * larger than the size of the ring buffer, or which cannot fit
5466 * within a struct bpf_dynptr.
5467 *
5468 * void *bpf_cgrp_storage_get(struct bpf_map *map, struct cgroup *cgroup, void *value, u64 flags)
5469 * Description
5470 * Get a bpf_local_storage from the *cgroup*.
5471 *
5472 * Logically, it could be thought of as getting the value from
5473 * a *map* with *cgroup* as the **key**. From this
5474 * perspective, the usage is not much different from
5475 * **bpf_map_lookup_elem**\ (*map*, **&**\ *cgroup*) except this
5476 * helper enforces the key must be a cgroup struct and the map must also
5477 * be a **BPF_MAP_TYPE_CGRP_STORAGE**.
5478 *
5479 * In reality, the local-storage value is embedded directly inside of the
5480 * *cgroup* object itself, rather than being located in the
5481 * **BPF_MAP_TYPE_CGRP_STORAGE** map. When the local-storage value is
5482 * queried for some *map* on a *cgroup* object, the kernel will perform an
5483 * O(n) iteration over all of the live local-storage values for that
5484 * *cgroup* object until the local-storage value for the *map* is found.
5485 *
5486 * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be
5487 * used such that a new bpf_local_storage will be
5488 * created if one does not exist. *value* can be used
5489 * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify
5490 * the initial value of a bpf_local_storage. If *value* is
5491 * **NULL**, the new bpf_local_storage will be zero initialized.
5492 * Return
5493 * A bpf_local_storage pointer is returned on success.
5494 *
5495 * **NULL** if not found or there was an error in adding
5496 * a new bpf_local_storage.
5497 *
5498 * long bpf_cgrp_storage_delete(struct bpf_map *map, struct cgroup *cgroup)
5499 * Description
5500 * Delete a bpf_local_storage from a *cgroup*.
5501 * Return
5502 * 0 on success.
5503 *
5504 * **-ENOENT** if the bpf_local_storage cannot be found.
49415505 */
4942#define __BPF_FUNC_MAPPER(FN) \
4943 FN(unspec), \
4944 FN(map_lookup_elem), \
4945 FN(map_update_elem), \
4946 FN(map_delete_elem), \
4947 FN(probe_read), \
4948 FN(ktime_get_ns), \
4949 FN(trace_printk), \
4950 FN(get_prandom_u32), \
4951 FN(get_smp_processor_id), \
4952 FN(skb_store_bytes), \
4953 FN(l3_csum_replace), \
4954 FN(l4_csum_replace), \
4955 FN(tail_call), \
4956 FN(clone_redirect), \
4957 FN(get_current_pid_tgid), \
4958 FN(get_current_uid_gid), \
4959 FN(get_current_comm), \
4960 FN(get_cgroup_classid), \
4961 FN(skb_vlan_push), \
4962 FN(skb_vlan_pop), \
4963 FN(skb_get_tunnel_key), \
4964 FN(skb_set_tunnel_key), \
4965 FN(perf_event_read), \
4966 FN(redirect), \
4967 FN(get_route_realm), \
4968 FN(perf_event_output), \
4969 FN(skb_load_bytes), \
4970 FN(get_stackid), \
4971 FN(csum_diff), \
4972 FN(skb_get_tunnel_opt), \
4973 FN(skb_set_tunnel_opt), \
4974 FN(skb_change_proto), \
4975 FN(skb_change_type), \
4976 FN(skb_under_cgroup), \
4977 FN(get_hash_recalc), \
4978 FN(get_current_task), \
4979 FN(probe_write_user), \
4980 FN(current_task_under_cgroup), \
4981 FN(skb_change_tail), \
4982 FN(skb_pull_data), \
4983 FN(csum_update), \
4984 FN(set_hash_invalid), \
4985 FN(get_numa_node_id), \
4986 FN(skb_change_head), \
4987 FN(xdp_adjust_head), \
4988 FN(probe_read_str), \
4989 FN(get_socket_cookie), \
4990 FN(get_socket_uid), \
4991 FN(set_hash), \
4992 FN(setsockopt), \
4993 FN(skb_adjust_room), \
4994 FN(redirect_map), \
4995 FN(sk_redirect_map), \
4996 FN(sock_map_update), \
4997 FN(xdp_adjust_meta), \
4998 FN(perf_event_read_value), \
4999 FN(perf_prog_read_value), \
5000 FN(getsockopt), \
5001 FN(override_return), \
5002 FN(sock_ops_cb_flags_set), \
5003 FN(msg_redirect_map), \
5004 FN(msg_apply_bytes), \
5005 FN(msg_cork_bytes), \
5006 FN(msg_pull_data), \
5007 FN(bind), \
5008 FN(xdp_adjust_tail), \
5009 FN(skb_get_xfrm_state), \
5010 FN(get_stack), \
5011 FN(skb_load_bytes_relative), \
5012 FN(fib_lookup), \
5013 FN(sock_hash_update), \
5014 FN(msg_redirect_hash), \
5015 FN(sk_redirect_hash), \
5016 FN(lwt_push_encap), \
5017 FN(lwt_seg6_store_bytes), \
5018 FN(lwt_seg6_adjust_srh), \
5019 FN(lwt_seg6_action), \
5020 FN(rc_repeat), \
5021 FN(rc_keydown), \
5022 FN(skb_cgroup_id), \
5023 FN(get_current_cgroup_id), \
5024 FN(get_local_storage), \
5025 FN(sk_select_reuseport), \
5026 FN(skb_ancestor_cgroup_id), \
5027 FN(sk_lookup_tcp), \
5028 FN(sk_lookup_udp), \
5029 FN(sk_release), \
5030 FN(map_push_elem), \
5031 FN(map_pop_elem), \
5032 FN(map_peek_elem), \
5033 FN(msg_push_data), \
5034 FN(msg_pop_data), \
5035 FN(rc_pointer_rel), \
5036 FN(spin_lock), \
5037 FN(spin_unlock), \
5038 FN(sk_fullsock), \
5039 FN(tcp_sock), \
5040 FN(skb_ecn_set_ce), \
5041 FN(get_listener_sock), \
5042 FN(skc_lookup_tcp), \
5043 FN(tcp_check_syncookie), \
5044 FN(sysctl_get_name), \
5045 FN(sysctl_get_current_value), \
5046 FN(sysctl_get_new_value), \
5047 FN(sysctl_set_new_value), \
5048 FN(strtol), \
5049 FN(strtoul), \
5050 FN(sk_storage_get), \
5051 FN(sk_storage_delete), \
5052 FN(send_signal), \
5053 FN(tcp_gen_syncookie), \
5054 FN(skb_output), \
5055 FN(probe_read_user), \
5056 FN(probe_read_kernel), \
5057 FN(probe_read_user_str), \
5058 FN(probe_read_kernel_str), \
5059 FN(tcp_send_ack), \
5060 FN(send_signal_thread), \
5061 FN(jiffies64), \
5062 FN(read_branch_records), \
5063 FN(get_ns_current_pid_tgid), \
5064 FN(xdp_output), \
5065 FN(get_netns_cookie), \
5066 FN(get_current_ancestor_cgroup_id), \
5067 FN(sk_assign), \
5068 FN(ktime_get_boot_ns), \
5069 FN(seq_printf), \
5070 FN(seq_write), \
5071 FN(sk_cgroup_id), \
5072 FN(sk_ancestor_cgroup_id), \
5073 FN(ringbuf_output), \
5074 FN(ringbuf_reserve), \
5075 FN(ringbuf_submit), \
5076 FN(ringbuf_discard), \
5077 FN(ringbuf_query), \
5078 FN(csum_level), \
5079 FN(skc_to_tcp6_sock), \
5080 FN(skc_to_tcp_sock), \
5081 FN(skc_to_tcp_timewait_sock), \
5082 FN(skc_to_tcp_request_sock), \
5083 FN(skc_to_udp6_sock), \
5084 FN(get_task_stack), \
5085 FN(load_hdr_opt), \
5086 FN(store_hdr_opt), \
5087 FN(reserve_hdr_opt), \
5088 FN(inode_storage_get), \
5089 FN(inode_storage_delete), \
5090 FN(d_path), \
5091 FN(copy_from_user), \
5092 FN(snprintf_btf), \
5093 FN(seq_printf_btf), \
5094 FN(skb_cgroup_classid), \
5095 FN(redirect_neigh), \
5096 FN(per_cpu_ptr), \
5097 FN(this_cpu_ptr), \
5098 FN(redirect_peer), \
5099 FN(task_storage_get), \
5100 FN(task_storage_delete), \
5101 FN(get_current_task_btf), \
5102 FN(bprm_opts_set), \
5103 FN(ktime_get_coarse_ns), \
5104 FN(ima_inode_hash), \
5105 FN(sock_from_file), \
5106 FN(check_mtu), \
5107 FN(for_each_map_elem), \
5108 FN(snprintf), \
5109 FN(sys_bpf), \
5110 FN(btf_find_by_name_kind), \
5111 FN(sys_close), \
5112 FN(timer_init), \
5113 FN(timer_set_callback), \
5114 FN(timer_start), \
5115 FN(timer_cancel), \
5116 FN(get_func_ip), \
5117 FN(get_attach_cookie), \
5118 FN(task_pt_regs), \
5119 FN(get_branch_snapshot), \
5120 FN(trace_vprintk), \
5121 FN(skc_to_unix_sock), \
5122 FN(kallsyms_lookup_name), \
5506#define ___BPF_FUNC_MAPPER(FN, ctx...) \
5507 FN(unspec, 0, ##ctx) \
5508 FN(map_lookup_elem, 1, ##ctx) \
5509 FN(map_update_elem, 2, ##ctx) \
5510 FN(map_delete_elem, 3, ##ctx) \
5511 FN(probe_read, 4, ##ctx) \
5512 FN(ktime_get_ns, 5, ##ctx) \
5513 FN(trace_printk, 6, ##ctx) \
5514 FN(get_prandom_u32, 7, ##ctx) \
5515 FN(get_smp_processor_id, 8, ##ctx) \
5516 FN(skb_store_bytes, 9, ##ctx) \
5517 FN(l3_csum_replace, 10, ##ctx) \
5518 FN(l4_csum_replace, 11, ##ctx) \
5519 FN(tail_call, 12, ##ctx) \
5520 FN(clone_redirect, 13, ##ctx) \
5521 FN(get_current_pid_tgid, 14, ##ctx) \
5522 FN(get_current_uid_gid, 15, ##ctx) \
5523 FN(get_current_comm, 16, ##ctx) \
5524 FN(get_cgroup_classid, 17, ##ctx) \
5525 FN(skb_vlan_push, 18, ##ctx) \
5526 FN(skb_vlan_pop, 19, ##ctx) \
5527 FN(skb_get_tunnel_key, 20, ##ctx) \
5528 FN(skb_set_tunnel_key, 21, ##ctx) \
5529 FN(perf_event_read, 22, ##ctx) \
5530 FN(redirect, 23, ##ctx) \
5531 FN(get_route_realm, 24, ##ctx) \
5532 FN(perf_event_output, 25, ##ctx) \
5533 FN(skb_load_bytes, 26, ##ctx) \
5534 FN(get_stackid, 27, ##ctx) \
5535 FN(csum_diff, 28, ##ctx) \
5536 FN(skb_get_tunnel_opt, 29, ##ctx) \
5537 FN(skb_set_tunnel_opt, 30, ##ctx) \
5538 FN(skb_change_proto, 31, ##ctx) \
5539 FN(skb_change_type, 32, ##ctx) \
5540 FN(skb_under_cgroup, 33, ##ctx) \
5541 FN(get_hash_recalc, 34, ##ctx) \
5542 FN(get_current_task, 35, ##ctx) \
5543 FN(probe_write_user, 36, ##ctx) \
5544 FN(current_task_under_cgroup, 37, ##ctx) \
5545 FN(skb_change_tail, 38, ##ctx) \
5546 FN(skb_pull_data, 39, ##ctx) \
5547 FN(csum_update, 40, ##ctx) \
5548 FN(set_hash_invalid, 41, ##ctx) \
5549 FN(get_numa_node_id, 42, ##ctx) \
5550 FN(skb_change_head, 43, ##ctx) \
5551 FN(xdp_adjust_head, 44, ##ctx) \
5552 FN(probe_read_str, 45, ##ctx) \
5553 FN(get_socket_cookie, 46, ##ctx) \
5554 FN(get_socket_uid, 47, ##ctx) \
5555 FN(set_hash, 48, ##ctx) \
5556 FN(setsockopt, 49, ##ctx) \
5557 FN(skb_adjust_room, 50, ##ctx) \
5558 FN(redirect_map, 51, ##ctx) \
5559 FN(sk_redirect_map, 52, ##ctx) \
5560 FN(sock_map_update, 53, ##ctx) \
5561 FN(xdp_adjust_meta, 54, ##ctx) \
5562 FN(perf_event_read_value, 55, ##ctx) \
5563 FN(perf_prog_read_value, 56, ##ctx) \
5564 FN(getsockopt, 57, ##ctx) \
5565 FN(override_return, 58, ##ctx) \
5566 FN(sock_ops_cb_flags_set, 59, ##ctx) \
5567 FN(msg_redirect_map, 60, ##ctx) \
5568 FN(msg_apply_bytes, 61, ##ctx) \
5569 FN(msg_cork_bytes, 62, ##ctx) \
5570 FN(msg_pull_data, 63, ##ctx) \
5571 FN(bind, 64, ##ctx) \
5572 FN(xdp_adjust_tail, 65, ##ctx) \
5573 FN(skb_get_xfrm_state, 66, ##ctx) \
5574 FN(get_stack, 67, ##ctx) \
5575 FN(skb_load_bytes_relative, 68, ##ctx) \
5576 FN(fib_lookup, 69, ##ctx) \
5577 FN(sock_hash_update, 70, ##ctx) \
5578 FN(msg_redirect_hash, 71, ##ctx) \
5579 FN(sk_redirect_hash, 72, ##ctx) \
5580 FN(lwt_push_encap, 73, ##ctx) \
5581 FN(lwt_seg6_store_bytes, 74, ##ctx) \
5582 FN(lwt_seg6_adjust_srh, 75, ##ctx) \
5583 FN(lwt_seg6_action, 76, ##ctx) \
5584 FN(rc_repeat, 77, ##ctx) \
5585 FN(rc_keydown, 78, ##ctx) \
5586 FN(skb_cgroup_id, 79, ##ctx) \
5587 FN(get_current_cgroup_id, 80, ##ctx) \
5588 FN(get_local_storage, 81, ##ctx) \
5589 FN(sk_select_reuseport, 82, ##ctx) \
5590 FN(skb_ancestor_cgroup_id, 83, ##ctx) \
5591 FN(sk_lookup_tcp, 84, ##ctx) \
5592 FN(sk_lookup_udp, 85, ##ctx) \
5593 FN(sk_release, 86, ##ctx) \
5594 FN(map_push_elem, 87, ##ctx) \
5595 FN(map_pop_elem, 88, ##ctx) \
5596 FN(map_peek_elem, 89, ##ctx) \
5597 FN(msg_push_data, 90, ##ctx) \
5598 FN(msg_pop_data, 91, ##ctx) \
5599 FN(rc_pointer_rel, 92, ##ctx) \
5600 FN(spin_lock, 93, ##ctx) \
5601 FN(spin_unlock, 94, ##ctx) \
5602 FN(sk_fullsock, 95, ##ctx) \
5603 FN(tcp_sock, 96, ##ctx) \
5604 FN(skb_ecn_set_ce, 97, ##ctx) \
5605 FN(get_listener_sock, 98, ##ctx) \
5606 FN(skc_lookup_tcp, 99, ##ctx) \
5607 FN(tcp_check_syncookie, 100, ##ctx) \
5608 FN(sysctl_get_name, 101, ##ctx) \
5609 FN(sysctl_get_current_value, 102, ##ctx) \
5610 FN(sysctl_get_new_value, 103, ##ctx) \
5611 FN(sysctl_set_new_value, 104, ##ctx) \
5612 FN(strtol, 105, ##ctx) \
5613 FN(strtoul, 106, ##ctx) \
5614 FN(sk_storage_get, 107, ##ctx) \
5615 FN(sk_storage_delete, 108, ##ctx) \
5616 FN(send_signal, 109, ##ctx) \
5617 FN(tcp_gen_syncookie, 110, ##ctx) \
5618 FN(skb_output, 111, ##ctx) \
5619 FN(probe_read_user, 112, ##ctx) \
5620 FN(probe_read_kernel, 113, ##ctx) \
5621 FN(probe_read_user_str, 114, ##ctx) \
5622 FN(probe_read_kernel_str, 115, ##ctx) \
5623 FN(tcp_send_ack, 116, ##ctx) \
5624 FN(send_signal_thread, 117, ##ctx) \
5625 FN(jiffies64, 118, ##ctx) \
5626 FN(read_branch_records, 119, ##ctx) \
5627 FN(get_ns_current_pid_tgid, 120, ##ctx) \
5628 FN(xdp_output, 121, ##ctx) \
5629 FN(get_netns_cookie, 122, ##ctx) \
5630 FN(get_current_ancestor_cgroup_id, 123, ##ctx) \
5631 FN(sk_assign, 124, ##ctx) \
5632 FN(ktime_get_boot_ns, 125, ##ctx) \
5633 FN(seq_printf, 126, ##ctx) \
5634 FN(seq_write, 127, ##ctx) \
5635 FN(sk_cgroup_id, 128, ##ctx) \
5636 FN(sk_ancestor_cgroup_id, 129, ##ctx) \
5637 FN(ringbuf_output, 130, ##ctx) \
5638 FN(ringbuf_reserve, 131, ##ctx) \
5639 FN(ringbuf_submit, 132, ##ctx) \
5640 FN(ringbuf_discard, 133, ##ctx) \
5641 FN(ringbuf_query, 134, ##ctx) \
5642 FN(csum_level, 135, ##ctx) \
5643 FN(skc_to_tcp6_sock, 136, ##ctx) \
5644 FN(skc_to_tcp_sock, 137, ##ctx) \
5645 FN(skc_to_tcp_timewait_sock, 138, ##ctx) \
5646 FN(skc_to_tcp_request_sock, 139, ##ctx) \
5647 FN(skc_to_udp6_sock, 140, ##ctx) \
5648 FN(get_task_stack, 141, ##ctx) \
5649 FN(load_hdr_opt, 142, ##ctx) \
5650 FN(store_hdr_opt, 143, ##ctx) \
5651 FN(reserve_hdr_opt, 144, ##ctx) \
5652 FN(inode_storage_get, 145, ##ctx) \
5653 FN(inode_storage_delete, 146, ##ctx) \
5654 FN(d_path, 147, ##ctx) \
5655 FN(copy_from_user, 148, ##ctx) \
5656 FN(snprintf_btf, 149, ##ctx) \
5657 FN(seq_printf_btf, 150, ##ctx) \
5658 FN(skb_cgroup_classid, 151, ##ctx) \
5659 FN(redirect_neigh, 152, ##ctx) \
5660 FN(per_cpu_ptr, 153, ##ctx) \
5661 FN(this_cpu_ptr, 154, ##ctx) \
5662 FN(redirect_peer, 155, ##ctx) \
5663 FN(task_storage_get, 156, ##ctx) \
5664 FN(task_storage_delete, 157, ##ctx) \
5665 FN(get_current_task_btf, 158, ##ctx) \
5666 FN(bprm_opts_set, 159, ##ctx) \
5667 FN(ktime_get_coarse_ns, 160, ##ctx) \
5668 FN(ima_inode_hash, 161, ##ctx) \
5669 FN(sock_from_file, 162, ##ctx) \
5670 FN(check_mtu, 163, ##ctx) \
5671 FN(for_each_map_elem, 164, ##ctx) \
5672 FN(snprintf, 165, ##ctx) \
5673 FN(sys_bpf, 166, ##ctx) \
5674 FN(btf_find_by_name_kind, 167, ##ctx) \
5675 FN(sys_close, 168, ##ctx) \
5676 FN(timer_init, 169, ##ctx) \
5677 FN(timer_set_callback, 170, ##ctx) \
5678 FN(timer_start, 171, ##ctx) \
5679 FN(timer_cancel, 172, ##ctx) \
5680 FN(get_func_ip, 173, ##ctx) \
5681 FN(get_attach_cookie, 174, ##ctx) \
5682 FN(task_pt_regs, 175, ##ctx) \
5683 FN(get_branch_snapshot, 176, ##ctx) \
5684 FN(trace_vprintk, 177, ##ctx) \
5685 FN(skc_to_unix_sock, 178, ##ctx) \
5686 FN(kallsyms_lookup_name, 179, ##ctx) \
5687 FN(find_vma, 180, ##ctx) \
5688 FN(loop, 181, ##ctx) \
5689 FN(strncmp, 182, ##ctx) \
5690 FN(get_func_arg, 183, ##ctx) \
5691 FN(get_func_ret, 184, ##ctx) \
5692 FN(get_func_arg_cnt, 185, ##ctx) \
5693 FN(get_retval, 186, ##ctx) \
5694 FN(set_retval, 187, ##ctx) \
5695 FN(xdp_get_buff_len, 188, ##ctx) \
5696 FN(xdp_load_bytes, 189, ##ctx) \
5697 FN(xdp_store_bytes, 190, ##ctx) \
5698 FN(copy_from_user_task, 191, ##ctx) \
5699 FN(skb_set_tstamp, 192, ##ctx) \
5700 FN(ima_file_hash, 193, ##ctx) \
5701 FN(kptr_xchg, 194, ##ctx) \
5702 FN(map_lookup_percpu_elem, 195, ##ctx) \
5703 FN(skc_to_mptcp_sock, 196, ##ctx) \
5704 FN(dynptr_from_mem, 197, ##ctx) \
5705 FN(ringbuf_reserve_dynptr, 198, ##ctx) \
5706 FN(ringbuf_submit_dynptr, 199, ##ctx) \
5707 FN(ringbuf_discard_dynptr, 200, ##ctx) \
5708 FN(dynptr_read, 201, ##ctx) \
5709 FN(dynptr_write, 202, ##ctx) \
5710 FN(dynptr_data, 203, ##ctx) \
5711 FN(tcp_raw_gen_syncookie_ipv4, 204, ##ctx) \
5712 FN(tcp_raw_gen_syncookie_ipv6, 205, ##ctx) \
5713 FN(tcp_raw_check_syncookie_ipv4, 206, ##ctx) \
5714 FN(tcp_raw_check_syncookie_ipv6, 207, ##ctx) \
5715 FN(ktime_get_tai_ns, 208, ##ctx) \
5716 FN(user_ringbuf_drain, 209, ##ctx) \
5717 FN(cgrp_storage_get, 210, ##ctx) \
5718 FN(cgrp_storage_delete, 211, ##ctx) \
51235719 /* */
51245720
5721/* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
5722 * know or care about integer value that is now passed as second argument
5723 */
5724#define __BPF_FUNC_MAPPER_APPLY(name, value, FN) FN(name),
5725#define __BPF_FUNC_MAPPER(FN) ___BPF_FUNC_MAPPER(__BPF_FUNC_MAPPER_APPLY, FN)
5726
51255727/* integer value in 'imm' field of BPF_CALL instruction selects which helper
51265728 * function eBPF program intends to call
51275729 */
5128#define __BPF_ENUM_FN(x) BPF_FUNC_ ## x
5730#define __BPF_ENUM_FN(x, y) BPF_FUNC_ ## x = y,
51295731enum bpf_func_id {
5130 __BPF_FUNC_MAPPER(__BPF_ENUM_FN)
5732 ___BPF_FUNC_MAPPER(__BPF_ENUM_FN)
51315733 __BPF_FUNC_MAX_ID,
51325734};
51335735#undef __BPF_ENUM_FN
......@@ -5180,6 +5782,12 @@ enum {
51805782 BPF_F_ZERO_CSUM_TX = (1ULL << 1),
51815783 BPF_F_DONT_FRAGMENT = (1ULL << 2),
51825784 BPF_F_SEQ_NUMBER = (1ULL << 3),
5785 BPF_F_NO_TUNNEL_KEY = (1ULL << 4),
5786};
5787
5788/* BPF_FUNC_skb_get_tunnel_key flags. */
5789enum {
5790 BPF_F_TUNINFO_FLAGS = (1ULL << 4),
51835791};
51845792
51855793/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and
......@@ -5214,6 +5822,8 @@ enum {
52145822 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
52155823 BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
52165824 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),
5825 BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = (1ULL << 7),
5826 BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = (1ULL << 8),
52175827};
52185828
52195829enum {
......@@ -5309,6 +5919,15 @@ union { \
53095919 __u64 :64; \
53105920} __attribute__((aligned(8)))
53115921
5922enum {
5923 BPF_SKB_TSTAMP_UNSPEC,
5924 BPF_SKB_TSTAMP_DELIVERY_MONO, /* tstamp has mono delivery time */
5925 /* For any BPF_SKB_TSTAMP_* that the bpf prog cannot handle,
5926 * the bpf prog should handle it like BPF_SKB_TSTAMP_UNSPEC
5927 * and try to deduce it by ingress, egress or skb->sk->sk_clockid.
5928 */
5929};
5930
53125931/* user accessible mirror of in-kernel sk_buff.
53135932 * new fields can only be added to the end of this structure
53145933 */
......@@ -5349,7 +5968,8 @@ struct __sk_buff {
53495968 __u32 gso_segs;
53505969 __bpf_md_ptr(struct bpf_sock *, sk);
53515970 __u32 gso_size;
5352 __u32 :32; /* Padding, future use. */
5971 __u8 tstamp_type;
5972 __u32 :24; /* Padding, future use. */
53535973 __u64 hwtstamp;
53545974};
53555975
......@@ -5361,8 +5981,15 @@ struct bpf_tunnel_key {
53615981 };
53625982 __u8 tunnel_tos;
53635983 __u8 tunnel_ttl;
5364 __u16 tunnel_ext; /* Padding, future use. */
5984 union {
5985 __u16 tunnel_ext; /* compat */
5986 __be16 tunnel_flags;
5987 };
53655988 __u32 tunnel_label;
5989 union {
5990 __u32 local_ipv4;
5991 __u32 local_ipv6[4];
5992 };
53665993};
53675994
53685995/* user accessible mirror of in-kernel xfrm_state.
......@@ -5401,6 +6028,11 @@ enum bpf_ret_code {
54016028 * represented by BPF_REDIRECT above).
54026029 */
54036030 BPF_LWT_REROUTE = 128,
6031 /* BPF_FLOW_DISSECTOR_CONTINUE: used by BPF_PROG_TYPE_FLOW_DISSECTOR
6032 * to indicate that no custom dissection was performed, and
6033 * fallback to standard dissector is requested.
6034 */
6035 BPF_FLOW_DISSECTOR_CONTINUE = 129,
54046036};
54056037
54066038struct bpf_sock {
......@@ -5414,7 +6046,8 @@ struct bpf_sock {
54146046 __u32 src_ip4;
54156047 __u32 src_ip6[4];
54166048 __u32 src_port; /* host byte order */
5417 __u32 dst_port; /* network byte order */
6049 __be16 dst_port; /* network byte order */
6050 __u16 :16; /* zero padding */
54186051 __u32 dst_ip4;
54196052 __u32 dst_ip6[4];
54206053 __u32 state;
......@@ -5645,6 +6278,8 @@ struct bpf_prog_info {
56456278 __u64 run_cnt;
56466279 __u64 recursion_misses;
56476280 __u32 verified_insns;
6281 __u32 attach_btf_obj_id;
6282 __u32 attach_btf_id;
56486283} __attribute__((aligned(8)));
56496284
56506285struct bpf_map_info {
......@@ -5696,11 +6331,26 @@ struct bpf_link_info {
56966331 struct {
56976332 __aligned_u64 target_name; /* in/out: target_name buffer ptr */
56986333 __u32 target_name_len; /* in/out: target_name buffer len */
6334
6335 /* If the iter specific field is 32 bits, it can be put
6336 * in the first or second union. Otherwise it should be
6337 * put in the second union.
6338 */
56996339 union {
57006340 struct {
57016341 __u32 map_id;
57026342 } map;
57036343 };
6344 union {
6345 struct {
6346 __u64 cgroup_id;
6347 __u32 order;
6348 } cgroup;
6349 struct {
6350 __u32 tid;
6351 __u32 pid;
6352 } task;
6353 };
57046354 } iter;
57056355 struct {
57066356 __u32 netns_ino;
......@@ -5819,6 +6469,7 @@ struct bpf_sock_ops {
58196469 * the outgoing header has not
58206470 * been written yet.
58216471 */
6472 __u64 skb_hwtstamp;
58226473};
58236474
58246475/* Definitions for bpf_sock_ops_cb_flags */
......@@ -6104,6 +6755,7 @@ struct bpf_raw_tracepoint_args {
61046755enum {
61056756 BPF_FIB_LOOKUP_DIRECT = (1U << 0),
61066757 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
6758 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
61076759};
61086760
61096761enum {
......@@ -6256,6 +6908,32 @@ struct bpf_timer {
62566908 __u64 :64;
62576909} __attribute__((aligned(8)));
62586910
6911struct bpf_dynptr {
6912 __u64 :64;
6913 __u64 :64;
6914} __attribute__((aligned(8)));
6915
6916struct bpf_list_head {
6917 __u64 :64;
6918 __u64 :64;
6919} __attribute__((aligned(8)));
6920
6921struct bpf_list_node {
6922 __u64 :64;
6923 __u64 :64;
6924} __attribute__((aligned(8)));
6925
6926struct bpf_rb_root {
6927 __u64 :64;
6928 __u64 :64;
6929} __attribute__((aligned(8)));
6930
6931struct bpf_rb_node {
6932 __u64 :64;
6933 __u64 :64;
6934 __u64 :64;
6935} __attribute__((aligned(8)));
6936
62596937struct bpf_sysctl {
62606938 __u32 write; /* Sysctl is being read (= 0) or written (= 1).
62616939 * Allows 1,2,4-byte read, but no write.
......@@ -6292,10 +6970,12 @@ struct bpf_sk_lookup {
62926970 __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */
62936971 __u32 remote_ip4; /* Network byte order */
62946972 __u32 remote_ip6[4]; /* Network byte order */
6295 __u32 remote_port; /* Network byte order */
6973 __be16 remote_port; /* Network byte order */
6974 __u16 :16; /* Zero padding */
62966975 __u32 local_ip4; /* Network byte order */
62976976 __u32 local_ip6[4]; /* Network byte order */
62986977 __u32 local_port; /* Host byte order */
6978 __u32 ingress_ifindex; /* The arriving interface. Determined by inet_iif. */
62996979};
63006980
63016981/*
......@@ -6328,4 +7008,79 @@ enum {
63287008 BTF_F_ZERO = (1ULL << 3),
63297009};
63307010
7011/* bpf_core_relo_kind encodes which aspect of captured field/type/enum value
7012 * has to be adjusted by relocations. It is emitted by llvm and passed to
7013 * libbpf and later to the kernel.
7014 */
7015enum bpf_core_relo_kind {
7016 BPF_CORE_FIELD_BYTE_OFFSET = 0, /* field byte offset */
7017 BPF_CORE_FIELD_BYTE_SIZE = 1, /* field size in bytes */
7018 BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */
7019 BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */
7020 BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */
7021 BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */
7022 BPF_CORE_TYPE_ID_LOCAL = 6, /* type ID in local BPF object */
7023 BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */
7024 BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */
7025 BPF_CORE_TYPE_SIZE = 9, /* type size in bytes */
7026 BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */
7027 BPF_CORE_ENUMVAL_VALUE = 11, /* enum value integer value */
7028 BPF_CORE_TYPE_MATCHES = 12, /* type match in target kernel */
7029};
7030
7031/*
7032 * "struct bpf_core_relo" is used to pass relocation data form LLVM to libbpf
7033 * and from libbpf to the kernel.
7034 *
7035 * CO-RE relocation captures the following data:
7036 * - insn_off - instruction offset (in bytes) within a BPF program that needs
7037 * its insn->imm field to be relocated with actual field info;
7038 * - type_id - BTF type ID of the "root" (containing) entity of a relocatable
7039 * type or field;
7040 * - access_str_off - offset into corresponding .BTF string section. String
7041 * interpretation depends on specific relocation kind:
7042 * - for field-based relocations, string encodes an accessed field using
7043 * a sequence of field and array indices, separated by colon (:). It's
7044 * conceptually very close to LLVM's getelementptr ([0]) instruction's
7045 * arguments for identifying offset to a field.
7046 * - for type-based relocations, strings is expected to be just "0";
7047 * - for enum value-based relocations, string contains an index of enum
7048 * value within its enum type;
7049 * - kind - one of enum bpf_core_relo_kind;
7050 *
7051 * Example:
7052 * struct sample {
7053 * int a;
7054 * struct {
7055 * int b[10];
7056 * };
7057 * };
7058 *
7059 * struct sample *s = ...;
7060 * int *x = &s->a; // encoded as "0:0" (a is field #0)
7061 * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1,
7062 * // b is field #0 inside anon struct, accessing elem #5)
7063 * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array)
7064 *
7065 * type_id for all relocs in this example will capture BTF type id of
7066 * `struct sample`.
7067 *
7068 * Such relocation is emitted when using __builtin_preserve_access_index()
7069 * Clang built-in, passing expression that captures field address, e.g.:
7070 *
7071 * bpf_probe_read(&dst, sizeof(dst),
7072 * __builtin_preserve_access_index(&src->a.b.c));
7073 *
7074 * In this case Clang will emit field relocation recording necessary data to
7075 * be able to find offset of embedded `a.b.c` field within `src` struct.
7076 *
7077 * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction
7078 */
7079struct bpf_core_relo {
7080 __u32 insn_off;
7081 __u32 type_id;
7082 __u32 access_str_off;
7083 enum bpf_core_relo_kind kind;
7084};
7085
63317086#endif /* __LINUX_BPF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btf.h+18-6
......@@ -33,17 +33,17 @@ struct btf_type {
3333 /* "info" bits arrangement
3434 * bits 0-15: vlen (e.g. # of struct's members)
3535 * bits 16-23: unused
36 * bits 24-27: kind (e.g. int, ptr, array...etc)
37 * bits 28-30: unused
36 * bits 24-28: kind (e.g. int, ptr, array...etc)
37 * bits 29-30: unused
3838 * bit 31: kind_flag, currently used by
39 * struct, union and fwd
39 * struct, union, enum, fwd and enum64
4040 */
4141 __u32 info;
42 /* "size" is used by INT, ENUM, STRUCT, UNION and DATASEC.
42 /* "size" is used by INT, ENUM, STRUCT, UNION, DATASEC and ENUM64.
4343 * "size" tells the size of the type it is describing.
4444 *
4545 * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
46 * FUNC, FUNC_PROTO, VAR and DECL_TAG.
46 * FUNC, FUNC_PROTO, VAR, DECL_TAG and TYPE_TAG.
4747 * "type" is a type_id referring to another type.
4848 */
4949 union {
......@@ -63,7 +63,7 @@ enum {
6363 BTF_KIND_ARRAY = 3, /* Array */
6464 BTF_KIND_STRUCT = 4, /* Struct */
6565 BTF_KIND_UNION = 5, /* Union */
66 BTF_KIND_ENUM = 6, /* Enumeration */
66 BTF_KIND_ENUM = 6, /* Enumeration up to 32-bit values */
6767 BTF_KIND_FWD = 7, /* Forward */
6868 BTF_KIND_TYPEDEF = 8, /* Typedef */
6969 BTF_KIND_VOLATILE = 9, /* Volatile */
......@@ -75,6 +75,8 @@ enum {
7575 BTF_KIND_DATASEC = 15, /* Section */
7676 BTF_KIND_FLOAT = 16, /* Floating point */
7777 BTF_KIND_DECL_TAG = 17, /* Decl Tag */
78 BTF_KIND_TYPE_TAG = 18, /* Type Tag */
79 BTF_KIND_ENUM64 = 19, /* Enumeration up to 64-bit values */
7880
7981 NR_BTF_KINDS,
8082 BTF_KIND_MAX = NR_BTF_KINDS - 1,
......@@ -185,4 +187,14 @@ struct btf_decl_tag {
185187 __s32 component_idx;
186188};
187189
190/* BTF_KIND_ENUM64 is followed by multiple "struct btf_enum64".
191 * The exact number of btf_enum64 is stored in the vlen (of the
192 * info in "struct btf_type").
193 */
194struct btf_enum64 {
195 __u32 name_off;
196 __u32 val_lo32;
197 __u32 val_hi32;
198};
199
188200#endif /* __LINUX_BTF_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs.h+195-13
......@@ -19,8 +19,14 @@
1919
2020#ifndef _LINUX_BTRFS_H
2121#define _LINUX_BTRFS_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
2227#include <linux/types.h>
2328#include <linux/ioctl.h>
29#include <linux/fs.h>
2430
2531#define BTRFS_IOCTL_MAGIC 0x94
2632#define BTRFS_VOL_NAME_MAX 255
......@@ -91,7 +97,7 @@ struct btrfs_qgroup_inherit {
9197 __u64 num_ref_copies;
9298 __u64 num_excl_copies;
9399 struct btrfs_qgroup_limit lim;
94 __u64 qgroups[0];
100 __u64 qgroups[];
95101};
96102
97103struct btrfs_ioctl_qgroup_limit_args {
......@@ -179,6 +185,7 @@ struct btrfs_scrub_progress {
179185};
180186
181187#define BTRFS_SCRUB_READONLY 1
188#define BTRFS_SCRUB_SUPPORTED_FLAGS (BTRFS_SCRUB_READONLY)
182189struct btrfs_ioctl_scrub_args {
183190 __u64 devid; /* in */
184191 __u64 start; /* in */
......@@ -237,7 +244,17 @@ struct btrfs_ioctl_dev_info_args {
237244 __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
238245 __u64 bytes_used; /* out */
239246 __u64 total_bytes; /* out */
240 __u64 unused[379]; /* pad to 4k */
247 /*
248 * Optional, out.
249 *
250 * Showing the fsid of the device, allowing user space to check if this
251 * device is a seeding one.
252 *
253 * Introduced in v6.3, thus user space still needs to check if kernel
254 * changed this value. Older kernel will not touch the values here.
255 */
256 __u8 fsid[BTRFS_UUID_SIZE];
257 __u64 unused[377]; /* pad to 4k */
241258 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
242259};
243260
......@@ -288,6 +305,12 @@ struct btrfs_ioctl_fs_info_args {
288305#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
289306#define BTRFS_FEATURE_COMPAT_RO_VERITY (1ULL << 2)
290307
308/*
309 * Put all block group items into a dedicated block group tree, greatly
310 * reducing mount time for large filesystem due to better locality.
311 */
312#define BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE (1ULL << 3)
313
291314#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
292315#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
293316#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
......@@ -307,6 +330,7 @@ struct btrfs_ioctl_fs_info_args {
307330#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
308331#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
309332#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
333#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
310334
311335struct btrfs_ioctl_feature_flags {
312336 __u64 compat_flags;
......@@ -324,6 +348,12 @@ struct btrfs_ioctl_feature_flags {
324348 */
325349struct btrfs_balance_args {
326350 __u64 profiles;
351
352 /*
353 * usage filter
354 * BTRFS_BALANCE_ARGS_USAGE with a single value means '0..N'
355 * BTRFS_BALANCE_ARGS_USAGE_RANGE - range syntax, min..max
356 */
327357 union {
328358 __u64 usage;
329359 struct {
......@@ -540,7 +570,7 @@ struct btrfs_ioctl_search_header {
540570 __u64 offset;
541571 __u32 type;
542572 __u32 len;
543};
573} __attribute__ ((__may_alias__));
544574
545575#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
546576/*
......@@ -553,18 +583,23 @@ struct btrfs_ioctl_search_args {
553583 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
554584};
555585
586/*
587 * Extended version of TREE_SEARCH ioctl that can return more than 4k of bytes.
588 * The allocated size of the buffer is set in buf_size.
589 */
556590struct btrfs_ioctl_search_args_v2 {
557591 struct btrfs_ioctl_search_key key; /* in/out - search parameters */
558592 __u64 buf_size; /* in - size of buffer
559593 * out - on EOVERFLOW: needed size
560594 * to store item */
561 __u64 buf[0]; /* out - found items */
595 __u64 buf[]; /* out - found items */
562596};
563597
598/* With a @src_length of zero, the range from @src_offset->EOF is cloned! */
564599struct btrfs_ioctl_clone_range_args {
565 __s64 src_fd;
566 __u64 src_offset, src_length;
567 __u64 dest_offset;
600 __s64 src_fd;
601 __u64 src_offset, src_length;
602 __u64 dest_offset;
568603};
569604
570605/*
......@@ -629,7 +664,7 @@ struct btrfs_ioctl_same_args {
629664 __u16 dest_count; /* in - total elements in info array */
630665 __u16 reserved1;
631666 __u32 reserved2;
632 struct btrfs_ioctl_same_extent_info info[0];
667 struct btrfs_ioctl_same_extent_info info[];
633668};
634669
635670struct btrfs_ioctl_space_info {
......@@ -641,7 +676,7 @@ struct btrfs_ioctl_space_info {
641676struct btrfs_ioctl_space_args {
642677 __u64 space_slots;
643678 __u64 total_spaces;
644 struct btrfs_ioctl_space_info spaces[0];
679 struct btrfs_ioctl_space_info spaces[];
645680};
646681
647682struct btrfs_data_container {
......@@ -649,7 +684,7 @@ struct btrfs_data_container {
649684 __u32 bytes_missing; /* out -- additional bytes needed for result */
650685 __u32 elem_cnt; /* out */
651686 __u32 elem_missed; /* out */
652 __u64 val[0]; /* out */
687 __u64 val[]; /* out */
653688};
654689
655690struct btrfs_ioctl_ino_path_args {
......@@ -668,8 +703,11 @@ struct btrfs_ioctl_logical_ino_args {
668703 /* struct btrfs_data_container *inodes; out */
669704 __u64 inodes;
670705};
671/* Return every ref to the extent, not just those containing logical block.
672 * Requires logical == extent bytenr. */
706
707/*
708 * Return every ref to the extent, not just those containing logical block.
709 * Requires logical == extent bytenr.
710 */
673711#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
674712
675713enum btrfs_dev_stat_values {
......@@ -774,11 +812,19 @@ struct btrfs_ioctl_received_subvol_args {
774812 */
775813#define BTRFS_SEND_FLAG_VERSION 0x8
776814
815/*
816 * Send compressed data using the ENCODED_WRITE command instead of decompressing
817 * the data and sending it with the WRITE command. This requires protocol
818 * version >= 2.
819 */
820#define BTRFS_SEND_FLAG_COMPRESSED 0x10
821
777822#define BTRFS_SEND_FLAG_MASK \
778823 (BTRFS_SEND_FLAG_NO_FILE_DATA | \
779824 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \
780825 BTRFS_SEND_FLAG_OMIT_END_CMD | \
781 BTRFS_SEND_FLAG_VERSION)
826 BTRFS_SEND_FLAG_VERSION | \
827 BTRFS_SEND_FLAG_COMPRESSED)
782828
783829struct btrfs_ioctl_send_args {
784830 __s64 send_fd; /* in */
......@@ -866,6 +912,134 @@ struct btrfs_ioctl_get_subvol_rootref_args {
866912 __u8 align[7];
867913};
868914
915/*
916 * Data and metadata for an encoded read or write.
917 *
918 * Encoded I/O bypasses any encoding automatically done by the filesystem (e.g.,
919 * compression). This can be used to read the compressed contents of a file or
920 * write pre-compressed data directly to a file.
921 *
922 * BTRFS_IOC_ENCODED_READ and BTRFS_IOC_ENCODED_WRITE are essentially
923 * preadv/pwritev with additional metadata about how the data is encoded and the
924 * size of the unencoded data.
925 *
926 * BTRFS_IOC_ENCODED_READ fills the given iovecs with the encoded data, fills
927 * the metadata fields, and returns the size of the encoded data. It reads one
928 * extent per call. It can also read data which is not encoded.
929 *
930 * BTRFS_IOC_ENCODED_WRITE uses the metadata fields, writes the encoded data
931 * from the iovecs, and returns the size of the encoded data. Note that the
932 * encoded data is not validated when it is written; if it is not valid (e.g.,
933 * it cannot be decompressed), then a subsequent read may return an error.
934 *
935 * Since the filesystem page cache contains decoded data, encoded I/O bypasses
936 * the page cache. Encoded I/O requires CAP_SYS_ADMIN.
937 */
938struct btrfs_ioctl_encoded_io_args {
939 /* Input parameters for both reads and writes. */
940
941 /*
942 * iovecs containing encoded data.
943 *
944 * For reads, if the size of the encoded data is larger than the sum of
945 * iov[n].iov_len for 0 <= n < iovcnt, then the ioctl fails with
946 * ENOBUFS.
947 *
948 * For writes, the size of the encoded data is the sum of iov[n].iov_len
949 * for 0 <= n < iovcnt. This must be less than 128 KiB (this limit may
950 * increase in the future). This must also be less than or equal to
951 * unencoded_len.
952 */
953 const struct iovec *iov;
954 /* Number of iovecs. */
955 unsigned long iovcnt;
956 /*
957 * Offset in file.
958 *
959 * For writes, must be aligned to the sector size of the filesystem.
960 */
961 __s64 offset;
962 /* Currently must be zero. */
963 __u64 flags;
964
965 /*
966 * For reads, the following members are output parameters that will
967 * contain the returned metadata for the encoded data.
968 * For writes, the following members must be set to the metadata for the
969 * encoded data.
970 */
971
972 /*
973 * Length of the data in the file.
974 *
975 * Must be less than or equal to unencoded_len - unencoded_offset. For
976 * writes, must be aligned to the sector size of the filesystem unless
977 * the data ends at or beyond the current end of the file.
978 */
979 __u64 len;
980 /*
981 * Length of the unencoded (i.e., decrypted and decompressed) data.
982 *
983 * For writes, must be no more than 128 KiB (this limit may increase in
984 * the future). If the unencoded data is actually longer than
985 * unencoded_len, then it is truncated; if it is shorter, then it is
986 * extended with zeroes.
987 */
988 __u64 unencoded_len;
989 /*
990 * Offset from the first byte of the unencoded data to the first byte of
991 * logical data in the file.
992 *
993 * Must be less than unencoded_len.
994 */
995 __u64 unencoded_offset;
996 /*
997 * BTRFS_ENCODED_IO_COMPRESSION_* type.
998 *
999 * For writes, must not be BTRFS_ENCODED_IO_COMPRESSION_NONE.
1000 */
1001 __u32 compression;
1002 /* Currently always BTRFS_ENCODED_IO_ENCRYPTION_NONE. */
1003 __u32 encryption;
1004 /*
1005 * Reserved for future expansion.
1006 *
1007 * For reads, always returned as zero. Users should check for non-zero
1008 * bytes. If there are any, then the kernel has a newer version of this
1009 * structure with additional information that the user definition is
1010 * missing.
1011 *
1012 * For writes, must be zeroed.
1013 */
1014 __u8 reserved[64];
1015};
1016
1017/* Data is not compressed. */
1018#define BTRFS_ENCODED_IO_COMPRESSION_NONE 0
1019/* Data is compressed as a single zlib stream. */
1020#define BTRFS_ENCODED_IO_COMPRESSION_ZLIB 1
1021/*
1022 * Data is compressed as a single zstd frame with the windowLog compression
1023 * parameter set to no more than 17.
1024 */
1025#define BTRFS_ENCODED_IO_COMPRESSION_ZSTD 2
1026/*
1027 * Data is compressed sector by sector (using the sector size indicated by the
1028 * name of the constant) with LZO1X and wrapped in the format documented in
1029 * fs/btrfs/lzo.c. For writes, the compression sector size must match the
1030 * filesystem sector size.
1031 */
1032#define BTRFS_ENCODED_IO_COMPRESSION_LZO_4K 3
1033#define BTRFS_ENCODED_IO_COMPRESSION_LZO_8K 4
1034#define BTRFS_ENCODED_IO_COMPRESSION_LZO_16K 5
1035#define BTRFS_ENCODED_IO_COMPRESSION_LZO_32K 6
1036#define BTRFS_ENCODED_IO_COMPRESSION_LZO_64K 7
1037#define BTRFS_ENCODED_IO_COMPRESSION_TYPES 8
1038
1039/* Data is not encrypted. */
1040#define BTRFS_ENCODED_IO_ENCRYPTION_NONE 0
1041#define BTRFS_ENCODED_IO_ENCRYPTION_TYPES 1
1042
8691043/* Error codes as returned by the kernel */
8701044enum btrfs_err_code {
8711045 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,
......@@ -994,5 +1168,13 @@ enum btrfs_err_code {
9941168 struct btrfs_ioctl_ino_lookup_user_args)
9951169#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
9961170 struct btrfs_ioctl_vol_args_v2)
1171#define BTRFS_IOC_ENCODED_READ _IOR(BTRFS_IOCTL_MAGIC, 64, \
1172 struct btrfs_ioctl_encoded_io_args)
1173#define BTRFS_IOC_ENCODED_WRITE _IOW(BTRFS_IOCTL_MAGIC, 64, \
1174 struct btrfs_ioctl_encoded_io_args)
1175
1176#ifdef __cplusplus
1177}
1178#endif
9971179
9981180#endif /* _LINUX_BTRFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/btrfs_tree.h+246-15
......@@ -6,6 +6,23 @@
66#include <linux/types.h>
77#include <stddef.h>
88
9/* ASCII for _BHRfS_M, no terminating nul */
10#define BTRFS_MAGIC 0x4D5F53665248425FULL
11
12#define BTRFS_MAX_LEVEL 8
13
14/*
15 * We can actually store much bigger names, but lets not confuse the rest of
16 * linux.
17 */
18#define BTRFS_NAME_LEN 255
19
20/*
21 * Theoretical limit is larger, but we keep this down to a sane value. That
22 * should limit greatly the possibility of collisions on inode ref items.
23 */
24#define BTRFS_LINK_MAX 65535U
25
926/*
1027 * This header contains the structure definitions and constants used
1128 * by file system objects that can be retrieved using
......@@ -49,6 +66,9 @@
4966/* tracks free space in block groups. */
5067#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
5168
69/* Holds the block group items for extent tree v2. */
70#define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL
71
5272/* device stats in the device tree */
5373#define BTRFS_DEV_STATS_OBJECTID 0ULL
5474
......@@ -142,7 +162,9 @@
142162
143163/*
144164 * dir items are the name -> inode pointers in a directory. There is one
145 * for every name in a directory.
165 * for every name in a directory. BTRFS_DIR_LOG_ITEM_KEY is no longer used
166 * but it's still defined here for documentation purposes and to help avoid
167 * having its numerical value reused in the future.
146168 */
147169#define BTRFS_DIR_LOG_ITEM_KEY 60
148170#define BTRFS_DIR_LOG_INDEX_KEY 72
......@@ -350,6 +372,50 @@ enum btrfs_csum_type {
350372#define BTRFS_FT_SYMLINK 7
351373#define BTRFS_FT_XATTR 8
352374#define BTRFS_FT_MAX 9
375/* Directory contains encrypted data */
376#define BTRFS_FT_ENCRYPTED 0x80
377
378static __inline__ __u8 btrfs_dir_flags_to_ftype(__u8 flags)
379{
380 return flags & ~BTRFS_FT_ENCRYPTED;
381}
382
383/*
384 * Inode flags
385 */
386#define BTRFS_INODE_NODATASUM (1U << 0)
387#define BTRFS_INODE_NODATACOW (1U << 1)
388#define BTRFS_INODE_READONLY (1U << 2)
389#define BTRFS_INODE_NOCOMPRESS (1U << 3)
390#define BTRFS_INODE_PREALLOC (1U << 4)
391#define BTRFS_INODE_SYNC (1U << 5)
392#define BTRFS_INODE_IMMUTABLE (1U << 6)
393#define BTRFS_INODE_APPEND (1U << 7)
394#define BTRFS_INODE_NODUMP (1U << 8)
395#define BTRFS_INODE_NOATIME (1U << 9)
396#define BTRFS_INODE_DIRSYNC (1U << 10)
397#define BTRFS_INODE_COMPRESS (1U << 11)
398
399#define BTRFS_INODE_ROOT_ITEM_INIT (1U << 31)
400
401#define BTRFS_INODE_FLAG_MASK \
402 (BTRFS_INODE_NODATASUM | \
403 BTRFS_INODE_NODATACOW | \
404 BTRFS_INODE_READONLY | \
405 BTRFS_INODE_NOCOMPRESS | \
406 BTRFS_INODE_PREALLOC | \
407 BTRFS_INODE_SYNC | \
408 BTRFS_INODE_IMMUTABLE | \
409 BTRFS_INODE_APPEND | \
410 BTRFS_INODE_NODUMP | \
411 BTRFS_INODE_NOATIME | \
412 BTRFS_INODE_DIRSYNC | \
413 BTRFS_INODE_COMPRESS | \
414 BTRFS_INODE_ROOT_ITEM_INIT)
415
416#define BTRFS_INODE_RO_VERITY (1U << 0)
417
418#define BTRFS_INODE_RO_FLAG_MASK (BTRFS_INODE_RO_VERITY)
353419
354420/*
355421 * The key defines the order in the tree, and so it also defines (optimal)
......@@ -380,6 +446,109 @@ struct btrfs_key {
380446 __u64 offset;
381447} __attribute__ ((__packed__));
382448
449/*
450 * Every tree block (leaf or node) starts with this header.
451 */
452struct btrfs_header {
453 /* These first four must match the super block */
454 __u8 csum[BTRFS_CSUM_SIZE];
455 /* FS specific uuid */
456 __u8 fsid[BTRFS_FSID_SIZE];
457 /* Which block this node is supposed to live in */
458 __le64 bytenr;
459 __le64 flags;
460
461 /* Allowed to be different from the super from here on down */
462 __u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
463 __le64 generation;
464 __le64 owner;
465 __le32 nritems;
466 __u8 level;
467} __attribute__ ((__packed__));
468
469/*
470 * This is a very generous portion of the super block, giving us room to
471 * translate 14 chunks with 3 stripes each.
472 */
473#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
474
475/*
476 * Just in case we somehow lose the roots and are not able to mount, we store
477 * an array of the roots from previous transactions in the super.
478 */
479#define BTRFS_NUM_BACKUP_ROOTS 4
480struct btrfs_root_backup {
481 __le64 tree_root;
482 __le64 tree_root_gen;
483
484 __le64 chunk_root;
485 __le64 chunk_root_gen;
486
487 __le64 extent_root;
488 __le64 extent_root_gen;
489
490 __le64 fs_root;
491 __le64 fs_root_gen;
492
493 __le64 dev_root;
494 __le64 dev_root_gen;
495
496 __le64 csum_root;
497 __le64 csum_root_gen;
498
499 __le64 total_bytes;
500 __le64 bytes_used;
501 __le64 num_devices;
502 /* future */
503 __le64 unused_64[4];
504
505 __u8 tree_root_level;
506 __u8 chunk_root_level;
507 __u8 extent_root_level;
508 __u8 fs_root_level;
509 __u8 dev_root_level;
510 __u8 csum_root_level;
511 /* future and to align */
512 __u8 unused_8[10];
513} __attribute__ ((__packed__));
514
515/*
516 * A leaf is full of items. offset and size tell us where to find the item in
517 * the leaf (relative to the start of the data area)
518 */
519struct btrfs_item {
520 struct btrfs_disk_key key;
521 __le32 offset;
522 __le32 size;
523} __attribute__ ((__packed__));
524
525/*
526 * Leaves have an item area and a data area:
527 * [item0, item1....itemN] [free space] [dataN...data1, data0]
528 *
529 * The data is separate from the items to get the keys closer together during
530 * searches.
531 */
532struct btrfs_leaf {
533 struct btrfs_header header;
534 struct btrfs_item items[];
535} __attribute__ ((__packed__));
536
537/*
538 * All non-leaf blocks are nodes, they hold only keys and pointers to other
539 * blocks.
540 */
541struct btrfs_key_ptr {
542 struct btrfs_disk_key key;
543 __le64 blockptr;
544 __le64 generation;
545} __attribute__ ((__packed__));
546
547struct btrfs_node {
548 struct btrfs_header header;
549 struct btrfs_key_ptr ptrs[];
550} __attribute__ ((__packed__));
551
383552struct btrfs_dev_item {
384553 /* the internal btrfs device id */
385554 __le64 devid;
......@@ -463,6 +632,69 @@ struct btrfs_chunk {
463632 /* additional stripes go here */
464633} __attribute__ ((__packed__));
465634
635/*
636 * The super block basically lists the main trees of the FS.
637 */
638struct btrfs_super_block {
639 /* The first 4 fields must match struct btrfs_header */
640 __u8 csum[BTRFS_CSUM_SIZE];
641 /* FS specific UUID, visible to user */
642 __u8 fsid[BTRFS_FSID_SIZE];
643 /* This block number */
644 __le64 bytenr;
645 __le64 flags;
646
647 /* Allowed to be different from the btrfs_header from here own down */
648 __le64 magic;
649 __le64 generation;
650 __le64 root;
651 __le64 chunk_root;
652 __le64 log_root;
653
654 /*
655 * This member has never been utilized since the very beginning, thus
656 * it's always 0 regardless of kernel version. We always use
657 * generation + 1 to read log tree root. So here we mark it deprecated.
658 */
659 __le64 __unused_log_root_transid;
660 __le64 total_bytes;
661 __le64 bytes_used;
662 __le64 root_dir_objectid;
663 __le64 num_devices;
664 __le32 sectorsize;
665 __le32 nodesize;
666 __le32 __unused_leafsize;
667 __le32 stripesize;
668 __le32 sys_chunk_array_size;
669 __le64 chunk_root_generation;
670 __le64 compat_flags;
671 __le64 compat_ro_flags;
672 __le64 incompat_flags;
673 __le16 csum_type;
674 __u8 root_level;
675 __u8 chunk_root_level;
676 __u8 log_root_level;
677 struct btrfs_dev_item dev_item;
678
679 char label[BTRFS_LABEL_SIZE];
680
681 __le64 cache_generation;
682 __le64 uuid_tree_generation;
683
684 /* The UUID written into btree blocks */
685 __u8 metadata_uuid[BTRFS_FSID_SIZE];
686
687 __u64 nr_global_roots;
688
689 /* Future expansion */
690 __le64 reserved[27];
691 __u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
692 struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
693
694 /* Padded to 4096 bytes */
695 __u8 padding[565];
696} __attribute__ ((__packed__));
697
466698#define BTRFS_FREE_SPACE_EXTENT 1
467699#define BTRFS_FREE_SPACE_BITMAP 2
468700
......@@ -517,6 +749,14 @@ struct btrfs_extent_item_v0 {
517749/* use full backrefs for extent pointers in the block */
518750#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8)
519751
752#define BTRFS_BACKREF_REV_MAX 256
753#define BTRFS_BACKREF_REV_SHIFT 56
754#define BTRFS_BACKREF_REV_MASK (((u64)BTRFS_BACKREF_REV_MAX - 1) << \
755 BTRFS_BACKREF_REV_SHIFT)
756
757#define BTRFS_OLD_BACKREF_REV 0
758#define BTRFS_MIXED_BACKREF_REV 1
759
520760/*
521761 * this flag is only used internally by scrub and may be changed at any time
522762 * it is only declared here to avoid collisions
......@@ -566,7 +806,7 @@ struct btrfs_inode_extref {
566806 __le64 parent_objectid;
567807 __le64 index;
568808 __le16 name_len;
569 __u8 name[0];
809 __u8 name[];
570810 /* name goes here */
571811} __attribute__ ((__packed__));
572812
......@@ -871,19 +1111,6 @@ struct btrfs_dev_replace_item {
8711111#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
8721112 BTRFS_SPACE_INFO_GLOBAL_RSV)
8731113
874enum btrfs_raid_types {
875 BTRFS_RAID_RAID10,
876 BTRFS_RAID_RAID1,
877 BTRFS_RAID_DUP,
878 BTRFS_RAID_RAID0,
879 BTRFS_RAID_SINGLE,
880 BTRFS_RAID_RAID5,
881 BTRFS_RAID_RAID6,
882 BTRFS_RAID_RAID1C3,
883 BTRFS_RAID_RAID1C4,
884 BTRFS_NR_RAID_TYPES
885};
886
8871114#define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \
8881115 BTRFS_BLOCK_GROUP_SYSTEM | \
8891116 BTRFS_BLOCK_GROUP_METADATA)
......@@ -969,6 +1196,10 @@ static __inline__ __u16 btrfs_qgroup_level(__u64 qgroupid)
9691196 */
9701197#define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)
9711198
1199#define BTRFS_QGROUP_STATUS_FLAGS_MASK (BTRFS_QGROUP_STATUS_FLAG_ON | \
1200 BTRFS_QGROUP_STATUS_FLAG_RESCAN | \
1201 BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT)
1202
9721203#define BTRFS_QGROUP_STATUS_VERSION 1
9731204
9741205struct btrfs_qgroup_status_item {
lib/libc/include/any-linux-any/linux/cachefiles.h created+68
......@@ -0,0 +1,68 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_CACHEFILES_H
3#define _LINUX_CACHEFILES_H
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8/*
9 * Fscache ensures that the maximum length of cookie key is 255. The volume key
10 * is controlled by netfs, and generally no bigger than 255.
11 */
12#define CACHEFILES_MSG_MAX_SIZE 1024
13
14enum cachefiles_opcode {
15 CACHEFILES_OP_OPEN,
16 CACHEFILES_OP_CLOSE,
17 CACHEFILES_OP_READ,
18};
19
20/*
21 * Message Header
22 *
23 * @msg_id a unique ID identifying this message
24 * @opcode message type, CACHEFILE_OP_*
25 * @len message length, including message header and following data
26 * @object_id a unique ID identifying a cache file
27 * @data message type specific payload
28 */
29struct cachefiles_msg {
30 __u32 msg_id;
31 __u32 opcode;
32 __u32 len;
33 __u32 object_id;
34 __u8 data[];
35};
36
37/*
38 * @data contains the volume_key followed directly by the cookie_key. volume_key
39 * is a NUL-terminated string; @volume_key_size indicates the size of the volume
40 * key in bytes. cookie_key is binary data, which is netfs specific;
41 * @cookie_key_size indicates the size of the cookie key in bytes.
42 *
43 * @fd identifies an anon_fd referring to the cache file.
44 */
45struct cachefiles_open {
46 __u32 volume_key_size;
47 __u32 cookie_key_size;
48 __u32 fd;
49 __u32 flags;
50 __u8 data[];
51};
52
53/*
54 * @off indicates the starting offset of the requested file range
55 * @len indicates the length of the requested file range
56 */
57struct cachefiles_read {
58 __u64 off;
59 __u64 len;
60};
61
62/*
63 * Reply for READ request
64 * @arg for this ioctl is the @id field of READ request.
65 */
66#define CACHEFILES_IOC_READ_COMPLETE _IOW(0x98, 1, int)
67
68#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can.h+53-2
......@@ -48,6 +48,7 @@
4848
4949#include <linux/types.h>
5050#include <linux/socket.h>
51#include <linux/stddef.h> /* for offsetof */
5152
5253/* controller area network (CAN) kernel definitions */
5354
......@@ -60,6 +61,7 @@
6061#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
6162#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
6263#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
64#define CANXL_PRIO_MASK CAN_SFF_MASK /* 11 bit priority mask */
6365
6466/*
6567 * Controller Area Network Identifier structure
......@@ -73,6 +75,7 @@ typedef __u32 canid_t;
7375
7476#define CAN_SFF_ID_BITS 11
7577#define CAN_EFF_ID_BITS 29
78#define CANXL_PRIO_BITS CAN_SFF_ID_BITS
7679
7780/*
7881 * Controller Area Network Error Message Frame Mask structure
......@@ -91,6 +94,16 @@ typedef __u32 can_err_mask_t;
9194#define CANFD_MAX_DLC 15
9295#define CANFD_MAX_DLEN 64
9396
97/*
98 * CAN XL payload length and DLC definitions according to ISO 11898-1
99 * CAN XL DLC ranges from 0 .. 2047 => data length from 1 .. 2048 byte
100 */
101#define CANXL_MIN_DLC 0
102#define CANXL_MAX_DLC 2047
103#define CANXL_MAX_DLC_MASK 0x07FF
104#define CANXL_MIN_DLEN 1
105#define CANXL_MAX_DLEN 2048
106
94107/**
95108 * struct can_frame - Classical CAN frame structure (aka CAN 2.0B)
96109 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
......@@ -141,8 +154,8 @@ struct can_frame {
141154 * When this is done the former differentiation via CAN_MTU / CANFD_MTU gets
142155 * lost. CANFD_FDF allows programmers to mark CAN FD frames in the case of
143156 * using struct canfd_frame for mixed CAN / CAN FD content (dual use).
144 * N.B. the Kernel APIs do NOT provide mixed CAN / CAN FD content inside of
145 * struct canfd_frame therefore the CANFD_FDF flag is disregarded by Linux.
157 * Since the introduction of CAN XL the CANFD_FDF flag is set in all CAN FD
158 * frame structures provided by the CAN subsystem of the Linux kernel.
146159 */
147160#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
148161#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
......@@ -166,8 +179,46 @@ struct canfd_frame {
166179 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
167180};
168181
182/*
183 * defined bits for canxl_frame.flags
184 *
185 * The canxl_frame.flags element contains two bits CANXL_XLF and CANXL_SEC
186 * and shares the relative position of the struct can[fd]_frame.len element.
187 * The CANXL_XLF bit ALWAYS needs to be set to indicate a valid CAN XL frame.
188 * As a side effect setting this bit intentionally breaks the length checks
189 * for Classical CAN and CAN FD frames.
190 *
191 * Undefined bits in canxl_frame.flags are reserved and shall be set to zero.
192 */
193#define CANXL_XLF 0x80 /* mandatory CAN XL frame flag (must always be set!) */
194#define CANXL_SEC 0x01 /* Simple Extended Content (security/segmentation) */
195
196/**
197 * 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
199 * @flags: additional flags for CAN XL
200 * @sdt: SDU (service data unit) type
201 * @len: frame payload length in byte (CANXL_MIN_DLEN .. CANXL_MAX_DLEN)
202 * @af: acceptance field
203 * @data: CAN XL frame payload (CANXL_MIN_DLEN .. CANXL_MAX_DLEN byte)
204 *
205 * @prio shares the same position as @can_id from struct can[fd]_frame.
206 */
207struct canxl_frame {
208 canid_t prio; /* 11 bit priority for arbitration (canid_t) */
209 __u8 flags; /* additional flags for CAN XL */
210 __u8 sdt; /* SDU (service data unit) type */
211 __u16 len; /* frame payload length in byte */
212 __u32 af; /* acceptance field */
213 __u8 data[CANXL_MAX_DLEN];
214};
215
169216#define CAN_MTU (sizeof(struct can_frame))
170217#define CANFD_MTU (sizeof(struct canfd_frame))
218#define CANXL_MTU (sizeof(struct canxl_frame))
219#define CANXL_HDR_SIZE (offsetof(struct canxl_frame, data))
220#define CANXL_MIN_MTU (CANXL_HDR_SIZE + 64)
221#define CANXL_MAX_MTU CANXL_MTU
171222
172223/* particular protocols of the protocol family PF_CAN */
173224#define CAN_RAW 1 /* RAW sockets */
lib/libc/include/any-linux-any/linux/can/bcm.h+1-1
......@@ -71,7 +71,7 @@ struct bcm_msg_head {
7171 struct bcm_timeval ival1, ival2;
7272 canid_t can_id;
7373 __u32 nframes;
74 struct can_frame frames[0];
74 struct can_frame frames[];
7575};
7676
7777enum {
lib/libc/include/any-linux-any/linux/can/error.h+19-1
......@@ -57,6 +57,8 @@
5757#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
5858#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
5959#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
60#define CAN_ERR_CNT 0x00000200U /* TX error counter / data[6] */
61 /* RX error counter / data[7] */
6062
6163/* arbitration lost in bit ... / data[0] */
6264#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
......@@ -120,6 +122,22 @@
120122#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
121123#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
122124
123/* controller specific additional information / data[5..7] */
125/* data[5] is reserved (do not use) */
126
127/* TX error counter / data[6] */
128/* RX error counter / data[7] */
129
130/* CAN state thresholds
131 *
132 * Error counter Error state
133 * -----------------------------------
134 * 0 - 95 Error-active
135 * 96 - 127 Error-warning
136 * 128 - 255 Error-passive
137 * 256 and greater Bus-off
138 */
139#define CAN_ERROR_WARNING_THRESHOLD 96
140#define CAN_ERROR_PASSIVE_THRESHOLD 128
141#define CAN_BUS_OFF_THRESHOLD 256
124142
125143#endif /* _CAN_ERROR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can/isotp.h+36-19
......@@ -124,33 +124,30 @@ struct can_isotp_ll_options {
124124
125125/* flags for isotp behaviour */
126126
127#define CAN_ISOTP_LISTEN_MODE 0x001 /* listen only (do not send FC) */
128#define CAN_ISOTP_EXTEND_ADDR 0x002 /* enable extended addressing */
129#define CAN_ISOTP_TX_PADDING 0x004 /* enable CAN frame padding tx path */
130#define CAN_ISOTP_RX_PADDING 0x008 /* enable CAN frame padding rx path */
131#define CAN_ISOTP_CHK_PAD_LEN 0x010 /* check received CAN frame padding */
132#define CAN_ISOTP_CHK_PAD_DATA 0x020 /* check received CAN frame padding */
133#define CAN_ISOTP_HALF_DUPLEX 0x040 /* half duplex error state handling */
134#define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */
135#define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */
136#define CAN_ISOTP_RX_EXT_ADDR 0x200 /* different rx extended addressing */
137#define CAN_ISOTP_WAIT_TX_DONE 0x400 /* wait for tx completion */
138#define CAN_ISOTP_SF_BROADCAST 0x800 /* 1-to-N functional addressing */
139
140/* default values */
127#define CAN_ISOTP_LISTEN_MODE 0x0001 /* listen only (do not send FC) */
128#define CAN_ISOTP_EXTEND_ADDR 0x0002 /* enable extended addressing */
129#define CAN_ISOTP_TX_PADDING 0x0004 /* enable CAN frame padding tx path */
130#define CAN_ISOTP_RX_PADDING 0x0008 /* enable CAN frame padding rx path */
131#define CAN_ISOTP_CHK_PAD_LEN 0x0010 /* check received CAN frame padding */
132#define CAN_ISOTP_CHK_PAD_DATA 0x0020 /* check received CAN frame padding */
133#define CAN_ISOTP_HALF_DUPLEX 0x0040 /* half duplex error state handling */
134#define CAN_ISOTP_FORCE_TXSTMIN 0x0080 /* ignore stmin from received FC */
135#define CAN_ISOTP_FORCE_RXSTMIN 0x0100 /* ignore CFs depending on rx stmin */
136#define CAN_ISOTP_RX_EXT_ADDR 0x0200 /* different rx extended addressing */
137#define CAN_ISOTP_WAIT_TX_DONE 0x0400 /* wait for tx completion */
138#define CAN_ISOTP_SF_BROADCAST 0x0800 /* 1-to-N functional addressing */
139#define CAN_ISOTP_CF_BROADCAST 0x1000 /* 1-to-N transmission w/o FC */
140
141/* protocol machine default values */
141142
142143#define CAN_ISOTP_DEFAULT_FLAGS 0
143144#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00
144145#define CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */
145#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0
146#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 50000 /* 50 micro seconds */
146147#define CAN_ISOTP_DEFAULT_RECV_BS 0
147148#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00
148149#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0
149150
150#define CAN_ISOTP_DEFAULT_LL_MTU CAN_MTU
151#define CAN_ISOTP_DEFAULT_LL_TX_DL CAN_MAX_DLEN
152#define CAN_ISOTP_DEFAULT_LL_TX_FLAGS 0
153
154151/*
155152 * Remark on CAN_ISOTP_DEFAULT_RECV_* values:
156153 *
......@@ -162,4 +159,24 @@ struct can_isotp_ll_options {
162159 * consistency and copied directly into the flow control (FC) frame.
163160 */
164161
162/* link layer default values => make use of Classical CAN frames */
163
164#define CAN_ISOTP_DEFAULT_LL_MTU CAN_MTU
165#define CAN_ISOTP_DEFAULT_LL_TX_DL CAN_MAX_DLEN
166#define CAN_ISOTP_DEFAULT_LL_TX_FLAGS 0
167
168/*
169 * The CAN_ISOTP_DEFAULT_FRAME_TXTIME has become a non-zero value as
170 * it only makes sense for isotp implementation tests to run without
171 * a N_As value. As user space applications usually do not set the
172 * frame_txtime element of struct can_isotp_options the new in-kernel
173 * default is very likely overwritten with zero when the sockopt()
174 * CAN_ISOTP_OPTS is invoked.
175 * To make sure that a N_As value of zero is only set intentional the
176 * value '0' is now interpreted as 'do not change the current value'.
177 * When a frame_txtime of zero is required for testing purposes this
178 * CAN_ISOTP_FRAME_TXTIME_ZERO u32 value has to be set in frame_txtime.
179 */
180#define CAN_ISOTP_FRAME_TXTIME_ZERO 0xFFFFFFFF
181
165182#endif /* !_UAPI_CAN_ISOTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/can/netlink.h+13
......@@ -137,6 +137,7 @@ enum {
137137 IFLA_CAN_DATA_BITRATE_CONST,
138138 IFLA_CAN_BITRATE_MAX,
139139 IFLA_CAN_TDC,
140 IFLA_CAN_CTRLMODE_EXT,
140141
141142 /* add new constants above here */
142143 __IFLA_CAN_MAX,
......@@ -166,6 +167,18 @@ enum {
166167 IFLA_CAN_TDC_MAX = __IFLA_CAN_TDC - 1
167168};
168169
170/*
171 * IFLA_CAN_CTRLMODE_EXT nest: controller mode extended parameters
172 */
173enum {
174 IFLA_CAN_CTRLMODE_UNSPEC,
175 IFLA_CAN_CTRLMODE_SUPPORTED, /* u32 */
176
177 /* add new constants above here */
178 __IFLA_CAN_CTRLMODE,
179 IFLA_CAN_CTRLMODE_MAX = __IFLA_CAN_CTRLMODE - 1
180};
181
169182/* u16 termination range: 1..65535 Ohms */
170183#define CAN_TERMINATION_DISABLED 0
171184
lib/libc/include/any-linux-any/linux/can/raw.h+1
......@@ -62,6 +62,7 @@ enum {
6262 CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
6363 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
6464 CAN_RAW_JOIN_FILTERS, /* all filters must match to trigger */
65 CAN_RAW_XL_FRAMES, /* allow CAN XL frames (default:off) */
6566};
6667
6768#endif /* !_UAPI_CAN_RAW_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/capability.h+1-1
......@@ -424,7 +424,7 @@ struct vfs_ns_cap_data {
424424 */
425425
426426#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
427#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
427#define CAP_TO_MASK(x) (1U << ((x) & 31)) /* mask for indexed __u32 */
428428
429429
430430#endif /* _LINUX_CAPABILITY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cdrom.h+1-1
......@@ -103,7 +103,7 @@
103103#define CDROMREADALL 0x5318 /* read all 2646 bytes */
104104
105105/*
106 * These ioctls are (now) only in ide-cd.c for controlling
106 * These ioctls were only in (now removed) ide-cd.c for controlling
107107 * drive spindown time. They should be implemented in the
108108 * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
109109 * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...
lib/libc/include/any-linux-any/linux/cec-funcs.h+14
......@@ -1568,6 +1568,20 @@ static __inline__ void cec_ops_request_short_audio_descriptor(const struct cec_m
15681568 }
15691569}
15701570
1571static __inline__ void cec_msg_set_audio_volume_level(struct cec_msg *msg,
1572 __u8 audio_volume_level)
1573{
1574 msg->len = 3;
1575 msg->msg[1] = CEC_MSG_SET_AUDIO_VOLUME_LEVEL;
1576 msg->msg[2] = audio_volume_level;
1577}
1578
1579static __inline__ void cec_ops_set_audio_volume_level(const struct cec_msg *msg,
1580 __u8 *audio_volume_level)
1581{
1582 *audio_volume_level = msg->msg[2];
1583}
1584
15711585
15721586/* Audio Rate Control Feature */
15731587static __inline__ void cec_msg_set_audio_rate(struct cec_msg *msg,
lib/libc/include/any-linux-any/linux/cec.h+22
......@@ -142,6 +142,26 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
142142 msg->reply = msg->timeout = 0;
143143}
144144
145/**
146 * cec_msg_recv_is_tx_result - return true if this message contains the
147 * result of an earlier non-blocking transmit
148 * @msg: the message structure from CEC_RECEIVE
149 */
150static __inline__ int cec_msg_recv_is_tx_result(const struct cec_msg *msg)
151{
152 return msg->sequence && msg->tx_status && !msg->rx_status;
153}
154
155/**
156 * cec_msg_recv_is_rx_result - return true if this message contains the
157 * reply of an earlier non-blocking transmit
158 * @msg: the message structure from CEC_RECEIVE
159 */
160static __inline__ int cec_msg_recv_is_rx_result(const struct cec_msg *msg)
161{
162 return msg->sequence && !msg->tx_status && msg->rx_status;
163}
164
145165/* cec_msg flags field */
146166#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
147167#define CEC_MSG_FL_RAW (1 << 1)
......@@ -748,6 +768,7 @@ struct cec_event {
748768#define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE 0x08
749769#define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX 0x04
750770#define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX 0x02
771#define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_VOLUME_LEVEL 0x01
751772
752773#define CEC_MSG_GIVE_FEATURES 0xa5 /* HDMI 2.0 */
753774
......@@ -1039,6 +1060,7 @@ struct cec_event {
10391060#define CEC_OP_AUD_FMT_ID_CEA861 0
10401061#define CEC_OP_AUD_FMT_ID_CEA861_CXT 1
10411062
1063#define CEC_MSG_SET_AUDIO_VOLUME_LEVEL 0x73
10421064
10431065/* Audio Rate Control Feature */
10441066#define CEC_MSG_SET_AUDIO_RATE 0x9a
lib/libc/include/any-linux-any/linux/comedi.h created+1528
......@@ -0,0 +1,1528 @@
1/* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */
2/*
3 * comedi.h
4 * header file for COMEDI user API
5 *
6 * COMEDI - Linux Control and Measurement Device Interface
7 * Copyright (C) 1998-2001 David A. Schleef <ds@schleef.org>
8 */
9
10#ifndef _COMEDI_H
11#define _COMEDI_H
12
13#define COMEDI_MAJORVERSION 0
14#define COMEDI_MINORVERSION 7
15#define COMEDI_MICROVERSION 76
16#define VERSION "0.7.76"
17
18/* comedi's major device number */
19#define COMEDI_MAJOR 98
20
21/*
22 * maximum number of minor devices. This can be increased, although
23 * kernel structures are currently statically allocated, thus you
24 * don't want this to be much more than you actually use.
25 */
26#define COMEDI_NDEVICES 16
27
28/* number of config options in the config structure */
29#define COMEDI_NDEVCONFOPTS 32
30
31/*
32 * NOTE: 'comedi_config --init-data' is deprecated
33 *
34 * The following indexes in the config options were used by
35 * comedi_config to pass firmware blobs from user space to the
36 * comedi drivers. The request_firmware() hotplug interface is
37 * now used by all comedi drivers instead.
38 */
39
40/* length of nth chunk of firmware data -*/
41#define COMEDI_DEVCONF_AUX_DATA3_LENGTH 25
42#define COMEDI_DEVCONF_AUX_DATA2_LENGTH 26
43#define COMEDI_DEVCONF_AUX_DATA1_LENGTH 27
44#define COMEDI_DEVCONF_AUX_DATA0_LENGTH 28
45/* most significant 32 bits of pointer address (if needed) */
46#define COMEDI_DEVCONF_AUX_DATA_HI 29
47/* least significant 32 bits of pointer address */
48#define COMEDI_DEVCONF_AUX_DATA_LO 30
49#define COMEDI_DEVCONF_AUX_DATA_LENGTH 31 /* total data length */
50
51/* max length of device and driver names */
52#define COMEDI_NAMELEN 20
53
54/* packs and unpacks a channel/range number */
55
56#define CR_PACK(chan, rng, aref) \
57 ((((aref) & 0x3) << 24) | (((rng) & 0xff) << 16) | (chan))
58#define CR_PACK_FLAGS(chan, range, aref, flags) \
59 (CR_PACK(chan, range, aref) | ((flags) & CR_FLAGS_MASK))
60
61#define CR_CHAN(a) ((a) & 0xffff)
62#define CR_RANGE(a) (((a) >> 16) & 0xff)
63#define CR_AREF(a) (((a) >> 24) & 0x03)
64
65#define CR_FLAGS_MASK 0xfc000000
66#define CR_ALT_FILTER 0x04000000
67#define CR_DITHER CR_ALT_FILTER
68#define CR_DEGLITCH CR_ALT_FILTER
69#define CR_ALT_SOURCE 0x08000000
70#define CR_EDGE 0x40000000
71#define CR_INVERT 0x80000000
72
73#define AREF_GROUND 0x00 /* analog ref = analog ground */
74#define AREF_COMMON 0x01 /* analog ref = analog common */
75#define AREF_DIFF 0x02 /* analog ref = differential */
76#define AREF_OTHER 0x03 /* analog ref = other (undefined) */
77
78/* counters -- these are arbitrary values */
79#define GPCT_RESET 0x0001
80#define GPCT_SET_SOURCE 0x0002
81#define GPCT_SET_GATE 0x0004
82#define GPCT_SET_DIRECTION 0x0008
83#define GPCT_SET_OPERATION 0x0010
84#define GPCT_ARM 0x0020
85#define GPCT_DISARM 0x0040
86#define GPCT_GET_INT_CLK_FRQ 0x0080
87
88#define GPCT_INT_CLOCK 0x0001
89#define GPCT_EXT_PIN 0x0002
90#define GPCT_NO_GATE 0x0004
91#define GPCT_UP 0x0008
92#define GPCT_DOWN 0x0010
93#define GPCT_HWUD 0x0020
94#define GPCT_SIMPLE_EVENT 0x0040
95#define GPCT_SINGLE_PERIOD 0x0080
96#define GPCT_SINGLE_PW 0x0100
97#define GPCT_CONT_PULSE_OUT 0x0200
98#define GPCT_SINGLE_PULSE_OUT 0x0400
99
100/* instructions */
101
102#define INSN_MASK_WRITE 0x8000000
103#define INSN_MASK_READ 0x4000000
104#define INSN_MASK_SPECIAL 0x2000000
105
106#define INSN_READ (0 | INSN_MASK_READ)
107#define INSN_WRITE (1 | INSN_MASK_WRITE)
108#define INSN_BITS (2 | INSN_MASK_READ | INSN_MASK_WRITE)
109#define INSN_CONFIG (3 | INSN_MASK_READ | INSN_MASK_WRITE)
110#define INSN_DEVICE_CONFIG (INSN_CONFIG | INSN_MASK_SPECIAL)
111#define INSN_GTOD (4 | INSN_MASK_READ | INSN_MASK_SPECIAL)
112#define INSN_WAIT (5 | INSN_MASK_WRITE | INSN_MASK_SPECIAL)
113#define INSN_INTTRIG (6 | INSN_MASK_WRITE | INSN_MASK_SPECIAL)
114
115/* command flags */
116/* These flags are used in comedi_cmd structures */
117
118#define CMDF_BOGUS 0x00000001 /* do the motions */
119
120/* try to use a real-time interrupt while performing command */
121#define CMDF_PRIORITY 0x00000008
122
123/* wake up on end-of-scan events */
124#define CMDF_WAKE_EOS 0x00000020
125
126#define CMDF_WRITE 0x00000040
127
128#define CMDF_RAWDATA 0x00000080
129
130/* timer rounding definitions */
131#define CMDF_ROUND_MASK 0x00030000
132#define CMDF_ROUND_NEAREST 0x00000000
133#define CMDF_ROUND_DOWN 0x00010000
134#define CMDF_ROUND_UP 0x00020000
135#define CMDF_ROUND_UP_NEXT 0x00030000
136
137#define COMEDI_EV_START 0x00040000
138#define COMEDI_EV_SCAN_BEGIN 0x00080000
139#define COMEDI_EV_CONVERT 0x00100000
140#define COMEDI_EV_SCAN_END 0x00200000
141#define COMEDI_EV_STOP 0x00400000
142
143/* compatibility definitions */
144#define TRIG_BOGUS CMDF_BOGUS
145#define TRIG_RT CMDF_PRIORITY
146#define TRIG_WAKE_EOS CMDF_WAKE_EOS
147#define TRIG_WRITE CMDF_WRITE
148#define TRIG_ROUND_MASK CMDF_ROUND_MASK
149#define TRIG_ROUND_NEAREST CMDF_ROUND_NEAREST
150#define TRIG_ROUND_DOWN CMDF_ROUND_DOWN
151#define TRIG_ROUND_UP CMDF_ROUND_UP
152#define TRIG_ROUND_UP_NEXT CMDF_ROUND_UP_NEXT
153
154/* trigger sources */
155
156#define TRIG_ANY 0xffffffff
157#define TRIG_INVALID 0x00000000
158
159#define TRIG_NONE 0x00000001 /* never trigger */
160#define TRIG_NOW 0x00000002 /* trigger now + N ns */
161#define TRIG_FOLLOW 0x00000004 /* trigger on next lower level trig */
162#define TRIG_TIME 0x00000008 /* trigger at time N ns */
163#define TRIG_TIMER 0x00000010 /* trigger at rate N ns */
164#define TRIG_COUNT 0x00000020 /* trigger when count reaches N */
165#define TRIG_EXT 0x00000040 /* trigger on external signal N */
166#define TRIG_INT 0x00000080 /* trigger on comedi-internal signal N */
167#define TRIG_OTHER 0x00000100 /* driver defined */
168
169/* subdevice flags */
170
171#define SDF_BUSY 0x0001 /* device is busy */
172#define SDF_BUSY_OWNER 0x0002 /* device is busy with your job */
173#define SDF_LOCKED 0x0004 /* subdevice is locked */
174#define SDF_LOCK_OWNER 0x0008 /* you own lock */
175#define SDF_MAXDATA 0x0010 /* maxdata depends on channel */
176#define SDF_FLAGS 0x0020 /* flags depend on channel */
177#define SDF_RANGETYPE 0x0040 /* range type depends on channel */
178#define SDF_PWM_COUNTER 0x0080 /* PWM can automatically switch off */
179#define SDF_PWM_HBRIDGE 0x0100 /* PWM is signed (H-bridge) */
180#define SDF_CMD 0x1000 /* can do commands (deprecated) */
181#define SDF_SOFT_CALIBRATED 0x2000 /* subdevice uses software calibration */
182#define SDF_CMD_WRITE 0x4000 /* can do output commands */
183#define SDF_CMD_READ 0x8000 /* can do input commands */
184
185/* subdevice can be read (e.g. analog input) */
186#define SDF_READABLE 0x00010000
187/* subdevice can be written (e.g. analog output) */
188#define SDF_WRITABLE 0x00020000
189#define SDF_WRITEABLE SDF_WRITABLE /* spelling error in API */
190/* subdevice does not have externally visible lines */
191#define SDF_INTERNAL 0x00040000
192#define SDF_GROUND 0x00100000 /* can do aref=ground */
193#define SDF_COMMON 0x00200000 /* can do aref=common */
194#define SDF_DIFF 0x00400000 /* can do aref=diff */
195#define SDF_OTHER 0x00800000 /* can do aref=other */
196#define SDF_DITHER 0x01000000 /* can do dithering */
197#define SDF_DEGLITCH 0x02000000 /* can do deglitching */
198#define SDF_MMAP 0x04000000 /* can do mmap() */
199#define SDF_RUNNING 0x08000000 /* subdevice is acquiring data */
200#define SDF_LSAMPL 0x10000000 /* subdevice uses 32-bit samples */
201#define SDF_PACKED 0x20000000 /* subdevice can do packed DIO */
202
203/* subdevice types */
204
205/**
206 * enum comedi_subdevice_type - COMEDI subdevice types
207 * @COMEDI_SUBD_UNUSED: Unused subdevice.
208 * @COMEDI_SUBD_AI: Analog input.
209 * @COMEDI_SUBD_AO: Analog output.
210 * @COMEDI_SUBD_DI: Digital input.
211 * @COMEDI_SUBD_DO: Digital output.
212 * @COMEDI_SUBD_DIO: Digital input/output.
213 * @COMEDI_SUBD_COUNTER: Counter.
214 * @COMEDI_SUBD_TIMER: Timer.
215 * @COMEDI_SUBD_MEMORY: Memory, EEPROM, DPRAM.
216 * @COMEDI_SUBD_CALIB: Calibration DACs.
217 * @COMEDI_SUBD_PROC: Processor, DSP.
218 * @COMEDI_SUBD_SERIAL: Serial I/O.
219 * @COMEDI_SUBD_PWM: Pulse-Width Modulation output.
220 */
221enum comedi_subdevice_type {
222 COMEDI_SUBD_UNUSED,
223 COMEDI_SUBD_AI,
224 COMEDI_SUBD_AO,
225 COMEDI_SUBD_DI,
226 COMEDI_SUBD_DO,
227 COMEDI_SUBD_DIO,
228 COMEDI_SUBD_COUNTER,
229 COMEDI_SUBD_TIMER,
230 COMEDI_SUBD_MEMORY,
231 COMEDI_SUBD_CALIB,
232 COMEDI_SUBD_PROC,
233 COMEDI_SUBD_SERIAL,
234 COMEDI_SUBD_PWM
235};
236
237/* configuration instructions */
238
239/**
240 * enum comedi_io_direction - COMEDI I/O directions
241 * @COMEDI_INPUT: Input.
242 * @COMEDI_OUTPUT: Output.
243 * @COMEDI_OPENDRAIN: Open-drain (or open-collector) output.
244 *
245 * These are used by the %INSN_CONFIG_DIO_QUERY configuration instruction to
246 * report a direction. They may also be used in other places where a direction
247 * needs to be specified.
248 */
249enum comedi_io_direction {
250 COMEDI_INPUT = 0,
251 COMEDI_OUTPUT = 1,
252 COMEDI_OPENDRAIN = 2
253};
254
255/**
256 * enum configuration_ids - COMEDI configuration instruction codes
257 * @INSN_CONFIG_DIO_INPUT: Configure digital I/O as input.
258 * @INSN_CONFIG_DIO_OUTPUT: Configure digital I/O as output.
259 * @INSN_CONFIG_DIO_OPENDRAIN: Configure digital I/O as open-drain (or open
260 * collector) output.
261 * @INSN_CONFIG_ANALOG_TRIG: Configure analog trigger.
262 * @INSN_CONFIG_ALT_SOURCE: Configure alternate input source.
263 * @INSN_CONFIG_DIGITAL_TRIG: Configure digital trigger.
264 * @INSN_CONFIG_BLOCK_SIZE: Configure block size for DMA transfers.
265 * @INSN_CONFIG_TIMER_1: Configure divisor for external clock.
266 * @INSN_CONFIG_FILTER: Configure a filter.
267 * @INSN_CONFIG_CHANGE_NOTIFY: Configure change notification for digital
268 * inputs. (New drivers should use
269 * %INSN_CONFIG_DIGITAL_TRIG instead.)
270 * @INSN_CONFIG_SERIAL_CLOCK: Configure clock for serial I/O.
271 * @INSN_CONFIG_BIDIRECTIONAL_DATA: Send and receive byte over serial I/O.
272 * @INSN_CONFIG_DIO_QUERY: Query direction of digital I/O channel.
273 * @INSN_CONFIG_PWM_OUTPUT: Configure pulse-width modulator output.
274 * @INSN_CONFIG_GET_PWM_OUTPUT: Get pulse-width modulator output configuration.
275 * @INSN_CONFIG_ARM: Arm a subdevice or channel.
276 * @INSN_CONFIG_DISARM: Disarm a subdevice or channel.
277 * @INSN_CONFIG_GET_COUNTER_STATUS: Get counter status.
278 * @INSN_CONFIG_RESET: Reset a subdevice or channel.
279 * @INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR: Configure counter/timer as
280 * single pulse generator.
281 * @INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR: Configure counter/timer as
282 * pulse train generator.
283 * @INSN_CONFIG_GPCT_QUADRATURE_ENCODER: Configure counter as a quadrature
284 * encoder.
285 * @INSN_CONFIG_SET_GATE_SRC: Set counter/timer gate source.
286 * @INSN_CONFIG_GET_GATE_SRC: Get counter/timer gate source.
287 * @INSN_CONFIG_SET_CLOCK_SRC: Set counter/timer master clock source.
288 * @INSN_CONFIG_GET_CLOCK_SRC: Get counter/timer master clock source.
289 * @INSN_CONFIG_SET_OTHER_SRC: Set counter/timer "other" source.
290 * @INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE: Get size (in bytes) of subdevice's
291 * on-board FIFOs used during streaming
292 * input/output.
293 * @INSN_CONFIG_SET_COUNTER_MODE: Set counter/timer mode.
294 * @INSN_CONFIG_8254_SET_MODE: (Deprecated) Same as
295 * %INSN_CONFIG_SET_COUNTER_MODE.
296 * @INSN_CONFIG_8254_READ_STATUS: Read status of 8254 counter channel.
297 * @INSN_CONFIG_SET_ROUTING: Set routing for a channel.
298 * @INSN_CONFIG_GET_ROUTING: Get routing for a channel.
299 * @INSN_CONFIG_PWM_SET_PERIOD: Set PWM period in nanoseconds.
300 * @INSN_CONFIG_PWM_GET_PERIOD: Get PWM period in nanoseconds.
301 * @INSN_CONFIG_GET_PWM_STATUS: Get PWM status.
302 * @INSN_CONFIG_PWM_SET_H_BRIDGE: Set PWM H bridge duty cycle and polarity for
303 * a relay simultaneously.
304 * @INSN_CONFIG_PWM_GET_H_BRIDGE: Get PWM H bridge duty cycle and polarity.
305 * @INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS: Get the hardware timing restraints,
306 * regardless of trigger sources.
307 */
308enum configuration_ids {
309 INSN_CONFIG_DIO_INPUT = COMEDI_INPUT,
310 INSN_CONFIG_DIO_OUTPUT = COMEDI_OUTPUT,
311 INSN_CONFIG_DIO_OPENDRAIN = COMEDI_OPENDRAIN,
312 INSN_CONFIG_ANALOG_TRIG = 16,
313/* INSN_CONFIG_WAVEFORM = 17, */
314/* INSN_CONFIG_TRIG = 18, */
315/* INSN_CONFIG_COUNTER = 19, */
316 INSN_CONFIG_ALT_SOURCE = 20,
317 INSN_CONFIG_DIGITAL_TRIG = 21,
318 INSN_CONFIG_BLOCK_SIZE = 22,
319 INSN_CONFIG_TIMER_1 = 23,
320 INSN_CONFIG_FILTER = 24,
321 INSN_CONFIG_CHANGE_NOTIFY = 25,
322
323 INSN_CONFIG_SERIAL_CLOCK = 26, /*ALPHA*/
324 INSN_CONFIG_BIDIRECTIONAL_DATA = 27,
325 INSN_CONFIG_DIO_QUERY = 28,
326 INSN_CONFIG_PWM_OUTPUT = 29,
327 INSN_CONFIG_GET_PWM_OUTPUT = 30,
328 INSN_CONFIG_ARM = 31,
329 INSN_CONFIG_DISARM = 32,
330 INSN_CONFIG_GET_COUNTER_STATUS = 33,
331 INSN_CONFIG_RESET = 34,
332 INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR = 1001,
333 INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR = 1002,
334 INSN_CONFIG_GPCT_QUADRATURE_ENCODER = 1003,
335 INSN_CONFIG_SET_GATE_SRC = 2001,
336 INSN_CONFIG_GET_GATE_SRC = 2002,
337 INSN_CONFIG_SET_CLOCK_SRC = 2003,
338 INSN_CONFIG_GET_CLOCK_SRC = 2004,
339 INSN_CONFIG_SET_OTHER_SRC = 2005,
340 INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE = 2006,
341 INSN_CONFIG_SET_COUNTER_MODE = 4097,
342 INSN_CONFIG_8254_SET_MODE = INSN_CONFIG_SET_COUNTER_MODE,
343 INSN_CONFIG_8254_READ_STATUS = 4098,
344 INSN_CONFIG_SET_ROUTING = 4099,
345 INSN_CONFIG_GET_ROUTING = 4109,
346 INSN_CONFIG_PWM_SET_PERIOD = 5000,
347 INSN_CONFIG_PWM_GET_PERIOD = 5001,
348 INSN_CONFIG_GET_PWM_STATUS = 5002,
349 INSN_CONFIG_PWM_SET_H_BRIDGE = 5003,
350 INSN_CONFIG_PWM_GET_H_BRIDGE = 5004,
351 INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS = 5005,
352};
353
354/**
355 * enum device_configuration_ids - COMEDI configuration instruction codes global
356 * to an entire device.
357 * @INSN_DEVICE_CONFIG_TEST_ROUTE: Validate the possibility of a
358 * globally-named route
359 * @INSN_DEVICE_CONFIG_CONNECT_ROUTE: Connect a globally-named route
360 * @INSN_DEVICE_CONFIG_DISCONNECT_ROUTE:Disconnect a globally-named route
361 * @INSN_DEVICE_CONFIG_GET_ROUTES: Get a list of all globally-named routes
362 * that are valid for a particular device.
363 */
364enum device_config_route_ids {
365 INSN_DEVICE_CONFIG_TEST_ROUTE = 0,
366 INSN_DEVICE_CONFIG_CONNECT_ROUTE = 1,
367 INSN_DEVICE_CONFIG_DISCONNECT_ROUTE = 2,
368 INSN_DEVICE_CONFIG_GET_ROUTES = 3,
369};
370
371/**
372 * enum comedi_digital_trig_op - operations for configuring a digital trigger
373 * @COMEDI_DIGITAL_TRIG_DISABLE: Return digital trigger to its default,
374 * inactive, unconfigured state.
375 * @COMEDI_DIGITAL_TRIG_ENABLE_EDGES: Set rising and/or falling edge inputs
376 * that each can fire the trigger.
377 * @COMEDI_DIGITAL_TRIG_ENABLE_LEVELS: Set a combination of high and/or low
378 * level inputs that can fire the trigger.
379 *
380 * These are used with the %INSN_CONFIG_DIGITAL_TRIG configuration instruction.
381 * The data for the configuration instruction is as follows...
382 *
383 * data[%0] = %INSN_CONFIG_DIGITAL_TRIG
384 *
385 * data[%1] = trigger ID
386 *
387 * data[%2] = configuration operation
388 *
389 * data[%3] = configuration parameter 1
390 *
391 * data[%4] = configuration parameter 2
392 *
393 * data[%5] = configuration parameter 3
394 *
395 * The trigger ID (data[%1]) is used to differentiate multiple digital triggers
396 * belonging to the same subdevice. The configuration operation (data[%2]) is
397 * one of the enum comedi_digital_trig_op values. The configuration
398 * parameters (data[%3], data[%4], and data[%5]) depend on the operation; they
399 * are not used with %COMEDI_DIGITAL_TRIG_DISABLE.
400 *
401 * For %COMEDI_DIGITAL_TRIG_ENABLE_EDGES and %COMEDI_DIGITAL_TRIG_ENABLE_LEVELS,
402 * configuration parameter 1 (data[%3]) contains a "left-shift" value that
403 * specifies the input corresponding to bit 0 of configuration parameters 2
404 * and 3. This is useful if the trigger has more than 32 inputs.
405 *
406 * For %COMEDI_DIGITAL_TRIG_ENABLE_EDGES, configuration parameter 2 (data[%4])
407 * specifies which of up to 32 inputs have rising-edge sensitivity, and
408 * configuration parameter 3 (data[%5]) specifies which of up to 32 inputs
409 * have falling-edge sensitivity that can fire the trigger.
410 *
411 * For %COMEDI_DIGITAL_TRIG_ENABLE_LEVELS, configuration parameter 2 (data[%4])
412 * specifies which of up to 32 inputs must be at a high level, and
413 * configuration parameter 3 (data[%5]) specifies which of up to 32 inputs
414 * must be at a low level for the trigger to fire.
415 *
416 * Some sequences of %INSN_CONFIG_DIGITAL_TRIG instructions may have a (partly)
417 * accumulative effect, depending on the low-level driver. This is useful
418 * when setting up a trigger that has more than 32 inputs, or has a combination
419 * of edge- and level-triggered inputs.
420 */
421enum comedi_digital_trig_op {
422 COMEDI_DIGITAL_TRIG_DISABLE = 0,
423 COMEDI_DIGITAL_TRIG_ENABLE_EDGES = 1,
424 COMEDI_DIGITAL_TRIG_ENABLE_LEVELS = 2
425};
426
427/**
428 * enum comedi_support_level - support level for a COMEDI feature
429 * @COMEDI_UNKNOWN_SUPPORT: Unspecified support for feature.
430 * @COMEDI_SUPPORTED: Feature is supported.
431 * @COMEDI_UNSUPPORTED: Feature is unsupported.
432 */
433enum comedi_support_level {
434 COMEDI_UNKNOWN_SUPPORT = 0,
435 COMEDI_SUPPORTED,
436 COMEDI_UNSUPPORTED
437};
438
439/**
440 * enum comedi_counter_status_flags - counter status bits
441 * @COMEDI_COUNTER_ARMED: Counter is armed.
442 * @COMEDI_COUNTER_COUNTING: Counter is counting.
443 * @COMEDI_COUNTER_TERMINAL_COUNT: Counter reached terminal count.
444 *
445 * These bitwise values are used by the %INSN_CONFIG_GET_COUNTER_STATUS
446 * configuration instruction to report the status of a counter.
447 */
448enum comedi_counter_status_flags {
449 COMEDI_COUNTER_ARMED = 0x1,
450 COMEDI_COUNTER_COUNTING = 0x2,
451 COMEDI_COUNTER_TERMINAL_COUNT = 0x4,
452};
453
454/* ioctls */
455
456#define CIO 'd'
457#define COMEDI_DEVCONFIG _IOW(CIO, 0, struct comedi_devconfig)
458#define COMEDI_DEVINFO _IOR(CIO, 1, struct comedi_devinfo)
459#define COMEDI_SUBDINFO _IOR(CIO, 2, struct comedi_subdinfo)
460#define COMEDI_CHANINFO _IOR(CIO, 3, struct comedi_chaninfo)
461/* _IOWR(CIO, 4, ...) is reserved */
462#define COMEDI_LOCK _IO(CIO, 5)
463#define COMEDI_UNLOCK _IO(CIO, 6)
464#define COMEDI_CANCEL _IO(CIO, 7)
465#define COMEDI_RANGEINFO _IOR(CIO, 8, struct comedi_rangeinfo)
466#define COMEDI_CMD _IOR(CIO, 9, struct comedi_cmd)
467#define COMEDI_CMDTEST _IOR(CIO, 10, struct comedi_cmd)
468#define COMEDI_INSNLIST _IOR(CIO, 11, struct comedi_insnlist)
469#define COMEDI_INSN _IOR(CIO, 12, struct comedi_insn)
470#define COMEDI_BUFCONFIG _IOR(CIO, 13, struct comedi_bufconfig)
471#define COMEDI_BUFINFO _IOWR(CIO, 14, struct comedi_bufinfo)
472#define COMEDI_POLL _IO(CIO, 15)
473#define COMEDI_SETRSUBD _IO(CIO, 16)
474#define COMEDI_SETWSUBD _IO(CIO, 17)
475
476/* structures */
477
478/**
479 * struct comedi_insn - COMEDI instruction
480 * @insn: COMEDI instruction type (%INSN_xxx).
481 * @n: Length of @data[].
482 * @data: Pointer to data array operated on by the instruction.
483 * @subdev: Subdevice index.
484 * @chanspec: A packed "chanspec" value consisting of channel number,
485 * analog range index, analog reference type, and flags.
486 * @unused: Reserved for future use.
487 *
488 * This is used with the %COMEDI_INSN ioctl, and indirectly with the
489 * %COMEDI_INSNLIST ioctl.
490 */
491struct comedi_insn {
492 unsigned int insn;
493 unsigned int n;
494 unsigned int *data;
495 unsigned int subdev;
496 unsigned int chanspec;
497 unsigned int unused[3];
498};
499
500/**
501 * struct comedi_insnlist - list of COMEDI instructions
502 * @n_insns: Number of COMEDI instructions.
503 * @insns: Pointer to array COMEDI instructions.
504 *
505 * This is used with the %COMEDI_INSNLIST ioctl.
506 */
507struct comedi_insnlist {
508 unsigned int n_insns;
509 struct comedi_insn *insns;
510};
511
512/**
513 * struct comedi_cmd - COMEDI asynchronous acquisition command details
514 * @subdev: Subdevice index.
515 * @flags: Command flags (%CMDF_xxx).
516 * @start_src: "Start acquisition" trigger source (%TRIG_xxx).
517 * @start_arg: "Start acquisition" trigger argument.
518 * @scan_begin_src: "Scan begin" trigger source.
519 * @scan_begin_arg: "Scan begin" trigger argument.
520 * @convert_src: "Convert" trigger source.
521 * @convert_arg: "Convert" trigger argument.
522 * @scan_end_src: "Scan end" trigger source.
523 * @scan_end_arg: "Scan end" trigger argument.
524 * @stop_src: "Stop acquisition" trigger source.
525 * @stop_arg: "Stop acquisition" trigger argument.
526 * @chanlist: Pointer to array of "chanspec" values, containing a
527 * sequence of channel numbers packed with analog range
528 * index, etc.
529 * @chanlist_len: Number of channels in sequence.
530 * @data: Pointer to miscellaneous set-up data (not used).
531 * @data_len: Length of miscellaneous set-up data.
532 *
533 * This is used with the %COMEDI_CMD or %COMEDI_CMDTEST ioctl to set-up
534 * or validate an asynchronous acquisition command. The ioctl may modify
535 * the &struct comedi_cmd and copy it back to the caller.
536 *
537 * Optional command @flags values that can be ORed together...
538 *
539 * %CMDF_BOGUS - makes %COMEDI_CMD ioctl return error %EAGAIN instead of
540 * starting the command.
541 *
542 * %CMDF_PRIORITY - requests "hard real-time" processing (which is not
543 * supported in this version of COMEDI).
544 *
545 * %CMDF_WAKE_EOS - requests the command makes data available for reading
546 * after every "scan" period.
547 *
548 * %CMDF_WRITE - marks the command as being in the "write" (to device)
549 * direction. This does not need to be specified by the caller unless the
550 * subdevice supports commands in either direction.
551 *
552 * %CMDF_RAWDATA - prevents the command from "munging" the data between the
553 * COMEDI sample format and the raw hardware sample format.
554 *
555 * %CMDF_ROUND_NEAREST - requests timing periods to be rounded to nearest
556 * supported values.
557 *
558 * %CMDF_ROUND_DOWN - requests timing periods to be rounded down to supported
559 * values (frequencies rounded up).
560 *
561 * %CMDF_ROUND_UP - requests timing periods to be rounded up to supported
562 * values (frequencies rounded down).
563 *
564 * Trigger source values for @start_src, @scan_begin_src, @convert_src,
565 * @scan_end_src, and @stop_src...
566 *
567 * %TRIG_ANY - "all ones" value used to test which trigger sources are
568 * supported.
569 *
570 * %TRIG_INVALID - "all zeroes" value used to indicate that all requested
571 * trigger sources are invalid.
572 *
573 * %TRIG_NONE - never trigger (often used as a @stop_src value).
574 *
575 * %TRIG_NOW - trigger after '_arg' nanoseconds.
576 *
577 * %TRIG_FOLLOW - trigger follows another event.
578 *
579 * %TRIG_TIMER - trigger every '_arg' nanoseconds.
580 *
581 * %TRIG_COUNT - trigger when count '_arg' is reached.
582 *
583 * %TRIG_EXT - trigger on external signal specified by '_arg'.
584 *
585 * %TRIG_INT - trigger on internal, software trigger specified by '_arg'.
586 *
587 * %TRIG_OTHER - trigger on other, driver-defined signal specified by '_arg'.
588 */
589struct comedi_cmd {
590 unsigned int subdev;
591 unsigned int flags;
592
593 unsigned int start_src;
594 unsigned int start_arg;
595
596 unsigned int scan_begin_src;
597 unsigned int scan_begin_arg;
598
599 unsigned int convert_src;
600 unsigned int convert_arg;
601
602 unsigned int scan_end_src;
603 unsigned int scan_end_arg;
604
605 unsigned int stop_src;
606 unsigned int stop_arg;
607
608 unsigned int *chanlist;
609 unsigned int chanlist_len;
610
611 short *data;
612 unsigned int data_len;
613};
614
615/**
616 * struct comedi_chaninfo - used to retrieve per-channel information
617 * @subdev: Subdevice index.
618 * @maxdata_list: Optional pointer to per-channel maximum data values.
619 * @flaglist: Optional pointer to per-channel flags.
620 * @rangelist: Optional pointer to per-channel range types.
621 * @unused: Reserved for future use.
622 *
623 * This is used with the %COMEDI_CHANINFO ioctl to get per-channel information
624 * for the subdevice. Use of this requires knowledge of the number of channels
625 * and subdevice flags obtained using the %COMEDI_SUBDINFO ioctl.
626 *
627 * The @maxdata_list member must be %NULL unless the %SDF_MAXDATA subdevice
628 * flag is set. The @flaglist member must be %NULL unless the %SDF_FLAGS
629 * subdevice flag is set. The @rangelist member must be %NULL unless the
630 * %SDF_RANGETYPE subdevice flag is set. Otherwise, the arrays they point to
631 * must be at least as long as the number of channels.
632 */
633struct comedi_chaninfo {
634 unsigned int subdev;
635 unsigned int *maxdata_list;
636 unsigned int *flaglist;
637 unsigned int *rangelist;
638 unsigned int unused[4];
639};
640
641/**
642 * struct comedi_rangeinfo - used to retrieve the range table for a channel
643 * @range_type: Encodes subdevice index (bits 27:24), channel index
644 * (bits 23:16) and range table length (bits 15:0).
645 * @range_ptr: Pointer to array of @struct comedi_krange to be filled
646 * in with the range table for the channel or subdevice.
647 *
648 * This is used with the %COMEDI_RANGEINFO ioctl to retrieve the range table
649 * for a specific channel (if the subdevice has the %SDF_RANGETYPE flag set to
650 * indicate that the range table depends on the channel), or for the subdevice
651 * as a whole (if the %SDF_RANGETYPE flag is clear, indicating the range table
652 * is shared by all channels).
653 *
654 * The @range_type value is an input to the ioctl and comes from a previous
655 * use of the %COMEDI_SUBDINFO ioctl (if the %SDF_RANGETYPE flag is clear),
656 * or the %COMEDI_CHANINFO ioctl (if the %SDF_RANGETYPE flag is set).
657 */
658struct comedi_rangeinfo {
659 unsigned int range_type;
660 void *range_ptr;
661};
662
663/**
664 * struct comedi_krange - describes a range in a range table
665 * @min: Minimum value in millionths (1e-6) of a unit.
666 * @max: Maximum value in millionths (1e-6) of a unit.
667 * @flags: Indicates the units (in bits 7:0) OR'ed with optional flags.
668 *
669 * A range table is associated with a single channel, or with all channels in a
670 * subdevice, and a list of one or more ranges. A %struct comedi_krange
671 * describes the physical range of units for one of those ranges. Sample
672 * values in COMEDI are unsigned from %0 up to some 'maxdata' value. The
673 * mapping from sample values to physical units is assumed to be nomimally
674 * linear (for the purpose of describing the range), with sample value %0
675 * mapping to @min, and the 'maxdata' sample value mapping to @max.
676 *
677 * The currently defined units are %UNIT_volt (%0), %UNIT_mA (%1), and
678 * %UNIT_none (%2). The @min and @max values are the physical range multiplied
679 * by 1e6, so a @max value of %1000000 (with %UNIT_volt) represents a maximal
680 * value of 1 volt.
681 *
682 * The only defined flag value is %RF_EXTERNAL (%0x100), indicating that the
683 * range needs to be multiplied by an external reference.
684 */
685struct comedi_krange {
686 int min;
687 int max;
688 unsigned int flags;
689};
690
691/**
692 * struct comedi_subdinfo - used to retrieve information about a subdevice
693 * @type: Type of subdevice from &enum comedi_subdevice_type.
694 * @n_chan: Number of channels the subdevice supports.
695 * @subd_flags: A mixture of static and dynamic flags describing
696 * aspects of the subdevice and its current state.
697 * @timer_type: Timer type. Always set to %5 ("nanosecond timer").
698 * @len_chanlist: Maximum length of a channel list if the subdevice
699 * supports asynchronous acquisition commands.
700 * @maxdata: Maximum sample value for all channels if the
701 * %SDF_MAXDATA subdevice flag is clear.
702 * @flags: Channel flags for all channels if the %SDF_FLAGS
703 * subdevice flag is clear.
704 * @range_type: The range type for all channels if the %SDF_RANGETYPE
705 * subdevice flag is clear. Encodes the subdevice index
706 * (bits 27:24), a dummy channel index %0 (bits 23:16),
707 * and the range table length (bits 15:0).
708 * @settling_time_0: Not used.
709 * @insn_bits_support: Set to %COMEDI_SUPPORTED if the subdevice supports the
710 * %INSN_BITS instruction, or to %COMEDI_UNSUPPORTED if it
711 * does not.
712 * @unused: Reserved for future use.
713 *
714 * This is used with the %COMEDI_SUBDINFO ioctl which copies an array of
715 * &struct comedi_subdinfo back to user space, with one element per subdevice.
716 * Use of this requires knowledge of the number of subdevices obtained from
717 * the %COMEDI_DEVINFO ioctl.
718 *
719 * These are the @subd_flags values that may be ORed together...
720 *
721 * %SDF_BUSY - the subdevice is busy processing an asynchronous command or a
722 * synchronous instruction.
723 *
724 * %SDF_BUSY_OWNER - the subdevice is busy processing an asynchronous
725 * acquisition command started on the current file object (the file object
726 * issuing the %COMEDI_SUBDINFO ioctl).
727 *
728 * %SDF_LOCKED - the subdevice is locked by a %COMEDI_LOCK ioctl.
729 *
730 * %SDF_LOCK_OWNER - the subdevice is locked by a %COMEDI_LOCK ioctl from the
731 * current file object.
732 *
733 * %SDF_MAXDATA - maximum sample values are channel-specific.
734 *
735 * %SDF_FLAGS - channel flags are channel-specific.
736 *
737 * %SDF_RANGETYPE - range types are channel-specific.
738 *
739 * %SDF_PWM_COUNTER - PWM can switch off automatically.
740 *
741 * %SDF_PWM_HBRIDGE - or PWM is signed (H-bridge).
742 *
743 * %SDF_CMD - the subdevice supports asynchronous commands.
744 *
745 * %SDF_SOFT_CALIBRATED - the subdevice uses software calibration.
746 *
747 * %SDF_CMD_WRITE - the subdevice supports asynchronous commands in the output
748 * ("write") direction.
749 *
750 * %SDF_CMD_READ - the subdevice supports asynchronous commands in the input
751 * ("read") direction.
752 *
753 * %SDF_READABLE - the subdevice is readable (e.g. analog input).
754 *
755 * %SDF_WRITABLE (aliased as %SDF_WRITEABLE) - the subdevice is writable (e.g.
756 * analog output).
757 *
758 * %SDF_INTERNAL - the subdevice has no externally visible lines.
759 *
760 * %SDF_GROUND - the subdevice can use ground as an analog reference.
761 *
762 * %SDF_COMMON - the subdevice can use a common analog reference.
763 *
764 * %SDF_DIFF - the subdevice can use differential inputs (or outputs).
765 *
766 * %SDF_OTHER - the subdevice can use some other analog reference.
767 *
768 * %SDF_DITHER - the subdevice can do dithering.
769 *
770 * %SDF_DEGLITCH - the subdevice can do deglitching.
771 *
772 * %SDF_MMAP - this is never set.
773 *
774 * %SDF_RUNNING - an asynchronous command is still running.
775 *
776 * %SDF_LSAMPL - the subdevice uses "long" (32-bit) samples (for asynchronous
777 * command data).
778 *
779 * %SDF_PACKED - the subdevice packs several DIO samples into a single sample
780 * (for asynchronous command data).
781 *
782 * No "channel flags" (@flags) values are currently defined.
783 */
784struct comedi_subdinfo {
785 unsigned int type;
786 unsigned int n_chan;
787 unsigned int subd_flags;
788 unsigned int timer_type;
789 unsigned int len_chanlist;
790 unsigned int maxdata;
791 unsigned int flags;
792 unsigned int range_type;
793 unsigned int settling_time_0;
794 unsigned int insn_bits_support;
795 unsigned int unused[8];
796};
797
798/**
799 * struct comedi_devinfo - used to retrieve information about a COMEDI device
800 * @version_code: COMEDI version code.
801 * @n_subdevs: Number of subdevices the device has.
802 * @driver_name: Null-terminated COMEDI driver name.
803 * @board_name: Null-terminated COMEDI board name.
804 * @read_subdevice: Index of the current "read" subdevice (%-1 if none).
805 * @write_subdevice: Index of the current "write" subdevice (%-1 if none).
806 * @unused: Reserved for future use.
807 *
808 * This is used with the %COMEDI_DEVINFO ioctl to get basic information about
809 * the device.
810 */
811struct comedi_devinfo {
812 unsigned int version_code;
813 unsigned int n_subdevs;
814 char driver_name[COMEDI_NAMELEN];
815 char board_name[COMEDI_NAMELEN];
816 int read_subdevice;
817 int write_subdevice;
818 int unused[30];
819};
820
821/**
822 * struct comedi_devconfig - used to configure a legacy COMEDI device
823 * @board_name: Null-terminated string specifying the type of board
824 * to configure.
825 * @options: An array of integer configuration options.
826 *
827 * This is used with the %COMEDI_DEVCONFIG ioctl to configure a "legacy" COMEDI
828 * device, such as an ISA card. Not all COMEDI drivers support this. Those
829 * that do either expect the specified board name to match one of a list of
830 * names registered with the COMEDI core, or expect the specified board name
831 * to match the COMEDI driver name itself. The configuration options are
832 * handled in a driver-specific manner.
833 */
834struct comedi_devconfig {
835 char board_name[COMEDI_NAMELEN];
836 int options[COMEDI_NDEVCONFOPTS];
837};
838
839/**
840 * struct comedi_bufconfig - used to set or get buffer size for a subdevice
841 * @subdevice: Subdevice index.
842 * @flags: Not used.
843 * @maximum_size: Maximum allowed buffer size.
844 * @size: Buffer size.
845 * @unused: Reserved for future use.
846 *
847 * This is used with the %COMEDI_BUFCONFIG ioctl to get or configure the
848 * maximum buffer size and current buffer size for a COMEDI subdevice that
849 * supports asynchronous commands. If the subdevice does not support
850 * asynchronous commands, @maximum_size and @size are ignored and set to 0.
851 *
852 * On ioctl input, non-zero values of @maximum_size and @size specify a
853 * new maximum size and new current size (in bytes), respectively. These
854 * will by rounded up to a multiple of %PAGE_SIZE. Specifying a new maximum
855 * size requires admin capabilities.
856 *
857 * On ioctl output, @maximum_size and @size and set to the current maximum
858 * buffer size and current buffer size, respectively.
859 */
860struct comedi_bufconfig {
861 unsigned int subdevice;
862 unsigned int flags;
863
864 unsigned int maximum_size;
865 unsigned int size;
866
867 unsigned int unused[4];
868};
869
870/**
871 * struct comedi_bufinfo - used to manipulate buffer position for a subdevice
872 * @subdevice: Subdevice index.
873 * @bytes_read: Specify amount to advance read position for an
874 * asynchronous command in the input ("read") direction.
875 * @buf_write_ptr: Current write position (index) within the buffer.
876 * @buf_read_ptr: Current read position (index) within the buffer.
877 * @buf_write_count: Total amount written, modulo 2^32.
878 * @buf_read_count: Total amount read, modulo 2^32.
879 * @bytes_written: Specify amount to advance write position for an
880 * asynchronous command in the output ("write") direction.
881 * @unused: Reserved for future use.
882 *
883 * This is used with the %COMEDI_BUFINFO ioctl to optionally advance the
884 * current read or write position in an asynchronous acquisition data buffer,
885 * and to get the current read and write positions in the buffer.
886 */
887struct comedi_bufinfo {
888 unsigned int subdevice;
889 unsigned int bytes_read;
890
891 unsigned int buf_write_ptr;
892 unsigned int buf_read_ptr;
893 unsigned int buf_write_count;
894 unsigned int buf_read_count;
895
896 unsigned int bytes_written;
897
898 unsigned int unused[4];
899};
900
901/* range stuff */
902
903#define __RANGE(a, b) ((((a) & 0xffff) << 16) | ((b) & 0xffff))
904
905#define RANGE_OFFSET(a) (((a) >> 16) & 0xffff)
906#define RANGE_LENGTH(b) ((b) & 0xffff)
907
908#define RF_UNIT(flags) ((flags) & 0xff)
909#define RF_EXTERNAL 0x100
910
911#define UNIT_volt 0
912#define UNIT_mA 1
913#define UNIT_none 2
914
915#define COMEDI_MIN_SPEED 0xffffffffu
916
917/**********************************************************/
918/* everything after this line is ALPHA */
919/**********************************************************/
920
921/*
922 * 8254 specific configuration.
923 *
924 * It supports two config commands:
925 *
926 * 0 ID: INSN_CONFIG_SET_COUNTER_MODE
927 * 1 8254 Mode
928 * I8254_MODE0, I8254_MODE1, ..., I8254_MODE5
929 * OR'ed with:
930 * I8254_BCD, I8254_BINARY
931 *
932 * 0 ID: INSN_CONFIG_8254_READ_STATUS
933 * 1 <-- Status byte returned here.
934 * B7 = Output
935 * B6 = NULL Count
936 * B5 - B0 Current mode.
937 */
938
939enum i8254_mode {
940 I8254_MODE0 = (0 << 1), /* Interrupt on terminal count */
941 I8254_MODE1 = (1 << 1), /* Hardware retriggerable one-shot */
942 I8254_MODE2 = (2 << 1), /* Rate generator */
943 I8254_MODE3 = (3 << 1), /* Square wave mode */
944 I8254_MODE4 = (4 << 1), /* Software triggered strobe */
945 /* Hardware triggered strobe (retriggerable) */
946 I8254_MODE5 = (5 << 1),
947 /* Use binary-coded decimal instead of binary (pretty useless) */
948 I8254_BCD = 1,
949 I8254_BINARY = 0
950};
951
952/* *** BEGIN GLOBALLY-NAMED NI TERMINALS/SIGNALS *** */
953
954/*
955 * Common National Instruments Terminal/Signal names.
956 * Some of these have no NI_ prefix as they are useful for non-NI hardware, such
957 * as those that utilize the PXI/RTSI trigger lines.
958 *
959 * NOTE ABOUT THE CHOICE OF NAMES HERE AND THE CAMELSCRIPT:
960 * The choice to use CamelScript and the exact names below is for
961 * maintainability, clarity, similarity to manufacturer's documentation,
962 * _and_ a mitigation for confusion that has plagued the use of these drivers
963 * for years!
964 *
965 * More detail:
966 * There have been significant confusions over the past many years for users
967 * when trying to understand how to connect to/from signals and terminals on
968 * NI hardware using comedi. The major reason for this is that the actual
969 * register values were exposed and required to be used by users. Several
970 * major reasons exist why this caused major confusion for users:
971 * 1) The register values are _NOT_ in user documentation, but rather in
972 * arcane locations, such as a few register programming manuals that are
973 * increasingly hard to find and the NI MHDDK (comments in example code).
974 * There is no one place to find the various valid values of the registers.
975 * 2) The register values are _NOT_ completely consistent. There is no way to
976 * gain any sense of intuition of which values, or even enums one should use
977 * for various registers. There was some attempt in prior use of comedi to
978 * name enums such that a user might know which enums should be used for
979 * varying purposes, but the end-user had to gain a knowledge of register
980 * values to correctly wield this approach.
981 * 3) The names for signals and registers found in the various register level
982 * programming manuals and vendor-provided documentation are _not_ even
983 * close to the same names that are in the end-user documentation.
984 *
985 * Similar, albeit less, confusion plagued NI's previous version of their own
986 * drivers. Earlier than 2003, NI greatly simplified the situation for users
987 * by releasing a new API that abstracted the names of signals/terminals to a
988 * common and intuitive set of names.
989 *
990 * The names below mirror the names chosen and well documented by NI. These
991 * names are exposed to the user via the comedilib user library. By keeping
992 * the names below, in spite of the use of CamelScript, maintenance will be
993 * greatly eased and confusion for users _and_ comedi developers will be
994 * greatly reduced.
995 */
996
997/*
998 * Base of abstracted NI names.
999 * The first 16 bits of *_arg are reserved for channel selection.
1000 * Since we only actually need the first 4 or 5 bits for all register values on
1001 * NI select registers anyways, we'll identify all values >= (1<<15) as being an
1002 * abstracted NI signal/terminal name.
1003 * These values are also used/returned by INSN_DEVICE_CONFIG_TEST_ROUTE,
1004 * INSN_DEVICE_CONFIG_CONNECT_ROUTE, INSN_DEVICE_CONFIG_DISCONNECT_ROUTE,
1005 * and INSN_DEVICE_CONFIG_GET_ROUTES.
1006 */
1007#define NI_NAMES_BASE 0x8000u
1008
1009#define _TERM_N(base, n, x) ((base) + ((x) & ((n) - 1)))
1010
1011/*
1012 * not necessarily all allowed 64 PFIs are valid--certainly not for all devices
1013 */
1014#define NI_PFI(x) _TERM_N(NI_NAMES_BASE, 64, x)
1015/* 8 trigger lines by standard, Some devices cannot talk to all eight. */
1016#define TRIGGER_LINE(x) _TERM_N(NI_PFI(-1) + 1, 8, x)
1017/* 4 RTSI shared MUXes to route signals to/from TRIGGER_LINES on NI hardware */
1018#define NI_RTSI_BRD(x) _TERM_N(TRIGGER_LINE(-1) + 1, 4, x)
1019
1020/* *** Counter/timer names : 8 counters max *** */
1021#define NI_MAX_COUNTERS 8
1022#define NI_COUNTER_NAMES_BASE (NI_RTSI_BRD(-1) + 1)
1023#define NI_CtrSource(x) _TERM_N(NI_COUNTER_NAMES_BASE, NI_MAX_COUNTERS, x)
1024/* Gate, Aux, A,B,Z are all treated, at times as gates */
1025#define NI_GATES_NAMES_BASE (NI_CtrSource(-1) + 1)
1026#define NI_CtrGate(x) _TERM_N(NI_GATES_NAMES_BASE, NI_MAX_COUNTERS, x)
1027#define NI_CtrAux(x) _TERM_N(NI_CtrGate(-1) + 1, NI_MAX_COUNTERS, x)
1028#define NI_CtrA(x) _TERM_N(NI_CtrAux(-1) + 1, NI_MAX_COUNTERS, x)
1029#define NI_CtrB(x) _TERM_N(NI_CtrA(-1) + 1, NI_MAX_COUNTERS, x)
1030#define NI_CtrZ(x) _TERM_N(NI_CtrB(-1) + 1, NI_MAX_COUNTERS, x)
1031#define NI_GATES_NAMES_MAX NI_CtrZ(-1)
1032#define NI_CtrArmStartTrigger(x) _TERM_N(NI_CtrZ(-1) + 1, NI_MAX_COUNTERS, x)
1033#define NI_CtrInternalOutput(x) \
1034 _TERM_N(NI_CtrArmStartTrigger(-1) + 1, NI_MAX_COUNTERS, x)
1035/** external pin(s) labeled conveniently as Ctr<i>Out. */
1036#define NI_CtrOut(x) _TERM_N(NI_CtrInternalOutput(-1) + 1, NI_MAX_COUNTERS, x)
1037/** For Buffered sampling of ctr -- x series capability. */
1038#define NI_CtrSampleClock(x) _TERM_N(NI_CtrOut(-1) + 1, NI_MAX_COUNTERS, x)
1039#define NI_COUNTER_NAMES_MAX NI_CtrSampleClock(-1)
1040
1041enum ni_common_signal_names {
1042 /* PXI_Star: this is a non-NI-specific signal */
1043 PXI_Star = NI_COUNTER_NAMES_MAX + 1,
1044 PXI_Clk10,
1045 PXIe_Clk100,
1046 NI_AI_SampleClock,
1047 NI_AI_SampleClockTimebase,
1048 NI_AI_StartTrigger,
1049 NI_AI_ReferenceTrigger,
1050 NI_AI_ConvertClock,
1051 NI_AI_ConvertClockTimebase,
1052 NI_AI_PauseTrigger,
1053 NI_AI_HoldCompleteEvent,
1054 NI_AI_HoldComplete,
1055 NI_AI_ExternalMUXClock,
1056 NI_AI_STOP, /* pulse signal that occurs when a update is finished(?) */
1057 NI_AO_SampleClock,
1058 NI_AO_SampleClockTimebase,
1059 NI_AO_StartTrigger,
1060 NI_AO_PauseTrigger,
1061 NI_DI_SampleClock,
1062 NI_DI_SampleClockTimebase,
1063 NI_DI_StartTrigger,
1064 NI_DI_ReferenceTrigger,
1065 NI_DI_PauseTrigger,
1066 NI_DI_InputBufferFull,
1067 NI_DI_ReadyForStartEvent,
1068 NI_DI_ReadyForTransferEventBurst,
1069 NI_DI_ReadyForTransferEventPipelined,
1070 NI_DO_SampleClock,
1071 NI_DO_SampleClockTimebase,
1072 NI_DO_StartTrigger,
1073 NI_DO_PauseTrigger,
1074 NI_DO_OutputBufferFull,
1075 NI_DO_DataActiveEvent,
1076 NI_DO_ReadyForStartEvent,
1077 NI_DO_ReadyForTransferEvent,
1078 NI_MasterTimebase,
1079 NI_20MHzTimebase,
1080 NI_80MHzTimebase,
1081 NI_100MHzTimebase,
1082 NI_200MHzTimebase,
1083 NI_100kHzTimebase,
1084 NI_10MHzRefClock,
1085 NI_FrequencyOutput,
1086 NI_ChangeDetectionEvent,
1087 NI_AnalogComparisonEvent,
1088 NI_WatchdogExpiredEvent,
1089 NI_WatchdogExpirationTrigger,
1090 NI_SCXI_Trig1,
1091 NI_LogicLow,
1092 NI_LogicHigh,
1093 NI_ExternalStrobe,
1094 NI_PFI_DO,
1095 NI_CaseGround,
1096 /* special internal signal used as variable source for RTSI bus: */
1097 NI_RGOUT0,
1098
1099 /* just a name to make the next more convenient, regardless of above */
1100 _NI_NAMES_MAX_PLUS_1,
1101 NI_NUM_NAMES = _NI_NAMES_MAX_PLUS_1 - NI_NAMES_BASE,
1102};
1103
1104/* *** END GLOBALLY-NAMED NI TERMINALS/SIGNALS *** */
1105
1106#define NI_USUAL_PFI_SELECT(x) (((x) < 10) ? (0x1 + (x)) : (0xb + (x)))
1107#define NI_USUAL_RTSI_SELECT(x) (((x) < 7) ? (0xb + (x)) : 0x1b)
1108
1109/*
1110 * mode bits for NI general-purpose counters, set with
1111 * INSN_CONFIG_SET_COUNTER_MODE
1112 */
1113#define NI_GPCT_COUNTING_MODE_SHIFT 16
1114#define NI_GPCT_INDEX_PHASE_BITSHIFT 20
1115#define NI_GPCT_COUNTING_DIRECTION_SHIFT 24
1116enum ni_gpct_mode_bits {
1117 NI_GPCT_GATE_ON_BOTH_EDGES_BIT = 0x4,
1118 NI_GPCT_EDGE_GATE_MODE_MASK = 0x18,
1119 NI_GPCT_EDGE_GATE_STARTS_STOPS_BITS = 0x0,
1120 NI_GPCT_EDGE_GATE_STOPS_STARTS_BITS = 0x8,
1121 NI_GPCT_EDGE_GATE_STARTS_BITS = 0x10,
1122 NI_GPCT_EDGE_GATE_NO_STARTS_NO_STOPS_BITS = 0x18,
1123 NI_GPCT_STOP_MODE_MASK = 0x60,
1124 NI_GPCT_STOP_ON_GATE_BITS = 0x00,
1125 NI_GPCT_STOP_ON_GATE_OR_TC_BITS = 0x20,
1126 NI_GPCT_STOP_ON_GATE_OR_SECOND_TC_BITS = 0x40,
1127 NI_GPCT_LOAD_B_SELECT_BIT = 0x80,
1128 NI_GPCT_OUTPUT_MODE_MASK = 0x300,
1129 NI_GPCT_OUTPUT_TC_PULSE_BITS = 0x100,
1130 NI_GPCT_OUTPUT_TC_TOGGLE_BITS = 0x200,
1131 NI_GPCT_OUTPUT_TC_OR_GATE_TOGGLE_BITS = 0x300,
1132 NI_GPCT_HARDWARE_DISARM_MASK = 0xc00,
1133 NI_GPCT_NO_HARDWARE_DISARM_BITS = 0x000,
1134 NI_GPCT_DISARM_AT_TC_BITS = 0x400,
1135 NI_GPCT_DISARM_AT_GATE_BITS = 0x800,
1136 NI_GPCT_DISARM_AT_TC_OR_GATE_BITS = 0xc00,
1137 NI_GPCT_LOADING_ON_TC_BIT = 0x1000,
1138 NI_GPCT_LOADING_ON_GATE_BIT = 0x4000,
1139 NI_GPCT_COUNTING_MODE_MASK = 0x7 << NI_GPCT_COUNTING_MODE_SHIFT,
1140 NI_GPCT_COUNTING_MODE_NORMAL_BITS =
1141 0x0 << NI_GPCT_COUNTING_MODE_SHIFT,
1142 NI_GPCT_COUNTING_MODE_QUADRATURE_X1_BITS =
1143 0x1 << NI_GPCT_COUNTING_MODE_SHIFT,
1144 NI_GPCT_COUNTING_MODE_QUADRATURE_X2_BITS =
1145 0x2 << NI_GPCT_COUNTING_MODE_SHIFT,
1146 NI_GPCT_COUNTING_MODE_QUADRATURE_X4_BITS =
1147 0x3 << NI_GPCT_COUNTING_MODE_SHIFT,
1148 NI_GPCT_COUNTING_MODE_TWO_PULSE_BITS =
1149 0x4 << NI_GPCT_COUNTING_MODE_SHIFT,
1150 NI_GPCT_COUNTING_MODE_SYNC_SOURCE_BITS =
1151 0x6 << NI_GPCT_COUNTING_MODE_SHIFT,
1152 NI_GPCT_INDEX_PHASE_MASK = 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT,
1153 NI_GPCT_INDEX_PHASE_LOW_A_LOW_B_BITS =
1154 0x0 << NI_GPCT_INDEX_PHASE_BITSHIFT,
1155 NI_GPCT_INDEX_PHASE_LOW_A_HIGH_B_BITS =
1156 0x1 << NI_GPCT_INDEX_PHASE_BITSHIFT,
1157 NI_GPCT_INDEX_PHASE_HIGH_A_LOW_B_BITS =
1158 0x2 << NI_GPCT_INDEX_PHASE_BITSHIFT,
1159 NI_GPCT_INDEX_PHASE_HIGH_A_HIGH_B_BITS =
1160 0x3 << NI_GPCT_INDEX_PHASE_BITSHIFT,
1161 NI_GPCT_INDEX_ENABLE_BIT = 0x400000,
1162 NI_GPCT_COUNTING_DIRECTION_MASK =
1163 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT,
1164 NI_GPCT_COUNTING_DIRECTION_DOWN_BITS =
1165 0x00 << NI_GPCT_COUNTING_DIRECTION_SHIFT,
1166 NI_GPCT_COUNTING_DIRECTION_UP_BITS =
1167 0x1 << NI_GPCT_COUNTING_DIRECTION_SHIFT,
1168 NI_GPCT_COUNTING_DIRECTION_HW_UP_DOWN_BITS =
1169 0x2 << NI_GPCT_COUNTING_DIRECTION_SHIFT,
1170 NI_GPCT_COUNTING_DIRECTION_HW_GATE_BITS =
1171 0x3 << NI_GPCT_COUNTING_DIRECTION_SHIFT,
1172 NI_GPCT_RELOAD_SOURCE_MASK = 0xc000000,
1173 NI_GPCT_RELOAD_SOURCE_FIXED_BITS = 0x0,
1174 NI_GPCT_RELOAD_SOURCE_SWITCHING_BITS = 0x4000000,
1175 NI_GPCT_RELOAD_SOURCE_GATE_SELECT_BITS = 0x8000000,
1176 NI_GPCT_OR_GATE_BIT = 0x10000000,
1177 NI_GPCT_INVERT_OUTPUT_BIT = 0x20000000
1178};
1179
1180/*
1181 * Bits for setting a clock source with
1182 * INSN_CONFIG_SET_CLOCK_SRC when using NI general-purpose counters.
1183 */
1184enum ni_gpct_clock_source_bits {
1185 NI_GPCT_CLOCK_SRC_SELECT_MASK = 0x3f,
1186 NI_GPCT_TIMEBASE_1_CLOCK_SRC_BITS = 0x0,
1187 NI_GPCT_TIMEBASE_2_CLOCK_SRC_BITS = 0x1,
1188 NI_GPCT_TIMEBASE_3_CLOCK_SRC_BITS = 0x2,
1189 NI_GPCT_LOGIC_LOW_CLOCK_SRC_BITS = 0x3,
1190 NI_GPCT_NEXT_GATE_CLOCK_SRC_BITS = 0x4,
1191 NI_GPCT_NEXT_TC_CLOCK_SRC_BITS = 0x5,
1192 /* NI 660x-specific */
1193 NI_GPCT_SOURCE_PIN_i_CLOCK_SRC_BITS = 0x6,
1194 NI_GPCT_PXI10_CLOCK_SRC_BITS = 0x7,
1195 NI_GPCT_PXI_STAR_TRIGGER_CLOCK_SRC_BITS = 0x8,
1196 NI_GPCT_ANALOG_TRIGGER_OUT_CLOCK_SRC_BITS = 0x9,
1197 NI_GPCT_PRESCALE_MODE_CLOCK_SRC_MASK = 0x30000000,
1198 NI_GPCT_NO_PRESCALE_CLOCK_SRC_BITS = 0x0,
1199 /* divide source by 2 */
1200 NI_GPCT_PRESCALE_X2_CLOCK_SRC_BITS = 0x10000000,
1201 /* divide source by 8 */
1202 NI_GPCT_PRESCALE_X8_CLOCK_SRC_BITS = 0x20000000,
1203 NI_GPCT_INVERT_CLOCK_SRC_BIT = 0x80000000
1204};
1205
1206/* NI 660x-specific */
1207#define NI_GPCT_SOURCE_PIN_CLOCK_SRC_BITS(x) (0x10 + (x))
1208
1209#define NI_GPCT_RTSI_CLOCK_SRC_BITS(x) (0x18 + (x))
1210
1211/* no pfi on NI 660x */
1212#define NI_GPCT_PFI_CLOCK_SRC_BITS(x) (0x20 + (x))
1213
1214/*
1215 * Possibilities for setting a gate source with
1216 * INSN_CONFIG_SET_GATE_SRC when using NI general-purpose counters.
1217 * May be bitwise-or'd with CR_EDGE or CR_INVERT.
1218 */
1219enum ni_gpct_gate_select {
1220 /* m-series gates */
1221 NI_GPCT_TIMESTAMP_MUX_GATE_SELECT = 0x0,
1222 NI_GPCT_AI_START2_GATE_SELECT = 0x12,
1223 NI_GPCT_PXI_STAR_TRIGGER_GATE_SELECT = 0x13,
1224 NI_GPCT_NEXT_OUT_GATE_SELECT = 0x14,
1225 NI_GPCT_AI_START1_GATE_SELECT = 0x1c,
1226 NI_GPCT_NEXT_SOURCE_GATE_SELECT = 0x1d,
1227 NI_GPCT_ANALOG_TRIGGER_OUT_GATE_SELECT = 0x1e,
1228 NI_GPCT_LOGIC_LOW_GATE_SELECT = 0x1f,
1229 /* more gates for 660x */
1230 NI_GPCT_SOURCE_PIN_i_GATE_SELECT = 0x100,
1231 NI_GPCT_GATE_PIN_i_GATE_SELECT = 0x101,
1232 /* more gates for 660x "second gate" */
1233 NI_GPCT_UP_DOWN_PIN_i_GATE_SELECT = 0x201,
1234 NI_GPCT_SELECTED_GATE_GATE_SELECT = 0x21e,
1235 /*
1236 * m-series "second gate" sources are unknown,
1237 * we should add them here with an offset of 0x300 when
1238 * known.
1239 */
1240 NI_GPCT_DISABLED_GATE_SELECT = 0x8000,
1241};
1242
1243#define NI_GPCT_GATE_PIN_GATE_SELECT(x) (0x102 + (x))
1244#define NI_GPCT_RTSI_GATE_SELECT(x) NI_USUAL_RTSI_SELECT(x)
1245#define NI_GPCT_PFI_GATE_SELECT(x) NI_USUAL_PFI_SELECT(x)
1246#define NI_GPCT_UP_DOWN_PIN_GATE_SELECT(x) (0x202 + (x))
1247
1248/*
1249 * Possibilities for setting a source with
1250 * INSN_CONFIG_SET_OTHER_SRC when using NI general-purpose counters.
1251 */
1252enum ni_gpct_other_index {
1253 NI_GPCT_SOURCE_ENCODER_A,
1254 NI_GPCT_SOURCE_ENCODER_B,
1255 NI_GPCT_SOURCE_ENCODER_Z
1256};
1257
1258enum ni_gpct_other_select {
1259 /* m-series gates */
1260 /* Still unknown, probably only need NI_GPCT_PFI_OTHER_SELECT */
1261 NI_GPCT_DISABLED_OTHER_SELECT = 0x8000,
1262};
1263
1264#define NI_GPCT_PFI_OTHER_SELECT(x) NI_USUAL_PFI_SELECT(x)
1265
1266/*
1267 * start sources for ni general-purpose counters for use with
1268 * INSN_CONFIG_ARM
1269 */
1270enum ni_gpct_arm_source {
1271 NI_GPCT_ARM_IMMEDIATE = 0x0,
1272 /*
1273 * Start both the counter and the adjacent paired counter simultaneously
1274 */
1275 NI_GPCT_ARM_PAIRED_IMMEDIATE = 0x1,
1276 /*
1277 * If the NI_GPCT_HW_ARM bit is set, we will pass the least significant
1278 * bits (3 bits for 660x or 5 bits for m-series) through to the
1279 * hardware. To select a hardware trigger, pass the appropriate select
1280 * bit, e.g.,
1281 * NI_GPCT_HW_ARM | NI_GPCT_AI_START1_GATE_SELECT or
1282 * NI_GPCT_HW_ARM | NI_GPCT_PFI_GATE_SELECT(pfi_number)
1283 */
1284 NI_GPCT_HW_ARM = 0x1000,
1285 NI_GPCT_ARM_UNKNOWN = NI_GPCT_HW_ARM, /* for backward compatibility */
1286};
1287
1288/* digital filtering options for ni 660x for use with INSN_CONFIG_FILTER. */
1289enum ni_gpct_filter_select {
1290 NI_GPCT_FILTER_OFF = 0x0,
1291 NI_GPCT_FILTER_TIMEBASE_3_SYNC = 0x1,
1292 NI_GPCT_FILTER_100x_TIMEBASE_1 = 0x2,
1293 NI_GPCT_FILTER_20x_TIMEBASE_1 = 0x3,
1294 NI_GPCT_FILTER_10x_TIMEBASE_1 = 0x4,
1295 NI_GPCT_FILTER_2x_TIMEBASE_1 = 0x5,
1296 NI_GPCT_FILTER_2x_TIMEBASE_3 = 0x6
1297};
1298
1299/*
1300 * PFI digital filtering options for ni m-series for use with
1301 * INSN_CONFIG_FILTER.
1302 */
1303enum ni_pfi_filter_select {
1304 NI_PFI_FILTER_OFF = 0x0,
1305 NI_PFI_FILTER_125ns = 0x1,
1306 NI_PFI_FILTER_6425ns = 0x2,
1307 NI_PFI_FILTER_2550us = 0x3
1308};
1309
1310/* master clock sources for ni mio boards and INSN_CONFIG_SET_CLOCK_SRC */
1311enum ni_mio_clock_source {
1312 NI_MIO_INTERNAL_CLOCK = 0,
1313 /*
1314 * Doesn't work for m-series, use NI_MIO_PLL_RTSI_CLOCK()
1315 * the NI_MIO_PLL_* sources are m-series only
1316 */
1317 NI_MIO_RTSI_CLOCK = 1,
1318 NI_MIO_PLL_PXI_STAR_TRIGGER_CLOCK = 2,
1319 NI_MIO_PLL_PXI10_CLOCK = 3,
1320 NI_MIO_PLL_RTSI0_CLOCK = 4
1321};
1322
1323#define NI_MIO_PLL_RTSI_CLOCK(x) (NI_MIO_PLL_RTSI0_CLOCK + (x))
1324
1325/*
1326 * Signals which can be routed to an NI RTSI pin with INSN_CONFIG_SET_ROUTING.
1327 * The numbers assigned are not arbitrary, they correspond to the bits required
1328 * to program the board.
1329 */
1330enum ni_rtsi_routing {
1331 NI_RTSI_OUTPUT_ADR_START1 = 0,
1332 NI_RTSI_OUTPUT_ADR_START2 = 1,
1333 NI_RTSI_OUTPUT_SCLKG = 2,
1334 NI_RTSI_OUTPUT_DACUPDN = 3,
1335 NI_RTSI_OUTPUT_DA_START1 = 4,
1336 NI_RTSI_OUTPUT_G_SRC0 = 5,
1337 NI_RTSI_OUTPUT_G_GATE0 = 6,
1338 NI_RTSI_OUTPUT_RGOUT0 = 7,
1339 NI_RTSI_OUTPUT_RTSI_BRD_0 = 8,
1340 /* Pre-m-series always have RTSI clock on line 7 */
1341 NI_RTSI_OUTPUT_RTSI_OSC = 12
1342};
1343
1344#define NI_RTSI_OUTPUT_RTSI_BRD(x) (NI_RTSI_OUTPUT_RTSI_BRD_0 + (x))
1345
1346/*
1347 * Signals which can be routed to an NI PFI pin on an m-series board with
1348 * INSN_CONFIG_SET_ROUTING. These numbers are also returned by
1349 * INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their routing
1350 * cannot be changed. The numbers assigned are not arbitrary, they correspond
1351 * to the bits required to program the board.
1352 */
1353enum ni_pfi_routing {
1354 NI_PFI_OUTPUT_PFI_DEFAULT = 0,
1355 NI_PFI_OUTPUT_AI_START1 = 1,
1356 NI_PFI_OUTPUT_AI_START2 = 2,
1357 NI_PFI_OUTPUT_AI_CONVERT = 3,
1358 NI_PFI_OUTPUT_G_SRC1 = 4,
1359 NI_PFI_OUTPUT_G_GATE1 = 5,
1360 NI_PFI_OUTPUT_AO_UPDATE_N = 6,
1361 NI_PFI_OUTPUT_AO_START1 = 7,
1362 NI_PFI_OUTPUT_AI_START_PULSE = 8,
1363 NI_PFI_OUTPUT_G_SRC0 = 9,
1364 NI_PFI_OUTPUT_G_GATE0 = 10,
1365 NI_PFI_OUTPUT_EXT_STROBE = 11,
1366 NI_PFI_OUTPUT_AI_EXT_MUX_CLK = 12,
1367 NI_PFI_OUTPUT_GOUT0 = 13,
1368 NI_PFI_OUTPUT_GOUT1 = 14,
1369 NI_PFI_OUTPUT_FREQ_OUT = 15,
1370 NI_PFI_OUTPUT_PFI_DO = 16,
1371 NI_PFI_OUTPUT_I_ATRIG = 17,
1372 NI_PFI_OUTPUT_RTSI0 = 18,
1373 NI_PFI_OUTPUT_PXI_STAR_TRIGGER_IN = 26,
1374 NI_PFI_OUTPUT_SCXI_TRIG1 = 27,
1375 NI_PFI_OUTPUT_DIO_CHANGE_DETECT_RTSI = 28,
1376 NI_PFI_OUTPUT_CDI_SAMPLE = 29,
1377 NI_PFI_OUTPUT_CDO_UPDATE = 30
1378};
1379
1380#define NI_PFI_OUTPUT_RTSI(x) (NI_PFI_OUTPUT_RTSI0 + (x))
1381
1382/*
1383 * Signals which can be routed to output on a NI PFI pin on a 660x board
1384 * with INSN_CONFIG_SET_ROUTING. The numbers assigned are
1385 * not arbitrary, they correspond to the bits required
1386 * to program the board. Lines 0 to 7 can only be set to
1387 * NI_660X_PFI_OUTPUT_DIO. Lines 32 to 39 can only be set to
1388 * NI_660X_PFI_OUTPUT_COUNTER.
1389 */
1390enum ni_660x_pfi_routing {
1391 NI_660X_PFI_OUTPUT_COUNTER = 1, /* counter */
1392 NI_660X_PFI_OUTPUT_DIO = 2, /* static digital output */
1393};
1394
1395/*
1396 * NI External Trigger lines. These values are not arbitrary, but are related
1397 * to the bits required to program the board (offset by 1 for historical
1398 * reasons).
1399 */
1400#define NI_EXT_PFI(x) (NI_USUAL_PFI_SELECT(x) - 1)
1401#define NI_EXT_RTSI(x) (NI_USUAL_RTSI_SELECT(x) - 1)
1402
1403/*
1404 * Clock sources for CDIO subdevice on NI m-series boards. Used as the
1405 * scan_begin_arg for a comedi_command. These sources may also be bitwise-or'd
1406 * with CR_INVERT to change polarity.
1407 */
1408enum ni_m_series_cdio_scan_begin_src {
1409 NI_CDIO_SCAN_BEGIN_SRC_GROUND = 0,
1410 NI_CDIO_SCAN_BEGIN_SRC_AI_START = 18,
1411 NI_CDIO_SCAN_BEGIN_SRC_AI_CONVERT = 19,
1412 NI_CDIO_SCAN_BEGIN_SRC_PXI_STAR_TRIGGER = 20,
1413 NI_CDIO_SCAN_BEGIN_SRC_G0_OUT = 28,
1414 NI_CDIO_SCAN_BEGIN_SRC_G1_OUT = 29,
1415 NI_CDIO_SCAN_BEGIN_SRC_ANALOG_TRIGGER = 30,
1416 NI_CDIO_SCAN_BEGIN_SRC_AO_UPDATE = 31,
1417 NI_CDIO_SCAN_BEGIN_SRC_FREQ_OUT = 32,
1418 NI_CDIO_SCAN_BEGIN_SRC_DIO_CHANGE_DETECT_IRQ = 33
1419};
1420
1421#define NI_CDIO_SCAN_BEGIN_SRC_PFI(x) NI_USUAL_PFI_SELECT(x)
1422#define NI_CDIO_SCAN_BEGIN_SRC_RTSI(x) NI_USUAL_RTSI_SELECT(x)
1423
1424/*
1425 * scan_begin_src for scan_begin_arg==TRIG_EXT with analog output command on NI
1426 * boards. These scan begin sources can also be bitwise-or'd with CR_INVERT to
1427 * change polarity.
1428 */
1429#define NI_AO_SCAN_BEGIN_SRC_PFI(x) NI_USUAL_PFI_SELECT(x)
1430#define NI_AO_SCAN_BEGIN_SRC_RTSI(x) NI_USUAL_RTSI_SELECT(x)
1431
1432/*
1433 * Bits for setting a clock source with
1434 * INSN_CONFIG_SET_CLOCK_SRC when using NI frequency output subdevice.
1435 */
1436enum ni_freq_out_clock_source_bits {
1437 NI_FREQ_OUT_TIMEBASE_1_DIV_2_CLOCK_SRC, /* 10 MHz */
1438 NI_FREQ_OUT_TIMEBASE_2_CLOCK_SRC /* 100 KHz */
1439};
1440
1441/*
1442 * Values for setting a clock source with INSN_CONFIG_SET_CLOCK_SRC for
1443 * 8254 counter subdevices on Amplicon DIO boards (amplc_dio200 driver).
1444 */
1445enum amplc_dio_clock_source {
1446 /*
1447 * Per channel external clock
1448 * input/output pin (pin is only an
1449 * input when clock source set to this value,
1450 * otherwise it is an output)
1451 */
1452 AMPLC_DIO_CLK_CLKN,
1453 AMPLC_DIO_CLK_10MHZ, /* 10 MHz internal clock */
1454 AMPLC_DIO_CLK_1MHZ, /* 1 MHz internal clock */
1455 AMPLC_DIO_CLK_100KHZ, /* 100 kHz internal clock */
1456 AMPLC_DIO_CLK_10KHZ, /* 10 kHz internal clock */
1457 AMPLC_DIO_CLK_1KHZ, /* 1 kHz internal clock */
1458 /*
1459 * Output of preceding counter channel
1460 * (for channel 0, preceding counter
1461 * channel is channel 2 on preceding
1462 * counter subdevice, for first counter
1463 * subdevice, preceding counter
1464 * subdevice is the last counter
1465 * subdevice)
1466 */
1467 AMPLC_DIO_CLK_OUTNM1,
1468 AMPLC_DIO_CLK_EXT, /* per chip external input pin */
1469 /* the following are "enhanced" clock sources for PCIe models */
1470 AMPLC_DIO_CLK_VCC, /* clock input HIGH */
1471 AMPLC_DIO_CLK_GND, /* clock input LOW */
1472 AMPLC_DIO_CLK_PAT_PRESENT, /* "pattern present" signal */
1473 AMPLC_DIO_CLK_20MHZ /* 20 MHz internal clock */
1474};
1475
1476/*
1477 * Values for setting a clock source with INSN_CONFIG_SET_CLOCK_SRC for
1478 * timer subdevice on some Amplicon DIO PCIe boards (amplc_dio200 driver).
1479 */
1480enum amplc_dio_ts_clock_src {
1481 AMPLC_DIO_TS_CLK_1GHZ, /* 1 ns period with 20 ns granularity */
1482 AMPLC_DIO_TS_CLK_1MHZ, /* 1 us period */
1483 AMPLC_DIO_TS_CLK_1KHZ /* 1 ms period */
1484};
1485
1486/*
1487 * Values for setting a gate source with INSN_CONFIG_SET_GATE_SRC for
1488 * 8254 counter subdevices on Amplicon DIO boards (amplc_dio200 driver).
1489 */
1490enum amplc_dio_gate_source {
1491 AMPLC_DIO_GAT_VCC, /* internal high logic level */
1492 AMPLC_DIO_GAT_GND, /* internal low logic level */
1493 AMPLC_DIO_GAT_GATN, /* per channel external gate input */
1494 /*
1495 * negated output of counter channel minus 2
1496 * (for channels 0 or 1, channel minus 2 is channel 1 or 2 on
1497 * the preceding counter subdevice, for the first counter subdevice
1498 * the preceding counter subdevice is the last counter subdevice)
1499 */
1500 AMPLC_DIO_GAT_NOUTNM2,
1501 AMPLC_DIO_GAT_RESERVED4,
1502 AMPLC_DIO_GAT_RESERVED5,
1503 AMPLC_DIO_GAT_RESERVED6,
1504 AMPLC_DIO_GAT_RESERVED7,
1505 /* the following are "enhanced" gate sources for PCIe models */
1506 AMPLC_DIO_GAT_NGATN = 6, /* negated per channel gate input */
1507 /* non-negated output of counter channel minus 2 */
1508 AMPLC_DIO_GAT_OUTNM2,
1509 AMPLC_DIO_GAT_PAT_PRESENT, /* "pattern present" signal */
1510 AMPLC_DIO_GAT_PAT_OCCURRED, /* "pattern occurred" latched */
1511 AMPLC_DIO_GAT_PAT_GONE, /* "pattern gone away" latched */
1512 AMPLC_DIO_GAT_NPAT_PRESENT, /* negated "pattern present" */
1513 AMPLC_DIO_GAT_NPAT_OCCURRED, /* negated "pattern occurred" */
1514 AMPLC_DIO_GAT_NPAT_GONE /* negated "pattern gone away" */
1515};
1516
1517/*
1518 * Values for setting a clock source with INSN_CONFIG_SET_CLOCK_SRC for
1519 * the counter subdevice on the Kolter Electronic PCI-Counter board
1520 * (ke_counter driver).
1521 */
1522enum ke_counter_clock_source {
1523 KE_CLK_20MHZ, /* internal 20MHz (default) */
1524 KE_CLK_4MHZ, /* internal 4MHz (option) */
1525 KE_CLK_EXT /* external clock on pin 21 of D-Sub */
1526};
1527
1528#endif /* _COMEDI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/connector.h+1-1
......@@ -75,7 +75,7 @@ struct cn_msg {
7575
7676 __u16 len; /* Length of the following data */
7777 __u16 flags;
78 __u8 data[0];
78 __u8 data[];
7979};
8080
8181#endif /* __CONNECTOR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/const.h+1-1
......@@ -28,7 +28,7 @@
2828#define _BITUL(x) (_UL(1) << (x))
2929#define _BITULL(x) (_ULL(1) << (x))
3030
31#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
31#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)
3232#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
3333
3434#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
lib/libc/include/any-linux-any/linux/counter.h+10
......@@ -61,6 +61,10 @@ enum counter_event_type {
6161 COUNTER_EVENT_THRESHOLD,
6262 /* Index signal detected */
6363 COUNTER_EVENT_INDEX,
64 /* State of counter is changed */
65 COUNTER_EVENT_CHANGE_OF_STATE,
66 /* Count value captured */
67 COUNTER_EVENT_CAPTURE,
6468};
6569
6670/**
......@@ -151,4 +155,10 @@ enum counter_synapse_action {
151155 COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
152156};
153157
158/* Signal polarity values */
159enum counter_signal_polarity {
160 COUNTER_SIGNAL_POLARITY_POSITIVE,
161 COUNTER_SIGNAL_POLARITY_NEGATIVE,
162};
163
154164#endif /* _COUNTER_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cxl_mem.h+32-12
......@@ -11,14 +11,19 @@
1111/**
1212 * DOC: UAPI
1313 *
14 * Not all of all commands that the driver supports are always available for use
15 * by userspace. Userspace must check the results from the QUERY command in
16 * order to determine the live set of commands.
14 * Not all of the commands that the driver supports are available for use by
15 * userspace at all times. Userspace can check the result of the QUERY command
16 * to determine the live set of commands. Alternatively, it can issue the
17 * command and check for failure.
1718 */
1819
1920#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
2021#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
2122
23/*
24 * NOTE: New defines must be added to the end of the list to preserve
25 * compatibility because this enum is exported to user space.
26 */
2227#define CXL_CMDS \
2328 ___C(INVALID, "Invalid Command"), \
2429 ___C(IDENTIFY, "Identify Command"), \
......@@ -68,8 +73,21 @@ static const struct {
6873 * struct cxl_command_info - Command information returned from a query.
6974 * @id: ID number for the command.
7075 * @flags: Flags that specify command behavior.
71 * @size_in: Expected input size, or -1 if variable length.
72 * @size_out: Expected output size, or -1 if variable length.
76 *
77 * CXL_MEM_COMMAND_FLAG_USER_ENABLED
78 *
79 * The given command id is supported by the driver and is supported by
80 * a related opcode on the device.
81 *
82 * CXL_MEM_COMMAND_FLAG_EXCLUSIVE
83 *
84 * Requests with the given command id will terminate with EBUSY as the
85 * kernel actively owns management of the given resource. For example,
86 * the label-storage-area can not be written while the kernel is
87 * actively managing that space.
88 *
89 * @size_in: Expected input size, or ~0 if variable length.
90 * @size_out: Expected output size, or ~0 if variable length.
7391 *
7492 * Represents a single command that is supported by both the driver and the
7593 * hardware. This is returned as part of an array from the query ioctl. The
......@@ -77,8 +95,8 @@ static const struct {
7795 * bytes of output.
7896 *
7997 * - @id = 10
80 * - @flags = 0
81 * - @size_in = -1
98 * - @flags = CXL_MEM_COMMAND_FLAG_ENABLED
99 * - @size_in = ~0
82100 * - @size_out = 0
83101 *
84102 * See struct cxl_mem_query_commands.
......@@ -87,10 +105,12 @@ struct cxl_command_info {
87105 __u32 id;
88106
89107 __u32 flags;
90#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(0, 0)
108#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(1, 0)
109#define CXL_MEM_COMMAND_FLAG_ENABLED BIT(0)
110#define CXL_MEM_COMMAND_FLAG_EXCLUSIVE BIT(1)
91111
92 __s32 size_in;
93 __s32 size_out;
112 __u32 size_in;
113 __u32 size_out;
94114};
95115
96116/**
......@@ -169,13 +189,13 @@ struct cxl_send_command {
169189 __u32 retval;
170190
171191 struct {
172 __s32 size;
192 __u32 size;
173193 __u32 rsvd;
174194 __u64 payload;
175195 } in;
176196
177197 struct {
178 __s32 size;
198 __u32 size;
179199 __u32 rsvd;
180200 __u64 payload;
181201 } out;
lib/libc/include/any-linux-any/linux/cyclades.h created+35
......@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_CYCLADES_H
4#define _LINUX_CYCLADES_H
5
6#warning "Support for features provided by this header has been removed"
7#warning "Please consider updating your code"
8
9struct cyclades_monitor {
10 unsigned long int_count;
11 unsigned long char_count;
12 unsigned long char_max;
13 unsigned long char_last;
14};
15
16#define CYGETMON 0x435901
17#define CYGETTHRESH 0x435902
18#define CYSETTHRESH 0x435903
19#define CYGETDEFTHRESH 0x435904
20#define CYSETDEFTHRESH 0x435905
21#define CYGETTIMEOUT 0x435906
22#define CYSETTIMEOUT 0x435907
23#define CYGETDEFTIMEOUT 0x435908
24#define CYSETDEFTIMEOUT 0x435909
25#define CYSETRFLOW 0x43590a
26#define CYGETRFLOW 0x43590b
27#define CYSETRTSDTR_INV 0x43590c
28#define CYGETRTSDTR_INV 0x43590d
29#define CYZSETPOLLCYCLE 0x43590e
30#define CYZGETPOLLCYCLE 0x43590f
31#define CYGETCD1400VER 0x435910
32#define CYSETWAIT 0x435912
33#define CYGETWAIT 0x435913
34
35#endif /* _LINUX_CYCLADES_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/cycx_cfm.h+1-1
......@@ -91,7 +91,7 @@ struct cycx_firmware {
9191 unsigned short reserved[6];
9292 char descr[CFM_DESCR_LEN];
9393 struct cycx_fw_info info;
94 unsigned char image[0];
94 unsigned char image[];
9595};
9696
9797struct cycx_fw_header {
lib/libc/include/any-linux-any/linux/dcbnl.h+10
......@@ -218,6 +218,9 @@ struct cee_pfc {
218218#define IEEE_8021QAZ_APP_SEL_ANY 4
219219#define IEEE_8021QAZ_APP_SEL_DSCP 5
220220
221/* Non-std selector values */
222#define DCB_APP_SEL_PCP 255
223
221224/* This structure contains the IEEE 802.1Qaz APP managed object. This
222225 * object is also used for the CEE std as well.
223226 *
......@@ -247,6 +250,8 @@ struct dcb_app {
247250 __u16 protocol;
248251};
249252
253#define IEEE_8021QAZ_APP_SEL_MAX 255
254
250255/**
251256 * struct dcb_peer_app_info - APP feature information sent by the peer
252257 *
......@@ -405,6 +410,8 @@ enum dcbnl_attrs {
405410 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
406411 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
407412 * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
413 * @DCB_ATTR_DCB_APP_TRUST_TABLE: selector trust table
414 * @DCB_ATTR_DCB_REWR_TABLE: rewrite configuration
408415 */
409416enum ieee_attrs {
410417 DCB_ATTR_IEEE_UNSPEC,
......@@ -418,6 +425,8 @@ enum ieee_attrs {
418425 DCB_ATTR_IEEE_QCN,
419426 DCB_ATTR_IEEE_QCN_STATS,
420427 DCB_ATTR_DCB_BUFFER,
428 DCB_ATTR_DCB_APP_TRUST_TABLE,
429 DCB_ATTR_DCB_REWR_TABLE,
421430 __DCB_ATTR_IEEE_MAX
422431};
423432#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
......@@ -425,6 +434,7 @@ enum ieee_attrs {
425434enum ieee_attrs_app {
426435 DCB_ATTR_IEEE_APP_UNSPEC,
427436 DCB_ATTR_IEEE_APP,
437 DCB_ATTR_DCB_APP,
428438 __DCB_ATTR_IEEE_APP_MAX
429439};
430440#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
lib/libc/include/any-linux-any/linux/devlink.h+72
......@@ -131,6 +131,14 @@ enum devlink_command {
131131 DEVLINK_CMD_RATE_NEW,
132132 DEVLINK_CMD_RATE_DEL,
133133
134 DEVLINK_CMD_LINECARD_GET, /* can dump */
135 DEVLINK_CMD_LINECARD_SET,
136 DEVLINK_CMD_LINECARD_NEW,
137 DEVLINK_CMD_LINECARD_DEL,
138
139 DEVLINK_CMD_SELFTESTS_GET, /* can dump */
140 DEVLINK_CMD_SELFTESTS_RUN,
141
134142 /* add new commands above here */
135143 __DEVLINK_CMD_MAX,
136144 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
......@@ -271,6 +279,30 @@ enum {
271279#define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \
272280 (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1)
273281
282enum devlink_attr_selftest_id {
283 DEVLINK_ATTR_SELFTEST_ID_UNSPEC,
284 DEVLINK_ATTR_SELFTEST_ID_FLASH, /* flag */
285
286 __DEVLINK_ATTR_SELFTEST_ID_MAX,
287 DEVLINK_ATTR_SELFTEST_ID_MAX = __DEVLINK_ATTR_SELFTEST_ID_MAX - 1
288};
289
290enum devlink_selftest_status {
291 DEVLINK_SELFTEST_STATUS_SKIP,
292 DEVLINK_SELFTEST_STATUS_PASS,
293 DEVLINK_SELFTEST_STATUS_FAIL
294};
295
296enum devlink_attr_selftest_result {
297 DEVLINK_ATTR_SELFTEST_RESULT_UNSPEC,
298 DEVLINK_ATTR_SELFTEST_RESULT, /* nested */
299 DEVLINK_ATTR_SELFTEST_RESULT_ID, /* u32, enum devlink_attr_selftest_id */
300 DEVLINK_ATTR_SELFTEST_RESULT_STATUS, /* u8, enum devlink_selftest_status */
301
302 __DEVLINK_ATTR_SELFTEST_RESULT_MAX,
303 DEVLINK_ATTR_SELFTEST_RESULT_MAX = __DEVLINK_ATTR_SELFTEST_RESULT_MAX - 1
304};
305
274306/**
275307 * enum devlink_trap_action - Packet trap action.
276308 * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not
......@@ -338,6 +370,19 @@ enum devlink_reload_limit {
338370
339371#define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BITUL(__DEVLINK_RELOAD_LIMIT_MAX) - 1)
340372
373enum devlink_linecard_state {
374 DEVLINK_LINECARD_STATE_UNSPEC,
375 DEVLINK_LINECARD_STATE_UNPROVISIONED,
376 DEVLINK_LINECARD_STATE_UNPROVISIONING,
377 DEVLINK_LINECARD_STATE_PROVISIONING,
378 DEVLINK_LINECARD_STATE_PROVISIONING_FAILED,
379 DEVLINK_LINECARD_STATE_PROVISIONED,
380 DEVLINK_LINECARD_STATE_ACTIVE,
381
382 __DEVLINK_LINECARD_STATE_MAX,
383 DEVLINK_LINECARD_STATE_MAX = __DEVLINK_LINECARD_STATE_MAX - 1
384};
385
341386enum devlink_attr {
342387 /* don't change the order or add anything between, this is ABI! */
343388 DEVLINK_ATTR_UNSPEC,
......@@ -553,6 +598,20 @@ enum devlink_attr {
553598
554599 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */
555600
601 DEVLINK_ATTR_LINECARD_INDEX, /* u32 */
602 DEVLINK_ATTR_LINECARD_STATE, /* u8 */
603 DEVLINK_ATTR_LINECARD_TYPE, /* string */
604 DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES, /* nested */
605
606 DEVLINK_ATTR_NESTED_DEVLINK, /* nested */
607
608 DEVLINK_ATTR_SELFTESTS, /* nested */
609
610 DEVLINK_ATTR_RATE_TX_PRIORITY, /* u32 */
611 DEVLINK_ATTR_RATE_TX_WEIGHT, /* u32 */
612
613 DEVLINK_ATTR_REGION_DIRECT, /* flag */
614
556615 /* add new attributes above here, update the policy in devlink.c */
557616
558617 __DEVLINK_ATTR_MAX,
......@@ -599,11 +658,24 @@ enum devlink_resource_unit {
599658 DEVLINK_RESOURCE_UNIT_ENTRY,
600659};
601660
661enum devlink_port_fn_attr_cap {
662 DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT,
663 DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT,
664
665 /* Add new caps above */
666 __DEVLINK_PORT_FN_ATTR_CAPS_MAX,
667};
668
669#define DEVLINK_PORT_FN_CAP_ROCE _BITUL(DEVLINK_PORT_FN_ATTR_CAP_ROCE_BIT)
670#define DEVLINK_PORT_FN_CAP_MIGRATABLE \
671 _BITUL(DEVLINK_PORT_FN_ATTR_CAP_MIGRATABLE_BIT)
672
602673enum devlink_port_function_attr {
603674 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
604675 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */
605676 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */
606677 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */
678 DEVLINK_PORT_FN_ATTR_CAPS, /* bitfield32 */
607679
608680 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
609681 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1
lib/libc/include/any-linux-any/linux/dlm.h-1
......@@ -69,7 +69,6 @@ struct dlm_lksb {
6969/* dlm_new_lockspace() flags */
7070
7171#define DLM_LSFL_TIMEWARN 0x00000002
72#define DLM_LSFL_FS 0x00000004
7372#define DLM_LSFL_NEWEXCL 0x00000008
7473
7574
lib/libc/include/any-linux-any/linux/dm-ioctl.h+6-6
......@@ -182,7 +182,7 @@ struct dm_target_spec {
182182struct dm_target_deps {
183183 __u32 count; /* Array size */
184184 __u32 padding; /* unused */
185 __u64 dev[0]; /* out */
185 __u64 dev[]; /* out */
186186};
187187
188188/*
......@@ -192,7 +192,7 @@ struct dm_name_list {
192192 __u64 dev;
193193 __u32 next; /* offset to the next record from
194194 the _start_ of this */
195 char name[0];
195 char name[];
196196
197197 /*
198198 * The following members can be accessed by taking a pointer that
......@@ -216,7 +216,7 @@ struct dm_target_versions {
216216 __u32 next;
217217 __u32 version[3];
218218
219 char name[0];
219 char name[];
220220};
221221
222222/*
......@@ -225,7 +225,7 @@ struct dm_target_versions {
225225struct dm_target_msg {
226226 __u64 sector; /* Device sector */
227227
228 char message[0];
228 char message[];
229229};
230230
231231/*
......@@ -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 45
289#define DM_VERSION_MINOR 47
290290#define DM_VERSION_PATCHLEVEL 0
291#define DM_VERSION_EXTRA "-ioctl (2021-03-22)"
291#define DM_VERSION_EXTRA "-ioctl (2022-07-28)"
292292
293293/* Status bits */
294294#define DM_READONLY_FLAG (1 << 0) /* In/Out */
lib/libc/include/any-linux-any/linux/dm-log-userspace.h+1-1
......@@ -426,7 +426,7 @@ struct dm_ulog_request {
426426 __u32 request_type; /* DM_ULOG_* defined above */
427427 __u32 data_size; /* How much data (not including this struct) */
428428
429 char data[0];
429 char data[];
430430};
431431
432432#endif /* __DM_LOG_USERSPACE_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dma-buf.h+86-2
......@@ -85,6 +85,88 @@ struct dma_buf_sync {
8585
8686#define DMA_BUF_NAME_LEN 32
8787
88/**
89 * struct dma_buf_export_sync_file - Get a sync_file from a dma-buf
90 *
91 * Userspace can perform a DMA_BUF_IOCTL_EXPORT_SYNC_FILE to retrieve the
92 * current set of fences on a dma-buf file descriptor as a sync_file. CPU
93 * waits via poll() or other driver-specific mechanisms typically wait on
94 * whatever fences are on the dma-buf at the time the wait begins. This
95 * is similar except that it takes a snapshot of the current fences on the
96 * dma-buf for waiting later instead of waiting immediately. This is
97 * useful for modern graphics APIs such as Vulkan which assume an explicit
98 * synchronization model but still need to inter-operate with dma-buf.
99 *
100 * The intended usage pattern is the following:
101 *
102 * 1. Export a sync_file with flags corresponding to the expected GPU usage
103 * via DMA_BUF_IOCTL_EXPORT_SYNC_FILE.
104 *
105 * 2. Submit rendering work which uses the dma-buf. The work should wait on
106 * the exported sync file before rendering and produce another sync_file
107 * when complete.
108 *
109 * 3. Import the rendering-complete sync_file into the dma-buf with flags
110 * corresponding to the GPU usage via DMA_BUF_IOCTL_IMPORT_SYNC_FILE.
111 *
112 * Unlike doing implicit synchronization via a GPU kernel driver's exec ioctl,
113 * the above is not a single atomic operation. If userspace wants to ensure
114 * ordering via these fences, it is the respnosibility of userspace to use
115 * locks or other mechanisms to ensure that no other context adds fences or
116 * submits work between steps 1 and 3 above.
117 */
118struct dma_buf_export_sync_file {
119 /**
120 * @flags: Read/write flags
121 *
122 * Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
123 *
124 * If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
125 * the returned sync file waits on any writers of the dma-buf to
126 * complete. Waiting on the returned sync file is equivalent to
127 * poll() with POLLIN.
128 *
129 * If DMA_BUF_SYNC_WRITE is set, the returned sync file waits on
130 * any users of the dma-buf (read or write) to complete. Waiting
131 * on the returned sync file is equivalent to poll() with POLLOUT.
132 * If both DMA_BUF_SYNC_WRITE and DMA_BUF_SYNC_READ are set, this
133 * is equivalent to just DMA_BUF_SYNC_WRITE.
134 */
135 __u32 flags;
136 /** @fd: Returned sync file descriptor */
137 __s32 fd;
138};
139
140/**
141 * struct dma_buf_import_sync_file - Insert a sync_file into a dma-buf
142 *
143 * Userspace can perform a DMA_BUF_IOCTL_IMPORT_SYNC_FILE to insert a
144 * sync_file into a dma-buf for the purposes of implicit synchronization
145 * with other dma-buf consumers. This allows clients using explicitly
146 * synchronized APIs such as Vulkan to inter-op with dma-buf consumers
147 * which expect implicit synchronization such as OpenGL or most media
148 * drivers/video.
149 */
150struct dma_buf_import_sync_file {
151 /**
152 * @flags: Read/write flags
153 *
154 * Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
155 *
156 * If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
157 * this inserts the sync_file as a read-only fence. Any subsequent
158 * implicitly synchronized writes to this dma-buf will wait on this
159 * fence but reads will not.
160 *
161 * If DMA_BUF_SYNC_WRITE is set, this inserts the sync_file as a
162 * write fence. All subsequent implicitly synchronized access to
163 * this dma-buf will wait on this fence.
164 */
165 __u32 flags;
166 /** @fd: Sync file descriptor */
167 __s32 fd;
168};
169
88170#define DMA_BUF_BASE 'b'
89171#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
90172
......@@ -92,7 +174,9 @@ struct dma_buf_sync {
92174 * between them in actual uapi, they're just different numbers.
93175 */
94176#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
95#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32)
96#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64)
177#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32)
178#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64)
179#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file)
180#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file)
97181
98182#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dn.h deleted-149
......@@ -1,149 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_DN_H
3#define _LINUX_DN_H
4
5#include <linux/ioctl.h>
6#include <linux/types.h>
7#include <linux/if_ether.h>
8
9/*
10
11 DECnet Data Structures and Constants
12
13*/
14
15/*
16 * DNPROTO_NSP can't be the same as SOL_SOCKET,
17 * so increment each by one (compared to ULTRIX)
18 */
19#define DNPROTO_NSP 2 /* NSP protocol number */
20#define DNPROTO_ROU 3 /* Routing protocol number */
21#define DNPROTO_NML 4 /* Net mgt protocol number */
22#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
23#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
24#define DNPROTO_NSPT 7 /* NSP trace protocol number */
25
26
27#define DN_ADDL 2
28#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
29#define DN_MAXOPTL 16
30#define DN_MAXOBJL 16
31#define DN_MAXACCL 40
32#define DN_MAXALIASL 128
33#define DN_MAXNODEL 256
34#define DNBUFSIZE 65023
35
36/*
37 * SET/GET Socket options - must match the DSO_ numbers below
38 */
39#define SO_CONDATA 1
40#define SO_CONACCESS 2
41#define SO_PROXYUSR 3
42#define SO_LINKINFO 7
43
44#define DSO_CONDATA 1 /* Set/Get connect data */
45#define DSO_DISDATA 10 /* Set/Get disconnect data */
46#define DSO_CONACCESS 2 /* Set/Get connect access data */
47#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
48#define DSO_CONACCEPT 5 /* Accept deferred connection */
49#define DSO_CONREJECT 6 /* Reject deferred connection */
50#define DSO_LINKINFO 7 /* Set/Get link information */
51#define DSO_STREAM 8 /* Set socket type to stream */
52#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
53#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
54#define DSO_NODELAY 12 /* Turn off nagle */
55#define DSO_CORK 13 /* Wait for more data! */
56#define DSO_SERVICES 14 /* NSP Services field */
57#define DSO_INFO 15 /* NSP Info field */
58#define DSO_MAX 15 /* Maximum option number */
59
60
61/* LINK States */
62#define LL_INACTIVE 0
63#define LL_CONNECTING 1
64#define LL_RUNNING 2
65#define LL_DISCONNECTING 3
66
67#define ACC_IMMED 0
68#define ACC_DEFER 1
69
70#define SDF_WILD 1 /* Wild card object */
71#define SDF_PROXY 2 /* Addr eligible for proxy */
72#define SDF_UICPROXY 4 /* Use uic-based proxy */
73
74/* Structures */
75
76
77struct dn_naddr {
78 __le16 a_len;
79 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
80};
81
82struct sockaddr_dn {
83 __u16 sdn_family;
84 __u8 sdn_flags;
85 __u8 sdn_objnum;
86 __le16 sdn_objnamel;
87 __u8 sdn_objname[DN_MAXOBJL];
88 struct dn_naddr sdn_add;
89};
90#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
91#define sdn_nodeaddr sdn_add.a_addr /* Node address */
92
93
94
95/*
96 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
97 */
98struct optdata_dn {
99 __le16 opt_status; /* Extended status return */
100#define opt_sts opt_status
101 __le16 opt_optl; /* Length of user data */
102 __u8 opt_data[16]; /* User data */
103};
104
105struct accessdata_dn {
106 __u8 acc_accl;
107 __u8 acc_acc[DN_MAXACCL];
108 __u8 acc_passl;
109 __u8 acc_pass[DN_MAXACCL];
110 __u8 acc_userl;
111 __u8 acc_user[DN_MAXACCL];
112};
113
114/*
115 * DECnet logical link information structure
116 */
117struct linkinfo_dn {
118 __u16 idn_segsize; /* Segment size for link */
119 __u8 idn_linkstate; /* Logical link state */
120};
121
122/*
123 * Ethernet address format (for DECnet)
124 */
125union etheraddress {
126 __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
127 struct {
128 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
129 __u8 dne_nodeaddr[2]; /* DECnet node address */
130 } dne_remote;
131};
132
133
134/*
135 * DECnet physical socket address format
136 */
137struct dn_addr {
138 __le16 dna_family; /* AF_DECnet */
139 union etheraddress dna_netaddr; /* DECnet ethernet address */
140};
141
142#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
143
144#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
145#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
146#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
147#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
148
149#endif /* _LINUX_DN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/dvb/audio.h-15
......@@ -7,21 +7,6 @@
77 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
88 * & Marcus Metzler <marcus@convergence.de>
99 * for convergence integrated media GmbH
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Lesser Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
2510 */
2611
2712#ifndef _DVBAUDIO_H_
lib/libc/include/any-linux-any/linux/dvb/ca.h-15
......@@ -5,21 +5,6 @@
55 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
66 * & Marcus Metzler <marcus@convergence.de>
77 * for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Lesser Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
238 */
249
2510#ifndef _DVBCA_H_
lib/libc/include/any-linux-any/linux/dvb/dmx.h-15
......@@ -5,21 +5,6 @@
55 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
66 * & Ralph Metzler <ralph@convergence.de>
77 * for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
238 */
249
2510#ifndef _DVBDMX_H_
lib/libc/include/any-linux-any/linux/dvb/frontend.h+59-18
......@@ -7,21 +7,6 @@
77 * Holger Waechtler <holger@convergence.de>
88 * Andre Draszik <ad@convergence.de>
99 * for convergence integrated media GmbH
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
2510 */
2611
2712#ifndef _DVBFRONTEND_H_
......@@ -282,7 +267,6 @@ enum fe_spectral_inversion {
282267/**
283268 * enum fe_code_rate - Type of Forward Error Correction (FEC)
284269 *
285 *
286270 * @FEC_NONE: No Forward Error Correction Code
287271 * @FEC_1_2: Forward Error Correction Code 1/2
288272 * @FEC_2_3: Forward Error Correction Code 2/3
......@@ -296,6 +280,22 @@ enum fe_spectral_inversion {
296280 * @FEC_3_5: Forward Error Correction Code 3/5
297281 * @FEC_9_10: Forward Error Correction Code 9/10
298282 * @FEC_2_5: Forward Error Correction Code 2/5
283 * @FEC_1_3: Forward Error Correction Code 1/3
284 * @FEC_1_4: Forward Error Correction Code 1/4
285 * @FEC_5_9: Forward Error Correction Code 5/9
286 * @FEC_7_9: Forward Error Correction Code 7/9
287 * @FEC_8_15: Forward Error Correction Code 8/15
288 * @FEC_11_15: Forward Error Correction Code 11/15
289 * @FEC_13_18: Forward Error Correction Code 13/18
290 * @FEC_9_20: Forward Error Correction Code 9/20
291 * @FEC_11_20: Forward Error Correction Code 11/20
292 * @FEC_23_36: Forward Error Correction Code 23/36
293 * @FEC_25_36: Forward Error Correction Code 25/36
294 * @FEC_13_45: Forward Error Correction Code 13/45
295 * @FEC_26_45: Forward Error Correction Code 26/45
296 * @FEC_28_45: Forward Error Correction Code 28/45
297 * @FEC_32_45: Forward Error Correction Code 32/45
298 * @FEC_77_90: Forward Error Correction Code 77/90
299299 *
300300 * Please note that not all FEC types are supported by a given standard.
301301 */
......@@ -313,6 +313,22 @@ enum fe_code_rate {
313313 FEC_3_5,
314314 FEC_9_10,
315315 FEC_2_5,
316 FEC_1_3,
317 FEC_1_4,
318 FEC_5_9,
319 FEC_7_9,
320 FEC_8_15,
321 FEC_11_15,
322 FEC_13_18,
323 FEC_9_20,
324 FEC_11_20,
325 FEC_23_36,
326 FEC_25_36,
327 FEC_13_45,
328 FEC_26_45,
329 FEC_28_45,
330 FEC_32_45,
331 FEC_77_90,
316332};
317333
318334/**
......@@ -331,6 +347,13 @@ enum fe_code_rate {
331347 * @APSK_32: 32-APSK modulation
332348 * @DQPSK: DQPSK modulation
333349 * @QAM_4_NR: 4-QAM-NR modulation
350 * @QAM_1024: 1024-QAM modulation
351 * @QAM_4096: 4096-QAM modulation
352 * @APSK_8_L: 8APSK-L modulation
353 * @APSK_16_L: 16APSK-L modulation
354 * @APSK_32_L: 32APSK-L modulation
355 * @APSK_64: 64APSK modulation
356 * @APSK_64_L: 64APSK-L modulation
334357 *
335358 * Please note that not all modulations are supported by a given standard.
336359 *
......@@ -350,6 +373,13 @@ enum fe_modulation {
350373 APSK_32,
351374 DQPSK,
352375 QAM_4_NR,
376 QAM_1024,
377 QAM_4096,
378 APSK_8_L,
379 APSK_16_L,
380 APSK_32_L,
381 APSK_64,
382 APSK_64_L,
353383};
354384
355385/**
......@@ -404,6 +434,7 @@ enum fe_transmit_mode {
404434 * @GUARD_INTERVAL_PN420: PN length 420 (1/4)
405435 * @GUARD_INTERVAL_PN595: PN length 595 (1/6)
406436 * @GUARD_INTERVAL_PN945: PN length 945 (1/9)
437 * @GUARD_INTERVAL_1_64: Guard interval 1/64
407438 *
408439 * Please note that not all guard intervals are supported by a given standard.
409440 */
......@@ -419,6 +450,7 @@ enum fe_guard_interval {
419450 GUARD_INTERVAL_PN420,
420451 GUARD_INTERVAL_PN595,
421452 GUARD_INTERVAL_PN945,
453 GUARD_INTERVAL_1_64,
422454};
423455
424456/**
......@@ -571,6 +603,9 @@ enum fe_pilot {
571603 * @ROLLOFF_20: Roloff factor: α=20%
572604 * @ROLLOFF_25: Roloff factor: α=25%
573605 * @ROLLOFF_AUTO: Auto-detect the roloff factor.
606 * @ROLLOFF_15: Rolloff factor: α=15%
607 * @ROLLOFF_10: Rolloff factor: α=10%
608 * @ROLLOFF_5: Rolloff factor: α=5%
574609 *
575610 * .. note:
576611 *
......@@ -581,6 +616,9 @@ enum fe_rolloff {
581616 ROLLOFF_20,
582617 ROLLOFF_25,
583618 ROLLOFF_AUTO,
619 ROLLOFF_15,
620 ROLLOFF_10,
621 ROLLOFF_5,
584622};
585623
586624/**
......@@ -594,6 +632,8 @@ enum fe_rolloff {
594632 * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
595633 * @SYS_DVBC_ANNEX_C:
596634 * Cable TV: DVB-C following ITU-T J.83 Annex C spec
635 * @SYS_DVBC2:
636 * Cable TV: DVB-C2
597637 * @SYS_ISDBC:
598638 * Cable TV: ISDB-C (no drivers yet)
599639 * @SYS_DVBT:
......@@ -611,7 +651,7 @@ enum fe_rolloff {
611651 * @SYS_DVBS:
612652 * Satellite TV: DVB-S
613653 * @SYS_DVBS2:
614 * Satellite TV: DVB-S2
654 * Satellite TV: DVB-S2 and DVB-S2X
615655 * @SYS_TURBO:
616656 * Satellite TV: DVB-S Turbo
617657 * @SYS_ISDBS:
......@@ -645,6 +685,7 @@ enum fe_delivery_system {
645685 SYS_DVBT2,
646686 SYS_TURBO,
647687 SYS_DVBC_ANNEX_C,
688 SYS_DVBC2,
648689};
649690
650691/* backward compatibility definitions for delivery systems */
......@@ -720,7 +761,7 @@ enum atscmh_rs_frame_mode {
720761};
721762
722763/**
723 * enum atscmh_rs_code_mode
764 * enum atscmh_rs_code_mode - ATSC-M/H Reed Solomon modes
724765 * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).
725766 * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).
726767 * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).
lib/libc/include/any-linux-any/linux/dvb/net.h-15
......@@ -5,21 +5,6 @@
55 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
66 * & Ralph Metzler <ralph@convergence.de>
77 * for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
238 */
249
2510#ifndef _DVBNET_H_
lib/libc/include/any-linux-any/linux/dvb/osd.h-15
......@@ -7,21 +7,6 @@
77 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
88 * & Marcus Metzler <marcus@convergence.de>
99 * for convergence integrated media GmbH
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Lesser Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
2510 */
2611
2712#ifndef _DVBOSD_H_
lib/libc/include/any-linux-any/linux/dvb/version.h-15
......@@ -4,21 +4,6 @@
44 *
55 * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
66 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
227 */
238
249#ifndef _DVBVERSION_H_
lib/libc/include/any-linux-any/linux/dvb/video.h-15
......@@ -7,21 +7,6 @@
77 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
88 * & Ralph Metzler <ralph@convergence.de>
99 * for convergence integrated media GmbH
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 *
2510 */
2611
2712#ifndef _DVBVIDEO_H_
lib/libc/include/any-linux-any/linux/dw100.h created+14
......@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/* Copyright 2022 NXP */
3
4#ifndef __UAPI_DW100_H__
5#define __UAPI_DW100_H__
6
7#include <linux/v4l2-controls.h>
8
9/*
10 * Check Documentation/userspace-api/media/drivers/dw100.rst for control details.
11 */
12#define V4L2_CID_DW100_DEWARPING_16x16_VERTEX_MAP (V4L2_CID_USER_DW100_BASE + 1)
13
14#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/elf-em.h+1
......@@ -51,6 +51,7 @@
5151#define EM_RISCV 243 /* RISC-V */
5252#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */
5353#define EM_CSKY 252 /* C-SKY */
54#define EM_LOONGARCH 258 /* LoongArch */
5455#define EM_FRV 0x5441 /* Fujitsu FR-V */
5556
5657/*
lib/libc/include/any-linux-any/linux/elf.h+26-11
......@@ -35,10 +35,14 @@ typedef __s64 Elf64_Sxword;
3535#define PT_HIOS 0x6fffffff /* OS-specific */
3636#define PT_LOPROC 0x70000000
3737#define PT_HIPROC 0x7fffffff
38#define PT_GNU_EH_FRAME 0x6474e550
39#define PT_GNU_PROPERTY 0x6474e553
40
38#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
4139#define PT_GNU_STACK (PT_LOOS + 0x474e551)
40#define PT_GNU_RELRO (PT_LOOS + 0x474e552)
41#define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)
42
43
44/* ARM MTE memory tag segment type */
45#define PT_AARCH64_MEMTAG_MTE (PT_LOPROC + 0x2)
4246
4347/*
4448 * Extended Numbering
......@@ -87,7 +91,7 @@ typedef __s64 Elf64_Sxword;
8791#define DT_INIT 12
8892#define DT_FINI 13
8993#define DT_SONAME 14
90#define DT_RPATH 15
94#define DT_RPATH 15
9195#define DT_SYMBOLIC 16
9296#define DT_REL 17
9397#define DT_RELSZ 18
......@@ -130,15 +134,15 @@ typedef __s64 Elf64_Sxword;
130134#define STT_TLS 6
131135
132136#define ELF_ST_BIND(x) ((x) >> 4)
133#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
137#define ELF_ST_TYPE(x) ((x) & 0xf)
134138#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
135139#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
136140#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
137141#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
138142
139typedef struct dynamic{
143typedef struct dynamic {
140144 Elf32_Sword d_tag;
141 union{
145 union {
142146 Elf32_Sword d_val;
143147 Elf32_Addr d_ptr;
144148 } d_un;
......@@ -169,7 +173,7 @@ typedef struct elf64_rel {
169173 Elf64_Xword r_info; /* index and type of relocation */
170174} Elf64_Rel;
171175
172typedef struct elf32_rela{
176typedef struct elf32_rela {
173177 Elf32_Addr r_offset;
174178 Elf32_Word r_info;
175179 Elf32_Sword r_addend;
......@@ -181,7 +185,7 @@ typedef struct elf64_rela {
181185 Elf64_Sxword r_addend; /* Constant addend used to compute value */
182186} Elf64_Rela;
183187
184typedef struct elf32_sym{
188typedef struct elf32_sym {
185189 Elf32_Word st_name;
186190 Elf32_Addr st_value;
187191 Elf32_Word st_size;
......@@ -202,7 +206,7 @@ typedef struct elf64_sym {
202206
203207#define EI_NIDENT 16
204208
205typedef struct elf32_hdr{
209typedef struct elf32_hdr {
206210 unsigned char e_ident[EI_NIDENT];
207211 Elf32_Half e_type;
208212 Elf32_Half e_machine;
......@@ -242,7 +246,7 @@ typedef struct elf64_hdr {
242246#define PF_W 0x2
243247#define PF_X 0x1
244248
245typedef struct elf32_phdr{
249typedef struct elf32_phdr {
246250 Elf32_Word p_type;
247251 Elf32_Off p_offset;
248252 Elf32_Addr p_vaddr;
......@@ -416,6 +420,7 @@ typedef struct elf64_shdr {
416420#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
417421#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */
418422#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */
423#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data */
419424#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
420425#define NT_ARM_TLS 0x401 /* ARM TLS register */
421426#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
......@@ -427,11 +432,21 @@ typedef struct elf64_shdr {
427432#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */
428433#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */
429434#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */
435#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers */
436#define NT_ARM_ZA 0x40c /* ARM SME ZA registers */
437#define NT_ARM_ZT 0x40d /* ARM SME ZT registers */
430438#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
431439#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
432440#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
433441#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
434442#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
443#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */
444#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */
445#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */
446#define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced SIMD Extension registers */
447#define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary Translation registers */
448#define NT_LOONGARCH_HW_BREAK 0xa05 /* LoongArch hardware breakpoint registers */
449#define NT_LOONGARCH_HW_WATCH 0xa06 /* LoongArch hardware watchpoint registers */
435450
436451/* Note types with note name "GNU" */
437452#define NT_GNU_PROPERTY_TYPE_0 5
lib/libc/include/any-linux-any/linux/ethtool.h+136-23
......@@ -157,8 +157,10 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
157157 * in its bus driver structure (e.g. pci_driver::name). Must
158158 * not be an empty string.
159159 * @version: Driver version string; may be an empty string
160 * @fw_version: Firmware version string; may be an empty string
161 * @erom_version: Expansion ROM version string; may be an empty string
160 * @fw_version: Firmware version string; driver defined; may be an
161 * empty string
162 * @erom_version: Expansion ROM version string; driver defined; may be
163 * an empty string
162164 * @bus_info: Device bus address. This should match the dev_name()
163165 * string for the underlying bus device, if there is one. May be
164166 * an empty string.
......@@ -177,10 +179,6 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
177179 *
178180 * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
179181 * strings in any string set (from Linux 2.6.34).
180 *
181 * Drivers should set at most @driver, @version, @fw_version and
182 * @bus_info in their get_drvinfo() implementation. The ethtool
183 * core fills in the other fields using other driver operations.
184182 */
185183struct ethtool_drvinfo {
186184 __u32 cmd;
......@@ -229,6 +227,7 @@ enum tunable_id {
229227 ETHTOOL_RX_COPYBREAK,
230228 ETHTOOL_TX_COPYBREAK,
231229 ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
230 ETHTOOL_TX_COPYBREAK_BUF_SIZE,
232231 /*
233232 * Add your fresh new tunable attribute above and remember to update
234233 * tunable_strings[] in net/ethtool/common.c
......@@ -254,7 +253,7 @@ struct ethtool_tunable {
254253 __u32 id;
255254 __u32 type_id;
256255 __u32 len;
257 void *data[0];
256 void *data[];
258257};
259258
260259#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
......@@ -319,7 +318,7 @@ struct ethtool_regs {
319318 __u32 cmd;
320319 __u32 version;
321320 __u32 len;
322 __u8 data[0];
321 __u8 data[];
323322};
324323
325324/**
......@@ -345,7 +344,7 @@ struct ethtool_eeprom {
345344 __u32 magic;
346345 __u32 offset;
347346 __u32 len;
348 __u8 data[0];
347 __u8 data[];
349348};
350349
351350/**
......@@ -710,6 +709,24 @@ enum ethtool_stringset {
710709 ETH_SS_COUNT
711710};
712711
712/**
713 * enum ethtool_mac_stats_src - source of ethtool MAC statistics
714 * @ETHTOOL_MAC_STATS_SRC_AGGREGATE:
715 * if device supports a MAC merge layer, this retrieves the aggregate
716 * statistics of the eMAC and pMAC. Otherwise, it retrieves just the
717 * statistics of the single (express) MAC.
718 * @ETHTOOL_MAC_STATS_SRC_EMAC:
719 * if device supports a MM layer, this retrieves the eMAC statistics.
720 * Otherwise, it retrieves the statistics of the single (express) MAC.
721 * @ETHTOOL_MAC_STATS_SRC_PMAC:
722 * if device supports a MM layer, this retrieves the pMAC statistics.
723 */
724enum ethtool_mac_stats_src {
725 ETHTOOL_MAC_STATS_SRC_AGGREGATE,
726 ETHTOOL_MAC_STATS_SRC_EMAC,
727 ETHTOOL_MAC_STATS_SRC_PMAC,
728};
729
713730/**
714731 * enum ethtool_module_power_mode_policy - plug-in module power mode policy
715732 * @ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: Module is always in high power mode.
......@@ -733,6 +750,76 @@ enum ethtool_module_power_mode {
733750 ETHTOOL_MODULE_POWER_MODE_HIGH,
734751};
735752
753/**
754 * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE
755 * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState
756 * @ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN: state of PoDL PSE functions are
757 * unknown
758 * @ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED: PoDL PSE functions are disabled
759 * @ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED: PoDL PSE functions are enabled
760 */
761enum ethtool_podl_pse_admin_state {
762 ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
763 ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED,
764 ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED,
765};
766
767/**
768 * enum ethtool_podl_pse_pw_d_status - power detection status of the PoDL PSE.
769 * IEEE 802.3-2018 30.15.1.1.3 aPoDLPSEPowerDetectionStatus:
770 * @ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN: PoDL PSE
771 * @ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED: "The enumeration “disabled” is
772 * asserted true when the PoDL PSE state diagram variable mr_pse_enable is
773 * false"
774 * @ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING: "The enumeration “searching” is
775 * asserted true when either of the PSE state diagram variables
776 * pi_detecting or pi_classifying is true."
777 * @ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING: "The enumeration “deliveringPower”
778 * is asserted true when the PoDL PSE state diagram variable pi_powered is
779 * true."
780 * @ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP: "The enumeration “sleep” is asserted
781 * true when the PoDL PSE state diagram variable pi_sleeping is true."
782 * @ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE: "The enumeration “idle” is asserted true
783 * when the logical combination of the PoDL PSE state diagram variables
784 * pi_prebiased*!pi_sleeping is true."
785 * @ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR: "The enumeration “error” is asserted
786 * true when the PoDL PSE state diagram variable overload_held is true."
787 */
788enum ethtool_podl_pse_pw_d_status {
789 ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN = 1,
790 ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED,
791 ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING,
792 ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING,
793 ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP,
794 ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE,
795 ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR,
796};
797
798/**
799 * enum ethtool_mm_verify_status - status of MAC Merge Verify function
800 * @ETHTOOL_MM_VERIFY_STATUS_UNKNOWN:
801 * verification status is unknown
802 * @ETHTOOL_MM_VERIFY_STATUS_INITIAL:
803 * the 802.3 Verify State diagram is in the state INIT_VERIFICATION
804 * @ETHTOOL_MM_VERIFY_STATUS_VERIFYING:
805 * the Verify State diagram is in the state VERIFICATION_IDLE,
806 * SEND_VERIFY or WAIT_FOR_RESPONSE
807 * @ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED:
808 * indicates that the Verify State diagram is in the state VERIFIED
809 * @ETHTOOL_MM_VERIFY_STATUS_FAILED:
810 * the Verify State diagram is in the state VERIFY_FAIL
811 * @ETHTOOL_MM_VERIFY_STATUS_DISABLED:
812 * verification of preemption operation is disabled
813 */
814enum ethtool_mm_verify_status {
815 ETHTOOL_MM_VERIFY_STATUS_UNKNOWN,
816 ETHTOOL_MM_VERIFY_STATUS_INITIAL,
817 ETHTOOL_MM_VERIFY_STATUS_VERIFYING,
818 ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED,
819 ETHTOOL_MM_VERIFY_STATUS_FAILED,
820 ETHTOOL_MM_VERIFY_STATUS_DISABLED,
821};
822
736823/**
737824 * struct ethtool_gstrings - string set for data tagging
738825 * @cmd: Command number = %ETHTOOL_GSTRINGS
......@@ -749,7 +836,7 @@ struct ethtool_gstrings {
749836 __u32 cmd;
750837 __u32 string_set;
751838 __u32 len;
752 __u8 data[0];
839 __u8 data[];
753840};
754841
755842/**
......@@ -774,7 +861,7 @@ struct ethtool_sset_info {
774861 __u32 cmd;
775862 __u32 reserved;
776863 __u64 sset_mask;
777 __u32 data[0];
864 __u32 data[];
778865};
779866
780867/**
......@@ -814,7 +901,7 @@ struct ethtool_test {
814901 __u32 flags;
815902 __u32 reserved;
816903 __u32 len;
817 __u64 data[0];
904 __u64 data[];
818905};
819906
820907/**
......@@ -831,7 +918,7 @@ struct ethtool_test {
831918struct ethtool_stats {
832919 __u32 cmd;
833920 __u32 n_stats;
834 __u64 data[0];
921 __u64 data[];
835922};
836923
837924/**
......@@ -848,7 +935,7 @@ struct ethtool_stats {
848935struct ethtool_perm_addr {
849936 __u32 cmd;
850937 __u32 size;
851 __u8 data[0];
938 __u8 data[];
852939};
853940
854941/* boolean flags controlling per-interface behavior characteristics.
......@@ -1137,7 +1224,7 @@ struct ethtool_rxnfc {
11371224 __u32 rule_cnt;
11381225 __u32 rss_context;
11391226 };
1140 __u32 rule_locs[0];
1227 __u32 rule_locs[];
11411228};
11421229
11431230
......@@ -1157,7 +1244,7 @@ struct ethtool_rxnfc {
11571244struct ethtool_rxfh_indir {
11581245 __u32 cmd;
11591246 __u32 size;
1160 __u32 ring_index[0];
1247 __u32 ring_index[];
11611248};
11621249
11631250/**
......@@ -1198,7 +1285,7 @@ struct ethtool_rxfh {
11981285 __u8 hfunc;
11991286 __u8 rsvd8[3];
12001287 __u32 rsvd32;
1201 __u32 rss_config[0];
1288 __u32 rss_config[];
12021289};
12031290#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
12041291#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
......@@ -1283,7 +1370,7 @@ struct ethtool_dump {
12831370 __u32 version;
12841371 __u32 flag;
12851372 __u32 len;
1286 __u8 data[0];
1373 __u8 data[];
12871374};
12881375
12891376#define ETH_FW_DUMP_DISABLE 0
......@@ -1315,7 +1402,7 @@ struct ethtool_get_features_block {
13151402struct ethtool_gfeatures {
13161403 __u32 cmd;
13171404 __u32 size;
1318 struct ethtool_get_features_block features[0];
1405 struct ethtool_get_features_block features[];
13191406};
13201407
13211408/**
......@@ -1337,7 +1424,7 @@ struct ethtool_set_features_block {
13371424struct ethtool_sfeatures {
13381425 __u32 cmd;
13391426 __u32 size;
1340 struct ethtool_set_features_block features[0];
1427 struct ethtool_set_features_block features[];
13411428};
13421429
13431430/**
......@@ -1688,6 +1775,17 @@ enum ethtool_link_mode_bit_indices {
16881775 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
16891776 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
16901777 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,
1778 ETHTOOL_LINK_MODE_10baseT1L_Full_BIT = 92,
1779 ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT = 93,
1780 ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT = 94,
1781 ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT = 95,
1782 ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT = 96,
1783 ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT = 97,
1784 ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT = 98,
1785 ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99,
1786 ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,
1787 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,
1788
16911789 /* must be last entry */
16921790 __ETHTOOL_LINK_MODE_MASK_NBITS
16931791};
......@@ -1799,6 +1897,7 @@ enum ethtool_link_mode_bit_indices {
17991897#define SPEED_100000 100000
18001898#define SPEED_200000 200000
18011899#define SPEED_400000 400000
1900#define SPEED_800000 800000
18021901
18031902#define SPEED_UNKNOWN -1
18041903
......@@ -1836,6 +1935,20 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
18361935#define MASTER_SLAVE_STATE_SLAVE 3
18371936#define MASTER_SLAVE_STATE_ERR 4
18381937
1938/* These are used to throttle the rate of data on the phy interface when the
1939 * native speed of the interface is higher than the link speed. These should
1940 * not be used for phy interfaces which natively support multiple speeds (e.g.
1941 * MII or SGMII).
1942 */
1943/* No rate matching performed. */
1944#define RATE_MATCH_NONE 0
1945/* The phy sends pause frames to throttle the MAC. */
1946#define RATE_MATCH_PAUSE 1
1947/* The phy asserts CRS to prevent the MAC from transmitting. */
1948#define RATE_MATCH_CRS 2
1949/* The MAC is programmed with a sufficiently-large IPG. */
1950#define RATE_MATCH_OPEN_LOOP 3
1951
18391952/* Which connector port. */
18401953#define PORT_TP 0x00
18411954#define PORT_AUI 0x01
......@@ -2029,8 +2142,8 @@ enum ethtool_reset_flags {
20292142 * reported consistently by PHYLIB. Read-only.
20302143 * @master_slave_cfg: Master/slave port mode.
20312144 * @master_slave_state: Master/slave port state.
2145 * @rate_matching: Rate adaptation performed by the PHY
20322146 * @reserved: Reserved for future use; see the note on reserved space.
2033 * @reserved1: Reserved for future use; see the note on reserved space.
20342147 * @link_mode_masks: Variable length bitmaps.
20352148 *
20362149 * If autonegotiation is disabled, the speed and @duplex represent the
......@@ -2081,9 +2194,9 @@ struct ethtool_link_settings {
20812194 __u8 transceiver;
20822195 __u8 master_slave_cfg;
20832196 __u8 master_slave_state;
2084 __u8 reserved1[1];
2197 __u8 rate_matching;
20852198 __u32 reserved[7];
2086 __u32 link_mode_masks[0];
2199 __u32 link_mode_masks[];
20872200 /* layout of link_mode_masks fields:
20882201 * __u32 map_supported[link_mode_masks_nwords];
20892202 * __u32 map_advertising[link_mode_masks_nwords];
lib/libc/include/any-linux-any/linux/ethtool_netlink.h+121
......@@ -49,6 +49,14 @@ enum {
4949 ETHTOOL_MSG_PHC_VCLOCKS_GET,
5050 ETHTOOL_MSG_MODULE_GET,
5151 ETHTOOL_MSG_MODULE_SET,
52 ETHTOOL_MSG_PSE_GET,
53 ETHTOOL_MSG_PSE_SET,
54 ETHTOOL_MSG_RSS_GET,
55 ETHTOOL_MSG_PLCA_GET_CFG,
56 ETHTOOL_MSG_PLCA_SET_CFG,
57 ETHTOOL_MSG_PLCA_GET_STATUS,
58 ETHTOOL_MSG_MM_GET,
59 ETHTOOL_MSG_MM_SET,
5260
5361 /* add new constants above here */
5462 __ETHTOOL_MSG_USER_CNT,
......@@ -94,6 +102,13 @@ enum {
94102 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
95103 ETHTOOL_MSG_MODULE_GET_REPLY,
96104 ETHTOOL_MSG_MODULE_NTF,
105 ETHTOOL_MSG_PSE_GET_REPLY,
106 ETHTOOL_MSG_RSS_GET_REPLY,
107 ETHTOOL_MSG_PLCA_GET_CFG_REPLY,
108 ETHTOOL_MSG_PLCA_GET_STATUS_REPLY,
109 ETHTOOL_MSG_PLCA_NTF,
110 ETHTOOL_MSG_MM_GET_REPLY,
111 ETHTOOL_MSG_MM_NTF,
97112
98113 /* add new constants above here */
99114 __ETHTOOL_MSG_KERNEL_CNT,
......@@ -242,6 +257,7 @@ enum {
242257 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */
243258 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */
244259 ETHTOOL_A_LINKMODES_LANES, /* u32 */
260 ETHTOOL_A_LINKMODES_RATE_MATCHING, /* u8 */
245261
246262 /* add new constants above here */
247263 __ETHTOOL_A_LINKMODES_CNT,
......@@ -258,6 +274,7 @@ enum {
258274 ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */
259275 ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */
260276 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */
277 ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT, /* u32 */
261278
262279 /* add new constants above here */
263280 __ETHTOOL_A_LINKSTATE_CNT,
......@@ -318,6 +335,12 @@ enum {
318335
319336/* RINGS */
320337
338enum {
339 ETHTOOL_TCP_DATA_SPLIT_UNKNOWN = 0,
340 ETHTOOL_TCP_DATA_SPLIT_DISABLED,
341 ETHTOOL_TCP_DATA_SPLIT_ENABLED,
342};
343
321344enum {
322345 ETHTOOL_A_RINGS_UNSPEC,
323346 ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
......@@ -329,6 +352,11 @@ enum {
329352 ETHTOOL_A_RINGS_RX_MINI, /* u32 */
330353 ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
331354 ETHTOOL_A_RINGS_TX, /* u32 */
355 ETHTOOL_A_RINGS_RX_BUF_LEN, /* u32 */
356 ETHTOOL_A_RINGS_TCP_DATA_SPLIT, /* u8 */
357 ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */
358 ETHTOOL_A_RINGS_TX_PUSH, /* u8 */
359 ETHTOOL_A_RINGS_RX_PUSH, /* u8 */
332360
333361 /* add new constants above here */
334362 __ETHTOOL_A_RINGS_CNT,
......@@ -383,6 +411,9 @@ enum {
383411 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
384412 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */
385413 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */
414 ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES, /* u32 */
415 ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES, /* u32 */
416 ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS, /* u32 */
386417
387418 /* add new constants above here */
388419 __ETHTOOL_A_COALESCE_CNT,
......@@ -398,6 +429,7 @@ enum {
398429 ETHTOOL_A_PAUSE_RX, /* u8 */
399430 ETHTOOL_A_PAUSE_TX, /* u8 */
400431 ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */
432 ETHTOOL_A_PAUSE_STATS_SRC, /* u32 */
401433
402434 /* add new constants above here */
403435 __ETHTOOL_A_PAUSE_CNT,
......@@ -714,6 +746,8 @@ enum {
714746
715747 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
716748
749 ETHTOOL_A_STATS_SRC, /* u32 */
750
717751 /* add new constants above here */
718752 __ETHTOOL_A_STATS_CNT,
719753 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
......@@ -852,6 +886,93 @@ enum {
852886 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
853887};
854888
889/* Power Sourcing Equipment */
890enum {
891 ETHTOOL_A_PSE_UNSPEC,
892 ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */
893 ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */
894 ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */
895 ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */
896
897 /* add new constants above here */
898 __ETHTOOL_A_PSE_CNT,
899 ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1)
900};
901
902enum {
903 ETHTOOL_A_RSS_UNSPEC,
904 ETHTOOL_A_RSS_HEADER,
905 ETHTOOL_A_RSS_CONTEXT, /* u32 */
906 ETHTOOL_A_RSS_HFUNC, /* u32 */
907 ETHTOOL_A_RSS_INDIR, /* binary */
908 ETHTOOL_A_RSS_HKEY, /* binary */
909
910 __ETHTOOL_A_RSS_CNT,
911 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
912};
913
914/* PLCA */
915
916enum {
917 ETHTOOL_A_PLCA_UNSPEC,
918 ETHTOOL_A_PLCA_HEADER, /* nest - _A_HEADER_* */
919 ETHTOOL_A_PLCA_VERSION, /* u16 */
920 ETHTOOL_A_PLCA_ENABLED, /* u8 */
921 ETHTOOL_A_PLCA_STATUS, /* u8 */
922 ETHTOOL_A_PLCA_NODE_CNT, /* u32 */
923 ETHTOOL_A_PLCA_NODE_ID, /* u32 */
924 ETHTOOL_A_PLCA_TO_TMR, /* u32 */
925 ETHTOOL_A_PLCA_BURST_CNT, /* u32 */
926 ETHTOOL_A_PLCA_BURST_TMR, /* u32 */
927
928 /* add new constants above here */
929 __ETHTOOL_A_PLCA_CNT,
930 ETHTOOL_A_PLCA_MAX = (__ETHTOOL_A_PLCA_CNT - 1)
931};
932
933/* MAC Merge (802.3) */
934
935enum {
936 ETHTOOL_A_MM_STAT_UNSPEC,
937 ETHTOOL_A_MM_STAT_PAD,
938
939 /* aMACMergeFrameAssErrorCount */
940 ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS, /* u64 */
941 /* aMACMergeFrameSmdErrorCount */
942 ETHTOOL_A_MM_STAT_SMD_ERRORS, /* u64 */
943 /* aMACMergeFrameAssOkCount */
944 ETHTOOL_A_MM_STAT_REASSEMBLY_OK, /* u64 */
945 /* aMACMergeFragCountRx */
946 ETHTOOL_A_MM_STAT_RX_FRAG_COUNT, /* u64 */
947 /* aMACMergeFragCountTx */
948 ETHTOOL_A_MM_STAT_TX_FRAG_COUNT, /* u64 */
949 /* aMACMergeHoldCount */
950 ETHTOOL_A_MM_STAT_HOLD_COUNT, /* u64 */
951
952 /* add new constants above here */
953 __ETHTOOL_A_MM_STAT_CNT,
954 ETHTOOL_A_MM_STAT_MAX = (__ETHTOOL_A_MM_STAT_CNT - 1)
955};
956
957enum {
958 ETHTOOL_A_MM_UNSPEC,
959 ETHTOOL_A_MM_HEADER, /* nest - _A_HEADER_* */
960 ETHTOOL_A_MM_PMAC_ENABLED, /* u8 */
961 ETHTOOL_A_MM_TX_ENABLED, /* u8 */
962 ETHTOOL_A_MM_TX_ACTIVE, /* u8 */
963 ETHTOOL_A_MM_TX_MIN_FRAG_SIZE, /* u32 */
964 ETHTOOL_A_MM_RX_MIN_FRAG_SIZE, /* u32 */
965 ETHTOOL_A_MM_VERIFY_ENABLED, /* u8 */
966 ETHTOOL_A_MM_VERIFY_STATUS, /* u8 */
967 ETHTOOL_A_MM_VERIFY_TIME, /* u32 */
968 ETHTOOL_A_MM_MAX_VERIFY_TIME, /* u32 */
969 ETHTOOL_A_MM_STATS, /* nest - _A_MM_STAT_* */
970
971 /* add new constants above here */
972 __ETHTOOL_A_MM_CNT,
973 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
974};
975
855976/* generic netlink info */
856977#define ETHTOOL_GENL_NAME "ethtool"
857978#define ETHTOOL_GENL_VERSION 1
lib/libc/include/any-linux-any/linux/eventpoll.h+6
......@@ -41,6 +41,12 @@
4141#define EPOLLMSG (__poll_t)0x00000400
4242#define EPOLLRDHUP (__poll_t)0x00002000
4343
44/*
45 * Internal flag - wakeup generated by io_uring, used to detect recursion back
46 * into the io_uring poll handler.
47 */
48#define EPOLL_URING_WAKE ((__poll_t)(1U << 27))
49
4450/* Set exclusive wakeup mode for the target file descriptor */
4551#define EPOLLEXCLUSIVE ((__poll_t)(1U << 28))
4652
lib/libc/include/any-linux-any/linux/f2fs.h+2-1
......@@ -13,7 +13,7 @@
1313#define F2FS_IOC_COMMIT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 2)
1414#define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)
1515#define F2FS_IOC_RELEASE_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 4)
16#define F2FS_IOC_ABORT_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 5)
16#define F2FS_IOC_ABORT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 5)
1717#define F2FS_IOC_GARBAGE_COLLECT _IOW(F2FS_IOCTL_MAGIC, 6, __u32)
1818#define F2FS_IOC_WRITE_CHECKPOINT _IO(F2FS_IOCTL_MAGIC, 7)
1919#define F2FS_IOC_DEFRAGMENT _IOWR(F2FS_IOCTL_MAGIC, 8, \
......@@ -42,6 +42,7 @@
4242 struct f2fs_comp_option)
4343#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)
4444#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
45#define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25)
4546
4647/*
4748 * should be same as XFS_IOC_GOINGDOWN.
lib/libc/include/any-linux-any/linux/fanotify.h+51-2
......@@ -28,6 +28,8 @@
2828
2929#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
3030
31#define FAN_RENAME 0x10000000 /* File was renamed */
32
3133#define FAN_ONDIR 0x40000000 /* Event occurred against dir */
3234
3335/* helper events */
......@@ -57,9 +59,13 @@
5759#define FAN_REPORT_FID 0x00000200 /* Report unique file id */
5860#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */
5961#define FAN_REPORT_NAME 0x00000800 /* Report events with name */
62#define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */
6063
6164/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */
6265#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)
66/* Convenience macro - FAN_REPORT_TARGET_FID requires all other FID flags */
67#define FAN_REPORT_DFID_NAME_TARGET (FAN_REPORT_DFID_NAME | \
68 FAN_REPORT_FID | FAN_REPORT_TARGET_FID)
6369
6470/* Deprecated - do not use this in programs and do not add new flags here! */
6571#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
......@@ -76,12 +82,21 @@
7682#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
7783#define FAN_MARK_FLUSH 0x00000080
7884/* FAN_MARK_FILESYSTEM is 0x00000100 */
85#define FAN_MARK_EVICTABLE 0x00000200
86/* This bit is mutually exclusive with FAN_MARK_IGNORED_MASK bit */
87#define FAN_MARK_IGNORE 0x00000400
7988
8089/* These are NOT bitwise flags. Both bits can be used togther. */
8190#define FAN_MARK_INODE 0x00000000
8291#define FAN_MARK_MOUNT 0x00000010
8392#define FAN_MARK_FILESYSTEM 0x00000100
8493
94/*
95 * Convenience macro - FAN_MARK_IGNORE requires FAN_MARK_IGNORED_SURV_MODIFY
96 * for non-inode mark types.
97 */
98#define FAN_MARK_IGNORE_SURV (FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY)
99
85100/* Deprecated - do not use this in programs and do not add new flags here! */
86101#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
87102 FAN_MARK_REMOVE |\
......@@ -128,6 +143,12 @@ struct fanotify_event_metadata {
128143#define FAN_EVENT_INFO_TYPE_PIDFD 4
129144#define FAN_EVENT_INFO_TYPE_ERROR 5
130145
146/* Special info types for FAN_RENAME */
147#define FAN_EVENT_INFO_TYPE_OLD_DFID_NAME 10
148/* Reserved for FAN_EVENT_INFO_TYPE_OLD_DFID 11 */
149#define FAN_EVENT_INFO_TYPE_NEW_DFID_NAME 12
150/* Reserved for FAN_EVENT_INFO_TYPE_NEW_DFID 13 */
151
131152/* Variable length info record following event metadata */
132153struct fanotify_event_info_header {
133154 __u8 info_type;
......@@ -149,7 +170,7 @@ struct fanotify_event_info_fid {
149170 * Following is an opaque struct file_handle that can be passed as
150171 * an argument to open_by_handle_at(2).
151172 */
152 unsigned char handle[0];
173 unsigned char handle[];
153174};
154175
155176/*
......@@ -167,15 +188,43 @@ struct fanotify_event_info_error {
167188 __u32 error_count;
168189};
169190
191/*
192 * User space may need to record additional information about its decision.
193 * The extra information type records what kind of information is included.
194 * The default is none. We also define an extra information buffer whose
195 * size is determined by the extra information type.
196 *
197 * If the information type is Audit Rule, then the information following
198 * is the rule number that triggered the user space decision that
199 * requires auditing.
200 */
201
202#define FAN_RESPONSE_INFO_NONE 0
203#define FAN_RESPONSE_INFO_AUDIT_RULE 1
204
170205struct fanotify_response {
171206 __s32 fd;
172207 __u32 response;
173208};
174209
210struct fanotify_response_info_header {
211 __u8 type;
212 __u8 pad;
213 __u16 len;
214};
215
216struct fanotify_response_info_audit_rule {
217 struct fanotify_response_info_header hdr;
218 __u32 rule_number;
219 __u32 subj_trust;
220 __u32 obj_trust;
221};
222
175223/* Legit userspace responses to a _PERM event */
176224#define FAN_ALLOW 0x01
177225#define FAN_DENY 0x02
178#define FAN_AUDIT 0x10 /* Bit mask to create audit record for result */
226#define FAN_AUDIT 0x10 /* Bitmask to create audit record for result */
227#define FAN_INFO 0x20 /* Bitmask to indicate additional information */
179228
180229/* No fd set in event */
181230#define FAN_NOFD -1
lib/libc/include/any-linux-any/linux/fb.h+1-1
......@@ -180,7 +180,7 @@ struct fb_fix_screeninfo {
180180 *
181181 * For pseudocolor: offset and length should be the same for all color
182182 * components. Offset specifies the position of the least significant bit
183 * of the pallette index in a pixel value. Length indicates the number
183 * of the palette index in a pixel value. Length indicates the number
184184 * of available palette entries (i.e. # of entries = 1 << length).
185185 */
186186struct fb_bitfield {
lib/libc/include/any-linux-any/linux/fcntl.h+1
......@@ -43,6 +43,7 @@
4343#define F_SEAL_GROW 0x0004 /* prevent file from growing */
4444#define F_SEAL_WRITE 0x0008 /* prevent writes */
4545#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
46#define F_SEAL_EXEC 0x0020 /* prevent chmod modifying exec bits */
4647/* (1U << 31) is reserved for signed error codes */
4748
4849/*
lib/libc/include/any-linux-any/linux/fiemap.h+1-1
......@@ -34,7 +34,7 @@ struct fiemap {
3434 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
3535 __u32 fm_extent_count; /* size of fm_extents array (in) */
3636 __u32 fm_reserved;
37 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
37 struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */
3838};
3939
4040#define FIEMAP_MAX_OFFSET (~0ULL)
lib/libc/include/any-linux-any/linux/firewire-cdev.h+6-6
......@@ -118,7 +118,7 @@ struct fw_cdev_event_response {
118118 __u32 type;
119119 __u32 rcode;
120120 __u32 length;
121 __u32 data[0];
121 __u32 data[];
122122};
123123
124124/**
......@@ -142,7 +142,7 @@ struct fw_cdev_event_request {
142142 __u64 offset;
143143 __u32 handle;
144144 __u32 length;
145 __u32 data[0];
145 __u32 data[];
146146};
147147
148148/**
......@@ -205,7 +205,7 @@ struct fw_cdev_event_request2 {
205205 __u32 generation;
206206 __u32 handle;
207207 __u32 length;
208 __u32 data[0];
208 __u32 data[];
209209};
210210
211211/**
......@@ -265,7 +265,7 @@ struct fw_cdev_event_iso_interrupt {
265265 __u32 type;
266266 __u32 cycle;
267267 __u32 header_length;
268 __u32 header[0];
268 __u32 header[];
269269};
270270
271271/**
......@@ -355,7 +355,7 @@ struct fw_cdev_event_phy_packet {
355355 __u32 type;
356356 __u32 rcode;
357357 __u32 length;
358 __u32 data[0];
358 __u32 data[];
359359};
360360
361361/**
......@@ -803,7 +803,7 @@ struct fw_cdev_set_iso_channels {
803803 */
804804struct fw_cdev_iso_packet {
805805 __u32 control;
806 __u32 header[0];
806 __u32 header[];
807807};
808808
809809/**
lib/libc/include/any-linux-any/linux/fou.h+27-29
......@@ -1,32 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* fou.h - FOU Interface */
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/fou.yaml */
4/* YNL-GEN uapi header */
35
46#ifndef _LINUX_FOU_H
57#define _LINUX_FOU_H
68
7/* NETLINK_GENERIC related info
8 */
99#define FOU_GENL_NAME "fou"
10#define FOU_GENL_VERSION 0x1
10#define FOU_GENL_VERSION 1
1111
1212enum {
13 FOU_ATTR_UNSPEC,
14 FOU_ATTR_PORT, /* u16 */
15 FOU_ATTR_AF, /* u8 */
16 FOU_ATTR_IPPROTO, /* u8 */
17 FOU_ATTR_TYPE, /* u8 */
18 FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */
19 FOU_ATTR_LOCAL_V4, /* u32 */
20 FOU_ATTR_LOCAL_V6, /* in6_addr */
21 FOU_ATTR_PEER_V4, /* u32 */
22 FOU_ATTR_PEER_V6, /* in6_addr */
23 FOU_ATTR_PEER_PORT, /* u16 */
24 FOU_ATTR_IFINDEX, /* s32 */
25
26 __FOU_ATTR_MAX,
13 FOU_ENCAP_UNSPEC,
14 FOU_ENCAP_DIRECT,
15 FOU_ENCAP_GUE,
2716};
2817
29#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1)
18enum {
19 FOU_ATTR_UNSPEC,
20 FOU_ATTR_PORT,
21 FOU_ATTR_AF,
22 FOU_ATTR_IPPROTO,
23 FOU_ATTR_TYPE,
24 FOU_ATTR_REMCSUM_NOPARTIAL,
25 FOU_ATTR_LOCAL_V4,
26 FOU_ATTR_LOCAL_V6,
27 FOU_ATTR_PEER_V4,
28 FOU_ATTR_PEER_V6,
29 FOU_ATTR_PEER_PORT,
30 FOU_ATTR_IFINDEX,
31
32 __FOU_ATTR_MAX
33};
34#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1)
3035
3136enum {
3237 FOU_CMD_UNSPEC,
......@@ -34,15 +39,8 @@ enum {
3439 FOU_CMD_DEL,
3540 FOU_CMD_GET,
3641
37 __FOU_CMD_MAX,
42 __FOU_CMD_MAX
3843};
39
40enum {
41 FOU_ENCAP_UNSPEC,
42 FOU_ENCAP_DIRECT,
43 FOU_ENCAP_GUE,
44};
45
46#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)
44#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)
4745
4846#endif /* _LINUX_FOU_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fs.h+1-1
......@@ -86,7 +86,7 @@ struct file_dedupe_range {
8686 __u16 dest_count; /* in - total elements in info array */
8787 __u16 reserved1; /* must be zero */
8888 __u32 reserved2; /* must be zero */
89 struct file_dedupe_range_info info[0];
89 struct file_dedupe_range_info info[];
9090};
9191
9292/* And dynamically-tunable limits and defaults: */
lib/libc/include/any-linux-any/linux/fscrypt.h+4-3
......@@ -26,8 +26,11 @@
2626#define FSCRYPT_MODE_AES_256_CTS 4
2727#define FSCRYPT_MODE_AES_128_CBC 5
2828#define FSCRYPT_MODE_AES_128_CTS 6
29#define FSCRYPT_MODE_SM4_XTS 7
30#define FSCRYPT_MODE_SM4_CTS 8
2931#define FSCRYPT_MODE_ADIANTUM 9
30/* If adding a mode number > 9, update FSCRYPT_MODE_MAX in fscrypt_private.h */
32#define FSCRYPT_MODE_AES_256_HCTR2 10
33/* If adding a mode number > 10, update FSCRYPT_MODE_MAX in fscrypt_private.h */
3134
3235/*
3336 * Legacy policy version; ad-hoc KDF and no key verification.
......@@ -183,8 +186,6 @@ struct fscrypt_get_key_status_arg {
183186#define FS_ENCRYPTION_MODE_AES_256_CTS FSCRYPT_MODE_AES_256_CTS
184187#define FS_ENCRYPTION_MODE_AES_128_CBC FSCRYPT_MODE_AES_128_CBC
185188#define FS_ENCRYPTION_MODE_AES_128_CTS FSCRYPT_MODE_AES_128_CTS
186#define FS_ENCRYPTION_MODE_SPECK128_256_XTS 7 /* removed */
187#define FS_ENCRYPTION_MODE_SPECK128_256_CTS 8 /* removed */
188189#define FS_ENCRYPTION_MODE_ADIANTUM FSCRYPT_MODE_ADIANTUM
189190#define FS_KEY_DESC_PREFIX FSCRYPT_KEY_DESC_PREFIX
190191#define FS_KEY_DESC_PREFIX_SIZE FSCRYPT_KEY_DESC_PREFIX_SIZE
lib/libc/include/any-linux-any/linux/fsi.h+14
......@@ -55,4 +55,18 @@ struct scom_access {
5555#define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)
5656#define FSI_SCOM_RESET _IOW('s', 0x03, __u32)
5757
58/*
59 * /dev/sbefifo* ioctl interface
60 */
61
62/**
63 * FSI_SBEFIFO_READ_TIMEOUT sets the read timeout for response from SBE.
64 *
65 * The read timeout is specified in seconds. The minimum value of read
66 * timeout is 10 seconds (default) and the maximum value of read timeout is
67 * 120 seconds. A read timeout of 0 will reset the value to the default of
68 * (10 seconds).
69 */
70#define FSI_SBEFIFO_READ_TIMEOUT_SECONDS _IOW('s', 0x00, __u32)
71
5872#endif /* _LINUX_FSI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fsmap.h+1-1
......@@ -69,7 +69,7 @@ struct fsmap_head {
6969};
7070
7171/* Size of an fsmap_head with room for nr records. */
72static __inline__ size_t
72static __inline__ __kernel_size_t
7373fsmap_sizeof(
7474 unsigned int nr)
7575{
lib/libc/include/any-linux-any/linux/fuse.h+112-6
......@@ -187,6 +187,25 @@
187187 *
188188 * 7.35
189189 * - add FOPEN_NOFLUSH
190 *
191 * 7.36
192 * - extend fuse_init_in with reserved fields, add FUSE_INIT_EXT init flag
193 * - add flags2 to fuse_init_in and fuse_init_out
194 * - add FUSE_SECURITY_CTX init flag
195 * - add security context to create, mkdir, symlink, and mknod requests
196 * - add FUSE_HAS_INODE_DAX, FUSE_ATTR_DAX
197 *
198 * 7.37
199 * - add FUSE_TMPFILE
200 *
201 * 7.38
202 * - add FUSE_EXPIRE_ONLY flag to fuse_notify_inval_entry
203 * - add FOPEN_PARALLEL_DIRECT_WRITES
204 * - add total_extlen to fuse_in_header
205 * - add FUSE_MAX_NR_SECCTX
206 * - add extension header
207 * - add FUSE_EXT_GROUPS
208 * - add FUSE_CREATE_SUPP_GROUP
190209 */
191210
192211#ifndef _LINUX_FUSE_H
......@@ -218,7 +237,7 @@
218237#define FUSE_KERNEL_VERSION 7
219238
220239/** Minor version number of this interface */
221#define FUSE_KERNEL_MINOR_VERSION 35
240#define FUSE_KERNEL_MINOR_VERSION 38
222241
223242/** The node ID of the root inode */
224243#define FUSE_ROOT_ID 1
......@@ -290,6 +309,7 @@ struct fuse_file_lock {
290309 * FOPEN_CACHE_DIR: allow caching this directory
291310 * FOPEN_STREAM: the file is stream-like (no file position at all)
292311 * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE)
312 * FOPEN_PARALLEL_DIRECT_WRITES: Allow concurrent direct writes on the same inode
293313 */
294314#define FOPEN_DIRECT_IO (1 << 0)
295315#define FOPEN_KEEP_CACHE (1 << 1)
......@@ -297,6 +317,7 @@ struct fuse_file_lock {
297317#define FOPEN_CACHE_DIR (1 << 3)
298318#define FOPEN_STREAM (1 << 4)
299319#define FOPEN_NOFLUSH (1 << 5)
320#define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
300321
301322/**
302323 * INIT request/reply flags
......@@ -337,6 +358,13 @@ struct fuse_file_lock {
337358 * write/truncate sgid is killed only if file has group
338359 * execute permission. (Same as Linux VFS behavior).
339360 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in
361 * FUSE_INIT_EXT: extended fuse_init_in request
362 * FUSE_INIT_RESERVED: reserved, do not use
363 * FUSE_SECURITY_CTX: add security context to create, mkdir, symlink, and
364 * mknod
365 * FUSE_HAS_INODE_DAX: use per inode DAX
366 * FUSE_CREATE_SUPP_GROUP: add supplementary group info to create, mkdir,
367 * symlink and mknod (single group that matches parent)
340368 */
341369#define FUSE_ASYNC_READ (1 << 0)
342370#define FUSE_POSIX_LOCKS (1 << 1)
......@@ -368,6 +396,12 @@ struct fuse_file_lock {
368396#define FUSE_SUBMOUNTS (1 << 27)
369397#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
370398#define FUSE_SETXATTR_EXT (1 << 29)
399#define FUSE_INIT_EXT (1 << 30)
400#define FUSE_INIT_RESERVED (1 << 31)
401/* bits 32..63 get shifted down 32 bits into the flags2 field */
402#define FUSE_SECURITY_CTX (1ULL << 32)
403#define FUSE_HAS_INODE_DAX (1ULL << 33)
404#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
371405
372406/**
373407 * CUSE INIT request/reply flags
......@@ -450,8 +484,10 @@ struct fuse_file_lock {
450484 * fuse_attr flags
451485 *
452486 * FUSE_ATTR_SUBMOUNT: Object is a submount root
487 * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode
453488 */
454489#define FUSE_ATTR_SUBMOUNT (1 << 0)
490#define FUSE_ATTR_DAX (1 << 1)
455491
456492/**
457493 * Open flags
......@@ -465,6 +501,23 @@ struct fuse_file_lock {
465501 */
466502#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
467503
504/**
505 * notify_inval_entry flags
506 * FUSE_EXPIRE_ONLY
507 */
508#define FUSE_EXPIRE_ONLY (1 << 0)
509
510/**
511 * extension type
512 * FUSE_MAX_NR_SECCTX: maximum value of &fuse_secctx_header.nr_secctx
513 * FUSE_EXT_GROUPS: &fuse_supp_groups extension
514 */
515enum fuse_ext_type {
516 /* Types 0..31 are reserved for fuse_secctx_header */
517 FUSE_MAX_NR_SECCTX = 31,
518 FUSE_EXT_GROUPS = 32,
519};
520
468521enum fuse_opcode {
469522 FUSE_LOOKUP = 1,
470523 FUSE_FORGET = 2, /* no reply */
......@@ -514,6 +567,7 @@ enum fuse_opcode {
514567 FUSE_SETUPMAPPING = 48,
515568 FUSE_REMOVEMAPPING = 49,
516569 FUSE_SYNCFS = 50,
570 FUSE_TMPFILE = 51,
517571
518572 /* CUSE specific operations */
519573 CUSE_INIT = 4096,
......@@ -737,6 +791,8 @@ struct fuse_init_in {
737791 uint32_t minor;
738792 uint32_t max_readahead;
739793 uint32_t flags;
794 uint32_t flags2;
795 uint32_t unused[11];
740796};
741797
742798#define FUSE_COMPAT_INIT_OUT_SIZE 8
......@@ -753,7 +809,8 @@ struct fuse_init_out {
753809 uint32_t time_gran;
754810 uint16_t max_pages;
755811 uint16_t map_alignment;
756 uint32_t unused[8];
812 uint32_t flags2;
813 uint32_t unused[7];
757814};
758815
759816#define CUSE_INIT_INFO_MAX 4096
......@@ -844,7 +901,8 @@ struct fuse_in_header {
844901 uint32_t uid;
845902 uint32_t gid;
846903 uint32_t pid;
847 uint32_t padding;
904 uint16_t total_extlen; /* length of extensions in 8byte units */
905 uint16_t padding;
848906};
849907
850908struct fuse_out_header {
......@@ -861,9 +919,12 @@ struct fuse_dirent {
861919 char name[];
862920};
863921
864#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
865#define FUSE_DIRENT_ALIGN(x) \
922/* Align variable length records to 64bit boundary */
923#define FUSE_REC_ALIGN(x) \
866924 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
925
926#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
927#define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
867928#define FUSE_DIRENT_SIZE(d) \
868929 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
869930
......@@ -886,7 +947,7 @@ struct fuse_notify_inval_inode_out {
886947struct fuse_notify_inval_entry_out {
887948 uint64_t parent;
888949 uint32_t namelen;
889 uint32_t padding;
950 uint32_t flags;
890951};
891952
892953struct fuse_notify_delete_out {
......@@ -980,4 +1041,49 @@ struct fuse_syncfs_in {
9801041 uint64_t padding;
9811042};
9821043
1044/*
1045 * For each security context, send fuse_secctx with size of security context
1046 * fuse_secctx will be followed by security context name and this in turn
1047 * will be followed by actual context label.
1048 * fuse_secctx, name, context
1049 */
1050struct fuse_secctx {
1051 uint32_t size;
1052 uint32_t padding;
1053};
1054
1055/*
1056 * Contains the information about how many fuse_secctx structures are being
1057 * sent and what's the total size of all security contexts (including
1058 * size of fuse_secctx_header).
1059 *
1060 */
1061struct fuse_secctx_header {
1062 uint32_t size;
1063 uint32_t nr_secctx;
1064};
1065
1066/**
1067 * struct fuse_ext_header - extension header
1068 * @size: total size of this extension including this header
1069 * @type: type of extension
1070 *
1071 * This is made compatible with fuse_secctx_header by using type values >
1072 * FUSE_MAX_NR_SECCTX
1073 */
1074struct fuse_ext_header {
1075 uint32_t size;
1076 uint32_t type;
1077};
1078
1079/**
1080 * struct fuse_supp_groups - Supplementary group extension
1081 * @nr_groups: number of supplementary groups
1082 * @groups: flexible array of group IDs
1083 */
1084struct fuse_supp_groups {
1085 uint32_t nr_groups;
1086 uint32_t groups[];
1087};
1088
9831089#endif /* _LINUX_FUSE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/genetlink.h+3-2
......@@ -87,6 +87,8 @@ enum {
8787 __CTRL_ATTR_MCAST_GRP_MAX,
8888};
8989
90#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
91
9092enum {
9193 CTRL_ATTR_POLICY_UNSPEC,
9294 CTRL_ATTR_POLICY_DO,
......@@ -96,7 +98,6 @@ enum {
9698 CTRL_ATTR_POLICY_DUMP_MAX = __CTRL_ATTR_POLICY_DUMP_MAX - 1
9799};
98100
99#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
100
101#define CTRL_ATTR_POLICY_MAX (__CTRL_ATTR_POLICY_DUMP_MAX - 1)
101102
102103#endif /* __LINUX_GENERIC_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gpio.h+3
......@@ -66,6 +66,8 @@ struct gpiochip_info {
6666 * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled
6767 * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
6868 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps
69 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE: line events contain timestamps from
70 * hardware timestamp engine
6971 */
7072enum gpio_v2_line_flag {
7173 GPIO_V2_LINE_FLAG_USED = _BITULL(0),
......@@ -80,6 +82,7 @@ enum gpio_v2_line_flag {
8082 GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN = _BITULL(9),
8183 GPIO_V2_LINE_FLAG_BIAS_DISABLED = _BITULL(10),
8284 GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME = _BITULL(11),
85 GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE = _BITULL(12),
8386};
8487
8588/**
lib/libc/include/any-linux-any/linux/gsmmux.h+13-4
......@@ -19,8 +19,7 @@ struct gsm_config
1919 unsigned int mtu;
2020 unsigned int k;
2121 unsigned int i;
22 unsigned int unused[8]; /* Padding for expansion without
23 breaking stuff */
22 unsigned int unused[8]; /* Can not be used */
2423};
2524
2625#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
......@@ -29,9 +28,9 @@ struct gsm_config
2928struct gsm_netconfig {
3029 unsigned int adaption; /* Adaption to use in network mode */
3130 unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */
32 unsigned short unused2;
31 unsigned short unused2; /* Can not be used */
3332 char if_name[IFNAMSIZ]; /* interface name format string */
34 __u8 unused[28]; /* For future use */
33 __u8 unused[28]; /* Can not be used */
3534};
3635
3736#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
......@@ -40,4 +39,14 @@ struct gsm_netconfig {
4039/* get the base tty number for a configured gsmmux tty */
4140#define GSMIOC_GETFIRST _IOR('G', 4, __u32)
4241
42struct 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 */
47};
48
49#define GSMIOC_GETCONF_EXT _IOR('G', 5, struct gsm_config_ext)
50#define GSMIOC_SETCONF_EXT _IOW('G', 6, struct gsm_config_ext)
51
4352#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/gtp.h+1
......@@ -8,6 +8,7 @@ enum gtp_genl_cmds {
88 GTP_CMD_NEWPDP,
99 GTP_CMD_DELPDP,
1010 GTP_CMD_GETPDP,
11 GTP_CMD_ECHOREQ,
1112
1213 GTP_CMD_MAX,
1314};
lib/libc/include/any-linux-any/linux/hid.h+20-6
......@@ -42,16 +42,30 @@
4242#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
4343#define USB_INTERFACE_PROTOCOL_MOUSE 2
4444
45/*
46 * HID report types --- Ouch! HID spec says 1 2 3!
47 */
48
49enum hid_report_type {
50 HID_INPUT_REPORT = 0,
51 HID_OUTPUT_REPORT = 1,
52 HID_FEATURE_REPORT = 2,
53
54 HID_REPORT_TYPES,
55};
56
4557/*
4658 * HID class requests
4759 */
4860
49#define HID_REQ_GET_REPORT 0x01
50#define HID_REQ_GET_IDLE 0x02
51#define HID_REQ_GET_PROTOCOL 0x03
52#define HID_REQ_SET_REPORT 0x09
53#define HID_REQ_SET_IDLE 0x0A
54#define HID_REQ_SET_PROTOCOL 0x0B
61enum hid_class_request {
62 HID_REQ_GET_REPORT = 0x01,
63 HID_REQ_GET_IDLE = 0x02,
64 HID_REQ_GET_PROTOCOL = 0x03,
65 HID_REQ_SET_REPORT = 0x09,
66 HID_REQ_SET_IDLE = 0x0A,
67 HID_REQ_SET_PROTOCOL = 0x0B,
68};
5569
5670/*
5771 * HID class descriptor types
lib/libc/include/any-linux-any/linux/hsi/cs-protocol.h-14
......@@ -6,20 +6,6 @@
66 *
77 * Contact: Kai Vehmanen <kai.vehmanen@nokia.com>
88 * Original author: Peter Ujfalusi <peter.ujfalusi@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
239 */
2410
2511#ifndef _CS_PROTOCOL_H
lib/libc/include/any-linux-any/linux/hsi/hsi_char.h-14
......@@ -5,20 +5,6 @@
55 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
66 *
77 * Contact: Andras Domokos <andras.domokos at nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
228 */
239
2410#ifndef __HSI_CHAR_H
lib/libc/include/any-linux-any/linux/hyperv.h+11
......@@ -90,6 +90,17 @@ struct hv_vss_check_dm_info {
9090 __u32 flags;
9191} __attribute__((packed));
9292
93/*
94 * struct hv_vss_msg encodes the fields that the Linux VSS
95 * driver accesses. However, FREEZE messages from Hyper-V contain
96 * additional LUN information that Linux doesn't use and are not
97 * represented in struct hv_vss_msg. A received FREEZE message may
98 * be as large as 6,260 bytes, so the driver must allocate at least
99 * that much space, not sizeof(struct hv_vss_msg). Other messages
100 * such as AUTO_RECOVER may be as large as 12,500 bytes. However,
101 * because the Linux VSS driver responds that it doesn't support
102 * auto-recovery, it should not receive such messages.
103 */
93104struct hv_vss_msg {
94105 union {
95106 struct hv_vss_hdr vss_hdr;
lib/libc/include/any-linux-any/linux/idxd.h+31-4
......@@ -24,6 +24,8 @@ enum idxd_scmd_stat {
2424 IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,
2525 IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,
2626 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
27 IDXD_SCMD_WQ_IRQ_ERR = 0x80100000,
28 IDXD_SCMD_WQ_USER_NO_IOMMU = 0x80110000,
2729};
2830
2931#define IDXD_SCMD_SOFTERR_MASK 0x80000000
......@@ -48,6 +50,11 @@ enum idxd_scmd_stat {
4850
4951/* IAX */
5052#define IDXD_OP_FLAG_RD_SRC2_AECS 0x010000
53#define IDXD_OP_FLAG_RD_SRC2_2ND 0x020000
54#define IDXD_OP_FLAG_WR_SRC2_AECS_COMP 0x040000
55#define IDXD_OP_FLAG_WR_SRC2_AECS_OVFL 0x080000
56#define IDXD_OP_FLAG_SRC2_STS 0x100000
57#define IDXD_OP_FLAG_CRC_RFC3720 0x200000
5158
5259/* Opcode */
5360enum dsa_opcode {
......@@ -76,6 +83,18 @@ enum iax_opcode {
7683 IAX_OPCODE_MEMMOVE,
7784 IAX_OPCODE_DECOMPRESS = 0x42,
7885 IAX_OPCODE_COMPRESS,
86 IAX_OPCODE_CRC64,
87 IAX_OPCODE_ZERO_DECOMP_32 = 0x48,
88 IAX_OPCODE_ZERO_DECOMP_16,
89 IAX_OPCODE_ZERO_COMP_32 = 0x4c,
90 IAX_OPCODE_ZERO_COMP_16,
91 IAX_OPCODE_SCAN = 0x50,
92 IAX_OPCODE_SET_MEMBER,
93 IAX_OPCODE_EXTRACT,
94 IAX_OPCODE_SELECT,
95 IAX_OPCODE_RLE_BURST,
96 IAX_OPCODE_FIND_UNIQUE,
97 IAX_OPCODE_EXPAND,
7998};
8099
81100/* Completion record status */
......@@ -115,6 +134,7 @@ enum iax_completion_status {
115134 IAX_COMP_NONE = 0,
116135 IAX_COMP_SUCCESS,
117136 IAX_COMP_PAGE_FAULT_IR = 0x04,
137 IAX_COMP_ANALYTICS_ERROR = 0x0a,
118138 IAX_COMP_OUTBUF_OVERFLOW,
119139 IAX_COMP_BAD_OPCODE = 0x10,
120140 IAX_COMP_INVALID_FLAGS,
......@@ -135,7 +155,10 @@ enum iax_completion_status {
135155 IAX_COMP_WATCHDOG,
136156 IAX_COMP_INVALID_COMP_FLAG = 0x30,
137157 IAX_COMP_INVALID_FILTER_FLAG,
138 IAX_COMP_INVALID_NUM_ELEMS = 0x33,
158 IAX_COMP_INVALID_INPUT_SIZE,
159 IAX_COMP_INVALID_NUM_ELEMS,
160 IAX_COMP_INVALID_SRC1_WIDTH,
161 IAX_COMP_INVALID_INVERT_OUT,
139162};
140163
141164#define DSA_COMP_STATUS_MASK 0x7f
......@@ -268,7 +291,7 @@ struct dsa_completion_record {
268291 };
269292
270293 uint32_t delta_rec_size;
271 uint32_t crc_val;
294 uint64_t crc_val;
272295
273296 /* DIF check & strip */
274297 struct {
......@@ -314,8 +337,12 @@ struct iax_completion_record {
314337 uint32_t output_size;
315338 uint8_t output_bits;
316339 uint8_t rsvd3;
317 uint16_t rsvd4;
318 uint64_t rsvd5[4];
340 uint16_t xor_csum;
341 uint32_t crc;
342 uint32_t min;
343 uint32_t max;
344 uint32_t sum;
345 uint64_t rsvd4[2];
319346} __attribute__((packed));
320347
321348struct iax_raw_completion_record {
lib/libc/include/any-linux-any/linux/if_addr.h+8-1
......@@ -33,8 +33,9 @@ enum {
3333 IFA_CACHEINFO,
3434 IFA_MULTICAST,
3535 IFA_FLAGS,
36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */
36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */
3737 IFA_TARGET_NETNSID,
38 IFA_PROTO, /* u8, address protocol */
3839 __IFA_MAX,
3940};
4041
......@@ -67,4 +68,10 @@ struct ifa_cacheinfo {
6768#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
6869#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
6970
71/* ifa_proto */
72#define IFAPROT_UNSPEC 0
73#define IFAPROT_KERNEL_LO 1 /* loopback */
74#define IFAPROT_KERNEL_RA 2 /* set by kernel from router announcement */
75#define IFAPROT_KERNEL_LL 3 /* link-local set by kernel */
76
7077#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_alg.h+2-1
......@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
4242
4343struct af_alg_iv {
4444 __u32 ivlen;
45 __u8 iv[0];
45 __u8 iv[];
4646};
4747
4848/* Socket options */
......@@ -52,6 +52,7 @@ struct af_alg_iv {
5252#define ALG_SET_AEAD_ASSOCLEN 4
5353#define ALG_SET_AEAD_AUTHSIZE 5
5454#define ALG_SET_DRBG_ENTROPY 6
55#define ALG_SET_KEY_BY_KEY_SERIAL 7
5556
5657/* Operations */
5758#define ALG_OP_DECRYPT 0
lib/libc/include/any-linux-any/linux/if_arcnet.h+3-3
......@@ -60,7 +60,7 @@ struct arc_rfc1201 {
6060 __u8 proto; /* protocol ID field - varies */
6161 __u8 split_flag; /* for use with split packets */
6262 __be16 sequence; /* sequence number */
63 __u8 payload[0]; /* space remaining in packet (504 bytes)*/
63 __u8 payload[]; /* space remaining in packet (504 bytes)*/
6464};
6565#define RFC1201_HDR_SIZE 4
6666
......@@ -69,7 +69,7 @@ struct arc_rfc1201 {
6969 */
7070struct arc_rfc1051 {
7171 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
72 __u8 payload[0]; /* 507 bytes */
72 __u8 payload[]; /* 507 bytes */
7373};
7474#define RFC1051_HDR_SIZE 1
7575
......@@ -80,7 +80,7 @@ struct arc_rfc1051 {
8080struct arc_eth_encap {
8181 __u8 proto; /* Always ARC_P_ETHER */
8282 struct ethhdr eth; /* standard ethernet header (yuck!) */
83 __u8 payload[0]; /* 493 bytes */
83 __u8 payload[]; /* 493 bytes */
8484};
8585#define ETH_ENCAP_HDR_SIZE 14
8686
lib/libc/include/any-linux-any/linux/if_bridge.h+41
......@@ -122,6 +122,7 @@ enum {
122122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,
123123 IFLA_BRIDGE_MRP,
124124 IFLA_BRIDGE_CFM,
125 IFLA_BRIDGE_MST,
125126 __IFLA_BRIDGE_MAX,
126127};
127128#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
......@@ -453,6 +454,21 @@ enum {
453454
454455#define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)
455456
457enum {
458 IFLA_BRIDGE_MST_UNSPEC,
459 IFLA_BRIDGE_MST_ENTRY,
460 __IFLA_BRIDGE_MST_MAX,
461};
462#define IFLA_BRIDGE_MST_MAX (__IFLA_BRIDGE_MST_MAX - 1)
463
464enum {
465 IFLA_BRIDGE_MST_ENTRY_UNSPEC,
466 IFLA_BRIDGE_MST_ENTRY_MSTI,
467 IFLA_BRIDGE_MST_ENTRY_STATE,
468 __IFLA_BRIDGE_MST_ENTRY_MAX,
469};
470#define IFLA_BRIDGE_MST_ENTRY_MAX (__IFLA_BRIDGE_MST_ENTRY_MAX - 1)
471
456472struct bridge_stp_xstats {
457473 __u64 transition_blk;
458474 __u64 transition_fwd;
......@@ -507,6 +523,8 @@ enum {
507523 BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
508524 BRIDGE_VLANDB_ENTRY_STATS,
509525 BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
526 BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS,
527 BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS,
510528 __BRIDGE_VLANDB_ENTRY_MAX,
511529};
512530#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
......@@ -564,6 +582,7 @@ enum {
564582 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,
565583 BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,
566584 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,
585 BRIDGE_VLANDB_GOPTS_MSTI,
567586 __BRIDGE_VLANDB_GOPTS_MAX
568587};
569588#define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
......@@ -706,10 +725,31 @@ enum {
706725enum {
707726 MDBE_ATTR_UNSPEC,
708727 MDBE_ATTR_SOURCE,
728 MDBE_ATTR_SRC_LIST,
729 MDBE_ATTR_GROUP_MODE,
730 MDBE_ATTR_RTPROT,
709731 __MDBE_ATTR_MAX,
710732};
711733#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)
712734
735/* per mdb entry source */
736enum {
737 MDBE_SRC_LIST_UNSPEC,
738 MDBE_SRC_LIST_ENTRY,
739 __MDBE_SRC_LIST_MAX,
740};
741#define MDBE_SRC_LIST_MAX (__MDBE_SRC_LIST_MAX - 1)
742
743/* per mdb entry per source attributes
744 * these are embedded in MDBE_SRC_LIST_ENTRY
745 */
746enum {
747 MDBE_SRCATTR_UNSPEC,
748 MDBE_SRCATTR_ADDRESS,
749 __MDBE_SRCATTR_MAX,
750};
751#define MDBE_SRCATTR_MAX (__MDBE_SRCATTR_MAX - 1)
752
713753/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
714754enum {
715755 BRIDGE_XSTATS_UNSPEC,
......@@ -759,6 +799,7 @@ struct br_mcast_stats {
759799enum br_boolopt_id {
760800 BR_BOOLOPT_NO_LL_LEARN,
761801 BR_BOOLOPT_MCAST_VLAN_SNOOPING,
802 BR_BOOLOPT_MST_ENABLE,
762803 BR_BOOLOPT_MAX
763804};
764805
lib/libc/include/any-linux-any/linux/if_ether.h+4
......@@ -86,8 +86,10 @@
8686 * over Ethernet
8787 */
8888#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
89#define ETH_P_PROFINET 0x8892 /* PROFINET */
8990#define ETH_P_REALTEK 0x8899 /* Multiple proprietary protocols */
9091#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
92#define ETH_P_ETHERCAT 0x88A4 /* EtherCAT */
9193#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
9294#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
9395#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */
......@@ -114,6 +116,7 @@
114116#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
115117#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
116118#define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
119#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW Tag Value [ NOT AN OFFICIALLY REGISTERED ID ] */
117120#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */
118121#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
119122
......@@ -135,6 +138,7 @@
135138#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
136139#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
137140#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
141#define ETH_P_CANXL 0x000E /* CANXL: eXtended frame Length */
138142#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
139143#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
140144#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
lib/libc/include/any-linux-any/linux/if_link.h+121
......@@ -211,6 +211,9 @@ struct rtnl_link_stats {
211211 * @rx_nohandler: Number of packets received on the interface
212212 * but dropped by the networking stack because the device is
213213 * not designated to receive packets (e.g. backup link in a bond).
214 *
215 * @rx_otherhost_dropped: Number of packets dropped due to mismatch
216 * in destination MAC address.
214217 */
215218struct rtnl_link_stats64 {
216219 __u64 rx_packets;
......@@ -243,6 +246,23 @@ struct rtnl_link_stats64 {
243246 __u64 rx_compressed;
244247 __u64 tx_compressed;
245248 __u64 rx_nohandler;
249
250 __u64 rx_otherhost_dropped;
251};
252
253/* Subset of link stats useful for in-HW collection. Meaning of the fields is as
254 * for struct rtnl_link_stats64.
255 */
256struct rtnl_hw_stats64 {
257 __u64 rx_packets;
258 __u64 tx_packets;
259 __u64 rx_bytes;
260 __u64 tx_bytes;
261 __u64 rx_errors;
262 __u64 tx_errors;
263 __u64 rx_dropped;
264 __u64 tx_dropped;
265 __u64 multicast;
246266};
247267
248268/* The struct should be in sync with struct ifmap */
......@@ -347,6 +367,15 @@ enum {
347367 */
348368 IFLA_PARENT_DEV_NAME,
349369 IFLA_PARENT_DEV_BUS_NAME,
370 IFLA_GRO_MAX_SIZE,
371 IFLA_TSO_MAX_SIZE,
372 IFLA_TSO_MAX_SEGS,
373 IFLA_ALLMULTI, /* Allmulti count: > 0 means acts ALLMULTI */
374
375 IFLA_DEVLINK_PORT,
376
377 IFLA_GSO_IPV4_MAX_SIZE,
378 IFLA_GRO_IPV4_MAX_SIZE,
350379
351380 __IFLA_MAX
352381};
......@@ -534,6 +563,10 @@ enum {
534563 IFLA_BRPORT_MRP_IN_OPEN,
535564 IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
536565 IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
566 IFLA_BRPORT_LOCKED,
567 IFLA_BRPORT_MAB,
568 IFLA_BRPORT_MCAST_N_GROUPS,
569 IFLA_BRPORT_MCAST_MAX_GROUPS,
537570 __IFLA_BRPORT_MAX
538571};
539572#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
......@@ -668,6 +701,7 @@ enum {
668701 IFLA_XFRM_UNSPEC,
669702 IFLA_XFRM_LINK,
670703 IFLA_XFRM_IF_ID,
704 IFLA_XFRM_COLLECT_METADATA,
671705 __IFLA_XFRM_MAX
672706};
673707
......@@ -709,7 +743,55 @@ enum ipvlan_mode {
709743#define IPVLAN_F_PRIVATE 0x01
710744#define IPVLAN_F_VEPA 0x02
711745
746/* Tunnel RTM header */
747struct tunnel_msg {
748 __u8 family;
749 __u8 flags;
750 __u16 reserved2;
751 __u32 ifindex;
752};
753
712754/* VXLAN section */
755
756/* include statistics in the dump */
757#define TUNNEL_MSG_FLAG_STATS 0x01
758
759#define TUNNEL_MSG_VALID_USER_FLAGS TUNNEL_MSG_FLAG_STATS
760
761/* Embedded inside VXLAN_VNIFILTER_ENTRY_STATS */
762enum {
763 VNIFILTER_ENTRY_STATS_UNSPEC,
764 VNIFILTER_ENTRY_STATS_RX_BYTES,
765 VNIFILTER_ENTRY_STATS_RX_PKTS,
766 VNIFILTER_ENTRY_STATS_RX_DROPS,
767 VNIFILTER_ENTRY_STATS_RX_ERRORS,
768 VNIFILTER_ENTRY_STATS_TX_BYTES,
769 VNIFILTER_ENTRY_STATS_TX_PKTS,
770 VNIFILTER_ENTRY_STATS_TX_DROPS,
771 VNIFILTER_ENTRY_STATS_TX_ERRORS,
772 VNIFILTER_ENTRY_STATS_PAD,
773 __VNIFILTER_ENTRY_STATS_MAX
774};
775#define VNIFILTER_ENTRY_STATS_MAX (__VNIFILTER_ENTRY_STATS_MAX - 1)
776
777enum {
778 VXLAN_VNIFILTER_ENTRY_UNSPEC,
779 VXLAN_VNIFILTER_ENTRY_START,
780 VXLAN_VNIFILTER_ENTRY_END,
781 VXLAN_VNIFILTER_ENTRY_GROUP,
782 VXLAN_VNIFILTER_ENTRY_GROUP6,
783 VXLAN_VNIFILTER_ENTRY_STATS,
784 __VXLAN_VNIFILTER_ENTRY_MAX
785};
786#define VXLAN_VNIFILTER_ENTRY_MAX (__VXLAN_VNIFILTER_ENTRY_MAX - 1)
787
788enum {
789 VXLAN_VNIFILTER_UNSPEC,
790 VXLAN_VNIFILTER_ENTRY,
791 __VXLAN_VNIFILTER_MAX
792};
793#define VXLAN_VNIFILTER_MAX (__VXLAN_VNIFILTER_MAX - 1)
794
713795enum {
714796 IFLA_VXLAN_UNSPEC,
715797 IFLA_VXLAN_ID,
......@@ -741,6 +823,7 @@ enum {
741823 IFLA_VXLAN_GPE,
742824 IFLA_VXLAN_TTL_INHERIT,
743825 IFLA_VXLAN_DF,
826 IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
744827 __IFLA_VXLAN_MAX
745828};
746829#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
......@@ -774,6 +857,7 @@ enum {
774857 IFLA_GENEVE_LABEL,
775858 IFLA_GENEVE_TTL_INHERIT,
776859 IFLA_GENEVE_DF,
860 IFLA_GENEVE_INNER_PROTO_INHERIT,
777861 __IFLA_GENEVE_MAX
778862};
779863#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
......@@ -819,6 +903,8 @@ enum {
819903 IFLA_GTP_FD1,
820904 IFLA_GTP_PDP_HASHSIZE,
821905 IFLA_GTP_ROLE,
906 IFLA_GTP_CREATE_SOCKETS,
907 IFLA_GTP_RESTART_COUNT,
822908 __IFLA_GTP_MAX,
823909};
824910#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
......@@ -856,6 +942,8 @@ enum {
856942 IFLA_BOND_TLB_DYNAMIC_LB,
857943 IFLA_BOND_PEER_NOTIF_DELAY,
858944 IFLA_BOND_AD_LACP_ACTIVE,
945 IFLA_BOND_MISSED_MAX,
946 IFLA_BOND_NS_IP6_TARGET,
859947 __IFLA_BOND_MAX,
860948};
861949
......@@ -883,6 +971,7 @@ enum {
883971 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
884972 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
885973 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
974 IFLA_BOND_SLAVE_PRIO,
886975 __IFLA_BOND_SLAVE_MAX,
887976};
888977
......@@ -1152,6 +1241,17 @@ enum {
11521241
11531242#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
11541243
1244enum {
1245 IFLA_STATS_GETSET_UNSPEC,
1246 IFLA_STATS_GET_FILTERS, /* Nest of IFLA_STATS_LINK_xxx, each a u32 with
1247 * a filter mask for the corresponding group.
1248 */
1249 IFLA_STATS_SET_OFFLOAD_XSTATS_L3_STATS, /* 0 or 1 as u8 */
1250 __IFLA_STATS_GETSET_MAX,
1251};
1252
1253#define IFLA_STATS_GETSET_MAX (__IFLA_STATS_GETSET_MAX - 1)
1254
11551255/* These are embedded into IFLA_STATS_LINK_XSTATS:
11561256 * [IFLA_STATS_LINK_XSTATS]
11571257 * -> [LINK_XSTATS_TYPE_xxx]
......@@ -1169,10 +1269,21 @@ enum {
11691269enum {
11701270 IFLA_OFFLOAD_XSTATS_UNSPEC,
11711271 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
1272 IFLA_OFFLOAD_XSTATS_HW_S_INFO, /* HW stats info. A nest */
1273 IFLA_OFFLOAD_XSTATS_L3_STATS, /* struct rtnl_hw_stats64 */
11721274 __IFLA_OFFLOAD_XSTATS_MAX
11731275};
11741276#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
11751277
1278enum {
1279 IFLA_OFFLOAD_XSTATS_HW_S_INFO_UNSPEC,
1280 IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST, /* u8 */
1281 IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED, /* u8 */
1282 __IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX,
1283};
1284#define IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX \
1285 (__IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX - 1)
1286
11761287/* XDP section */
11771288
11781289#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
......@@ -1271,4 +1382,14 @@ enum {
12711382
12721383#define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)
12731384
1385/* DSA section */
1386
1387enum {
1388 IFLA_DSA_UNSPEC,
1389 IFLA_DSA_MASTER,
1390 __IFLA_DSA_MAX,
1391};
1392
1393#define IFLA_DSA_MAX (__IFLA_DSA_MAX - 1)
1394
12741395#endif /* _LINUX_IF_LINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_macsec.h+2
......@@ -22,6 +22,8 @@
2222
2323#define MACSEC_KEYID_LEN 16
2424
25#define MACSEC_SALT_LEN 12
26
2527/* cipher IDs as per IEEE802.1AE-2018 (Table 14-1) */
2628#define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL
2729#define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL
lib/libc/include/any-linux-any/linux/if_packet.h+2
......@@ -70,6 +70,7 @@ struct sockaddr_ll {
7070#define PACKET_FANOUT_EBPF 7
7171#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
7272#define PACKET_FANOUT_FLAG_UNIQUEID 0x2000
73#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000
7374#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
7475
7576struct tpacket_stats {
......@@ -114,6 +115,7 @@ struct tpacket_auxdata {
114115#define TP_STATUS_BLK_TMO (1 << 5)
115116#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
116117#define TP_STATUS_CSUM_VALID (1 << 7)
118#define TP_STATUS_GSO_TCP (1 << 8)
117119
118120/* Tx ring - header status */
119121#define TP_STATUS_AVAILABLE 0
lib/libc/include/any-linux-any/linux/if_pppox.h+2-2
......@@ -122,7 +122,7 @@ struct sockaddr_pppol2tpv3in6 {
122122struct pppoe_tag {
123123 __be16 tag_type;
124124 __be16 tag_len;
125 char tag_data[0];
125 char tag_data[];
126126} __attribute__ ((packed));
127127
128128/* Tag identifiers */
......@@ -150,7 +150,7 @@ struct pppoe_hdr {
150150 __u8 code;
151151 __be16 sid;
152152 __be16 length;
153 struct pppoe_tag tag[0];
153 struct pppoe_tag tag[];
154154} __attribute__((packed));
155155
156156/* Length of entire PPPoE + PPP header */
lib/libc/include/any-linux-any/linux/if_tun.h+5-1
......@@ -67,6 +67,8 @@
6767#define IFF_TAP 0x0002
6868#define IFF_NAPI 0x0010
6969#define IFF_NAPI_FRAGS 0x0020
70/* Used in TUNSETIFF to bring up tun/tap without carrier */
71#define IFF_NO_CARRIER 0x0040
7072#define IFF_NO_PI 0x1000
7173/* This flag has no real effect */
7274#define IFF_ONE_QUEUE 0x2000
......@@ -88,6 +90,8 @@
8890#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
8991#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
9092#define TUN_F_UFO 0x10 /* I can handle UFO packets */
93#define TUN_F_USO4 0x20 /* I can handle USO for IPv4 packets */
94#define TUN_F_USO6 0x40 /* I can handle USO for IPv6 packets */
9195
9296/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
9397#define TUN_PKT_STRIP 0x0001
......@@ -108,7 +112,7 @@ struct tun_pi {
108112struct tun_filter {
109113 __u16 flags; /* TUN_FLT_ flags see above */
110114 __u16 count; /* Number of addresses */
111 __u8 addr[0][ETH_ALEN];
115 __u8 addr[][ETH_ALEN];
112116};
113117
114118#endif /* __IF_TUN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_tunnel.h+3-1
......@@ -176,8 +176,10 @@ enum {
176176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
177177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
178178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
179#define TUNNEL_GTP_OPT __cpu_to_be16(0x8000)
179180
180181#define TUNNEL_OPTIONS_PRESENT \
181 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT)
182 (TUNNEL_GENEVE_OPT | TUNNEL_VXLAN_OPT | TUNNEL_ERSPAN_OPT | \
183 TUNNEL_GTP_OPT)
182184
183185#endif /* _IF_TUNNEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/igmp.h+3-3
......@@ -48,7 +48,7 @@ struct igmpv3_grec {
4848 __u8 grec_auxwords;
4949 __be16 grec_nsrcs;
5050 __be32 grec_mca;
51 __be32 grec_src[0];
51 __be32 grec_src[];
5252};
5353
5454struct igmpv3_report {
......@@ -57,7 +57,7 @@ struct igmpv3_report {
5757 __sum16 csum;
5858 __be16 resv2;
5959 __be16 ngrec;
60 struct igmpv3_grec grec[0];
60 struct igmpv3_grec grec[];
6161};
6262
6363struct igmpv3_query {
......@@ -78,7 +78,7 @@ struct igmpv3_query {
7878#endif
7979 __u8 qqic;
8080 __be16 nsrcs;
81 __be32 srcs[0];
81 __be32 srcs[];
8282};
8383
8484#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
lib/libc/include/any-linux-any/linux/iio/types.h+10
......@@ -95,6 +95,12 @@ enum iio_modifier {
9595 IIO_MOD_ETHANOL,
9696 IIO_MOD_H2,
9797 IIO_MOD_O2,
98 IIO_MOD_LINEAR_X,
99 IIO_MOD_LINEAR_Y,
100 IIO_MOD_LINEAR_Z,
101 IIO_MOD_PITCH,
102 IIO_MOD_YAW,
103 IIO_MOD_ROLL,
98104};
99105
100106enum iio_event_type {
......@@ -104,6 +110,8 @@ enum iio_event_type {
104110 IIO_EV_TYPE_THRESH_ADAPTIVE,
105111 IIO_EV_TYPE_MAG_ADAPTIVE,
106112 IIO_EV_TYPE_CHANGE,
113 IIO_EV_TYPE_MAG_REFERENCED,
114 IIO_EV_TYPE_GESTURE,
107115};
108116
109117enum iio_event_direction {
......@@ -111,6 +119,8 @@ enum iio_event_direction {
111119 IIO_EV_DIR_RISING,
112120 IIO_EV_DIR_FALLING,
113121 IIO_EV_DIR_NONE,
122 IIO_EV_DIR_SINGLETAP,
123 IIO_EV_DIR_DOUBLETAP,
114124};
115125
116126#endif /* _IIO_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/in.h+11-14
......@@ -20,6 +20,7 @@
2020#define _LINUX_IN_H
2121
2222#include <linux/types.h>
23#include <linux/stddef.h>
2324#include <linux/libc-compat.h>
2425#include <linux/socket.h>
2526
......@@ -68,6 +69,8 @@ enum {
6869#define IPPROTO_PIM IPPROTO_PIM
6970 IPPROTO_COMP = 108, /* Compression Header Protocol */
7071#define IPPROTO_COMP IPPROTO_COMP
72 IPPROTO_L2TP = 115, /* Layer 2 Tunnelling Protocol */
73#define IPPROTO_L2TP IPPROTO_L2TP
7174 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
7275#define IPPROTO_SCTP IPPROTO_SCTP
7376 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
......@@ -159,6 +162,8 @@ struct in_addr {
159162#define MCAST_MSFILTER 48
160163#define IP_MULTICAST_ALL 49
161164#define IP_UNICAST_IF 50
165#define IP_LOCAL_PORT_RANGE 51
166#define IP_PROTOCOL 52
162167
163168#define MCAST_EXCLUDE 0
164169#define MCAST_INCLUDE 1
......@@ -188,21 +193,13 @@ struct ip_mreq_source {
188193};
189194
190195struct ip_msfilter {
196 __be32 imsf_multiaddr;
197 __be32 imsf_interface;
198 __u32 imsf_fmode;
199 __u32 imsf_numsrc;
191200 union {
192 struct {
193 __be32 imsf_multiaddr_aux;
194 __be32 imsf_interface_aux;
195 __u32 imsf_fmode_aux;
196 __u32 imsf_numsrc_aux;
197 __be32 imsf_slist[1];
198 };
199 struct {
200 __be32 imsf_multiaddr;
201 __be32 imsf_interface;
202 __u32 imsf_fmode;
203 __u32 imsf_numsrc;
204 __be32 imsf_slist_flex[];
205 };
201 __be32 imsf_slist[1];
202 __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
206203 };
207204};
208205
lib/libc/include/any-linux-any/linux/inet_diag.h+1-1
......@@ -104,7 +104,7 @@ struct inet_diag_hostcond {
104104 __u8 family;
105105 __u8 prefix_len;
106106 int port;
107 __be32 addr[0];
107 __be32 addr[];
108108};
109109
110110struct inet_diag_markcond {
lib/libc/include/any-linux-any/linux/inotify.h+1-1
......@@ -23,7 +23,7 @@ struct inotify_event {
2323 __u32 mask; /* watch mask */
2424 __u32 cookie; /* cookie to synchronize two events */
2525 __u32 len; /* length (including nulls) of name */
26 char name[0]; /* stub for possible name */
26 char name[]; /* stub for possible name */
2727};
2828
2929/* the following are legal, implemented events that user-space can watch for */
lib/libc/include/any-linux-any/linux/input-event-codes.h+28-1
......@@ -278,7 +278,8 @@
278278#define KEY_PAUSECD 201
279279#define KEY_PROG3 202
280280#define KEY_PROG4 203
281#define KEY_DASHBOARD 204 /* AL Dashboard */
281#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */
282#define KEY_DASHBOARD KEY_ALL_APPLICATIONS
282283#define KEY_SUSPEND 205
283284#define KEY_CLOSE 206 /* AC Close */
284285#define KEY_PLAY 207
......@@ -612,6 +613,10 @@
612613#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
613614#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
614615#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
616#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
617#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
618#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
619#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
615620
616621#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
617622#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
......@@ -660,6 +665,27 @@
660665/* Select an area of screen to be copied */
661666#define KEY_SELECTIVE_SCREENSHOT 0x27a
662667
668/* Move the focus to the next or previous user controllable element within a UI container */
669#define KEY_NEXT_ELEMENT 0x27b
670#define KEY_PREVIOUS_ELEMENT 0x27c
671
672/* Toggle Autopilot engagement */
673#define KEY_AUTOPILOT_ENGAGE_TOGGLE 0x27d
674
675/* Shortcut Keys */
676#define KEY_MARK_WAYPOINT 0x27e
677#define KEY_SOS 0x27f
678#define KEY_NAV_CHART 0x280
679#define KEY_FISHING_CHART 0x281
680#define KEY_SINGLE_RANGE_RADAR 0x282
681#define KEY_DUAL_RANGE_RADAR 0x283
682#define KEY_RADAR_OVERLAY 0x284
683#define KEY_TRADITIONAL_SONAR 0x285
684#define KEY_CLEARVU_SONAR 0x286
685#define KEY_SIDEVU_SONAR 0x287
686#define KEY_NAV_INFO 0x288
687#define KEY_BRIGHTNESS_MENU 0x289
688
663689/*
664690 * Some keyboards have keys which do not have a defined meaning, these keys
665691 * are intended to be programmed / bound to macros by the user. For most
......@@ -839,6 +865,7 @@
839865#define ABS_TOOL_WIDTH 0x1c
840866
841867#define ABS_VOLUME 0x20
868#define ABS_PROFILE 0x21
842869
843870#define ABS_MISC 0x28
844871
lib/libc/include/any-linux-any/linux/input.h+8-4
......@@ -76,10 +76,13 @@ struct input_id {
7676 * Note that input core does not clamp reported values to the
7777 * [minimum, maximum] limits, such task is left to userspace.
7878 *
79 * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z)
80 * is reported in units per millimeter (units/mm), resolution
81 * for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported
82 * in units per radian.
79 * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z,
80 * ABS_MT_POSITION_X, ABS_MT_POSITION_Y) is reported in units
81 * per millimeter (units/mm), resolution for rotational axes
82 * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.
83 * The resolution for the size axes (ABS_MT_TOUCH_MAJOR,
84 * ABS_MT_TOUCH_MINOR, ABS_MT_WIDTH_MAJOR, ABS_MT_WIDTH_MINOR)
85 * is reported in units per millimeter (units/mm).
8386 * When INPUT_PROP_ACCELEROMETER is set the resolution changes.
8487 * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in
8588 * units per g (units/g) and in units per degree per second
......@@ -269,6 +272,7 @@ struct input_mask {
269272#define BUS_RMI 0x1D
270273#define BUS_CEC 0x1E
271274#define BUS_INTEL_ISHTP 0x1F
275#define BUS_AMD_SFH 0x20
272276
273277/*
274278 * MT_TOOL types
lib/libc/include/any-linux-any/linux/io_uring.h+293-9
......@@ -10,6 +10,19 @@
1010
1111#include <linux/fs.h>
1212#include <linux/types.h>
13/*
14 * this file is shared with liburing and that has to autodetect
15 * if linux/time_types.h is available or not, it can
16 * define UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H
17 * if linux/time_types.h is not available
18 */
19#ifndef UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H
20#include <linux/time_types.h>
21#endif
22
23#ifdef __cplusplus
24extern "C" {
25#endif
1326
1427/*
1528 * IO submission data structure (Submission Queue Entry)
......@@ -22,6 +35,10 @@ struct io_uring_sqe {
2235 union {
2336 __u64 off; /* offset into file */
2437 __u64 addr2;
38 struct {
39 __u32 cmd_op;
40 __u32 __pad1;
41 };
2542 };
2643 union {
2744 __u64 addr; /* pointer to buffer or iovecs */
......@@ -45,6 +62,9 @@ struct io_uring_sqe {
4562 __u32 rename_flags;
4663 __u32 unlink_flags;
4764 __u32 hardlink_flags;
65 __u32 xattr_flags;
66 __u32 msg_ring_flags;
67 __u32 uring_cmd_flags;
4868 };
4969 __u64 user_data; /* data to be passed back at completion time */
5070 /* pack this to avoid bogus arm OABI complaints */
......@@ -59,10 +79,33 @@ struct io_uring_sqe {
5979 union {
6080 __s32 splice_fd_in;
6181 __u32 file_index;
82 struct {
83 __u16 addr_len;
84 __u16 __pad3[1];
85 };
86 };
87 union {
88 struct {
89 __u64 addr3;
90 __u64 __pad2[1];
91 };
92 /*
93 * If the ring is initialized with IORING_SETUP_SQE128, then
94 * this field is used for 80 bytes of arbitrary command data
95 */
96 __u8 cmd[0];
6297 };
63 __u64 __pad2[2];
6498};
6599
100/*
101 * If sqe->file_index is set to this for opcodes that instantiate a new
102 * direct descriptor (like openat/openat2/accept), then io_uring will allocate
103 * an available direct descriptor instead of having the application pass one
104 * in. The picked direct descriptor will be returned in cqe->res, or -ENFILE
105 * if the space is full.
106 */
107#define IORING_FILE_INDEX_ALLOC (~0U)
108
66109enum {
67110 IOSQE_FIXED_FILE_BIT,
68111 IOSQE_IO_DRAIN_BIT,
......@@ -70,6 +113,7 @@ enum {
70113 IOSQE_IO_HARDLINK_BIT,
71114 IOSQE_ASYNC_BIT,
72115 IOSQE_BUFFER_SELECT_BIT,
116 IOSQE_CQE_SKIP_SUCCESS_BIT,
73117};
74118
75119/*
......@@ -87,6 +131,8 @@ enum {
87131#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
88132/* select buffer from sqe->buf_group */
89133#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)
134/* don't post CQE if request succeeded */
135#define IOSQE_CQE_SKIP_SUCCESS (1U << IOSQE_CQE_SKIP_SUCCESS_BIT)
90136
91137/*
92138 * io_uring_setup() flags
......@@ -98,8 +144,36 @@ enum {
98144#define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */
99145#define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
100146#define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */
147#define IORING_SETUP_SUBMIT_ALL (1U << 7) /* continue submit on error */
148/*
149 * Cooperative task running. When requests complete, they often require
150 * forcing the submitter to transition to the kernel to complete. If this
151 * flag is set, work will be done when the task transitions anyway, rather
152 * than force an inter-processor interrupt reschedule. This avoids interrupting
153 * a task running in userspace, and saves an IPI.
154 */
155#define IORING_SETUP_COOP_TASKRUN (1U << 8)
156/*
157 * If COOP_TASKRUN is set, get notified if task work is available for
158 * running and a kernel transition would be needed to run it. This sets
159 * IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
160 */
161#define IORING_SETUP_TASKRUN_FLAG (1U << 9)
162#define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */
163#define IORING_SETUP_CQE32 (1U << 11) /* CQEs are 32 byte */
164/*
165 * Only one task is allowed to submit requests
166 */
167#define IORING_SETUP_SINGLE_ISSUER (1U << 12)
101168
102enum {
169/*
170 * Defer running task work to get events.
171 * Rather than running bits of task work whenever the task transitions
172 * try to do it just before it is needed.
173 */
174#define IORING_SETUP_DEFER_TASKRUN (1U << 13)
175
176enum io_uring_op {
103177 IORING_OP_NOP,
104178 IORING_OP_READV,
105179 IORING_OP_WRITEV,
......@@ -140,11 +214,28 @@ enum {
140214 IORING_OP_MKDIRAT,
141215 IORING_OP_SYMLINKAT,
142216 IORING_OP_LINKAT,
217 IORING_OP_MSG_RING,
218 IORING_OP_FSETXATTR,
219 IORING_OP_SETXATTR,
220 IORING_OP_FGETXATTR,
221 IORING_OP_GETXATTR,
222 IORING_OP_SOCKET,
223 IORING_OP_URING_CMD,
224 IORING_OP_SEND_ZC,
225 IORING_OP_SENDMSG_ZC,
143226
144227 /* this goes last, obviously */
145228 IORING_OP_LAST,
146229};
147230
231/*
232 * sqe->uring_cmd_flags
233 * IORING_URING_CMD_FIXED use registered buffer; pass this flag
234 * along with setting sqe->buf_index.
235 */
236#define IORING_URING_CMD_FIXED (1U << 0)
237
238
148239/*
149240 * sqe->fsync_flags
150241 */
......@@ -177,10 +268,87 @@ enum {
177268 *
178269 * IORING_POLL_UPDATE Update existing poll request, matching
179270 * sqe->addr as the old user_data field.
271 *
272 * IORING_POLL_LEVEL Level triggered poll.
180273 */
181274#define IORING_POLL_ADD_MULTI (1U << 0)
182275#define IORING_POLL_UPDATE_EVENTS (1U << 1)
183276#define IORING_POLL_UPDATE_USER_DATA (1U << 2)
277#define IORING_POLL_ADD_LEVEL (1U << 3)
278
279/*
280 * ASYNC_CANCEL flags.
281 *
282 * IORING_ASYNC_CANCEL_ALL Cancel all requests that match the given key
283 * IORING_ASYNC_CANCEL_FD Key off 'fd' for cancelation rather than the
284 * request 'user_data'
285 * IORING_ASYNC_CANCEL_ANY Match any request
286 * IORING_ASYNC_CANCEL_FD_FIXED 'fd' passed in is a fixed descriptor
287 */
288#define IORING_ASYNC_CANCEL_ALL (1U << 0)
289#define IORING_ASYNC_CANCEL_FD (1U << 1)
290#define IORING_ASYNC_CANCEL_ANY (1U << 2)
291#define IORING_ASYNC_CANCEL_FD_FIXED (1U << 3)
292
293/*
294 * send/sendmsg and recv/recvmsg flags (sqe->ioprio)
295 *
296 * IORING_RECVSEND_POLL_FIRST If set, instead of first attempting to send
297 * or receive and arm poll if that yields an
298 * -EAGAIN result, arm poll upfront and skip
299 * the initial transfer attempt.
300 *
301 * IORING_RECV_MULTISHOT Multishot recv. Sets IORING_CQE_F_MORE if
302 * the handler will continue to report
303 * CQEs on behalf of the same SQE.
304 *
305 * IORING_RECVSEND_FIXED_BUF Use registered buffers, the index is stored in
306 * the buf_index field.
307 *
308 * IORING_SEND_ZC_REPORT_USAGE
309 * If set, SEND[MSG]_ZC should report
310 * the zerocopy usage in cqe.res
311 * for the IORING_CQE_F_NOTIF cqe.
312 * 0 is reported if zerocopy was actually possible.
313 * IORING_NOTIF_USAGE_ZC_COPIED if data was copied
314 * (at least partially).
315 */
316#define IORING_RECVSEND_POLL_FIRST (1U << 0)
317#define IORING_RECV_MULTISHOT (1U << 1)
318#define IORING_RECVSEND_FIXED_BUF (1U << 2)
319#define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
320
321/*
322 * cqe.res for IORING_CQE_F_NOTIF if
323 * IORING_SEND_ZC_REPORT_USAGE was requested
324 *
325 * It should be treated as a flag, all other
326 * bits of cqe.res should be treated as reserved!
327 */
328#define IORING_NOTIF_USAGE_ZC_COPIED (1U << 31)
329
330/*
331 * accept flags stored in sqe->ioprio
332 */
333#define IORING_ACCEPT_MULTISHOT (1U << 0)
334
335/*
336 * IORING_OP_MSG_RING command types, stored in sqe->addr
337 */
338enum {
339 IORING_MSG_DATA, /* pass sqe->len as 'res' and off as user_data */
340 IORING_MSG_SEND_FD, /* send a registered fd to another ring */
341};
342
343/*
344 * IORING_OP_MSG_RING flags (sqe->msg_ring_flags)
345 *
346 * IORING_MSG_RING_CQE_SKIP Don't post a CQE to the target ring. Not
347 * applicable for IORING_MSG_DATA, obviously.
348 */
349#define IORING_MSG_RING_CQE_SKIP (1U << 0)
350/* Pass through the flags from sqe->file_index to cqe->flags */
351#define IORING_MSG_RING_FLAGS_PASS (1U << 1)
184352
185353/*
186354 * IO completion data structure (Completion Queue Entry)
......@@ -189,6 +357,12 @@ struct io_uring_cqe {
189357 __u64 user_data; /* sqe->data submission passed back */
190358 __s32 res; /* result code for this event */
191359 __u32 flags;
360
361 /*
362 * If the ring is initialized with IORING_SETUP_CQE32, then this field
363 * contains 16-bytes of padding, doubling the size of the CQE.
364 */
365 __u64 big_cqe[];
192366};
193367
194368/*
......@@ -196,9 +370,14 @@ struct io_uring_cqe {
196370 *
197371 * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
198372 * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries
373 * IORING_CQE_F_SOCK_NONEMPTY If set, more data to read after socket recv
374 * IORING_CQE_F_NOTIF Set for notification CQEs. Can be used to distinct
375 * them from sends.
199376 */
200377#define IORING_CQE_F_BUFFER (1U << 0)
201378#define IORING_CQE_F_MORE (1U << 1)
379#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
380#define IORING_CQE_F_NOTIF (1U << 3)
202381
203382enum {
204383 IORING_CQE_BUFFER_SHIFT = 16,
......@@ -231,6 +410,7 @@ struct io_sqring_offsets {
231410 */
232411#define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */
233412#define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */
413#define IORING_SQ_TASKRUN (1U << 2) /* task should enter the kernel */
234414
235415struct io_cqring_offsets {
236416 __u32 head;
......@@ -254,10 +434,11 @@ struct io_cqring_offsets {
254434/*
255435 * io_uring_enter(2) flags
256436 */
257#define IORING_ENTER_GETEVENTS (1U << 0)
258#define IORING_ENTER_SQ_WAKEUP (1U << 1)
259#define IORING_ENTER_SQ_WAIT (1U << 2)
260#define IORING_ENTER_EXT_ARG (1U << 3)
437#define IORING_ENTER_GETEVENTS (1U << 0)
438#define IORING_ENTER_SQ_WAKEUP (1U << 1)
439#define IORING_ENTER_SQ_WAIT (1U << 2)
440#define IORING_ENTER_EXT_ARG (1U << 3)
441#define IORING_ENTER_REGISTERED_RING (1U << 4)
261442
262443/*
263444 * Passed in for io_uring_setup(2). Copied back with updated info on success
......@@ -289,6 +470,9 @@ struct io_uring_params {
289470#define IORING_FEAT_EXT_ARG (1U << 8)
290471#define IORING_FEAT_NATIVE_WORKERS (1U << 9)
291472#define IORING_FEAT_RSRC_TAGS (1U << 10)
473#define IORING_FEAT_CQE_SKIP (1U << 11)
474#define IORING_FEAT_LINKED_FILE (1U << 12)
475#define IORING_FEAT_REG_REG_RING (1U << 13)
292476
293477/*
294478 * io_uring_register(2) opcodes and arguments
......@@ -321,8 +505,25 @@ enum {
321505 /* set/get max number of io-wq workers */
322506 IORING_REGISTER_IOWQ_MAX_WORKERS = 19,
323507
508 /* register/unregister io_uring fd with the ring */
509 IORING_REGISTER_RING_FDS = 20,
510 IORING_UNREGISTER_RING_FDS = 21,
511
512 /* register ring based provide buffer group */
513 IORING_REGISTER_PBUF_RING = 22,
514 IORING_UNREGISTER_PBUF_RING = 23,
515
516 /* sync cancelation API */
517 IORING_REGISTER_SYNC_CANCEL = 24,
518
519 /* register a range of fixed file slots for automatic slot allocation */
520 IORING_REGISTER_FILE_ALLOC_RANGE = 25,
521
324522 /* this goes last */
325 IORING_REGISTER_LAST
523 IORING_REGISTER_LAST,
524
525 /* flag added to the opcode to use a registered ring fd */
526 IORING_REGISTER_USE_REGISTERED_RING = 1U << 31
326527};
327528
328529/* io-wq worker categories */
......@@ -338,9 +539,15 @@ struct io_uring_files_update {
338539 __aligned_u64 /* __s32 * */ fds;
339540};
340541
542/*
543 * Register a fully sparse file space, rather than pass in an array of all
544 * -1 file descriptors.
545 */
546#define IORING_RSRC_REGISTER_SPARSE (1U << 0)
547
341548struct io_uring_rsrc_register {
342549 __u32 nr;
343 __u32 resv;
550 __u32 flags;
344551 __u64 resv2;
345552 __aligned_u64 data;
346553 __aligned_u64 tags;
......@@ -361,6 +568,19 @@ struct io_uring_rsrc_update2 {
361568 __u32 resv2;
362569};
363570
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
364584/* Skip updating fd indexes set to this value in the fd table */
365585#define IORING_REGISTER_FILES_SKIP (-2)
366586
......@@ -378,7 +598,7 @@ struct io_uring_probe {
378598 __u8 ops_len; /* length of ops[] array below */
379599 __u16 resv;
380600 __u32 resv2[3];
381 struct io_uring_probe_op ops[0];
601 struct io_uring_probe_op ops[];
382602};
383603
384604struct io_uring_restriction {
......@@ -392,6 +612,38 @@ struct io_uring_restriction {
392612 __u32 resv2[3];
393613};
394614
615struct io_uring_buf {
616 __u64 addr;
617 __u32 len;
618 __u16 bid;
619 __u16 resv;
620};
621
622struct io_uring_buf_ring {
623 union {
624 /*
625 * To avoid spilling into more pages than we need to, the
626 * ring tail is overlaid with the io_uring_buf->resv field.
627 */
628 struct {
629 __u64 resv1;
630 __u32 resv2;
631 __u16 resv3;
632 __u16 tail;
633 };
634 __DECLARE_FLEX_ARRAY(struct io_uring_buf, bufs);
635 };
636};
637
638/* argument for IORING_(UN)REGISTER_PBUF_RING */
639struct io_uring_buf_reg {
640 __u64 ring_addr;
641 __u32 ring_entries;
642 __u16 bgid;
643 __u16 pad;
644 __u64 resv[3];
645};
646
395647/*
396648 * io_uring_restriction->opcode values
397649 */
......@@ -418,4 +670,36 @@ struct io_uring_getevents_arg {
418670 __u64 ts;
419671};
420672
673/*
674 * Argument for IORING_REGISTER_SYNC_CANCEL
675 */
676struct io_uring_sync_cancel_reg {
677 __u64 addr;
678 __s32 fd;
679 __u32 flags;
680 struct __kernel_timespec timeout;
681 __u64 pad[4];
682};
683
684/*
685 * Argument for IORING_REGISTER_FILE_ALLOC_RANGE
686 * The range is specified as [off, off + len)
687 */
688struct io_uring_file_index_range {
689 __u32 off;
690 __u32 len;
691 __u64 resv;
692};
693
694struct io_uring_recvmsg_out {
695 __u32 namelen;
696 __u32 controllen;
697 __u32 payloadlen;
698 __u32 flags;
699};
700
701#ifdef __cplusplus
702}
703#endif
704
421705#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioam6.h+1-1
......@@ -127,7 +127,7 @@ struct ioam6_trace_hdr {
127127#endif
128128
129129#define IOAM6_TRACE_DATA_SIZE_MAX 244
130 __u8 data[0];
130 __u8 data[];
131131} __attribute__((packed));
132132
133133#endif /* _LINUX_IOAM6_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ioam6_iptunnel.h+9
......@@ -41,6 +41,15 @@ enum {
4141 /* IOAM Trace Header */
4242 IOAM6_IPTUNNEL_TRACE, /* struct ioam6_trace_hdr */
4343
44 /* Insertion frequency:
45 * "k over n" packets (0 < k <= n)
46 * [0.0001% ... 100%]
47 */
48#define IOAM6_IPTUNNEL_FREQ_MIN 1
49#define IOAM6_IPTUNNEL_FREQ_MAX 1000000
50 IOAM6_IPTUNNEL_FREQ_K, /* u32 */
51 IOAM6_IPTUNNEL_FREQ_N, /* u32 */
52
4453 __IOAM6_IPTUNNEL_MAX,
4554};
4655
lib/libc/include/any-linux-any/linux/iommu.h-181
......@@ -158,185 +158,4 @@ struct iommu_page_response {
158158 __u32 code;
159159};
160160
161/* defines the granularity of the invalidation */
162enum iommu_inv_granularity {
163 IOMMU_INV_GRANU_DOMAIN, /* domain-selective invalidation */
164 IOMMU_INV_GRANU_PASID, /* PASID-selective invalidation */
165 IOMMU_INV_GRANU_ADDR, /* page-selective invalidation */
166 IOMMU_INV_GRANU_NR, /* number of invalidation granularities */
167};
168
169/**
170 * struct iommu_inv_addr_info - Address Selective Invalidation Structure
171 *
172 * @flags: indicates the granularity of the address-selective invalidation
173 * - If the PASID bit is set, the @pasid field is populated and the invalidation
174 * relates to cache entries tagged with this PASID and matching the address
175 * range.
176 * - If ARCHID bit is set, @archid is populated and the invalidation relates
177 * to cache entries tagged with this architecture specific ID and matching
178 * the address range.
179 * - Both PASID and ARCHID can be set as they may tag different caches.
180 * - If neither PASID or ARCHID is set, global addr invalidation applies.
181 * - The LEAF flag indicates whether only the leaf PTE caching needs to be
182 * invalidated and other paging structure caches can be preserved.
183 * @pasid: process address space ID
184 * @archid: architecture-specific ID
185 * @addr: first stage/level input address
186 * @granule_size: page/block size of the mapping in bytes
187 * @nb_granules: number of contiguous granules to be invalidated
188 */
189struct iommu_inv_addr_info {
190#define IOMMU_INV_ADDR_FLAGS_PASID (1 << 0)
191#define IOMMU_INV_ADDR_FLAGS_ARCHID (1 << 1)
192#define IOMMU_INV_ADDR_FLAGS_LEAF (1 << 2)
193 __u32 flags;
194 __u32 archid;
195 __u64 pasid;
196 __u64 addr;
197 __u64 granule_size;
198 __u64 nb_granules;
199};
200
201/**
202 * struct iommu_inv_pasid_info - PASID Selective Invalidation Structure
203 *
204 * @flags: indicates the granularity of the PASID-selective invalidation
205 * - If the PASID bit is set, the @pasid field is populated and the invalidation
206 * relates to cache entries tagged with this PASID and matching the address
207 * range.
208 * - If the ARCHID bit is set, the @archid is populated and the invalidation
209 * relates to cache entries tagged with this architecture specific ID and
210 * matching the address range.
211 * - Both PASID and ARCHID can be set as they may tag different caches.
212 * - At least one of PASID or ARCHID must be set.
213 * @pasid: process address space ID
214 * @archid: architecture-specific ID
215 */
216struct iommu_inv_pasid_info {
217#define IOMMU_INV_PASID_FLAGS_PASID (1 << 0)
218#define IOMMU_INV_PASID_FLAGS_ARCHID (1 << 1)
219 __u32 flags;
220 __u32 archid;
221 __u64 pasid;
222};
223
224/**
225 * struct iommu_cache_invalidate_info - First level/stage invalidation
226 * information
227 * @argsz: User filled size of this data
228 * @version: API version of this structure
229 * @cache: bitfield that allows to select which caches to invalidate
230 * @granularity: defines the lowest granularity used for the invalidation:
231 * domain > PASID > addr
232 * @padding: reserved for future use (should be zero)
233 * @pasid_info: invalidation data when @granularity is %IOMMU_INV_GRANU_PASID
234 * @addr_info: invalidation data when @granularity is %IOMMU_INV_GRANU_ADDR
235 *
236 * Not all the combinations of cache/granularity are valid:
237 *
238 * +--------------+---------------+---------------+---------------+
239 * | type / | DEV_IOTLB | IOTLB | PASID |
240 * | granularity | | | cache |
241 * +==============+===============+===============+===============+
242 * | DOMAIN | N/A | Y | Y |
243 * +--------------+---------------+---------------+---------------+
244 * | PASID | Y | Y | Y |
245 * +--------------+---------------+---------------+---------------+
246 * | ADDR | Y | Y | N/A |
247 * +--------------+---------------+---------------+---------------+
248 *
249 * Invalidations by %IOMMU_INV_GRANU_DOMAIN don't take any argument other than
250 * @version and @cache.
251 *
252 * If multiple cache types are invalidated simultaneously, they all
253 * must support the used granularity.
254 */
255struct iommu_cache_invalidate_info {
256 __u32 argsz;
257#define IOMMU_CACHE_INVALIDATE_INFO_VERSION_1 1
258 __u32 version;
259/* IOMMU paging structure cache */
260#define IOMMU_CACHE_INV_TYPE_IOTLB (1 << 0) /* IOMMU IOTLB */
261#define IOMMU_CACHE_INV_TYPE_DEV_IOTLB (1 << 1) /* Device IOTLB */
262#define IOMMU_CACHE_INV_TYPE_PASID (1 << 2) /* PASID cache */
263#define IOMMU_CACHE_INV_TYPE_NR (3)
264 __u8 cache;
265 __u8 granularity;
266 __u8 padding[6];
267 union {
268 struct iommu_inv_pasid_info pasid_info;
269 struct iommu_inv_addr_info addr_info;
270 } granu;
271};
272
273/**
274 * struct iommu_gpasid_bind_data_vtd - Intel VT-d specific data on device and guest
275 * SVA binding.
276 *
277 * @flags: VT-d PASID table entry attributes
278 * @pat: Page attribute table data to compute effective memory type
279 * @emt: Extended memory type
280 *
281 * Only guest vIOMMU selectable and effective options are passed down to
282 * the host IOMMU.
283 */
284struct iommu_gpasid_bind_data_vtd {
285#define IOMMU_SVA_VTD_GPASID_SRE (1 << 0) /* supervisor request */
286#define IOMMU_SVA_VTD_GPASID_EAFE (1 << 1) /* extended access enable */
287#define IOMMU_SVA_VTD_GPASID_PCD (1 << 2) /* page-level cache disable */
288#define IOMMU_SVA_VTD_GPASID_PWT (1 << 3) /* page-level write through */
289#define IOMMU_SVA_VTD_GPASID_EMTE (1 << 4) /* extended mem type enable */
290#define IOMMU_SVA_VTD_GPASID_CD (1 << 5) /* PASID-level cache disable */
291#define IOMMU_SVA_VTD_GPASID_WPE (1 << 6) /* Write protect enable */
292#define IOMMU_SVA_VTD_GPASID_LAST (1 << 7)
293 __u64 flags;
294 __u32 pat;
295 __u32 emt;
296};
297
298#define IOMMU_SVA_VTD_GPASID_MTS_MASK (IOMMU_SVA_VTD_GPASID_CD | \
299 IOMMU_SVA_VTD_GPASID_EMTE | \
300 IOMMU_SVA_VTD_GPASID_PCD | \
301 IOMMU_SVA_VTD_GPASID_PWT)
302
303/**
304 * struct iommu_gpasid_bind_data - Information about device and guest PASID binding
305 * @argsz: User filled size of this data
306 * @version: Version of this data structure
307 * @format: PASID table entry format
308 * @flags: Additional information on guest bind request
309 * @gpgd: Guest page directory base of the guest mm to bind
310 * @hpasid: Process address space ID used for the guest mm in host IOMMU
311 * @gpasid: Process address space ID used for the guest mm in guest IOMMU
312 * @addr_width: Guest virtual address width
313 * @padding: Reserved for future use (should be zero)
314 * @vtd: Intel VT-d specific data
315 *
316 * Guest to host PASID mapping can be an identity or non-identity, where guest
317 * has its own PASID space. For non-identify mapping, guest to host PASID lookup
318 * is needed when VM programs guest PASID into an assigned device. VMM may
319 * trap such PASID programming then request host IOMMU driver to convert guest
320 * PASID to host PASID based on this bind data.
321 */
322struct iommu_gpasid_bind_data {
323 __u32 argsz;
324#define IOMMU_GPASID_BIND_VERSION_1 1
325 __u32 version;
326#define IOMMU_PASID_FORMAT_INTEL_VTD 1
327#define IOMMU_PASID_FORMAT_LAST 2
328 __u32 format;
329 __u32 addr_width;
330#define IOMMU_SVA_GPASID_VAL (1 << 0) /* guest PASID valid */
331 __u64 flags;
332 __u64 gpgd;
333 __u64 hpasid;
334 __u64 gpasid;
335 __u8 padding[8];
336 /* Vendor specific data */
337 union {
338 struct iommu_gpasid_bind_data_vtd vtd;
339 } vendor;
340};
341
342161#endif /* _IOMMU_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommufd.h created+347
......@@ -0,0 +1,347 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES.
3 */
4#ifndef _IOMMUFD_H
5#define _IOMMUFD_H
6
7#include <linux/types.h>
8#include <linux/ioctl.h>
9
10#define IOMMUFD_TYPE (';')
11
12/**
13 * DOC: General ioctl format
14 *
15 * The ioctl interface follows a general format to allow for extensibility. Each
16 * ioctl is passed in a structure pointer as the argument providing the size of
17 * the structure in the first u32. The kernel checks that any structure space
18 * beyond what it understands is 0. This allows userspace to use the backward
19 * compatible portion while consistently using the newer, larger, structures.
20 *
21 * ioctls use a standard meaning for common errnos:
22 *
23 * - ENOTTY: The IOCTL number itself is not supported at all
24 * - E2BIG: The IOCTL number is supported, but the provided structure has
25 * non-zero in a part the kernel does not understand.
26 * - EOPNOTSUPP: The IOCTL number is supported, and the structure is
27 * understood, however a known field has a value the kernel does not
28 * understand or support.
29 * - EINVAL: Everything about the IOCTL was understood, but a field is not
30 * correct.
31 * - ENOENT: An ID or IOVA provided does not exist.
32 * - ENOMEM: Out of memory.
33 * - EOVERFLOW: Mathematics overflowed.
34 *
35 * As well as additional errnos, within specific ioctls.
36 */
37enum {
38 IOMMUFD_CMD_BASE = 0x80,
39 IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE,
40 IOMMUFD_CMD_IOAS_ALLOC,
41 IOMMUFD_CMD_IOAS_ALLOW_IOVAS,
42 IOMMUFD_CMD_IOAS_COPY,
43 IOMMUFD_CMD_IOAS_IOVA_RANGES,
44 IOMMUFD_CMD_IOAS_MAP,
45 IOMMUFD_CMD_IOAS_UNMAP,
46 IOMMUFD_CMD_OPTION,
47 IOMMUFD_CMD_VFIO_IOAS,
48};
49
50/**
51 * struct iommu_destroy - ioctl(IOMMU_DESTROY)
52 * @size: sizeof(struct iommu_destroy)
53 * @id: iommufd object ID to destroy. Can be any destroyable object type.
54 *
55 * Destroy any object held within iommufd.
56 */
57struct iommu_destroy {
58 __u32 size;
59 __u32 id;
60};
61#define IOMMU_DESTROY _IO(IOMMUFD_TYPE, IOMMUFD_CMD_DESTROY)
62
63/**
64 * struct iommu_ioas_alloc - ioctl(IOMMU_IOAS_ALLOC)
65 * @size: sizeof(struct iommu_ioas_alloc)
66 * @flags: Must be 0
67 * @out_ioas_id: Output IOAS ID for the allocated object
68 *
69 * Allocate an IO Address Space (IOAS) which holds an IO Virtual Address (IOVA)
70 * to memory mapping.
71 */
72struct iommu_ioas_alloc {
73 __u32 size;
74 __u32 flags;
75 __u32 out_ioas_id;
76};
77#define IOMMU_IOAS_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_ALLOC)
78
79/**
80 * struct iommu_iova_range - ioctl(IOMMU_IOVA_RANGE)
81 * @start: First IOVA
82 * @last: Inclusive last IOVA
83 *
84 * An interval in IOVA space.
85 */
86struct iommu_iova_range {
87 __aligned_u64 start;
88 __aligned_u64 last;
89};
90
91/**
92 * struct iommu_ioas_iova_ranges - ioctl(IOMMU_IOAS_IOVA_RANGES)
93 * @size: sizeof(struct iommu_ioas_iova_ranges)
94 * @ioas_id: IOAS ID to read ranges from
95 * @num_iovas: Input/Output total number of ranges in the IOAS
96 * @__reserved: Must be 0
97 * @allowed_iovas: Pointer to the output array of struct iommu_iova_range
98 * @out_iova_alignment: Minimum alignment required for mapping IOVA
99 *
100 * Query an IOAS for ranges of allowed IOVAs. Mapping IOVA outside these ranges
101 * is not allowed. num_iovas will be set to the total number of iovas and
102 * the allowed_iovas[] will be filled in as space permits.
103 *
104 * The allowed ranges are dependent on the HW path the DMA operation takes, and
105 * can change during the lifetime of the IOAS. A fresh empty IOAS will have a
106 * full range, and each attached device will narrow the ranges based on that
107 * device's HW restrictions. Detaching a device can widen the ranges. Userspace
108 * should query ranges after every attach/detach to know what IOVAs are valid
109 * for mapping.
110 *
111 * On input num_iovas is the length of the allowed_iovas array. On output it is
112 * the total number of iovas filled in. The ioctl will return -EMSGSIZE and set
113 * num_iovas to the required value if num_iovas is too small. In this case the
114 * caller should allocate a larger output array and re-issue the ioctl.
115 *
116 * out_iova_alignment returns the minimum IOVA alignment that can be given
117 * to IOMMU_IOAS_MAP/COPY. IOVA's must satisfy::
118 *
119 * starting_iova % out_iova_alignment == 0
120 * (starting_iova + length) % out_iova_alignment == 0
121 *
122 * out_iova_alignment can be 1 indicating any IOVA is allowed. It cannot
123 * be higher than the system PAGE_SIZE.
124 */
125struct iommu_ioas_iova_ranges {
126 __u32 size;
127 __u32 ioas_id;
128 __u32 num_iovas;
129 __u32 __reserved;
130 __aligned_u64 allowed_iovas;
131 __aligned_u64 out_iova_alignment;
132};
133#define IOMMU_IOAS_IOVA_RANGES _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_IOVA_RANGES)
134
135/**
136 * struct iommu_ioas_allow_iovas - ioctl(IOMMU_IOAS_ALLOW_IOVAS)
137 * @size: sizeof(struct iommu_ioas_allow_iovas)
138 * @ioas_id: IOAS ID to allow IOVAs from
139 * @num_iovas: Input/Output total number of ranges in the IOAS
140 * @__reserved: Must be 0
141 * @allowed_iovas: Pointer to array of struct iommu_iova_range
142 *
143 * Ensure a range of IOVAs are always available for allocation. If this call
144 * succeeds then IOMMU_IOAS_IOVA_RANGES will never return a list of IOVA ranges
145 * that are narrower than the ranges provided here. This call will fail if
146 * IOMMU_IOAS_IOVA_RANGES is currently narrower than the given ranges.
147 *
148 * When an IOAS is first created the IOVA_RANGES will be maximally sized, and as
149 * devices are attached the IOVA will narrow based on the device restrictions.
150 * When an allowed range is specified any narrowing will be refused, ie device
151 * attachment can fail if the device requires limiting within the allowed range.
152 *
153 * Automatic IOVA allocation is also impacted by this call. MAP will only
154 * allocate within the allowed IOVAs if they are present.
155 *
156 * This call replaces the entire allowed list with the given list.
157 */
158struct iommu_ioas_allow_iovas {
159 __u32 size;
160 __u32 ioas_id;
161 __u32 num_iovas;
162 __u32 __reserved;
163 __aligned_u64 allowed_iovas;
164};
165#define IOMMU_IOAS_ALLOW_IOVAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_ALLOW_IOVAS)
166
167/**
168 * enum iommufd_ioas_map_flags - Flags for map and copy
169 * @IOMMU_IOAS_MAP_FIXED_IOVA: If clear the kernel will compute an appropriate
170 * IOVA to place the mapping at
171 * @IOMMU_IOAS_MAP_WRITEABLE: DMA is allowed to write to this mapping
172 * @IOMMU_IOAS_MAP_READABLE: DMA is allowed to read from this mapping
173 */
174enum iommufd_ioas_map_flags {
175 IOMMU_IOAS_MAP_FIXED_IOVA = 1 << 0,
176 IOMMU_IOAS_MAP_WRITEABLE = 1 << 1,
177 IOMMU_IOAS_MAP_READABLE = 1 << 2,
178};
179
180/**
181 * struct iommu_ioas_map - ioctl(IOMMU_IOAS_MAP)
182 * @size: sizeof(struct iommu_ioas_map)
183 * @flags: Combination of enum iommufd_ioas_map_flags
184 * @ioas_id: IOAS ID to change the mapping of
185 * @__reserved: Must be 0
186 * @user_va: Userspace pointer to start mapping from
187 * @length: Number of bytes to map
188 * @iova: IOVA the mapping was placed at. If IOMMU_IOAS_MAP_FIXED_IOVA is set
189 * then this must be provided as input.
190 *
191 * Set an IOVA mapping from a user pointer. If FIXED_IOVA is specified then the
192 * mapping will be established at iova, otherwise a suitable location based on
193 * the reserved and allowed lists will be automatically selected and returned in
194 * iova.
195 *
196 * If IOMMU_IOAS_MAP_FIXED_IOVA is specified then the iova range must currently
197 * be unused, existing IOVA cannot be replaced.
198 */
199struct iommu_ioas_map {
200 __u32 size;
201 __u32 flags;
202 __u32 ioas_id;
203 __u32 __reserved;
204 __aligned_u64 user_va;
205 __aligned_u64 length;
206 __aligned_u64 iova;
207};
208#define IOMMU_IOAS_MAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP)
209
210/**
211 * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY)
212 * @size: sizeof(struct iommu_ioas_copy)
213 * @flags: Combination of enum iommufd_ioas_map_flags
214 * @dst_ioas_id: IOAS ID to change the mapping of
215 * @src_ioas_id: IOAS ID to copy from
216 * @length: Number of bytes to copy and map
217 * @dst_iova: IOVA the mapping was placed at. If IOMMU_IOAS_MAP_FIXED_IOVA is
218 * set then this must be provided as input.
219 * @src_iova: IOVA to start the copy
220 *
221 * Copy an already existing mapping from src_ioas_id and establish it in
222 * dst_ioas_id. The src iova/length must exactly match a range used with
223 * IOMMU_IOAS_MAP.
224 *
225 * This may be used to efficiently clone a subset of an IOAS to another, or as a
226 * kind of 'cache' to speed up mapping. Copy has an efficiency advantage over
227 * establishing equivalent new mappings, as internal resources are shared, and
228 * the kernel will pin the user memory only once.
229 */
230struct iommu_ioas_copy {
231 __u32 size;
232 __u32 flags;
233 __u32 dst_ioas_id;
234 __u32 src_ioas_id;
235 __aligned_u64 length;
236 __aligned_u64 dst_iova;
237 __aligned_u64 src_iova;
238};
239#define IOMMU_IOAS_COPY _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_COPY)
240
241/**
242 * struct iommu_ioas_unmap - ioctl(IOMMU_IOAS_UNMAP)
243 * @size: sizeof(struct iommu_ioas_unmap)
244 * @ioas_id: IOAS ID to change the mapping of
245 * @iova: IOVA to start the unmapping at
246 * @length: Number of bytes to unmap, and return back the bytes unmapped
247 *
248 * Unmap an IOVA range. The iova/length must be a superset of a previously
249 * mapped range used with IOMMU_IOAS_MAP or IOMMU_IOAS_COPY. Splitting or
250 * truncating ranges is not allowed. The values 0 to U64_MAX will unmap
251 * everything.
252 */
253struct iommu_ioas_unmap {
254 __u32 size;
255 __u32 ioas_id;
256 __aligned_u64 iova;
257 __aligned_u64 length;
258};
259#define IOMMU_IOAS_UNMAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_UNMAP)
260
261/**
262 * enum iommufd_option - ioctl(IOMMU_OPTION_RLIMIT_MODE) and
263 * ioctl(IOMMU_OPTION_HUGE_PAGES)
264 * @IOMMU_OPTION_RLIMIT_MODE:
265 * Change how RLIMIT_MEMLOCK accounting works. The caller must have privilege
266 * to invoke this. Value 0 (default) is user based accouting, 1 uses process
267 * based accounting. Global option, object_id must be 0
268 * @IOMMU_OPTION_HUGE_PAGES:
269 * Value 1 (default) allows contiguous pages to be combined when generating
270 * iommu mappings. Value 0 disables combining, everything is mapped to
271 * PAGE_SIZE. This can be useful for benchmarking. This is a per-IOAS
272 * option, the object_id must be the IOAS ID.
273 */
274enum iommufd_option {
275 IOMMU_OPTION_RLIMIT_MODE = 0,
276 IOMMU_OPTION_HUGE_PAGES = 1,
277};
278
279/**
280 * enum iommufd_option_ops - ioctl(IOMMU_OPTION_OP_SET) and
281 * ioctl(IOMMU_OPTION_OP_GET)
282 * @IOMMU_OPTION_OP_SET: Set the option's value
283 * @IOMMU_OPTION_OP_GET: Get the option's value
284 */
285enum iommufd_option_ops {
286 IOMMU_OPTION_OP_SET = 0,
287 IOMMU_OPTION_OP_GET = 1,
288};
289
290/**
291 * struct iommu_option - iommu option multiplexer
292 * @size: sizeof(struct iommu_option)
293 * @option_id: One of enum iommufd_option
294 * @op: One of enum iommufd_option_ops
295 * @__reserved: Must be 0
296 * @object_id: ID of the object if required
297 * @val64: Option value to set or value returned on get
298 *
299 * Change a simple option value. This multiplexor allows controlling options
300 * on objects. IOMMU_OPTION_OP_SET will load an option and IOMMU_OPTION_OP_GET
301 * will return the current value.
302 */
303struct iommu_option {
304 __u32 size;
305 __u32 option_id;
306 __u16 op;
307 __u16 __reserved;
308 __u32 object_id;
309 __aligned_u64 val64;
310};
311#define IOMMU_OPTION _IO(IOMMUFD_TYPE, IOMMUFD_CMD_OPTION)
312
313/**
314 * enum iommufd_vfio_ioas_op - IOMMU_VFIO_IOAS_* ioctls
315 * @IOMMU_VFIO_IOAS_GET: Get the current compatibility IOAS
316 * @IOMMU_VFIO_IOAS_SET: Change the current compatibility IOAS
317 * @IOMMU_VFIO_IOAS_CLEAR: Disable VFIO compatibility
318 */
319enum iommufd_vfio_ioas_op {
320 IOMMU_VFIO_IOAS_GET = 0,
321 IOMMU_VFIO_IOAS_SET = 1,
322 IOMMU_VFIO_IOAS_CLEAR = 2,
323};
324
325/**
326 * struct iommu_vfio_ioas - ioctl(IOMMU_VFIO_IOAS)
327 * @size: sizeof(struct iommu_vfio_ioas)
328 * @ioas_id: For IOMMU_VFIO_IOAS_SET the input IOAS ID to set
329 * For IOMMU_VFIO_IOAS_GET will output the IOAS ID
330 * @op: One of enum iommufd_vfio_ioas_op
331 * @__reserved: Must be 0
332 *
333 * The VFIO compatibility support uses a single ioas because VFIO APIs do not
334 * support the ID field. Set or Get the IOAS that VFIO compatibility will use.
335 * When VFIO_GROUP_SET_CONTAINER is used on an iommufd it will get the
336 * compatibility ioas, either by taking what is already set, or auto creating
337 * one. From then on VFIO will continue to use that ioas and is not effected by
338 * this ioctl. SET or CLEAR does not destroy any auto-created IOAS.
339 */
340struct iommu_vfio_ioas {
341 __u32 size;
342 __u32 ioas_id;
343 __u16 op;
344 __u16 __reserved;
345};
346#define IOMMU_VFIO_IOAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VFIO_IOAS)
347#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ip.h+7-4
......@@ -18,6 +18,7 @@
1818#ifndef _LINUX_IP_H
1919#define _LINUX_IP_H
2020#include <linux/types.h>
21#include <linux/stddef.h>
2122#include <asm/byteorder.h>
2223
2324#define IPTOS_TOS_MASK 0x1E
......@@ -100,8 +101,10 @@ struct iphdr {
100101 __u8 ttl;
101102 __u8 protocol;
102103 __sum16 check;
103 __be32 saddr;
104 __be32 daddr;
104 __struct_group(/* no tag */, addrs, /* no attrs */,
105 __be32 saddr;
106 __be32 daddr;
107 );
105108 /*The options start here. */
106109};
107110
......@@ -112,13 +115,13 @@ struct ip_auth_hdr {
112115 __be16 reserved;
113116 __be32 spi;
114117 __be32 seq_no; /* Sequence number */
115 __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
118 __u8 auth_data[]; /* Variable len but >=4. Mind the 64 bit alignment! */
116119};
117120
118121struct ip_esp_hdr {
119122 __be32 spi;
120123 __be32 seq_no; /* Sequence number */
121 __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
124 __u8 enc_data[]; /* Variable len but >=8. Mind the 64 bit alignment! */
122125};
123126
124127struct ip_comp_hdr {
lib/libc/include/any-linux-any/linux/ip_vs.h+2-2
......@@ -254,7 +254,7 @@ struct ip_vs_get_dests {
254254 unsigned int num_dests;
255255
256256 /* the real servers */
257 struct ip_vs_dest_entry entrytable[0];
257 struct ip_vs_dest_entry entrytable[];
258258};
259259
260260
......@@ -264,7 +264,7 @@ struct ip_vs_get_services {
264264 unsigned int num_services;
265265
266266 /* service table */
267 struct ip_vs_service_entry entrytable[0];
267 struct ip_vs_service_entry entrytable[];
268268};
269269
270270
lib/libc/include/any-linux-any/linux/ipmi_ssif_bmc.h created+18
......@@ -0,0 +1,18 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note*/
2/*
3 * Copyright (c) 2022, Ampere Computing LLC.
4 */
5
6#ifndef _LINUX_IPMI_SSIF_BMC_H
7#define _LINUX_IPMI_SSIF_BMC_H
8
9#include <linux/types.h>
10
11/* Max length of ipmi ssif message included netfn and cmd field */
12#define IPMI_SSIF_PAYLOAD_MAX 254
13struct ipmi_ssif_msg {
14 unsigned int len;
15 __u8 payload[IPMI_SSIF_PAYLOAD_MAX];
16};
17
18#endif /* _LINUX_IPMI_SSIF_BMC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ipv6.h+6-2
......@@ -4,6 +4,7 @@
44
55#include <linux/libc-compat.h>
66#include <linux/types.h>
7#include <linux/stddef.h>
78#include <linux/in6.h>
89#include <asm/byteorder.h>
910
......@@ -130,8 +131,10 @@ struct ipv6hdr {
130131 __u8 nexthdr;
131132 __u8 hop_limit;
132133
133 struct in6_addr saddr;
134 struct in6_addr daddr;
134 __struct_group(/* no tag */, addrs, /* no attrs */,
135 struct in6_addr saddr;
136 struct in6_addr daddr;
137 );
135138};
136139
137140
......@@ -194,6 +197,7 @@ enum {
194197 DEVCONF_IOAM6_ID,
195198 DEVCONF_IOAM6_ID_WIDE,
196199 DEVCONF_NDISC_EVICT_NOCARRIER,
200 DEVCONF_ACCEPT_UNTRACKED_NA,
197201 DEVCONF_MAX
198202};
199203
lib/libc/include/any-linux-any/linux/iso_fs.h+2-2
......@@ -137,7 +137,7 @@ struct iso_path_table{
137137 __u8 name_len[2]; /* 721 */
138138 __u8 extent[4]; /* 731 */
139139 __u8 parent[2]; /* 721 */
140 char name[0];
140 char name[];
141141} __attribute__((packed));
142142
143143/* high sierra is identical to iso, except that the date is only 6 bytes, and
......@@ -154,7 +154,7 @@ struct iso_directory_record {
154154 __u8 interleave [ISODCL (28, 28)]; /* 711 */
155155 __u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */
156156 __u8 name_len [ISODCL (33, 33)]; /* 711 */
157 char name [0];
157 char name [];
158158} __attribute__((packed));
159159
160160#define ISOFS_BLOCK_BITS 11
lib/libc/include/any-linux-any/linux/jffs2.h+4-4
......@@ -123,7 +123,7 @@ struct jffs2_raw_dirent
123123 __u8 unused[2];
124124 jint32_t node_crc;
125125 jint32_t name_crc;
126 __u8 name[0];
126 __u8 name[];
127127};
128128
129129/* The JFFS2 raw inode structure: Used for storage on physical media. */
......@@ -155,7 +155,7 @@ struct jffs2_raw_inode
155155 jint16_t flags; /* See JFFS2_INO_FLAG_* */
156156 jint32_t data_crc; /* CRC for the (compressed) data. */
157157 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
158 __u8 data[0];
158 __u8 data[];
159159};
160160
161161struct jffs2_raw_xattr {
......@@ -170,7 +170,7 @@ struct jffs2_raw_xattr {
170170 jint16_t value_len;
171171 jint32_t data_crc;
172172 jint32_t node_crc;
173 __u8 data[0];
173 __u8 data[];
174174} __attribute__((packed));
175175
176176struct jffs2_raw_xref
......@@ -196,7 +196,7 @@ struct jffs2_raw_summary
196196 jint32_t padded; /* sum of the size of padding nodes */
197197 jint32_t sum_crc; /* summary information crc */
198198 jint32_t node_crc; /* node crc */
199 jint32_t sum[0]; /* inode summary info */
199 jint32_t sum[]; /* inode summary info */
200200};
201201
202202union jffs2_node_union
lib/libc/include/any-linux-any/linux/kcov.h+1-1
......@@ -13,7 +13,7 @@ struct kcov_remote_arg {
1313 __u32 area_size; /* Length of coverage buffer in words */
1414 __u32 num_handles; /* Size of handles array */
1515 __aligned_u64 common_handle;
16 __aligned_u64 handles[0];
16 __aligned_u64 handles[];
1717};
1818
1919#define KCOV_REMOTE_MAX_HANDLES 0x100
lib/libc/include/any-linux-any/linux/kd.h+8-2
......@@ -161,19 +161,25 @@ struct console_font_op {
161161 unsigned int flags; /* KD_FONT_FLAG_* */
162162 unsigned int width, height; /* font size */
163163 unsigned int charcount;
164 unsigned char *data; /* font data with height fixed to 32 */
164 unsigned char *data; /* font data with vpitch fixed to 32 for
165 * KD_FONT_OP_SET/GET
166 */
165167};
166168
167169struct console_font {
168170 unsigned int width, height; /* font size */
169171 unsigned int charcount;
170 unsigned char *data; /* font data with height fixed to 32 */
172 unsigned char *data; /* font data with vpitch fixed to 32 for
173 * KD_FONT_OP_SET/GET
174 */
171175};
172176
173177#define KD_FONT_OP_SET 0 /* Set font */
174178#define KD_FONT_OP_GET 1 /* Get font */
175179#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
176180#define KD_FONT_OP_COPY 3 /* Obsolete, do not use */
181#define KD_FONT_OP_SET_TALL 4 /* Set font with vpitch = height */
182#define KD_FONT_OP_GET_TALL 5 /* Get font with vpitch = height */
177183
178184#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
179185
lib/libc/include/any-linux-any/linux/kexec.h+3-2
......@@ -43,6 +43,7 @@
4343#define KEXEC_ARCH_MIPS ( 8 << 16)
4444#define KEXEC_ARCH_AARCH64 (183 << 16)
4545#define KEXEC_ARCH_RISCV (243 << 16)
46#define KEXEC_ARCH_LOONGARCH (258 << 16)
4647
4748/* The artificial cap on the number of segments passed to kexec_load. */
4849#define KEXEC_SEGMENT_MAX 16
......@@ -53,9 +54,9 @@
5354 */
5455struct kexec_segment {
5556 const void *buf;
56 size_t bufsz;
57 __kernel_size_t bufsz;
5758 const void *mem;
58 size_t memsz;
59 __kernel_size_t memsz;
5960};
6061
6162
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+142-7
......@@ -32,9 +32,14 @@
3232 * - 1.4 - Indicate new SRAM EDC bit in device properties
3333 * - 1.5 - Add SVM API
3434 * - 1.6 - Query clear flags in SVM get_attr API
35 * - 1.7 - Checkpoint Restore (CRIU) API
36 * - 1.8 - CRIU - Support for SDMA transfers with GTT BOs
37 * - 1.9 - Add available memory ioctl
38 * - 1.10 - Add SMI profiler event log
39 * - 1.11 - Add unified memory for ctx save/restore area
3540 */
3641#define KFD_IOCTL_MAJOR_VERSION 1
37#define KFD_IOCTL_MINOR_VERSION 6
42#define KFD_IOCTL_MINOR_VERSION 11
3843
3944struct kfd_ioctl_get_version_args {
4045 __u32 major_version; /* from KFD */
......@@ -98,6 +103,12 @@ struct kfd_ioctl_get_queue_wave_state_args {
98103 __u32 pad;
99104};
100105
106struct kfd_ioctl_get_available_memory_args {
107 __u64 available; /* from KFD */
108 __u32 gpu_id; /* to KFD */
109 __u32 pad;
110};
111
101112/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
102113#define KFD_IOC_CACHE_POLICY_COHERENT 0
103114#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
......@@ -194,6 +205,8 @@ struct kfd_ioctl_dbg_wave_control_args {
194205 __u32 buf_size_in_bytes; /*including gpu_id and buf_size */
195206};
196207
208#define KFD_INVALID_FD 0xffffffff
209
197210/* Matching HSA_EVENTTYPE */
198211#define KFD_IOC_EVENT_SIGNAL 0
199212#define KFD_IOC_EVENT_NODECHANGE 1
......@@ -459,15 +472,129 @@ enum kfd_smi_event {
459472 KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
460473 KFD_SMI_EVENT_GPU_PRE_RESET = 3,
461474 KFD_SMI_EVENT_GPU_POST_RESET = 4,
475 KFD_SMI_EVENT_MIGRATE_START = 5,
476 KFD_SMI_EVENT_MIGRATE_END = 6,
477 KFD_SMI_EVENT_PAGE_FAULT_START = 7,
478 KFD_SMI_EVENT_PAGE_FAULT_END = 8,
479 KFD_SMI_EVENT_QUEUE_EVICTION = 9,
480 KFD_SMI_EVENT_QUEUE_RESTORE = 10,
481 KFD_SMI_EVENT_UNMAP_FROM_GPU = 11,
482
483 /*
484 * max event number, as a flag bit to get events from all processes,
485 * this requires super user permission, otherwise will not be able to
486 * receive event from any process. Without this flag to receive events
487 * from same process.
488 */
489 KFD_SMI_EVENT_ALL_PROCESS = 64
490};
491
492enum KFD_MIGRATE_TRIGGERS {
493 KFD_MIGRATE_TRIGGER_PREFETCH,
494 KFD_MIGRATE_TRIGGER_PAGEFAULT_GPU,
495 KFD_MIGRATE_TRIGGER_PAGEFAULT_CPU,
496 KFD_MIGRATE_TRIGGER_TTM_EVICTION
497};
498
499enum KFD_QUEUE_EVICTION_TRIGGERS {
500 KFD_QUEUE_EVICTION_TRIGGER_SVM,
501 KFD_QUEUE_EVICTION_TRIGGER_USERPTR,
502 KFD_QUEUE_EVICTION_TRIGGER_TTM,
503 KFD_QUEUE_EVICTION_TRIGGER_SUSPEND,
504 KFD_QUEUE_EVICTION_CRIU_CHECKPOINT,
505 KFD_QUEUE_EVICTION_CRIU_RESTORE
506};
507
508enum KFD_SVM_UNMAP_TRIGGERS {
509 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY,
510 KFD_SVM_UNMAP_TRIGGER_MMU_NOTIFY_MIGRATE,
511 KFD_SVM_UNMAP_TRIGGER_UNMAP_FROM_CPU
462512};
463513
464514#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
515#define KFD_SMI_EVENT_MSG_SIZE 96
465516
466517struct kfd_ioctl_smi_events_args {
467518 __u32 gpuid; /* to KFD */
468519 __u32 anon_fd; /* from KFD */
469520};
470521
522/**************************************************************************************************
523 * CRIU IOCTLs (Checkpoint Restore In Userspace)
524 *
525 * When checkpointing a process, the userspace application will perform:
526 * 1. PROCESS_INFO op to determine current process information. This pauses execution and evicts
527 * all the queues.
528 * 2. CHECKPOINT op to checkpoint process contents (BOs, queues, events, svm-ranges)
529 * 3. UNPAUSE op to un-evict all the queues
530 *
531 * When restoring a process, the CRIU userspace application will perform:
532 *
533 * 1. RESTORE op to restore process contents
534 * 2. RESUME op to start the process
535 *
536 * Note: Queues are forced into an evicted state after a successful PROCESS_INFO. User
537 * application needs to perform an UNPAUSE operation after calling PROCESS_INFO.
538 */
539
540enum kfd_criu_op {
541 KFD_CRIU_OP_PROCESS_INFO,
542 KFD_CRIU_OP_CHECKPOINT,
543 KFD_CRIU_OP_UNPAUSE,
544 KFD_CRIU_OP_RESTORE,
545 KFD_CRIU_OP_RESUME,
546};
547
548/**
549 * kfd_ioctl_criu_args - Arguments perform CRIU operation
550 * @devices: [in/out] User pointer to memory location for devices information.
551 * This is an array of type kfd_criu_device_bucket.
552 * @bos: [in/out] User pointer to memory location for BOs information
553 * This is an array of type kfd_criu_bo_bucket.
554 * @priv_data: [in/out] User pointer to memory location for private data
555 * @priv_data_size: [in/out] Size of priv_data in bytes
556 * @num_devices: [in/out] Number of GPUs used by process. Size of @devices array.
557 * @num_bos [in/out] Number of BOs used by process. Size of @bos array.
558 * @num_objects: [in/out] Number of objects used by process. Objects are opaque to
559 * user application.
560 * @pid: [in/out] PID of the process being checkpointed
561 * @op [in] Type of operation (kfd_criu_op)
562 *
563 * Return: 0 on success, -errno on failure
564 */
565struct kfd_ioctl_criu_args {
566 __u64 devices; /* Used during ops: CHECKPOINT, RESTORE */
567 __u64 bos; /* Used during ops: CHECKPOINT, RESTORE */
568 __u64 priv_data; /* Used during ops: CHECKPOINT, RESTORE */
569 __u64 priv_data_size; /* Used during ops: PROCESS_INFO, RESTORE */
570 __u32 num_devices; /* Used during ops: PROCESS_INFO, RESTORE */
571 __u32 num_bos; /* Used during ops: PROCESS_INFO, RESTORE */
572 __u32 num_objects; /* Used during ops: PROCESS_INFO, RESTORE */
573 __u32 pid; /* Used during ops: PROCESS_INFO, RESUME */
574 __u32 op;
575};
576
577struct kfd_criu_device_bucket {
578 __u32 user_gpu_id;
579 __u32 actual_gpu_id;
580 __u32 drm_fd;
581 __u32 pad;
582};
583
584struct kfd_criu_bo_bucket {
585 __u64 addr;
586 __u64 size;
587 __u64 offset;
588 __u64 restored_offset; /* During restore, updated offset for BO */
589 __u32 gpu_id; /* This is the user_gpu_id */
590 __u32 alloc_flags;
591 __u32 dmabuf_fd;
592 __u32 pad;
593};
594
595/* CRIU IOCTLs - END */
596/**************************************************************************************************/
597
471598/* Register offset inside the remapped mmio page
472599 */
473600enum kfd_mmio_remap {
......@@ -487,6 +614,8 @@ enum kfd_mmio_remap {
487614#define KFD_IOCTL_SVM_FLAG_GPU_EXEC 0x00000010
488615/* GPUs mostly read, may allow similar optimizations as RO, but writes fault */
489616#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
617/* Keep GPU memory mapping always valid as if XNACK is disable */
618#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
490619
491620/**
492621 * kfd_ioctl_svm_op - SVM ioctl operations
......@@ -596,7 +725,7 @@ struct kfd_ioctl_svm_args {
596725 __u32 op;
597726 __u32 nattr;
598727 /* Variable length array of attributes */
599 struct kfd_ioctl_svm_attribute attrs[0];
728 struct kfd_ioctl_svm_attribute attrs[];
600729};
601730
602731/**
......@@ -679,16 +808,16 @@ struct kfd_ioctl_set_xnack_mode_args {
679808#define AMDKFD_IOC_WAIT_EVENTS \
680809 AMDKFD_IOWR(0x0C, struct kfd_ioctl_wait_events_args)
681810
682#define AMDKFD_IOC_DBG_REGISTER \
811#define AMDKFD_IOC_DBG_REGISTER_DEPRECATED \
683812 AMDKFD_IOW(0x0D, struct kfd_ioctl_dbg_register_args)
684813
685#define AMDKFD_IOC_DBG_UNREGISTER \
814#define AMDKFD_IOC_DBG_UNREGISTER_DEPRECATED \
686815 AMDKFD_IOW(0x0E, struct kfd_ioctl_dbg_unregister_args)
687816
688#define AMDKFD_IOC_DBG_ADDRESS_WATCH \
817#define AMDKFD_IOC_DBG_ADDRESS_WATCH_DEPRECATED \
689818 AMDKFD_IOW(0x0F, struct kfd_ioctl_dbg_address_watch_args)
690819
691#define AMDKFD_IOC_DBG_WAVE_CONTROL \
820#define AMDKFD_IOC_DBG_WAVE_CONTROL_DEPRECATED \
692821 AMDKFD_IOW(0x10, struct kfd_ioctl_dbg_wave_control_args)
693822
694823#define AMDKFD_IOC_SET_SCRATCH_BACKING_VA \
......@@ -742,7 +871,13 @@ struct kfd_ioctl_set_xnack_mode_args {
742871#define AMDKFD_IOC_SET_XNACK_MODE \
743872 AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args)
744873
874#define AMDKFD_IOC_CRIU_OP \
875 AMDKFD_IOWR(0x22, struct kfd_ioctl_criu_args)
876
877#define AMDKFD_IOC_AVAILABLE_MEMORY \
878 AMDKFD_IOWR(0x23, struct kfd_ioctl_get_available_memory_args)
879
745880#define AMDKFD_COMMAND_START 0x01
746#define AMDKFD_COMMAND_END 0x22
881#define AMDKFD_COMMAND_END 0x24
747882
748883#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kfd_sysfs.h created+108
......@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */
2/*
3 * Copyright 2021 Advanced Micro Devices, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef KFD_SYSFS_H_INCLUDED
25#define KFD_SYSFS_H_INCLUDED
26
27/* Capability bits in node properties */
28#define HSA_CAP_HOT_PLUGGABLE 0x00000001
29#define HSA_CAP_ATS_PRESENT 0x00000002
30#define HSA_CAP_SHARED_WITH_GRAPHICS 0x00000004
31#define HSA_CAP_QUEUE_SIZE_POW2 0x00000008
32#define HSA_CAP_QUEUE_SIZE_32BIT 0x00000010
33#define HSA_CAP_QUEUE_IDLE_EVENT 0x00000020
34#define HSA_CAP_VA_LIMIT 0x00000040
35#define HSA_CAP_WATCH_POINTS_SUPPORTED 0x00000080
36#define HSA_CAP_WATCH_POINTS_TOTALBITS_MASK 0x00000f00
37#define HSA_CAP_WATCH_POINTS_TOTALBITS_SHIFT 8
38#define HSA_CAP_DOORBELL_TYPE_TOTALBITS_MASK 0x00003000
39#define HSA_CAP_DOORBELL_TYPE_TOTALBITS_SHIFT 12
40
41#define HSA_CAP_DOORBELL_TYPE_PRE_1_0 0x0
42#define HSA_CAP_DOORBELL_TYPE_1_0 0x1
43#define HSA_CAP_DOORBELL_TYPE_2_0 0x2
44#define HSA_CAP_AQL_QUEUE_DOUBLE_MAP 0x00004000
45
46/* Old buggy user mode depends on this being 0 */
47#define HSA_CAP_RESERVED_WAS_SRAM_EDCSUPPORTED 0x00080000
48
49#define HSA_CAP_MEM_EDCSUPPORTED 0x00100000
50#define HSA_CAP_RASEVENTNOTIFY 0x00200000
51#define HSA_CAP_ASIC_REVISION_MASK 0x03c00000
52#define HSA_CAP_ASIC_REVISION_SHIFT 22
53#define HSA_CAP_SRAM_EDCSUPPORTED 0x04000000
54#define HSA_CAP_SVMAPI_SUPPORTED 0x08000000
55#define HSA_CAP_FLAGS_COHERENTHOSTACCESS 0x10000000
56#define HSA_CAP_RESERVED 0xe00f8000
57
58/* Heap types in memory properties */
59#define HSA_MEM_HEAP_TYPE_SYSTEM 0
60#define HSA_MEM_HEAP_TYPE_FB_PUBLIC 1
61#define HSA_MEM_HEAP_TYPE_FB_PRIVATE 2
62#define HSA_MEM_HEAP_TYPE_GPU_GDS 3
63#define HSA_MEM_HEAP_TYPE_GPU_LDS 4
64#define HSA_MEM_HEAP_TYPE_GPU_SCRATCH 5
65
66/* Flag bits in memory properties */
67#define HSA_MEM_FLAGS_HOT_PLUGGABLE 0x00000001
68#define HSA_MEM_FLAGS_NON_VOLATILE 0x00000002
69#define HSA_MEM_FLAGS_RESERVED 0xfffffffc
70
71/* Cache types in cache properties */
72#define HSA_CACHE_TYPE_DATA 0x00000001
73#define HSA_CACHE_TYPE_INSTRUCTION 0x00000002
74#define HSA_CACHE_TYPE_CPU 0x00000004
75#define HSA_CACHE_TYPE_HSACU 0x00000008
76#define HSA_CACHE_TYPE_RESERVED 0xfffffff0
77
78/* Link types in IO link properties (matches CRAT link types) */
79#define HSA_IOLINK_TYPE_UNDEFINED 0
80#define HSA_IOLINK_TYPE_HYPERTRANSPORT 1
81#define HSA_IOLINK_TYPE_PCIEXPRESS 2
82#define HSA_IOLINK_TYPE_AMBA 3
83#define HSA_IOLINK_TYPE_MIPI 4
84#define HSA_IOLINK_TYPE_QPI_1_1 5
85#define HSA_IOLINK_TYPE_RESERVED1 6
86#define HSA_IOLINK_TYPE_RESERVED2 7
87#define HSA_IOLINK_TYPE_RAPID_IO 8
88#define HSA_IOLINK_TYPE_INFINIBAND 9
89#define HSA_IOLINK_TYPE_RESERVED3 10
90#define HSA_IOLINK_TYPE_XGMI 11
91#define HSA_IOLINK_TYPE_XGOP 12
92#define HSA_IOLINK_TYPE_GZ 13
93#define HSA_IOLINK_TYPE_ETHERNET_RDMA 14
94#define HSA_IOLINK_TYPE_RDMA_OTHER 15
95#define HSA_IOLINK_TYPE_OTHER 16
96
97/* Flag bits in IO link properties (matches CRAT flags, excluding the
98 * bi-directional flag, which is not offially part of the CRAT spec, and
99 * only used internally in KFD)
100 */
101#define HSA_IOLINK_FLAGS_ENABLED (1 << 0)
102#define HSA_IOLINK_FLAGS_NON_COHERENT (1 << 1)
103#define HSA_IOLINK_FLAGS_NO_ATOMICS_32_BIT (1 << 2)
104#define HSA_IOLINK_FLAGS_NO_ATOMICS_64_BIT (1 << 3)
105#define HSA_IOLINK_FLAGS_NO_PEER_TO_PEER_DMA (1 << 4)
106#define HSA_IOLINK_FLAGS_RESERVED 0xffffffe0
107
108#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kvm.h+230-26
......@@ -86,14 +86,6 @@ struct kvm_debug_guest {
8686/* *** End of deprecated interfaces *** */
8787
8888
89/* for KVM_CREATE_MEMORY_REGION */
90struct kvm_memory_region {
91 __u32 slot;
92 __u32 flags;
93 __u64 guest_phys_addr;
94 __u64 memory_size; /* bytes */
95};
96
9789/* for KVM_SET_USER_MEMORY_REGION */
9890struct kvm_userspace_memory_region {
9991 __u32 slot;
......@@ -104,9 +96,9 @@ struct kvm_userspace_memory_region {
10496};
10597
10698/*
107 * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,
108 * other bits are reserved for kvm internal use which are defined in
109 * include/linux/kvm_host.h.
99 * The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for
100 * userspace, other bits are reserved for kvm internal use which are defined
101 * in include/linux/kvm_host.h.
110102 */
111103#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
112104#define KVM_MEM_READONLY (1UL << 1)
......@@ -270,6 +262,8 @@ struct kvm_xen_exit {
270262#define KVM_EXIT_X86_BUS_LOCK 33
271263#define KVM_EXIT_XEN 34
272264#define KVM_EXIT_RISCV_SBI 35
265#define KVM_EXIT_RISCV_CSR 36
266#define KVM_EXIT_NOTIFY 37
273267
274268/* For KVM_EXIT_INTERNAL_ERROR */
275269/* Emulate instruction failed. */
......@@ -444,8 +438,15 @@ struct kvm_run {
444438#define KVM_SYSTEM_EVENT_SHUTDOWN 1
445439#define KVM_SYSTEM_EVENT_RESET 2
446440#define KVM_SYSTEM_EVENT_CRASH 3
441#define KVM_SYSTEM_EVENT_WAKEUP 4
442#define KVM_SYSTEM_EVENT_SUSPEND 5
443#define KVM_SYSTEM_EVENT_SEV_TERM 6
447444 __u32 type;
448 __u64 flags;
445 __u32 ndata;
446 union {
447 __u64 flags;
448 __u64 data[16];
449 };
449450 } system_event;
450451 /* KVM_EXIT_S390_STSI */
451452 struct {
......@@ -474,6 +475,9 @@ struct kvm_run {
474475#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)
475476#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)
476477#define KVM_MSR_EXIT_REASON_FILTER (1 << 2)
478#define KVM_MSR_EXIT_REASON_VALID_MASK (KVM_MSR_EXIT_REASON_INVAL | \
479 KVM_MSR_EXIT_REASON_UNKNOWN | \
480 KVM_MSR_EXIT_REASON_FILTER)
477481 __u32 reason; /* kernel -> user */
478482 __u32 index; /* kernel -> user */
479483 __u64 data; /* kernel <-> user */
......@@ -487,6 +491,18 @@ struct kvm_run {
487491 unsigned long args[6];
488492 unsigned long ret[2];
489493 } riscv_sbi;
494 /* KVM_EXIT_RISCV_CSR */
495 struct {
496 unsigned long csr_num;
497 unsigned long new_value;
498 unsigned long write_mask;
499 unsigned long ret_value;
500 } riscv_csr;
501 /* KVM_EXIT_NOTIFY */
502 struct {
503#define KVM_NOTIFY_CONTEXT_INVALID (1 << 0)
504 __u32 flags;
505 } notify;
490506 /* Fix the size of the union. */
491507 char padding[256];
492508 };
......@@ -533,7 +549,7 @@ struct kvm_coalesced_mmio {
533549
534550struct kvm_coalesced_mmio_ring {
535551 __u32 first, last;
536 struct kvm_coalesced_mmio coalesced_mmio[0];
552 struct kvm_coalesced_mmio coalesced_mmio[];
537553};
538554
539555#define KVM_COALESCED_MMIO_MAX \
......@@ -562,9 +578,14 @@ struct kvm_s390_mem_op {
562578 __u32 op; /* type of operation */
563579 __u64 buf; /* buffer in userspace */
564580 union {
565 __u8 ar; /* the access register number */
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 };
566587 __u32 sida_offset; /* offset into the sida */
567 __u8 reserved[32]; /* should be set to 0 */
588 __u8 reserved[32]; /* ignored */
568589 };
569590};
570591/* types for kvm_s390_mem_op->op */
......@@ -572,9 +593,18 @@ struct kvm_s390_mem_op {
572593#define KVM_S390_MEMOP_LOGICAL_WRITE 1
573594#define KVM_S390_MEMOP_SIDA_READ 2
574595#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
575600/* flags for kvm_s390_mem_op->flags */
576601#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
577602#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)
578608
579609/* for KVM_INTERRUPT */
580610struct kvm_interrupt {
......@@ -606,7 +636,7 @@ struct kvm_clear_dirty_log {
606636/* for KVM_SET_SIGNAL_MASK */
607637struct kvm_signal_mask {
608638 __u32 len;
609 __u8 sigset[0];
639 __u8 sigset[];
610640};
611641
612642/* for KVM_TPR_ACCESS_REPORTING */
......@@ -634,6 +664,7 @@ struct kvm_vapic_addr {
634664#define KVM_MP_STATE_OPERATING 7
635665#define KVM_MP_STATE_LOAD 8
636666#define KVM_MP_STATE_AP_RESET_HOLD 9
667#define KVM_MP_STATE_SUSPENDED 10
637668
638669struct kvm_mp_state {
639670 __u32 mp_state;
......@@ -1131,6 +1162,26 @@ struct kvm_ppc_resize_hpt {
11311162#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
11321163#define KVM_CAP_ARM_MTE 205
11331164#define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
1165#define KVM_CAP_VM_GPA_BITS 207
1166#define KVM_CAP_XSAVE2 208
1167#define KVM_CAP_SYS_ATTRIBUTES 209
1168#define KVM_CAP_PPC_AIL_MODE_3 210
1169#define KVM_CAP_S390_MEM_OP_EXTENSION 211
1170#define KVM_CAP_PMU_CAPABILITY 212
1171#define KVM_CAP_DISABLE_QUIRKS2 213
1172#define KVM_CAP_VM_TSC_CONTROL 214
1173#define KVM_CAP_SYSTEM_EVENT_DATA 215
1174#define KVM_CAP_ARM_SYSTEM_SUSPEND 216
1175#define KVM_CAP_S390_PROTECTED_DUMP 217
1176#define KVM_CAP_X86_TRIPLE_FAULT_EVENT 218
1177#define KVM_CAP_X86_NOTIFY_VMEXIT 219
1178#define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
1179#define KVM_CAP_S390_ZPCI_OP 221
1180#define KVM_CAP_S390_CPU_TOPOLOGY 222
1181#define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 223
1182#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 224
1183#define KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP 225
1184#define KVM_CAP_PMU_EVENT_MASKED_EVENTS 226
11341185
11351186#ifdef KVM_CAP_IRQ_ROUTING
11361187
......@@ -1162,11 +1213,20 @@ struct kvm_irq_routing_hv_sint {
11621213 __u32 sint;
11631214};
11641215
1216struct kvm_irq_routing_xen_evtchn {
1217 __u32 port;
1218 __u32 vcpu;
1219 __u32 priority;
1220};
1221
1222#define KVM_IRQ_ROUTING_XEN_EVTCHN_PRIO_2LEVEL ((__u32)(-1))
1223
11651224/* gsi routing entry types */
11661225#define KVM_IRQ_ROUTING_IRQCHIP 1
11671226#define KVM_IRQ_ROUTING_MSI 2
11681227#define KVM_IRQ_ROUTING_S390_ADAPTER 3
11691228#define KVM_IRQ_ROUTING_HV_SINT 4
1229#define KVM_IRQ_ROUTING_XEN_EVTCHN 5
11701230
11711231struct kvm_irq_routing_entry {
11721232 __u32 gsi;
......@@ -1178,6 +1238,7 @@ struct kvm_irq_routing_entry {
11781238 struct kvm_irq_routing_msi msi;
11791239 struct kvm_irq_routing_s390_adapter adapter;
11801240 struct kvm_irq_routing_hv_sint hv_sint;
1241 struct kvm_irq_routing_xen_evtchn xen_evtchn;
11811242 __u32 pad[8];
11821243 } u;
11831244};
......@@ -1185,7 +1246,7 @@ struct kvm_irq_routing_entry {
11851246struct kvm_irq_routing {
11861247 __u32 nr;
11871248 __u32 flags;
1188 struct kvm_irq_routing_entry entries[0];
1249 struct kvm_irq_routing_entry entries[];
11891250};
11901251
11911252#endif
......@@ -1208,6 +1269,9 @@ struct kvm_x86_mce {
12081269#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
12091270#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
12101271#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)
12111275
12121276struct kvm_xen_hvm_config {
12131277 __u32 flags;
......@@ -1303,7 +1367,7 @@ struct kvm_dirty_tlb {
13031367
13041368struct kvm_reg_list {
13051369 __u64 n; /* number of regs */
1306 __u64 reg[0];
1370 __u64 reg[];
13071371};
13081372
13091373struct kvm_one_reg {
......@@ -1378,18 +1442,12 @@ struct kvm_vfio_spapr_tce {
13781442 __s32 tablefd;
13791443};
13801444
1381/*
1382 * ioctls for VM fds
1383 */
1384#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
13851445/*
13861446 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
13871447 * a vcpu fd.
13881448 */
13891449#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
13901450#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
1391/* KVM_SET_MEMORY_ALIAS is obsolete: */
1392#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
13931451#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
13941452#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
13951453#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
......@@ -1446,7 +1504,8 @@ struct kvm_s390_ucas_mapping {
14461504#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
14471505/* Available with KVM_CAP_PPC_GET_PVINFO */
14481506#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
1449/* Available with KVM_CAP_TSC_CONTROL */
1507/* Available with KVM_CAP_TSC_CONTROL for a vCPU, or with
1508* KVM_CAP_VM_TSC_CONTROL to set defaults for a VM */
14501509#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
14511510#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
14521511/* Available with KVM_CAP_PCI_2_3 */
......@@ -1621,6 +1680,55 @@ struct kvm_s390_pv_unp {
16211680 __u64 tweak;
16221681};
16231682
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
16241732enum pv_cmd_id {
16251733 KVM_PV_ENABLE,
16261734 KVM_PV_DISABLE,
......@@ -1629,6 +1737,10 @@ enum pv_cmd_id {
16291737 KVM_PV_VERIFY,
16301738 KVM_PV_PREP_RESET,
16311739 KVM_PV_UNSHARE_ALL,
1740 KVM_PV_INFO,
1741 KVM_PV_DUMP,
1742 KVM_PV_ASYNC_CLEANUP_PREPARE,
1743 KVM_PV_ASYNC_CLEANUP_PERFORM,
16321744};
16331745
16341746struct kvm_pv_cmd {
......@@ -1659,22 +1771,59 @@ struct kvm_xen_hvm_attr {
16591771 union {
16601772 __u8 long_mode;
16611773 __u8 vector;
1774 __u8 runstate_update_flag;
16621775 struct {
16631776 __u64 gfn;
1777#define KVM_XEN_INVALID_GFN ((__u64)-1)
16641778 } 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;
16651805 __u64 pad[8];
16661806 } u;
16671807};
16681808
1809
16691810/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
16701811#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
16711812#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
16721813#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
16731819
16741820/* Per-vCPU Xen attributes */
16751821#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
16761822#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)
16771823
1824/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
1825#define KVM_XEN_HVM_EVTCHN_SEND _IOW(KVMIO, 0xd0, struct kvm_irq_routing_xen_evtchn)
1826
16781827#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)
16791828#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)
16801829
......@@ -1683,6 +1832,7 @@ struct kvm_xen_vcpu_attr {
16831832 __u16 pad[3];
16841833 union {
16851834 __u64 gpa;
1835#define KVM_XEN_INVALID_GPA ((__u64)-1)
16861836 __u64 pad[8];
16871837 struct {
16881838 __u64 state;
......@@ -1692,6 +1842,13 @@ struct kvm_xen_vcpu_attr {
16921842 __u64 time_blocked;
16931843 __u64 time_offline;
16941844 } runstate;
1845 __u32 vcpu_id;
1846 struct {
1847 __u32 port;
1848 __u32 priority;
1849 __u64 expires_ns;
1850 } timer;
1851 __u8 vector;
16951852 } u;
16961853};
16971854
......@@ -1702,6 +1859,10 @@ struct kvm_xen_vcpu_attr {
17021859#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
17031860#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
17041861#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
17051866
17061867/* Secure Encrypted Virtualization command */
17071868enum sev_cmd_id {
......@@ -1956,6 +2117,8 @@ struct kvm_dirty_gfn {
19562117#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0)
19572118#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1)
19582119
2120#define KVM_PMU_CAP_DISABLE (1 << 0)
2121
19592122/**
19602123 * struct kvm_stats_header - Header of per vm/vcpu binary statistics data.
19612124 * @flags: Some extra information for header, always 0 for now.
......@@ -1999,7 +2162,8 @@ struct kvm_stats_header {
19992162#define KVM_STATS_UNIT_BYTES (0x1 << KVM_STATS_UNIT_SHIFT)
20002163#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
20012164#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
2002#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES
2165#define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT)
2166#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN
20032167
20042168#define KVM_STATS_BASE_SHIFT 8
20052169#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)
......@@ -2031,4 +2195,44 @@ struct kvm_stats_desc {
20312195
20322196#define KVM_GET_STATS_FD _IO(KVMIO, 0xce)
20332197
2198/* Available with KVM_CAP_XSAVE2 */
2199#define KVM_GET_XSAVE2 _IOR(KVMIO, 0xcf, struct kvm_xsave)
2200
2201/* Available with KVM_CAP_S390_PROTECTED_DUMP */
2202#define KVM_S390_PV_CPU_COMMAND _IOWR(KVMIO, 0xd0, struct kvm_pv_cmd)
2203
2204/* Available with KVM_CAP_X86_NOTIFY_VMEXIT */
2205#define KVM_X86_NOTIFY_VMEXIT_ENABLED (1ULL << 0)
2206#define KVM_X86_NOTIFY_VMEXIT_USER (1ULL << 1)
2207
2208/* Available with KVM_CAP_S390_ZPCI_OP */
2209#define KVM_S390_ZPCI_OP _IOW(KVMIO, 0xd1, struct kvm_s390_zpci_op)
2210
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;
2229};
2230
2231/* types for kvm_s390_zpci_op->op */
2232#define KVM_S390_ZPCIOP_REG_AEN 0
2233#define KVM_S390_ZPCIOP_DEREG_AEN 1
2234
2235/* flags for kvm_s390_zpci_op->u.reg_aen.flags */
2236#define KVM_S390_ZPCIOP_REGAEN_HOST (1 << 0)
2237
20342238#endif /* __LINUX_KVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/l2tp.h-2
......@@ -13,8 +13,6 @@
1313#include <linux/in.h>
1414#include <linux/in6.h>
1515
16#define IPPROTO_L2TP 115
17
1816/**
1917 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
2018 * @l2tp_family: address family number AF_L2TPIP.
lib/libc/include/any-linux-any/linux/landlock.h+48-9
......@@ -21,8 +21,14 @@ struct landlock_ruleset_attr {
2121 /**
2222 * @handled_access_fs: Bitmask of actions (cf. `Filesystem flags`_)
2323 * that is handled by this ruleset and should then be forbidden if no
24 * rule explicitly allow them. This is needed for backward
25 * compatibility reasons.
24 * rule explicitly allow them: it is a deny-by-default list that should
25 * contain as much Landlock access rights as possible. Indeed, all
26 * Landlock filesystem access rights that are not part of
27 * handled_access_fs are allowed. This is needed for backward
28 * compatibility reasons. One exception is the
29 * %LANDLOCK_ACCESS_FS_REFER access right, which is always implicitly
30 * handled, but must still be explicitly handled to add new rules with
31 * this access right.
2632 */
2733 __u64 handled_access_fs;
2834};
......@@ -33,7 +39,9 @@ struct landlock_ruleset_attr {
3339 * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI
3440 * version.
3541 */
42/* clang-format off */
3643#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
44/* clang-format on */
3745
3846/**
3947 * enum landlock_rule_type - Landlock rule type
......@@ -60,8 +68,9 @@ struct landlock_path_beneath_attr {
6068 */
6169 __u64 allowed_access;
6270 /**
63 * @parent_fd: File descriptor, open with ``O_PATH``, which identifies
64 * the parent directory of a file hierarchy, or just a file.
71 * @parent_fd: File descriptor, preferably opened with ``O_PATH``,
72 * which identifies the parent directory of a file hierarchy, or just a
73 * file.
6574 */
6675 __s32 parent_fd;
6776 /*
......@@ -86,8 +95,19 @@ struct landlock_path_beneath_attr {
8695 * A file can only receive these access rights:
8796 *
8897 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.
89 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access.
98 * - %LANDLOCK_ACCESS_FS_WRITE_FILE: Open a file with write access. Note that
99 * you might additionally need the %LANDLOCK_ACCESS_FS_TRUNCATE right in order
100 * to overwrite files with :manpage:`open(2)` using ``O_TRUNC`` or
101 * :manpage:`creat(2)`.
90102 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.
103 * - %LANDLOCK_ACCESS_FS_TRUNCATE: Truncate a file with :manpage:`truncate(2)`,
104 * :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.
91111 *
92112 * A directory can receive access rights related to files or directories. The
93113 * following access right is applied to the directory itself, and the
......@@ -109,17 +129,33 @@ struct landlock_path_beneath_attr {
109129 * - %LANDLOCK_ACCESS_FS_MAKE_FIFO: Create (or rename or link) a named pipe.
110130 * - %LANDLOCK_ACCESS_FS_MAKE_BLOCK: Create (or rename or link) a block device.
111131 * - %LANDLOCK_ACCESS_FS_MAKE_SYM: Create (or rename or link) a symbolic link.
132 * - %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.
112148 *
113149 * .. warning::
114150 *
115151 * It is currently not possible to restrict some file-related actions
116152 * accessible through these syscall families: :manpage:`chdir(2)`,
117 * :manpage:`truncate(2)`, :manpage:`stat(2)`, :manpage:`flock(2)`,
118 * :manpage:`chmod(2)`, :manpage:`chown(2)`, :manpage:`setxattr(2)`,
119 * :manpage:`utime(2)`, :manpage:`ioctl(2)`, :manpage:`fcntl(2)`,
120 * :manpage:`access(2)`.
153 * :manpage:`stat(2)`, :manpage:`flock(2)`, :manpage:`chmod(2)`,
154 * :manpage:`chown(2)`, :manpage:`setxattr(2)`, :manpage:`utime(2)`,
155 * :manpage:`ioctl(2)`, :manpage:`fcntl(2)`, :manpage:`access(2)`.
121156 * Future Landlock evolutions will enable to restrict them.
122157 */
158/* clang-format off */
123159#define LANDLOCK_ACCESS_FS_EXECUTE (1ULL << 0)
124160#define LANDLOCK_ACCESS_FS_WRITE_FILE (1ULL << 1)
125161#define LANDLOCK_ACCESS_FS_READ_FILE (1ULL << 2)
......@@ -133,5 +169,8 @@ struct landlock_path_beneath_attr {
133169#define LANDLOCK_ACCESS_FS_MAKE_FIFO (1ULL << 10)
134170#define LANDLOCK_ACCESS_FS_MAKE_BLOCK (1ULL << 11)
135171#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)
172#define LANDLOCK_ACCESS_FS_REFER (1ULL << 13)
173#define LANDLOCK_ACCESS_FS_TRUNCATE (1ULL << 14)
174/* clang-format on */
136175
137176#endif /* _LINUX_LANDLOCK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/lirc.h+13-8
......@@ -16,14 +16,16 @@
1616#define LIRC_MODE2_PULSE 0x01000000
1717#define LIRC_MODE2_FREQUENCY 0x02000000
1818#define LIRC_MODE2_TIMEOUT 0x03000000
19#define LIRC_MODE2_OVERFLOW 0x04000000
1920
2021#define LIRC_VALUE_MASK 0x00FFFFFF
2122#define LIRC_MODE2_MASK 0xFF000000
2223
23#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)
24#define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
25#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
26#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
24#define LIRC_SPACE(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)
25#define LIRC_PULSE(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
26#define LIRC_FREQUENCY(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
27#define LIRC_TIMEOUT(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)
28#define LIRC_OVERFLOW(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_OVERFLOW)
2729
2830#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)
2931#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)
......@@ -32,6 +34,7 @@
3234#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
3335#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
3436#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
37#define LIRC_IS_OVERFLOW(val) (LIRC_MODE2(val) == LIRC_MODE2_OVERFLOW)
3538
3639/* used heavily by lirc userspace */
3740#define lirc_t int
......@@ -70,13 +73,10 @@
7073#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
7174
7275#define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16)
73#define LIRC_CAN_SET_REC_DUTY_CYCLE (LIRC_CAN_SET_SEND_DUTY_CYCLE << 16)
7476
75#define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE 0x40000000
7677#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000
7778#define LIRC_CAN_GET_REC_RESOLUTION 0x20000000
7879#define LIRC_CAN_SET_REC_TIMEOUT 0x10000000
79#define LIRC_CAN_SET_REC_FILTER 0x08000000
8080
8181#define LIRC_CAN_MEASURE_CARRIER 0x02000000
8282#define LIRC_CAN_USE_WIDEBAND_RECEIVER 0x04000000
......@@ -84,7 +84,12 @@
8484#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
8585#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
8686
87#define LIRC_CAN_NOTIFY_DECODE 0x01000000
87/*
88 * Unused features. These features were never implemented, in tree or
89 * out of tree. These definitions are here so not to break the lircd build.
90 */
91#define LIRC_CAN_SET_REC_FILTER 0
92#define LIRC_CAN_NOTIFY_DECODE 0
8893
8994/*** IOCTL commands for lirc driver ***/
9095
lib/libc/include/any-linux-any/linux/loadpin.h created+22
......@@ -0,0 +1,22 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2022, Google LLC
4 */
5
6#ifndef _LINUX_LOOP_LOADPIN_H
7#define _LINUX_LOOP_LOADPIN_H
8
9#define LOADPIN_IOC_MAGIC 'L'
10
11/**
12 * LOADPIN_IOC_SET_TRUSTED_VERITY_DIGESTS - Set up the root digests of verity devices
13 * that loadpin should trust.
14 *
15 * Takes a file descriptor from which to read the root digests of trusted verity devices. The file
16 * is expected to contain a list of digests in ASCII format, with one line per digest. The ioctl
17 * must be issued on the securityfs attribute 'loadpin/dm-verity' (which can be typically found
18 * under /sys/kernel/security/loadpin/dm-verity).
19 */
20#define LOADPIN_IOC_SET_TRUSTED_VERITY_DIGESTS _IOW(LOADPIN_IOC_MAGIC, 0x00, unsigned int)
21
22#endif /* _LINUX_LOOP_LOADPIN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/loop.h+3-8
......@@ -1,11 +1,6 @@
11/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
22/*
3 * include/linux/loop.h
4 *
5 * Written by Theodore Ts'o, 3/29/93.
6 *
7 * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
8 * permitted under the GNU General Public License.
3 * Copyright 1993 by Theodore Ts'o.
94 */
105#ifndef _LINUX_LOOP_H
116#define _LINUX_LOOP_H
......@@ -45,7 +40,7 @@ struct loop_info {
4540 unsigned long lo_inode; /* ioctl r/o */
4641 __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
4742 int lo_offset;
48 int lo_encrypt_type;
43 int lo_encrypt_type; /* obsolete, ignored */
4944 int lo_encrypt_key_size; /* ioctl w/o */
5045 int lo_flags;
5146 char lo_name[LO_NAME_SIZE];
......@@ -61,7 +56,7 @@ struct loop_info64 {
6156 __u64 lo_offset;
6257 __u64 lo_sizelimit;/* bytes, 0 == max available */
6358 __u32 lo_number; /* ioctl r/o */
64 __u32 lo_encrypt_type;
59 __u32 lo_encrypt_type; /* obsolete, ignored */
6560 __u32 lo_encrypt_key_size; /* ioctl w/o */
6661 __u32 lo_flags;
6762 __u8 lo_file_name[LO_NAME_SIZE];
lib/libc/include/any-linux-any/linux/lwtunnel.h+10
......@@ -15,6 +15,7 @@ enum lwtunnel_encap_types {
1515 LWTUNNEL_ENCAP_SEG6_LOCAL,
1616 LWTUNNEL_ENCAP_RPL,
1717 LWTUNNEL_ENCAP_IOAM6,
18 LWTUNNEL_ENCAP_XFRM,
1819 __LWTUNNEL_ENCAP_MAX,
1920};
2021
......@@ -111,4 +112,13 @@ enum {
111112
112113#define LWT_BPF_MAX_HEADROOM 256
113114
115enum {
116 LWT_XFRM_UNSPEC,
117 LWT_XFRM_IF_ID,
118 LWT_XFRM_LINK,
119 __LWT_XFRM_MAX,
120};
121
122#define LWT_XFRM_MAX (__LWT_XFRM_MAX - 1)
123
114124#endif /* _LWTUNNEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/magic.h+7-4
......@@ -6,6 +6,7 @@
66#define AFFS_SUPER_MAGIC 0xadff
77#define AFS_SUPER_MAGIC 0x5346414F
88#define AUTOFS_SUPER_MAGIC 0x0187
9#define CEPH_SUPER_MAGIC 0x00c36400
910#define CODA_SUPER_MAGIC 0x73757245
1011#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
1112#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
......@@ -35,6 +36,7 @@
3536#define EFIVARFS_MAGIC 0xde5e81e4
3637#define HOSTFS_SUPER_MAGIC 0x00c0ffee
3738#define OVERLAYFS_SUPER_MAGIC 0x794c7630
39#define FUSE_SUPER_MAGIC 0x65735546
3840
3941#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
4042#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
......@@ -43,6 +45,7 @@
4345#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */
4446
4547#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
48#define EXFAT_SUPER_MAGIC 0x2011BAB0
4649#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
4750#define NFS_SUPER_MAGIC 0x6969
4851#define OCFS2_SUPER_MAGIC 0x7461636f
......@@ -51,6 +54,7 @@
5154#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */
5255#define AFS_FS_MAGIC 0x6B414653
5356
57
5458#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
5559 /* used by file system utilities that
5660 look at the superblock, etc. */
......@@ -59,6 +63,9 @@
5963#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
6064
6165#define SMB_SUPER_MAGIC 0x517B
66#define CIFS_SUPER_MAGIC 0xFF534D42 /* the first four bytes of SMB PDUs */
67#define SMB2_SUPER_MAGIC 0xFE534D42
68
6269#define CGROUP_SUPER_MAGIC 0x27e0eb
6370#define CGROUP2_SUPER_MAGIC 0x63677270
6471
......@@ -91,12 +98,8 @@
9198
9299/* Since UDF 2.01 is ISO 13346 based... */
93100#define UDF_SUPER_MAGIC 0x15013346
94#define BALLOON_KVM_MAGIC 0x13661366
95#define ZSMALLOC_MAGIC 0x58295829
96101#define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */
97102#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */
98#define Z3FOLD_MAGIC 0x33
99#define PPC_CMM_MAGIC 0xc7571590
100103#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
101104
102105#endif /* __LINUX_MAGIC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mctp.h+18
......@@ -44,7 +44,25 @@ struct sockaddr_mctp_ext {
4444
4545#define MCTP_TAG_MASK 0x07
4646#define MCTP_TAG_OWNER 0x08
47#define MCTP_TAG_PREALLOC 0x10
4748
4849#define MCTP_OPT_ADDR_EXT 1
4950
51#define SIOCMCTPALLOCTAG (SIOCPROTOPRIVATE + 0)
52#define SIOCMCTPDROPTAG (SIOCPROTOPRIVATE + 1)
53
54struct mctp_ioc_tag_ctl {
55 mctp_eid_t peer_addr;
56
57 /* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
58 * populate with the allocated tag value. Returned tag value will
59 * always have TO and PREALLOC set.
60 *
61 * For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
62 * a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
63 */
64 __u8 tag;
65 __u16 flags;
66};
67
5068#endif /* __UAPI_MCTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mdio.h+83
......@@ -67,6 +67,21 @@
6767#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
6868#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
6969#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
70#define MDIO_B10L_PMA_CTRL 2294 /* 10BASE-T1L PMA control */
71#define MDIO_PMA_10T1L_STAT 2295 /* 10BASE-T1L PMA status */
72#define MDIO_PCS_10T1L_CTRL 2278 /* 10BASE-T1L PCS control */
73#define MDIO_PMA_PMD_BT1 18 /* BASE-T1 PMA/PMD extended ability */
74#define MDIO_AN_T1_CTRL 512 /* BASE-T1 AN control */
75#define MDIO_AN_T1_STAT 513 /* BASE-T1 AN status */
76#define MDIO_AN_T1_ADV_L 514 /* BASE-T1 AN advertisement register [15:0] */
77#define MDIO_AN_T1_ADV_M 515 /* BASE-T1 AN advertisement register [31:16] */
78#define MDIO_AN_T1_ADV_H 516 /* BASE-T1 AN advertisement register [47:32] */
79#define MDIO_AN_T1_LP_L 517 /* BASE-T1 AN LP Base Page ability register [15:0] */
80#define MDIO_AN_T1_LP_M 518 /* BASE-T1 AN LP Base Page ability register [31:16] */
81#define MDIO_AN_T1_LP_H 519 /* BASE-T1 AN LP Base Page ability register [47:32] */
82#define MDIO_AN_10BT1_AN_CTRL 526 /* 10BASE-T1 AN control register */
83#define MDIO_AN_10BT1_AN_STAT 527 /* 10BASE-T1 AN status register */
84#define MDIO_PMA_PMD_BT1_CTRL 2100 /* BASE-T1 PMA/PMD control register */
7085
7186/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
7287#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
......@@ -159,6 +174,7 @@
159174#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */
160175#define MDIO_PMA_CTRL2_2_5GBT 0x0030 /* 2.5GBaseT type */
161176#define MDIO_PMA_CTRL2_5GBT 0x0031 /* 5GBaseT type */
177#define MDIO_PMA_CTRL2_BASET1 0x003D /* BASE-T1 type */
162178#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */
163179#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */
164180#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */
......@@ -212,6 +228,7 @@
212228#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */
213229#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */
214230#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */
231#define MDIO_PMA_EXTABLE_BT1 0x0800 /* BASE-T1 ability */
215232#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */
216233
217234/* PHY XGXS lane state register. */
......@@ -268,6 +285,72 @@
268285#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
269286#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
270287
288/* 10BASE-T1L PMA control */
289#define MDIO_PMA_10T1L_CTRL_LB_EN 0x0001 /* Enable loopback mode */
290#define MDIO_PMA_10T1L_CTRL_EEE_EN 0x0400 /* Enable EEE mode */
291#define MDIO_PMA_10T1L_CTRL_LOW_POWER 0x0800 /* Low-power mode */
292#define MDIO_PMA_10T1L_CTRL_2V4_EN 0x1000 /* Enable 2.4 Vpp operating mode */
293#define MDIO_PMA_10T1L_CTRL_TX_DIS 0x4000 /* Transmit disable */
294#define MDIO_PMA_10T1L_CTRL_PMA_RST 0x8000 /* MA reset */
295
296/* 10BASE-T1L PMA status register. */
297#define MDIO_PMA_10T1L_STAT_LINK 0x0001 /* PMA receive link up */
298#define MDIO_PMA_10T1L_STAT_FAULT 0x0002 /* Fault condition detected */
299#define MDIO_PMA_10T1L_STAT_POLARITY 0x0004 /* Receive polarity is reversed */
300#define MDIO_PMA_10T1L_STAT_RECV_FAULT 0x0200 /* Able to detect fault on receive path */
301#define MDIO_PMA_10T1L_STAT_EEE 0x0400 /* PHY has EEE ability */
302#define MDIO_PMA_10T1L_STAT_LOW_POWER 0x0800 /* PMA has low-power ability */
303#define MDIO_PMA_10T1L_STAT_2V4_ABLE 0x1000 /* PHY has 2.4 Vpp operating mode ability */
304#define MDIO_PMA_10T1L_STAT_LB_ABLE 0x2000 /* PHY has loopback ability */
305
306/* 10BASE-T1L PCS control register. */
307#define MDIO_PCS_10T1L_CTRL_LB 0x4000 /* Enable PCS level loopback mode */
308#define MDIO_PCS_10T1L_CTRL_RESET 0x8000 /* PCS reset */
309
310/* BASE-T1 PMA/PMD extended ability register. */
311#define MDIO_PMA_PMD_BT1_B10L_ABLE 0x0004 /* 10BASE-T1L Ability */
312
313/* BASE-T1 auto-negotiation advertisement register [15:0] */
314#define MDIO_AN_T1_ADV_L_PAUSE_CAP ADVERTISE_PAUSE_CAP
315#define MDIO_AN_T1_ADV_L_PAUSE_ASYM ADVERTISE_PAUSE_ASYM
316#define MDIO_AN_T1_ADV_L_FORCE_MS 0x1000 /* Force Master/slave Configuration */
317#define MDIO_AN_T1_ADV_L_REMOTE_FAULT ADVERTISE_RFAULT
318#define MDIO_AN_T1_ADV_L_ACK ADVERTISE_LPACK
319#define MDIO_AN_T1_ADV_L_NEXT_PAGE_REQ ADVERTISE_NPAGE
320
321/* BASE-T1 auto-negotiation advertisement register [31:16] */
322#define MDIO_AN_T1_ADV_M_B10L 0x4000 /* device is compatible with 10BASE-T1L */
323#define MDIO_AN_T1_ADV_M_MST 0x0010 /* advertise master preference */
324
325/* BASE-T1 auto-negotiation advertisement register [47:32] */
326#define MDIO_AN_T1_ADV_H_10L_TX_HI_REQ 0x1000 /* 10BASE-T1L High Level Transmit Request */
327#define MDIO_AN_T1_ADV_H_10L_TX_HI 0x2000 /* 10BASE-T1L High Level Transmit Ability */
328
329/* BASE-T1 AN LP Base Page ability register [15:0] */
330#define MDIO_AN_T1_LP_L_PAUSE_CAP LPA_PAUSE_CAP
331#define MDIO_AN_T1_LP_L_PAUSE_ASYM LPA_PAUSE_ASYM
332#define MDIO_AN_T1_LP_L_FORCE_MS 0x1000 /* LP Force Master/slave Configuration */
333#define MDIO_AN_T1_LP_L_REMOTE_FAULT LPA_RFAULT
334#define MDIO_AN_T1_LP_L_ACK LPA_LPACK
335#define MDIO_AN_T1_LP_L_NEXT_PAGE_REQ LPA_NPAGE
336
337/* BASE-T1 AN LP Base Page ability register [31:16] */
338#define MDIO_AN_T1_LP_M_MST 0x0010 /* LP master preference */
339#define MDIO_AN_T1_LP_M_B10L 0x4000 /* LP is compatible with 10BASE-T1L */
340
341/* BASE-T1 AN LP Base Page ability register [47:32] */
342#define MDIO_AN_T1_LP_H_10L_TX_HI_REQ 0x1000 /* 10BASE-T1L High Level LP Transmit Request */
343#define MDIO_AN_T1_LP_H_10L_TX_HI 0x2000 /* 10BASE-T1L High Level LP Transmit Ability */
344
345/* 10BASE-T1 AN control register */
346#define MDIO_AN_10BT1_AN_CTRL_ADV_EEE_T1L 0x4000 /* 10BASE-T1L EEE ability advertisement */
347
348/* 10BASE-T1 AN status register */
349#define MDIO_AN_10BT1_AN_STAT_LPA_EEE_T1L 0x4000 /* 10BASE-T1L LP EEE ability advertisement */
350
351/* BASE-T1 PMA/PMD control register */
352#define MDIO_PMA_PMD_BT1_CTRL_CFG_MST 0x4000 /* MASTER-SLAVE config value */
353
271354/* EEE Supported/Advertisement/LP Advertisement registers.
272355 *
273356 * EEE capability Register (3.20), Advertisement (7.60) and
lib/libc/include/any-linux-any/linux/media-bus-format.h+10-2
......@@ -34,7 +34,7 @@
3434
3535#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x101e */
37/* RGB - next is 0x1025 */
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,8 +46,11 @@
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_BGR666_1X18 0x1023
4950#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
5051#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
52#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI 0x1024
53#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI 0x1022
5154#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
5255#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
5356#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
......@@ -59,13 +62,17 @@
5962#define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d
6063#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011
6164#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012
65#define MEDIA_BUS_FMT_RGB666_1X30_CPADLO 0x101e
66#define MEDIA_BUS_FMT_RGB888_1X30_CPADLO 0x101f
6267#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
6368#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f
6469#define MEDIA_BUS_FMT_RGB101010_1X30 0x1018
70#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO 0x1020
71#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x1021
6572#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
6673#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
6774
68/* YUV (including grey) - next is 0x202e */
75/* YUV (including grey) - next is 0x202f */
6976#define MEDIA_BUS_FMT_Y8_1X8 0x2001
7077#define MEDIA_BUS_FMT_UV8_1X8 0x2015
7178#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
......@@ -88,6 +95,7 @@
8895#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
8996#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
9097#define MEDIA_BUS_FMT_Y14_1X14 0x202d
98#define MEDIA_BUS_FMT_Y16_1X16 0x202e
9199#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
92100#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
93101#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
lib/libc/include/any-linux-any/linux/media.h+1-1
......@@ -20,7 +20,6 @@
2020#ifndef __LINUX_MEDIA_H
2121#define __LINUX_MEDIA_H
2222
23#include <stdint.h>
2423#include <linux/ioctl.h>
2524#include <linux/types.h>
2625
......@@ -222,6 +221,7 @@ struct media_pad_desc {
222221#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
223222# define MEDIA_LNK_FL_DATA_LINK (0 << 28)
224223# define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
224# define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28)
225225
226226struct media_link_desc {
227227 struct media_pad_desc source;
lib/libc/include/any-linux-any/linux/membarrier.h+4
......@@ -137,6 +137,9 @@
137137 * @MEMBARRIER_CMD_SHARED:
138138 * Alias to MEMBARRIER_CMD_GLOBAL. Provided for
139139 * header backward compatibility.
140 * @MEMBARRIER_CMD_GET_REGISTRATIONS:
141 * Returns a bitmask of previously issued
142 * registration commands.
140143 *
141144 * Command to be passed to the membarrier system call. The commands need to
142145 * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to
......@@ -153,6 +156,7 @@ enum membarrier_cmd {
153156 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),
154157 MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = (1 << 7),
155158 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = (1 << 8),
159 MEMBARRIER_CMD_GET_REGISTRATIONS = (1 << 9),
156160
157161 /* Alias for header backward compatibility. */
158162 MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,
lib/libc/include/any-linux-any/linux/memfd.h+4
......@@ -8,6 +8,10 @@
88#define MFD_CLOEXEC 0x0001U
99#define MFD_ALLOW_SEALING 0x0002U
1010#define MFD_HUGETLB 0x0004U
11/* not executable and sealed to prevent changing to executable. */
12#define MFD_NOEXEC_SEAL 0x0008U
13/* executable */
14#define MFD_EXEC 0x0010U
1115
1216/*
1317 * Huge page size encoding when MFD_HUGETLB is specified, and a huge page
lib/libc/include/any-linux-any/linux/meye.h deleted-65
......@@ -1,65 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Motion Eye video4linux driver for Sony Vaio PictureBook
4 *
5 * Copyright (C) 2001-2003 Stelian Pop <stelian@popies.net>
6 *
7 * Copyright (C) 2001-2002 Alcôve <www.alcove.com>
8 *
9 * Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
10 *
11 * Earlier work by Werner Almesberger, Paul `Rusty' Russell and Paul Mackerras.
12 *
13 * Some parts borrowed from various video4linux drivers, especially
14 * bttv-driver.c and zoran.c, see original files for credits.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#ifndef _MEYE_H_
32#define _MEYE_H_
33
34/****************************************************************************/
35/* Private API for handling mjpeg capture / playback. */
36/****************************************************************************/
37
38struct meye_params {
39 unsigned char subsample;
40 unsigned char quality;
41 unsigned char sharpness;
42 unsigned char agc;
43 unsigned char picture;
44 unsigned char framerate;
45};
46
47/* query the extended parameters */
48#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOC_PRIVATE+0, struct meye_params)
49/* set the extended parameters */
50#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOC_PRIVATE+1, struct meye_params)
51/* queue a buffer for mjpeg capture */
52#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOC_PRIVATE+2, int)
53/* sync a previously queued mjpeg buffer */
54#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOC_PRIVATE+3, int)
55/* get a still uncompressed snapshot */
56#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOC_PRIVATE+4)
57/* get a jpeg compressed snapshot */
58#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int)
59
60/* V4L2 private controls */
61#define V4L2_CID_MEYE_AGC (V4L2_CID_USER_MEYE_BASE + 0)
62#define V4L2_CID_MEYE_PICTURE (V4L2_CID_USER_MEYE_BASE + 1)
63#define V4L2_CID_MEYE_FRAMERATE (V4L2_CID_USER_MEYE_BASE + 2)
64
65#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/minix_fs.h+2-2
......@@ -97,11 +97,11 @@ struct minix3_super_block {
9797
9898struct minix_dir_entry {
9999 __u16 inode;
100 char name[0];
100 char name[];
101101};
102102
103103struct minix3_dir_entry {
104104 __u32 inode;
105 char name[0];
105 char name[];
106106};
107107#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mmc/ioctl.h+1-1
......@@ -58,7 +58,7 @@ struct mmc_ioc_cmd {
5858 */
5959struct mmc_ioc_multi_cmd {
6060 __u64 num_of_cmds;
61 struct mmc_ioc_cmd cmds[0];
61 struct mmc_ioc_cmd cmds[];
6262};
6363
6464#define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)
lib/libc/include/any-linux-any/linux/module.h+1
......@@ -5,5 +5,6 @@
55/* Flags for sys_finit_module: */
66#define MODULE_INIT_IGNORE_MODVERSIONS 1
77#define MODULE_INIT_IGNORE_VERMAGIC 2
8#define MODULE_INIT_COMPRESSED_FILE 4
89
910#endif /* _LINUX_MODULE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mptcp.h+21-2
......@@ -2,14 +2,15 @@
22#ifndef _MPTCP_H
33#define _MPTCP_H
44
5#include <netinet/in.h> /* for sockaddr_in and sockaddr_in6 */
6#include <sys/socket.h> /* for struct sockaddr */
7
58#include <linux/const.h>
69#include <linux/types.h>
710#include <linux/in.h> /* for sockaddr_in */
811#include <linux/in6.h> /* for sockaddr_in6 */
912#include <linux/socket.h> /* for sockaddr_storage and sa_family */
1013
11#include <sys/socket.h> /* for struct sockaddr */
12
1314#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
1415#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
1516#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)
......@@ -53,6 +54,9 @@ enum {
5354 MPTCP_PM_ATTR_ADDR, /* nested address */
5455 MPTCP_PM_ATTR_RCV_ADD_ADDRS, /* u32 */
5556 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 */
5660
5761 __MPTCP_PM_ATTR_MAX
5862};
......@@ -79,6 +83,7 @@ enum {
7983#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
8084#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
8185#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
86#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
8287
8388enum {
8489 MPTCP_PM_CMD_UNSPEC,
......@@ -90,6 +95,10 @@ enum {
9095 MPTCP_PM_CMD_SET_LIMITS,
9196 MPTCP_PM_CMD_GET_LIMITS,
9297 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,
93102
94103 __MPTCP_PM_CMD_AFTER_LAST
95104};
......@@ -149,6 +158,12 @@ struct mptcp_info {
149158 * daddr4 | daddr6, sport, dport, backup, if_idx
150159 * [, error]
151160 * 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.
152167 */
153168enum mptcp_event_type {
154169 MPTCP_EVENT_UNSPEC = 0,
......@@ -163,6 +178,9 @@ enum mptcp_event_type {
163178 MPTCP_EVENT_SUB_CLOSED = 11,
164179
165180 MPTCP_EVENT_SUB_PRIORITY = 13,
181
182 MPTCP_EVENT_LISTENER_CREATED = 15,
183 MPTCP_EVENT_LISTENER_CLOSED = 16,
166184};
167185
168186enum mptcp_event_attr {
......@@ -185,6 +203,7 @@ enum mptcp_event_attr {
185203 MPTCP_ATTR_IF_IDX, /* s32 */
186204 MPTCP_ATTR_RESET_REASON,/* u32 */
187205 MPTCP_ATTR_RESET_FLAGS, /* u32 */
206 MPTCP_ATTR_SERVER_SIDE, /* u8 */
188207
189208 __MPTCP_ATTR_AFTER_LAST
190209};
lib/libc/include/any-linux-any/linux/mroute6.h+1
......@@ -134,6 +134,7 @@ struct mrt6msg {
134134#define MRT6MSG_NOCACHE 1
135135#define MRT6MSG_WRONGMIF 2
136136#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
137#define MRT6MSG_WRMIFWHOLE 4 /* For PIM Register and assert processing */
137138 __u8 im6_mbz; /* must be zero */
138139 __u8 im6_msgtype; /* what type of message */
139140 __u16 im6_mif; /* mif rec'd on */
lib/libc/include/any-linux-any/linux/ndctl.h+5-7
......@@ -30,25 +30,25 @@ struct nd_cmd_get_config_data_hdr {
3030 __u32 in_offset;
3131 __u32 in_length;
3232 __u32 status;
33 __u8 out_buf[0];
33 __u8 out_buf[];
3434} __attribute__((packed));
3535
3636struct nd_cmd_set_config_hdr {
3737 __u32 in_offset;
3838 __u32 in_length;
39 __u8 in_buf[0];
39 __u8 in_buf[];
4040} __attribute__((packed));
4141
4242struct nd_cmd_vendor_hdr {
4343 __u32 opcode;
4444 __u32 in_length;
45 __u8 in_buf[0];
45 __u8 in_buf[];
4646} __attribute__((packed));
4747
4848struct nd_cmd_vendor_tail {
4949 __u32 status;
5050 __u32 out_length;
51 __u8 out_buf[0];
51 __u8 out_buf[];
5252} __attribute__((packed));
5353
5454struct nd_cmd_ars_cap {
......@@ -86,7 +86,7 @@ struct nd_cmd_ars_status {
8686 __u32 reserved;
8787 __u64 err_address;
8888 __u64 length;
89 } __attribute__((packed)) records[0];
89 } __attribute__((packed)) records[];
9090} __attribute__((packed));
9191
9292struct nd_cmd_clear_error {
......@@ -189,7 +189,6 @@ static __inline__ const char *nvdimm_cmd_name(unsigned cmd)
189189#define ND_DEVICE_REGION_BLK 3 /* nd_region: (parent of BLK namespaces) */
190190#define ND_DEVICE_NAMESPACE_IO 4 /* legacy persistent memory */
191191#define ND_DEVICE_NAMESPACE_PMEM 5 /* PMEM namespace (may alias with BLK) */
192#define ND_DEVICE_NAMESPACE_BLK 6 /* BLK namespace (may alias with PMEM) */
193192#define ND_DEVICE_DAX_PMEM 7 /* Device DAX interface to pmem */
194193
195194enum nd_driver_flags {
......@@ -198,7 +197,6 @@ enum nd_driver_flags {
198197 ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
199198 ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
200199 ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
201 ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
202200 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
203201};
204202
lib/libc/include/any-linux-any/linux/neighbour.h+10-1
......@@ -32,6 +32,8 @@ enum {
3232 NDA_NH_ID,
3333 NDA_FDB_EXT_ATTRS,
3434 NDA_FLAGS_EXT,
35 NDA_NDM_STATE_MASK,
36 NDA_NDM_FLAGS_MASK,
3537 __NDA_MAX
3638};
3739
......@@ -50,7 +52,8 @@ enum {
5052#define NTF_STICKY (1 << 6)
5153#define NTF_ROUTER (1 << 7)
5254/* Extended flags under NDA_FLAGS_EXT: */
53#define NTF_EXT_MANAGED (1 << 0)
55#define NTF_EXT_MANAGED (1 << 0)
56#define NTF_EXT_LOCKED (1 << 1)
5457
5558/*
5659 * Neighbor Cache Entry States.
......@@ -84,6 +87,11 @@ enum {
8487 * NTF_EXT_MANAGED flagged neigbor entries are managed by the kernel on behalf
8588 * of a user space control plane, and automatically refreshed so that (if
8689 * possible) they remain in NUD_REACHABLE state.
90 *
91 * NTF_EXT_LOCKED flagged bridge FDB entries are entries generated by the
92 * bridge in response to a host trying to communicate via a locked bridge port
93 * with MAB enabled. Their purpose is to notify user space that a host requires
94 * authentication.
8795 */
8896
8997struct nda_cacheinfo {
......@@ -152,6 +160,7 @@ enum {
152160 NDTPA_QUEUE_LENBYTES, /* u32 */
153161 NDTPA_MCAST_REPROBES, /* u32 */
154162 NDTPA_PAD,
163 NDTPA_INTERVAL_PROBE_TIME_MS, /* u64, msecs */
155164 __NDTPA_MAX
156165};
157166#define NDTPA_MAX (__NDTPA_MAX - 1)
lib/libc/include/any-linux-any/linux/net_dropmon.h+3-2
......@@ -29,12 +29,12 @@ struct net_dm_config_entry {
2929
3030struct net_dm_config_msg {
3131 __u32 entries;
32 struct net_dm_config_entry options[0];
32 struct net_dm_config_entry options[];
3333};
3434
3535struct net_dm_alert_msg {
3636 __u32 entries;
37 struct net_dm_drop_point points[0];
37 struct net_dm_drop_point points[];
3838};
3939
4040struct net_dm_user_msg {
......@@ -93,6 +93,7 @@ enum net_dm_attr {
9393 NET_DM_ATTR_SW_DROPS, /* flag */
9494 NET_DM_ATTR_HW_DROPS, /* flag */
9595 NET_DM_ATTR_FLOW_ACTION_COOKIE, /* binary */
96 NET_DM_ATTR_REASON, /* string */
9697
9798 __NET_DM_ATTR_MAX,
9899 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
lib/libc/include/any-linux-any/linux/net_tstamp.h+18-2
......@@ -31,8 +31,9 @@ enum {
3131 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),
3232 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
3333 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),
34 SOF_TIMESTAMPING_OPT_ID_TCP = (1 << 16),
3435
35 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_BIND_PHC,
36 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_ID_TCP,
3637 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
3738 SOF_TIMESTAMPING_LAST
3839};
......@@ -62,7 +63,7 @@ struct so_timestamping {
6263/**
6364 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
6465 *
65 * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP
66 * @flags: one of HWTSTAMP_FLAG_*
6667 * @tx_type: one of HWTSTAMP_TX_*
6768 * @rx_filter: one of HWTSTAMP_FILTER_*
6869 *
......@@ -78,6 +79,21 @@ struct hwtstamp_config {
7879 int rx_filter;
7980};
8081
82/* possible values for hwtstamp_config->flags */
83enum hwtstamp_flags {
84 /*
85 * With this flag, the user could get bond active interface's
86 * PHC index. Note this PHC index is not stable as when there
87 * is a failover, the bond active interface will be changed, so
88 * will be the PHC index.
89 */
90 HWTSTAMP_FLAG_BONDED_PHC_INDEX = (1<<0),
91#define HWTSTAMP_FLAG_BONDED_PHC_INDEX HWTSTAMP_FLAG_BONDED_PHC_INDEX
92
93 HWTSTAMP_FLAG_LAST = HWTSTAMP_FLAG_BONDED_PHC_INDEX,
94 HWTSTAMP_FLAG_MASK = (HWTSTAMP_FLAG_LAST - 1) | HWTSTAMP_FLAG_LAST
95};
96
8197/* possible values for hwtstamp_config->tx_type */
8298enum hwtstamp_tx_types {
8399 /*
lib/libc/include/any-linux-any/linux/netdev.h created+61
......@@ -0,0 +1,61 @@
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/netdev.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_NETDEV_H
7#define _LINUX_NETDEV_H
8
9#define NETDEV_FAMILY_NAME "netdev"
10#define NETDEV_FAMILY_VERSION 1
11
12/**
13 * enum netdev_xdp_act
14 * @NETDEV_XDP_ACT_BASIC: XDP feautues set supported by all drivers
15 * (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
16 * @NETDEV_XDP_ACT_REDIRECT: The netdev supports XDP_REDIRECT
17 * @NETDEV_XDP_ACT_NDO_XMIT: This feature informs if netdev implements
18 * ndo_xdp_xmit callback.
19 * @NETDEV_XDP_ACT_XSK_ZEROCOPY: This feature informs if netdev supports AF_XDP
20 * in zero copy mode.
21 * @NETDEV_XDP_ACT_HW_OFFLOAD: This feature informs if netdev supports XDP hw
22 * offloading.
23 * @NETDEV_XDP_ACT_RX_SG: This feature informs if netdev implements non-linear
24 * XDP buffer support in the driver napi callback.
25 * @NETDEV_XDP_ACT_NDO_XMIT_SG: This feature informs if netdev implements
26 * non-linear XDP buffer support in ndo_xdp_xmit callback.
27 */
28enum netdev_xdp_act {
29 NETDEV_XDP_ACT_BASIC = 1,
30 NETDEV_XDP_ACT_REDIRECT = 2,
31 NETDEV_XDP_ACT_NDO_XMIT = 4,
32 NETDEV_XDP_ACT_XSK_ZEROCOPY = 8,
33 NETDEV_XDP_ACT_HW_OFFLOAD = 16,
34 NETDEV_XDP_ACT_RX_SG = 32,
35 NETDEV_XDP_ACT_NDO_XMIT_SG = 64,
36
37 NETDEV_XDP_ACT_MASK = 127,
38};
39
40enum {
41 NETDEV_A_DEV_IFINDEX = 1,
42 NETDEV_A_DEV_PAD,
43 NETDEV_A_DEV_XDP_FEATURES,
44
45 __NETDEV_A_DEV_MAX,
46 NETDEV_A_DEV_MAX = (__NETDEV_A_DEV_MAX - 1)
47};
48
49enum {
50 NETDEV_CMD_DEV_GET = 1,
51 NETDEV_CMD_DEV_ADD_NTF,
52 NETDEV_CMD_DEV_DEL_NTF,
53 NETDEV_CMD_DEV_CHANGE_NTF,
54
55 __NETDEV_CMD_MAX,
56 NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
57};
58
59#define NETDEV_MCGRP_MGMT "mgmt"
60
61#endif /* _LINUX_NETDEV_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter/ipset/ip_set.h+2-4
......@@ -3,10 +3,6 @@
33 * Patrick Schaaf <bof@bof.de>
44 * Martin Josefsson <gandalf@wlug.westbo.se>
55 * Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@netfilter.org>
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 version 2 as
9 * published by the Free Software Foundation.
106 */
117#ifndef _IP_SET_H
128#define _IP_SET_H
......@@ -89,6 +85,7 @@ enum {
8985 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
9086 IPSET_ATTR_MARK, /* 10 */
9187 IPSET_ATTR_MARKMASK, /* 11 */
88 IPSET_ATTR_BITMASK, /* 12 */
9289 /* Reserve empty slots */
9390 IPSET_ATTR_CADT_MAX = 16,
9491 /* Create-only specific attributes */
......@@ -157,6 +154,7 @@ enum ipset_errno {
157154 IPSET_ERR_COMMENT,
158155 IPSET_ERR_INVALID_MARKMASK,
159156 IPSET_ERR_SKBINFO,
157 IPSET_ERR_BITMASK_NETMASK_EXCL,
160158
161159 /* Type specific error codes */
162160 IPSET_ERR_TYPE_SPECIFIC = 4352,
lib/libc/include/any-linux-any/linux/netfilter/nf_conntrack_common.h+1-1
......@@ -94,7 +94,7 @@ enum ip_conntrack_status {
9494 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),
9595
9696
97 /* Conntrack got a helper explicitly attached via CT target. */
97 /* Conntrack got a helper explicitly attached (ruleset, ctnetlink). */
9898 IPS_HELPER_BIT = 13,
9999 IPS_HELPER = (1 << IPS_HELPER_BIT),
100100
lib/libc/include/any-linux-any/linux/netfilter/nf_conntrack_sctp.h+1-1
......@@ -15,7 +15,7 @@ enum sctp_conntrack {
1515 SCTP_CONNTRACK_SHUTDOWN_RECD,
1616 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
1717 SCTP_CONNTRACK_HEARTBEAT_SENT,
18 SCTP_CONNTRACK_HEARTBEAT_ACKED,
18 SCTP_CONNTRACK_HEARTBEAT_ACKED, /* no longer used */
1919 SCTP_CONNTRACK_MAX
2020};
2121
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+43
......@@ -97,6 +97,14 @@ enum nft_verdicts {
9797 * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes)
9898 * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes)
9999 * @NFT_MSG_DELFLOWTABLE: delete flow table (enum nft_flowtable_attributes)
100 * @NFT_MSG_GETRULE_RESET: get rules and reset stateful expressions (enum nft_obj_attributes)
101 * @NFT_MSG_DESTROYTABLE: destroy a table (enum nft_table_attributes)
102 * @NFT_MSG_DESTROYCHAIN: destroy a chain (enum nft_chain_attributes)
103 * @NFT_MSG_DESTROYRULE: destroy a rule (enum nft_rule_attributes)
104 * @NFT_MSG_DESTROYSET: destroy a set (enum nft_set_attributes)
105 * @NFT_MSG_DESTROYSETELEM: destroy a set element (enum nft_set_elem_attributes)
106 * @NFT_MSG_DESTROYOBJ: destroy a stateful object (enum nft_object_attributes)
107 * @NFT_MSG_DESTROYFLOWTABLE: destroy flow table (enum nft_flowtable_attributes)
100108 */
101109enum nf_tables_msg_types {
102110 NFT_MSG_NEWTABLE,
......@@ -124,6 +132,14 @@ enum nf_tables_msg_types {
124132 NFT_MSG_NEWFLOWTABLE,
125133 NFT_MSG_GETFLOWTABLE,
126134 NFT_MSG_DELFLOWTABLE,
135 NFT_MSG_GETRULE_RESET,
136 NFT_MSG_DESTROYTABLE,
137 NFT_MSG_DESTROYCHAIN,
138 NFT_MSG_DESTROYRULE,
139 NFT_MSG_DESTROYSET,
140 NFT_MSG_DESTROYSETELEM,
141 NFT_MSG_DESTROYOBJ,
142 NFT_MSG_DESTROYFLOWTABLE,
127143 NFT_MSG_MAX,
128144};
129145
......@@ -760,6 +776,7 @@ enum nft_payload_bases {
760776 NFT_PAYLOAD_NETWORK_HEADER,
761777 NFT_PAYLOAD_TRANSPORT_HEADER,
762778 NFT_PAYLOAD_INNER_HEADER,
779 NFT_PAYLOAD_TUN_HEADER,
763780};
764781
765782/**
......@@ -779,6 +796,32 @@ enum nft_payload_csum_flags {
779796 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = (1 << 0),
780797};
781798
799enum nft_inner_type {
800 NFT_INNER_UNSPEC = 0,
801 NFT_INNER_VXLAN,
802 NFT_INNER_GENEVE,
803};
804
805enum nft_inner_flags {
806 NFT_INNER_HDRSIZE = (1 << 0),
807 NFT_INNER_LL = (1 << 1),
808 NFT_INNER_NH = (1 << 2),
809 NFT_INNER_TH = (1 << 3),
810};
811#define NFT_INNER_MASK (NFT_INNER_HDRSIZE | NFT_INNER_LL | \
812 NFT_INNER_NH | NFT_INNER_TH)
813
814enum nft_inner_attributes {
815 NFTA_INNER_UNSPEC,
816 NFTA_INNER_NUM,
817 NFTA_INNER_TYPE,
818 NFTA_INNER_FLAGS,
819 NFTA_INNER_HDRSIZE,
820 NFTA_INNER_EXPR,
821 __NFTA_INNER_MAX
822};
823#define NFTA_INNER_MAX (__NFTA_INNER_MAX - 1)
824
782825/**
783826 * enum nft_payload_attributes - nf_tables payload expression netlink attributes
784827 *
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_cttimeout.h+1-1
......@@ -94,7 +94,7 @@ enum ctattr_timeout_sctp {
9494 CTA_TIMEOUT_SCTP_SHUTDOWN_RECD,
9595 CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT,
9696 CTA_TIMEOUT_SCTP_HEARTBEAT_SENT,
97 CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED,
97 CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED, /* no longer used */
9898 __CTA_TIMEOUT_SCTP_MAX
9999};
100100#define CTA_TIMEOUT_SCTP_MAX (__CTA_TIMEOUT_SCTP_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_queue.h+1
......@@ -61,6 +61,7 @@ enum nfqnl_attr_type {
6161 NFQA_SECCTX, /* security context string */
6262 NFQA_VLAN, /* nested attribute: packet vlan info */
6363 NFQA_L2HDR, /* full L2 header */
64 NFQA_PRIORITY, /* skb->priority */
6465
6566 __NFQA_MAX
6667};
lib/libc/include/any-linux-any/linux/netfilter/x_tables.h+2-2
......@@ -28,7 +28,7 @@ struct xt_entry_match {
2828 __u16 match_size;
2929 } u;
3030
31 unsigned char data[0];
31 unsigned char data[];
3232};
3333
3434struct xt_entry_target {
......@@ -119,7 +119,7 @@ struct xt_counters_info {
119119 unsigned int num_counters;
120120
121121 /* The counters (actually `number' of these). */
122 struct xt_counters counters[0];
122 struct xt_counters counters[];
123123};
124124
125125#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
lib/libc/include/any-linux-any/linux/netfilter/xt_AUDIT.h-4
......@@ -4,10 +4,6 @@
44 *
55 * (C) 2010-2011 Thomas Graf <tgraf@redhat.com>
66 * (C) 2010-2011 Red Hat, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
117 */
128
139#ifndef _XT_AUDIT_TARGET_H
lib/libc/include/any-linux-any/linux/netfilter/xt_IDLETIMER.h+1-16
......@@ -1,6 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
12/*
2 * linux/include/linux/netfilter/xt_IDLETIMER.h
3 *
43 * Header file for Xtables timer target module.
54 *
65 * Copyright (C) 2004, 2010 Nokia Corporation
......@@ -10,20 +9,6 @@
109 * by Luciano Coelho <luciano.coelho@nokia.com>
1110 *
1211 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * version 2 as published by the Free Software Foundation.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 * 02110-1301 USA
2712 */
2813
2914#ifndef _XT_IDLETIMER_H
lib/libc/include/any-linux-any/linux/netfilter/xt_connmark.h+4-9
......@@ -1,18 +1,13 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/* Copyright (C) 2002,2004 MARA Systems AB <https://www.marasystems.com>
3 * by Henrik Nordstrom <hno@marasystems.com>
4 */
5
26#ifndef _XT_CONNMARK_H
37#define _XT_CONNMARK_H
48
59#include <linux/types.h>
610
7/* Copyright (C) 2002,2004 MARA Systems AB <https://www.marasystems.com>
8 * by Henrik Nordstrom <hno@marasystems.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
1611enum {
1712 XT_CONNMARK_SET = 0,
1813 XT_CONNMARK_SAVE,
lib/libc/include/any-linux-any/linux/netfilter/xt_osf.h-14
......@@ -1,20 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
33 * Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru>
4 *
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 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
184 */
195
206#ifndef _XT_OSF_H
lib/libc/include/any-linux-any/linux/netfilter_arp/arp_tables.h+3-3
......@@ -107,7 +107,7 @@ struct arpt_entry
107107 struct xt_counters counters;
108108
109109 /* The matches (if any), then the target. */
110 unsigned char elems[0];
110 unsigned char elems[];
111111};
112112
113113/*
......@@ -179,7 +179,7 @@ struct arpt_replace {
179179 struct xt_counters *counters;
180180
181181 /* The entries (hang off end: not really an array). */
182 struct arpt_entry entries[0];
182 struct arpt_entry entries[];
183183};
184184
185185/* The argument to ARPT_SO_GET_ENTRIES. */
......@@ -191,7 +191,7 @@ struct arpt_get_entries {
191191 unsigned int size;
192192
193193 /* The entries. */
194 struct arpt_entry entrytable[0];
194 struct arpt_entry entrytable[];
195195};
196196
197197/* Helper functions */
lib/libc/include/any-linux-any/linux/netfilter_bridge/ebt_among.h+1-1
......@@ -40,7 +40,7 @@ struct ebt_mac_wormhash_tuple {
4040struct ebt_mac_wormhash {
4141 int table[257];
4242 int poolsize;
43 struct ebt_mac_wormhash_tuple pool[0];
43 struct ebt_mac_wormhash_tuple pool[];
4444};
4545
4646#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \
lib/libc/include/any-linux-any/linux/netfilter_decnet.h deleted-68
......@@ -1,68 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __LINUX_DECNET_NETFILTER_H
3#define __LINUX_DECNET_NETFILTER_H
4
5/* DECnet-specific defines for netfilter.
6 * This file (C) Steve Whitehouse 1999 derived from the
7 * ipv4 netfilter header file which is
8 * (C)1998 Rusty Russell -- This code is GPL.
9 */
10
11#include <linux/netfilter.h>
12
13/* only for userspace compatibility */
14
15#include <limits.h> /* for INT_MIN, INT_MAX */
16
17/* kernel define is in netfilter_defs.h */
18#define NF_DN_NUMHOOKS 7
19
20/* DECnet Hooks */
21/* After promisc drops, checksum checks. */
22#define NF_DN_PRE_ROUTING 0
23/* If the packet is destined for this box. */
24#define NF_DN_LOCAL_IN 1
25/* If the packet is destined for another interface. */
26#define NF_DN_FORWARD 2
27/* Packets coming from a local process. */
28#define NF_DN_LOCAL_OUT 3
29/* Packets about to hit the wire. */
30#define NF_DN_POST_ROUTING 4
31/* Input Hello Packets */
32#define NF_DN_HELLO 5
33/* Input Routing Packets */
34#define NF_DN_ROUTE 6
35
36enum nf_dn_hook_priorities {
37 NF_DN_PRI_FIRST = INT_MIN,
38 NF_DN_PRI_CONNTRACK = -200,
39 NF_DN_PRI_MANGLE = -150,
40 NF_DN_PRI_NAT_DST = -100,
41 NF_DN_PRI_FILTER = 0,
42 NF_DN_PRI_NAT_SRC = 100,
43 NF_DN_PRI_DNRTMSG = 200,
44 NF_DN_PRI_LAST = INT_MAX,
45};
46
47struct nf_dn_rtmsg {
48 int nfdn_ifindex;
49};
50
51#define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)))
52
53/* backwards compatibility for userspace */
54#define DNRMG_L1_GROUP 0x01
55#define DNRMG_L2_GROUP 0x02
56
57enum {
58 DNRNG_NLGRP_NONE,
59#define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE
60 DNRNG_NLGRP_L1,
61#define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1
62 DNRNG_NLGRP_L2,
63#define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2
64 __DNRNG_NLGRP_MAX
65};
66#define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1)
67
68#endif /*__LINUX_DECNET_NETFILTER_H*/
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netfilter_ipv4/ip_tables.h+3-3
......@@ -119,7 +119,7 @@ struct ipt_entry {
119119 struct xt_counters counters;
120120
121121 /* The matches (if any), then the target. */
122 unsigned char elems[0];
122 unsigned char elems[];
123123};
124124
125125/*
......@@ -201,7 +201,7 @@ struct ipt_replace {
201201 struct xt_counters *counters;
202202
203203 /* The entries (hang off end: not really an array). */
204 struct ipt_entry entries[0];
204 struct ipt_entry entries[];
205205};
206206
207207/* The argument to IPT_SO_GET_ENTRIES. */
......@@ -213,7 +213,7 @@ struct ipt_get_entries {
213213 unsigned int size;
214214
215215 /* The entries. */
216 struct ipt_entry entrytable[0];
216 struct ipt_entry entrytable[];
217217};
218218
219219/* Helper functions */
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6_tables.h+2-2
......@@ -241,7 +241,7 @@ struct ip6t_replace {
241241 struct xt_counters *counters;
242242
243243 /* The entries (hang off end: not really an array). */
244 struct ip6t_entry entries[0];
244 struct ip6t_entry entries[];
245245};
246246
247247/* The argument to IP6T_SO_GET_ENTRIES. */
......@@ -253,7 +253,7 @@ struct ip6t_get_entries {
253253 unsigned int size;
254254
255255 /* The entries. */
256 struct ip6t_entry entrytable[0];
256 struct ip6t_entry entrytable[];
257257};
258258
259259/* Helper functions */
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6t_LOG.h+1-1
......@@ -17,4 +17,4 @@ struct ip6t_log_info {
1717 char prefix[30];
1818};
1919
20#endif /*_IPT_LOG_H*/
\ No newline at end of file
20#endif /* _IP6T_LOG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/netlink.h+25-7
......@@ -20,7 +20,7 @@
2020#define NETLINK_CONNECTOR 11
2121#define NETLINK_NETFILTER 12 /* netfilter subsystem */
2222#define NETLINK_IP6_FW 13
23#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
23#define NETLINK_DNRTMSG 14 /* DECnet routing messages (obsolete) */
2424#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
2525#define NETLINK_GENERIC 16
2626/* leave room for NETLINK_DM (DM Events) */
......@@ -41,12 +41,20 @@ struct sockaddr_nl {
4141 __u32 nl_groups; /* multicast groups mask */
4242};
4343
44/**
45 * struct nlmsghdr - fixed format metadata header of Netlink messages
46 * @nlmsg_len: Length of message including header
47 * @nlmsg_type: Message content type
48 * @nlmsg_flags: Additional flags
49 * @nlmsg_seq: Sequence number
50 * @nlmsg_pid: Sending process port ID
51 */
4452struct nlmsghdr {
45 __u32 nlmsg_len; /* Length of message including header */
46 __u16 nlmsg_type; /* Message content */
47 __u16 nlmsg_flags; /* Additional flags */
48 __u32 nlmsg_seq; /* Sequence number */
49 __u32 nlmsg_pid; /* Sending process port ID */
53 __u32 nlmsg_len;
54 __u16 nlmsg_type;
55 __u16 nlmsg_flags;
56 __u32 nlmsg_seq;
57 __u32 nlmsg_pid;
5058};
5159
5260/* Flags values */
......@@ -54,7 +62,7 @@ struct nlmsghdr {
5462#define NLM_F_REQUEST 0x01 /* It is request message. */
5563#define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */
5664#define NLM_F_ACK 0x04 /* Reply with ack, with zero or error code */
57#define NLM_F_ECHO 0x08 /* Echo this request */
65#define NLM_F_ECHO 0x08 /* Receive resulting notifications */
5866#define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */
5967#define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */
6068
......@@ -72,6 +80,7 @@ struct nlmsghdr {
7280
7381/* Modifiers to DELETE request */
7482#define NLM_F_NONREC 0x100 /* Do not delete recursively */
83#define NLM_F_BULK 0x200 /* Delete multiple objects */
7584
7685/* Flags for ACK message */
7786#define NLM_F_CAPPED 0x100 /* request was capped */
......@@ -131,6 +140,10 @@ struct nlmsgerr {
131140 * be used - in the success case - to identify a created
132141 * object or operation or similar (binary)
133142 * @NLMSGERR_ATTR_POLICY: policy for a rejected attribute
143 * @NLMSGERR_ATTR_MISS_TYPE: type of a missing required attribute,
144 * %NLMSGERR_ATTR_MISS_NEST will not be present if the attribute was
145 * missing at the message level
146 * @NLMSGERR_ATTR_MISS_NEST: offset of the nest where attribute was missing
134147 * @__NLMSGERR_ATTR_MAX: number of attributes
135148 * @NLMSGERR_ATTR_MAX: highest attribute number
136149 */
......@@ -140,6 +153,8 @@ enum nlmsgerr_attrs {
140153 NLMSGERR_ATTR_OFFS,
141154 NLMSGERR_ATTR_COOKIE,
142155 NLMSGERR_ATTR_POLICY,
156 NLMSGERR_ATTR_MISS_TYPE,
157 NLMSGERR_ATTR_MISS_NEST,
143158
144159 __NLMSGERR_ATTR_MAX,
145160 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
......@@ -332,6 +347,9 @@ enum netlink_attribute_type {
332347 * bitfield32 type (U32)
333348 * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)
334349 * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment
350 *
351 * @__NL_POLICY_TYPE_ATTR_MAX: number of attributes
352 * @NL_POLICY_TYPE_ATTR_MAX: highest attribute number
335353 */
336354enum netlink_policy_type_attr {
337355 NL_POLICY_TYPE_ATTR_UNSPEC,
lib/libc/include/any-linux-any/linux/nfs4.h+1
......@@ -45,6 +45,7 @@
4545
4646#define NFS4_OPEN_RESULT_CONFIRM 0x0002
4747#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
48#define NFS4_OPEN_RESULT_PRESERVE_UNLINKED 0x0008
4849#define NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK 0x0020
4950
5051#define NFS4_SHARE_ACCESS_MASK 0x000F
lib/libc/include/any-linux-any/linux/nfs_fs.h+1-1
......@@ -52,7 +52,7 @@
5252#define NFSDBG_CALLBACK 0x0100
5353#define NFSDBG_CLIENT 0x0200
5454#define NFSDBG_MOUNT 0x0400
55#define NFSDBG_FSCACHE 0x0800
55#define NFSDBG_FSCACHE 0x0800 /* unused */
5656#define NFSDBG_PNFS 0x1000
5757#define NFSDBG_PNFS_LD 0x2000
5858#define NFSDBG_STATE 0x4000
lib/libc/include/any-linux-any/linux/nl80211.h+314-19
......@@ -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-2021 Intel Corporation
14 * Copyright (C) 2018-2022 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
......@@ -323,6 +323,17 @@
323323 * Once the association is done, the driver cleans the FILS AAD data.
324324 */
325325
326/**
327 * DOC: Multi-Link Operation
328 *
329 * In Multi-Link Operation, a connection between to MLDs utilizes multiple
330 * links. To use this in nl80211, various commands and responses now need
331 * to or will include the new %NL80211_ATTR_MLO_LINKS attribute.
332 * Additionally, various commands that need to operate on a specific link
333 * now need to be given the %NL80211_ATTR_MLO_LINK_ID attribute, e.g. to
334 * use %NL80211_CMD_START_AP or similar functions.
335 */
336
326337/**
327338 * enum nl80211_commands - supported nl80211 commands
328339 *
......@@ -366,14 +377,22 @@
366377 * the non-transmitting interfaces are deleted as well.
367378 *
368379 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
369 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
380 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC
381 * represents peer's MLD address for MLO pairwise key. For MLO group key,
382 * the link is identified by %NL80211_ATTR_MLO_LINK_ID.
370383 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
371384 * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
385 * For MLO connection, the link to set default key is identified by
386 * %NL80211_ATTR_MLO_LINK_ID.
372387 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
373388 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
374 * and %NL80211_ATTR_KEY_SEQ attributes.
389 * and %NL80211_ATTR_KEY_SEQ attributes. %NL80211_ATTR_MAC represents
390 * peer's MLD address for MLO pairwise key. The link to add MLO
391 * group key is identified by %NL80211_ATTR_MLO_LINK_ID.
375392 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
376 * or %NL80211_ATTR_MAC.
393 * or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC represents peer's MLD address
394 * for MLO pairwise key. The link to delete group key is identified by
395 * %NL80211_ATTR_MLO_LINK_ID.
377396 *
378397 * @NL80211_CMD_GET_BEACON: (not used)
379398 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
......@@ -405,7 +424,8 @@
405424 * interface identified by %NL80211_ATTR_IFINDEX.
406425 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
407426 * or, if no MAC address given, all stations, on the interface identified
408 * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and
427 * by %NL80211_ATTR_IFINDEX. For MLD station, MLD address is used in
428 * %NL80211_ATTR_MAC. %NL80211_ATTR_MGMT_SUBTYPE and
409429 * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
410430 * of disconnection indication should be sent to the station
411431 * (Deauthentication or Disassociation frame and reason code for that
......@@ -753,6 +773,13 @@
753773 * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
754774 * counters which will be updated to the current value. This attribute
755775 * is used during CSA period.
776 * For TX on an MLD, the frequency can be omitted and the link ID be
777 * specified, or if transmitting to a known peer MLD (with MLD addresses
778 * in the frame) both can be omitted and the link will be selected by
779 * lower layers.
780 * For RX notification, %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
781 * indicate the frame RX timestamp and %NL80211_ATTR_TX_HW_TIMESTAMP may
782 * be included to indicate the ack TX timestamp.
756783 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
757784 * command may be used with the corresponding cookie to cancel the wait
758785 * time if it is known that it is no longer necessary. This command is
......@@ -763,7 +790,9 @@
763790 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
764791 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
765792 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
766 * the frame.
793 * the frame. %NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the
794 * tx timestamp and %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
795 * indicate the ack RX timestamp.
767796 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
768797 * backward compatibility.
769798 *
......@@ -1108,6 +1137,12 @@
11081137 * has been received. %NL80211_ATTR_FRAME is used to specify the
11091138 * frame contents. The frame is the raw EAPoL data, without ethernet or
11101139 * 802.11 headers.
1140 * For an MLD transmitter, the %NL80211_ATTR_MLO_LINK_ID may be given and
1141 * its effect will depend on the destination: If the destination is known
1142 * to be an MLD, this will be used as a hint to select the link to transmit
1143 * the frame on. If the destination is not an MLD, this will select both
1144 * the link to transmit on and the source address will be set to the link
1145 * address of that link.
11111146 * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
11121147 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added
11131148 * indicating the protocol type of the received frame; whether the frame
......@@ -1132,6 +1167,23 @@
11321167 * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH
11331168 * command interface.
11341169 *
1170 * Host driver sends MLD address of the AP with %NL80211_ATTR_MLD_ADDR in
1171 * %NL80211_CMD_EXTERNAL_AUTH event to indicate user space to enable MLO
1172 * during the authentication offload in STA mode while connecting to MLD
1173 * APs. Host driver should check %NL80211_ATTR_MLO_SUPPORT flag capability
1174 * in %NL80211_CMD_CONNECT to know whether the user space supports enabling
1175 * MLO during the authentication offload or not.
1176 * User space should enable MLO during the authentication only when it
1177 * receives the AP MLD address in authentication offload request. User
1178 * space shouldn't enable MLO when the authentication offload request
1179 * doesn't indicate the AP MLD address even if the AP is MLO capable.
1180 * User space should use %NL80211_ATTR_MLD_ADDR as peer's MLD address and
1181 * interface address identified by %NL80211_ATTR_IFINDEX as self MLD
1182 * address. User space and host driver to use MLD addresses in RA, TA and
1183 * BSSID fields of the frames between them, and host driver translates the
1184 * MLD addresses to/from link addresses based on the link chosen for the
1185 * authentication.
1186 *
11351187 * Host driver reports this status on an authentication failure to the
11361188 * user space through the connect result as the user space would have
11371189 * initiated the connection through the connect request.
......@@ -1232,6 +1284,21 @@
12321284 * &NL80211_ATTR_FILS_NONCES - for FILS Nonces
12331285 * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
12341286 *
1287 * @NL80211_CMD_ASSOC_COMEBACK: notification about an association
1288 * temporal rejection with comeback. The event includes %NL80211_ATTR_MAC
1289 * to describe the BSSID address of the AP and %NL80211_ATTR_TIMEOUT to
1290 * specify the timeout value.
1291 *
1292 * @NL80211_CMD_ADD_LINK: Add a new link to an interface. The
1293 * %NL80211_ATTR_MLO_LINK_ID attribute is used for the new link.
1294 * @NL80211_CMD_REMOVE_LINK: Remove a link from an interface. This may come
1295 * without %NL80211_ATTR_MLO_LINK_ID as an easy way to remove all links
1296 * in preparation for e.g. roaming to a regular (non-MLO) AP.
1297 *
1298 * @NL80211_CMD_ADD_LINK_STA: Add a link to an MLD station
1299 * @NL80211_CMD_MODIFY_LINK_STA: Modify a link of an MLD station
1300 * @NL80211_CMD_REMOVE_LINK_STA: Remove a link of an MLD station
1301 *
12351302 * @NL80211_CMD_MAX: highest used command number
12361303 * @__NL80211_CMD_AFTER_LAST: internal use
12371304 */
......@@ -1474,6 +1541,15 @@ enum nl80211_commands {
14741541
14751542 NL80211_CMD_SET_FILS_AAD,
14761543
1544 NL80211_CMD_ASSOC_COMEBACK,
1545
1546 NL80211_CMD_ADD_LINK,
1547 NL80211_CMD_REMOVE_LINK,
1548
1549 NL80211_CMD_ADD_LINK_STA,
1550 NL80211_CMD_MODIFY_LINK_STA,
1551 NL80211_CMD_REMOVE_LINK_STA,
1552
14771553 /* add new commands above here */
14781554
14791555 /* used to define NL80211_CMD_MAX below */
......@@ -2333,8 +2409,10 @@ enum nl80211_commands {
23332409 *
23342410 * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
23352411 * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
2336 * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
2337 * interface type.
2412 * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
2413 * other interface-type specific capabilities per interface type. For MLO,
2414 * %NL80211_ATTR_EML_CAPABILITY and %NL80211_ATTR_MLD_CAPA_AND_OPS are
2415 * present.
23382416 *
23392417 * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
23402418 * groupID for monitor mode.
......@@ -2470,7 +2548,9 @@ enum nl80211_commands {
24702548 * space supports external authentication. This attribute shall be used
24712549 * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
24722550 * may offload authentication processing to user space if this capability
2473 * is indicated in the respective requests from the user space.
2551 * is indicated in the respective requests from the user space. (This flag
2552 * attribute deprecated for %NL80211_CMD_START_AP, use
2553 * %NL80211_ATTR_AP_SETTINGS_FLAGS)
24742554 *
24752555 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
24762556 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
......@@ -2639,6 +2719,62 @@ enum nl80211_commands {
26392719 * Mandatory parameter for the transmitting interface to enable MBSSID.
26402720 * Optional for the non-transmitting interfaces.
26412721 *
2722 * @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
2723 * available for radar/CAC detection on some hw. This chain can't be used
2724 * to transmit or receive frames and it is bounded to a running wdev.
2725 * Background radar/CAC detection allows to avoid the CAC downtime
2726 * switching on a different channel during CAC detection on the selected
2727 * radar channel.
2728 *
2729 * @NL80211_ATTR_AP_SETTINGS_FLAGS: u32 attribute contains ap settings flags,
2730 * enumerated in &enum nl80211_ap_settings_flags. This attribute shall be
2731 * used with %NL80211_CMD_START_AP request.
2732 *
2733 * @NL80211_ATTR_EHT_CAPABILITY: EHT Capability information element (from
2734 * association request when used with NL80211_CMD_NEW_STATION). Can be set
2735 * only if %NL80211_STA_FLAG_WME is set.
2736 *
2737 * @NL80211_ATTR_MLO_LINK_ID: A (u8) link ID for use with MLO, to be used with
2738 * various commands that need a link ID to operate.
2739 * @NL80211_ATTR_MLO_LINKS: A nested array of links, each containing some
2740 * per-link information and a link ID.
2741 * @NL80211_ATTR_MLD_ADDR: An MLD address, used with various commands such as
2742 * authenticate/associate.
2743 *
2744 * @NL80211_ATTR_MLO_SUPPORT: Flag attribute to indicate user space supports MLO
2745 * connection. Used with %NL80211_CMD_CONNECT. If this attribute is not
2746 * included in NL80211_CMD_CONNECT drivers must not perform MLO connection.
2747 *
2748 * @NL80211_ATTR_MAX_NUM_AKM_SUITES: U16 attribute. Indicates maximum number of
2749 * AKM suites allowed for %NL80211_CMD_CONNECT, %NL80211_CMD_ASSOCIATE and
2750 * %NL80211_CMD_START_AP in %NL80211_CMD_GET_WIPHY response. If this
2751 * attribute is not present userspace shall consider maximum number of AKM
2752 * suites allowed as %NL80211_MAX_NR_AKM_SUITES which is the legacy maximum
2753 * number prior to the introduction of this attribute.
2754 *
2755 * @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
2756 * @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
2757 *
2758 * @NL80211_ATTR_TX_HW_TIMESTAMP: Hardware timestamp for TX operation in
2759 * nanoseconds (u64). This is the device clock timestamp so it will
2760 * probably reset when the device is stopped or the firmware is reset.
2761 * When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the frame TX
2762 * timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
2763 * the ack TX timestamp.
2764 * @NL80211_ATTR_RX_HW_TIMESTAMP: Hardware timestamp for RX operation in
2765 * nanoseconds (u64). This is the device clock timestamp so it will
2766 * probably reset when the device is stopped or the firmware is reset.
2767 * When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
2768 * timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
2769 * the incoming frame RX timestamp.
2770 * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
2771 * (re)associations.
2772 *
2773 * @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest
2774 * bit corresponds to the lowest 20 MHz channel. Each bit set to 1
2775 * indicates that the sub-channel is punctured. Higher 16 bits are
2776 * reserved.
2777 *
26422778 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
26432779 * @NL80211_ATTR_MAX: highest attribute number currently defined
26442780 * @__NL80211_ATTR_AFTER_LAST: internal use
......@@ -3145,6 +3281,31 @@ enum nl80211_attrs {
31453281 NL80211_ATTR_MBSSID_CONFIG,
31463282 NL80211_ATTR_MBSSID_ELEMS,
31473283
3284 NL80211_ATTR_RADAR_BACKGROUND,
3285
3286 NL80211_ATTR_AP_SETTINGS_FLAGS,
3287
3288 NL80211_ATTR_EHT_CAPABILITY,
3289
3290 NL80211_ATTR_DISABLE_EHT,
3291
3292 NL80211_ATTR_MLO_LINKS,
3293 NL80211_ATTR_MLO_LINK_ID,
3294 NL80211_ATTR_MLD_ADDR,
3295
3296 NL80211_ATTR_MLO_SUPPORT,
3297
3298 NL80211_ATTR_MAX_NUM_AKM_SUITES,
3299
3300 NL80211_ATTR_EML_CAPABILITY,
3301 NL80211_ATTR_MLD_CAPA_AND_OPS,
3302
3303 NL80211_ATTR_TX_HW_TIMESTAMP,
3304 NL80211_ATTR_RX_HW_TIMESTAMP,
3305 NL80211_ATTR_TD_BITMAP,
3306
3307 NL80211_ATTR_PUNCT_BITMAP,
3308
31483309 /* add attributes here, update the policy in nl80211.c */
31493310
31503311 __NL80211_ATTR_AFTER_LAST,
......@@ -3199,7 +3360,14 @@ enum nl80211_attrs {
31993360#define NL80211_HE_MIN_CAPABILITY_LEN 16
32003361#define NL80211_HE_MAX_CAPABILITY_LEN 54
32013362#define NL80211_MAX_NR_CIPHER_SUITES 5
3363
3364/*
3365 * NL80211_MAX_NR_AKM_SUITES is obsolete when %NL80211_ATTR_MAX_NUM_AKM_SUITES
3366 * present in %NL80211_CMD_GET_WIPHY response.
3367 */
32023368#define NL80211_MAX_NR_AKM_SUITES 2
3369#define NL80211_EHT_MIN_CAPABILITY_LEN 13
3370#define NL80211_EHT_MAX_CAPABILITY_LEN 51
32033371
32043372#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
32053373
......@@ -3227,7 +3395,7 @@ enum nl80211_attrs {
32273395 * and therefore can't be created in the normal ways, use the
32283396 * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
32293397 * commands to create and destroy one
3230 * @NL80211_IF_TYPE_OCB: Outside Context of a BSS
3398 * @NL80211_IFTYPE_OCB: Outside Context of a BSS
32313399 * This mode corresponds to the MIB variable dot11OCBActivated=true
32323400 * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
32333401 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
......@@ -3368,6 +3536,56 @@ enum nl80211_he_ru_alloc {
33683536 NL80211_RATE_INFO_HE_RU_ALLOC_2x996,
33693537};
33703538
3539/**
3540 * enum nl80211_eht_gi - EHT guard interval
3541 * @NL80211_RATE_INFO_EHT_GI_0_8: 0.8 usec
3542 * @NL80211_RATE_INFO_EHT_GI_1_6: 1.6 usec
3543 * @NL80211_RATE_INFO_EHT_GI_3_2: 3.2 usec
3544 */
3545enum nl80211_eht_gi {
3546 NL80211_RATE_INFO_EHT_GI_0_8,
3547 NL80211_RATE_INFO_EHT_GI_1_6,
3548 NL80211_RATE_INFO_EHT_GI_3_2,
3549};
3550
3551/**
3552 * enum nl80211_eht_ru_alloc - EHT RU allocation values
3553 * @NL80211_RATE_INFO_EHT_RU_ALLOC_26: 26-tone RU allocation
3554 * @NL80211_RATE_INFO_EHT_RU_ALLOC_52: 52-tone RU allocation
3555 * @NL80211_RATE_INFO_EHT_RU_ALLOC_52P26: 52+26-tone RU allocation
3556 * @NL80211_RATE_INFO_EHT_RU_ALLOC_106: 106-tone RU allocation
3557 * @NL80211_RATE_INFO_EHT_RU_ALLOC_106P26: 106+26 tone RU allocation
3558 * @NL80211_RATE_INFO_EHT_RU_ALLOC_242: 242-tone RU allocation
3559 * @NL80211_RATE_INFO_EHT_RU_ALLOC_484: 484-tone RU allocation
3560 * @NL80211_RATE_INFO_EHT_RU_ALLOC_484P242: 484+242 tone RU allocation
3561 * @NL80211_RATE_INFO_EHT_RU_ALLOC_996: 996-tone RU allocation
3562 * @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484: 996+484 tone RU allocation
3563 * @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242: 996+484+242 tone RU allocation
3564 * @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996: 2x996-tone RU allocation
3565 * @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484: 2x996+484 tone RU allocation
3566 * @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996: 3x996-tone RU allocation
3567 * @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484: 3x996+484 tone RU allocation
3568 * @NL80211_RATE_INFO_EHT_RU_ALLOC_4x996: 4x996-tone RU allocation
3569 */
3570enum nl80211_eht_ru_alloc {
3571 NL80211_RATE_INFO_EHT_RU_ALLOC_26,
3572 NL80211_RATE_INFO_EHT_RU_ALLOC_52,
3573 NL80211_RATE_INFO_EHT_RU_ALLOC_52P26,
3574 NL80211_RATE_INFO_EHT_RU_ALLOC_106,
3575 NL80211_RATE_INFO_EHT_RU_ALLOC_106P26,
3576 NL80211_RATE_INFO_EHT_RU_ALLOC_242,
3577 NL80211_RATE_INFO_EHT_RU_ALLOC_484,
3578 NL80211_RATE_INFO_EHT_RU_ALLOC_484P242,
3579 NL80211_RATE_INFO_EHT_RU_ALLOC_996,
3580 NL80211_RATE_INFO_EHT_RU_ALLOC_996P484,
3581 NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242,
3582 NL80211_RATE_INFO_EHT_RU_ALLOC_2x996,
3583 NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484,
3584 NL80211_RATE_INFO_EHT_RU_ALLOC_3x996,
3585 NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484,
3586 NL80211_RATE_INFO_EHT_RU_ALLOC_4x996,
3587};
3588
33713589/**
33723590 * enum nl80211_rate_info - bitrate information
33733591 *
......@@ -3407,6 +3625,13 @@ enum nl80211_he_ru_alloc {
34073625 * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
34083626 * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
34093627 * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
3628 * @NL80211_RATE_INFO_320_MHZ_WIDTH: 320 MHz bitrate
3629 * @NL80211_RATE_INFO_EHT_MCS: EHT MCS index (u8, 0-15)
3630 * @NL80211_RATE_INFO_EHT_NSS: EHT NSS value (u8, 1-8)
3631 * @NL80211_RATE_INFO_EHT_GI: EHT guard interval identifier
3632 * (u8, see &enum nl80211_eht_gi)
3633 * @NL80211_RATE_INFO_EHT_RU_ALLOC: EHT RU allocation, if not present then
3634 * non-OFDMA was used (u8, see &enum nl80211_eht_ru_alloc)
34103635 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
34113636 */
34123637enum nl80211_rate_info {
......@@ -3428,6 +3653,11 @@ enum nl80211_rate_info {
34283653 NL80211_RATE_INFO_HE_GI,
34293654 NL80211_RATE_INFO_HE_DCM,
34303655 NL80211_RATE_INFO_HE_RU_ALLOC,
3656 NL80211_RATE_INFO_320_MHZ_WIDTH,
3657 NL80211_RATE_INFO_EHT_MCS,
3658 NL80211_RATE_INFO_EHT_NSS,
3659 NL80211_RATE_INFO_EHT_GI,
3660 NL80211_RATE_INFO_EHT_RU_ALLOC,
34313661
34323662 /* keep last */
34333663 __NL80211_RATE_INFO_AFTER_LAST,
......@@ -3738,13 +3968,20 @@ enum nl80211_mpath_info {
37383968 * capabilities IE
37393969 * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as
37403970 * defined in HE capabilities IE
3741 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
3742 * defined
37433971 * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
37443972 * given for all 6 GHz band channels
37453973 * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
37463974 * advertised on this band/for this iftype (binary)
3975 * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC: EHT MAC capabilities as in EHT
3976 * capabilities element
3977 * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY: EHT PHY capabilities as in EHT
3978 * capabilities element
3979 * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET: EHT supported NSS/MCS as in EHT
3980 * capabilities element
3981 * @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE: EHT PPE thresholds information as
3982 * defined in EHT capabilities element
37473983 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
3984 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
37483985 */
37493986enum nl80211_band_iftype_attr {
37503987 __NL80211_BAND_IFTYPE_ATTR_INVALID,
......@@ -3756,6 +3993,10 @@ enum nl80211_band_iftype_attr {
37563993 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
37573994 NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
37583995 NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,
3996 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC,
3997 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY,
3998 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET,
3999 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE,
37594000
37604001 /* keep last */
37614002 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
......@@ -3900,6 +4141,10 @@ enum nl80211_wmm_rule {
39004141 * on this channel in current regulatory domain.
39014142 * @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
39024143 * on this channel in current regulatory domain.
4144 * @NL80211_FREQUENCY_ATTR_NO_320MHZ: any 320 MHz channel using this channel
4145 * as the primary or any of the secondary channels isn't possible
4146 * @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
4147 * in current regulatory domain.
39034148 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
39044149 * currently defined
39054150 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
......@@ -3936,6 +4181,8 @@ enum nl80211_frequency_attr {
39364181 NL80211_FREQUENCY_ATTR_4MHZ,
39374182 NL80211_FREQUENCY_ATTR_8MHZ,
39384183 NL80211_FREQUENCY_ATTR_16MHZ,
4184 NL80211_FREQUENCY_ATTR_NO_320MHZ,
4185 NL80211_FREQUENCY_ATTR_NO_EHT,
39394186
39404187 /* keep last */
39414188 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
......@@ -4134,6 +4381,7 @@ enum nl80211_sched_scan_match_attr {
41344381 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
41354382 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
41364383 * @NL80211_RRF_NO_HE: HE operation not allowed
4384 * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
41374385 */
41384386enum nl80211_reg_rule_flags {
41394387 NL80211_RRF_NO_OFDM = 1<<0,
......@@ -4152,6 +4400,7 @@ enum nl80211_reg_rule_flags {
41524400 NL80211_RRF_NO_80MHZ = 1<<15,
41534401 NL80211_RRF_NO_160MHZ = 1<<16,
41544402 NL80211_RRF_NO_HE = 1<<17,
4403 NL80211_RRF_NO_320MHZ = 1<<18,
41554404};
41564405
41574406#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
......@@ -4649,6 +4898,8 @@ enum nl80211_key_mode {
46494898 * @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel
46504899 * @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel
46514900 * @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel
4901 * @NL80211_CHAN_WIDTH_320: 320 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
4902 * attribute must be provided as well
46524903 */
46534904enum nl80211_chan_width {
46544905 NL80211_CHAN_WIDTH_20_NOHT,
......@@ -4664,6 +4915,7 @@ enum nl80211_chan_width {
46644915 NL80211_CHAN_WIDTH_4,
46654916 NL80211_CHAN_WIDTH_8,
46664917 NL80211_CHAN_WIDTH_16,
4918 NL80211_CHAN_WIDTH_320,
46674919};
46684920
46694921/**
......@@ -4735,6 +4987,8 @@ enum nl80211_bss_scan_width {
47354987 * Contains a nested array of signal strength attributes (u8, dBm),
47364988 * using the nesting index as the antenna number.
47374989 * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
4990 * @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
4991 * @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
47384992 * @__NL80211_BSS_AFTER_LAST: internal
47394993 * @NL80211_BSS_MAX: highest BSS attribute
47404994 */
......@@ -4760,6 +5014,8 @@ enum nl80211_bss {
47605014 NL80211_BSS_PARENT_BSSID,
47615015 NL80211_BSS_CHAIN_SIGNAL,
47625016 NL80211_BSS_FREQUENCY_OFFSET,
5017 NL80211_BSS_MLO_LINK_ID,
5018 NL80211_BSS_MLD_ADDR,
47635019
47645020 /* keep last */
47655021 __NL80211_BSS_AFTER_LAST,
......@@ -5555,7 +5811,7 @@ enum nl80211_iface_limit_attrs {
55555811 * => allows 8 of AP/GO that can have BI gcd >= min gcd
55565812 *
55575813 * numbers = [ #{STA} <= 2 ], channels = 2, max = 2
5558 * => allows two STAs on different channels
5814 * => allows two STAs on the same or on different channels
55595815 *
55605816 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
55615817 * => allows a STA plus three P2P interfaces
......@@ -5600,7 +5856,7 @@ enum nl80211_if_combination_attrs {
56005856 * @NL80211_PLINK_ESTAB: mesh peer link is established
56015857 * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
56025858 * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
5603 * plink are discarded
5859 * plink are discarded, except for authentication frames
56045860 * @NUM_NL80211_PLINK_STATES: number of peer link states
56055861 * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
56065862 */
......@@ -5639,6 +5895,7 @@ enum plink_actions {
56395895#define NL80211_KEK_LEN 16
56405896#define NL80211_KCK_EXT_LEN 24
56415897#define NL80211_KEK_EXT_LEN 32
5898#define NL80211_KCK_EXT_LEN_32 32
56425899#define NL80211_REPLAY_CTR_LEN 8
56435900
56445901/**
......@@ -5737,13 +5994,15 @@ enum nl80211_tdls_operation {
57375994 NL80211_TDLS_DISABLE_LINK,
57385995};
57395996
5740/*
5997/**
57415998 * enum nl80211_ap_sme_features - device-integrated AP features
5742 * Reserved for future use, no bits are defined in
5743 * NL80211_ATTR_DEVICE_AP_SME yet.
5999 * @NL80211_AP_SME_SA_QUERY_OFFLOAD: SA Query procedures offloaded to driver
6000 * when user space indicates support for SA Query procedures offload during
6001 * "start ap" with %NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT.
6002 */
57446003enum nl80211_ap_sme_features {
6004 NL80211_AP_SME_SA_QUERY_OFFLOAD = 1 << 0,
57456005};
5746 */
57476006
57486007/**
57496008 * enum nl80211_feature_flags - device/driver features
......@@ -5754,7 +6013,7 @@ enum nl80211_ap_sme_features {
57546013 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
57556014 * the connected inactive stations in AP mode.
57566015 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
5757 * to work properly to suppport receiving regulatory hints from
6016 * to work properly to support receiving regulatory hints from
57586017 * cellular base stations.
57596018 * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
57606019 * here to reserve the value for API/ABI compatibility)
......@@ -6051,6 +6310,22 @@ enum nl80211_feature_flags {
60516310 * frames. Userspace has to share FILS AAD details to the driver by using
60526311 * @NL80211_CMD_SET_FILS_AAD.
60536312 *
6313 * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
6314 * detection.
6315 *
6316 * @NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE: Device can perform a MAC address
6317 * change without having to bring the underlying network device down
6318 * first. For example, in station mode this can be used to vary the
6319 * origin MAC address prior to a connection to a new AP for privacy
6320 * or other reasons. Note that certain driver specific restrictions
6321 * might apply, e.g. no scans in progress, no offchannel operations
6322 * in progress, and no active connections.
6323 *
6324 * @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
6325 *
6326 * @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
6327 * authentication, data encryption and message integrity.
6328 *
60546329 * @NUM_NL80211_EXT_FEATURES: number of extended features.
60556330 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
60566331 */
......@@ -6117,6 +6392,10 @@ enum nl80211_ext_feature_index {
61176392 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
61186393 NL80211_EXT_FEATURE_BSS_COLOR,
61196394 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
6395 NL80211_EXT_FEATURE_RADAR_BACKGROUND,
6396 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
6397 NL80211_EXT_FEATURE_PUNCT,
6398 NL80211_EXT_FEATURE_SECURE_NAN,
61206399
61216400 /* add new features before the definition below */
61226401 NUM_NL80211_EXT_FEATURES,
......@@ -7462,4 +7741,20 @@ enum nl80211_mbssid_config_attributes {
74627741 NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
74637742};
74647743
7744/**
7745 * enum nl80211_ap_settings_flags - AP settings flags
7746 *
7747 * @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
7748 * authentication.
7749 * @NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT: Userspace supports SA Query
7750 * procedures offload to driver. If driver advertises
7751 * %NL80211_AP_SME_SA_QUERY_OFFLOAD in AP SME features, userspace shall
7752 * ignore SA Query procedures and validations when this flag is set by
7753 * userspace.
7754 */
7755enum nl80211_ap_settings_flags {
7756 NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = 1 << 0,
7757 NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
7758};
7759
74657760#endif /* __LINUX_NL80211_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nvme_ioctl.h+33-1
......@@ -55,7 +55,10 @@ struct nvme_passthru_cmd64 {
5555 __u64 metadata;
5656 __u64 addr;
5757 __u32 metadata_len;
58 __u32 data_len;
58 union {
59 __u32 data_len; /* for non-vectored io */
60 __u32 vec_cnt; /* for vectored io */
61 };
5962 __u32 cdw10;
6063 __u32 cdw11;
6164 __u32 cdw12;
......@@ -67,6 +70,28 @@ struct nvme_passthru_cmd64 {
6770 __u64 result;
6871};
6972
73/* same as struct nvme_passthru_cmd64, minus the 8b result field */
74struct nvme_uring_cmd {
75 __u8 opcode;
76 __u8 flags;
77 __u16 rsvd1;
78 __u32 nsid;
79 __u32 cdw2;
80 __u32 cdw3;
81 __u64 metadata;
82 __u64 addr;
83 __u32 metadata_len;
84 __u32 data_len;
85 __u32 cdw10;
86 __u32 cdw11;
87 __u32 cdw12;
88 __u32 cdw13;
89 __u32 cdw14;
90 __u32 cdw15;
91 __u32 timeout_ms;
92 __u32 rsvd2;
93};
94
7095#define nvme_admin_cmd nvme_passthru_cmd
7196
7297#define NVME_IOCTL_ID _IO('N', 0x40)
......@@ -78,5 +103,12 @@ struct nvme_passthru_cmd64 {
78103#define NVME_IOCTL_RESCAN _IO('N', 0x46)
79104#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
80105#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)
106#define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64)
107
108/* io_uring async commands: */
109#define NVME_URING_CMD_IO _IOWR('N', 0x80, struct nvme_uring_cmd)
110#define NVME_URING_CMD_IO_VEC _IOWR('N', 0x81, struct nvme_uring_cmd)
111#define NVME_URING_CMD_ADMIN _IOWR('N', 0x82, struct nvme_uring_cmd)
112#define NVME_URING_CMD_ADMIN_VEC _IOWR('N', 0x83, struct nvme_uring_cmd)
81113
82114#endif /* _LINUX_NVME_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/omap3isp.h+7-4
......@@ -162,6 +162,7 @@ struct omap3isp_h3a_aewb_config {
162162 * struct omap3isp_stat_data - Statistic data sent to or received from user
163163 * @ts: Timestamp of returned framestats.
164164 * @buf: Pointer to pass to user.
165 * @buf_size: Size of buffer.
165166 * @frame_number: Frame number of requested stats.
166167 * @cur_frame: Current frame number being processed.
167168 * @config_counter: Number of the configuration associated with the data.
......@@ -169,10 +170,12 @@ struct omap3isp_h3a_aewb_config {
169170struct omap3isp_stat_data {
170171 struct timeval ts;
171172 void *buf;
172 __u32 buf_size;
173 __u16 frame_number;
174 __u16 cur_frame;
175 __u16 config_counter;
173 __struct_group(/* no tag */, frame, /* no attrs */,
174 __u32 buf_size;
175 __u16 frame_number;
176 __u16 cur_frame;
177 __u16 config_counter;
178 );
176179};
177180
178181
lib/libc/include/any-linux-any/linux/openvswitch.h+36
......@@ -76,6 +76,8 @@ enum ovs_datapath_cmd {
7676 * datapath. Always present in notifications.
7777 * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the
7878 * datapath. Always present in notifications.
79 * @OVS_DP_ATTR_IFINDEX: Interface index for a new datapath netdev. Only
80 * valid for %OVS_DP_CMD_NEW requests.
7981 *
8082 * These attributes follow the &struct ovs_header within the Generic Netlink
8183 * payload for %OVS_DP_* commands.
......@@ -92,6 +94,7 @@ enum ovs_datapath_attr {
9294 OVS_DP_ATTR_PER_CPU_PIDS, /* Netlink PIDS to receive upcalls in
9395 * per-cpu dispatch mode
9496 */
97 OVS_DP_ATTR_IFINDEX,
9598 __OVS_DP_ATTR_MAX
9699};
97100
......@@ -274,11 +277,25 @@ enum ovs_vport_attr {
274277 OVS_VPORT_ATTR_PAD,
275278 OVS_VPORT_ATTR_IFINDEX,
276279 OVS_VPORT_ATTR_NETNSID,
280 OVS_VPORT_ATTR_UPCALL_STATS,
277281 __OVS_VPORT_ATTR_MAX
278282};
279283
280284#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
281285
286/**
287 * enum ovs_vport_upcall_attr - attributes for %OVS_VPORT_UPCALL* commands
288 * @OVS_VPORT_UPCALL_SUCCESS: 64-bit upcall success packets.
289 * @OVS_VPORT_UPCALL_FAIL: 64-bit upcall fail packets.
290 */
291enum ovs_vport_upcall_attr {
292 OVS_VPORT_UPCALL_ATTR_SUCCESS,
293 OVS_VPORT_UPCALL_ATTR_FAIL,
294 __OVS_VPORT_UPCALL_ATTR_MAX
295};
296
297#define OVS_VPORT_UPCALL_ATTR_MAX (__OVS_VPORT_UPCALL_ATTR_MAX - 1)
298
282299enum {
283300 OVS_VXLAN_EXT_UNSPEC,
284301 OVS_VXLAN_EXT_GBP, /* Flag or __u32 */
......@@ -352,6 +369,20 @@ enum ovs_key_attr {
352369 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6, /* struct ovs_key_ct_tuple_ipv6 */
353370 OVS_KEY_ATTR_NSH, /* Nested set of ovs_nsh_key_* */
354371
372 /* User space decided to squat on types 29 and 30. They are defined
373 * below, but should not be sent to the kernel.
374 *
375 * WARNING: No new types should be added unless they are defined
376 * for both kernel and user space (no 'ifdef's). It's hard
377 * to keep compatibility otherwise.
378 */
379 OVS_KEY_ATTR_PACKET_TYPE, /* be32 packet type */
380 OVS_KEY_ATTR_ND_EXTENSIONS, /* IPv6 Neighbor Discovery extensions */
381
382 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info.
383 * For in-kernel use only.
384 */
385 OVS_KEY_ATTR_IPV6_EXTHDRS, /* struct ovs_key_ipv6_exthdr */
355386 __OVS_KEY_ATTR_MAX
356387};
357388
......@@ -427,6 +458,11 @@ struct ovs_key_ipv6 {
427458 __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */
428459};
429460
461/* separate structure to support backward compatibility with older user space */
462struct ovs_key_ipv6_exthdrs {
463 __u16 hdrs;
464};
465
430466struct ovs_key_tcp {
431467 __be16 tcp_src;
432468 __be16 tcp_dst;
lib/libc/include/any-linux-any/linux/pci_regs.h+105-70
......@@ -301,23 +301,23 @@
301301#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
302302#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
303303
304/* Message Signalled Interrupt registers */
304/* Message Signaled Interrupt registers */
305305
306#define PCI_MSI_FLAGS 2 /* Message Control */
306#define PCI_MSI_FLAGS 0x02 /* Message Control */
307307#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */
308308#define PCI_MSI_FLAGS_QMASK 0x000e /* Maximum queue size available */
309309#define PCI_MSI_FLAGS_QSIZE 0x0070 /* Message queue size configured */
310310#define PCI_MSI_FLAGS_64BIT 0x0080 /* 64-bit addresses allowed */
311311#define PCI_MSI_FLAGS_MASKBIT 0x0100 /* Per-vector masking capable */
312312#define PCI_MSI_RFU 3 /* Rest of capability flags */
313#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
314#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
315#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
316#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
317#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
318#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
319#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
320#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
313#define PCI_MSI_ADDRESS_LO 0x04 /* Lower 32 bits */
314#define PCI_MSI_ADDRESS_HI 0x08 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
315#define PCI_MSI_DATA_32 0x08 /* 16 bits of data for 32-bit devices */
316#define PCI_MSI_MASK_32 0x0c /* Mask bits register for 32-bit devices */
317#define PCI_MSI_PENDING_32 0x10 /* Pending intrs for 32-bit devices */
318#define PCI_MSI_DATA_64 0x0c /* 16 bits of data for 64-bit devices */
319#define PCI_MSI_MASK_64 0x10 /* Mask bits register for 64-bit devices */
320#define PCI_MSI_PENDING_64 0x14 /* Pending intrs for 64-bit devices */
321321
322322/* MSI-X registers (in MSI-X capability) */
323323#define PCI_MSIX_FLAGS 2 /* Message Control */
......@@ -335,10 +335,10 @@
335335
336336/* MSI-X Table entry format (in memory mapped by a BAR) */
337337#define PCI_MSIX_ENTRY_SIZE 16
338#define PCI_MSIX_ENTRY_LOWER_ADDR 0 /* Message Address */
339#define PCI_MSIX_ENTRY_UPPER_ADDR 4 /* Message Upper Address */
340#define PCI_MSIX_ENTRY_DATA 8 /* Message Data */
341#define PCI_MSIX_ENTRY_VECTOR_CTRL 12 /* Vector Control */
338#define PCI_MSIX_ENTRY_LOWER_ADDR 0x0 /* Message Address */
339#define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */
340#define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */
341#define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */
342342#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001
343343
344344/* CompactPCI Hotswap Register */
......@@ -470,7 +470,7 @@
470470
471471/* PCI Express capability registers */
472472
473#define PCI_EXP_FLAGS 2 /* Capabilities register */
473#define PCI_EXP_FLAGS 0x02 /* Capabilities register */
474474#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
475475#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
476476#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
......@@ -484,7 +484,7 @@
484484#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
485485#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
486486#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
487#define PCI_EXP_DEVCAP 4 /* Device capabilities */
487#define PCI_EXP_DEVCAP 0x04 /* Device capabilities */
488488#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
489489#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
490490#define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */
......@@ -497,7 +497,7 @@
497497#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
498498#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
499499#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
500#define PCI_EXP_DEVCTL 8 /* Device Control */
500#define PCI_EXP_DEVCTL 0x08 /* Device Control */
501501#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
502502#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
503503#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
......@@ -522,7 +522,7 @@
522522#define PCI_EXP_DEVCTL_READRQ_2048B 0x4000 /* 2048 Bytes */
523523#define PCI_EXP_DEVCTL_READRQ_4096B 0x5000 /* 4096 Bytes */
524524#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */
525#define PCI_EXP_DEVSTA 10 /* Device Status */
525#define PCI_EXP_DEVSTA 0x0a /* Device Status */
526526#define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */
527527#define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */
528528#define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */
......@@ -530,7 +530,7 @@
530530#define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */
531531#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */
532532#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V1 12 /* v1 endpoints without link end here */
533#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
533#define PCI_EXP_LNKCAP 0x0c /* Link Capabilities */
534534#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
535535#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
536536#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
......@@ -549,7 +549,7 @@
549549#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */
550550#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */
551551#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
552#define PCI_EXP_LNKCTL 16 /* Link Control */
552#define PCI_EXP_LNKCTL 0x10 /* Link Control */
553553#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
554554#define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */
555555#define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */
......@@ -562,7 +562,7 @@
562562#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
563563#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
564564#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Link Autonomous Bandwidth Interrupt Enable */
565#define PCI_EXP_LNKSTA 18 /* Link Status */
565#define PCI_EXP_LNKSTA 0x12 /* Link Status */
566566#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
567567#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
568568#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
......@@ -582,7 +582,7 @@
582582#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
583583#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
584584#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints with link end here */
585#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
585#define PCI_EXP_SLTCAP 0x14 /* Slot Capabilities */
586586#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
587587#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
588588#define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */
......@@ -595,7 +595,7 @@
595595#define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */
596596#define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */
597597#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */
598#define PCI_EXP_SLTCTL 24 /* Slot Control */
598#define PCI_EXP_SLTCTL 0x18 /* Slot Control */
599599#define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */
600600#define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */
601601#define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */
......@@ -616,8 +616,9 @@
616616#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
617617#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
618618#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
619#define PCI_EXP_SLTCTL_ASPL_DISABLE 0x2000 /* Auto Slot Power Limit Disable */
619620#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */
620#define PCI_EXP_SLTSTA 26 /* Slot Status */
621#define PCI_EXP_SLTSTA 0x1a /* Slot Status */
621622#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
622623#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */
623624#define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */
......@@ -627,15 +628,15 @@
627628#define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */
628629#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
629630#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */
630#define PCI_EXP_RTCTL 28 /* Root Control */
631#define PCI_EXP_RTCTL 0x1c /* Root Control */
631632#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */
632633#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
633634#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
634635#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
635636#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */
636#define PCI_EXP_RTCAP 30 /* Root Capabilities */
637#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */
637638#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */
638#define PCI_EXP_RTSTA 32 /* Root Status */
639#define PCI_EXP_RTSTA 0x20 /* Root Status */
639640#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
640641#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
641642/*
......@@ -646,7 +647,7 @@
646647 * Use pcie_capability_read_word() and similar interfaces to use them
647648 * safely.
648649 */
649#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
650#define PCI_EXP_DEVCAP2 0x24 /* Device Capabilities 2 */
650651#define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */
651652#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */
652653#define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */
......@@ -658,7 +659,7 @@
658659#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
659660#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
660661#define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */
661#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
662#define PCI_EXP_DEVCTL2 0x28 /* Device Control 2 */
662663#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */
663664#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */
664665#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */
......@@ -670,9 +671,9 @@
670671#define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */
671672#define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */
672673#define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
673#define PCI_EXP_DEVSTA2 42 /* Device Status 2 */
674#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints without link end here */
675#define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */
674#define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */
675#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */
676#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */
676677#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
677678#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
678679#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */
......@@ -680,7 +681,7 @@
680681#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */
681682#define PCI_EXP_LNKCAP2_SLS_64_0GB 0x00000040 /* Supported Speed 64GT/s */
682683#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */
683#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
684#define PCI_EXP_LNKCTL2 0x30 /* Link Control 2 */
684685#define PCI_EXP_LNKCTL2_TLS 0x000f
685686#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */
686687#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */
......@@ -691,12 +692,13 @@
691692#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */
692693#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */
693694#define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */
694#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
695#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */
696#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */
695#define PCI_EXP_LNKSTA2 0x32 /* Link Status 2 */
696#define PCI_EXP_LNKSTA2_FLIT 0x0400 /* Flit Mode Status */
697#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32 /* end of v2 EPs w/ link */
698#define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities 2 */
697699#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */
698#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
699#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */
700#define PCI_EXP_SLTCTL2 0x38 /* Slot Control 2 */
701#define PCI_EXP_SLTSTA2 0x3a /* Slot Status 2 */
700702
701703/* Extended Capabilities (PCI-X 2.0 and Express) */
702704#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
......@@ -736,13 +738,14 @@
736738#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
737739#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
738740#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
739#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT
741#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
742#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
740743
741744#define PCI_EXT_CAP_DSN_SIZEOF 12
742745#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
743746
744747/* Advanced Error Reporting */
745#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
748#define PCI_ERR_UNCOR_STATUS 0x04 /* Uncorrectable Error Status */
746749#define PCI_ERR_UNC_UND 0x00000001 /* Undefined */
747750#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
748751#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
......@@ -760,11 +763,11 @@
760763#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
761764#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
762765#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
763#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
766#define PCI_ERR_UNCOR_MASK 0x08 /* Uncorrectable Error Mask */
764767 /* Same bits as above */
765#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
768#define PCI_ERR_UNCOR_SEVER 0x0c /* Uncorrectable Error Severity */
766769 /* Same bits as above */
767#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
770#define PCI_ERR_COR_STATUS 0x10 /* Correctable Error Status */
768771#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
769772#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
770773#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
......@@ -773,20 +776,20 @@
773776#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
774777#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
775778#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
776#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
779#define PCI_ERR_COR_MASK 0x14 /* Correctable Error Mask */
777780 /* Same bits as above */
778#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
779#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
781#define PCI_ERR_CAP 0x18 /* Advanced Error Capabilities & Ctrl*/
782#define PCI_ERR_CAP_FEP(x) ((x) & 0x1f) /* First Error Pointer */
780783#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
781784#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
782785#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
783786#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
784#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
785#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
787#define PCI_ERR_HEADER_LOG 0x1c /* Header Log Register (16 bytes) */
788#define PCI_ERR_ROOT_COMMAND 0x2c /* Root Error Command */
786789#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */
787790#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */
788791#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */
789#define PCI_ERR_ROOT_STATUS 48
792#define PCI_ERR_ROOT_STATUS 0x30
790793#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
791794#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */
792795#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */
......@@ -795,52 +798,52 @@
795798#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
796799#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
797800#define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */
798#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
801#define PCI_ERR_ROOT_ERR_SRC 0x34 /* Error Source Identification */
799802
800803/* Virtual Channel */
801#define PCI_VC_PORT_CAP1 4
804#define PCI_VC_PORT_CAP1 0x04
802805#define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */
803806#define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */
804807#define PCI_VC_CAP1_ARB_SIZE 0x00000c00
805#define PCI_VC_PORT_CAP2 8
808#define PCI_VC_PORT_CAP2 0x08
806809#define PCI_VC_CAP2_32_PHASE 0x00000002
807810#define PCI_VC_CAP2_64_PHASE 0x00000004
808811#define PCI_VC_CAP2_128_PHASE 0x00000008
809812#define PCI_VC_CAP2_ARB_OFF 0xff000000
810#define PCI_VC_PORT_CTRL 12
813#define PCI_VC_PORT_CTRL 0x0c
811814#define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001
812#define PCI_VC_PORT_STATUS 14
815#define PCI_VC_PORT_STATUS 0x0e
813816#define PCI_VC_PORT_STATUS_TABLE 0x00000001
814#define PCI_VC_RES_CAP 16
817#define PCI_VC_RES_CAP 0x10
815818#define PCI_VC_RES_CAP_32_PHASE 0x00000002
816819#define PCI_VC_RES_CAP_64_PHASE 0x00000004
817820#define PCI_VC_RES_CAP_128_PHASE 0x00000008
818821#define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010
819822#define PCI_VC_RES_CAP_256_PHASE 0x00000020
820823#define PCI_VC_RES_CAP_ARB_OFF 0xff000000
821#define PCI_VC_RES_CTRL 20
824#define PCI_VC_RES_CTRL 0x14
822825#define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000
823826#define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000
824827#define PCI_VC_RES_CTRL_ID 0x07000000
825828#define PCI_VC_RES_CTRL_ENABLE 0x80000000
826#define PCI_VC_RES_STATUS 26
829#define PCI_VC_RES_STATUS 0x1a
827830#define PCI_VC_RES_STATUS_TABLE 0x00000001
828831#define PCI_VC_RES_STATUS_NEGO 0x00000002
829832#define PCI_CAP_VC_BASE_SIZEOF 0x10
830#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
833#define PCI_CAP_VC_PER_VC_SIZEOF 0x0c
831834
832835/* Power Budgeting */
833#define PCI_PWR_DSR 4 /* Data Select Register */
834#define PCI_PWR_DATA 8 /* Data Register */
836#define PCI_PWR_DSR 0x04 /* Data Select Register */
837#define PCI_PWR_DATA 0x08 /* Data Register */
835838#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
836839#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
837840#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
838841#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
839842#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
840843#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
841#define PCI_PWR_CAP 12 /* Capability */
844#define PCI_PWR_CAP 0x0c /* Capability */
842845#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
843#define PCI_EXT_CAP_PWR_SIZEOF 16
846#define PCI_EXT_CAP_PWR_SIZEOF 0x10
844847
845848/* Root Complex Event Collector Endpoint Association */
846849#define PCI_RCEC_RCIEP_BITMAP 4 /* Associated Bitmap for RCiEPs */
......@@ -964,7 +967,7 @@
964967#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
965968#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
966969#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
967#define PCI_EXT_CAP_SRIOV_SIZEOF 64
970#define PCI_EXT_CAP_SRIOV_SIZEOF 0x40
968971
969972#define PCI_LTR_MAX_SNOOP_LAT 0x4
970973#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
......@@ -1017,12 +1020,12 @@
10171020#define PCI_TPH_LOC_NONE 0x000 /* no location */
10181021#define PCI_TPH_LOC_CAP 0x200 /* in capability */
10191022#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
1020#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
1021#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
1022#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
1023#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST table mask */
1024#define PCI_TPH_CAP_ST_SHIFT 16 /* ST table shift */
1025#define PCI_TPH_BASE_SIZEOF 0xc /* size with no ST table */
10231026
10241027/* Downstream Port Containment */
1025#define PCI_EXP_DPC_CAP 4 /* DPC Capability */
1028#define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */
10261029#define PCI_EXP_DPC_IRQ 0x001F /* Interrupt Message Number */
10271030#define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */
10281031#define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */
......@@ -1030,19 +1033,19 @@
10301033#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */
10311034#define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */
10321035
1033#define PCI_EXP_DPC_CTL 6 /* DPC control */
1036#define PCI_EXP_DPC_CTL 0x06 /* DPC control */
10341037#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */
10351038#define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */
10361039#define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */
10371040
1038#define PCI_EXP_DPC_STATUS 8 /* DPC Status */
1041#define PCI_EXP_DPC_STATUS 0x08 /* DPC Status */
10391042#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */
10401043#define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */
10411044#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */
10421045#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */
10431046#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */
10441047
1045#define PCI_EXP_DPC_SOURCE_ID 10 /* DPC Source Identifier */
1048#define PCI_EXP_DPC_SOURCE_ID 0x0A /* DPC Source Identifier */
10461049
10471050#define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */
10481051#define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO Mask */
......@@ -1056,6 +1059,7 @@
10561059/* Precision Time Measurement */
10571060#define PCI_PTM_CAP 0x04 /* PTM Capability */
10581061#define PCI_PTM_CAP_REQ 0x00000001 /* Requester capable */
1062#define PCI_PTM_CAP_RES 0x00000002 /* Responder capable */
10591063#define PCI_PTM_CAP_ROOT 0x00000004 /* Root capable */
10601064#define PCI_PTM_GRANULARITY_MASK 0x0000FF00 /* Clock granularity */
10611065#define PCI_PTM_CTRL 0x08 /* PTM Control */
......@@ -1086,7 +1090,11 @@
10861090
10871091/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */
10881092#define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */
1093#define PCI_DVSEC_HEADER1_VID(x) ((x) & 0xffff)
1094#define PCI_DVSEC_HEADER1_REV(x) (((x) >> 16) & 0xf)
1095#define PCI_DVSEC_HEADER1_LEN(x) (((x) >> 20) & 0xfff)
10891096#define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */
1097#define PCI_DVSEC_HEADER2_ID(x) ((x) & 0xffff)
10901098
10911099/* Data Link Feature */
10921100#define PCI_DLF_CAP 0x04 /* Capabilities Register */
......@@ -1098,4 +1106,31 @@
10981106#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
10991107#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
11001108
1109/* Data Object Exchange */
1110#define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */
1111#define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */
1112#define PCI_DOE_CAP_INT_MSG_NUM 0x00000ffe /* Interrupt Message Number */
1113#define PCI_DOE_CTRL 0x08 /* DOE Control Register */
1114#define PCI_DOE_CTRL_ABORT 0x00000001 /* DOE Abort */
1115#define PCI_DOE_CTRL_INT_EN 0x00000002 /* DOE Interrupt Enable */
1116#define PCI_DOE_CTRL_GO 0x80000000 /* DOE Go */
1117#define PCI_DOE_STATUS 0x0c /* DOE Status Register */
1118#define PCI_DOE_STATUS_BUSY 0x00000001 /* DOE Busy */
1119#define PCI_DOE_STATUS_INT_STATUS 0x00000002 /* DOE Interrupt Status */
1120#define PCI_DOE_STATUS_ERROR 0x00000004 /* DOE Error */
1121#define PCI_DOE_STATUS_DATA_OBJECT_READY 0x80000000 /* Data Object Ready */
1122#define PCI_DOE_WRITE 0x10 /* DOE Write Data Mailbox Register */
1123#define PCI_DOE_READ 0x14 /* DOE Read Data Mailbox Register */
1124#define PCI_DOE_CAP_SIZEOF 0x18 /* Size of DOE register block */
1125
1126/* DOE Data Object - note not actually registers */
1127#define PCI_DOE_DATA_OBJECT_HEADER_1_VID 0x0000ffff
1128#define PCI_DOE_DATA_OBJECT_HEADER_1_TYPE 0x00ff0000
1129#define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff
1130
1131#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff
1132#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff
1133#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000
1134#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000
1135
11011136#endif /* LINUX_PCI_REGS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/perf_event.h+68-8
......@@ -164,8 +164,6 @@ enum perf_event_sample_format {
164164 PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,
165165
166166 PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */
167
168 __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
169167};
170168
171169#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
......@@ -204,6 +202,8 @@ enum perf_branch_sample_type_shift {
204202
205203 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */
206204
205 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */
206
207207 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208208};
209209
......@@ -233,6 +233,8 @@ enum perf_branch_sample_type {
233233
234234 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
235235
236 PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
237
236238 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
237239};
238240
......@@ -251,9 +253,50 @@ enum {
251253 PERF_BR_SYSRET = 8, /* syscall return */
252254 PERF_BR_COND_CALL = 9, /* conditional function call */
253255 PERF_BR_COND_RET = 10, /* conditional function return */
256 PERF_BR_ERET = 11, /* exception return */
257 PERF_BR_IRQ = 12, /* irq */
258 PERF_BR_SERROR = 13, /* system error */
259 PERF_BR_NO_TX = 14, /* not in transaction */
260 PERF_BR_EXTEND_ABI = 15, /* extend ABI */
254261 PERF_BR_MAX,
255262};
256263
264/*
265 * Common branch speculation outcome classification
266 */
267enum {
268 PERF_BR_SPEC_NA = 0, /* Not available */
269 PERF_BR_SPEC_WRONG_PATH = 1, /* Speculative but on wrong path */
270 PERF_BR_NON_SPEC_CORRECT_PATH = 2, /* Non-speculative but on correct path */
271 PERF_BR_SPEC_CORRECT_PATH = 3, /* Speculative and on correct path */
272 PERF_BR_SPEC_MAX,
273};
274
275enum {
276 PERF_BR_NEW_FAULT_ALGN = 0, /* Alignment fault */
277 PERF_BR_NEW_FAULT_DATA = 1, /* Data fault */
278 PERF_BR_NEW_FAULT_INST = 2, /* Inst fault */
279 PERF_BR_NEW_ARCH_1 = 3, /* Architecture specific */
280 PERF_BR_NEW_ARCH_2 = 4, /* Architecture specific */
281 PERF_BR_NEW_ARCH_3 = 5, /* Architecture specific */
282 PERF_BR_NEW_ARCH_4 = 6, /* Architecture specific */
283 PERF_BR_NEW_ARCH_5 = 7, /* Architecture specific */
284 PERF_BR_NEW_MAX,
285};
286
287enum {
288 PERF_BR_PRIV_UNKNOWN = 0,
289 PERF_BR_PRIV_USER = 1,
290 PERF_BR_PRIV_KERNEL = 2,
291 PERF_BR_PRIV_HV = 3,
292};
293
294#define PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1
295#define PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2
296#define PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3
297#define PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4
298#define PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5
299
257300#define PERF_SAMPLE_BRANCH_PLM_ALL \
258301 (PERF_SAMPLE_BRANCH_USER|\
259302 PERF_SAMPLE_BRANCH_KERNEL|\
......@@ -299,6 +342,7 @@ enum {
299342 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
300343 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
301344 * { u64 id; } && PERF_FORMAT_ID
345 * { u64 lost; } && PERF_FORMAT_LOST
302346 * } && !PERF_FORMAT_GROUP
303347 *
304348 * { u64 nr;
......@@ -306,6 +350,7 @@ enum {
306350 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
307351 * { u64 value;
308352 * { u64 id; } && PERF_FORMAT_ID
353 * { u64 lost; } && PERF_FORMAT_LOST
309354 * } cntr[nr];
310355 * } && PERF_FORMAT_GROUP
311356 * };
......@@ -315,8 +360,9 @@ enum perf_event_read_format {
315360 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
316361 PERF_FORMAT_ID = 1U << 2,
317362 PERF_FORMAT_GROUP = 1U << 3,
363 PERF_FORMAT_LOST = 1U << 4,
318364
319 PERF_FORMAT_MAX = 1U << 4, /* non-ABI */
365 PERF_FORMAT_MAX = 1U << 5, /* non-ABI */
320366};
321367
322368#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
......@@ -328,6 +374,7 @@ enum perf_event_read_format {
328374#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */
329375#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */
330376#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */
377#define PERF_ATTR_SIZE_VER8 136 /* add: config3 */
331378
332379/*
333380 * Hardware event_id to monitor via a performance monitoring event:
......@@ -465,8 +512,12 @@ struct perf_event_attr {
465512 /*
466513 * User provided data if sigtrap=1, passed back to user via
467514 * siginfo_t::si_perf_data, e.g. to permit user to identify the event.
515 * Note, siginfo_t::si_perf_data is long-sized, and sig_data will be
516 * truncated accordingly on 32 bit architectures.
468517 */
469518 __u64 sig_data;
519
520 __u64 config3; /* extension of config2 */
470521};
471522
472523/*
......@@ -487,7 +538,7 @@ struct perf_event_query_bpf {
487538 /*
488539 * User provided buffer to store program ids
489540 */
490 __u32 ids[0];
541 __u32 ids[];
491542};
492543
493544/*
......@@ -1288,7 +1339,9 @@ union perf_mem_data_src {
12881339#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
12891340#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
12901341#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
1291/* 5-0xa available */
1342/* 5-0x8 available */
1343#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */
1344#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */
12921345#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
12931346#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */
12941347#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */
......@@ -1306,7 +1359,7 @@ union perf_mem_data_src {
13061359#define PERF_MEM_SNOOP_SHIFT 19
13071360
13081361#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1309/* 1 free */
1362#define PERF_MEM_SNOOPX_PEER 0x02 /* xfer from peer */
13101363#define PERF_MEM_SNOOPX_SHIFT 38
13111364
13121365/* locked instruction */
......@@ -1332,7 +1385,10 @@ union perf_mem_data_src {
13321385
13331386/* hop level */
13341387#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */
1335/* 2-7 available */
1388#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */
1389#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */
1390#define PERF_MEM_HOPS_3 0x04 /* remote board */
1391/* 5-7 available */
13361392#define PERF_MEM_HOPS_SHIFT 43
13371393
13381394#define PERF_MEM_S(a, s) \
......@@ -1353,6 +1409,7 @@ union perf_mem_data_src {
13531409 * abort: aborting a hardware transaction
13541410 * cycles: cycles from last branch (or 0 if not supported)
13551411 * type: branch type
1412 * spec: branch speculation info (or 0 if not supported)
13561413 */
13571414struct perf_branch_entry {
13581415 __u64 from;
......@@ -1363,7 +1420,10 @@ struct perf_branch_entry {
13631420 abort:1, /* transaction abort */
13641421 cycles:16, /* cycle count to last branch */
13651422 type:4, /* branch type */
1366 reserved:40;
1423 spec:2, /* branch speculation info */
1424 new_type:4, /* additional branch type */
1425 priv:3, /* privilege level */
1426 reserved:31;
13671427};
13681428
13691429union perf_sample_weight {
lib/libc/include/any-linux-any/linux/pfkeyv2.h+2
......@@ -309,6 +309,7 @@ struct sadb_x_filter {
309309#define SADB_X_AALG_SHA2_512HMAC 7
310310#define SADB_X_AALG_RIPEMD160HMAC 8
311311#define SADB_X_AALG_AES_XCBC_MAC 9
312#define SADB_X_AALG_SM3_256HMAC 10
312313#define SADB_X_AALG_NULL 251 /* kame */
313314#define SADB_AALG_MAX 251
314315
......@@ -329,6 +330,7 @@ struct sadb_x_filter {
329330#define SADB_X_EALG_AES_GCM_ICV16 20
330331#define SADB_X_EALG_CAMELLIACBC 22
331332#define SADB_X_EALG_NULL_AES_GMAC 23
333#define SADB_X_EALG_SM4CBC 24
332334#define SADB_EALG_MAX 253 /* last EALG */
333335/* private allocations should use 249-255 (RFC2407) */
334336#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
lib/libc/include/any-linux-any/linux/pfrut.h created+262
......@@ -0,0 +1,262 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Platform Firmware Runtime Update header
4 *
5 * Copyright(c) 2021 Intel Corporation. All rights reserved.
6 */
7#ifndef __PFRUT_H__
8#define __PFRUT_H__
9
10#include <linux/ioctl.h>
11#include <linux/types.h>
12
13#define PFRUT_IOCTL_MAGIC 0xEE
14
15/**
16 * PFRU_IOC_SET_REV - _IOW(PFRUT_IOCTL_MAGIC, 0x01, unsigned int)
17 *
18 * Return:
19 * * 0 - success
20 * * -EFAULT - fail to read the revision id
21 * * -EINVAL - user provides an invalid revision id
22 *
23 * Set the Revision ID for Platform Firmware Runtime Update.
24 */
25#define PFRU_IOC_SET_REV _IOW(PFRUT_IOCTL_MAGIC, 0x01, unsigned int)
26
27/**
28 * PFRU_IOC_STAGE - _IOW(PFRUT_IOCTL_MAGIC, 0x02, unsigned int)
29 *
30 * Return:
31 * * 0 - success
32 * * -EINVAL - stage phase returns invalid result
33 *
34 * Stage a capsule image from communication buffer and perform authentication.
35 */
36#define PFRU_IOC_STAGE _IOW(PFRUT_IOCTL_MAGIC, 0x02, unsigned int)
37
38/**
39 * PFRU_IOC_ACTIVATE - _IOW(PFRUT_IOCTL_MAGIC, 0x03, unsigned int)
40 *
41 * Return:
42 * * 0 - success
43 * * -EINVAL - activate phase returns invalid result
44 *
45 * Activate a previously staged capsule image.
46 */
47#define PFRU_IOC_ACTIVATE _IOW(PFRUT_IOCTL_MAGIC, 0x03, unsigned int)
48
49/**
50 * PFRU_IOC_STAGE_ACTIVATE - _IOW(PFRUT_IOCTL_MAGIC, 0x04, unsigned int)
51 *
52 * Return:
53 * * 0 - success
54 * * -EINVAL - stage/activate phase returns invalid result.
55 *
56 * Perform both stage and activation action.
57 */
58#define PFRU_IOC_STAGE_ACTIVATE _IOW(PFRUT_IOCTL_MAGIC, 0x04, unsigned int)
59
60/**
61 * PFRU_IOC_QUERY_CAP - _IOR(PFRUT_IOCTL_MAGIC, 0x05,
62 * struct pfru_update_cap_info)
63 *
64 * Return:
65 * * 0 - success
66 * * -EINVAL - query phase returns invalid result
67 * * -EFAULT - the result fails to be copied to userspace
68 *
69 * Retrieve information on the Platform Firmware Runtime Update capability.
70 * The information is a struct pfru_update_cap_info.
71 */
72#define PFRU_IOC_QUERY_CAP _IOR(PFRUT_IOCTL_MAGIC, 0x05, struct pfru_update_cap_info)
73
74/**
75 * struct pfru_payload_hdr - Capsule file payload header.
76 *
77 * @sig: Signature of this capsule file.
78 * @hdr_version: Revision of this header structure.
79 * @hdr_size: Size of this header, including the OemHeader bytes.
80 * @hw_ver: The supported firmware version.
81 * @rt_ver: Version of the code injection image.
82 * @platform_id: A platform specific GUID to specify the platform what
83 * this capsule image support.
84 */
85struct pfru_payload_hdr {
86 __u32 sig;
87 __u32 hdr_version;
88 __u32 hdr_size;
89 __u32 hw_ver;
90 __u32 rt_ver;
91 __u8 platform_id[16];
92};
93
94enum pfru_dsm_status {
95 DSM_SUCCEED = 0,
96 DSM_FUNC_NOT_SUPPORT = 1,
97 DSM_INVAL_INPUT = 2,
98 DSM_HARDWARE_ERR = 3,
99 DSM_RETRY_SUGGESTED = 4,
100 DSM_UNKNOWN = 5,
101 DSM_FUNC_SPEC_ERR = 6,
102};
103
104/**
105 * struct pfru_update_cap_info - Runtime update capability information.
106 *
107 * @status: Indicator of whether this query succeed.
108 * @update_cap: Bitmap to indicate whether the feature is supported.
109 * @code_type: A buffer containing an image type GUID.
110 * @fw_version: Platform firmware version.
111 * @code_rt_version: Code injection runtime version for anti-rollback.
112 * @drv_type: A buffer containing an image type GUID.
113 * @drv_rt_version: The version of the driver update runtime code.
114 * @drv_svn: The secure version number(SVN) of the driver update runtime code.
115 * @platform_id: A buffer containing a platform ID GUID.
116 * @oem_id: A buffer containing an OEM ID GUID.
117 * @oem_info_len: Length of the buffer containing the vendor specific information.
118 */
119struct pfru_update_cap_info {
120 __u32 status;
121 __u32 update_cap;
122
123 __u8 code_type[16];
124 __u32 fw_version;
125 __u32 code_rt_version;
126
127 __u8 drv_type[16];
128 __u32 drv_rt_version;
129 __u32 drv_svn;
130
131 __u8 platform_id[16];
132 __u8 oem_id[16];
133
134 __u32 oem_info_len;
135};
136
137/**
138 * struct pfru_com_buf_info - Communication buffer information.
139 *
140 * @status: Indicator of whether this query succeed.
141 * @ext_status: Implementation specific query result.
142 * @addr_lo: Low 32bit physical address of the communication buffer to hold
143 * a runtime update package.
144 * @addr_hi: High 32bit physical address of the communication buffer to hold
145 * a runtime update package.
146 * @buf_size: Maximum size in bytes of the communication buffer.
147 */
148struct pfru_com_buf_info {
149 __u32 status;
150 __u32 ext_status;
151 __u64 addr_lo;
152 __u64 addr_hi;
153 __u32 buf_size;
154};
155
156/**
157 * struct pfru_updated_result - Platform firmware runtime update result information.
158 * @status: Indicator of whether this update succeed.
159 * @ext_status: Implementation specific update result.
160 * @low_auth_time: Low 32bit value of image authentication time in nanosecond.
161 * @high_auth_time: High 32bit value of image authentication time in nanosecond.
162 * @low_exec_time: Low 32bit value of image execution time in nanosecond.
163 * @high_exec_time: High 32bit value of image execution time in nanosecond.
164 */
165struct pfru_updated_result {
166 __u32 status;
167 __u32 ext_status;
168 __u64 low_auth_time;
169 __u64 high_auth_time;
170 __u64 low_exec_time;
171 __u64 high_exec_time;
172};
173
174/**
175 * struct pfrt_log_data_info - Log Data from telemetry service.
176 * @status: Indicator of whether this update succeed.
177 * @ext_status: Implementation specific update result.
178 * @chunk1_addr_lo: Low 32bit physical address of the telemetry data chunk1
179 * starting address.
180 * @chunk1_addr_hi: High 32bit physical address of the telemetry data chunk1
181 * starting address.
182 * @chunk2_addr_lo: Low 32bit physical address of the telemetry data chunk2
183 * starting address.
184 * @chunk2_addr_hi: High 32bit physical address of the telemetry data chunk2
185 * starting address.
186 * @max_data_size: Maximum supported size of data of all data chunks combined.
187 * @chunk1_size: Data size in bytes of the telemetry data chunk1 buffer.
188 * @chunk2_size: Data size in bytes of the telemetry data chunk2 buffer.
189 * @rollover_cnt: Number of times telemetry data buffer is overwritten
190 * since telemetry buffer reset.
191 * @reset_cnt: Number of times telemetry services resets that results in
192 * rollover count and data chunk buffers are reset.
193 */
194struct pfrt_log_data_info {
195 __u32 status;
196 __u32 ext_status;
197 __u64 chunk1_addr_lo;
198 __u64 chunk1_addr_hi;
199 __u64 chunk2_addr_lo;
200 __u64 chunk2_addr_hi;
201 __u32 max_data_size;
202 __u32 chunk1_size;
203 __u32 chunk2_size;
204 __u32 rollover_cnt;
205 __u32 reset_cnt;
206};
207
208/**
209 * struct pfrt_log_info - Telemetry log information.
210 * @log_level: The telemetry log level.
211 * @log_type: The telemetry log type(history and execution).
212 * @log_revid: The telemetry log revision id.
213 */
214struct pfrt_log_info {
215 __u32 log_level;
216 __u32 log_type;
217 __u32 log_revid;
218};
219
220/**
221 * PFRT_LOG_IOC_SET_INFO - _IOW(PFRUT_IOCTL_MAGIC, 0x06,
222 * struct pfrt_log_info)
223 *
224 * Return:
225 * * 0 - success
226 * * -EFAULT - fail to get the setting parameter
227 * * -EINVAL - fail to set the log level
228 *
229 * Set the PFRT log level and log type. The input information is
230 * a struct pfrt_log_info.
231 */
232#define PFRT_LOG_IOC_SET_INFO _IOW(PFRUT_IOCTL_MAGIC, 0x06, struct pfrt_log_info)
233
234/**
235 * PFRT_LOG_IOC_GET_INFO - _IOR(PFRUT_IOCTL_MAGIC, 0x07,
236 * struct pfrt_log_info)
237 *
238 * Return:
239 * * 0 - success
240 * * -EINVAL - fail to get the log level
241 * * -EFAULT - fail to copy the result back to userspace
242 *
243 * Retrieve log level and log type of the telemetry. The information is
244 * a struct pfrt_log_info.
245 */
246#define PFRT_LOG_IOC_GET_INFO _IOR(PFRUT_IOCTL_MAGIC, 0x07, struct pfrt_log_info)
247
248/**
249 * PFRT_LOG_IOC_GET_DATA_INFO - _IOR(PFRUT_IOCTL_MAGIC, 0x08,
250 * struct pfrt_log_data_info)
251 *
252 * Return:
253 * * 0 - success
254 * * -EINVAL - fail to get the log buffer information
255 * * -EFAULT - fail to copy the log buffer information to userspace
256 *
257 * Retrieve data information about the telemetry. The information
258 * is a struct pfrt_log_data_info.
259 */
260#define PFRT_LOG_IOC_GET_DATA_INFO _IOR(PFRUT_IOCTL_MAGIC, 0x08, struct pfrt_log_data_info)
261
262#endif /* __PFRUT_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pkt_cls.h+30-5
......@@ -19,13 +19,16 @@ enum {
1919 TCA_ACT_FLAGS,
2020 TCA_ACT_HW_STATS,
2121 TCA_ACT_USED_HW_STATS,
22 TCA_ACT_IN_HW_COUNT,
2223 __TCA_ACT_MAX
2324};
2425
2526/* See other TCA_ACT_FLAGS_ * flags in include/net/act_api.h. */
26#define TCA_ACT_FLAGS_NO_PERCPU_STATS 1 /* Don't use percpu allocator for
27 * actions stats.
28 */
27#define TCA_ACT_FLAGS_NO_PERCPU_STATS (1 << 0) /* Don't use percpu allocator for
28 * actions stats.
29 */
30#define TCA_ACT_FLAGS_SKIP_HW (1 << 1) /* don't offload action to HW */
31#define TCA_ACT_FLAGS_SKIP_SW (1 << 2) /* don't use action in SW */
2932
3033/* tca HW stats type
3134 * When user does not pass the attribute, he does not care.
......@@ -253,7 +256,7 @@ struct tc_u32_sel {
253256
254257 short hoff;
255258 __be32 hmask;
256 struct tc_u32_key keys[0];
259 struct tc_u32_key keys[];
257260};
258261
259262struct tc_u32_mark {
......@@ -265,7 +268,7 @@ struct tc_u32_mark {
265268struct tc_u32_pcnt {
266269 __u64 rcnt;
267270 __u64 rhit;
268 __u64 kcnts[0];
271 __u64 kcnts[];
269272};
270273
271274/* Flags */
......@@ -584,6 +587,13 @@ enum {
584587 TCA_FLOWER_KEY_HASH, /* u32 */
585588 TCA_FLOWER_KEY_HASH_MASK, /* u32 */
586589
590 TCA_FLOWER_KEY_NUM_OF_VLANS, /* u8 */
591
592 TCA_FLOWER_KEY_PPPOE_SID, /* be16 */
593 TCA_FLOWER_KEY_PPP_PROTO, /* be16 */
594
595 TCA_FLOWER_KEY_L2TPV3_SID, /* be32 */
596
587597 __TCA_FLOWER_MAX,
588598};
589599
......@@ -613,6 +623,10 @@ enum {
613623 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_
614624 * attributes
615625 */
626 TCA_FLOWER_KEY_ENC_OPTS_GTP, /* Nested
627 * TCA_FLOWER_KEY_ENC_OPT_GTP_
628 * attributes
629 */
616630 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
617631};
618632
......@@ -651,6 +665,17 @@ enum {
651665#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \
652666 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)
653667
668enum {
669 TCA_FLOWER_KEY_ENC_OPT_GTP_UNSPEC,
670 TCA_FLOWER_KEY_ENC_OPT_GTP_PDU_TYPE, /* u8 */
671 TCA_FLOWER_KEY_ENC_OPT_GTP_QFI, /* u8 */
672
673 __TCA_FLOWER_KEY_ENC_OPT_GTP_MAX,
674};
675
676#define TCA_FLOWER_KEY_ENC_OPT_GTP_MAX \
677 (__TCA_FLOWER_KEY_ENC_OPT_GTP_MAX - 1)
678
654679enum {
655680 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
656681 TCA_FLOWER_KEY_MPLS_OPTS_LSE,
lib/libc/include/any-linux-any/linux/pkt_sched.h+11
......@@ -1232,6 +1232,16 @@ enum {
12321232#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0)
12331233#define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD _BITUL(1)
12341234
1235enum {
1236 TCA_TAPRIO_TC_ENTRY_UNSPEC,
1237 TCA_TAPRIO_TC_ENTRY_INDEX, /* u32 */
1238 TCA_TAPRIO_TC_ENTRY_MAX_SDU, /* u32 */
1239
1240 /* add new constants above here */
1241 __TCA_TAPRIO_TC_ENTRY_CNT,
1242 TCA_TAPRIO_TC_ENTRY_MAX = (__TCA_TAPRIO_TC_ENTRY_CNT - 1)
1243};
1244
12351245enum {
12361246 TCA_TAPRIO_ATTR_UNSPEC,
12371247 TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */
......@@ -1245,6 +1255,7 @@ enum {
12451255 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
12461256 TCA_TAPRIO_ATTR_FLAGS, /* u32 */
12471257 TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */
1258 TCA_TAPRIO_ATTR_TC_ENTRY, /* nest */
12481259 __TCA_TAPRIO_ATTR_MAX,
12491260};
12501261
lib/libc/include/any-linux-any/linux/pr.h+17
......@@ -4,6 +4,23 @@
44
55#include <linux/types.h>
66
7enum pr_status {
8 PR_STS_SUCCESS = 0x0,
9 /*
10 * The following error codes are based on SCSI, because the interface
11 * was originally created for it and has existing users.
12 */
13 /* Generic device failure. */
14 PR_STS_IOERR = 0x2,
15 PR_STS_RESERVATION_CONFLICT = 0x18,
16 /* Temporary path failure that can be retried. */
17 PR_STS_RETRY_PATH_FAILURE = 0xe0000,
18 /* The request was failed due to a fast failure timer. */
19 PR_STS_PATH_FAST_FAILED = 0xf0000,
20 /* The path cannot be reached and has been marked as failed. */
21 PR_STS_PATH_FAILED = 0x10000,
22};
23
724enum pr_type {
825 PR_WRITE_EXCLUSIVE = 1,
926 PR_EXCLUSIVE_ACCESS = 2,
lib/libc/include/any-linux-any/linux/prctl.h+18
......@@ -272,4 +272,22 @@ struct prctl_mm_map {
272272# define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1
273273# define PR_SCHED_CORE_SCOPE_PROCESS_GROUP 2
274274
275/* arm64 Scalable Matrix Extension controls */
276/* Flag values must be in sync with SVE versions */
277#define PR_SME_SET_VL 63 /* set task vector length */
278# define PR_SME_SET_VL_ONEXEC (1 << 18) /* defer effect until exec */
279#define PR_SME_GET_VL 64 /* get task vector length */
280/* Bits common to PR_SME_SET_VL and PR_SME_GET_VL */
281# define PR_SME_VL_LEN_MASK 0xffff
282# define PR_SME_VL_INHERIT (1 << 17) /* inherit across exec */
283
284/* Memory deny write / execute */
285#define PR_SET_MDWE 65
286# define PR_MDWE_REFUSE_EXEC_GAIN 1
287
288#define PR_GET_MDWE 66
289
290#define PR_SET_VMA 0x53564d41
291# define PR_SET_VMA_ANON_NAME 0
292
275293#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psci.h+18
......@@ -48,12 +48,26 @@
4848#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)
4949
5050#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)
51#define PSCI_1_0_FN_CPU_FREEZE PSCI_0_2_FN(11)
52#define PSCI_1_0_FN_CPU_DEFAULT_SUSPEND PSCI_0_2_FN(12)
53#define PSCI_1_0_FN_NODE_HW_STATE PSCI_0_2_FN(13)
5154#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)
5255#define PSCI_1_0_FN_SET_SUSPEND_MODE PSCI_0_2_FN(15)
56#define PSCI_1_0_FN_STAT_RESIDENCY PSCI_0_2_FN(16)
57#define PSCI_1_0_FN_STAT_COUNT PSCI_0_2_FN(17)
58
5359#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)
60#define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19)
61#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20)
5462
63#define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12)
64#define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13)
5565#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)
66#define PSCI_1_0_FN64_STAT_RESIDENCY PSCI_0_2_FN64(16)
67#define PSCI_1_0_FN64_STAT_COUNT PSCI_0_2_FN64(17)
68
5669#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)
70#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20)
5771
5872/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
5973#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
......@@ -82,6 +96,10 @@
8296#define PSCI_0_2_TOS_UP_NO_MIGRATE 1
8397#define PSCI_0_2_TOS_MP 2
8498
99/* PSCI v1.1 reset type encoding for SYSTEM_RESET2 */
100#define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET 0
101#define PSCI_1_1_RESET_TYPE_VENDOR_START 0x80000000U
102
85103/* PSCI version decoding (independent of PSCI version) */
86104#define PSCI_VERSION_MAJOR_SHIFT 16
87105#define PSCI_VERSION_MINOR_MASK \
lib/libc/include/any-linux-any/linux/ptrace.h+1-1
......@@ -114,7 +114,7 @@ struct ptrace_rseq_configuration {
114114
115115/*
116116 * These values are stored in task->ptrace_message
117 * by tracehook_report_syscall_* to describe the current syscall-stop.
117 * by ptrace_stop to describe the current syscall-stop.
118118 */
119119#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
120120#define PTRACE_EVENTMSG_SYSCALL_EXIT 2
lib/libc/include/any-linux-any/linux/raid/md_p.h+1-1
......@@ -303,7 +303,7 @@ struct mdp_superblock_1 {
303303 * into the 'roles' value. If a device is spare or faulty, then it doesn't
304304 * have a meaningful role.
305305 */
306 __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
306 __le16 dev_roles[]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
307307};
308308
309309/* feature_map bits */
lib/libc/include/any-linux-any/linux/random.h+1-1
......@@ -41,7 +41,7 @@
4141struct rand_pool_info {
4242 int entropy_count;
4343 int buf_size;
44 __u32 buf[0];
44 __u32 buf[];
4545};
4646
4747/*
lib/libc/include/any-linux-any/linux/reiserfs_xattr.h+1-1
......@@ -19,7 +19,7 @@ struct reiserfs_xattr_header {
1919struct reiserfs_security_handle {
2020 const char *name;
2121 void *value;
22 size_t length;
22 __kernel_size_t length;
2323};
2424
2525#endif /* _LINUX_REISERFS_XATTR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rfkill.h+12-2
......@@ -159,8 +159,16 @@ struct rfkill_event_ext {
159159 * old behaviour for all userspace, unless it explicitly opts in to the
160160 * rules outlined here by using the new &struct rfkill_event_ext.
161161 *
162 * Userspace using &struct rfkill_event_ext must adhere to the following
163 * rules
162 * Additionally, some other userspace (bluez, g-s-d) was reading with a
163 * large size but as streaming reads rather than message-based, or with
164 * too strict checks for the returned size. So eventually, we completely
165 * reverted this, and extended messages need to be opted in to by using
166 * an ioctl:
167 *
168 * ioctl(fd, RFKILL_IOCTL_MAX_SIZE, sizeof(struct rfkill_event_ext));
169 *
170 * Userspace using &struct rfkill_event_ext and the ioctl must adhere to
171 * the following rules:
164172 *
165173 * 1. accept short writes, optionally using them to detect that it's
166174 * running on an older kernel;
......@@ -175,6 +183,8 @@ struct rfkill_event_ext {
175183#define RFKILL_IOC_MAGIC 'R'
176184#define RFKILL_IOC_NOINPUT 1
177185#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
186#define RFKILL_IOC_MAX_SIZE 2
187#define RFKILL_IOCTL_MAX_SIZE _IOW(RFKILL_IOC_MAGIC, RFKILL_IOC_MAX_SIZE, __u32)
178188
179189/* and that's all userspace gets */
180190
lib/libc/include/any-linux-any/linux/rkisp1-config.h+61-16
......@@ -117,7 +117,46 @@
117117/*
118118 * Defect Pixel Cluster Correction
119119 */
120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
121
122#define RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE (1U << 2)
123
124#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER (1U << 0)
125#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_RB_CENTER (1U << 1)
126#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_G_3X3 (1U << 2)
127#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_RB_3X3 (1U << 3)
128
129/* 0-2 for sets 1-3 */
130#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_SET(n) ((n) << 0)
131#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_FIX_SET (1U << 3)
132
133#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_GREEN_ENABLE (1U << 0)
134#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE (1U << 1)
135#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_GREEN_ENABLE (1U << 2)
136#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE (1U << 3)
137#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_GREEN_ENABLE (1U << 4)
138#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_RED_BLUE_ENABLE (1U << 8)
139#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE (1U << 9)
140#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_RED_BLUE_ENABLE (1U << 10)
141#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE (1U << 11)
142#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_RED_BLUE_ENABLE (1U << 12)
143
144#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_G(v) ((v) << 0)
145#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_RB(v) ((v) << 8)
146#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_G(v) ((v) << 0)
147#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_RB(v) ((v) << 8)
148#define RKISP1_CIF_ISP_DPCC_PG_FAC_G(v) ((v) << 0)
149#define RKISP1_CIF_ISP_DPCC_PG_FAC_RB(v) ((v) << 8)
150#define RKISP1_CIF_ISP_DPCC_RND_THRESH_G(v) ((v) << 0)
151#define RKISP1_CIF_ISP_DPCC_RND_THRESH_RB(v) ((v) << 8)
152#define RKISP1_CIF_ISP_DPCC_RG_FAC_G(v) ((v) << 0)
153#define RKISP1_CIF_ISP_DPCC_RG_FAC_RB(v) ((v) << 8)
154
155#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_G(n, v) ((v) << ((n) * 4))
156#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_RB(n, v) ((v) << ((n) * 4 + 2))
157
158#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_G(n, v) ((v) << ((n) * 4))
159#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_RB(n, v) ((v) << ((n) * 4 + 2))
121160
122161/*
123162 * Denoising pre filter
......@@ -249,16 +288,20 @@ struct rkisp1_cif_isp_bls_config {
249288};
250289
251290/**
252 * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC
291 * struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
253292 *
254 * Methods Configuration used by Defect Pixel Cluster Correction
293 * This structure stores the configuration of one set of methods for the DPCC
294 * algorithm. Multiple methods can be selected in each set (independently for
295 * the Green and Red/Blue components) through the @method field, the result is
296 * the logical AND of all enabled methods. The remaining fields set thresholds
297 * and factors for each method.
255298 *
256 * @method: Method enable bits
257 * @line_thresh: Line threshold
258 * @line_mad_fac: Line MAD factor
259 * @pg_fac: Peak gradient factor
260 * @rnd_thresh: Rank Neighbor Difference threshold
261 * @rg_fac: Rank gradient factor
299 * @method: Method enable bits (RKISP1_CIF_ISP_DPCC_METHODS_SET_*)
300 * @line_thresh: Line threshold (RKISP1_CIF_ISP_DPCC_LINE_THRESH_*)
301 * @line_mad_fac: Line Mean Absolute Difference factor (RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_*)
302 * @pg_fac: Peak gradient factor (RKISP1_CIF_ISP_DPCC_PG_FAC_*)
303 * @rnd_thresh: Rank Neighbor Difference threshold (RKISP1_CIF_ISP_DPCC_RND_THRESH_*)
304 * @rg_fac: Rank gradient factor (RKISP1_CIF_ISP_DPCC_RG_FAC_*)
262305 */
263306struct rkisp1_cif_isp_dpcc_methods_config {
264307 __u32 method;
......@@ -272,14 +315,16 @@ struct rkisp1_cif_isp_dpcc_methods_config {
272315/**
273316 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
274317 *
275 * Configuration used by Defect Pixel Cluster Correction
318 * Configuration used by Defect Pixel Cluster Correction. Three sets of methods
319 * can be configured and selected through the @set_use field. The result is the
320 * logical OR of all enabled sets.
276321 *
277 * @mode: dpcc output mode
278 * @output_mode: whether use hard coded methods
279 * @set_use: stage1 methods set
280 * @methods: methods config
281 * @ro_limits: rank order limits
282 * @rnd_offs: differential rank offsets for rank neighbor difference
322 * @mode: DPCC mode (RKISP1_CIF_ISP_DPCC_MODE_*)
323 * @output_mode: Interpolation output mode (RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_*)
324 * @set_use: Methods sets selection (RKISP1_CIF_ISP_DPCC_SET_USE_*)
325 * @methods: Methods sets configuration
326 * @ro_limits: Rank order limits (RKISP1_CIF_ISP_DPCC_RO_LIMITS_*)
327 * @rnd_offs: Differential rank offsets for rank neighbor difference (RKISP1_CIF_ISP_DPCC_RND_OFFS_*)
283328 */
284329struct rkisp1_cif_isp_dpcc_config {
285330 __u32 mode;
lib/libc/include/any-linux-any/linux/romfs_fs.h+2-2
......@@ -27,7 +27,7 @@ struct romfs_super_block {
2727 __be32 word1;
2828 __be32 size;
2929 __be32 checksum;
30 char name[0]; /* volume name */
30 char name[]; /* volume name */
3131};
3232
3333/* On disk inode */
......@@ -37,7 +37,7 @@ struct romfs_inode {
3737 __be32 spec;
3838 __be32 size;
3939 __be32 checksum;
40 char name[0];
40 char name[];
4141};
4242
4343#define ROMFH_TYPE 7
lib/libc/include/any-linux-any/linux/rpl.h+2-2
......@@ -37,8 +37,8 @@ struct ipv6_rpl_sr_hdr {
3737#endif
3838
3939 union {
40 struct in6_addr addr[0];
41 __u8 data[0];
40 __DECLARE_FLEX_ARRAY(struct in6_addr, addr);
41 __DECLARE_FLEX_ARRAY(__u8, data);
4242 } segments;
4343} __attribute__((packed));
4444
lib/libc/include/any-linux-any/linux/rpmsg.h+10
......@@ -33,4 +33,14 @@ struct rpmsg_endpoint_info {
3333 */
3434#define RPMSG_DESTROY_EPT_IOCTL _IO(0xb5, 0x2)
3535
36/**
37 * Instantiate a new local rpmsg service device.
38 */
39#define RPMSG_CREATE_DEV_IOCTL _IOW(0xb5, 0x3, struct rpmsg_endpoint_info)
40
41/**
42 * Release a local rpmsg device.
43 */
44#define RPMSG_RELEASE_DEV_IOCTL _IOW(0xb5, 0x4, struct rpmsg_endpoint_info)
45
3646#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rseq.h+26-16
......@@ -105,23 +105,11 @@ struct rseq {
105105 * Read and set by the kernel. Set by user-space with single-copy
106106 * atomicity semantics. This field should only be updated by the
107107 * thread which registered this data structure. Aligned on 64-bit.
108 *
109 * 32-bit architectures should update the low order bits of the
110 * rseq_cs field, leaving the high order bits initialized to 0.
108111 */
109 union {
110 __u64 ptr64;
111#ifdef __LP64__
112 __u64 ptr;
113#else
114 struct {
115#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || defined(__BIG_ENDIAN)
116 __u32 padding; /* Initialized to zero. */
117 __u32 ptr32;
118#else /* LITTLE */
119 __u32 ptr32;
120 __u32 padding; /* Initialized to zero. */
121#endif /* ENDIAN */
122 } ptr;
123#endif
124 } rseq_cs;
112 __u64 rseq_cs;
125113
126114 /*
127115 * Restartable sequences flags field.
......@@ -142,6 +130,28 @@ struct rseq {
142130 * this thread.
143131 */
144132 __u32 flags;
133
134 /*
135 * Restartable sequences node_id field. Updated by the kernel. Read by
136 * user-space with single-copy atomicity semantics. This field should
137 * only be read by the thread which registered this data structure.
138 * Aligned on 32-bit. Contains the current NUMA node ID.
139 */
140 __u32 node_id;
141
142 /*
143 * Restartable sequences mm_cid field. Updated by the kernel. Read by
144 * user-space with single-copy atomicity semantics. This field should
145 * only be read by the thread which registered this data structure.
146 * Aligned on 32-bit. Contains the current thread's concurrency ID
147 * (allocated uniquely within a memory map).
148 */
149 __u32 mm_cid;
150
151 /*
152 * Flexible array member at end of structure, after last feature field.
153 */
154 char end[];
145155} __attribute__((aligned(4 * sizeof(__u64))));
146156
147157#endif /* _LINUX_RSEQ_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rtc.h+2-1
......@@ -133,7 +133,8 @@ struct rtc_param {
133133#define RTC_FEATURE_UPDATE_INTERRUPT 4
134134#define RTC_FEATURE_CORRECTION 5
135135#define RTC_FEATURE_BACKUP_SWITCH_MODE 6
136#define RTC_FEATURE_CNT 7
136#define RTC_FEATURE_ALARM_WAKEUP_ONLY 7
137#define RTC_FEATURE_CNT 8
137138
138139/* parameter list */
139140#define RTC_PARAM_FEATURES 0
lib/libc/include/any-linux-any/linux/rtnetlink.h+19-1
......@@ -146,6 +146,8 @@ enum {
146146#define RTM_NEWSTATS RTM_NEWSTATS
147147 RTM_GETSTATS = 94,
148148#define RTM_GETSTATS RTM_GETSTATS
149 RTM_SETSTATS,
150#define RTM_SETSTATS RTM_SETSTATS
149151
150152 RTM_NEWCACHEREPORT = 96,
151153#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
......@@ -185,6 +187,13 @@ enum {
185187 RTM_GETNEXTHOPBUCKET,
186188#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET
187189
190 RTM_NEWTUNNEL = 120,
191#define RTM_NEWTUNNEL RTM_NEWTUNNEL
192 RTM_DELTUNNEL,
193#define RTM_DELTUNNEL RTM_DELTUNNEL
194 RTM_GETTUNNEL,
195#define RTM_GETTUNNEL RTM_GETTUNNEL
196
188197 __RTM_MAX,
189198#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
190199};
......@@ -431,7 +440,7 @@ struct rtnexthop {
431440/* RTA_VIA */
432441struct rtvia {
433442 __kernel_sa_family_t rtvia_family;
434 __u8 rtvia_addr[0];
443 __u8 rtvia_addr[];
435444};
436445
437446/* RTM_CACHEINFO */
......@@ -626,6 +635,7 @@ enum {
626635 TCA_INGRESS_BLOCK,
627636 TCA_EGRESS_BLOCK,
628637 TCA_DUMP_FLAGS,
638 TCA_EXT_WARN_MSG,
629639 __TCA_MAX
630640};
631641
......@@ -752,6 +762,12 @@ enum rtnetlink_groups {
752762#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
753763 RTNLGRP_BRVLAN,
754764#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
765 RTNLGRP_MCTP_IFADDR,
766#define RTNLGRP_MCTP_IFADDR RTNLGRP_MCTP_IFADDR
767 RTNLGRP_TUNNEL,
768#define RTNLGRP_TUNNEL RTNLGRP_TUNNEL
769 RTNLGRP_STATS,
770#define RTNLGRP_STATS RTNLGRP_STATS
755771 __RTNLGRP_MAX
756772};
757773#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
......@@ -771,6 +787,7 @@ enum {
771787 TCA_ROOT_FLAGS,
772788 TCA_ROOT_COUNT,
773789 TCA_ROOT_TIME_DELTA, /* in msecs */
790 TCA_ROOT_EXT_WARN_MSG,
774791 __TCA_ROOT_MAX,
775792#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
776793};
......@@ -800,6 +817,7 @@ enum {
800817#define RTEXT_FILTER_MRP (1 << 4)
801818#define RTEXT_FILTER_CFM_CONFIG (1 << 5)
802819#define RTEXT_FILTER_CFM_STATUS (1 << 6)
820#define RTEXT_FILTER_MST (1 << 7)
803821
804822/* End of information exported to user level */
805823
lib/libc/include/any-linux-any/linux/sctp.h+5-5
......@@ -365,7 +365,7 @@ struct sctp_assoc_change {
365365 __u16 sac_outbound_streams;
366366 __u16 sac_inbound_streams;
367367 sctp_assoc_t sac_assoc_id;
368 __u8 sac_info[0];
368 __u8 sac_info[];
369369};
370370
371371/*
......@@ -436,7 +436,7 @@ struct sctp_remote_error {
436436 __u32 sre_length;
437437 __be16 sre_error;
438438 sctp_assoc_t sre_assoc_id;
439 __u8 sre_data[0];
439 __u8 sre_data[];
440440};
441441
442442
......@@ -453,7 +453,7 @@ struct sctp_send_failed {
453453 __u32 ssf_error;
454454 struct sctp_sndrcvinfo ssf_info;
455455 sctp_assoc_t ssf_assoc_id;
456 __u8 ssf_data[0];
456 __u8 ssf_data[];
457457};
458458
459459struct sctp_send_failed_event {
......@@ -463,7 +463,7 @@ struct sctp_send_failed_event {
463463 __u32 ssf_error;
464464 struct sctp_sndinfo ssfe_info;
465465 sctp_assoc_t ssf_assoc_id;
466 __u8 ssf_data[0];
466 __u8 ssf_data[];
467467};
468468
469469/*
......@@ -1023,7 +1023,7 @@ struct sctp_getaddrs_old {
10231023struct sctp_getaddrs {
10241024 sctp_assoc_t assoc_id; /*input*/
10251025 __u32 addr_num; /*output*/
1026 __u8 addrs[0]; /*output, variable size*/
1026 __u8 addrs[]; /*output, variable size*/
10271027};
10281028
10291029/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
lib/libc/include/any-linux-any/linux/seccomp.h+2
......@@ -23,6 +23,8 @@
2323#define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)
2424#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
2525#define SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1UL << 4)
26/* Received notifications wait in killable state (only respond to fatal signals) */
27#define SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV (1UL << 5)
2628
2729/*
2830 * All BPF programs must return a 32-bit value.
lib/libc/include/any-linux-any/linux/sed-opal.h+21-1
......@@ -44,6 +44,11 @@ enum opal_lock_state {
4444 OPAL_LK = 0x04, /* 0100 */
4545};
4646
47enum opal_lock_flags {
48 /* IOC_OPAL_SAVE will also store the provided key for locking */
49 OPAL_SAVE_FOR_LOCK = 0x01,
50};
51
4752struct opal_key {
4853 __u8 lr;
4954 __u8 key_len;
......@@ -76,7 +81,8 @@ struct opal_user_lr_setup {
7681struct opal_lock_unlock {
7782 struct opal_session_info session;
7883 __u32 l_state;
79 __u8 __align[4];
84 __u16 flags;
85 __u8 __align[2];
8086};
8187
8288struct opal_new_pw {
......@@ -132,6 +138,19 @@ struct opal_read_write_table {
132138 __u64 priv;
133139};
134140
141#define OPAL_FL_SUPPORTED 0x00000001
142#define OPAL_FL_LOCKING_SUPPORTED 0x00000002
143#define OPAL_FL_LOCKING_ENABLED 0x00000004
144#define OPAL_FL_LOCKED 0x00000008
145#define OPAL_FL_MBR_ENABLED 0x00000010
146#define OPAL_FL_MBR_DONE 0x00000020
147#define OPAL_FL_SUM_SUPPORTED 0x00000040
148
149struct opal_status {
150 __u32 flags;
151 __u32 reserved;
152};
153
135154#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
136155#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
137156#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
......@@ -148,5 +167,6 @@ struct opal_read_write_table {
148167#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
149168#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
150169#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)
170#define IOC_OPAL_GET_STATUS _IOR('p', 236, struct opal_status)
151171
152172#endif /* _SED_OPAL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seg6.h+1-1
......@@ -30,7 +30,7 @@ struct ipv6_sr_hdr {
3030 __u8 flags;
3131 __u16 tag;
3232
33 struct in6_addr segments[0];
33 struct in6_addr segments[];
3434};
3535
3636#define SR6_FLAG1_PROTECTED (1 << 6)
lib/libc/include/any-linux-any/linux/seg6_iptunnel.h+3-1
......@@ -26,7 +26,7 @@ enum {
2626
2727struct seg6_iptunnel_encap {
2828 int mode;
29 struct ipv6_sr_hdr srh[0];
29 struct ipv6_sr_hdr srh[];
3030};
3131
3232#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
......@@ -35,6 +35,8 @@ enum {
3535 SEG6_IPTUN_MODE_INLINE,
3636 SEG6_IPTUN_MODE_ENCAP,
3737 SEG6_IPTUN_MODE_L2ENCAP,
38 SEG6_IPTUN_MODE_ENCAP_RED,
39 SEG6_IPTUN_MODE_L2ENCAP_RED,
3840};
3941
4042#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seg6_local.h+24
......@@ -28,6 +28,7 @@ enum {
2828 SEG6_LOCAL_BPF,
2929 SEG6_LOCAL_VRFTABLE,
3030 SEG6_LOCAL_COUNTERS,
31 SEG6_LOCAL_FLAVORS,
3132 __SEG6_LOCAL_MAX,
3233};
3334#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
......@@ -110,4 +111,27 @@ enum {
110111
111112#define SEG6_LOCAL_CNT_MAX (__SEG6_LOCAL_CNT_MAX - 1)
112113
114/* SRv6 End* Flavor attributes */
115enum {
116 SEG6_LOCAL_FLV_UNSPEC,
117 SEG6_LOCAL_FLV_OPERATION,
118 SEG6_LOCAL_FLV_LCBLOCK_BITS,
119 SEG6_LOCAL_FLV_LCNODE_FN_BITS,
120 __SEG6_LOCAL_FLV_MAX,
121};
122
123#define SEG6_LOCAL_FLV_MAX (__SEG6_LOCAL_FLV_MAX - 1)
124
125/* Designed flavor operations for SRv6 End* Behavior */
126enum {
127 SEG6_LOCAL_FLV_OP_UNSPEC,
128 SEG6_LOCAL_FLV_OP_PSP,
129 SEG6_LOCAL_FLV_OP_USP,
130 SEG6_LOCAL_FLV_OP_USD,
131 SEG6_LOCAL_FLV_OP_NEXT_CSID,
132 __SEG6_LOCAL_FLV_OP_MAX
133};
134
135#define SEG6_LOCAL_FLV_OP_MAX (__SEG6_LOCAL_FLV_OP_MAX - 1)
136
113137#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial.h+49-16
......@@ -107,29 +107,62 @@ struct serial_icounter_struct {
107107 int reserved[9];
108108};
109109
110/*
110/**
111 * struct serial_rs485 - serial interface for controlling RS485 settings.
112 * @flags: RS485 feature flags.
113 * @delay_rts_before_send: Delay before send (milliseconds).
114 * @delay_rts_after_send: Delay after send (milliseconds).
115 * @addr_recv: Receive filter for RS485 addressing mode
116 * (used only when %SER_RS485_ADDR_RECV is set).
117 * @addr_dest: Destination address for RS485 addressing mode
118 * (used only when %SER_RS485_ADDR_DEST is set).
119 * @padding0: Padding (set to zero).
120 * @padding1: Padding (set to zero).
121 * @padding: Deprecated, use @padding0 and @padding1 instead.
122 * Do not use with @addr_recv and @addr_dest (due to
123 * overlap).
124 *
111125 * Serial interface for controlling RS485 settings on chips with suitable
112126 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
113127 * platform. The set function returns the new state, with any unsupported bits
114128 * reverted appropriately.
129 *
130 * The flag bits are:
131 *
132 * * %SER_RS485_ENABLED - RS485 enabled.
133 * * %SER_RS485_RTS_ON_SEND - Logical level for RTS pin when sending.
134 * * %SER_RS485_RTS_AFTER_SEND - Logical level for RTS pin after sent.
135 * * %SER_RS485_RX_DURING_TX - Full-duplex RS485 line.
136 * * %SER_RS485_TERMINATE_BUS - Enable bus termination (if supported).
137 * * %SER_RS485_ADDRB - Enable RS485 addressing mode.
138 * * %SER_RS485_ADDR_RECV - Receive address filter (enables @addr_recv). Requires %SER_RS485_ADDRB.
139 * * %SER_RS485_ADDR_DEST - Destination address (enables @addr_dest). Requires %SER_RS485_ADDRB.
115140 */
116
117141struct serial_rs485 {
118 __u32 flags; /* RS485 feature flags */
119#define SER_RS485_ENABLED (1 << 0) /* If enabled */
120#define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for
121 RTS pin when
122 sending */
123#define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for
124 RTS pin after sent*/
142 __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)
125146#define SER_RS485_RX_DURING_TX (1 << 4)
126#define SER_RS485_TERMINATE_BUS (1 << 5) /* Enable bus
127 termination
128 (if supported) */
129 __u32 delay_rts_before_send; /* Delay before send (milliseconds) */
130 __u32 delay_rts_after_send; /* Delay after send (milliseconds) */
131 __u32 padding[5]; /* Memory is cheap, new structs
132 are a royal PITA .. */
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)
151
152 __u32 delay_rts_before_send;
153 __u32 delay_rts_after_send;
154
155 /* The fields below are defined by flags */
156 union {
157 __u32 padding[5]; /* Memory is cheap, new structs are a pain */
158
159 struct {
160 __u8 addr_recv;
161 __u8 addr_dest;
162 __u8 padding0[2];
163 __u32 padding1[4];
164 };
165 };
133166};
134167
135168/*
lib/libc/include/any-linux-any/linux/serial_core.h+9-4
......@@ -68,6 +68,9 @@
6868/* NVIDIA Tegra Combined UART */
6969#define PORT_TEGRA_TCU 41
7070
71/* ASPEED AST2x00 virtual UART */
72#define PORT_ASPEED_VUART 42
73
7174/* Intel EG20 */
7275#define PORT_PCH_8LINE 44
7376#define PORT_PCH_2LINE 45
......@@ -121,10 +124,6 @@
121124/* TXX9 type number */
122125#define PORT_TXX9 64
123126
124/* NEC VR4100 series SIU/DSIU */
125#define PORT_VR41XX_SIU 65
126#define PORT_VR41XX_DSIU 66
127
128127/* Samsung S3C2400 SoC */
129128#define PORT_S3C2400 67
130129
......@@ -208,6 +207,9 @@
208207/* Atheros AR933X SoC */
209208#define PORT_AR933X 99
210209
210/* MCHP 16550A UART with 256 byte FIFOs */
211#define PORT_MCHP16550A 100
212
211213/* ARC (Synopsys) on-chip UART */
212214#define PORT_ARC 101
213215
......@@ -274,4 +276,7 @@
274276/* Freescale LINFlexD UART */
275277#define PORT_LINFLEXUART 122
276278
279/* Sunplus UART */
280#define PORT_SUNPLUS 123
281
277282#endif /* LINUX_SERIAL_CORE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/serial_reg.h+7-2
......@@ -44,6 +44,11 @@
4444#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */
4545#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */
4646#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */
47#define UART_IIR_64BYTE_FIFO 0x20 /* 16750 64 bytes FIFO */
48#define UART_IIR_FIFO_ENABLED 0xc0 /* FIFOs enabled / port type identification */
49#define UART_IIR_FIFO_ENABLED_8250 0x00 /* 8250: no FIFO */
50#define UART_IIR_FIFO_ENABLED_16550 0x80 /* 16550: (broken/unusable) FIFO */
51#define UART_IIR_FIFO_ENABLED_16550A 0xc0 /* 16550A: FIFO enabled */
4752
4853#define UART_FCR 2 /* Out: FIFO Control Register */
4954#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
......@@ -139,7 +144,7 @@
139144#define UART_LSR_PE 0x04 /* Parity error indicator */
140145#define UART_LSR_OE 0x02 /* Overrun error indicator */
141146#define UART_LSR_DR 0x01 /* Receiver data ready */
142#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
147#define UART_LSR_BRK_ERROR_BITS (UART_LSR_BI|UART_LSR_FE|UART_LSR_PE|UART_LSR_OE)
143148
144149#define UART_MSR 6 /* In: Modem Status Register */
145150#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
......@@ -150,7 +155,7 @@
150155#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
151156#define UART_MSR_DDSR 0x02 /* Delta DSR */
152157#define UART_MSR_DCTS 0x01 /* Delta CTS */
153#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
158#define UART_MSR_ANY_DELTA (UART_MSR_DDCD|UART_MSR_TERI|UART_MSR_DDSR|UART_MSR_DCTS)
154159
155160#define UART_SCR 7 /* I/O: Scratch Register */
156161
lib/libc/include/any-linux-any/linux/sev-guest.h created+80
......@@ -0,0 +1,80 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Userspace interface for AMD SEV and SNP guest driver.
4 *
5 * Copyright (C) 2021 Advanced Micro Devices, Inc.
6 *
7 * Author: Brijesh Singh <brijesh.singh@amd.com>
8 *
9 * SEV API specification is available at: https://developer.amd.com/sev/
10 */
11
12#ifndef __UAPI_LINUX_SEV_GUEST_H_
13#define __UAPI_LINUX_SEV_GUEST_H_
14
15#include <linux/types.h>
16
17struct snp_report_req {
18 /* user data that should be included in the report */
19 __u8 user_data[64];
20
21 /* The vmpl level to be included in the report */
22 __u32 vmpl;
23
24 /* Must be zero filled */
25 __u8 rsvd[28];
26};
27
28struct snp_report_resp {
29 /* response data, see SEV-SNP spec for the format */
30 __u8 data[4000];
31};
32
33struct snp_derived_key_req {
34 __u32 root_key_select;
35 __u32 rsvd;
36 __u64 guest_field_select;
37 __u32 vmpl;
38 __u32 guest_svn;
39 __u64 tcb_version;
40};
41
42struct snp_derived_key_resp {
43 /* response data, see SEV-SNP spec for the format */
44 __u8 data[64];
45};
46
47struct snp_guest_request_ioctl {
48 /* message version number (must be non-zero) */
49 __u8 msg_version;
50
51 /* Request and response structure address */
52 __u64 req_data;
53 __u64 resp_data;
54
55 /* firmware error code on failure (see psp-sev.h) */
56 __u64 fw_err;
57};
58
59struct snp_ext_report_req {
60 struct snp_report_req data;
61
62 /* where to copy the certificate blob */
63 __u64 certs_address;
64
65 /* length of the certificate blob */
66 __u32 certs_len;
67};
68
69#define SNP_GUEST_REQ_IOC_TYPE 'S'
70
71/* Get SNP attestation report */
72#define SNP_GET_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x0, struct snp_guest_request_ioctl)
73
74/* Get a derived key from the root */
75#define SNP_GET_DERIVED_KEY _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x1, struct snp_guest_request_ioctl)
76
77/* Get SNP extended report as defined in the GHCB specification version 2. */
78#define SNP_GET_EXT_REPORT _IOWR(SNP_GUEST_REQ_IOC_TYPE, 0x2, struct snp_guest_request_ioctl)
79
80#endif /* __UAPI_LINUX_SEV_GUEST_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/smc.h+18
......@@ -59,6 +59,9 @@ enum {
5959 SMC_NETLINK_DUMP_SEID,
6060 SMC_NETLINK_ENABLE_SEID,
6161 SMC_NETLINK_DISABLE_SEID,
62 SMC_NETLINK_DUMP_HS_LIMITATION,
63 SMC_NETLINK_ENABLE_HS_LIMITATION,
64 SMC_NETLINK_DISABLE_HS_LIMITATION,
6265};
6366
6467/* SMC_GENL_FAMILY top level attributes */
......@@ -119,6 +122,9 @@ enum {
119122 SMC_NLA_LGR_R_CONNS_NUM, /* u32 */
120123 SMC_NLA_LGR_R_V2_COMMON, /* nest */
121124 SMC_NLA_LGR_R_V2, /* nest */
125 SMC_NLA_LGR_R_NET_COOKIE, /* u64 */
126 SMC_NLA_LGR_R_PAD, /* flag */
127 SMC_NLA_LGR_R_BUF_TYPE, /* u8 */
122128 __SMC_NLA_LGR_R_MAX,
123129 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1
124130};
......@@ -282,4 +288,16 @@ enum {
282288 __SMC_NLA_SEID_TABLE_MAX,
283289 SMC_NLA_SEID_TABLE_MAX = __SMC_NLA_SEID_TABLE_MAX - 1
284290};
291
292/* SMC_NETLINK_HS_LIMITATION attributes */
293enum {
294 SMC_NLA_HS_LIMITATION_UNSPEC,
295 SMC_NLA_HS_LIMITATION_ENABLED, /* u8 */
296 __SMC_NLA_HS_LIMITATION_MAX,
297 SMC_NLA_HS_LIMITATION_MAX = __SMC_NLA_HS_LIMITATION_MAX - 1
298};
299
300/* SMC socket options */
301#define SMC_LIMIT_HS 1 /* constraint on smc handshake */
302
285303#endif /* _LINUX_SMC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/snmp.h+6
......@@ -95,6 +95,8 @@ enum
9595 ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
9696 ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
9797 ICMP_MIB_CSUMERRORS, /* InCsumErrors */
98 ICMP_MIB_RATELIMITGLOBAL, /* OutRateLimitGlobal */
99 ICMP_MIB_RATELIMITHOST, /* OutRateLimitHost */
98100 __ICMP_MIB_MAX
99101};
100102
......@@ -112,6 +114,7 @@ enum
112114 ICMP6_MIB_OUTMSGS, /* OutMsgs */
113115 ICMP6_MIB_OUTERRORS, /* OutErrors */
114116 ICMP6_MIB_CSUMERRORS, /* InCsumErrors */
117 ICMP6_MIB_RATELIMITHOST, /* OutRateLimitHost */
115118 __ICMP6_MIB_MAX
116119};
117120
......@@ -292,6 +295,7 @@ enum
292295 LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */
293296 LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */
294297 LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */
298 LINUX_MIB_TCPPLBREHASH, /* TCPPLBRehash */
295299 __LINUX_MIB_MAX
296300};
297301
......@@ -344,6 +348,8 @@ enum
344348 LINUX_MIB_TLSRXDEVICE, /* TlsRxDevice */
345349 LINUX_MIB_TLSDECRYPTERROR, /* TlsDecryptError */
346350 LINUX_MIB_TLSRXDEVICERESYNC, /* TlsRxDeviceResync */
351 LINUX_MIB_TLSDECRYPTRETRY, /* TlsDecryptRetry */
352 LINUX_MIB_TLSRXNOPADVIOL, /* TlsRxNoPadViolation */
347353 __LINUX_MIB_TLSMAX
348354};
349355
lib/libc/include/any-linux-any/linux/socket.h+4
......@@ -31,4 +31,8 @@ struct __kernel_sockaddr_storage {
3131
3232#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK)
3333
34#define SOCK_TXREHASH_DEFAULT 255
35#define SOCK_TXREHASH_DISABLED 0
36#define SOCK_TXREHASH_ENABLED 1
37
3438#endif /* _LINUX_SOCKET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/soundcard.h+1-1
......@@ -1046,7 +1046,7 @@ typedef struct mixer_vol_table {
10461046 * the GPL version of OSS-4.x and build against that version
10471047 * of the header.
10481048 *
1049 * We redefine the extern keyword so that make headers_check
1049 * We redefine the extern keyword so that usr/include/headers_check.pl
10501050 * does not complain about SEQ_USE_EXTBUF.
10511051 */
10521052#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
lib/libc/include/any-linux-any/linux/spi/spi.h+2-1
......@@ -27,6 +27,7 @@
2727#define SPI_TX_OCTAL _BITUL(13) /* transmit with 8 wires */
2828#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
2929#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
30#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */
3031
3132/*
3233 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
......@@ -36,6 +37,6 @@
3637 * These bits must not overlap. A static assert check should make sure of that.
3738 * If adding extra bits, make sure to increase the bit index below as well.
3839 */
39#define SPI_MODE_USER_MASK (_BITUL(16) - 1)
40#define SPI_MODE_USER_MASK (_BITUL(17) - 1)
4041
4142#endif /* _SPI_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stat.h+3-1
......@@ -124,7 +124,8 @@ struct statx {
124124 __u32 stx_dev_minor;
125125 /* 0x90 */
126126 __u64 stx_mnt_id;
127 __u64 __spare2;
127 __u32 stx_dio_mem_align; /* Memory buffer alignment for direct I/O */
128 __u32 stx_dio_offset_align; /* File offset alignment for direct I/O */
128129 /* 0xa0 */
129130 __u64 __spare3[12]; /* Spare space for future expansion */
130131 /* 0x100 */
......@@ -152,6 +153,7 @@ struct statx {
152153#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */
153154#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
154155#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
155157
156158#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
157159
lib/libc/include/any-linux-any/linux/stddef.h+5-1
......@@ -1,4 +1,7 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_STDDEF_H
3#define _LINUX_STDDEF_H
4
25
36
47#ifndef __always_inline
......@@ -40,4 +43,5 @@
4043 struct { \
4144 struct { } __empty_ ## NAME; \
4245 TYPE NAME[]; \
43 }
\ No newline at end of file
46 }
47#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/stm.h+1-1
......@@ -36,7 +36,7 @@ struct stp_policy_id {
3636 /* padding */
3737 __u16 __reserved_0;
3838 __u32 __reserved_1;
39 char id[0];
39 char id[];
4040};
4141
4242#define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)
lib/libc/include/any-linux-any/linux/swab.h+4-4
......@@ -3,7 +3,7 @@
33#define _LINUX_SWAB_H
44
55#include <linux/types.h>
6
6#include <linux/stddef.h>
77#include <asm/bitsperlong.h>
88#include <asm/swab.h>
99
......@@ -102,7 +102,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
102102#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
103103#else
104104#define __swab16(x) \
105 (__builtin_constant_p((__u16)(x)) ? \
105 (__u16)(__builtin_constant_p(x) ? \
106106 ___constant_swab16(x) : \
107107 __fswab16(x))
108108#endif
......@@ -115,7 +115,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
115115#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
116116#else
117117#define __swab32(x) \
118 (__builtin_constant_p((__u32)(x)) ? \
118 (__u32)(__builtin_constant_p(x) ? \
119119 ___constant_swab32(x) : \
120120 __fswab32(x))
121121#endif
......@@ -128,7 +128,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
128128#define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
129129#else
130130#define __swab64(x) \
131 (__builtin_constant_p((__u64)(x)) ? \
131 (__u64)(__builtin_constant_p(x) ? \
132132 ___constant_swab64(x) : \
133133 __fswab64(x))
134134#endif
lib/libc/include/any-linux-any/linux/sysctl.h+19-18
......@@ -584,24 +584,25 @@ enum {
584584
585585/* /proc/sys/net/<protocol>/neigh/<dev> */
586586enum {
587 NET_NEIGH_MCAST_SOLICIT=1,
588 NET_NEIGH_UCAST_SOLICIT=2,
589 NET_NEIGH_APP_SOLICIT=3,
590 NET_NEIGH_RETRANS_TIME=4,
591 NET_NEIGH_REACHABLE_TIME=5,
592 NET_NEIGH_DELAY_PROBE_TIME=6,
593 NET_NEIGH_GC_STALE_TIME=7,
594 NET_NEIGH_UNRES_QLEN=8,
595 NET_NEIGH_PROXY_QLEN=9,
596 NET_NEIGH_ANYCAST_DELAY=10,
597 NET_NEIGH_PROXY_DELAY=11,
598 NET_NEIGH_LOCKTIME=12,
599 NET_NEIGH_GC_INTERVAL=13,
600 NET_NEIGH_GC_THRESH1=14,
601 NET_NEIGH_GC_THRESH2=15,
602 NET_NEIGH_GC_THRESH3=16,
603 NET_NEIGH_RETRANS_TIME_MS=17,
604 NET_NEIGH_REACHABLE_TIME_MS=18,
587 NET_NEIGH_MCAST_SOLICIT = 1,
588 NET_NEIGH_UCAST_SOLICIT = 2,
589 NET_NEIGH_APP_SOLICIT = 3,
590 NET_NEIGH_RETRANS_TIME = 4,
591 NET_NEIGH_REACHABLE_TIME = 5,
592 NET_NEIGH_DELAY_PROBE_TIME = 6,
593 NET_NEIGH_GC_STALE_TIME = 7,
594 NET_NEIGH_UNRES_QLEN = 8,
595 NET_NEIGH_PROXY_QLEN = 9,
596 NET_NEIGH_ANYCAST_DELAY = 10,
597 NET_NEIGH_PROXY_DELAY = 11,
598 NET_NEIGH_LOCKTIME = 12,
599 NET_NEIGH_GC_INTERVAL = 13,
600 NET_NEIGH_GC_THRESH1 = 14,
601 NET_NEIGH_GC_THRESH2 = 15,
602 NET_NEIGH_GC_THRESH3 = 16,
603 NET_NEIGH_RETRANS_TIME_MS = 17,
604 NET_NEIGH_REACHABLE_TIME_MS = 18,
605 NET_NEIGH_INTERVAL_PROBE_TIME_MS = 19,
605606};
606607
607608/* /proc/sys/net/dccp */
lib/libc/include/any-linux-any/linux/target_core_user.h+1-1
......@@ -152,7 +152,7 @@ struct tcmu_tmr_entry {
152152 __u32 cmd_cnt;
153153 __u64 __pad3;
154154 __u64 __pad4;
155 __u16 cmd_ids[0];
155 __u16 cmd_ids[];
156156} __attribute__((packed));
157157
158158#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
lib/libc/include/any-linux-any/linux/taskstats.h+28-2
......@@ -34,7 +34,7 @@
3434 */
3535
3636
37#define TASKSTATS_VERSION 10
37#define TASKSTATS_VERSION 13
3838#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939 * in linux/sched.h */
4040
......@@ -48,7 +48,8 @@ struct taskstats {
4848 __u32 ac_exitcode; /* Exit status */
4949
5050 /* The accounting flags of a task as defined in <linux/acct.h>
51 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
51 * Defined values are AFORK, ASU, ACOMPAT, ACORE, AXSIG, and AGROUP.
52 * (AGROUP since version 12).
5253 */
5354 __u8 ac_flag; /* Record flags */
5455 __u8 ac_nice; /* task_nice */
......@@ -172,6 +173,31 @@ struct taskstats {
172173
173174 /* v10: 64-bit btime to avoid overflow */
174175 __u64 ac_btime64; /* 64-bit begin time */
176
177 /* v11: Delay waiting for memory compact */
178 __u64 compact_count;
179 __u64 compact_delay_total;
180
181 /* v12 begin */
182 __u32 ac_tgid; /* thread group ID */
183 /* Thread group walltime up to now. This is total process walltime if
184 * AGROUP flag is set.
185 */
186 __u64 ac_tgetime __attribute__((aligned(8)));
187 /* Lightweight information to identify process binary files.
188 * This leaves userspace to match this to a file system path, using
189 * MAJOR() and MINOR() macros to identify a device and mount point,
190 * the inode to identify the executable file. This is /proc/self/exe
191 * at the end, so matching the most recent exec(). Values are zero
192 * for kernel threads.
193 */
194 __u64 ac_exe_dev; /* program binary device ID */
195 __u64 ac_exe_inode; /* program binary inode number */
196 /* v12 end */
197
198 /* v13: Delay waiting for write-protect copy */
199 __u64 wpcopy_count;
200 __u64 wpcopy_delay_total;
175201};
176202
177203
lib/libc/include/any-linux-any/linux/tc_act/tc_bpf.h-5
......@@ -1,11 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
33 * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
94 */
105
116#ifndef __LINUX_TC_BPF_H
lib/libc/include/any-linux-any/linux/tc_act/tc_ct.h+3
......@@ -22,6 +22,9 @@ enum {
2222 TCA_CT_NAT_PORT_MIN, /* be16 */
2323 TCA_CT_NAT_PORT_MAX, /* be16 */
2424 TCA_CT_PAD,
25 TCA_CT_HELPER_NAME, /* string */
26 TCA_CT_HELPER_FAMILY, /* u8 */
27 TCA_CT_HELPER_PROTO, /* u8 */
2528 __TCA_CT_MAX
2629};
2730
lib/libc/include/any-linux-any/linux/tc_act/tc_skbedit.h+2-13
......@@ -2,19 +2,6 @@
22/*
33 * Copyright (c) 2008, Intel Corporation.
44 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
185 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
196 */
207
......@@ -29,6 +16,7 @@
2916#define SKBEDIT_F_PTYPE 0x8
3017#define SKBEDIT_F_MASK 0x10
3118#define SKBEDIT_F_INHERITDSFIELD 0x20
19#define SKBEDIT_F_TXQ_SKBHASH 0x40
3220
3321struct tc_skbedit {
3422 tc_gen;
......@@ -45,6 +33,7 @@ enum {
4533 TCA_SKBEDIT_PTYPE,
4634 TCA_SKBEDIT_MASK,
4735 TCA_SKBEDIT_FLAGS,
36 TCA_SKBEDIT_QUEUE_MAPPING_MAX,
4837 __TCA_SKBEDIT_MAX
4938};
5039#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
lib/libc/include/any-linux-any/linux/tc_act/tc_skbmod.h+1-6
......@@ -1,12 +1,7 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
33 * Copyright (c) 2016, Jamal Hadi Salim
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9*/
4 */
105
116#ifndef __LINUX_TC_SKBMOD_H
127#define __LINUX_TC_SKBMOD_H
lib/libc/include/any-linux-any/linux/tc_act/tc_tunnel_key.h-5
......@@ -2,11 +2,6 @@
22/*
33 * Copyright (c) 2016, Amir Vadai <amir@vadai.me>
44 * Copyright (c) 2016, Mellanox Technologies. All rights reserved.
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.
105 */
116
127#ifndef __LINUX_TC_TUNNEL_KEY_H
lib/libc/include/any-linux-any/linux/tc_act/tc_vlan.h-5
......@@ -1,11 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
33 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
94 */
105
116#ifndef __LINUX_TC_VLAN_H
lib/libc/include/any-linux-any/linux/tcp.h+6
......@@ -284,6 +284,11 @@ struct tcp_info {
284284 __u32 tcpi_snd_wnd; /* peer's advertised receive window after
285285 * scaling (bytes)
286286 */
287 __u32 tcpi_rcv_wnd; /* local advertised receive window after
288 * scaling (bytes)
289 */
290
291 __u32 tcpi_rehash; /* PLB or timeout triggered rehash attempts */
287292};
288293
289294/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
......@@ -315,6 +320,7 @@ enum {
315320 TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */
316321 TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */
317322 TCP_NLA_TTL, /* TTL or hop limit of a packet received */
323 TCP_NLA_REHASH, /* PLB and timeout triggered rehash attempts */
318324};
319325
320326/* for TCP_MD5SIG socket option */
lib/libc/include/any-linux-any/linux/tdx-guest.h created+42
......@@ -0,0 +1,42 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Userspace interface for TDX guest driver
4 *
5 * Copyright (C) 2022 Intel Corporation
6 */
7
8#ifndef _LINUX_TDX_GUEST_H_
9#define _LINUX_TDX_GUEST_H_
10
11#include <linux/ioctl.h>
12#include <linux/types.h>
13
14/* Length of the REPORTDATA used in TDG.MR.REPORT TDCALL */
15#define TDX_REPORTDATA_LEN 64
16
17/* Length of TDREPORT used in TDG.MR.REPORT TDCALL */
18#define TDX_REPORT_LEN 1024
19
20/**
21 * struct tdx_report_req - Request struct for TDX_CMD_GET_REPORT0 IOCTL.
22 *
23 * @reportdata: User buffer with REPORTDATA to be included into TDREPORT.
24 * Typically it can be some nonce provided by attestation
25 * service, so the generated TDREPORT can be uniquely verified.
26 * @tdreport: User buffer to store TDREPORT output from TDCALL[TDG.MR.REPORT].
27 */
28struct tdx_report_req {
29 __u8 reportdata[TDX_REPORTDATA_LEN];
30 __u8 tdreport[TDX_REPORT_LEN];
31};
32
33/*
34 * TDX_CMD_GET_REPORT0 - Get TDREPORT0 (a.k.a. TDREPORT subtype 0) using
35 * TDCALL[TDG.MR.REPORT]
36 *
37 * Return 0 on success, -EIO on TDCALL execution failure, and
38 * standard errno on other general error cases.
39 */
40#define TDX_CMD_GET_REPORT0 _IOWR('T', 1, struct tdx_report_req)
41
42#endif /* _LINUX_TDX_GUEST_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/tee.h-4
......@@ -42,10 +42,6 @@
4242#define TEE_IOC_MAGIC 0xa4
4343#define TEE_IOC_BASE 0
4444
45/* Flags relating to shared memory */
46#define TEE_IOCTL_SHM_MAPPED 0x1 /* memory mapped in normal world */
47#define TEE_IOCTL_SHM_DMA_BUF 0x2 /* dma-buf handle on shared memory */
48
4945#define TEE_MAX_ARG_SIZE 1024
5046
5147#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
lib/libc/include/any-linux-any/linux/thermal.h+5-1
......@@ -44,7 +44,10 @@ enum thermal_genl_attr {
4444 THERMAL_GENL_ATTR_CDEV_MAX_STATE,
4545 THERMAL_GENL_ATTR_CDEV_NAME,
4646 THERMAL_GENL_ATTR_GOV_NAME,
47
47 THERMAL_GENL_ATTR_CPU_CAPABILITY,
48 THERMAL_GENL_ATTR_CPU_CAPABILITY_ID,
49 THERMAL_GENL_ATTR_CPU_CAPABILITY_PERFORMANCE,
50 THERMAL_GENL_ATTR_CPU_CAPABILITY_EFFICIENCY,
4851 __THERMAL_GENL_ATTR_MAX,
4952};
5053#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
......@@ -71,6 +74,7 @@ enum thermal_genl_event {
7174 THERMAL_GENL_EVENT_CDEV_DELETE, /* Cdev unbound */
7275 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
7376 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
77 THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */
7478 __THERMAL_GENL_EVENT_MAX,
7579};
7680#define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)
lib/libc/include/any-linux-any/linux/tipc_config.h+12-14
......@@ -43,8 +43,6 @@
4343#include <linux/tipc.h>
4444#include <asm/byteorder.h>
4545
46#include <arpa/inet.h> /* for ntohs etc. */
47
4846/*
4947 * Configuration
5048 *
......@@ -267,33 +265,33 @@ static __inline__ int TLV_OK(const void *tlv, __u16 space)
267265 */
268266
269267 return (space >= TLV_SPACE(0)) &&
270 (ntohs(((struct tlv_desc *)tlv)->tlv_len) <= space);
268 (__be16_to_cpu(((struct tlv_desc *)tlv)->tlv_len) <= space);
271269}
272270
273271static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
274272{
275273 return TLV_OK(tlv, space) &&
276 (ntohs(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
274 (__be16_to_cpu(((struct tlv_desc *)tlv)->tlv_type) == exp_type);
277275}
278276
279277static __inline__ int TLV_GET_LEN(struct tlv_desc *tlv)
280278{
281 return ntohs(tlv->tlv_len);
279 return __be16_to_cpu(tlv->tlv_len);
282280}
283281
284282static __inline__ void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)
285283{
286 tlv->tlv_len = htons(len);
284 tlv->tlv_len = __cpu_to_be16(len);
287285}
288286
289287static __inline__ int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)
290288{
291 return (ntohs(tlv->tlv_type) == type);
289 return (__be16_to_cpu(tlv->tlv_type) == type);
292290}
293291
294292static __inline__ void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)
295293{
296 tlv->tlv_type = htons(type);
294 tlv->tlv_type = __cpu_to_be16(type);
297295}
298296
299297static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
......@@ -303,8 +301,8 @@ static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
303301
304302 tlv_len = TLV_LENGTH(len);
305303 tlv_ptr = (struct tlv_desc *)tlv;
306 tlv_ptr->tlv_type = htons(type);
307 tlv_ptr->tlv_len = htons(tlv_len);
304 tlv_ptr->tlv_type = __cpu_to_be16(type);
305 tlv_ptr->tlv_len = __cpu_to_be16(tlv_len);
308306 if (len && data) {
309307 memcpy(TLV_DATA(tlv_ptr), data, len);
310308 memset((char *)TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);
......@@ -346,7 +344,7 @@ static __inline__ void *TLV_LIST_DATA(struct tlv_list_desc *list)
346344
347345static __inline__ void TLV_LIST_STEP(struct tlv_list_desc *list)
348346{
349 __u16 tlv_space = TLV_ALIGN(ntohs(list->tlv_ptr->tlv_len));
347 __u16 tlv_space = TLV_ALIGN(__be16_to_cpu(list->tlv_ptr->tlv_len));
350348
351349 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
352350 list->tlv_space -= tlv_space;
......@@ -402,9 +400,9 @@ static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,
402400
403401 msg_len = TCM_LENGTH(data_len);
404402 tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;
405 tcm_hdr->tcm_len = htonl(msg_len);
406 tcm_hdr->tcm_type = htons(cmd);
407 tcm_hdr->tcm_flags = htons(flags);
403 tcm_hdr->tcm_len = __cpu_to_be32(msg_len);
404 tcm_hdr->tcm_type = __cpu_to_be16(cmd);
405 tcm_hdr->tcm_flags = __cpu_to_be16(flags);
408406 if (data_len && data) {
409407 memcpy(TCM_DATA(msg), data, data_len);
410408 memset((char *)TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);
lib/libc/include/any-linux-any/linux/tls.h+34
......@@ -39,6 +39,8 @@
3939/* TLS socket options */
4040#define TLS_TX 1 /* Set transmit parameters */
4141#define TLS_RX 2 /* Set receive parameters */
42#define TLS_TX_ZEROCOPY_RO 3 /* TX zerocopy (only sendfile now) */
43#define TLS_RX_EXPECT_NO_PAD 4 /* Attempt opportunistic zero-copy */
4244
4345/* Supported versions */
4446#define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)
......@@ -98,6 +100,20 @@
98100#define TLS_CIPHER_SM4_CCM_TAG_SIZE 16
99101#define TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE 8
100102
103#define TLS_CIPHER_ARIA_GCM_128 57
104#define TLS_CIPHER_ARIA_GCM_128_IV_SIZE 8
105#define TLS_CIPHER_ARIA_GCM_128_KEY_SIZE 16
106#define TLS_CIPHER_ARIA_GCM_128_SALT_SIZE 4
107#define TLS_CIPHER_ARIA_GCM_128_TAG_SIZE 16
108#define TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE 8
109
110#define TLS_CIPHER_ARIA_GCM_256 58
111#define TLS_CIPHER_ARIA_GCM_256_IV_SIZE 8
112#define TLS_CIPHER_ARIA_GCM_256_KEY_SIZE 32
113#define TLS_CIPHER_ARIA_GCM_256_SALT_SIZE 4
114#define TLS_CIPHER_ARIA_GCM_256_TAG_SIZE 16
115#define TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE 8
116
101117#define TLS_SET_RECORD_TYPE 1
102118#define TLS_GET_RECORD_TYPE 2
103119
......@@ -154,12 +170,30 @@ struct tls12_crypto_info_sm4_ccm {
154170 unsigned char rec_seq[TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE];
155171};
156172
173struct tls12_crypto_info_aria_gcm_128 {
174 struct tls_crypto_info info;
175 unsigned char iv[TLS_CIPHER_ARIA_GCM_128_IV_SIZE];
176 unsigned char key[TLS_CIPHER_ARIA_GCM_128_KEY_SIZE];
177 unsigned char salt[TLS_CIPHER_ARIA_GCM_128_SALT_SIZE];
178 unsigned char rec_seq[TLS_CIPHER_ARIA_GCM_128_REC_SEQ_SIZE];
179};
180
181struct tls12_crypto_info_aria_gcm_256 {
182 struct tls_crypto_info info;
183 unsigned char iv[TLS_CIPHER_ARIA_GCM_256_IV_SIZE];
184 unsigned char key[TLS_CIPHER_ARIA_GCM_256_KEY_SIZE];
185 unsigned char salt[TLS_CIPHER_ARIA_GCM_256_SALT_SIZE];
186 unsigned char rec_seq[TLS_CIPHER_ARIA_GCM_256_REC_SEQ_SIZE];
187};
188
157189enum {
158190 TLS_INFO_UNSPEC,
159191 TLS_INFO_VERSION,
160192 TLS_INFO_CIPHER,
161193 TLS_INFO_TXCONF,
162194 TLS_INFO_RXCONF,
195 TLS_INFO_ZC_RO_TX,
196 TLS_INFO_RX_NO_PAD,
163197 __TLS_INFO_MAX,
164198};
165199#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
lib/libc/include/any-linux-any/linux/tty.h+6-2
......@@ -6,8 +6,6 @@
66 * 'tty.h' defines some structures used by tty_io.c and some defines.
77 */
88
9#define NR_LDISCS 30
10
119/* line disciplines */
1210#define N_TTY 0
1311#define N_SLIP 1
......@@ -38,5 +36,11 @@
3836#define N_NCI 25 /* NFC NCI UART */
3937#define N_SPEAKUP 26 /* Speakup communication with synths */
4038#define N_NULL 27 /* Null ldisc used for error handling */
39#define N_MCTP 28 /* MCTP-over-serial */
40#define N_DEVELOPMENT 29 /* Manual out-of-tree testing */
41#define N_CAN327 30 /* ELM327 based OBD-II interfaces */
42
43/* Always the newest line discipline + 1 */
44#define NR_LDISCS 31
4145
4246#endif /* _LINUX_TTY_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/types.h+6-3
......@@ -14,12 +14,15 @@
1414 * any application/library that wants linux/types.h.
1515 */
1616
17/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
1718#ifdef __CHECKER__
18#define __bitwise__ __attribute__((bitwise))
19#define __bitwise __attribute__((bitwise))
1920#else
20#define __bitwise__
21#define __bitwise
2122#endif
22#define __bitwise __bitwise__
23
24/* The kernel doesn't use this legacy form, but user space does */
25#define __bitwise__ __bitwise
2326
2427typedef __u16 __bitwise __le16;
2528typedef __u16 __bitwise __be16;
lib/libc/include/any-linux-any/linux/ublk_cmd.h created+278
......@@ -0,0 +1,278 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef USER_BLK_DRV_CMD_INC_H
3#define USER_BLK_DRV_CMD_INC_H
4
5#include <linux/types.h>
6
7/* ublk server command definition */
8
9/*
10 * Admin commands, issued by ublk server, and handled by ublk driver.
11 */
12#define UBLK_CMD_GET_QUEUE_AFFINITY 0x01
13#define UBLK_CMD_GET_DEV_INFO 0x02
14#define UBLK_CMD_ADD_DEV 0x04
15#define UBLK_CMD_DEL_DEV 0x05
16#define UBLK_CMD_START_DEV 0x06
17#define UBLK_CMD_STOP_DEV 0x07
18#define UBLK_CMD_SET_PARAMS 0x08
19#define UBLK_CMD_GET_PARAMS 0x09
20#define UBLK_CMD_START_USER_RECOVERY 0x10
21#define UBLK_CMD_END_USER_RECOVERY 0x11
22#define UBLK_CMD_GET_DEV_INFO2 0x12
23
24/*
25 * IO commands, issued by ublk server, and handled by ublk driver.
26 *
27 * FETCH_REQ: issued via sqe(URING_CMD) beforehand for fetching IO request
28 * from ublk driver, should be issued only when starting device. After
29 * the associated cqe is returned, request's tag can be retrieved via
30 * cqe->userdata.
31 *
32 * COMMIT_AND_FETCH_REQ: issued via sqe(URING_CMD) after ublkserver handled
33 * this IO request, request's handling result is committed to ublk
34 * driver, meantime FETCH_REQ is piggyback, and FETCH_REQ has to be
35 * handled before completing io request.
36 *
37 * NEED_GET_DATA: only used for write requests to set io addr and copy data
38 * When NEED_GET_DATA is set, ublksrv has to issue UBLK_IO_NEED_GET_DATA
39 * command after ublk driver returns UBLK_IO_RES_NEED_GET_DATA.
40 *
41 * It is only used if ublksrv set UBLK_F_NEED_GET_DATA flag
42 * while starting a ublk device.
43 */
44#define UBLK_IO_FETCH_REQ 0x20
45#define UBLK_IO_COMMIT_AND_FETCH_REQ 0x21
46#define UBLK_IO_NEED_GET_DATA 0x22
47
48/* only ABORT means that no re-fetch */
49#define UBLK_IO_RES_OK 0
50#define UBLK_IO_RES_NEED_GET_DATA 1
51#define UBLK_IO_RES_ABORT (-ENODEV)
52
53#define UBLKSRV_CMD_BUF_OFFSET 0
54#define UBLKSRV_IO_BUF_OFFSET 0x80000000
55
56/* tag bit is 12bit, so at most 4096 IOs for each queue */
57#define UBLK_MAX_QUEUE_DEPTH 4096
58
59/*
60 * zero copy requires 4k block size, and can remap ublk driver's io
61 * request into ublksrv's vm space
62 */
63#define UBLK_F_SUPPORT_ZERO_COPY (1ULL << 0)
64
65/*
66 * Force to complete io cmd via io_uring_cmd_complete_in_task so that
67 * performance comparison is done easily with using task_work_add
68 */
69#define UBLK_F_URING_CMD_COMP_IN_TASK (1ULL << 1)
70
71/*
72 * User should issue io cmd again for write requests to
73 * set io buffer address and copy data from bio vectors
74 * to the userspace io buffer.
75 *
76 * In this mode, task_work is not used.
77 */
78#define UBLK_F_NEED_GET_DATA (1UL << 2)
79
80#define UBLK_F_USER_RECOVERY (1UL << 3)
81
82#define UBLK_F_USER_RECOVERY_REISSUE (1UL << 4)
83
84/*
85 * Unprivileged user can create /dev/ublkcN and /dev/ublkbN.
86 *
87 * /dev/ublk-control needs to be available for unprivileged user, and it
88 * can be done via udev rule to make all control commands available to
89 * unprivileged user. Except for the command of UBLK_CMD_ADD_DEV, all
90 * other commands are only allowed for the owner of the specified device.
91 *
92 * When userspace sends UBLK_CMD_ADD_DEV, the device pair's owner_uid and
93 * owner_gid are stored to ublksrv_ctrl_dev_info by kernel, so far only
94 * the current user's uid/gid is stored, that said owner of the created
95 * device is always the current user.
96 *
97 * We still need udev rule to apply OWNER/GROUP with the stored owner_uid
98 * and owner_gid.
99 *
100 * Then ublk server can be run as unprivileged user, and /dev/ublkbN can
101 * be accessed and managed by its owner represented by owner_uid/owner_gid.
102 */
103#define UBLK_F_UNPRIVILEGED_DEV (1UL << 5)
104
105/* device state */
106#define UBLK_S_DEV_DEAD 0
107#define UBLK_S_DEV_LIVE 1
108#define UBLK_S_DEV_QUIESCED 2
109
110/* shipped via sqe->cmd of io_uring command */
111struct ublksrv_ctrl_cmd {
112 /* sent to which device, must be valid */
113 __u32 dev_id;
114
115 /* sent to which queue, must be -1 if the cmd isn't for queue */
116 __u16 queue_id;
117 /*
118 * cmd specific buffer, can be IN or OUT.
119 */
120 __u16 len;
121 __u64 addr;
122
123 /* __inline__ data */
124 __u64 data[1];
125
126 /*
127 * Used for UBLK_F_UNPRIVILEGED_DEV and UBLK_CMD_GET_DEV_INFO2
128 * only, include null char
129 */
130 __u16 dev_path_len;
131 __u16 pad;
132 __u32 reserved;
133};
134
135struct ublksrv_ctrl_dev_info {
136 __u16 nr_hw_queues;
137 __u16 queue_depth;
138 __u16 state;
139 __u16 pad0;
140
141 __u32 max_io_buf_bytes;
142 __u32 dev_id;
143
144 __s32 ublksrv_pid;
145 __u32 pad1;
146
147 __u64 flags;
148
149 /* For ublksrv internal use, invisible to ublk driver */
150 __u64 ublksrv_flags;
151
152 __u32 owner_uid; /* store by kernel */
153 __u32 owner_gid; /* store by kernel */
154 __u64 reserved1;
155 __u64 reserved2;
156};
157
158#define UBLK_IO_OP_READ 0
159#define UBLK_IO_OP_WRITE 1
160#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
164
165#define UBLK_IO_F_FAILFAST_DEV (1U << 8)
166#define UBLK_IO_F_FAILFAST_TRANSPORT (1U << 9)
167#define UBLK_IO_F_FAILFAST_DRIVER (1U << 10)
168#define UBLK_IO_F_META (1U << 11)
169#define UBLK_IO_F_FUA (1U << 13)
170#define UBLK_IO_F_NOUNMAP (1U << 15)
171#define UBLK_IO_F_SWAP (1U << 16)
172
173/*
174 * io cmd is described by this structure, and stored in share memory, indexed
175 * by request tag.
176 *
177 * The data is stored by ublk driver, and read by ublksrv after one fetch command
178 * returns.
179 */
180struct ublksrv_io_desc {
181 /* op: bit 0-7, flags: bit 8-31 */
182 __u32 op_flags;
183
184 __u32 nr_sectors;
185
186 /* start sector for this io */
187 __u64 start_sector;
188
189 /* buffer address in ublksrv daemon vm space, from ublk driver */
190 __u64 addr;
191};
192
193static __inline__ __u8 ublksrv_get_op(const struct ublksrv_io_desc *iod)
194{
195 return iod->op_flags & 0xff;
196}
197
198static __inline__ __u32 ublksrv_get_flags(const struct ublksrv_io_desc *iod)
199{
200 return iod->op_flags >> 8;
201}
202
203/* issued to ublk driver via /dev/ublkcN */
204struct ublksrv_io_cmd {
205 __u16 q_id;
206
207 /* for fetch/commit which result */
208 __u16 tag;
209
210 /* io result, it is valid for COMMIT* command only */
211 __s32 result;
212
213 /*
214 * userspace buffer address in ublksrv daemon process, valid for
215 * FETCH* command only
216 */
217 __u64 addr;
218};
219
220struct ublk_param_basic {
221#define UBLK_ATTR_READ_ONLY (1 << 0)
222#define UBLK_ATTR_ROTATIONAL (1 << 1)
223#define UBLK_ATTR_VOLATILE_CACHE (1 << 2)
224#define UBLK_ATTR_FUA (1 << 3)
225 __u32 attrs;
226 __u8 logical_bs_shift;
227 __u8 physical_bs_shift;
228 __u8 io_opt_shift;
229 __u8 io_min_shift;
230
231 __u32 max_sectors;
232 __u32 chunk_sectors;
233
234 __u64 dev_sectors;
235 __u64 virt_boundary_mask;
236};
237
238struct ublk_param_discard {
239 __u32 discard_alignment;
240
241 __u32 discard_granularity;
242 __u32 max_discard_sectors;
243
244 __u32 max_write_zeroes_sectors;
245 __u16 max_discard_segments;
246 __u16 reserved0;
247};
248
249/*
250 * read-only, can't set via UBLK_CMD_SET_PARAMS, disk_devt is available
251 * after device is started
252 */
253struct ublk_param_devt {
254 __u32 char_major;
255 __u32 char_minor;
256 __u32 disk_major;
257 __u32 disk_minor;
258};
259
260struct ublk_params {
261 /*
262 * Total length of parameters, userspace has to set 'len' for both
263 * SET_PARAMS and GET_PARAMS command, and driver may update len
264 * if two sides use different version of 'ublk_params', same with
265 * 'types' fields.
266 */
267 __u32 len;
268#define UBLK_PARAM_TYPE_BASIC (1 << 0)
269#define UBLK_PARAM_TYPE_DISCARD (1 << 1)
270#define UBLK_PARAM_TYPE_DEVT (1 << 2)
271 __u32 types; /* types of parameter included */
272
273 struct ublk_param_basic basic;
274 struct ublk_param_discard discard;
275 struct ublk_param_devt devt;
276};
277
278#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/audio.h+1-1
......@@ -341,7 +341,7 @@ struct uac_feature_unit_descriptor {
341341 __u8 bUnitID;
342342 __u8 bSourceID;
343343 __u8 bControlSize;
344 __u8 bmaControls[0]; /* variable length */
344 __u8 bmaControls[]; /* variable length */
345345} __attribute__((packed));
346346
347347static __inline__ __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
lib/libc/include/any-linux-any/linux/usb/cdc.h+16-3
......@@ -171,7 +171,7 @@ struct usb_cdc_mdlm_detail_desc {
171171
172172 /* type is associated with mdlm_desc.bGUID */
173173 __u8 bGuidDescriptorType;
174 __u8 bDetailData[0];
174 __u8 bDetailData[];
175175} __attribute__ ((packed));
176176
177177/* "OBEX Control Model Functional Descriptor" */
......@@ -271,6 +271,10 @@ struct usb_cdc_line_coding {
271271 __u8 bDataBits;
272272} __attribute__ ((packed));
273273
274/* Control Signal Bitmap Values from 6.2.14 SetControlLineState */
275#define USB_CDC_CTRL_DTR (1 << 0)
276#define USB_CDC_CTRL_RTS (1 << 1)
277
274278/* table 62; bits in multicast filter */
275279#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
276280#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
......@@ -302,6 +306,15 @@ struct usb_cdc_notification {
302306 __le16 wLength;
303307} __attribute__ ((packed));
304308
309/* UART State Bitmap Values from 6.3.5 SerialState */
310#define USB_CDC_SERIAL_STATE_DCD (1 << 0)
311#define USB_CDC_SERIAL_STATE_DSR (1 << 1)
312#define USB_CDC_SERIAL_STATE_BREAK (1 << 2)
313#define USB_CDC_SERIAL_STATE_RING_SIGNAL (1 << 3)
314#define USB_CDC_SERIAL_STATE_FRAMING (1 << 4)
315#define USB_CDC_SERIAL_STATE_PARITY (1 << 5)
316#define USB_CDC_SERIAL_STATE_OVERRUN (1 << 6)
317
305318struct usb_cdc_speed_change {
306319 __le32 DLBitRRate; /* contains the downlink bit rate (IN pipe) */
307320 __le32 ULBitRate; /* contains the uplink bit rate (OUT pipe) */
......@@ -379,7 +392,7 @@ struct usb_cdc_ncm_ndp16 {
379392 __le32 dwSignature;
380393 __le16 wLength;
381394 __le16 wNextNdpIndex;
382 struct usb_cdc_ncm_dpe16 dpe16[0];
395 struct usb_cdc_ncm_dpe16 dpe16[];
383396} __attribute__ ((packed));
384397
385398/* 32-bit NCM Datagram Pointer Entry */
......@@ -395,7 +408,7 @@ struct usb_cdc_ncm_ndp32 {
395408 __le16 wReserved6;
396409 __le32 dwNextNdpIndex;
397410 __le32 dwReserved12;
398 struct usb_cdc_ncm_dpe32 dpe32[0];
411 struct usb_cdc_ncm_dpe32 dpe32[];
399412} __attribute__ ((packed));
400413
401414/* CDC NCM subclass 3.2.1 and 3.2.2 */
lib/libc/include/any-linux-any/linux/usb/ch9.h+17-1
......@@ -818,7 +818,7 @@ struct usb_key_descriptor {
818818
819819 __u8 tTKID[3];
820820 __u8 bReserved;
821 __u8 bKeyData[0];
821 __u8 bKeyData[];
822822} __attribute__((packed));
823823
824824/*-------------------------------------------------------------------------*/
......@@ -947,6 +947,22 @@ struct usb_ss_container_id_descriptor {
947947
948948#define USB_DT_USB_SS_CONTN_ID_SIZE 20
949949
950/*
951 * Platform Device Capability descriptor: Defines platform specific device
952 * capabilities
953 */
954#define USB_PLAT_DEV_CAP_TYPE 5
955struct usb_plat_dev_cap_descriptor {
956 __u8 bLength;
957 __u8 bDescriptorType;
958 __u8 bDevCapabilityType;
959 __u8 bReserved;
960 __u8 UUID[16];
961 __u8 CapabilityData[];
962} __attribute__((packed));
963
964#define USB_DT_USB_PLAT_DEV_CAP_SIZE(capability_data_size) (20 + capability_data_size)
965
950966/*
951967 * SuperSpeed Plus USB Capability descriptor: Defines the set of
952968 * SuperSpeed Plus USB specific device level capabilities
lib/libc/include/any-linux-any/linux/usb/g_uvc.h+3
......@@ -21,6 +21,9 @@
2121#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5)
2222#define UVC_EVENT_LAST (V4L2_EVENT_PRIVATE_START + 5)
2323
24#define UVC_STRING_CONTROL_IDX 0
25#define UVC_STRING_STREAMING_IDX 1
26
2427struct uvc_request_data {
2528 __s32 length;
2629 __u8 data[60];
lib/libc/include/any-linux-any/linux/usb/raw_gadget.h+2-2
......@@ -60,7 +60,7 @@ enum usb_raw_event_type {
6060struct usb_raw_event {
6161 __u32 type;
6262 __u32 length;
63 __u8 data[0];
63 __u8 data[];
6464};
6565
6666#define USB_RAW_IO_FLAGS_ZERO 0x0001
......@@ -90,7 +90,7 @@ struct usb_raw_ep_io {
9090 __u16 ep;
9191 __u16 flags;
9292 __u32 length;
93 __u8 data[0];
93 __u8 data[];
9494};
9595
9696/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
lib/libc/include/any-linux-any/linux/usb/video.h+32-2
......@@ -179,6 +179,36 @@
179179#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
180180#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
181181
182/* 3.9.2.6 Color Matching Descriptor Values */
183enum uvc_color_primaries_values {
184 UVC_COLOR_PRIMARIES_UNSPECIFIED,
185 UVC_COLOR_PRIMARIES_BT_709_SRGB,
186 UVC_COLOR_PRIMARIES_BT_470_2_M,
187 UVC_COLOR_PRIMARIES_BT_470_2_B_G,
188 UVC_COLOR_PRIMARIES_SMPTE_170M,
189 UVC_COLOR_PRIMARIES_SMPTE_240M,
190};
191
192enum uvc_transfer_characteristics_values {
193 UVC_TRANSFER_CHARACTERISTICS_UNSPECIFIED,
194 UVC_TRANSFER_CHARACTERISTICS_BT_709,
195 UVC_TRANSFER_CHARACTERISTICS_BT_470_2_M,
196 UVC_TRANSFER_CHARACTERISTICS_BT_470_2_B_G,
197 UVC_TRANSFER_CHARACTERISTICS_SMPTE_170M,
198 UVC_TRANSFER_CHARACTERISTICS_SMPTE_240M,
199 UVC_TRANSFER_CHARACTERISTICS_LINEAR,
200 UVC_TRANSFER_CHARACTERISTICS_SRGB,
201};
202
203enum uvc_matrix_coefficients {
204 UVC_MATRIX_COEFFICIENTS_UNSPECIFIED,
205 UVC_MATRIX_COEFFICIENTS_BT_709,
206 UVC_MATRIX_COEFFICIENTS_FCC,
207 UVC_MATRIX_COEFFICIENTS_BT_470_2_B_G,
208 UVC_MATRIX_COEFFICIENTS_SMPTE_170M,
209 UVC_MATRIX_COEFFICIENTS_SMPTE_240M,
210};
211
182212/* ------------------------------------------------------------------------
183213 * UVC structures
184214 */
......@@ -466,7 +496,7 @@ struct uvc_format_uncompressed {
466496 __u8 bDefaultFrameIndex;
467497 __u8 bAspectRatioX;
468498 __u8 bAspectRatioY;
469 __u8 bmInterfaceFlags;
499 __u8 bmInterlaceFlags;
470500 __u8 bCopyProtect;
471501} __attribute__((__packed__));
472502
......@@ -522,7 +552,7 @@ struct uvc_format_mjpeg {
522552 __u8 bDefaultFrameIndex;
523553 __u8 bAspectRatioX;
524554 __u8 bAspectRatioY;
525 __u8 bmInterfaceFlags;
555 __u8 bmInterlaceFlags;
526556 __u8 bCopyProtect;
527557} __attribute__((__packed__));
528558
lib/libc/include/any-linux-any/linux/usbdevice_fs.h+2-2
......@@ -131,7 +131,7 @@ struct usbdevfs_urb {
131131 unsigned int signr; /* signal to be sent on completion,
132132 or 0 if none should be sent. */
133133 void *usercontext;
134 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
134 struct usbdevfs_iso_packet_desc iso_frame_desc[];
135135};
136136
137137/* ioctls for talking directly to drivers */
......@@ -176,7 +176,7 @@ struct usbdevfs_disconnect_claim {
176176struct usbdevfs_streams {
177177 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */
178178 unsigned int num_eps;
179 unsigned char eps[0];
179 unsigned char eps[];
180180};
181181
182182/*
lib/libc/include/any-linux-any/linux/usbip.h+26
......@@ -24,4 +24,30 @@ enum usbip_device_status {
2424 VDEV_ST_USED,
2525 VDEV_ST_ERROR
2626};
27
28/* USB URB Transfer flags:
29 *
30 * USBIP server and client (vchi) pack URBs in TCP packets. The following
31 * are the transfer type defines used in USBIP protocol.
32 */
33
34#define USBIP_URB_SHORT_NOT_OK 0x0001
35#define USBIP_URB_ISO_ASAP 0x0002
36#define USBIP_URB_NO_TRANSFER_DMA_MAP 0x0004
37#define USBIP_URB_ZERO_PACKET 0x0040
38#define USBIP_URB_NO_INTERRUPT 0x0080
39#define USBIP_URB_FREE_BUFFER 0x0100
40#define USBIP_URB_DIR_IN 0x0200
41#define USBIP_URB_DIR_OUT 0
42#define USBIP_URB_DIR_MASK USBIP_URB_DIR_IN
43
44#define USBIP_URB_DMA_MAP_SINGLE 0x00010000
45#define USBIP_URB_DMA_MAP_PAGE 0x00020000
46#define USBIP_URB_DMA_MAP_SG 0x00040000
47#define USBIP_URB_MAP_LOCAL 0x00080000
48#define USBIP_URB_SETUP_MAP_SINGLE 0x00100000
49#define USBIP_URB_SETUP_MAP_LOCAL 0x00200000
50#define USBIP_URB_DMA_SG_COMBINED 0x00400000
51#define USBIP_URB_ALIGNED_TEMP_BUFFER 0x00800000
52
2753#endif /* _LINUX_USBIP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/userfaultfd.h+18-2
......@@ -12,6 +12,10 @@
1212
1313#include <linux/types.h>
1414
15/* ioctls for /dev/userfaultfd */
16#define USERFAULTFD_IOC 0xAA
17#define USERFAULTFD_IOC_NEW _IO(USERFAULTFD_IOC, 0x00)
18
1519/*
1620 * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and
1721 * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In
......@@ -32,7 +36,9 @@
3236 UFFD_FEATURE_SIGBUS | \
3337 UFFD_FEATURE_THREAD_ID | \
3438 UFFD_FEATURE_MINOR_HUGETLBFS | \
35 UFFD_FEATURE_MINOR_SHMEM)
39 UFFD_FEATURE_MINOR_SHMEM | \
40 UFFD_FEATURE_EXACT_ADDRESS | \
41 UFFD_FEATURE_WP_HUGETLBFS_SHMEM)
3642#define UFFD_API_IOCTLS \
3743 ((__u64)1 << _UFFDIO_REGISTER | \
3844 (__u64)1 << _UFFDIO_UNREGISTER | \
......@@ -46,7 +52,8 @@
4652#define UFFD_API_RANGE_IOCTLS_BASIC \
4753 ((__u64)1 << _UFFDIO_WAKE | \
4854 (__u64)1 << _UFFDIO_COPY | \
49 (__u64)1 << _UFFDIO_CONTINUE)
55 (__u64)1 << _UFFDIO_CONTINUE | \
56 (__u64)1 << _UFFDIO_WRITEPROTECT)
5057
5158/*
5259 * Valid ioctl command number range with this API is from 0x00 to
......@@ -189,6 +196,13 @@ struct uffdio_api {
189196 *
190197 * UFFD_FEATURE_MINOR_SHMEM indicates the same support as
191198 * UFFD_FEATURE_MINOR_HUGETLBFS, but for shmem-backed pages instead.
199 *
200 * UFFD_FEATURE_EXACT_ADDRESS indicates that the exact address of page
201 * faults would be provided and the offset within the page would not be
202 * masked.
203 *
204 * UFFD_FEATURE_WP_HUGETLBFS_SHMEM indicates that userfaultfd
205 * write-protection mode is supported on both shmem and hugetlbfs.
192206 */
193207#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
194208#define UFFD_FEATURE_EVENT_FORK (1<<1)
......@@ -201,6 +215,8 @@ struct uffdio_api {
201215#define UFFD_FEATURE_THREAD_ID (1<<8)
202216#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9)
203217#define UFFD_FEATURE_MINOR_SHMEM (1<<10)
218#define UFFD_FEATURE_EXACT_ADDRESS (1<<11)
219#define UFFD_FEATURE_WP_HUGETLBFS_SHMEM (1<<12)
204220 __u64 features;
205221
206222 __u64 ioctls;
lib/libc/include/any-linux-any/linux/uuid.h+5-17
......@@ -1,18 +1,10 @@
11/* 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 */
23/*
3 * UUID/GUID definition
4 * MEI UUID definition
45 *
56 * Copyright (C) 2010, Intel Corp.
67 * Huang Ying <ying.huang@intel.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation;
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.
168 */
179
1810#ifndef _LINUX_UUID_H_
......@@ -22,19 +14,15 @@
2214
2315typedef struct {
2416 __u8 b[16];
25} guid_t;
17} uuid_le;
2618
27#define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
28((guid_t) \
19#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
20((uuid_le) \
2921{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
3022 (b) & 0xff, ((b) >> 8) & 0xff, \
3123 (c) & 0xff, ((c) >> 8) & 0xff, \
3224 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
3325
34/* backwards compatibility, don't use in new code */
35typedef guid_t uuid_le;
36#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
37 GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
3826#define NULL_UUID_LE \
3927 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
4028 0x00, 0x00, 0x00, 0x00)
lib/libc/include/any-linux-any/linux/uvcvideo.h+4-2
......@@ -36,9 +36,11 @@
3636 UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
3737 UVC_CTRL_FLAG_GET_DEF)
3838
39#define UVC_MENU_NAME_LEN 32
40
3941struct uvc_menu_info {
4042 __u32 value;
41 __u8 name[32];
43 __u8 name[UVC_MENU_NAME_LEN];
4244};
4345
4446struct uvc_xu_control_mapping {
......@@ -86,7 +88,7 @@ struct uvc_xu_control_query {
8688 * struct. The first two fields are added by the driver, they can be used for
8789 * clock synchronisation. The rest is an exact copy of a UVC payload header.
8890 * Only complete objects with complete buffers are included. Therefore it's
89 * always sizeof(meta->ts) + sizeof(meta->sof) + meta->length bytes large.
91 * always sizeof(meta->ns) + sizeof(meta->sof) + meta->length bytes large.
9092 */
9193struct uvc_meta_buf {
9294 __u64 ns;
lib/libc/include/any-linux-any/linux/v4l2-common.h-39
......@@ -10,45 +10,6 @@
1010 *
1111 * Copyright (C) 2012 Nokia Corporation
1212 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * Alternatively you can redistribute this file under the terms of the
25 * BSD license as stated below:
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in
34 * the documentation and/or other materials provided with the
35 * distribution.
36 * 3. The names of its contributors may not be used to endorse or promote
37 * products derived from this software without specific prior written
38 * permission.
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
46 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
47 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
48 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
49 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 *
5213 */
5314
5415#ifndef __V4L2_COMMON__
lib/libc/include/any-linux-any/linux/v4l2-controls.h+778-42
......@@ -4,44 +4,6 @@
44 *
55 * Copyright (C) 1999-2012 the contributors
66 *
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 * Alternatively you can redistribute this file under the terms of the
18 * BSD license as stated below:
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in
27 * the documentation and/or other materials provided with the
28 * distribution.
29 * 3. The names of its contributors may not be used to endorse or promote
30 * products derived from this software without specific prior written
31 * permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
40 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
42 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 *
457 * The contents of this header was split off from videodev2.h. All control
468 * definitions should be added to this header, which is included by
479 * videodev2.h.
......@@ -128,6 +90,7 @@ enum v4l2_colorfx {
12890 V4L2_COLORFX_SOLARIZATION = 13,
12991 V4L2_COLORFX_ANTIQUE = 14,
13092 V4L2_COLORFX_SET_CBCR = 15,
93 V4L2_COLORFX_SET_RGB = 16,
13194};
13295#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
13396#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
......@@ -145,14 +108,17 @@ enum v4l2_colorfx {
145108
146109#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
147110#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
111#define V4L2_CID_COLORFX_RGB (V4L2_CID_BASE+43)
148112
149113/* last CID + 1 */
150#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)
114#define V4L2_CID_LASTP1 (V4L2_CID_BASE+44)
151115
152116/* USER-class private control IDs */
153117
154/* The base for the meye driver controls. See linux/meye.h for the list
155 * of controls. We reserve 16 controls for this driver. */
118/*
119 * The base for the meye driver controls. This driver was removed, but
120 * we keep this define in case any software still uses it.
121 */
156122#define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000)
157123
158124/* The base for the bttv driver controls.
......@@ -217,6 +183,24 @@ enum v4l2_colorfx {
217183 */
218184#define V4L2_CID_USER_ALLEGRO_BASE (V4L2_CID_USER_BASE + 0x1170)
219185
186/*
187 * The base for the isl7998x driver controls.
188 * We reserve 16 controls for this driver.
189 */
190#define V4L2_CID_USER_ISL7998X_BASE (V4L2_CID_USER_BASE + 0x1180)
191
192/*
193 * The base for DW100 driver controls.
194 * We reserve 16 controls for this driver.
195 */
196#define V4L2_CID_USER_DW100_BASE (V4L2_CID_USER_BASE + 0x1190)
197
198/*
199 * The base for Aspeed driver controls.
200 * We reserve 16 controls for this driver.
201 */
202#define V4L2_CID_USER_ASPEED_BASE (V4L2_CID_USER_BASE + 0x11a0)
203
220204/* MPEG-class control IDs */
221205/* The MPEG controls are applicable to all codec controls
222206 * and the 'MPEG' part of the define is historical */
......@@ -439,6 +423,11 @@ enum v4l2_mpeg_video_multi_slice_mode {
439423#define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234)
440424#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235)
441425#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+236)
426#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE (V4L2_CID_CODEC_BASE+237)
427enum v4l2_mpeg_video_intra_refresh_period_type {
428 V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM = 0,
429 V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC = 1,
430};
442431
443432/* CIDs for the MPEG-2 Part 2 (H.262) codec */
444433#define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)
......@@ -998,6 +987,8 @@ enum v4l2_auto_focus_range {
998987
999988#define V4L2_CID_CAMERA_SENSOR_ROTATION (V4L2_CID_CAMERA_CLASS_BASE+35)
1000989
990#define V4L2_CID_HDR_SENSOR_MODE (V4L2_CID_CAMERA_CLASS_BASE+36)
991
1001992/* FM Modulator class control IDs */
1002993
1003994#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
......@@ -1559,6 +1550,8 @@ struct v4l2_h264_dpb_entry {
15591550#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
15601551#define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC 0x02
15611552#define V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD 0x04
1553#define V4L2_H264_DECODE_PARAM_FLAG_PFRAME 0x08
1554#define V4L2_H264_DECODE_PARAM_FLAG_BFRAME 0x10
15621555
15631556#define V4L2_CID_STATELESS_H264_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 7)
15641557/**
......@@ -1713,7 +1706,7 @@ struct v4l2_vp8_segment {
17131706 * @sharpness_level: matches sharpness_level syntax element.
17141707 * @level: matches loop_filter_level syntax element.
17151708 * @padding: padding field. Should be zeroed by applications.
1716 * @flags: see V4L2_VP8_LF_FLAG_{}.
1709 * @flags: see V4L2_VP8_LF_{}.
17171710 *
17181711 * This structure contains loop filter related parameters.
17191712 * See the 'mb_lf_adjustments()' part of the frame header syntax,
......@@ -1980,6 +1973,465 @@ struct v4l2_ctrl_mpeg2_quantisation {
19801973 __u8 chroma_non_intra_quantiser_matrix[64];
19811974};
19821975
1976#define V4L2_CID_STATELESS_HEVC_SPS (V4L2_CID_CODEC_STATELESS_BASE + 400)
1977#define V4L2_CID_STATELESS_HEVC_PPS (V4L2_CID_CODEC_STATELESS_BASE + 401)
1978#define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 402)
1979#define V4L2_CID_STATELESS_HEVC_SCALING_MATRIX (V4L2_CID_CODEC_STATELESS_BASE + 403)
1980#define V4L2_CID_STATELESS_HEVC_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 404)
1981#define V4L2_CID_STATELESS_HEVC_DECODE_MODE (V4L2_CID_CODEC_STATELESS_BASE + 405)
1982#define V4L2_CID_STATELESS_HEVC_START_CODE (V4L2_CID_CODEC_STATELESS_BASE + 406)
1983#define V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS (V4L2_CID_CODEC_STATELESS_BASE + 407)
1984
1985enum v4l2_stateless_hevc_decode_mode {
1986 V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED,
1987 V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED,
1988};
1989
1990enum v4l2_stateless_hevc_start_code {
1991 V4L2_STATELESS_HEVC_START_CODE_NONE,
1992 V4L2_STATELESS_HEVC_START_CODE_ANNEX_B,
1993};
1994
1995#define V4L2_HEVC_SLICE_TYPE_B 0
1996#define V4L2_HEVC_SLICE_TYPE_P 1
1997#define V4L2_HEVC_SLICE_TYPE_I 2
1998
1999#define V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE (1ULL << 0)
2000#define V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED (1ULL << 1)
2001#define V4L2_HEVC_SPS_FLAG_AMP_ENABLED (1ULL << 2)
2002#define V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET (1ULL << 3)
2003#define V4L2_HEVC_SPS_FLAG_PCM_ENABLED (1ULL << 4)
2004#define V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED (1ULL << 5)
2005#define V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT (1ULL << 6)
2006#define V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED (1ULL << 7)
2007#define V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED (1ULL << 8)
2008
2009/**
2010 * struct v4l2_ctrl_hevc_sps - ITU-T Rec. H.265: Sequence parameter set
2011 *
2012 * @video_parameter_set_id: specifies the value of the
2013 * vps_video_parameter_set_id of the active VPS
2014 * @seq_parameter_set_id: provides an identifier for the SPS for
2015 * reference by other syntax elements
2016 * @pic_width_in_luma_samples: specifies the width of each decoded picture
2017 * in units of luma samples
2018 * @pic_height_in_luma_samples: specifies the height of each decoded picture
2019 * in units of luma samples
2020 * @bit_depth_luma_minus8: this value plus 8specifies the bit depth of the
2021 * samples of the luma array
2022 * @bit_depth_chroma_minus8: this value plus 8 specifies the bit depth of the
2023 * samples of the chroma arrays
2024 * @log2_max_pic_order_cnt_lsb_minus4: this value plus 4 specifies the value of
2025 * the variable MaxPicOrderCntLsb
2026 * @sps_max_dec_pic_buffering_minus1: this value plus 1 specifies the maximum
2027 * required size of the decoded picture
2028 * buffer for the codec video sequence
2029 * @sps_max_num_reorder_pics: indicates the maximum allowed number of pictures
2030 * @sps_max_latency_increase_plus1: not equal to 0 is used to compute the
2031 * value of SpsMaxLatencyPictures array
2032 * @log2_min_luma_coding_block_size_minus3: plus 3 specifies the minimum
2033 * luma coding block size
2034 * @log2_diff_max_min_luma_coding_block_size: specifies the difference between
2035 * the maximum and minimum luma
2036 * coding block size
2037 * @log2_min_luma_transform_block_size_minus2: plus 2 specifies the minimum luma
2038 * transform block size
2039 * @log2_diff_max_min_luma_transform_block_size: specifies the difference between
2040 * the maximum and minimum luma
2041 * transform block size
2042 * @max_transform_hierarchy_depth_inter: specifies the maximum hierarchy
2043 * depth for transform units of
2044 * coding units coded in inter
2045 * prediction mode
2046 * @max_transform_hierarchy_depth_intra: specifies the maximum hierarchy
2047 * depth for transform units of
2048 * coding units coded in intra
2049 * prediction mode
2050 * @pcm_sample_bit_depth_luma_minus1: this value plus 1 specifies the number of
2051 * bits used to represent each of PCM sample
2052 * values of the luma component
2053 * @pcm_sample_bit_depth_chroma_minus1: this value plus 1 specifies the number
2054 * of bits used to represent each of PCM
2055 * sample values of the chroma components
2056 * @log2_min_pcm_luma_coding_block_size_minus3: this value plus 3 specifies the
2057 * minimum size of coding blocks
2058 * @log2_diff_max_min_pcm_luma_coding_block_size: specifies the difference between
2059 * the maximum and minimum size of
2060 * coding blocks
2061 * @num_short_term_ref_pic_sets: specifies the number of st_ref_pic_set()
2062 * syntax structures included in the SPS
2063 * @num_long_term_ref_pics_sps: specifies the number of candidate long-term
2064 * reference pictures that are specified in the SPS
2065 * @chroma_format_idc: specifies the chroma sampling
2066 * @sps_max_sub_layers_minus1: this value plus 1 specifies the maximum number
2067 * of temporal sub-layers
2068 * @reserved: padding field. Should be zeroed by applications.
2069 * @flags: see V4L2_HEVC_SPS_FLAG_{}
2070 */
2071struct v4l2_ctrl_hevc_sps {
2072 __u8 video_parameter_set_id;
2073 __u8 seq_parameter_set_id;
2074 __u16 pic_width_in_luma_samples;
2075 __u16 pic_height_in_luma_samples;
2076 __u8 bit_depth_luma_minus8;
2077 __u8 bit_depth_chroma_minus8;
2078 __u8 log2_max_pic_order_cnt_lsb_minus4;
2079 __u8 sps_max_dec_pic_buffering_minus1;
2080 __u8 sps_max_num_reorder_pics;
2081 __u8 sps_max_latency_increase_plus1;
2082 __u8 log2_min_luma_coding_block_size_minus3;
2083 __u8 log2_diff_max_min_luma_coding_block_size;
2084 __u8 log2_min_luma_transform_block_size_minus2;
2085 __u8 log2_diff_max_min_luma_transform_block_size;
2086 __u8 max_transform_hierarchy_depth_inter;
2087 __u8 max_transform_hierarchy_depth_intra;
2088 __u8 pcm_sample_bit_depth_luma_minus1;
2089 __u8 pcm_sample_bit_depth_chroma_minus1;
2090 __u8 log2_min_pcm_luma_coding_block_size_minus3;
2091 __u8 log2_diff_max_min_pcm_luma_coding_block_size;
2092 __u8 num_short_term_ref_pic_sets;
2093 __u8 num_long_term_ref_pics_sps;
2094 __u8 chroma_format_idc;
2095 __u8 sps_max_sub_layers_minus1;
2096
2097 __u8 reserved[6];
2098 __u64 flags;
2099};
2100
2101#define V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT_ENABLED (1ULL << 0)
2102#define V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT (1ULL << 1)
2103#define V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED (1ULL << 2)
2104#define V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT (1ULL << 3)
2105#define V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED (1ULL << 4)
2106#define V4L2_HEVC_PPS_FLAG_TRANSFORM_SKIP_ENABLED (1ULL << 5)
2107#define V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED (1ULL << 6)
2108#define V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT (1ULL << 7)
2109#define V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED (1ULL << 8)
2110#define V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED (1ULL << 9)
2111#define V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED (1ULL << 10)
2112#define V4L2_HEVC_PPS_FLAG_TILES_ENABLED (1ULL << 11)
2113#define V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED (1ULL << 12)
2114#define V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED (1ULL << 13)
2115#define V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED (1ULL << 14)
2116#define V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED (1ULL << 15)
2117#define V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER (1ULL << 16)
2118#define V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT (1ULL << 17)
2119#define V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT (1ULL << 18)
2120#define V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT (1ULL << 19)
2121#define V4L2_HEVC_PPS_FLAG_UNIFORM_SPACING (1ULL << 20)
2122
2123/**
2124 * struct v4l2_ctrl_hevc_pps - ITU-T Rec. H.265: Picture parameter set
2125 *
2126 * @pic_parameter_set_id: identifies the PPS for reference by other
2127 * syntax elements
2128 * @num_extra_slice_header_bits: specifies the number of extra slice header
2129 * bits that are present in the slice header RBSP
2130 * for coded pictures referring to the PPS.
2131 * @num_ref_idx_l0_default_active_minus1: this value plus 1 specifies the
2132 * inferred value of num_ref_idx_l0_active_minus1
2133 * @num_ref_idx_l1_default_active_minus1: this value plus 1 specifies the
2134 * inferred value of num_ref_idx_l1_active_minus1
2135 * @init_qp_minus26: this value plus 26 specifies the initial value of SliceQp Y for
2136 * each slice referring to the PPS
2137 * @diff_cu_qp_delta_depth: specifies the difference between the luma coding
2138 * tree block size and the minimum luma coding block
2139 * size of coding units that convey cu_qp_delta_abs
2140 * and cu_qp_delta_sign_flag
2141 * @pps_cb_qp_offset: specify the offsets to the luma quantization parameter Cb
2142 * @pps_cr_qp_offset: specify the offsets to the luma quantization parameter Cr
2143 * @num_tile_columns_minus1: this value plus 1 specifies the number of tile columns
2144 * partitioning the picture
2145 * @num_tile_rows_minus1: this value plus 1 specifies the number of tile rows partitioning
2146 * the picture
2147 * @column_width_minus1: this value plus 1 specifies the width of the each tile column in
2148 * units of coding tree blocks
2149 * @row_height_minus1: this value plus 1 specifies the height of the each tile row in
2150 * units of coding tree blocks
2151 * @pps_beta_offset_div2: specify the default deblocking parameter offsets for
2152 * beta divided by 2
2153 * @pps_tc_offset_div2: specify the default deblocking parameter offsets for tC
2154 * divided by 2
2155 * @log2_parallel_merge_level_minus2: this value plus 2 specifies the value of
2156 * the variable Log2ParMrgLevel
2157 * @reserved: padding field. Should be zeroed by applications.
2158 * @flags: see V4L2_HEVC_PPS_FLAG_{}
2159 */
2160struct v4l2_ctrl_hevc_pps {
2161 __u8 pic_parameter_set_id;
2162 __u8 num_extra_slice_header_bits;
2163 __u8 num_ref_idx_l0_default_active_minus1;
2164 __u8 num_ref_idx_l1_default_active_minus1;
2165 __s8 init_qp_minus26;
2166 __u8 diff_cu_qp_delta_depth;
2167 __s8 pps_cb_qp_offset;
2168 __s8 pps_cr_qp_offset;
2169 __u8 num_tile_columns_minus1;
2170 __u8 num_tile_rows_minus1;
2171 __u8 column_width_minus1[20];
2172 __u8 row_height_minus1[22];
2173 __s8 pps_beta_offset_div2;
2174 __s8 pps_tc_offset_div2;
2175 __u8 log2_parallel_merge_level_minus2;
2176 __u8 reserved;
2177 __u64 flags;
2178};
2179
2180#define V4L2_HEVC_DPB_ENTRY_LONG_TERM_REFERENCE 0x01
2181
2182#define V4L2_HEVC_SEI_PIC_STRUCT_FRAME 0
2183#define V4L2_HEVC_SEI_PIC_STRUCT_TOP_FIELD 1
2184#define V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_FIELD 2
2185#define V4L2_HEVC_SEI_PIC_STRUCT_TOP_BOTTOM 3
2186#define V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_TOP 4
2187#define V4L2_HEVC_SEI_PIC_STRUCT_TOP_BOTTOM_TOP 5
2188#define V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM 6
2189#define V4L2_HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING 7
2190#define V4L2_HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING 8
2191#define V4L2_HEVC_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM 9
2192#define V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP 10
2193#define V4L2_HEVC_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM 11
2194#define V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP 12
2195
2196#define V4L2_HEVC_DPB_ENTRIES_NUM_MAX 16
2197
2198/**
2199 * struct v4l2_hevc_dpb_entry - HEVC decoded picture buffer entry
2200 *
2201 * @timestamp: timestamp of the V4L2 capture buffer to use as reference.
2202 * @flags: long term flag for the reference frame
2203 * @field_pic: whether the reference is a field picture or a frame.
2204 * @reserved: padding field. Should be zeroed by applications.
2205 * @pic_order_cnt_val: the picture order count of the current picture.
2206 */
2207struct v4l2_hevc_dpb_entry {
2208 __u64 timestamp;
2209 __u8 flags;
2210 __u8 field_pic;
2211 __u16 reserved;
2212 __s32 pic_order_cnt_val;
2213};
2214
2215/**
2216 * struct v4l2_hevc_pred_weight_table - HEVC weighted prediction parameters
2217 *
2218 * @delta_luma_weight_l0: the difference of the weighting factor applied
2219 * to the luma prediction value for list 0
2220 * @luma_offset_l0: the additive offset applied to the luma prediction value
2221 * for list 0
2222 * @delta_chroma_weight_l0: the difference of the weighting factor applied
2223 * to the chroma prediction values for list 0
2224 * @chroma_offset_l0: the difference of the additive offset applied to
2225 * the chroma prediction values for list 0
2226 * @delta_luma_weight_l1: the difference of the weighting factor applied
2227 * to the luma prediction value for list 1
2228 * @luma_offset_l1: the additive offset applied to the luma prediction value
2229 * for list 1
2230 * @delta_chroma_weight_l1: the difference of the weighting factor applied
2231 * to the chroma prediction values for list 1
2232 * @chroma_offset_l1: the difference of the additive offset applied to
2233 * the chroma prediction values for list 1
2234 * @luma_log2_weight_denom: the base 2 logarithm of the denominator for
2235 * all luma weighting factors
2236 * @delta_chroma_log2_weight_denom: the difference of the base 2 logarithm
2237 * of the denominator for all chroma
2238 * weighting factors
2239 */
2240struct v4l2_hevc_pred_weight_table {
2241 __s8 delta_luma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2242 __s8 luma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2243 __s8 delta_chroma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2];
2244 __s8 chroma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2];
2245
2246 __s8 delta_luma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2247 __s8 luma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2248 __s8 delta_chroma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2];
2249 __s8 chroma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2];
2250
2251 __u8 luma_log2_weight_denom;
2252 __s8 delta_chroma_log2_weight_denom;
2253};
2254
2255#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA (1ULL << 0)
2256#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA (1ULL << 1)
2257#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED (1ULL << 2)
2258#define V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO (1ULL << 3)
2259#define V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT (1ULL << 4)
2260#define V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0 (1ULL << 5)
2261#define V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV (1ULL << 6)
2262#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED (1ULL << 7)
2263#define V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED (1ULL << 8)
2264#define V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT (1ULL << 9)
2265
2266/**
2267 * struct v4l2_ctrl_hevc_slice_params - HEVC slice parameters
2268 *
2269 * This control is a dynamically sized 1-dimensional array,
2270 * V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it.
2271 *
2272 * @bit_size: size (in bits) of the current slice data
2273 * @data_byte_offset: offset (in bytes) to the video data in the current slice data
2274 * @num_entry_point_offsets: specifies the number of entry point offset syntax
2275 * elements in the slice header.
2276 * @nal_unit_type: specifies the coding type of the slice (B, P or I)
2277 * @nuh_temporal_id_plus1: minus 1 specifies a temporal identifier for the NAL unit
2278 * @slice_type: see V4L2_HEVC_SLICE_TYPE_{}
2279 * @colour_plane_id: specifies the colour plane associated with the current slice
2280 * @slice_pic_order_cnt: specifies the picture order count
2281 * @num_ref_idx_l0_active_minus1: this value plus 1 specifies the maximum
2282 * reference index for reference picture list 0
2283 * that may be used to decode the slice
2284 * @num_ref_idx_l1_active_minus1: this value plus 1 specifies the maximum
2285 * reference index for reference picture list 1
2286 * that may be used to decode the slice
2287 * @collocated_ref_idx: specifies the reference index of the collocated picture used
2288 * for temporal motion vector prediction
2289 * @five_minus_max_num_merge_cand: specifies the maximum number of merging
2290 * motion vector prediction candidates supported in
2291 * the slice subtracted from 5
2292 * @slice_qp_delta: specifies the initial value of QpY to be used for the coding
2293 * blocks in the slice
2294 * @slice_cb_qp_offset: specifies a difference to be added to the value of pps_cb_qp_offset
2295 * @slice_cr_qp_offset: specifies a difference to be added to the value of pps_cr_qp_offset
2296 * @slice_act_y_qp_offset: screen content extension parameters
2297 * @slice_act_cb_qp_offset: screen content extension parameters
2298 * @slice_act_cr_qp_offset: screen content extension parameters
2299 * @slice_beta_offset_div2: specify the deblocking parameter offsets for beta divided by 2
2300 * @slice_tc_offset_div2: specify the deblocking parameter offsets for tC divided by 2
2301 * @pic_struct: indicates whether a picture should be displayed as a frame or as one or
2302 * more fields
2303 * @reserved0: padding field. Should be zeroed by applications.
2304 * @slice_segment_addr: specifies the address of the first coding tree block in
2305 * the slice segment
2306 * @ref_idx_l0: the list of L0 reference elements as indices in the DPB
2307 * @ref_idx_l1: the list of L1 reference elements as indices in the DPB
2308 * @short_term_ref_pic_set_size: specifies the size of short-term reference
2309 * pictures set included in the SPS
2310 * @long_term_ref_pic_set_size: specifies the size of long-term reference
2311 * pictures set include in the SPS
2312 * @pred_weight_table: the prediction weight coefficients for inter-picture
2313 * prediction
2314 * @reserved1: padding field. Should be zeroed by applications.
2315 * @flags: see V4L2_HEVC_SLICE_PARAMS_FLAG_{}
2316 */
2317struct v4l2_ctrl_hevc_slice_params {
2318 __u32 bit_size;
2319 __u32 data_byte_offset;
2320 __u32 num_entry_point_offsets;
2321
2322 /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */
2323 __u8 nal_unit_type;
2324 __u8 nuh_temporal_id_plus1;
2325
2326 /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
2327 __u8 slice_type;
2328 __u8 colour_plane_id;
2329 __s32 slice_pic_order_cnt;
2330 __u8 num_ref_idx_l0_active_minus1;
2331 __u8 num_ref_idx_l1_active_minus1;
2332 __u8 collocated_ref_idx;
2333 __u8 five_minus_max_num_merge_cand;
2334 __s8 slice_qp_delta;
2335 __s8 slice_cb_qp_offset;
2336 __s8 slice_cr_qp_offset;
2337 __s8 slice_act_y_qp_offset;
2338 __s8 slice_act_cb_qp_offset;
2339 __s8 slice_act_cr_qp_offset;
2340 __s8 slice_beta_offset_div2;
2341 __s8 slice_tc_offset_div2;
2342
2343 /* ISO/IEC 23008-2, ITU-T Rec. H.265: Picture timing SEI message */
2344 __u8 pic_struct;
2345
2346 __u8 reserved0[3];
2347 /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */
2348 __u32 slice_segment_addr;
2349 __u8 ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2350 __u8 ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2351 __u16 short_term_ref_pic_set_size;
2352 __u16 long_term_ref_pic_set_size;
2353
2354 /* ISO/IEC 23008-2, ITU-T Rec. H.265: Weighted prediction parameter */
2355 struct v4l2_hevc_pred_weight_table pred_weight_table;
2356
2357 __u8 reserved1[2];
2358 __u64 flags;
2359};
2360
2361#define V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC 0x1
2362#define V4L2_HEVC_DECODE_PARAM_FLAG_IDR_PIC 0x2
2363#define V4L2_HEVC_DECODE_PARAM_FLAG_NO_OUTPUT_OF_PRIOR 0x4
2364
2365/**
2366 * struct v4l2_ctrl_hevc_decode_params - HEVC decode parameters
2367 *
2368 * @pic_order_cnt_val: picture order count
2369 * @short_term_ref_pic_set_size: specifies the size of short-term reference
2370 * pictures set included in the SPS of the first slice
2371 * @long_term_ref_pic_set_size: specifies the size of long-term reference
2372 * pictures set include in the SPS of the first slice
2373 * @num_active_dpb_entries: the number of entries in dpb
2374 * @num_poc_st_curr_before: the number of reference pictures in the short-term
2375 * set that come before the current frame
2376 * @num_poc_st_curr_after: the number of reference pictures in the short-term
2377 * set that come after the current frame
2378 * @num_poc_lt_curr: the number of reference pictures in the long-term set
2379 * @poc_st_curr_before: provides the index of the short term before references
2380 * in DPB array
2381 * @poc_st_curr_after: provides the index of the short term after references
2382 * in DPB array
2383 * @poc_lt_curr: provides the index of the long term references in DPB array
2384 * @reserved: padding field. Should be zeroed by applications.
2385 * @dpb: the decoded picture buffer, for meta-data about reference frames
2386 * @flags: see V4L2_HEVC_DECODE_PARAM_FLAG_{}
2387 */
2388struct v4l2_ctrl_hevc_decode_params {
2389 __s32 pic_order_cnt_val;
2390 __u16 short_term_ref_pic_set_size;
2391 __u16 long_term_ref_pic_set_size;
2392 __u8 num_active_dpb_entries;
2393 __u8 num_poc_st_curr_before;
2394 __u8 num_poc_st_curr_after;
2395 __u8 num_poc_lt_curr;
2396 __u8 poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2397 __u8 poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2398 __u8 poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2399 __u8 reserved[4];
2400 struct v4l2_hevc_dpb_entry dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
2401 __u64 flags;
2402};
2403
2404/**
2405 * struct v4l2_ctrl_hevc_scaling_matrix - HEVC scaling lists parameters
2406 *
2407 * @scaling_list_4x4: scaling list is used for the scaling process for
2408 * transform coefficients. The values on each scaling
2409 * list are expected in raster scan order
2410 * @scaling_list_8x8: scaling list is used for the scaling process for
2411 * transform coefficients. The values on each scaling
2412 * list are expected in raster scan order
2413 * @scaling_list_16x16: scaling list is used for the scaling process for
2414 * transform coefficients. The values on each scaling
2415 * list are expected in raster scan order
2416 * @scaling_list_32x32: scaling list is used for the scaling process for
2417 * transform coefficients. The values on each scaling
2418 * list are expected in raster scan order
2419 * @scaling_list_dc_coef_16x16: scaling list is used for the scaling process
2420 * for transform coefficients. The values on each
2421 * scaling list are expected in raster scan order.
2422 * @scaling_list_dc_coef_32x32: scaling list is used for the scaling process
2423 * for transform coefficients. The values on each
2424 * scaling list are expected in raster scan order.
2425 */
2426struct v4l2_ctrl_hevc_scaling_matrix {
2427 __u8 scaling_list_4x4[6][16];
2428 __u8 scaling_list_8x8[6][64];
2429 __u8 scaling_list_16x16[6][64];
2430 __u8 scaling_list_32x32[2][64];
2431 __u8 scaling_list_dc_coef_16x16[6];
2432 __u8 scaling_list_dc_coef_32x32[2];
2433};
2434
19832435#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
19842436#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
19852437
......@@ -2014,6 +2466,290 @@ struct v4l2_ctrl_hdr10_mastering_display {
20142466 __u32 min_display_mastering_luminance;
20152467};
20162468
2469/* Stateless VP9 controls */
2470
2471#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED 0x1
2472#define V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE 0x2
2473
2474/**
2475 * struct v4l2_vp9_loop_filter - VP9 loop filter parameters
2476 *
2477 * @ref_deltas: contains the adjustment needed for the filter level based on the
2478 * chosen reference frame. If this syntax element is not present in the bitstream,
2479 * users should pass its last value.
2480 * @mode_deltas: contains the adjustment needed for the filter level based on the
2481 * chosen mode. If this syntax element is not present in the bitstream, users should
2482 * pass its last value.
2483 * @level: indicates the loop filter strength.
2484 * @sharpness: indicates the sharpness level.
2485 * @flags: combination of V4L2_VP9_LOOP_FILTER_FLAG_{} flags.
2486 * @reserved: padding field. Should be zeroed by applications.
2487 *
2488 * This structure contains all loop filter related parameters. See sections
2489 * '7.2.8 Loop filter semantics' of the VP9 specification for more details.
2490 */
2491struct v4l2_vp9_loop_filter {
2492 __s8 ref_deltas[4];
2493 __s8 mode_deltas[2];
2494 __u8 level;
2495 __u8 sharpness;
2496 __u8 flags;
2497 __u8 reserved[7];
2498};
2499
2500/**
2501 * struct v4l2_vp9_quantization - VP9 quantization parameters
2502 *
2503 * @base_q_idx: indicates the base frame qindex.
2504 * @delta_q_y_dc: indicates the Y DC quantizer relative to base_q_idx.
2505 * @delta_q_uv_dc: indicates the UV DC quantizer relative to base_q_idx.
2506 * @delta_q_uv_ac: indicates the UV AC quantizer relative to base_q_idx.
2507 * @reserved: padding field. Should be zeroed by applications.
2508 *
2509 * Encodes the quantization parameters. See section '7.2.9 Quantization params
2510 * syntax' of the VP9 specification for more details.
2511 */
2512struct v4l2_vp9_quantization {
2513 __u8 base_q_idx;
2514 __s8 delta_q_y_dc;
2515 __s8 delta_q_uv_dc;
2516 __s8 delta_q_uv_ac;
2517 __u8 reserved[4];
2518};
2519
2520#define V4L2_VP9_SEGMENTATION_FLAG_ENABLED 0x01
2521#define V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP 0x02
2522#define V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE 0x04
2523#define V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA 0x08
2524#define V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE 0x10
2525
2526#define V4L2_VP9_SEG_LVL_ALT_Q 0
2527#define V4L2_VP9_SEG_LVL_ALT_L 1
2528#define V4L2_VP9_SEG_LVL_REF_FRAME 2
2529#define V4L2_VP9_SEG_LVL_SKIP 3
2530#define V4L2_VP9_SEG_LVL_MAX 4
2531
2532#define V4L2_VP9_SEGMENT_FEATURE_ENABLED(id) (1 << (id))
2533#define V4L2_VP9_SEGMENT_FEATURE_ENABLED_MASK 0xf
2534
2535/**
2536 * struct v4l2_vp9_segmentation - VP9 segmentation parameters
2537 *
2538 * @feature_data: data attached to each feature. Data entry is only valid if
2539 * the feature is enabled. The array shall be indexed with segment number as
2540 * the first dimension (0..7) and one of V4L2_VP9_SEG_{} as the second dimension.
2541 * @feature_enabled: bitmask defining which features are enabled in each segment.
2542 * The value for each segment is a combination of V4L2_VP9_SEGMENT_FEATURE_ENABLED(id)
2543 * values where id is one of V4L2_VP9_SEG_LVL_{}.
2544 * @tree_probs: specifies the probability values to be used when decoding a
2545 * Segment-ID. See '5.15. Segmentation map' section of the VP9 specification
2546 * for more details.
2547 * @pred_probs: specifies the probability values to be used when decoding a
2548 * Predicted-Segment-ID. See '6.4.14. Get segment id syntax' section of :ref:`vp9`
2549 * for more details.
2550 * @flags: combination of V4L2_VP9_SEGMENTATION_FLAG_{} flags.
2551 * @reserved: padding field. Should be zeroed by applications.
2552 *
2553 * Encodes the quantization parameters. See section '7.2.10 Segmentation params syntax' of
2554 * the VP9 specification for more details.
2555 */
2556struct v4l2_vp9_segmentation {
2557 __s16 feature_data[8][4];
2558 __u8 feature_enabled[8];
2559 __u8 tree_probs[7];
2560 __u8 pred_probs[3];
2561 __u8 flags;
2562 __u8 reserved[5];
2563};
2564
2565#define V4L2_VP9_FRAME_FLAG_KEY_FRAME 0x001
2566#define V4L2_VP9_FRAME_FLAG_SHOW_FRAME 0x002
2567#define V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT 0x004
2568#define V4L2_VP9_FRAME_FLAG_INTRA_ONLY 0x008
2569#define V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV 0x010
2570#define V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX 0x020
2571#define V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE 0x040
2572#define V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING 0x080
2573#define V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING 0x100
2574#define V4L2_VP9_FRAME_FLAG_COLOR_RANGE_FULL_SWING 0x200
2575
2576#define V4L2_VP9_SIGN_BIAS_LAST 0x1
2577#define V4L2_VP9_SIGN_BIAS_GOLDEN 0x2
2578#define V4L2_VP9_SIGN_BIAS_ALT 0x4
2579
2580#define V4L2_VP9_RESET_FRAME_CTX_NONE 0
2581#define V4L2_VP9_RESET_FRAME_CTX_SPEC 1
2582#define V4L2_VP9_RESET_FRAME_CTX_ALL 2
2583
2584#define V4L2_VP9_INTERP_FILTER_EIGHTTAP 0
2585#define V4L2_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH 1
2586#define V4L2_VP9_INTERP_FILTER_EIGHTTAP_SHARP 2
2587#define V4L2_VP9_INTERP_FILTER_BILINEAR 3
2588#define V4L2_VP9_INTERP_FILTER_SWITCHABLE 4
2589
2590#define V4L2_VP9_REFERENCE_MODE_SINGLE_REFERENCE 0
2591#define V4L2_VP9_REFERENCE_MODE_COMPOUND_REFERENCE 1
2592#define V4L2_VP9_REFERENCE_MODE_SELECT 2
2593
2594#define V4L2_VP9_PROFILE_MAX 3
2595
2596#define V4L2_CID_STATELESS_VP9_FRAME (V4L2_CID_CODEC_STATELESS_BASE + 300)
2597/**
2598 * struct v4l2_ctrl_vp9_frame - VP9 frame decoding control
2599 *
2600 * @lf: loop filter parameters. See &v4l2_vp9_loop_filter for more details.
2601 * @quant: quantization parameters. See &v4l2_vp9_quantization for more details.
2602 * @seg: segmentation parameters. See &v4l2_vp9_segmentation for more details.
2603 * @flags: combination of V4L2_VP9_FRAME_FLAG_{} flags.
2604 * @compressed_header_size: compressed header size in bytes.
2605 * @uncompressed_header_size: uncompressed header size in bytes.
2606 * @frame_width_minus_1: add 1 to it and you'll get the frame width expressed in pixels.
2607 * @frame_height_minus_1: add 1 to it and you'll get the frame height expressed in pixels.
2608 * @render_width_minus_1: add 1 to it and you'll get the expected render width expressed in
2609 * pixels. This is not used during the decoding process but might be used by HW scalers
2610 * to prepare a frame that's ready for scanout.
2611 * @render_height_minus_1: add 1 to it and you'll get the expected render height expressed in
2612 * pixels. This is not used during the decoding process but might be used by HW scalers
2613 * to prepare a frame that's ready for scanout.
2614 * @last_frame_ts: "last" reference buffer timestamp.
2615 * The timestamp refers to the timestamp field in struct v4l2_buffer.
2616 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
2617 * @golden_frame_ts: "golden" reference buffer timestamp.
2618 * The timestamp refers to the timestamp field in struct v4l2_buffer.
2619 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
2620 * @alt_frame_ts: "alt" reference buffer timestamp.
2621 * The timestamp refers to the timestamp field in struct v4l2_buffer.
2622 * Use v4l2_timeval_to_ns() to convert the struct timeval to a __u64.
2623 * @ref_frame_sign_bias: a bitfield specifying whether the sign bias is set for a given
2624 * reference frame. Either of V4L2_VP9_SIGN_BIAS_{}.
2625 * @reset_frame_context: specifies whether the frame context should be reset to default values.
2626 * Either of V4L2_VP9_RESET_FRAME_CTX_{}.
2627 * @frame_context_idx: frame context that should be used/updated.
2628 * @profile: VP9 profile. Can be 0, 1, 2 or 3.
2629 * @bit_depth: bits per components. Can be 8, 10 or 12. Note that not all profiles support
2630 * 10 and/or 12 bits depths.
2631 * @interpolation_filter: specifies the filter selection used for performing inter prediction.
2632 * Set to one of V4L2_VP9_INTERP_FILTER_{}.
2633 * @tile_cols_log2: specifies the base 2 logarithm of the width of each tile (where the width
2634 * is measured in units of 8x8 blocks). Shall be less than or equal to 6.
2635 * @tile_rows_log2: specifies the base 2 logarithm of the height of each tile (where the height
2636 * is measured in units of 8x8 blocks).
2637 * @reference_mode: specifies the type of inter prediction to be used.
2638 * Set to one of V4L2_VP9_REFERENCE_MODE_{}.
2639 * @reserved: padding field. Should be zeroed by applications.
2640 */
2641struct v4l2_ctrl_vp9_frame {
2642 struct v4l2_vp9_loop_filter lf;
2643 struct v4l2_vp9_quantization quant;
2644 struct v4l2_vp9_segmentation seg;
2645 __u32 flags;
2646 __u16 compressed_header_size;
2647 __u16 uncompressed_header_size;
2648 __u16 frame_width_minus_1;
2649 __u16 frame_height_minus_1;
2650 __u16 render_width_minus_1;
2651 __u16 render_height_minus_1;
2652 __u64 last_frame_ts;
2653 __u64 golden_frame_ts;
2654 __u64 alt_frame_ts;
2655 __u8 ref_frame_sign_bias;
2656 __u8 reset_frame_context;
2657 __u8 frame_context_idx;
2658 __u8 profile;
2659 __u8 bit_depth;
2660 __u8 interpolation_filter;
2661 __u8 tile_cols_log2;
2662 __u8 tile_rows_log2;
2663 __u8 reference_mode;
2664 __u8 reserved[7];
2665};
2666
2667#define V4L2_VP9_NUM_FRAME_CTX 4
2668
2669/**
2670 * struct v4l2_vp9_mv_probs - VP9 Motion vector probability updates
2671 * @joint: motion vector joint probability updates.
2672 * @sign: motion vector sign probability updates.
2673 * @classes: motion vector class probability updates.
2674 * @class0_bit: motion vector class0 bit probability updates.
2675 * @bits: motion vector bits probability updates.
2676 * @class0_fr: motion vector class0 fractional bit probability updates.
2677 * @fr: motion vector fractional bit probability updates.
2678 * @class0_hp: motion vector class0 high precision fractional bit probability updates.
2679 * @hp: motion vector high precision fractional bit probability updates.
2680 *
2681 * This structure contains new values of motion vector probabilities.
2682 * A value of zero in an array element means there is no update of the relevant probability.
2683 * See `struct v4l2_vp9_prob_updates` for details.
2684 */
2685struct v4l2_vp9_mv_probs {
2686 __u8 joint[3];
2687 __u8 sign[2];
2688 __u8 classes[2][10];
2689 __u8 class0_bit[2];
2690 __u8 bits[2][10];
2691 __u8 class0_fr[2][2][3];
2692 __u8 fr[2][3];
2693 __u8 class0_hp[2];
2694 __u8 hp[2];
2695};
2696
2697#define V4L2_CID_STATELESS_VP9_COMPRESSED_HDR (V4L2_CID_CODEC_STATELESS_BASE + 301)
2698
2699#define V4L2_VP9_TX_MODE_ONLY_4X4 0
2700#define V4L2_VP9_TX_MODE_ALLOW_8X8 1
2701#define V4L2_VP9_TX_MODE_ALLOW_16X16 2
2702#define V4L2_VP9_TX_MODE_ALLOW_32X32 3
2703#define V4L2_VP9_TX_MODE_SELECT 4
2704
2705/**
2706 * struct v4l2_ctrl_vp9_compressed_hdr - VP9 probability updates control
2707 * @tx_mode: specifies the TX mode. Set to one of V4L2_VP9_TX_MODE_{}.
2708 * @tx8: TX 8x8 probability updates.
2709 * @tx16: TX 16x16 probability updates.
2710 * @tx32: TX 32x32 probability updates.
2711 * @coef: coefficient probability updates.
2712 * @skip: skip probability updates.
2713 * @inter_mode: inter mode probability updates.
2714 * @interp_filter: interpolation filter probability updates.
2715 * @is_inter: is inter-block probability updates.
2716 * @comp_mode: compound prediction mode probability updates.
2717 * @single_ref: single ref probability updates.
2718 * @comp_ref: compound ref probability updates.
2719 * @y_mode: Y prediction mode probability updates.
2720 * @uv_mode: UV prediction mode probability updates.
2721 * @partition: partition probability updates.
2722 * @mv: motion vector probability updates.
2723 *
2724 * This structure holds the probabilities update as parsed in the compressed
2725 * header (Spec 6.3). These values represent the value of probability update after
2726 * being translated with inv_map_table[] (see 6.3.5). A value of zero in an array element
2727 * means that there is no update of the relevant probability.
2728 *
2729 * This control is optional and needs to be used when dealing with the hardware which is
2730 * not capable of parsing the compressed header itself. Only drivers which need it will
2731 * implement it.
2732 */
2733struct v4l2_ctrl_vp9_compressed_hdr {
2734 __u8 tx_mode;
2735 __u8 tx8[2][1];
2736 __u8 tx16[2][2];
2737 __u8 tx32[2][3];
2738 __u8 coef[4][2][2][6][6][3];
2739 __u8 skip[3];
2740 __u8 inter_mode[7][3];
2741 __u8 interp_filter[4][2];
2742 __u8 is_inter[4];
2743 __u8 comp_mode[5];
2744 __u8 single_ref[5][2];
2745 __u8 comp_ref[5];
2746 __u8 y_mode[4][9];
2747 __u8 uv_mode[10][9];
2748 __u8 partition[16][3];
2749
2750 struct v4l2_vp9_mv_probs mv;
2751};
2752
20172753/* MPEG-compression definitions kept for backwards compatibility */
20182754#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
20192755#define V4L2_CID_MPEG_CLASS V4L2_CID_CODEC_CLASS
lib/libc/include/any-linux-any/linux/v4l2-dv-timings.h-9
......@@ -3,15 +3,6 @@
33 * V4L2 DV timings header.
44 *
55 * Copyright (C) 2012-2016 Hans Verkuil <hans.verkuil@cisco.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
156 */
167
178#ifndef _V4L2_DV_TIMINGS_H
lib/libc/include/any-linux-any/linux/v4l2-mediabus.h-4
......@@ -3,10 +3,6 @@
33 * Media Bus API header
44 *
55 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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 version 2 as
9 * published by the Free Software Foundation.
106 */
117
128#ifndef __LINUX_V4L2_MEDIABUS_H
lib/libc/include/any-linux-any/linux/v4l2-subdev.h+67-20
......@@ -6,24 +6,12 @@
66 *
77 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
88 * Sakari Ailus <sakari.ailus@iki.fi>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
229 */
2310
2411#ifndef __LINUX_V4L2_SUBDEV_H
2512#define __LINUX_V4L2_SUBDEV_H
2613
14#include <linux/const.h>
2715#include <linux/ioctl.h>
2816#include <linux/types.h>
2917#include <linux/v4l2-common.h>
......@@ -44,13 +32,15 @@ enum v4l2_subdev_format_whence {
4432 * @which: format type (from enum v4l2_subdev_format_whence)
4533 * @pad: pad number, as reported by the media API
4634 * @format: media bus format (format code and frame size)
35 * @stream: stream number, defined in subdev routing
4736 * @reserved: drivers and applications must zero this array
4837 */
4938struct v4l2_subdev_format {
5039 __u32 which;
5140 __u32 pad;
5241 struct v4l2_mbus_framefmt format;
53 __u32 reserved[8];
42 __u32 stream;
43 __u32 reserved[7];
5444};
5545
5646/**
......@@ -58,13 +48,15 @@ struct v4l2_subdev_format {
5848 * @which: format type (from enum v4l2_subdev_format_whence)
5949 * @pad: pad number, as reported by the media API
6050 * @rect: pad crop rectangle boundaries
51 * @stream: stream number, defined in subdev routing
6152 * @reserved: drivers and applications must zero this array
6253 */
6354struct v4l2_subdev_crop {
6455 __u32 which;
6556 __u32 pad;
6657 struct v4l2_rect rect;
67 __u32 reserved[8];
58 __u32 stream;
59 __u32 reserved[7];
6860};
6961
7062#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
......@@ -80,6 +72,7 @@ struct v4l2_subdev_crop {
8072 * @code: format code (MEDIA_BUS_FMT_ definitions)
8173 * @which: format type (from enum v4l2_subdev_format_whence)
8274 * @flags: flags set by the driver, (V4L2_SUBDEV_MBUS_CODE_*)
75 * @stream: stream number, defined in subdev routing
8376 * @reserved: drivers and applications must zero this array
8477 */
8578struct v4l2_subdev_mbus_code_enum {
......@@ -88,7 +81,8 @@ struct v4l2_subdev_mbus_code_enum {
8881 __u32 code;
8982 __u32 which;
9083 __u32 flags;
91 __u32 reserved[7];
84 __u32 stream;
85 __u32 reserved[6];
9286};
9387
9488/**
......@@ -101,6 +95,7 @@ struct v4l2_subdev_mbus_code_enum {
10195 * @min_height: minimum frame height, in pixels
10296 * @max_height: maximum frame height, in pixels
10397 * @which: format type (from enum v4l2_subdev_format_whence)
98 * @stream: stream number, defined in subdev routing
10499 * @reserved: drivers and applications must zero this array
105100 */
106101struct v4l2_subdev_frame_size_enum {
......@@ -112,19 +107,22 @@ struct v4l2_subdev_frame_size_enum {
112107 __u32 min_height;
113108 __u32 max_height;
114109 __u32 which;
115 __u32 reserved[8];
110 __u32 stream;
111 __u32 reserved[7];
116112};
117113
118114/**
119115 * struct v4l2_subdev_frame_interval - Pad-level frame rate
120116 * @pad: pad number, as reported by the media API
121117 * @interval: frame interval in seconds
118 * @stream: stream number, defined in subdev routing
122119 * @reserved: drivers and applications must zero this array
123120 */
124121struct v4l2_subdev_frame_interval {
125122 __u32 pad;
126123 struct v4l2_fract interval;
127 __u32 reserved[9];
124 __u32 stream;
125 __u32 reserved[8];
128126};
129127
130128/**
......@@ -136,6 +134,7 @@ struct v4l2_subdev_frame_interval {
136134 * @height: frame height in pixels
137135 * @interval: frame interval in seconds
138136 * @which: format type (from enum v4l2_subdev_format_whence)
137 * @stream: stream number, defined in subdev routing
139138 * @reserved: drivers and applications must zero this array
140139 */
141140struct v4l2_subdev_frame_interval_enum {
......@@ -146,7 +145,8 @@ struct v4l2_subdev_frame_interval_enum {
146145 __u32 height;
147146 struct v4l2_fract interval;
148147 __u32 which;
149 __u32 reserved[8];
148 __u32 stream;
149 __u32 reserved[7];
150150};
151151
152152/**
......@@ -158,6 +158,7 @@ struct v4l2_subdev_frame_interval_enum {
158158 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
159159 * @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
160160 * @r: coordinates of the selection window
161 * @stream: stream number, defined in subdev routing
161162 * @reserved: for future use, set to zero for now
162163 *
163164 * Hardware may use multiple helper windows to process a video stream.
......@@ -170,7 +171,8 @@ struct v4l2_subdev_selection {
170171 __u32 target;
171172 __u32 flags;
172173 struct v4l2_rect r;
173 __u32 reserved[8];
174 __u32 stream;
175 __u32 reserved[7];
174176};
175177
176178/**
......@@ -188,6 +190,49 @@ struct v4l2_subdev_capability {
188190/* The v4l2 sub-device video device node is registered in read-only mode. */
189191#define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001
190192
193/* The v4l2 sub-device supports routing and multiplexed streams. */
194#define V4L2_SUBDEV_CAP_STREAMS 0x00000002
195
196/*
197 * Is the route active? An active route will start when streaming is enabled
198 * on a video node.
199 */
200#define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1U << 0)
201
202/**
203 * struct v4l2_subdev_route - A route inside a subdev
204 *
205 * @sink_pad: the sink pad index
206 * @sink_stream: the sink stream identifier
207 * @source_pad: the source pad index
208 * @source_stream: the source stream identifier
209 * @flags: route flags V4L2_SUBDEV_ROUTE_FL_*
210 * @reserved: drivers and applications must zero this array
211 */
212struct v4l2_subdev_route {
213 __u32 sink_pad;
214 __u32 sink_stream;
215 __u32 source_pad;
216 __u32 source_stream;
217 __u32 flags;
218 __u32 reserved[5];
219};
220
221/**
222 * struct v4l2_subdev_routing - Subdev routing information
223 *
224 * @which: configuration type (from enum v4l2_subdev_format_whence)
225 * @num_routes: the total number of routes in the routes array
226 * @routes: pointer to the routes array
227 * @reserved: drivers and applications must zero this array
228 */
229struct v4l2_subdev_routing {
230 __u32 which;
231 __u32 num_routes;
232 __u64 routes;
233 __u32 reserved[6];
234};
235
191236/* Backwards compatibility define --- to be removed */
192237#define v4l2_subdev_edid v4l2_edid
193238
......@@ -203,6 +248,8 @@ struct v4l2_subdev_capability {
203248#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
204249#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
205250#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
251#define VIDIOC_SUBDEV_G_ROUTING _IOWR('V', 38, struct v4l2_subdev_routing)
252#define VIDIOC_SUBDEV_S_ROUTING _IOWR('V', 39, struct v4l2_subdev_routing)
206253/* The following ioctls are identical to the ioctls in videodev2.h */
207254#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
208255#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
lib/libc/include/any-linux-any/linux/vdpa.h+16
......@@ -18,11 +18,15 @@ enum vdpa_command {
1818 VDPA_CMD_DEV_DEL,
1919 VDPA_CMD_DEV_GET, /* can dump */
2020 VDPA_CMD_DEV_CONFIG_GET, /* can dump */
21 VDPA_CMD_DEV_VSTATS_GET,
2122};
2223
2324enum vdpa_attr {
2425 VDPA_ATTR_UNSPEC,
2526
27 /* Pad attribute for 64b alignment */
28 VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
29
2630 /* bus name (optional) + dev name together make the parent device handle */
2731 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
2832 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
......@@ -40,6 +44,18 @@ enum vdpa_attr {
4044 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
4145 VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */
4246
47 VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */
48 VDPA_ATTR_DEV_MGMTDEV_MAX_VQS, /* u32 */
49 /* virtio features that are supported by the vDPA management device */
50 VDPA_ATTR_DEV_SUPPORTED_FEATURES, /* u64 */
51
52 VDPA_ATTR_DEV_QUEUE_INDEX, /* u32 */
53 VDPA_ATTR_DEV_VENDOR_ATTR_NAME, /* string */
54 VDPA_ATTR_DEV_VENDOR_ATTR_VALUE, /* u64 */
55
56 /* virtio features that are provisioned to the vDPA device */
57 VDPA_ATTR_DEV_FEATURES, /* u64 */
58
4359 /* new attributes must be added above here */
4460 VDPA_ATTR_MAX,
4561};
lib/libc/include/any-linux-any/linux/vduse.h+47
......@@ -210,6 +210,53 @@ struct vduse_vq_eventfd {
210210 */
211211#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)
212212
213/**
214 * struct vduse_iova_umem - userspace memory configuration for one IOVA region
215 * @uaddr: start address of userspace memory, it must be aligned to page size
216 * @iova: start of the IOVA region
217 * @size: size of the IOVA region
218 * @reserved: for future use, needs to be initialized to zero
219 *
220 * Structure used by VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM
221 * ioctls to register/de-register userspace memory for IOVA regions
222 */
223struct vduse_iova_umem {
224 __u64 uaddr;
225 __u64 iova;
226 __u64 size;
227 __u64 reserved[3];
228};
229
230/* Register userspace memory for IOVA regions */
231#define VDUSE_IOTLB_REG_UMEM _IOW(VDUSE_BASE, 0x18, struct vduse_iova_umem)
232
233/* De-register the userspace memory. Caller should set iova and size field. */
234#define VDUSE_IOTLB_DEREG_UMEM _IOW(VDUSE_BASE, 0x19, struct vduse_iova_umem)
235
236/**
237 * struct vduse_iova_info - information of one IOVA region
238 * @start: start of the IOVA region
239 * @last: last of the IOVA region
240 * @capability: capability of the IOVA regsion
241 * @reserved: for future use, needs to be initialized to zero
242 *
243 * Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
244 * one IOVA region.
245 */
246struct vduse_iova_info {
247 __u64 start;
248 __u64 last;
249#define VDUSE_IOVA_CAP_UMEM (1 << 0)
250 __u64 capability;
251 __u64 reserved[3];
252};
253
254/*
255 * Find the first IOVA region that overlaps with the range [start, last]
256 * and return some information on it. Caller should set start and last fields.
257 */
258#define VDUSE_IOTLB_GET_INFO _IOWR(VDUSE_BASE, 0x1a, struct vduse_iova_info)
259
213260/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
214261
215262/**
lib/libc/include/any-linux-any/linux/version.h+4-4
......@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 331778
1#define LINUX_VERSION_CODE 393992
22#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
3#define LINUX_VERSION_MAJOR 5
4#define LINUX_VERSION_PATCHLEVEL 16
5#define LINUX_VERSION_SUBLEVEL 2
\ No newline at end of file
3#define LINUX_VERSION_MAJOR 6
4#define LINUX_VERSION_PATCHLEVEL 3
5#define LINUX_VERSION_SUBLEVEL 8
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+476-219
......@@ -49,7 +49,11 @@
4949/* Supports VFIO_DMA_UNMAP_FLAG_ALL */
5050#define VFIO_UNMAP_ALL 9
5151
52/* Supports the vaddr flag for DMA map and unmap */
52/*
53 * Supports the vaddr flag for DMA map and unmap. Not supported for mediated
54 * devices, so this capability is subject to change as groups are added or
55 * removed.
56 */
5357#define VFIO_UPDATE_VADDR 10
5458
5559/*
......@@ -323,7 +327,7 @@ struct vfio_region_info_cap_type {
323327#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
324328#define VFIO_REGION_TYPE_GFX (1)
325329#define VFIO_REGION_TYPE_CCW (2)
326#define VFIO_REGION_TYPE_MIGRATION (3)
330#define VFIO_REGION_TYPE_MIGRATION_DEPRECATED (3)
327331
328332/* sub-types for VFIO_REGION_TYPE_PCI_* */
329333
......@@ -405,225 +409,29 @@ struct vfio_region_gfx_edid {
405409#define VFIO_REGION_SUBTYPE_CCW_CRW (3)
406410
407411/* sub-types for VFIO_REGION_TYPE_MIGRATION */
408#define VFIO_REGION_SUBTYPE_MIGRATION (1)
409
410/*
411 * The structure vfio_device_migration_info is placed at the 0th offset of
412 * the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related
413 * migration information. Field accesses from this structure are only supported
414 * at their native width and alignment. Otherwise, the result is undefined and
415 * vendor drivers should return an error.
416 *
417 * device_state: (read/write)
418 * - The user application writes to this field to inform the vendor driver
419 * about the device state to be transitioned to.
420 * - The vendor driver should take the necessary actions to change the
421 * device state. After successful transition to a given state, the
422 * vendor driver should return success on write(device_state, state)
423 * system call. If the device state transition fails, the vendor driver
424 * should return an appropriate -errno for the fault condition.
425 * - On the user application side, if the device state transition fails,
426 * that is, if write(device_state, state) returns an error, read
427 * device_state again to determine the current state of the device from
428 * the vendor driver.
429 * - The vendor driver should return previous state of the device unless
430 * the vendor driver has encountered an internal error, in which case
431 * the vendor driver may report the device_state VFIO_DEVICE_STATE_ERROR.
432 * - The user application must use the device reset ioctl to recover the
433 * device from VFIO_DEVICE_STATE_ERROR state. If the device is
434 * indicated to be in a valid device state by reading device_state, the
435 * user application may attempt to transition the device to any valid
436 * state reachable from the current state or terminate itself.
437 *
438 * device_state consists of 3 bits:
439 * - If bit 0 is set, it indicates the _RUNNING state. If bit 0 is clear,
440 * it indicates the _STOP state. When the device state is changed to
441 * _STOP, driver should stop the device before write() returns.
442 * - If bit 1 is set, it indicates the _SAVING state, which means that the
443 * driver should start gathering device state information that will be
444 * provided to the VFIO user application to save the device's state.
445 * - If bit 2 is set, it indicates the _RESUMING state, which means that
446 * the driver should prepare to resume the device. Data provided through
447 * the migration region should be used to resume the device.
448 * Bits 3 - 31 are reserved for future use. To preserve them, the user
449 * application should perform a read-modify-write operation on this
450 * field when modifying the specified bits.
451 *
452 * +------- _RESUMING
453 * |+------ _SAVING
454 * ||+----- _RUNNING
455 * |||
456 * 000b => Device Stopped, not saving or resuming
457 * 001b => Device running, which is the default state
458 * 010b => Stop the device & save the device state, stop-and-copy state
459 * 011b => Device running and save the device state, pre-copy state
460 * 100b => Device stopped and the device state is resuming
461 * 101b => Invalid state
462 * 110b => Error state
463 * 111b => Invalid state
464 *
465 * State transitions:
466 *
467 * _RESUMING _RUNNING Pre-copy Stop-and-copy _STOP
468 * (100b) (001b) (011b) (010b) (000b)
469 * 0. Running or default state
470 * |
471 *
472 * 1. Normal Shutdown (optional)
473 * |------------------------------------->|
474 *
475 * 2. Save the state or suspend
476 * |------------------------->|---------->|
477 *
478 * 3. Save the state during live migration
479 * |----------->|------------>|---------->|
480 *
481 * 4. Resuming
482 * |<---------|
483 *
484 * 5. Resumed
485 * |--------->|
486 *
487 * 0. Default state of VFIO device is _RUNNING when the user application starts.
488 * 1. During normal shutdown of the user application, the user application may
489 * optionally change the VFIO device state from _RUNNING to _STOP. This
490 * transition is optional. The vendor driver must support this transition but
491 * must not require it.
492 * 2. When the user application saves state or suspends the application, the
493 * device state transitions from _RUNNING to stop-and-copy and then to _STOP.
494 * On state transition from _RUNNING to stop-and-copy, driver must stop the
495 * device, save the device state and send it to the application through the
496 * migration region. The sequence to be followed for such transition is given
497 * below.
498 * 3. In live migration of user application, the state transitions from _RUNNING
499 * to pre-copy, to stop-and-copy, and to _STOP.
500 * On state transition from _RUNNING to pre-copy, the driver should start
501 * gathering the device state while the application is still running and send
502 * the device state data to application through the migration region.
503 * On state transition from pre-copy to stop-and-copy, the driver must stop
504 * the device, save the device state and send it to the user application
505 * through the migration region.
506 * Vendor drivers must support the pre-copy state even for implementations
507 * where no data is provided to the user before the stop-and-copy state. The
508 * user must not be required to consume all migration data before the device
509 * transitions to a new state, including the stop-and-copy state.
510 * The sequence to be followed for above two transitions is given below.
511 * 4. To start the resuming phase, the device state should be transitioned from
512 * the _RUNNING to the _RESUMING state.
513 * In the _RESUMING state, the driver should use the device state data
514 * received through the migration region to resume the device.
515 * 5. After providing saved device data to the driver, the application should
516 * change the state from _RESUMING to _RUNNING.
517 *
518 * reserved:
519 * Reads on this field return zero and writes are ignored.
520 *
521 * pending_bytes: (read only)
522 * The number of pending bytes still to be migrated from the vendor driver.
523 *
524 * data_offset: (read only)
525 * The user application should read data_offset field from the migration
526 * region. The user application should read the device data from this
527 * offset within the migration region during the _SAVING state or write
528 * the device data during the _RESUMING state. See below for details of
529 * sequence to be followed.
530 *
531 * data_size: (read/write)
532 * The user application should read data_size to get the size in bytes of
533 * the data copied in the migration region during the _SAVING state and
534 * write the size in bytes of the data copied in the migration region
535 * during the _RESUMING state.
536 *
537 * The format of the migration region is as follows:
538 * ------------------------------------------------------------------
539 * |vfio_device_migration_info| data section |
540 * | | /////////////////////////////// |
541 * ------------------------------------------------------------------
542 * ^ ^
543 * offset 0-trapped part data_offset
544 *
545 * The structure vfio_device_migration_info is always followed by the data
546 * section in the region, so data_offset will always be nonzero. The offset
547 * from where the data is copied is decided by the kernel driver. The data
548 * section can be trapped, mmapped, or partitioned, depending on how the kernel
549 * driver defines the data section. The data section partition can be defined
550 * as mapped by the sparse mmap capability. If mmapped, data_offset must be
551 * page aligned, whereas initial section which contains the
552 * vfio_device_migration_info structure, might not end at the offset, which is
553 * page aligned. The user is not required to access through mmap regardless
554 * of the capabilities of the region mmap.
555 * The vendor driver should determine whether and how to partition the data
556 * section. The vendor driver should return data_offset accordingly.
557 *
558 * The sequence to be followed while in pre-copy state and stop-and-copy state
559 * is as follows:
560 * a. Read pending_bytes, indicating the start of a new iteration to get device
561 * data. Repeated read on pending_bytes at this stage should have no side
562 * effects.
563 * If pending_bytes == 0, the user application should not iterate to get data
564 * for that device.
565 * If pending_bytes > 0, perform the following steps.
566 * b. Read data_offset, indicating that the vendor driver should make data
567 * available through the data section. The vendor driver should return this
568 * read operation only after data is available from (region + data_offset)
569 * to (region + data_offset + data_size).
570 * c. Read data_size, which is the amount of data in bytes available through
571 * the migration region.
572 * Read on data_offset and data_size should return the offset and size of
573 * the current buffer if the user application reads data_offset and
574 * data_size more than once here.
575 * d. Read data_size bytes of data from (region + data_offset) from the
576 * migration region.
577 * e. Process the data.
578 * f. Read pending_bytes, which indicates that the data from the previous
579 * iteration has been read. If pending_bytes > 0, go to step b.
580 *
581 * The user application can transition from the _SAVING|_RUNNING
582 * (pre-copy state) to the _SAVING (stop-and-copy) state regardless of the
583 * number of pending bytes. The user application should iterate in _SAVING
584 * (stop-and-copy) until pending_bytes is 0.
585 *
586 * The sequence to be followed while _RESUMING device state is as follows:
587 * While data for this device is available, repeat the following steps:
588 * a. Read data_offset from where the user application should write data.
589 * b. Write migration data starting at the migration region + data_offset for
590 * the length determined by data_size from the migration source.
591 * c. Write data_size, which indicates to the vendor driver that data is
592 * written in the migration region. Vendor driver must return this write
593 * operations on consuming data. Vendor driver should apply the
594 * user-provided migration region data to the device resume state.
595 *
596 * If an error occurs during the above sequences, the vendor driver can return
597 * an error code for next read() or write() operation, which will terminate the
598 * loop. The user application should then take the next necessary action, for
599 * example, failing migration or terminating the user application.
600 *
601 * For the user application, data is opaque. The user application should write
602 * data in the same order as the data is received and the data should be of
603 * same transaction size at the source.
604 */
412#define VFIO_REGION_SUBTYPE_MIGRATION_DEPRECATED (1)
605413
606414struct vfio_device_migration_info {
607415 __u32 device_state; /* VFIO device state */
608#define VFIO_DEVICE_STATE_STOP (0)
609#define VFIO_DEVICE_STATE_RUNNING (1 << 0)
610#define VFIO_DEVICE_STATE_SAVING (1 << 1)
611#define VFIO_DEVICE_STATE_RESUMING (1 << 2)
612#define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_RUNNING | \
613 VFIO_DEVICE_STATE_SAVING | \
614 VFIO_DEVICE_STATE_RESUMING)
416#define VFIO_DEVICE_STATE_V1_STOP (0)
417#define VFIO_DEVICE_STATE_V1_RUNNING (1 << 0)
418#define VFIO_DEVICE_STATE_V1_SAVING (1 << 1)
419#define VFIO_DEVICE_STATE_V1_RESUMING (1 << 2)
420#define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_V1_RUNNING | \
421 VFIO_DEVICE_STATE_V1_SAVING | \
422 VFIO_DEVICE_STATE_V1_RESUMING)
615423
616424#define VFIO_DEVICE_STATE_VALID(state) \
617 (state & VFIO_DEVICE_STATE_RESUMING ? \
618 (state & VFIO_DEVICE_STATE_MASK) == VFIO_DEVICE_STATE_RESUMING : 1)
425 (state & VFIO_DEVICE_STATE_V1_RESUMING ? \
426 (state & VFIO_DEVICE_STATE_MASK) == VFIO_DEVICE_STATE_V1_RESUMING : 1)
619427
620428#define VFIO_DEVICE_STATE_IS_ERROR(state) \
621 ((state & VFIO_DEVICE_STATE_MASK) == (VFIO_DEVICE_STATE_SAVING | \
622 VFIO_DEVICE_STATE_RESUMING))
429 ((state & VFIO_DEVICE_STATE_MASK) == (VFIO_DEVICE_STATE_V1_SAVING | \
430 VFIO_DEVICE_STATE_V1_RESUMING))
623431
624432#define VFIO_DEVICE_STATE_SET_ERROR(state) \
625 ((state & ~VFIO_DEVICE_STATE_MASK) | VFIO_DEVICE_SATE_SAVING | \
626 VFIO_DEVICE_STATE_RESUMING)
433 ((state & ~VFIO_DEVICE_STATE_MASK) | VFIO_DEVICE_STATE_V1_SAVING | \
434 VFIO_DEVICE_STATE_V1_RESUMING)
627435
628436 __u32 reserved;
629437 __u64 pending_bytes;
......@@ -839,7 +647,7 @@ enum {
839647};
840648
841649/**
842 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
650 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 12,
843651 * struct vfio_pci_hot_reset_info)
844652 *
845653 * Return: 0 on success, -errno on failure:
......@@ -966,7 +774,7 @@ struct vfio_device_ioeventfd {
966774#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
967775
968776/**
969 * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,
777 * VFIO_DEVICE_FEATURE - _IOWR(VFIO_TYPE, VFIO_BASE + 17,
970778 * struct vfio_device_feature)
971779 *
972780 * Get, set, or probe feature data of the device. The feature is selected
......@@ -1002,6 +810,456 @@ struct vfio_device_feature {
1002810 */
1003811#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN (0)
1004812
813/*
814 * Indicates the device can support the migration API through
815 * VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE. If this GET succeeds, the RUNNING and
816 * ERROR states are always supported. Support for additional states is
817 * indicated via the flags field; at least VFIO_MIGRATION_STOP_COPY must be
818 * set.
819 *
820 * VFIO_MIGRATION_STOP_COPY means that STOP, STOP_COPY and
821 * RESUMING are supported.
822 *
823 * VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_P2P means that RUNNING_P2P
824 * is supported in addition to the STOP_COPY states.
825 *
826 * VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_PRE_COPY means that
827 * PRE_COPY is supported in addition to the STOP_COPY states.
828 *
829 * VFIO_MIGRATION_STOP_COPY | VFIO_MIGRATION_P2P | VFIO_MIGRATION_PRE_COPY
830 * means that RUNNING_P2P, PRE_COPY and PRE_COPY_P2P are supported
831 * in addition to the STOP_COPY states.
832 *
833 * Other combinations of flags have behavior to be defined in the future.
834 */
835struct vfio_device_feature_migration {
836 __aligned_u64 flags;
837#define VFIO_MIGRATION_STOP_COPY (1 << 0)
838#define VFIO_MIGRATION_P2P (1 << 1)
839#define VFIO_MIGRATION_PRE_COPY (1 << 2)
840};
841#define VFIO_DEVICE_FEATURE_MIGRATION 1
842
843/*
844 * Upon VFIO_DEVICE_FEATURE_SET, execute a migration state change on the VFIO
845 * device. The new state is supplied in device_state, see enum
846 * vfio_device_mig_state for details
847 *
848 * The kernel migration driver must fully transition the device to the new state
849 * value before the operation returns to the user.
850 *
851 * The kernel migration driver must not generate asynchronous device state
852 * transitions outside of manipulation by the user or the VFIO_DEVICE_RESET
853 * ioctl as described above.
854 *
855 * If this function fails then current device_state may be the original
856 * operating state or some other state along the combination transition path.
857 * The user can then decide if it should execute a VFIO_DEVICE_RESET, attempt
858 * to return to the original state, or attempt to return to some other state
859 * such as RUNNING or STOP.
860 *
861 * If the new_state starts a new data transfer session then the FD associated
862 * with that session is returned in data_fd. The user is responsible to close
863 * this FD when it is finished. The user must consider the migration data stream
864 * carried over the FD to be opaque and must preserve the byte order of the
865 * stream. The user is not required to preserve buffer segmentation when writing
866 * the data stream during the RESUMING operation.
867 *
868 * Upon VFIO_DEVICE_FEATURE_GET, get the current migration state of the VFIO
869 * device, data_fd will be -1.
870 */
871struct vfio_device_feature_mig_state {
872 __u32 device_state; /* From enum vfio_device_mig_state */
873 __s32 data_fd;
874};
875#define VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE 2
876
877/*
878 * The device migration Finite State Machine is described by the enum
879 * vfio_device_mig_state. Some of the FSM arcs will create a migration data
880 * transfer session by returning a FD, in this case the migration data will
881 * flow over the FD using read() and write() as discussed below.
882 *
883 * There are 5 states to support VFIO_MIGRATION_STOP_COPY:
884 * RUNNING - The device is running normally
885 * STOP - The device does not change the internal or external state
886 * STOP_COPY - The device internal state can be read out
887 * RESUMING - The device is stopped and is loading a new internal state
888 * ERROR - The device has failed and must be reset
889 *
890 * And optional states to support VFIO_MIGRATION_P2P:
891 * RUNNING_P2P - RUNNING, except the device cannot do peer to peer DMA
892 * And VFIO_MIGRATION_PRE_COPY:
893 * PRE_COPY - The device is running normally but tracking internal state
894 * changes
895 * And VFIO_MIGRATION_P2P | VFIO_MIGRATION_PRE_COPY:
896 * PRE_COPY_P2P - PRE_COPY, except the device cannot do peer to peer DMA
897 *
898 * The FSM takes actions on the arcs between FSM states. The driver implements
899 * the following behavior for the FSM arcs:
900 *
901 * RUNNING_P2P -> STOP
902 * STOP_COPY -> STOP
903 * While in STOP the device must stop the operation of the device. The device
904 * must not generate interrupts, DMA, or any other change to external state.
905 * It must not change its internal state. When stopped the device and kernel
906 * migration driver must accept and respond to interaction to support external
907 * subsystems in the STOP state, for example PCI MSI-X and PCI config space.
908 * Failure by the user to restrict device access while in STOP must not result
909 * in error conditions outside the user context (ex. host system faults).
910 *
911 * The STOP_COPY arc will terminate a data transfer session.
912 *
913 * RESUMING -> STOP
914 * Leaving RESUMING terminates a data transfer session and indicates the
915 * device should complete processing of the data delivered by write(). The
916 * kernel migration driver should complete the incorporation of data written
917 * to the data transfer FD into the device internal state and perform
918 * final validity and consistency checking of the new device state. If the
919 * user provided data is found to be incomplete, inconsistent, or otherwise
920 * invalid, the migration driver must fail the SET_STATE ioctl and
921 * optionally go to the ERROR state as described below.
922 *
923 * While in STOP the device has the same behavior as other STOP states
924 * described above.
925 *
926 * To abort a RESUMING session the device must be reset.
927 *
928 * PRE_COPY -> RUNNING
929 * RUNNING_P2P -> RUNNING
930 * While in RUNNING the device is fully operational, the device may generate
931 * interrupts, DMA, respond to MMIO, all vfio device regions are functional,
932 * and the device may advance its internal state.
933 *
934 * The PRE_COPY arc will terminate a data transfer session.
935 *
936 * PRE_COPY_P2P -> RUNNING_P2P
937 * RUNNING -> RUNNING_P2P
938 * STOP -> RUNNING_P2P
939 * While in RUNNING_P2P the device is partially running in the P2P quiescent
940 * state defined below.
941 *
942 * The PRE_COPY_P2P arc will terminate a data transfer session.
943 *
944 * RUNNING -> PRE_COPY
945 * RUNNING_P2P -> PRE_COPY_P2P
946 * STOP -> STOP_COPY
947 * PRE_COPY, PRE_COPY_P2P and STOP_COPY form the "saving group" of states
948 * which share a data transfer session. Moving between these states alters
949 * what is streamed in session, but does not terminate or otherwise affect
950 * the associated fd.
951 *
952 * These arcs begin the process of saving the device state and will return a
953 * new data_fd. The migration driver may perform actions such as enabling
954 * dirty logging of device state when entering PRE_COPY or PER_COPY_P2P.
955 *
956 * Each arc does not change the device operation, the device remains
957 * RUNNING, P2P quiesced or in STOP. The STOP_COPY state is described below
958 * in PRE_COPY_P2P -> STOP_COPY.
959 *
960 * PRE_COPY -> PRE_COPY_P2P
961 * Entering PRE_COPY_P2P continues all the behaviors of PRE_COPY above.
962 * However, while in the PRE_COPY_P2P state, the device is partially running
963 * in the P2P quiescent state defined below, like RUNNING_P2P.
964 *
965 * PRE_COPY_P2P -> PRE_COPY
966 * This arc allows returning the device to a full RUNNING behavior while
967 * continuing all the behaviors of PRE_COPY.
968 *
969 * PRE_COPY_P2P -> STOP_COPY
970 * While in the STOP_COPY state the device has the same behavior as STOP
971 * with the addition that the data transfers session continues to stream the
972 * migration state. End of stream on the FD indicates the entire device
973 * state has been transferred.
974 *
975 * The user should take steps to restrict access to vfio device regions while
976 * the device is in STOP_COPY or risk corruption of the device migration data
977 * stream.
978 *
979 * STOP -> RESUMING
980 * Entering the RESUMING state starts a process of restoring the device state
981 * and will return a new data_fd. The data stream fed into the data_fd should
982 * be taken from the data transfer output of a single FD during saving from
983 * a compatible device. The migration driver may alter/reset the internal
984 * device state for this arc if required to prepare the device to receive the
985 * migration data.
986 *
987 * STOP_COPY -> PRE_COPY
988 * STOP_COPY -> PRE_COPY_P2P
989 * These arcs are not permitted and return error if requested. Future
990 * revisions of this API may define behaviors for these arcs, in this case
991 * support will be discoverable by a new flag in
992 * VFIO_DEVICE_FEATURE_MIGRATION.
993 *
994 * any -> ERROR
995 * ERROR cannot be specified as a device state, however any transition request
996 * can be failed with an errno return and may then move the device_state into
997 * ERROR. In this case the device was unable to execute the requested arc and
998 * was also unable to restore the device to any valid device_state.
999 * To recover from ERROR VFIO_DEVICE_RESET must be used to return the
1000 * device_state back to RUNNING.
1001 *
1002 * The optional peer to peer (P2P) quiescent state is intended to be a quiescent
1003 * state for the device for the purposes of managing multiple devices within a
1004 * user context where peer-to-peer DMA between devices may be active. The
1005 * RUNNING_P2P and PRE_COPY_P2P states must prevent the device from initiating
1006 * any new P2P DMA transactions. If the device can identify P2P transactions
1007 * then it can stop only P2P DMA, otherwise it must stop all DMA. The migration
1008 * driver must complete any such outstanding operations prior to completing the
1009 * FSM arc into a P2P state. For the purpose of specification the states
1010 * behave as though the device was fully running if not supported. Like while in
1011 * STOP or STOP_COPY the user must not touch the device, otherwise the state
1012 * can be exited.
1013 *
1014 * The remaining possible transitions are interpreted as combinations of the
1015 * above FSM arcs. As there are multiple paths through the FSM arcs the path
1016 * should be selected based on the following rules:
1017 * - Select the shortest path.
1018 * - The path cannot have saving group states as interior arcs, only
1019 * starting/end states.
1020 * Refer to vfio_mig_get_next_state() for the result of the algorithm.
1021 *
1022 * The automatic transit through the FSM arcs that make up the combination
1023 * transition is invisible to the user. When working with combination arcs the
1024 * user may see any step along the path in the device_state if SET_STATE
1025 * fails. When handling these types of errors users should anticipate future
1026 * revisions of this protocol using new states and those states becoming
1027 * visible in this case.
1028 *
1029 * The optional states cannot be used with SET_STATE if the device does not
1030 * support them. The user can discover if these states are supported by using
1031 * VFIO_DEVICE_FEATURE_MIGRATION. By using combination transitions the user can
1032 * avoid knowing about these optional states if the kernel driver supports them.
1033 *
1034 * Arcs touching PRE_COPY and PRE_COPY_P2P are removed if support for PRE_COPY
1035 * is not present.
1036 */
1037enum vfio_device_mig_state {
1038 VFIO_DEVICE_STATE_ERROR = 0,
1039 VFIO_DEVICE_STATE_STOP = 1,
1040 VFIO_DEVICE_STATE_RUNNING = 2,
1041 VFIO_DEVICE_STATE_STOP_COPY = 3,
1042 VFIO_DEVICE_STATE_RESUMING = 4,
1043 VFIO_DEVICE_STATE_RUNNING_P2P = 5,
1044 VFIO_DEVICE_STATE_PRE_COPY = 6,
1045 VFIO_DEVICE_STATE_PRE_COPY_P2P = 7,
1046};
1047
1048/**
1049 * VFIO_MIG_GET_PRECOPY_INFO - _IO(VFIO_TYPE, VFIO_BASE + 21)
1050 *
1051 * This ioctl is used on the migration data FD in the precopy phase of the
1052 * migration data transfer. It returns an estimate of the current data sizes
1053 * remaining to be transferred. It allows the user to judge when it is
1054 * appropriate to leave PRE_COPY for STOP_COPY.
1055 *
1056 * This ioctl is valid only in PRE_COPY states and kernel driver should
1057 * return -EINVAL from any other migration state.
1058 *
1059 * The vfio_precopy_info data structure returned by this ioctl provides
1060 * estimates of data available from the device during the PRE_COPY states.
1061 * This estimate is split into two categories, initial_bytes and
1062 * dirty_bytes.
1063 *
1064 * The initial_bytes field indicates the amount of initial precopy
1065 * data available from the device. This field should have a non-zero initial
1066 * value and decrease as migration data is read from the device.
1067 * It is recommended to leave PRE_COPY for STOP_COPY only after this field
1068 * reaches zero. Leaving PRE_COPY earlier might make things slower.
1069 *
1070 * The dirty_bytes field tracks device state changes relative to data
1071 * previously retrieved. This field starts at zero and may increase as
1072 * the internal device state is modified or decrease as that modified
1073 * state is read from the device.
1074 *
1075 * Userspace may use the combination of these fields to estimate the
1076 * potential data size available during the PRE_COPY phases, as well as
1077 * trends relative to the rate the device is dirtying its internal
1078 * state, but these fields are not required to have any bearing relative
1079 * to the data size available during the STOP_COPY phase.
1080 *
1081 * Drivers have a lot of flexibility in when and what they transfer during the
1082 * PRE_COPY phase, and how they report this from VFIO_MIG_GET_PRECOPY_INFO.
1083 *
1084 * During pre-copy the migration data FD has a temporary "end of stream" that is
1085 * reached when both initial_bytes and dirty_byte are zero. For instance, this
1086 * may indicate that the device is idle and not currently dirtying any internal
1087 * state. When read() is done on this temporary end of stream the kernel driver
1088 * should return ENOMSG from read(). Userspace can wait for more data (which may
1089 * never come) by using poll.
1090 *
1091 * Once in STOP_COPY the migration data FD has a permanent end of stream
1092 * signaled in the usual way by read() always returning 0 and poll always
1093 * returning readable. ENOMSG may not be returned in STOP_COPY.
1094 * Support for this ioctl is mandatory if a driver claims to support
1095 * VFIO_MIGRATION_PRE_COPY.
1096 *
1097 * Return: 0 on success, -1 and errno set on failure.
1098 */
1099struct vfio_precopy_info {
1100 __u32 argsz;
1101 __u32 flags;
1102 __aligned_u64 initial_bytes;
1103 __aligned_u64 dirty_bytes;
1104};
1105
1106#define VFIO_MIG_GET_PRECOPY_INFO _IO(VFIO_TYPE, VFIO_BASE + 21)
1107
1108/*
1109 * Upon VFIO_DEVICE_FEATURE_SET, allow the device to be moved into a low power
1110 * state with the platform-based power management. Device use of lower power
1111 * states depends on factors managed by the runtime power management core,
1112 * including system level support and coordinating support among dependent
1113 * devices. Enabling device low power entry does not guarantee lower power
1114 * usage by the device, nor is a mechanism provided through this feature to
1115 * know the current power state of the device. If any device access happens
1116 * (either from the host or through the vfio uAPI) when the device is in the
1117 * low power state, then the host will move the device out of the low power
1118 * state as necessary prior to the access. Once the access is completed, the
1119 * device may re-enter the low power state. For single shot low power support
1120 * with wake-up notification, see
1121 * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP below. Access to mmap'd
1122 * device regions is disabled on LOW_POWER_ENTRY and may only be resumed after
1123 * calling LOW_POWER_EXIT.
1124 */
1125#define VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY 3
1126
1127/*
1128 * This device feature has the same behavior as
1129 * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY with the exception that the user
1130 * provides an eventfd for wake-up notification. When the device moves out of
1131 * the low power state for the wake-up, the host will not allow the device to
1132 * re-enter a low power state without a subsequent user call to one of the low
1133 * power entry device feature IOCTLs. Access to mmap'd device regions is
1134 * disabled on LOW_POWER_ENTRY_WITH_WAKEUP and may only be resumed after the
1135 * low power exit. The low power exit can happen either through LOW_POWER_EXIT
1136 * or through any other access (where the wake-up notification has been
1137 * generated). The access to mmap'd device regions will not trigger low power
1138 * exit.
1139 *
1140 * The notification through the provided eventfd will be generated only when
1141 * the device has entered and is resumed from a low power state after
1142 * calling this device feature IOCTL. A device that has not entered low power
1143 * state, as managed through the runtime power management core, will not
1144 * generate a notification through the provided eventfd on access. Calling the
1145 * LOW_POWER_EXIT feature is optional in the case where notification has been
1146 * signaled on the provided eventfd that a resume from low power has occurred.
1147 */
1148struct vfio_device_low_power_entry_with_wakeup {
1149 __s32 wakeup_eventfd;
1150 __u32 reserved;
1151};
1152
1153#define VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP 4
1154
1155/*
1156 * Upon VFIO_DEVICE_FEATURE_SET, disallow use of device low power states as
1157 * previously enabled via VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY or
1158 * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP device features.
1159 * This device feature IOCTL may itself generate a wakeup eventfd notification
1160 * in the latter case if the device had previously entered a low power state.
1161 */
1162#define VFIO_DEVICE_FEATURE_LOW_POWER_EXIT 5
1163
1164/*
1165 * Upon VFIO_DEVICE_FEATURE_SET start/stop device DMA logging.
1166 * VFIO_DEVICE_FEATURE_PROBE can be used to detect if the device supports
1167 * DMA logging.
1168 *
1169 * DMA logging allows a device to internally record what DMAs the device is
1170 * initiating and report them back to userspace. It is part of the VFIO
1171 * migration infrastructure that allows implementing dirty page tracking
1172 * during the pre copy phase of live migration. Only DMA WRITEs are logged,
1173 * and this API is not connected to VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE.
1174 *
1175 * When DMA logging is started a range of IOVAs to monitor is provided and the
1176 * device can optimize its logging to cover only the IOVA range given. Each
1177 * DMA that the device initiates inside the range will be logged by the device
1178 * for later retrieval.
1179 *
1180 * page_size is an input that hints what tracking granularity the device
1181 * should try to achieve. If the device cannot do the hinted page size then
1182 * it's the driver choice which page size to pick based on its support.
1183 * On output the device will return the page size it selected.
1184 *
1185 * ranges is a pointer to an array of
1186 * struct vfio_device_feature_dma_logging_range.
1187 *
1188 * The core kernel code guarantees to support by minimum num_ranges that fit
1189 * into a single kernel page. User space can try higher values but should give
1190 * up if the above can't be achieved as of some driver limitations.
1191 *
1192 * A single call to start device DMA logging can be issued and a matching stop
1193 * should follow at the end. Another start is not allowed in the meantime.
1194 */
1195struct vfio_device_feature_dma_logging_control {
1196 __aligned_u64 page_size;
1197 __u32 num_ranges;
1198 __u32 __reserved;
1199 __aligned_u64 ranges;
1200};
1201
1202struct vfio_device_feature_dma_logging_range {
1203 __aligned_u64 iova;
1204 __aligned_u64 length;
1205};
1206
1207#define VFIO_DEVICE_FEATURE_DMA_LOGGING_START 6
1208
1209/*
1210 * Upon VFIO_DEVICE_FEATURE_SET stop device DMA logging that was started
1211 * by VFIO_DEVICE_FEATURE_DMA_LOGGING_START
1212 */
1213#define VFIO_DEVICE_FEATURE_DMA_LOGGING_STOP 7
1214
1215/*
1216 * Upon VFIO_DEVICE_FEATURE_GET read back and clear the device DMA log
1217 *
1218 * Query the device's DMA log for written pages within the given IOVA range.
1219 * During querying the log is cleared for the IOVA range.
1220 *
1221 * bitmap is a pointer to an array of u64s that will hold the output bitmap
1222 * with 1 bit reporting a page_size unit of IOVA. The mapping of IOVA to bits
1223 * is given by:
1224 * bitmap[(addr - iova)/page_size] & (1ULL << (addr % 64))
1225 *
1226 * The input page_size can be any power of two value and does not have to
1227 * match the value given to VFIO_DEVICE_FEATURE_DMA_LOGGING_START. The driver
1228 * will format its internal logging to match the reporting page size, possibly
1229 * by replicating bits if the internal page size is lower than requested.
1230 *
1231 * The LOGGING_REPORT will only set bits in the bitmap and never clear or
1232 * perform any initialization of the user provided bitmap.
1233 *
1234 * If any error is returned userspace should assume that the dirty log is
1235 * corrupted. Error recovery is to consider all memory dirty and try to
1236 * restart the dirty tracking, or to abort/restart the whole migration.
1237 *
1238 * If DMA logging is not enabled, an error will be returned.
1239 *
1240 */
1241struct vfio_device_feature_dma_logging_report {
1242 __aligned_u64 iova;
1243 __aligned_u64 length;
1244 __aligned_u64 page_size;
1245 __aligned_u64 bitmap;
1246};
1247
1248#define VFIO_DEVICE_FEATURE_DMA_LOGGING_REPORT 8
1249
1250/*
1251 * Upon VFIO_DEVICE_FEATURE_GET read back the estimated data length that will
1252 * be required to complete stop copy.
1253 *
1254 * Note: Can be called on each device state.
1255 */
1256
1257struct vfio_device_feature_mig_data_size {
1258 __aligned_u64 stop_copy_length;
1259};
1260
1261#define VFIO_DEVICE_FEATURE_MIG_DATA_SIZE 9
1262
10051263/* -------- API for Type1 VFIO IOMMU -------- */
10061264
10071265/**
......@@ -1089,8 +1347,7 @@ struct vfio_iommu_type1_info_dma_avail {
10891347 * Map process virtual addresses to IO virtual addresses using the
10901348 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
10911349 *
1092 * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova, and
1093 * unblock translation of host virtual addresses in the iova range. The vaddr
1350 * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova. The vaddr
10941351 * must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To
10951352 * maintain memory consistency within the user application, the updated vaddr
10961353 * must address the same memory object as originally mapped. Failure to do so
......@@ -1141,9 +1398,9 @@ struct vfio_bitmap {
11411398 * must be 0. This cannot be combined with the get-dirty-bitmap flag.
11421399 *
11431400 * If flags & VFIO_DMA_UNMAP_FLAG_VADDR, do not unmap, but invalidate host
1144 * virtual addresses in the iova range. Tasks that attempt to translate an
1145 * iova's vaddr will block. DMA to already-mapped pages continues. This
1146 * cannot be combined with the get-dirty-bitmap flag.
1401 * virtual addresses in the iova range. DMA to already-mapped pages continues.
1402 * Groups may not be added to the container while any addresses are invalid.
1403 * This cannot be combined with the get-dirty-bitmap flag.
11471404 */
11481405struct vfio_iommu_type1_dma_unmap {
11491406 __u32 argsz;
lib/libc/include/any-linux-any/linux/vfio_zdev.h+7
......@@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base {
2929 __u16 fmb_length; /* Measurement Block Length (in bytes) */
3030 __u8 pft; /* PCI Function Type */
3131 __u8 gid; /* PCI function group ID */
32 /* End of version 1 */
33 __u32 fh; /* PCI function handle */
34 /* End of version 2 */
3235};
3336
3437/**
......@@ -47,6 +50,10 @@ struct vfio_device_info_cap_zpci_group {
4750 __u16 noi; /* Maximum number of MSIs */
4851 __u16 maxstbl; /* Maximum Store Block Length */
4952 __u8 version; /* Supported PCI Version */
53 /* End of version 1 */
54 __u8 reserved;
55 __u16 imaxstbl; /* Maximum Interpreted Store Block Length */
56 /* End of version 2 */
5057};
5158
5259/**
lib/libc/include/any-linux-any/linux/vhost.h+43-5
......@@ -89,11 +89,6 @@
8989
9090/* Set or get vhost backend capability */
9191
92/* Use message type V2 */
93#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
94/* IOTLB can accept batching hints */
95#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
96
9792#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
9893#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
9994
......@@ -150,4 +145,47 @@
150145/* Get the valid iova range */
151146#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \
152147 struct vhost_vdpa_iova_range)
148/* Get the config size */
149#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)
150
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
157/* Get the number of address spaces. */
158#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
159
160/* Get the group for a virtqueue: read index, write group in num,
161 * The virtqueue index is stored in the index field of
162 * vhost_vring_state. The group for this specific virtqueue is
163 * returned via num field of vhost_vring_state.
164 */
165#define VHOST_VDPA_GET_VRING_GROUP _IOWR(VHOST_VIRTIO, 0x7B, \
166 struct vhost_vring_state)
167/* Set the ASID for a virtqueue group. The group index is stored in
168 * the index field of vhost_vring_state, the ASID associated with this
169 * group is stored at num field of vhost_vring_state.
170 */
171#define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \
172 struct vhost_vring_state)
173
174/* Suspend a device so it does not process virtqueue requests anymore
175 *
176 * After the return of ioctl the device must preserve all the necessary state
177 * (the virtqueue vring base plus the possible device specific states) that is
178 * required for restoring in the future. The device must not change its
179 * configuration after that point.
180 */
181#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D)
182
183/* Resume a device so it can resume processing virtqueue requests
184 *
185 * After the return of this ioctl the device will have restored all the
186 * necessary states and it is fully operational to continue processing the
187 * virtqueue descriptors.
188 */
189#define VHOST_VDPA_RESUME _IO(VHOST_VIRTIO, 0x7E)
190
153191#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vhost_types.h+16-3
......@@ -87,7 +87,7 @@ struct vhost_msg {
8787
8888struct vhost_msg_v2 {
8989 __u32 type;
90 __u32 reserved;
90 __u32 asid;
9191 union {
9292 struct vhost_iotlb_msg iotlb;
9393 __u8 padding[64];
......@@ -107,7 +107,7 @@ struct vhost_memory_region {
107107struct vhost_memory {
108108 __u32 nregions;
109109 __u32 padding;
110 struct vhost_memory_region regions[0];
110 struct vhost_memory_region regions[];
111111};
112112
113113/* VHOST_SCSI specific definitions */
......@@ -135,7 +135,7 @@ struct vhost_scsi_target {
135135struct vhost_vdpa_config {
136136 __u32 off;
137137 __u32 len;
138 __u8 buf[0];
138 __u8 buf[];
139139};
140140
141141/* vhost vdpa IOVA range
......@@ -153,4 +153,17 @@ struct vhost_vdpa_iova_range {
153153/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
154154#define VHOST_NET_F_VIRTIO_NET_HDR 27
155155
156/* Use message type V2 */
157#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
158/* IOTLB can accept batching hints */
159#define VHOST_BACKEND_F_IOTLB_BATCH 0x2
160/* IOTLB can accept address space identifier through V2 type of IOTLB
161 * message
162 */
163#define VHOST_BACKEND_F_IOTLB_ASID 0x3
164/* Device can be suspended */
165#define VHOST_BACKEND_F_SUSPEND 0x4
166/* Device can be resumed */
167#define VHOST_BACKEND_F_RESUME 0x5
168
156169#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/videodev2.h+54-3
......@@ -243,6 +243,7 @@ enum v4l2_colorspace {
243243
244244 /* DCI-P3 colorspace, used by cinema projectors */
245245 V4L2_COLORSPACE_DCI_P3 = 12,
246
246247};
247248
248249/*
......@@ -474,7 +475,6 @@ struct v4l2_capability {
474475#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */
475476
476477#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
477#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
478478#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
479479#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */
480480
......@@ -549,6 +549,9 @@ struct v4l2_pix_format {
549549#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */
550550#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
551551#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */
552#define V4L2_PIX_FMT_RGBX1010102 v4l2_fourcc('R', 'X', '3', '0') /* 32 RGBX-10-10-10-2 */
553#define V4L2_PIX_FMT_RGBA1010102 v4l2_fourcc('R', 'A', '3', '0') /* 32 RGBA-10-10-10-2 */
554#define V4L2_PIX_FMT_ARGB2101010 v4l2_fourcc('A', 'R', '3', '0') /* 32 ARGB-2-10-10-10 */
552555
553556/* Grey formats */
554557#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
......@@ -563,6 +566,7 @@ struct v4l2_pix_format {
563566/* Grey bit-packed formats */
564567#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
565568#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */
569#define V4L2_PIX_FMT_IPU3_Y10 v4l2_fourcc('i', 'p', '3', 'y') /* IPU3 packed 10-bit greyscale */
566570
567571/* Palette formats */
568572#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
......@@ -586,8 +590,18 @@ struct v4l2_pix_format {
586590#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */
587591#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */
588592#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */
593#define V4L2_PIX_FMT_YUVA32 v4l2_fourcc('Y', 'U', 'V', 'A') /* 32 YUVA-8-8-8-8 */
594#define V4L2_PIX_FMT_YUVX32 v4l2_fourcc('Y', 'U', 'V', 'X') /* 32 YUVX-8-8-8-8 */
589595#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
590596
597/*
598 * YCbCr packed format. For each Y2xx format, xx bits of valid data occupy the MSBs
599 * of the 16 bit components, and 16-xx bits of zero padding occupy the LSBs.
600 */
601#define V4L2_PIX_FMT_Y210 v4l2_fourcc('Y', '2', '1', '0') /* 32 YUYV 4:2:2 */
602#define V4L2_PIX_FMT_Y212 v4l2_fourcc('Y', '2', '1', '2') /* 32 YUYV 4:2:2 */
603#define V4L2_PIX_FMT_Y216 v4l2_fourcc('Y', '2', '1', '6') /* 32 YUYV 4:2:2 */
604
591605/* two planes -- one Y, one Cr + Cb interleaved */
592606#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
593607#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
......@@ -595,6 +609,7 @@ struct v4l2_pix_format {
595609#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
596610#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
597611#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
612#define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */
598613
599614/* two non contiguous planes - one Y, one Cr + Cb interleaved */
600615#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
......@@ -622,10 +637,15 @@ struct v4l2_pix_format {
622637#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */
623638#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
624639#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 32x32 tiles */
640#define V4L2_PIX_FMT_P010_4L4 v4l2_fourcc('T', '0', '1', '0') /* 12 Y/CbCr 4:2:0 10-bit 4x4 macroblocks */
641#define V4L2_PIX_FMT_NV12_8L128 v4l2_fourcc('A', 'T', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
642#define V4L2_PIX_FMT_NV12_10BE_8L128 v4l2_fourcc_be('A', 'X', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */
625643
626644/* Tiled YUV formats, non contiguous planes */
627645#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */
628646#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
647#define V4L2_PIX_FMT_NV12M_8L128 v4l2_fourcc('N', 'A', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
648#define V4L2_PIX_FMT_NV12M_10BE_8L128 v4l2_fourcc_be('N', 'T', '1', '2') /* Y/CbCr 4:2:0 10-bit 8x128 tiles */
629649
630650/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
631651#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
......@@ -697,10 +717,12 @@ struct v4l2_pix_format {
697717#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
698718#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */
699719#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
720#define V4L2_PIX_FMT_VP9_FRAME v4l2_fourcc('V', 'P', '9', 'F') /* VP9 parsed frame */
700721#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
701722#define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */
702723#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
703724#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */
725#define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
704726
705727/* Vendor-specific formats */
706728#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
......@@ -737,8 +759,11 @@ struct v4l2_pix_format {
737759#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
738760#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
739761#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */
762#define V4L2_PIX_FMT_QC08C v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */
763#define V4L2_PIX_FMT_QC10C v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */
764#define V4L2_PIX_FMT_AJPG v4l2_fourcc('A', 'J', 'P', 'G') /* Aspeed JPEG */
740765
741/* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
766/* 10bit raw packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */
742767#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
743768#define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */
744769#define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
......@@ -1540,7 +1565,8 @@ struct v4l2_bt_timings {
15401565 ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
15411566#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
15421567 ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + \
1543 (bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch)
1568 ((bt)->interlaced ? \
1569 ((bt)->il_vfrontporch + (bt)->il_vsync + (bt)->il_vbackporch) : 0))
15441570#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
15451571 ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
15461572
......@@ -1718,6 +1744,8 @@ struct v4l2_ext_control {
17181744 __u8 *p_u8;
17191745 __u16 *p_u16;
17201746 __u32 *p_u32;
1747 __u32 *p_s32;
1748 __u32 *p_s64;
17211749 struct v4l2_area *p_area;
17221750 struct v4l2_ctrl_h264_sps *p_h264_sps;
17231751 struct v4l2_ctrl_h264_pps *p_h264_pps;
......@@ -1730,6 +1758,13 @@ struct v4l2_ext_control {
17301758 struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;
17311759 struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;
17321760 struct v4l2_ctrl_mpeg2_quantisation *p_mpeg2_quantisation;
1761 struct v4l2_ctrl_vp9_compressed_hdr *p_vp9_compressed_hdr_probs;
1762 struct v4l2_ctrl_vp9_frame *p_vp9_frame;
1763 struct v4l2_ctrl_hevc_sps *p_hevc_sps;
1764 struct v4l2_ctrl_hevc_pps *p_hevc_pps;
1765 struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params;
1766 struct v4l2_ctrl_hevc_scaling_matrix *p_hevc_scaling_matrix;
1767 struct v4l2_ctrl_hevc_decode_params *p_hevc_decode_params;
17331768 void *ptr;
17341769 };
17351770} __attribute__ ((packed));
......@@ -1790,6 +1825,15 @@ enum v4l2_ctrl_type {
17901825 V4L2_CTRL_TYPE_MPEG2_QUANTISATION = 0x0250,
17911826 V4L2_CTRL_TYPE_MPEG2_SEQUENCE = 0x0251,
17921827 V4L2_CTRL_TYPE_MPEG2_PICTURE = 0x0252,
1828
1829 V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR = 0x0260,
1830 V4L2_CTRL_TYPE_VP9_FRAME = 0x0261,
1831
1832 V4L2_CTRL_TYPE_HEVC_SPS = 0x0270,
1833 V4L2_CTRL_TYPE_HEVC_PPS = 0x0271,
1834 V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS = 0x0272,
1835 V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX = 0x0273,
1836 V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS = 0x0274,
17931837};
17941838
17951839/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
......@@ -1845,6 +1889,7 @@ struct v4l2_querymenu {
18451889#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100
18461890#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
18471891#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400
1892#define V4L2_CTRL_FLAG_DYNAMIC_ARRAY 0x0800
18481893
18491894/* Query flags, to be ORed with the control ID */
18501895#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
......@@ -2352,6 +2397,7 @@ struct v4l2_event_vsync {
23522397#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
23532398#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
23542399#define V4L2_EVENT_CTRL_CH_RANGE (1 << 2)
2400#define V4L2_EVENT_CTRL_CH_DIMENSIONS (1 << 3)
23552401
23562402struct v4l2_event_ctrl {
23572403 __u32 changes;
......@@ -2594,5 +2640,10 @@ struct v4l2_create_buffers {
25942640/* Deprecated definitions kept for backwards compatibility */
25952641#define V4L2_PIX_FMT_HM12 V4L2_PIX_FMT_NV12_16L16
25962642#define V4L2_PIX_FMT_SUNXI_TILED_NV12 V4L2_PIX_FMT_NV12_32L32
2643/*
2644 * This capability was never implemented, anyone using this cap should drop it
2645 * from their code.
2646 */
2647#define V4L2_CAP_ASYNCIO 0x02000000
25972648
25982649#endif /* __LINUX_VIDEODEV2_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_9p.h+1-1
......@@ -38,7 +38,7 @@ struct virtio_9p_config {
3838 /* length of the tag name */
3939 __virtio16 tag_len;
4040 /* non-NULL terminated tag name */
41 __u8 tag[0];
41 __u8 tag[];
4242} __attribute__((packed));
4343
4444#endif /* _LINUX_VIRTIO_9P_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_blk.h+124
......@@ -40,6 +40,8 @@
4040#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */
4141#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */
4242#define VIRTIO_BLK_F_WRITE_ZEROES 14 /* WRITE ZEROES is supported */
43#define VIRTIO_BLK_F_SECURE_ERASE 16 /* Secure Erase is supported */
44#define VIRTIO_BLK_F_ZONED 17 /* Zoned block device */
4345
4446/* Legacy feature bits */
4547#ifndef VIRTIO_BLK_NO_LEGACY
......@@ -119,6 +121,31 @@ struct virtio_blk_config {
119121 __u8 write_zeroes_may_unmap;
120122
121123 __u8 unused1[3];
124
125 /* the next 3 entries are guarded by VIRTIO_BLK_F_SECURE_ERASE */
126 /*
127 * The maximum secure erase sectors (in 512-byte sectors) for
128 * one segment.
129 */
130 __virtio32 max_secure_erase_sectors;
131 /*
132 * The maximum number of secure erase segments in a
133 * secure erase command.
134 */
135 __virtio32 max_secure_erase_seg;
136 /* Secure erase commands must be aligned to this number of sectors. */
137 __virtio32 secure_erase_sector_alignment;
138
139 /* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
140 struct virtio_blk_zoned_characteristics {
141 __virtio32 zone_sectors;
142 __virtio32 max_open_zones;
143 __virtio32 max_active_zones;
144 __virtio32 max_append_sectors;
145 __virtio32 write_granularity;
146 __u8 model;
147 __u8 unused2[3];
148 } zoned;
122149} __attribute__((packed));
123150
124151/*
......@@ -153,6 +180,30 @@ struct virtio_blk_config {
153180/* Write zeroes command */
154181#define VIRTIO_BLK_T_WRITE_ZEROES 13
155182
183/* Secure erase command */
184#define VIRTIO_BLK_T_SECURE_ERASE 14
185
186/* Zone append command */
187#define VIRTIO_BLK_T_ZONE_APPEND 15
188
189/* Report zones command */
190#define VIRTIO_BLK_T_ZONE_REPORT 16
191
192/* Open zone command */
193#define VIRTIO_BLK_T_ZONE_OPEN 18
194
195/* Close zone command */
196#define VIRTIO_BLK_T_ZONE_CLOSE 20
197
198/* Finish zone command */
199#define VIRTIO_BLK_T_ZONE_FINISH 22
200
201/* Reset zone command */
202#define VIRTIO_BLK_T_ZONE_RESET 24
203
204/* Reset All zones command */
205#define VIRTIO_BLK_T_ZONE_RESET_ALL 26
206
156207#ifndef VIRTIO_BLK_NO_LEGACY
157208/* Barrier before this op. */
158209#define VIRTIO_BLK_T_BARRIER 0x80000000
......@@ -172,6 +223,72 @@ struct virtio_blk_outhdr {
172223 __virtio64 sector;
173224};
174225
226/*
227 * Supported zoned device models.
228 */
229
230/* Regular block device */
231#define VIRTIO_BLK_Z_NONE 0
232/* Host-managed zoned device */
233#define VIRTIO_BLK_Z_HM 1
234/* Host-aware zoned device */
235#define VIRTIO_BLK_Z_HA 2
236
237/*
238 * Zone descriptor. A part of VIRTIO_BLK_T_ZONE_REPORT command reply.
239 */
240struct virtio_blk_zone_descriptor {
241 /* Zone capacity */
242 __virtio64 z_cap;
243 /* The starting sector of the zone */
244 __virtio64 z_start;
245 /* Zone write pointer position in sectors */
246 __virtio64 z_wp;
247 /* Zone type */
248 __u8 z_type;
249 /* Zone state */
250 __u8 z_state;
251 __u8 reserved[38];
252};
253
254struct virtio_blk_zone_report {
255 __virtio64 nr_zones;
256 __u8 reserved[56];
257 struct virtio_blk_zone_descriptor zones[];
258};
259
260/*
261 * Supported zone types.
262 */
263
264/* Conventional zone */
265#define VIRTIO_BLK_ZT_CONV 1
266/* Sequential Write Required zone */
267#define VIRTIO_BLK_ZT_SWR 2
268/* Sequential Write Preferred zone */
269#define VIRTIO_BLK_ZT_SWP 3
270
271/*
272 * Zone states that are available for zones of all types.
273 */
274
275/* Not a write pointer (conventional zones only) */
276#define VIRTIO_BLK_ZS_NOT_WP 0
277/* Empty */
278#define VIRTIO_BLK_ZS_EMPTY 1
279/* Implicitly Open */
280#define VIRTIO_BLK_ZS_IOPEN 2
281/* Explicitly Open */
282#define VIRTIO_BLK_ZS_EOPEN 3
283/* Closed */
284#define VIRTIO_BLK_ZS_CLOSED 4
285/* Read-Only */
286#define VIRTIO_BLK_ZS_RDONLY 13
287/* Full */
288#define VIRTIO_BLK_ZS_FULL 14
289/* Offline */
290#define VIRTIO_BLK_ZS_OFFLINE 15
291
175292/* Unmap this range (only valid for write zeroes command) */
176293#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
177294
......@@ -198,4 +315,11 @@ struct virtio_scsi_inhdr {
198315#define VIRTIO_BLK_S_OK 0
199316#define VIRTIO_BLK_S_IOERR 1
200317#define VIRTIO_BLK_S_UNSUPP 2
318
319/* Error codes that are specific to zoned block devices */
320#define VIRTIO_BLK_S_ZONE_INVALID_CMD 3
321#define VIRTIO_BLK_S_ZONE_UNALIGNED_WP 4
322#define VIRTIO_BLK_S_ZONE_OPEN_RESOURCE 5
323#define VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE 6
324
201325#endif /* _LINUX_VIRTIO_BLK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_bt.h+8
......@@ -9,6 +9,7 @@
99#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */
1010#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */
1111#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */
12#define VIRTIO_BT_F_CONFIG_V2 3 /* Use second version configuration */
1213
1314enum virtio_bt_config_type {
1415 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
......@@ -28,4 +29,11 @@ struct virtio_bt_config {
2829 __u16 msft_opcode;
2930} __attribute__((packed));
3031
32struct virtio_bt_config_v2 {
33 __u8 type;
34 __u8 alignment;
35 __u16 vendor;
36 __u16 msft_opcode;
37};
38
3139#endif /* _LINUX_VIRTIO_BT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_config.h+12-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 38
55#define VIRTIO_TRANSPORT_F_END 41
5656
5757#ifndef VIRTIO_CONFIG_NO_LEGACY
5858/* Do we get callbacks when the ring is completely used, even if we've
......@@ -80,6 +80,12 @@
8080/* This feature indicates support for the packed virtqueue layout. */
8181#define VIRTIO_F_RING_PACKED 34
8282
83/*
84 * Inorder feature indicates that all buffers are used by the device
85 * in the same order in which they have been made available.
86 */
87#define VIRTIO_F_IN_ORDER 35
88
8389/*
8490 * This feature indicates that memory accesses by the driver and the
8591 * device are ordered in a way described by the platform.
......@@ -90,4 +96,9 @@
9096 * Does the device support Single Root I/O Virtualization?
9197 */
9298#define VIRTIO_F_SR_IOV 37
99
100/*
101 * This feature indicates that the driver can reset a queue individually.
102 */
103#define VIRTIO_F_RING_RESET 40
93104#endif /* _LINUX_VIRTIO_CONFIG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_crypto.h+81-1
......@@ -37,6 +37,7 @@
3737#define VIRTIO_CRYPTO_SERVICE_HASH 1
3838#define VIRTIO_CRYPTO_SERVICE_MAC 2
3939#define VIRTIO_CRYPTO_SERVICE_AEAD 3
40#define VIRTIO_CRYPTO_SERVICE_AKCIPHER 4
4041
4142#define VIRTIO_CRYPTO_OPCODE(service, op) (((service) << 8) | (op))
4243
......@@ -57,6 +58,10 @@ struct virtio_crypto_ctrl_header {
5758 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x02)
5859#define VIRTIO_CRYPTO_AEAD_DESTROY_SESSION \
5960 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x03)
61#define VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION \
62 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x04)
63#define VIRTIO_CRYPTO_AKCIPHER_DESTROY_SESSION \
64 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x05)
6065 __le32 opcode;
6166 __le32 algo;
6267 __le32 flag;
......@@ -180,6 +185,58 @@ struct virtio_crypto_aead_create_session_req {
180185 __u8 padding[32];
181186};
182187
188struct virtio_crypto_rsa_session_para {
189#define VIRTIO_CRYPTO_RSA_RAW_PADDING 0
190#define VIRTIO_CRYPTO_RSA_PKCS1_PADDING 1
191 __le32 padding_algo;
192
193#define VIRTIO_CRYPTO_RSA_NO_HASH 0
194#define VIRTIO_CRYPTO_RSA_MD2 1
195#define VIRTIO_CRYPTO_RSA_MD3 2
196#define VIRTIO_CRYPTO_RSA_MD4 3
197#define VIRTIO_CRYPTO_RSA_MD5 4
198#define VIRTIO_CRYPTO_RSA_SHA1 5
199#define VIRTIO_CRYPTO_RSA_SHA256 6
200#define VIRTIO_CRYPTO_RSA_SHA384 7
201#define VIRTIO_CRYPTO_RSA_SHA512 8
202#define VIRTIO_CRYPTO_RSA_SHA224 9
203 __le32 hash_algo;
204};
205
206struct virtio_crypto_ecdsa_session_para {
207#define VIRTIO_CRYPTO_CURVE_UNKNOWN 0
208#define VIRTIO_CRYPTO_CURVE_NIST_P192 1
209#define VIRTIO_CRYPTO_CURVE_NIST_P224 2
210#define VIRTIO_CRYPTO_CURVE_NIST_P256 3
211#define VIRTIO_CRYPTO_CURVE_NIST_P384 4
212#define VIRTIO_CRYPTO_CURVE_NIST_P521 5
213 __le32 curve_id;
214 __le32 padding;
215};
216
217struct virtio_crypto_akcipher_session_para {
218#define VIRTIO_CRYPTO_NO_AKCIPHER 0
219#define VIRTIO_CRYPTO_AKCIPHER_RSA 1
220#define VIRTIO_CRYPTO_AKCIPHER_DSA 2
221#define VIRTIO_CRYPTO_AKCIPHER_ECDSA 3
222 __le32 algo;
223
224#define VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PUBLIC 1
225#define VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PRIVATE 2
226 __le32 keytype;
227 __le32 keylen;
228
229 union {
230 struct virtio_crypto_rsa_session_para rsa;
231 struct virtio_crypto_ecdsa_session_para ecdsa;
232 } u;
233};
234
235struct virtio_crypto_akcipher_create_session_req {
236 struct virtio_crypto_akcipher_session_para para;
237 __u8 padding[36];
238};
239
183240struct virtio_crypto_alg_chain_session_para {
184241#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER 1
185242#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH 2
......@@ -247,6 +304,8 @@ struct virtio_crypto_op_ctrl_req {
247304 mac_create_session;
248305 struct virtio_crypto_aead_create_session_req
249306 aead_create_session;
307 struct virtio_crypto_akcipher_create_session_req
308 akcipher_create_session;
250309 struct virtio_crypto_destroy_session_req
251310 destroy_session;
252311 __u8 padding[56];
......@@ -266,6 +325,14 @@ struct virtio_crypto_op_header {
266325 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x00)
267326#define VIRTIO_CRYPTO_AEAD_DECRYPT \
268327 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x01)
328#define VIRTIO_CRYPTO_AKCIPHER_ENCRYPT \
329 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00)
330#define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \
331 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01)
332#define VIRTIO_CRYPTO_AKCIPHER_SIGN \
333 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02)
334#define VIRTIO_CRYPTO_AKCIPHER_VERIFY \
335 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x03)
269336 __le32 opcode;
270337 /* algo should be service-specific algorithms */
271338 __le32 algo;
......@@ -390,6 +457,16 @@ struct virtio_crypto_aead_data_req {
390457 __u8 padding[32];
391458};
392459
460struct virtio_crypto_akcipher_para {
461 __le32 src_data_len;
462 __le32 dst_data_len;
463};
464
465struct virtio_crypto_akcipher_data_req {
466 struct virtio_crypto_akcipher_para para;
467 __u8 padding[40];
468};
469
393470/* The request of the data virtqueue's packet */
394471struct virtio_crypto_op_data_req {
395472 struct virtio_crypto_op_header header;
......@@ -399,6 +476,7 @@ struct virtio_crypto_op_data_req {
399476 struct virtio_crypto_hash_data_req hash_req;
400477 struct virtio_crypto_mac_data_req mac_req;
401478 struct virtio_crypto_aead_data_req aead_req;
479 struct virtio_crypto_akcipher_data_req akcipher_req;
402480 __u8 padding[48];
403481 } u;
404482};
......@@ -408,6 +486,8 @@ struct virtio_crypto_op_data_req {
408486#define VIRTIO_CRYPTO_BADMSG 2
409487#define VIRTIO_CRYPTO_NOTSUPP 3
410488#define VIRTIO_CRYPTO_INVSESS 4 /* Invalid session id */
489#define VIRTIO_CRYPTO_NOSPC 5 /* no free session ID */
490#define VIRTIO_CRYPTO_KEY_REJECTED 6 /* Signature verification failed */
411491
412492/* The accelerator hardware is ready */
413493#define VIRTIO_CRYPTO_S_HW_READY (1 << 0)
......@@ -438,7 +518,7 @@ struct virtio_crypto_config {
438518 __le32 max_cipher_key_len;
439519 /* Maximum length of authenticated key */
440520 __le32 max_auth_key_len;
441 __le32 reserve;
521 __le32 akcipher_algo;
442522 /* Maximum size of each crypto request's content */
443523 __le64 max_size;
444524};
lib/libc/include/any-linux-any/linux/virtio_ids.h+7-7
......@@ -73,12 +73,12 @@
7373 * Virtio Transitional IDs
7474 */
7575
76#define VIRTIO_TRANS_ID_NET 1000 /* transitional virtio net */
77#define VIRTIO_TRANS_ID_BLOCK 1001 /* transitional virtio block */
78#define VIRTIO_TRANS_ID_BALLOON 1002 /* transitional virtio balloon */
79#define VIRTIO_TRANS_ID_CONSOLE 1003 /* transitional virtio console */
80#define VIRTIO_TRANS_ID_SCSI 1004 /* transitional virtio SCSI */
81#define VIRTIO_TRANS_ID_RNG 1005 /* transitional virtio rng */
82#define VIRTIO_TRANS_ID_9P 1009 /* transitional virtio 9p console */
76#define VIRTIO_TRANS_ID_NET 0x1000 /* transitional virtio net */
77#define VIRTIO_TRANS_ID_BLOCK 0x1001 /* transitional virtio block */
78#define VIRTIO_TRANS_ID_BALLOON 0x1002 /* transitional virtio balloon */
79#define VIRTIO_TRANS_ID_CONSOLE 0x1003 /* transitional virtio console */
80#define VIRTIO_TRANS_ID_SCSI 0x1004 /* transitional virtio SCSI */
81#define VIRTIO_TRANS_ID_RNG 0x1005 /* transitional virtio rng */
82#define VIRTIO_TRANS_ID_9P 0x1009 /* transitional virtio 9p console */
8383
8484#endif /* _LINUX_VIRTIO_IDS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_iommu.h+7-1
......@@ -16,6 +16,7 @@
1616#define VIRTIO_IOMMU_F_BYPASS 3
1717#define VIRTIO_IOMMU_F_PROBE 4
1818#define VIRTIO_IOMMU_F_MMIO 5
19#define VIRTIO_IOMMU_F_BYPASS_CONFIG 6
1920
2021struct virtio_iommu_range_64 {
2122 __le64 start;
......@@ -36,6 +37,8 @@ struct virtio_iommu_config {
3637 struct virtio_iommu_range_32 domain_range;
3738 /* Probe buffer size */
3839 __le32 probe_size;
40 __u8 bypass;
41 __u8 reserved[3];
3942};
4043
4144/* Request types */
......@@ -66,11 +69,14 @@ struct virtio_iommu_req_tail {
6669 __u8 reserved[3];
6770};
6871
72#define VIRTIO_IOMMU_ATTACH_F_BYPASS (1 << 0)
73
6974struct virtio_iommu_req_attach {
7075 struct virtio_iommu_req_head head;
7176 __le32 domain;
7277 __le32 endpoint;
73 __u8 reserved[8];
78 __le32 flags;
79 __u8 reserved[4];
7480 struct virtio_iommu_req_tail tail;
7581};
7682
lib/libc/include/any-linux-any/linux/virtio_net.h+37-1
......@@ -56,7 +56,10 @@
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
59#define VIRTIO_NET_F_NOTF_COAL 53 /* Device supports notifications coalescing */
60#define VIRTIO_NET_F_GUEST_USO4 54 /* Guest can handle USOv4 in. */
61#define VIRTIO_NET_F_GUEST_USO6 55 /* Guest can handle USOv6 in. */
62#define VIRTIO_NET_F_HOST_USO 56 /* Host can handle USO in. */
6063#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
6164#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
6265#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
......@@ -130,6 +133,7 @@ struct virtio_net_hdr_v1 {
130133#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */
131134#define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */
132135#define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */
136#define VIRTIO_NET_HDR_GSO_UDP_L4 5 /* GSO frame, IPv4& IPv6 UDP (USO) */
133137#define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */
134138 __u8 gso_type;
135139 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
......@@ -355,4 +359,36 @@ struct virtio_net_hash_config {
355359#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
356360#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
357361
362/*
363 * Control notifications coalescing.
364 *
365 * Request the device to change the notifications coalescing parameters.
366 *
367 * Available with the VIRTIO_NET_F_NOTF_COAL feature bit.
368 */
369#define VIRTIO_NET_CTRL_NOTF_COAL 6
370/*
371 * Set the tx-usecs/tx-max-packets parameters.
372 */
373struct virtio_net_ctrl_coal_tx {
374 /* Maximum number of packets to send before a TX notification */
375 __le32 tx_max_packets;
376 /* Maximum number of usecs to delay a TX notification */
377 __le32 tx_usecs;
378};
379
380#define VIRTIO_NET_CTRL_NOTF_COAL_TX_SET 0
381
382/*
383 * Set the rx-usecs/rx-max-packets parameters.
384 */
385struct virtio_net_ctrl_coal_rx {
386 /* Maximum number of packets to receive before a RX notification */
387 __le32 rx_max_packets;
388 /* Maximum number of usecs to delay a RX notification */
389 __le32 rx_usecs;
390};
391
392#define VIRTIO_NET_CTRL_NOTF_COAL_RX_SET 1
393
358394#endif /* _LINUX_VIRTIO_NET_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_pci.h+2
......@@ -202,6 +202,8 @@ struct virtio_pci_cfg_cap {
202202#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
203203#define VIRTIO_PCI_COMMON_Q_USEDLO 48
204204#define VIRTIO_PCI_COMMON_Q_USEDHI 52
205#define VIRTIO_PCI_COMMON_Q_NDATA 56
206#define VIRTIO_PCI_COMMON_Q_RESET 58
205207
206208#endif /* VIRTIO_PCI_NO_MODERN */
207209
lib/libc/include/any-linux-any/linux/virtio_ring.h+11-5
......@@ -91,15 +91,21 @@
9191#define VRING_USED_ALIGN_SIZE 4
9292#define VRING_DESC_ALIGN_SIZE 16
9393
94/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
94/**
95 * struct vring_desc - Virtio ring descriptors,
96 * 16 bytes long. These can chain together via @next.
97 *
98 * @addr: buffer address (guest-physical)
99 * @len: buffer length
100 * @flags: descriptor flags
101 * @next: index of the next descriptor in the chain,
102 * if the VRING_DESC_F_NEXT flag is set. We chain unused
103 * descriptors via this, too.
104 */
95105struct vring_desc {
96 /* Address (guest-physical). */
97106 __virtio64 addr;
98 /* Length. */
99107 __virtio32 len;
100 /* The flags as indicated above. */
101108 __virtio16 flags;
102 /* We chain unused descriptors via this, too */
103109 __virtio16 next;
104110};
105111
lib/libc/include/any-linux-any/linux/xfrm.h+19-6
......@@ -33,7 +33,7 @@ struct xfrm_sec_ctx {
3333 __u8 ctx_alg;
3434 __u16 ctx_len;
3535 __u32 ctx_sid;
36 char ctx_str[0];
36 char ctx_str[];
3737};
3838
3939/* Security Context Domains of Interpretation */
......@@ -96,27 +96,27 @@ struct xfrm_replay_state_esn {
9696 __u32 oseq_hi;
9797 __u32 seq_hi;
9898 __u32 replay_window;
99 __u32 bmp[0];
99 __u32 bmp[];
100100};
101101
102102struct xfrm_algo {
103103 char alg_name[64];
104104 unsigned int alg_key_len; /* in bits */
105 char alg_key[0];
105 char alg_key[];
106106};
107107
108108struct xfrm_algo_auth {
109109 char alg_name[64];
110110 unsigned int alg_key_len; /* in bits */
111111 unsigned int alg_trunc_len; /* in bits */
112 char alg_key[0];
112 char alg_key[];
113113};
114114
115115struct xfrm_algo_aead {
116116 char alg_name[64];
117117 unsigned int alg_key_len; /* in bits */
118118 unsigned int alg_icv_len; /* in bits */
119 char alg_key[0];
119 char alg_key[];
120120};
121121
122122struct xfrm_stats {
......@@ -296,7 +296,7 @@ enum xfrm_attr_type_t {
296296 XFRMA_ETIMER_THRESH,
297297 XFRMA_SRCADDR, /* xfrm_address_t */
298298 XFRMA_COADDR, /* xfrm_address_t */
299 XFRMA_LASTUSED, /* unsigned long */
299 XFRMA_LASTUSED, /* __u64 */
300300 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
301301 XFRMA_MIGRATE,
302302 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
......@@ -313,6 +313,7 @@ enum xfrm_attr_type_t {
313313 XFRMA_SET_MARK, /* __u32 */
314314 XFRMA_SET_MARK_MASK, /* __u32 */
315315 XFRMA_IF_ID, /* __u32 */
316 XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */
316317 __XFRMA_MAX
317318
318319#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */
......@@ -510,8 +511,20 @@ struct xfrm_user_offload {
510511 int ifindex;
511512 __u8 flags;
512513};
514/* This flag was exposed without any kernel code that supports it.
515 * Unfortunately, strongswan has the code that sets this flag,
516 * which makes it impossible to reuse this bit.
517 *
518 * So leave it here to make sure that it won't be reused by mistake.
519 */
513520#define XFRM_OFFLOAD_IPV6 1
514521#define XFRM_OFFLOAD_INBOUND 2
522/* Two bits above are relevant for state path only, while
523 * offload is used for both policy and state flows.
524 *
525 * In policy offload mode, they are free and can be safely reused.
526 */
527#define XFRM_OFFLOAD_PACKET 4
515528
516529struct xfrm_userpolicy_default {
517530#define XFRM_USERPOLICY_UNSPEC 0
lib/libc/include/any-linux-any/misc/fastrpc.h+87-1
......@@ -13,12 +13,65 @@
1313#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
1414#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
1515#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
16#define FASTRPC_IOCTL_INIT_CREATE_STATIC _IOWR('R', 9, struct fastrpc_init_create_static)
17#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)
18#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)
19#define FASTRPC_IOCTL_GET_DSP_INFO _IOWR('R', 13, struct fastrpc_ioctl_capability)
20
21/**
22 * enum fastrpc_map_flags - control flags for mapping memory on DSP user process
23 * @FASTRPC_MAP_STATIC: Map memory pages with RW- permission and CACHE WRITEBACK.
24 * The driver is responsible for cache maintenance when passed
25 * the buffer to FastRPC calls. Same virtual address will be
26 * assigned for subsequent FastRPC calls.
27 * @FASTRPC_MAP_RESERVED: Reserved
28 * @FASTRPC_MAP_FD: Map memory pages with RW- permission and CACHE WRITEBACK.
29 * Mapping tagged with a file descriptor. User is responsible for
30 * CPU and DSP cache maintenance for the buffer. Get virtual address
31 * of buffer on DSP using HAP_mmap_get() and HAP_mmap_put() APIs.
32 * @FASTRPC_MAP_FD_DELAYED: Mapping delayed until user call HAP_mmap() and HAP_munmap()
33 * functions on DSP. It is useful to map a buffer with cache modes
34 * other than default modes. User is responsible for CPU and DSP
35 * cache maintenance for the buffer.
36 * @FASTRPC_MAP_FD_NOMAP: This flag is used to skip CPU mapping,
37 * otherwise behaves similar to FASTRPC_MAP_FD_DELAYED flag.
38 * @FASTRPC_MAP_MAX: max count for flags
39 *
40 */
41enum fastrpc_map_flags {
42 FASTRPC_MAP_STATIC = 0,
43 FASTRPC_MAP_RESERVED,
44 FASTRPC_MAP_FD = 2,
45 FASTRPC_MAP_FD_DELAYED,
46 FASTRPC_MAP_FD_NOMAP = 16,
47 FASTRPC_MAP_MAX,
48};
49
50enum fastrpc_proc_attr {
51 /* Macro for Debug attr */
52 FASTRPC_MODE_DEBUG = (1 << 0),
53 /* Macro for Ptrace */
54 FASTRPC_MODE_PTRACE = (1 << 1),
55 /* Macro for CRC Check */
56 FASTRPC_MODE_CRC = (1 << 2),
57 /* Macro for Unsigned PD */
58 FASTRPC_MODE_UNSIGNED_MODULE = (1 << 3),
59 /* Macro for Adaptive QoS */
60 FASTRPC_MODE_ADAPTIVE_QOS = (1 << 4),
61 /* Macro for System Process */
62 FASTRPC_MODE_SYSTEM_PROCESS = (1 << 5),
63 /* Macro for Prvileged Process */
64 FASTRPC_MODE_PRIVILEGED = (1 << 6),
65};
66
67/* Fastrpc attribute for memory protection of buffers */
68#define FASTRPC_ATTR_SECUREMAP (1)
1669
1770struct fastrpc_invoke_args {
1871 __u64 ptr;
1972 __u64 length;
2073 __s32 fd;
21 __u32 reserved;
74 __u32 attr;
2275};
2376
2477struct fastrpc_invoke {
......@@ -35,6 +88,12 @@ struct fastrpc_init_create {
3588 __u64 file; /* pointer to elf file */
3689};
3790
91struct fastrpc_init_create_static {
92 __u32 namelen; /* length of pd process name */
93 __u32 memlen;
94 __u64 name; /* pd process name */
95};
96
3897struct fastrpc_alloc_dma_buf {
3998 __s32 fd; /* fd */
4099 __u32 flags; /* flags to map with */
......@@ -49,9 +108,36 @@ struct fastrpc_req_mmap {
49108 __u64 vaddrout; /* dsp virtual address */
50109};
51110
111struct fastrpc_mem_map {
112 __s32 version;
113 __s32 fd; /* fd */
114 __s32 offset; /* buffer offset */
115 __u32 flags; /* flags defined in enum fastrpc_map_flags */
116 __u64 vaddrin; /* buffer virtual address */
117 __u64 length; /* buffer length */
118 __u64 vaddrout; /* [out] remote virtual address */
119 __s32 attrs; /* buffer attributes used for SMMU mapping */
120 __s32 reserved[4];
121};
122
52123struct fastrpc_req_munmap {
53124 __u64 vaddrout; /* address to unmap */
54125 __u64 size; /* size */
55126};
56127
128struct fastrpc_mem_unmap {
129 __s32 vesion;
130 __s32 fd; /* fd */
131 __u64 vaddr; /* remote process (dsp) virtual address */
132 __u64 length; /* buffer size */
133 __s32 reserved[5];
134};
135
136struct fastrpc_ioctl_capability {
137 __u32 domain;
138 __u32 attribute_id;
139 __u32 capability; /* dsp capability */
140 __u32 reserved[4];
141};
142
57143#endif /* __QCOM_FASTRPC_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/habanalabs.h deleted-1384
......@@ -1,1384 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2 *
3 * Copyright 2016-2020 HabanaLabs, Ltd.
4 * All Rights Reserved.
5 *
6 */
7
8#ifndef HABANALABS_H_
9#define HABANALABS_H_
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14/*
15 * Defines that are asic-specific but constitutes as ABI between kernel driver
16 * and userspace
17 */
18#define GOYA_KMD_SRAM_RESERVED_SIZE_FROM_START 0x8000 /* 32KB */
19#define GAUDI_DRIVER_SRAM_RESERVED_SIZE_FROM_START 0x80 /* 128 bytes */
20
21/*
22 * 128 SOBs reserved for collective wait
23 * 16 SOBs reserved for sync stream
24 */
25#define GAUDI_FIRST_AVAILABLE_W_S_SYNC_OBJECT 144
26
27/*
28 * 64 monitors reserved for collective wait
29 * 8 monitors reserved for sync stream
30 */
31#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
32
33/*
34 * Goya queue Numbering
35 *
36 * The external queues (PCI DMA channels) MUST be before the internal queues
37 * and each group (PCI DMA channels and internal) must be contiguous inside
38 * itself but there can be a gap between the two groups (although not
39 * recommended)
40 */
41
42enum goya_queue_id {
43 GOYA_QUEUE_ID_DMA_0 = 0,
44 GOYA_QUEUE_ID_DMA_1 = 1,
45 GOYA_QUEUE_ID_DMA_2 = 2,
46 GOYA_QUEUE_ID_DMA_3 = 3,
47 GOYA_QUEUE_ID_DMA_4 = 4,
48 GOYA_QUEUE_ID_CPU_PQ = 5,
49 GOYA_QUEUE_ID_MME = 6, /* Internal queues start here */
50 GOYA_QUEUE_ID_TPC0 = 7,
51 GOYA_QUEUE_ID_TPC1 = 8,
52 GOYA_QUEUE_ID_TPC2 = 9,
53 GOYA_QUEUE_ID_TPC3 = 10,
54 GOYA_QUEUE_ID_TPC4 = 11,
55 GOYA_QUEUE_ID_TPC5 = 12,
56 GOYA_QUEUE_ID_TPC6 = 13,
57 GOYA_QUEUE_ID_TPC7 = 14,
58 GOYA_QUEUE_ID_SIZE
59};
60
61/*
62 * Gaudi queue Numbering
63 * External queues (PCI DMA channels) are DMA_0_*, DMA_1_* and DMA_5_*.
64 * Except one CPU queue, all the rest are internal queues.
65 */
66
67enum gaudi_queue_id {
68 GAUDI_QUEUE_ID_DMA_0_0 = 0, /* external */
69 GAUDI_QUEUE_ID_DMA_0_1 = 1, /* external */
70 GAUDI_QUEUE_ID_DMA_0_2 = 2, /* external */
71 GAUDI_QUEUE_ID_DMA_0_3 = 3, /* external */
72 GAUDI_QUEUE_ID_DMA_1_0 = 4, /* external */
73 GAUDI_QUEUE_ID_DMA_1_1 = 5, /* external */
74 GAUDI_QUEUE_ID_DMA_1_2 = 6, /* external */
75 GAUDI_QUEUE_ID_DMA_1_3 = 7, /* external */
76 GAUDI_QUEUE_ID_CPU_PQ = 8, /* CPU */
77 GAUDI_QUEUE_ID_DMA_2_0 = 9, /* internal */
78 GAUDI_QUEUE_ID_DMA_2_1 = 10, /* internal */
79 GAUDI_QUEUE_ID_DMA_2_2 = 11, /* internal */
80 GAUDI_QUEUE_ID_DMA_2_3 = 12, /* internal */
81 GAUDI_QUEUE_ID_DMA_3_0 = 13, /* internal */
82 GAUDI_QUEUE_ID_DMA_3_1 = 14, /* internal */
83 GAUDI_QUEUE_ID_DMA_3_2 = 15, /* internal */
84 GAUDI_QUEUE_ID_DMA_3_3 = 16, /* internal */
85 GAUDI_QUEUE_ID_DMA_4_0 = 17, /* internal */
86 GAUDI_QUEUE_ID_DMA_4_1 = 18, /* internal */
87 GAUDI_QUEUE_ID_DMA_4_2 = 19, /* internal */
88 GAUDI_QUEUE_ID_DMA_4_3 = 20, /* internal */
89 GAUDI_QUEUE_ID_DMA_5_0 = 21, /* internal */
90 GAUDI_QUEUE_ID_DMA_5_1 = 22, /* internal */
91 GAUDI_QUEUE_ID_DMA_5_2 = 23, /* internal */
92 GAUDI_QUEUE_ID_DMA_5_3 = 24, /* internal */
93 GAUDI_QUEUE_ID_DMA_6_0 = 25, /* internal */
94 GAUDI_QUEUE_ID_DMA_6_1 = 26, /* internal */
95 GAUDI_QUEUE_ID_DMA_6_2 = 27, /* internal */
96 GAUDI_QUEUE_ID_DMA_6_3 = 28, /* internal */
97 GAUDI_QUEUE_ID_DMA_7_0 = 29, /* internal */
98 GAUDI_QUEUE_ID_DMA_7_1 = 30, /* internal */
99 GAUDI_QUEUE_ID_DMA_7_2 = 31, /* internal */
100 GAUDI_QUEUE_ID_DMA_7_3 = 32, /* internal */
101 GAUDI_QUEUE_ID_MME_0_0 = 33, /* internal */
102 GAUDI_QUEUE_ID_MME_0_1 = 34, /* internal */
103 GAUDI_QUEUE_ID_MME_0_2 = 35, /* internal */
104 GAUDI_QUEUE_ID_MME_0_3 = 36, /* internal */
105 GAUDI_QUEUE_ID_MME_1_0 = 37, /* internal */
106 GAUDI_QUEUE_ID_MME_1_1 = 38, /* internal */
107 GAUDI_QUEUE_ID_MME_1_2 = 39, /* internal */
108 GAUDI_QUEUE_ID_MME_1_3 = 40, /* internal */
109 GAUDI_QUEUE_ID_TPC_0_0 = 41, /* internal */
110 GAUDI_QUEUE_ID_TPC_0_1 = 42, /* internal */
111 GAUDI_QUEUE_ID_TPC_0_2 = 43, /* internal */
112 GAUDI_QUEUE_ID_TPC_0_3 = 44, /* internal */
113 GAUDI_QUEUE_ID_TPC_1_0 = 45, /* internal */
114 GAUDI_QUEUE_ID_TPC_1_1 = 46, /* internal */
115 GAUDI_QUEUE_ID_TPC_1_2 = 47, /* internal */
116 GAUDI_QUEUE_ID_TPC_1_3 = 48, /* internal */
117 GAUDI_QUEUE_ID_TPC_2_0 = 49, /* internal */
118 GAUDI_QUEUE_ID_TPC_2_1 = 50, /* internal */
119 GAUDI_QUEUE_ID_TPC_2_2 = 51, /* internal */
120 GAUDI_QUEUE_ID_TPC_2_3 = 52, /* internal */
121 GAUDI_QUEUE_ID_TPC_3_0 = 53, /* internal */
122 GAUDI_QUEUE_ID_TPC_3_1 = 54, /* internal */
123 GAUDI_QUEUE_ID_TPC_3_2 = 55, /* internal */
124 GAUDI_QUEUE_ID_TPC_3_3 = 56, /* internal */
125 GAUDI_QUEUE_ID_TPC_4_0 = 57, /* internal */
126 GAUDI_QUEUE_ID_TPC_4_1 = 58, /* internal */
127 GAUDI_QUEUE_ID_TPC_4_2 = 59, /* internal */
128 GAUDI_QUEUE_ID_TPC_4_3 = 60, /* internal */
129 GAUDI_QUEUE_ID_TPC_5_0 = 61, /* internal */
130 GAUDI_QUEUE_ID_TPC_5_1 = 62, /* internal */
131 GAUDI_QUEUE_ID_TPC_5_2 = 63, /* internal */
132 GAUDI_QUEUE_ID_TPC_5_3 = 64, /* internal */
133 GAUDI_QUEUE_ID_TPC_6_0 = 65, /* internal */
134 GAUDI_QUEUE_ID_TPC_6_1 = 66, /* internal */
135 GAUDI_QUEUE_ID_TPC_6_2 = 67, /* internal */
136 GAUDI_QUEUE_ID_TPC_6_3 = 68, /* internal */
137 GAUDI_QUEUE_ID_TPC_7_0 = 69, /* internal */
138 GAUDI_QUEUE_ID_TPC_7_1 = 70, /* internal */
139 GAUDI_QUEUE_ID_TPC_7_2 = 71, /* internal */
140 GAUDI_QUEUE_ID_TPC_7_3 = 72, /* internal */
141 GAUDI_QUEUE_ID_NIC_0_0 = 73, /* internal */
142 GAUDI_QUEUE_ID_NIC_0_1 = 74, /* internal */
143 GAUDI_QUEUE_ID_NIC_0_2 = 75, /* internal */
144 GAUDI_QUEUE_ID_NIC_0_3 = 76, /* internal */
145 GAUDI_QUEUE_ID_NIC_1_0 = 77, /* internal */
146 GAUDI_QUEUE_ID_NIC_1_1 = 78, /* internal */
147 GAUDI_QUEUE_ID_NIC_1_2 = 79, /* internal */
148 GAUDI_QUEUE_ID_NIC_1_3 = 80, /* internal */
149 GAUDI_QUEUE_ID_NIC_2_0 = 81, /* internal */
150 GAUDI_QUEUE_ID_NIC_2_1 = 82, /* internal */
151 GAUDI_QUEUE_ID_NIC_2_2 = 83, /* internal */
152 GAUDI_QUEUE_ID_NIC_2_3 = 84, /* internal */
153 GAUDI_QUEUE_ID_NIC_3_0 = 85, /* internal */
154 GAUDI_QUEUE_ID_NIC_3_1 = 86, /* internal */
155 GAUDI_QUEUE_ID_NIC_3_2 = 87, /* internal */
156 GAUDI_QUEUE_ID_NIC_3_3 = 88, /* internal */
157 GAUDI_QUEUE_ID_NIC_4_0 = 89, /* internal */
158 GAUDI_QUEUE_ID_NIC_4_1 = 90, /* internal */
159 GAUDI_QUEUE_ID_NIC_4_2 = 91, /* internal */
160 GAUDI_QUEUE_ID_NIC_4_3 = 92, /* internal */
161 GAUDI_QUEUE_ID_NIC_5_0 = 93, /* internal */
162 GAUDI_QUEUE_ID_NIC_5_1 = 94, /* internal */
163 GAUDI_QUEUE_ID_NIC_5_2 = 95, /* internal */
164 GAUDI_QUEUE_ID_NIC_5_3 = 96, /* internal */
165 GAUDI_QUEUE_ID_NIC_6_0 = 97, /* internal */
166 GAUDI_QUEUE_ID_NIC_6_1 = 98, /* internal */
167 GAUDI_QUEUE_ID_NIC_6_2 = 99, /* internal */
168 GAUDI_QUEUE_ID_NIC_6_3 = 100, /* internal */
169 GAUDI_QUEUE_ID_NIC_7_0 = 101, /* internal */
170 GAUDI_QUEUE_ID_NIC_7_1 = 102, /* internal */
171 GAUDI_QUEUE_ID_NIC_7_2 = 103, /* internal */
172 GAUDI_QUEUE_ID_NIC_7_3 = 104, /* internal */
173 GAUDI_QUEUE_ID_NIC_8_0 = 105, /* internal */
174 GAUDI_QUEUE_ID_NIC_8_1 = 106, /* internal */
175 GAUDI_QUEUE_ID_NIC_8_2 = 107, /* internal */
176 GAUDI_QUEUE_ID_NIC_8_3 = 108, /* internal */
177 GAUDI_QUEUE_ID_NIC_9_0 = 109, /* internal */
178 GAUDI_QUEUE_ID_NIC_9_1 = 110, /* internal */
179 GAUDI_QUEUE_ID_NIC_9_2 = 111, /* internal */
180 GAUDI_QUEUE_ID_NIC_9_3 = 112, /* internal */
181 GAUDI_QUEUE_ID_SIZE
182};
183
184/*
185 * Engine Numbering
186 *
187 * Used in the "busy_engines_mask" field in `struct hl_info_hw_idle'
188 */
189
190enum goya_engine_id {
191 GOYA_ENGINE_ID_DMA_0 = 0,
192 GOYA_ENGINE_ID_DMA_1,
193 GOYA_ENGINE_ID_DMA_2,
194 GOYA_ENGINE_ID_DMA_3,
195 GOYA_ENGINE_ID_DMA_4,
196 GOYA_ENGINE_ID_MME_0,
197 GOYA_ENGINE_ID_TPC_0,
198 GOYA_ENGINE_ID_TPC_1,
199 GOYA_ENGINE_ID_TPC_2,
200 GOYA_ENGINE_ID_TPC_3,
201 GOYA_ENGINE_ID_TPC_4,
202 GOYA_ENGINE_ID_TPC_5,
203 GOYA_ENGINE_ID_TPC_6,
204 GOYA_ENGINE_ID_TPC_7,
205 GOYA_ENGINE_ID_SIZE
206};
207
208enum gaudi_engine_id {
209 GAUDI_ENGINE_ID_DMA_0 = 0,
210 GAUDI_ENGINE_ID_DMA_1,
211 GAUDI_ENGINE_ID_DMA_2,
212 GAUDI_ENGINE_ID_DMA_3,
213 GAUDI_ENGINE_ID_DMA_4,
214 GAUDI_ENGINE_ID_DMA_5,
215 GAUDI_ENGINE_ID_DMA_6,
216 GAUDI_ENGINE_ID_DMA_7,
217 GAUDI_ENGINE_ID_MME_0,
218 GAUDI_ENGINE_ID_MME_1,
219 GAUDI_ENGINE_ID_MME_2,
220 GAUDI_ENGINE_ID_MME_3,
221 GAUDI_ENGINE_ID_TPC_0,
222 GAUDI_ENGINE_ID_TPC_1,
223 GAUDI_ENGINE_ID_TPC_2,
224 GAUDI_ENGINE_ID_TPC_3,
225 GAUDI_ENGINE_ID_TPC_4,
226 GAUDI_ENGINE_ID_TPC_5,
227 GAUDI_ENGINE_ID_TPC_6,
228 GAUDI_ENGINE_ID_TPC_7,
229 GAUDI_ENGINE_ID_NIC_0,
230 GAUDI_ENGINE_ID_NIC_1,
231 GAUDI_ENGINE_ID_NIC_2,
232 GAUDI_ENGINE_ID_NIC_3,
233 GAUDI_ENGINE_ID_NIC_4,
234 GAUDI_ENGINE_ID_NIC_5,
235 GAUDI_ENGINE_ID_NIC_6,
236 GAUDI_ENGINE_ID_NIC_7,
237 GAUDI_ENGINE_ID_NIC_8,
238 GAUDI_ENGINE_ID_NIC_9,
239 GAUDI_ENGINE_ID_SIZE
240};
241
242/*
243 * ASIC specific PLL index
244 *
245 * Used to retrieve in frequency info of different IPs via
246 * HL_INFO_PLL_FREQUENCY under HL_IOCTL_INFO IOCTL. The enums need to be
247 * used as an index in struct hl_pll_frequency_info
248 */
249
250enum hl_goya_pll_index {
251 HL_GOYA_CPU_PLL = 0,
252 HL_GOYA_IC_PLL,
253 HL_GOYA_MC_PLL,
254 HL_GOYA_MME_PLL,
255 HL_GOYA_PCI_PLL,
256 HL_GOYA_EMMC_PLL,
257 HL_GOYA_TPC_PLL,
258 HL_GOYA_PLL_MAX
259};
260
261enum hl_gaudi_pll_index {
262 HL_GAUDI_CPU_PLL = 0,
263 HL_GAUDI_PCI_PLL,
264 HL_GAUDI_SRAM_PLL,
265 HL_GAUDI_HBM_PLL,
266 HL_GAUDI_NIC_PLL,
267 HL_GAUDI_DMA_PLL,
268 HL_GAUDI_MESH_PLL,
269 HL_GAUDI_MME_PLL,
270 HL_GAUDI_TPC_PLL,
271 HL_GAUDI_IF_PLL,
272 HL_GAUDI_PLL_MAX
273};
274
275/**
276 * enum hl_device_status - Device status information.
277 * @HL_DEVICE_STATUS_OPERATIONAL: Device is operational.
278 * @HL_DEVICE_STATUS_IN_RESET: Device is currently during reset.
279 * @HL_DEVICE_STATUS_MALFUNCTION: Device is unusable.
280 * @HL_DEVICE_STATUS_NEEDS_RESET: Device needs reset because auto reset was disabled.
281 * @HL_DEVICE_STATUS_IN_DEVICE_CREATION: Device is operational but its creation is still in
282 * progress.
283 * @HL_DEVICE_STATUS_LAST: Last status.
284 */
285enum hl_device_status {
286 HL_DEVICE_STATUS_OPERATIONAL,
287 HL_DEVICE_STATUS_IN_RESET,
288 HL_DEVICE_STATUS_MALFUNCTION,
289 HL_DEVICE_STATUS_NEEDS_RESET,
290 HL_DEVICE_STATUS_IN_DEVICE_CREATION,
291 HL_DEVICE_STATUS_LAST = HL_DEVICE_STATUS_IN_DEVICE_CREATION
292};
293
294enum hl_server_type {
295 HL_SERVER_TYPE_UNKNOWN = 0,
296 HL_SERVER_GAUDI_HLS1 = 1,
297 HL_SERVER_GAUDI_HLS1H = 2,
298 HL_SERVER_GAUDI_TYPE1 = 3,
299 HL_SERVER_GAUDI_TYPE2 = 4
300};
301
302/* Opcode for management ioctl
303 *
304 * HW_IP_INFO - Receive information about different IP blocks in the
305 * device.
306 * HL_INFO_HW_EVENTS - Receive an array describing how many times each event
307 * occurred since the last hard reset.
308 * HL_INFO_DRAM_USAGE - Retrieve the dram usage inside the device and of the
309 * specific context. This is relevant only for devices
310 * where the dram is managed by the kernel driver
311 * HL_INFO_HW_IDLE - Retrieve information about the idle status of each
312 * internal engine.
313 * HL_INFO_DEVICE_STATUS - Retrieve the device's status. This opcode doesn't
314 * require an open context.
315 * HL_INFO_DEVICE_UTILIZATION - Retrieve the total utilization of the device
316 * over the last period specified by the user.
317 * The period can be between 100ms to 1s, in
318 * resolution of 100ms. The return value is a
319 * percentage of the utilization rate.
320 * HL_INFO_HW_EVENTS_AGGREGATE - Receive an array describing how many times each
321 * event occurred since the driver was loaded.
322 * HL_INFO_CLK_RATE - Retrieve the current and maximum clock rate
323 * of the device in MHz. The maximum clock rate is
324 * configurable via sysfs parameter
325 * HL_INFO_RESET_COUNT - Retrieve the counts of the soft and hard reset
326 * operations performed on the device since the last
327 * time the driver was loaded.
328 * HL_INFO_TIME_SYNC - Retrieve the device's time alongside the host's time
329 * for synchronization.
330 * HL_INFO_CS_COUNTERS - Retrieve command submission counters
331 * HL_INFO_PCI_COUNTERS - Retrieve PCI counters
332 * HL_INFO_CLK_THROTTLE_REASON - Retrieve clock throttling reason
333 * HL_INFO_SYNC_MANAGER - Retrieve sync manager info per dcore
334 * HL_INFO_TOTAL_ENERGY - Retrieve total energy consumption
335 * HL_INFO_PLL_FREQUENCY - Retrieve PLL frequency
336 * HL_INFO_OPEN_STATS - Retrieve info regarding recent device open calls
337 */
338#define HL_INFO_HW_IP_INFO 0
339#define HL_INFO_HW_EVENTS 1
340#define HL_INFO_DRAM_USAGE 2
341#define HL_INFO_HW_IDLE 3
342#define HL_INFO_DEVICE_STATUS 4
343#define HL_INFO_DEVICE_UTILIZATION 6
344#define HL_INFO_HW_EVENTS_AGGREGATE 7
345#define HL_INFO_CLK_RATE 8
346#define HL_INFO_RESET_COUNT 9
347#define HL_INFO_TIME_SYNC 10
348#define HL_INFO_CS_COUNTERS 11
349#define HL_INFO_PCI_COUNTERS 12
350#define HL_INFO_CLK_THROTTLE_REASON 13
351#define HL_INFO_SYNC_MANAGER 14
352#define HL_INFO_TOTAL_ENERGY 15
353#define HL_INFO_PLL_FREQUENCY 16
354#define HL_INFO_POWER 17
355#define HL_INFO_OPEN_STATS 18
356
357#define HL_INFO_VERSION_MAX_LEN 128
358#define HL_INFO_CARD_NAME_MAX_LEN 16
359
360/**
361 * struct hl_info_hw_ip_info - hardware information on various IPs in the ASIC
362 * @sram_base_address: The first SRAM physical base address that is free to be
363 * used by the user.
364 * @dram_base_address: The first DRAM virtual or physical base address that is
365 * free to be used by the user.
366 * @dram_size: The DRAM size that is available to the user.
367 * @sram_size: The SRAM size that is available to the user.
368 * @num_of_events: The number of events that can be received from the f/w. This
369 * is needed so the user can what is the size of the h/w events
370 * array he needs to pass to the kernel when he wants to fetch
371 * the event counters.
372 * @device_id: PCI device ID of the ASIC.
373 * @module_id: Module ID of the ASIC for mezzanine cards in servers
374 * (From OCP spec).
375 * @first_available_interrupt_id: The first available interrupt ID for the user
376 * to be used when it works with user interrupts.
377 * @server_type: Server type that the Gaudi ASIC is currently installed in.
378 * The value is according to enum hl_server_type
379 * @cpld_version: CPLD version on the board.
380 * @psoc_pci_pll_nr: PCI PLL NR value. Needed by the profiler in some ASICs.
381 * @psoc_pci_pll_nf: PCI PLL NF value. Needed by the profiler in some ASICs.
382 * @psoc_pci_pll_od: PCI PLL OD value. Needed by the profiler in some ASICs.
383 * @psoc_pci_pll_div_factor: PCI PLL DIV factor value. Needed by the profiler
384 * in some ASICs.
385 * @tpc_enabled_mask: Bit-mask that represents which TPCs are enabled. Relevant
386 * for Goya/Gaudi only.
387 * @dram_enabled: Whether the DRAM is enabled.
388 * @cpucp_version: The CPUCP f/w version.
389 * @card_name: The card name as passed by the f/w.
390 * @dram_page_size: The DRAM physical page size.
391 */
392struct hl_info_hw_ip_info {
393 __u64 sram_base_address;
394 __u64 dram_base_address;
395 __u64 dram_size;
396 __u32 sram_size;
397 __u32 num_of_events;
398 __u32 device_id;
399 __u32 module_id;
400 __u32 reserved;
401 __u16 first_available_interrupt_id;
402 __u16 server_type;
403 __u32 cpld_version;
404 __u32 psoc_pci_pll_nr;
405 __u32 psoc_pci_pll_nf;
406 __u32 psoc_pci_pll_od;
407 __u32 psoc_pci_pll_div_factor;
408 __u8 tpc_enabled_mask;
409 __u8 dram_enabled;
410 __u8 pad[2];
411 __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN];
412 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
413 __u64 reserved2;
414 __u64 dram_page_size;
415};
416
417struct hl_info_dram_usage {
418 __u64 dram_free_mem;
419 __u64 ctx_dram_mem;
420};
421
422#define HL_BUSY_ENGINES_MASK_EXT_SIZE 2
423
424struct hl_info_hw_idle {
425 __u32 is_idle;
426 /*
427 * Bitmask of busy engines.
428 * Bits definition is according to `enum <chip>_enging_id'.
429 */
430 __u32 busy_engines_mask;
431
432 /*
433 * Extended Bitmask of busy engines.
434 * Bits definition is according to `enum <chip>_enging_id'.
435 */
436 __u64 busy_engines_mask_ext[HL_BUSY_ENGINES_MASK_EXT_SIZE];
437};
438
439struct hl_info_device_status {
440 __u32 status;
441 __u32 pad;
442};
443
444struct hl_info_device_utilization {
445 __u32 utilization;
446 __u32 pad;
447};
448
449struct hl_info_clk_rate {
450 __u32 cur_clk_rate_mhz;
451 __u32 max_clk_rate_mhz;
452};
453
454struct hl_info_reset_count {
455 __u32 hard_reset_cnt;
456 __u32 soft_reset_cnt;
457};
458
459struct hl_info_time_sync {
460 __u64 device_time;
461 __u64 host_time;
462};
463
464/**
465 * struct hl_info_pci_counters - pci counters
466 * @rx_throughput: PCI rx throughput KBps
467 * @tx_throughput: PCI tx throughput KBps
468 * @replay_cnt: PCI replay counter
469 */
470struct hl_info_pci_counters {
471 __u64 rx_throughput;
472 __u64 tx_throughput;
473 __u64 replay_cnt;
474};
475
476#define HL_CLK_THROTTLE_POWER 0x1
477#define HL_CLK_THROTTLE_THERMAL 0x2
478
479/**
480 * struct hl_info_clk_throttle - clock throttling reason
481 * @clk_throttling_reason: each bit represents a clk throttling reason
482 */
483struct hl_info_clk_throttle {
484 __u32 clk_throttling_reason;
485};
486
487/**
488 * struct hl_info_energy - device energy information
489 * @total_energy_consumption: total device energy consumption
490 */
491struct hl_info_energy {
492 __u64 total_energy_consumption;
493};
494
495#define HL_PLL_NUM_OUTPUTS 4
496
497struct hl_pll_frequency_info {
498 __u16 output[HL_PLL_NUM_OUTPUTS];
499};
500
501/**
502 * struct hl_open_stats_info - device open statistics information
503 * @open_counter: ever growing counter, increased on each successful dev open
504 * @last_open_period_ms: duration (ms) device was open last time
505 */
506struct hl_open_stats_info {
507 __u64 open_counter;
508 __u64 last_open_period_ms;
509};
510
511/**
512 * struct hl_power_info - power information
513 * @power: power consumption
514 */
515struct hl_power_info {
516 __u64 power;
517};
518
519/**
520 * struct hl_info_sync_manager - sync manager information
521 * @first_available_sync_object: first available sob
522 * @first_available_monitor: first available monitor
523 * @first_available_cq: first available cq
524 */
525struct hl_info_sync_manager {
526 __u32 first_available_sync_object;
527 __u32 first_available_monitor;
528 __u32 first_available_cq;
529 __u32 reserved;
530};
531
532/**
533 * struct hl_info_cs_counters - command submission counters
534 * @total_out_of_mem_drop_cnt: total dropped due to memory allocation issue
535 * @ctx_out_of_mem_drop_cnt: context dropped due to memory allocation issue
536 * @total_parsing_drop_cnt: total dropped due to error in packet parsing
537 * @ctx_parsing_drop_cnt: context dropped due to error in packet parsing
538 * @total_queue_full_drop_cnt: total dropped due to queue full
539 * @ctx_queue_full_drop_cnt: context dropped due to queue full
540 * @total_device_in_reset_drop_cnt: total dropped due to device in reset
541 * @ctx_device_in_reset_drop_cnt: context dropped due to device in reset
542 * @total_max_cs_in_flight_drop_cnt: total dropped due to maximum CS in-flight
543 * @ctx_max_cs_in_flight_drop_cnt: context dropped due to maximum CS in-flight
544 * @total_validation_drop_cnt: total dropped due to validation error
545 * @ctx_validation_drop_cnt: context dropped due to validation error
546 */
547struct hl_info_cs_counters {
548 __u64 total_out_of_mem_drop_cnt;
549 __u64 ctx_out_of_mem_drop_cnt;
550 __u64 total_parsing_drop_cnt;
551 __u64 ctx_parsing_drop_cnt;
552 __u64 total_queue_full_drop_cnt;
553 __u64 ctx_queue_full_drop_cnt;
554 __u64 total_device_in_reset_drop_cnt;
555 __u64 ctx_device_in_reset_drop_cnt;
556 __u64 total_max_cs_in_flight_drop_cnt;
557 __u64 ctx_max_cs_in_flight_drop_cnt;
558 __u64 total_validation_drop_cnt;
559 __u64 ctx_validation_drop_cnt;
560};
561
562enum gaudi_dcores {
563 HL_GAUDI_WS_DCORE,
564 HL_GAUDI_WN_DCORE,
565 HL_GAUDI_EN_DCORE,
566 HL_GAUDI_ES_DCORE
567};
568
569/**
570 * struct hl_info_args - Main structure to retrieve device related information.
571 * @return_pointer: User space address of the relevant structure related to HL_INFO_* operation
572 * mentioned in @op.
573 * @return_size: Size of the structure used in @return_pointer, just like "size" in "snprintf", it
574 * limits how many bytes the kernel can write. For hw_events array, the size should be
575 * hl_info_hw_ip_info.num_of_events * sizeof(__u32).
576 * @op: Defines which type of information to be retrieved. Refer HL_INFO_* for details.
577 * @dcore_id: DCORE id for which the information is relevant (for Gaudi refer to enum gaudi_dcores).
578 * @ctx_id: Context ID of the user. Currently not in use.
579 * @period_ms: Period value, in milliseconds, for utilization rate in range 100ms - 1000ms in 100 ms
580 * resolution. Currently not in use.
581 * @pll_index: Index as defined in hl_<asic type>_pll_index enumeration.
582 * @pad: Padding to 64 bit.
583 */
584struct hl_info_args {
585 __u64 return_pointer;
586 __u32 return_size;
587 __u32 op;
588
589 union {
590 __u32 dcore_id;
591 __u32 ctx_id;
592 __u32 period_ms;
593 __u32 pll_index;
594 };
595
596 __u32 pad;
597};
598
599/* Opcode to create a new command buffer */
600#define HL_CB_OP_CREATE 0
601/* Opcode to destroy previously created command buffer */
602#define HL_CB_OP_DESTROY 1
603/* Opcode to retrieve information about a command buffer */
604#define HL_CB_OP_INFO 2
605
606/* 2MB minus 32 bytes for 2xMSG_PROT */
607#define HL_MAX_CB_SIZE (0x200000 - 32)
608
609/* Indicates whether the command buffer should be mapped to the device's MMU */
610#define HL_CB_FLAGS_MAP 0x1
611
612struct hl_cb_in {
613 /* Handle of CB or 0 if we want to create one */
614 __u64 cb_handle;
615 /* HL_CB_OP_* */
616 __u32 op;
617 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
618 * will be allocated, regardless of this parameter's value, is PAGE_SIZE
619 */
620 __u32 cb_size;
621 /* Context ID - Currently not in use */
622 __u32 ctx_id;
623 /* HL_CB_FLAGS_* */
624 __u32 flags;
625};
626
627struct hl_cb_out {
628 union {
629 /* Handle of CB */
630 __u64 cb_handle;
631
632 /* Information about CB */
633 struct {
634 /* Usage count of CB */
635 __u32 usage_cnt;
636 __u32 pad;
637 };
638 };
639};
640
641union hl_cb_args {
642 struct hl_cb_in in;
643 struct hl_cb_out out;
644};
645
646/* HL_CS_CHUNK_FLAGS_ values
647 *
648 * HL_CS_CHUNK_FLAGS_USER_ALLOC_CB:
649 * Indicates if the CB was allocated and mapped by userspace.
650 * User allocated CB is a command buffer allocated by the user, via malloc
651 * (or similar). After allocating the CB, the user invokes “memory ioctl”
652 * to map the user memory into a device virtual address. The user provides
653 * this address via the cb_handle field. The interface provides the
654 * ability to create a large CBs, Which aren’t limited to
655 * “HL_MAX_CB_SIZE”. Therefore, it increases the PCI-DMA queues
656 * throughput. This CB allocation method also reduces the use of Linux
657 * DMA-able memory pool. Which are limited and used by other Linux
658 * sub-systems.
659 */
660#define HL_CS_CHUNK_FLAGS_USER_ALLOC_CB 0x1
661
662/*
663 * This structure size must always be fixed to 64-bytes for backward
664 * compatibility
665 */
666struct hl_cs_chunk {
667 union {
668 /* For external queue, this represents a Handle of CB on the
669 * Host.
670 * For internal queue in Goya, this represents an SRAM or
671 * a DRAM address of the internal CB. In Gaudi, this might also
672 * represent a mapped host address of the CB.
673 *
674 * A mapped host address is in the device address space, after
675 * a host address was mapped by the device MMU.
676 */
677 __u64 cb_handle;
678
679 /* Relevant only when HL_CS_FLAGS_WAIT or
680 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
681 * This holds address of array of u64 values that contain
682 * signal CS sequence numbers. The wait described by
683 * this job will listen on all those signals
684 * (wait event per signal)
685 */
686 __u64 signal_seq_arr;
687
688 /*
689 * Relevant only when HL_CS_FLAGS_WAIT or
690 * HL_CS_FLAGS_COLLECTIVE_WAIT is set
691 * along with HL_CS_FLAGS_ENCAP_SIGNALS.
692 * This is the CS sequence which has the encapsulated signals.
693 */
694 __u64 encaps_signal_seq;
695 };
696
697 /* Index of queue to put the CB on */
698 __u32 queue_index;
699
700 union {
701 /*
702 * Size of command buffer with valid packets
703 * Can be smaller then actual CB size
704 */
705 __u32 cb_size;
706
707 /* Relevant only when HL_CS_FLAGS_WAIT or
708 * HL_CS_FLAGS_COLLECTIVE_WAIT is set.
709 * Number of entries in signal_seq_arr
710 */
711 __u32 num_signal_seq_arr;
712
713 /* Relevant only when HL_CS_FLAGS_WAIT or
714 * HL_CS_FLAGS_COLLECTIVE_WAIT is set along
715 * with HL_CS_FLAGS_ENCAP_SIGNALS
716 * This set the signals range that the user want to wait for
717 * out of the whole reserved signals range.
718 * e.g if the signals range is 20, and user don't want
719 * to wait for signal 8, so he set this offset to 7, then
720 * he call the API again with 9 and so on till 20.
721 */
722 __u32 encaps_signal_offset;
723 };
724
725 /* HL_CS_CHUNK_FLAGS_* */
726 __u32 cs_chunk_flags;
727
728 /* Relevant only when HL_CS_FLAGS_COLLECTIVE_WAIT is set.
729 * This holds the collective engine ID. The wait described by this job
730 * will sync with this engine and with all NICs before completion.
731 */
732 __u32 collective_engine_id;
733
734 /* Align structure to 64 bytes */
735 __u32 pad[10];
736};
737
738/* SIGNAL and WAIT/COLLECTIVE_WAIT flags are mutually exclusive */
739#define HL_CS_FLAGS_FORCE_RESTORE 0x1
740#define HL_CS_FLAGS_SIGNAL 0x2
741#define HL_CS_FLAGS_WAIT 0x4
742#define HL_CS_FLAGS_COLLECTIVE_WAIT 0x8
743#define HL_CS_FLAGS_TIMESTAMP 0x20
744#define HL_CS_FLAGS_STAGED_SUBMISSION 0x40
745#define HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 0x80
746#define HL_CS_FLAGS_STAGED_SUBMISSION_LAST 0x100
747#define HL_CS_FLAGS_CUSTOM_TIMEOUT 0x200
748#define HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT 0x400
749
750/*
751 * The encapsulated signals CS is merged into the existing CS ioctls.
752 * In order to use this feature need to follow the below procedure:
753 * 1. Reserve signals, set the CS type to HL_CS_FLAGS_RESERVE_SIGNALS_ONLY
754 * the output of this API will be the SOB offset from CFG_BASE.
755 * this address will be used to patch CB cmds to do the signaling for this
756 * SOB by incrementing it's value.
757 * for reverting the reservation use HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY
758 * CS type, note that this might fail if out-of-sync happened to the SOB
759 * value, in case other signaling request to the same SOB occurred between
760 * reserve-unreserve calls.
761 * 2. Use the staged CS to do the encapsulated signaling jobs.
762 * use HL_CS_FLAGS_STAGED_SUBMISSION and HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
763 * along with HL_CS_FLAGS_ENCAP_SIGNALS flag, and set encaps_signal_offset
764 * field. This offset allows app to wait on part of the reserved signals.
765 * 3. Use WAIT/COLLECTIVE WAIT CS along with HL_CS_FLAGS_ENCAP_SIGNALS flag
766 * to wait for the encapsulated signals.
767 */
768#define HL_CS_FLAGS_ENCAP_SIGNALS 0x800
769#define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000
770#define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000
771
772#define HL_CS_STATUS_SUCCESS 0
773
774#define HL_MAX_JOBS_PER_CS 512
775
776struct hl_cs_in {
777
778 /* this holds address of array of hl_cs_chunk for restore phase */
779 __u64 chunks_restore;
780
781 /* holds address of array of hl_cs_chunk for execution phase */
782 __u64 chunks_execute;
783
784 union {
785 /*
786 * Sequence number of a staged submission CS
787 * valid only if HL_CS_FLAGS_STAGED_SUBMISSION is set and
788 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST is unset.
789 */
790 __u64 seq;
791
792 /*
793 * Encapsulated signals handle id
794 * Valid for two flows:
795 * 1. CS with encapsulated signals:
796 * when HL_CS_FLAGS_STAGED_SUBMISSION and
797 * HL_CS_FLAGS_STAGED_SUBMISSION_FIRST
798 * and HL_CS_FLAGS_ENCAP_SIGNALS are set.
799 * 2. unreserve signals:
800 * valid when HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY is set.
801 */
802 __u32 encaps_sig_handle_id;
803
804 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
805 struct {
806 /* Encapsulated signals number */
807 __u32 encaps_signals_count;
808
809 /* Encapsulated signals queue index (stream) */
810 __u32 encaps_signals_q_idx;
811 };
812 };
813
814 /* Number of chunks in restore phase array. Maximum number is
815 * HL_MAX_JOBS_PER_CS
816 */
817 __u32 num_chunks_restore;
818
819 /* Number of chunks in execution array. Maximum number is
820 * HL_MAX_JOBS_PER_CS
821 */
822 __u32 num_chunks_execute;
823
824 /* timeout in seconds - valid only if HL_CS_FLAGS_CUSTOM_TIMEOUT
825 * is set
826 */
827 __u32 timeout;
828
829 /* HL_CS_FLAGS_* */
830 __u32 cs_flags;
831
832 /* Context ID - Currently not in use */
833 __u32 ctx_id;
834};
835
836struct hl_cs_out {
837 union {
838 /*
839 * seq holds the sequence number of the CS to pass to wait
840 * ioctl. All values are valid except for 0 and ULLONG_MAX
841 */
842 __u64 seq;
843
844 /* Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set */
845 struct {
846 /* This is the resereved signal handle id */
847 __u32 handle_id;
848
849 /* This is the signals count */
850 __u32 count;
851 };
852 };
853
854 /* HL_CS_STATUS */
855 __u32 status;
856
857 /*
858 * SOB base address offset
859 * Valid only when HL_CS_FLAGS_RESERVE_SIGNALS_ONLY is set
860 */
861 __u32 sob_base_addr_offset;
862};
863
864union hl_cs_args {
865 struct hl_cs_in in;
866 struct hl_cs_out out;
867};
868
869#define HL_WAIT_CS_FLAGS_INTERRUPT 0x2
870#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
871#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
872
873#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
874
875struct hl_wait_cs_in {
876 union {
877 struct {
878 /*
879 * In case of wait_cs holds the CS sequence number.
880 * In case of wait for multi CS hold a user pointer to
881 * an array of CS sequence numbers
882 */
883 __u64 seq;
884 /* Absolute timeout to wait for command submission
885 * in microseconds
886 */
887 __u64 timeout_us;
888 };
889
890 struct {
891 /* User address for completion comparison.
892 * upon interrupt, driver will compare the value pointed
893 * by this address with the supplied target value.
894 * in order not to perform any comparison, set address
895 * to all 1s.
896 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
897 */
898 __u64 addr;
899 /* Target value for completion comparison */
900 __u64 target;
901 };
902 };
903
904 /* Context ID - Currently not in use */
905 __u32 ctx_id;
906
907 /* HL_WAIT_CS_FLAGS_*
908 * If HL_WAIT_CS_FLAGS_INTERRUPT is set, this field should include
909 * interrupt id according to HL_WAIT_CS_FLAGS_INTERRUPT_MASK, in order
910 * not to specify an interrupt id ,set mask to all 1s.
911 */
912 __u32 flags;
913
914 /* Multi CS API info- valid entries in multi-CS array */
915 __u8 seq_arr_len;
916 __u8 pad[3];
917
918 /* Absolute timeout to wait for an interrupt in microseconds.
919 * Relevant only when HL_WAIT_CS_FLAGS_INTERRUPT is set
920 */
921 __u32 interrupt_timeout_us;
922};
923
924#define HL_WAIT_CS_STATUS_COMPLETED 0
925#define HL_WAIT_CS_STATUS_BUSY 1
926#define HL_WAIT_CS_STATUS_TIMEDOUT 2
927#define HL_WAIT_CS_STATUS_ABORTED 3
928
929#define HL_WAIT_CS_STATUS_FLAG_GONE 0x1
930#define HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD 0x2
931
932struct hl_wait_cs_out {
933 /* HL_WAIT_CS_STATUS_* */
934 __u32 status;
935 /* HL_WAIT_CS_STATUS_FLAG* */
936 __u32 flags;
937 /*
938 * valid only if HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD is set
939 * for wait_cs: timestamp of CS completion
940 * for wait_multi_cs: timestamp of FIRST CS completion
941 */
942 __s64 timestamp_nsec;
943 /* multi CS completion bitmap */
944 __u32 cs_completion_map;
945 __u32 pad;
946};
947
948union hl_wait_cs_args {
949 struct hl_wait_cs_in in;
950 struct hl_wait_cs_out out;
951};
952
953/* Opcode to allocate device memory */
954#define HL_MEM_OP_ALLOC 0
955/* Opcode to free previously allocated device memory */
956#define HL_MEM_OP_FREE 1
957/* Opcode to map host and device memory */
958#define HL_MEM_OP_MAP 2
959/* Opcode to unmap previously mapped host and device memory */
960#define HL_MEM_OP_UNMAP 3
961/* Opcode to map a hw block */
962#define HL_MEM_OP_MAP_BLOCK 4
963/* Opcode to create DMA-BUF object for an existing device memory allocation
964 * and to export an FD of that DMA-BUF back to the caller
965 */
966#define HL_MEM_OP_EXPORT_DMABUF_FD 5
967
968/* Memory flags */
969#define HL_MEM_CONTIGUOUS 0x1
970#define HL_MEM_SHARED 0x2
971#define HL_MEM_USERPTR 0x4
972#define HL_MEM_FORCE_HINT 0x8
973
974struct hl_mem_in {
975 union {
976 /* HL_MEM_OP_ALLOC- allocate device memory */
977 struct {
978 /* Size to alloc */
979 __u64 mem_size;
980 } alloc;
981
982 /* HL_MEM_OP_FREE - free device memory */
983 struct {
984 /* Handle returned from HL_MEM_OP_ALLOC */
985 __u64 handle;
986 } free;
987
988 /* HL_MEM_OP_MAP - map device memory */
989 struct {
990 /*
991 * Requested virtual address of mapped memory.
992 * The driver will try to map the requested region to
993 * this hint address, as long as the address is valid
994 * and not already mapped. The user should check the
995 * returned address of the IOCTL to make sure he got
996 * the hint address. Passing 0 here means that the
997 * driver will choose the address itself.
998 */
999 __u64 hint_addr;
1000 /* Handle returned from HL_MEM_OP_ALLOC */
1001 __u64 handle;
1002 } map_device;
1003
1004 /* HL_MEM_OP_MAP - map host memory */
1005 struct {
1006 /* Address of allocated host memory */
1007 __u64 host_virt_addr;
1008 /*
1009 * Requested virtual address of mapped memory.
1010 * The driver will try to map the requested region to
1011 * this hint address, as long as the address is valid
1012 * and not already mapped. The user should check the
1013 * returned address of the IOCTL to make sure he got
1014 * the hint address. Passing 0 here means that the
1015 * driver will choose the address itself.
1016 */
1017 __u64 hint_addr;
1018 /* Size of allocated host memory */
1019 __u64 mem_size;
1020 } map_host;
1021
1022 /* HL_MEM_OP_MAP_BLOCK - map a hw block */
1023 struct {
1024 /*
1025 * HW block address to map, a handle and size will be
1026 * returned to the user and will be used to mmap the
1027 * relevant block. Only addresses from configuration
1028 * space are allowed.
1029 */
1030 __u64 block_addr;
1031 } map_block;
1032
1033 /* HL_MEM_OP_UNMAP - unmap host memory */
1034 struct {
1035 /* Virtual address returned from HL_MEM_OP_MAP */
1036 __u64 device_virt_addr;
1037 } unmap;
1038
1039 /* HL_MEM_OP_EXPORT_DMABUF_FD */
1040 struct {
1041 /* Handle returned from HL_MEM_OP_ALLOC. In Gaudi,
1042 * where we don't have MMU for the device memory, the
1043 * driver expects a physical address (instead of
1044 * a handle) in the device memory space.
1045 */
1046 __u64 handle;
1047 /* Size of memory allocation. Relevant only for GAUDI */
1048 __u64 mem_size;
1049 } export_dmabuf_fd;
1050 };
1051
1052 /* HL_MEM_OP_* */
1053 __u32 op;
1054 /* HL_MEM_* flags.
1055 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the
1056 * DMA-BUF file/FD flags.
1057 */
1058 __u32 flags;
1059 /* Context ID - Currently not in use */
1060 __u32 ctx_id;
1061 __u32 pad;
1062};
1063
1064struct hl_mem_out {
1065 union {
1066 /*
1067 * Used for HL_MEM_OP_MAP as the virtual address that was
1068 * assigned in the device VA space.
1069 * A value of 0 means the requested operation failed.
1070 */
1071 __u64 device_virt_addr;
1072
1073 /*
1074 * Used in HL_MEM_OP_ALLOC
1075 * This is the assigned handle for the allocated memory
1076 */
1077 __u64 handle;
1078
1079 struct {
1080 /*
1081 * Used in HL_MEM_OP_MAP_BLOCK.
1082 * This is the assigned handle for the mapped block
1083 */
1084 __u64 block_handle;
1085
1086 /*
1087 * Used in HL_MEM_OP_MAP_BLOCK
1088 * This is the size of the mapped block
1089 */
1090 __u32 block_size;
1091
1092 __u32 pad;
1093 };
1094
1095 /* Returned in HL_MEM_OP_EXPORT_DMABUF_FD. Represents the
1096 * DMA-BUF object that was created to describe a memory
1097 * allocation on the device's memory space. The FD should be
1098 * passed to the importer driver
1099 */
1100 __s32 fd;
1101 };
1102};
1103
1104union hl_mem_args {
1105 struct hl_mem_in in;
1106 struct hl_mem_out out;
1107};
1108
1109#define HL_DEBUG_MAX_AUX_VALUES 10
1110
1111struct hl_debug_params_etr {
1112 /* Address in memory to allocate buffer */
1113 __u64 buffer_address;
1114
1115 /* Size of buffer to allocate */
1116 __u64 buffer_size;
1117
1118 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1119 __u32 sink_mode;
1120 __u32 pad;
1121};
1122
1123struct hl_debug_params_etf {
1124 /* Address in memory to allocate buffer */
1125 __u64 buffer_address;
1126
1127 /* Size of buffer to allocate */
1128 __u64 buffer_size;
1129
1130 /* Sink operation mode: SW fifo, HW fifo, Circular buffer */
1131 __u32 sink_mode;
1132 __u32 pad;
1133};
1134
1135struct hl_debug_params_stm {
1136 /* Two bit masks for HW event and Stimulus Port */
1137 __u64 he_mask;
1138 __u64 sp_mask;
1139
1140 /* Trace source ID */
1141 __u32 id;
1142
1143 /* Frequency for the timestamp register */
1144 __u32 frequency;
1145};
1146
1147struct hl_debug_params_bmon {
1148 /* Two address ranges that the user can request to filter */
1149 __u64 start_addr0;
1150 __u64 addr_mask0;
1151
1152 __u64 start_addr1;
1153 __u64 addr_mask1;
1154
1155 /* Capture window configuration */
1156 __u32 bw_win;
1157 __u32 win_capture;
1158
1159 /* Trace source ID */
1160 __u32 id;
1161 __u32 pad;
1162};
1163
1164struct hl_debug_params_spmu {
1165 /* Event types selection */
1166 __u64 event_types[HL_DEBUG_MAX_AUX_VALUES];
1167
1168 /* Number of event types selection */
1169 __u32 event_types_num;
1170 __u32 pad;
1171};
1172
1173/* Opcode for ETR component */
1174#define HL_DEBUG_OP_ETR 0
1175/* Opcode for ETF component */
1176#define HL_DEBUG_OP_ETF 1
1177/* Opcode for STM component */
1178#define HL_DEBUG_OP_STM 2
1179/* Opcode for FUNNEL component */
1180#define HL_DEBUG_OP_FUNNEL 3
1181/* Opcode for BMON component */
1182#define HL_DEBUG_OP_BMON 4
1183/* Opcode for SPMU component */
1184#define HL_DEBUG_OP_SPMU 5
1185/* Opcode for timestamp (deprecated) */
1186#define HL_DEBUG_OP_TIMESTAMP 6
1187/* Opcode for setting the device into or out of debug mode. The enable
1188 * variable should be 1 for enabling debug mode and 0 for disabling it
1189 */
1190#define HL_DEBUG_OP_SET_MODE 7
1191
1192struct hl_debug_args {
1193 /*
1194 * Pointer to user input structure.
1195 * This field is relevant to specific opcodes.
1196 */
1197 __u64 input_ptr;
1198 /* Pointer to user output structure */
1199 __u64 output_ptr;
1200 /* Size of user input structure */
1201 __u32 input_size;
1202 /* Size of user output structure */
1203 __u32 output_size;
1204 /* HL_DEBUG_OP_* */
1205 __u32 op;
1206 /*
1207 * Register index in the component, taken from the debug_regs_index enum
1208 * in the various ASIC header files
1209 */
1210 __u32 reg_idx;
1211 /* Enable/disable */
1212 __u32 enable;
1213 /* Context ID - Currently not in use */
1214 __u32 ctx_id;
1215};
1216
1217/*
1218 * Various information operations such as:
1219 * - H/W IP information
1220 * - Current dram usage
1221 *
1222 * The user calls this IOCTL with an opcode that describes the required
1223 * information. The user should supply a pointer to a user-allocated memory
1224 * chunk, which will be filled by the driver with the requested information.
1225 *
1226 * The user supplies the maximum amount of size to copy into the user's memory,
1227 * in order to prevent data corruption in case of differences between the
1228 * definitions of structures in kernel and userspace, e.g. in case of old
1229 * userspace and new kernel driver
1230 */
1231#define HL_IOCTL_INFO \
1232 _IOWR('H', 0x01, struct hl_info_args)
1233
1234/*
1235 * Command Buffer
1236 * - Request a Command Buffer
1237 * - Destroy a Command Buffer
1238 *
1239 * The command buffers are memory blocks that reside in DMA-able address
1240 * space and are physically contiguous so they can be accessed by the device
1241 * directly. They are allocated using the coherent DMA API.
1242 *
1243 * When creating a new CB, the IOCTL returns a handle of it, and the user-space
1244 * process needs to use that handle to mmap the buffer so it can access them.
1245 *
1246 * In some instances, the device must access the command buffer through the
1247 * device's MMU, and thus its memory should be mapped. In these cases, user can
1248 * indicate the driver that such a mapping is required.
1249 * The resulting device virtual address will be used internally by the driver,
1250 * and won't be returned to user.
1251 *
1252 */
1253#define HL_IOCTL_CB \
1254 _IOWR('H', 0x02, union hl_cb_args)
1255
1256/*
1257 * Command Submission
1258 *
1259 * To submit work to the device, the user need to call this IOCTL with a set
1260 * of JOBS. That set of JOBS constitutes a CS object.
1261 * Each JOB will be enqueued on a specific queue, according to the user's input.
1262 * There can be more then one JOB per queue.
1263 *
1264 * The CS IOCTL will receive two sets of JOBS. One set is for "restore" phase
1265 * and a second set is for "execution" phase.
1266 * The JOBS on the "restore" phase are enqueued only after context-switch
1267 * (or if its the first CS for this context). The user can also order the
1268 * driver to run the "restore" phase explicitly
1269 *
1270 * There are two types of queues - external and internal. External queues
1271 * are DMA queues which transfer data from/to the Host. All other queues are
1272 * internal. The driver will get completion notifications from the device only
1273 * on JOBS which are enqueued in the external queues.
1274 *
1275 * For jobs on external queues, the user needs to create command buffers
1276 * through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on
1277 * internal queues, the user needs to prepare a "command buffer" with packets
1278 * on either the device SRAM/DRAM or the host, and give the device address of
1279 * that buffer to the CS ioctl.
1280 *
1281 * This IOCTL is asynchronous in regard to the actual execution of the CS. This
1282 * means it returns immediately after ALL the JOBS were enqueued on their
1283 * relevant queues. Therefore, the user mustn't assume the CS has been completed
1284 * or has even started to execute.
1285 *
1286 * Upon successful enqueue, the IOCTL returns a sequence number which the user
1287 * can use with the "Wait for CS" IOCTL to check whether the handle's CS
1288 * external JOBS have been completed. Note that if the CS has internal JOBS
1289 * which can execute AFTER the external JOBS have finished, the driver might
1290 * report that the CS has finished executing BEFORE the internal JOBS have
1291 * actually finished executing.
1292 *
1293 * Even though the sequence number increments per CS, the user can NOT
1294 * automatically assume that if CS with sequence number N finished, then CS
1295 * with sequence number N-1 also finished. The user can make this assumption if
1296 * and only if CS N and CS N-1 are exactly the same (same CBs for the same
1297 * queues).
1298 */
1299#define HL_IOCTL_CS \
1300 _IOWR('H', 0x03, union hl_cs_args)
1301
1302/*
1303 * Wait for Command Submission
1304 *
1305 * The user can call this IOCTL with a handle it received from the CS IOCTL
1306 * to wait until the handle's CS has finished executing. The user will wait
1307 * inside the kernel until the CS has finished or until the user-requested
1308 * timeout has expired.
1309 *
1310 * If the timeout value is 0, the driver won't sleep at all. It will check
1311 * the status of the CS and return immediately
1312 *
1313 * The return value of the IOCTL is a standard Linux error code. The possible
1314 * values are:
1315 *
1316 * EINTR - Kernel waiting has been interrupted, e.g. due to OS signal
1317 * that the user process received
1318 * ETIMEDOUT - The CS has caused a timeout on the device
1319 * EIO - The CS was aborted (usually because the device was reset)
1320 * ENODEV - The device wants to do hard-reset (so user need to close FD)
1321 *
1322 * The driver also returns a custom define in case the IOCTL call returned 0.
1323 * The define can be one of the following:
1324 *
1325 * HL_WAIT_CS_STATUS_COMPLETED - The CS has been completed successfully (0)
1326 * HL_WAIT_CS_STATUS_BUSY - The CS is still executing (0)
1327 * HL_WAIT_CS_STATUS_TIMEDOUT - The CS has caused a timeout on the device
1328 * (ETIMEDOUT)
1329 * HL_WAIT_CS_STATUS_ABORTED - The CS was aborted, usually because the
1330 * device was reset (EIO)
1331 */
1332
1333#define HL_IOCTL_WAIT_CS \
1334 _IOWR('H', 0x04, union hl_wait_cs_args)
1335
1336/*
1337 * Memory
1338 * - Map host memory to device MMU
1339 * - Unmap host memory from device MMU
1340 *
1341 * This IOCTL allows the user to map host memory to the device MMU
1342 *
1343 * For host memory, the IOCTL doesn't allocate memory. The user is supposed
1344 * to allocate the memory in user-space (malloc/new). The driver pins the
1345 * physical pages (up to the allowed limit by the OS), assigns a virtual
1346 * address in the device VA space and initializes the device MMU.
1347 *
1348 * There is an option for the user to specify the requested virtual address.
1349 *
1350 */
1351#define HL_IOCTL_MEMORY \
1352 _IOWR('H', 0x05, union hl_mem_args)
1353
1354/*
1355 * Debug
1356 * - Enable/disable the ETR/ETF/FUNNEL/STM/BMON/SPMU debug traces
1357 *
1358 * This IOCTL allows the user to get debug traces from the chip.
1359 *
1360 * Before the user can send configuration requests of the various
1361 * debug/profile engines, it needs to set the device into debug mode.
1362 * This is because the debug/profile infrastructure is shared component in the
1363 * device and we can't allow multiple users to access it at the same time.
1364 *
1365 * Once a user set the device into debug mode, the driver won't allow other
1366 * users to "work" with the device, i.e. open a FD. If there are multiple users
1367 * opened on the device, the driver won't allow any user to debug the device.
1368 *
1369 * For each configuration request, the user needs to provide the register index
1370 * and essential data such as buffer address and size.
1371 *
1372 * Once the user has finished using the debug/profile engines, he should
1373 * set the device into non-debug mode, i.e. disable debug mode.
1374 *
1375 * The driver can decide to "kick out" the user if he abuses this interface.
1376 *
1377 */
1378#define HL_IOCTL_DEBUG \
1379 _IOWR('H', 0x06, struct hl_debug_args)
1380
1381#define HL_COMMAND_START 0x01
1382#define HL_COMMAND_END 0x07
1383
1384#endif /* HABANALABS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/misc/uacce/hisi_qm.h+16-1
......@@ -14,11 +14,26 @@ struct hisi_qp_ctx {
1414 __u16 qc_type;
1515};
1616
17/**
18 * struct hisi_qp_info - User data for hisi qp.
19 * @sqe_size: Submission queue element size
20 * @sq_depth: The number of sqe
21 * @cq_depth: The number of cqe
22 * @reserved: Reserved data
23 */
24struct hisi_qp_info {
25 __u32 sqe_size;
26 __u16 sq_depth;
27 __u16 cq_depth;
28 __u64 reserved;
29};
30
1731#define HISI_QM_API_VER_BASE "hisi_qm_v1"
1832#define HISI_QM_API_VER2_BASE "hisi_qm_v2"
1933#define HISI_QM_API_VER3_BASE "hisi_qm_v3"
2034
2135/* UACCE_CMD_QM_SET_QP_CTX: Set qp algorithm type */
2236#define UACCE_CMD_QM_SET_QP_CTX _IOWR('H', 10, struct hisi_qp_ctx)
23
37/* UACCE_CMD_QM_SET_QP_INFO: Set qp depth and BD size */
38#define UACCE_CMD_QM_SET_QP_INFO _IOWR('H', 11, struct hisi_qp_info)
2439#endif
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/mtd-abi.h+61-7
......@@ -55,9 +55,9 @@ struct mtd_oob_buf64 {
5555 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
5656 * this mode implies %MTD_OPS_PLACE_OOB
5757 *
58 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
59 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
60 * %MTD_FILE_MODE_RAW.
58 * These modes can be passed to ioctl(MEMWRITE) and ioctl(MEMREAD); they are
59 * also used internally. See notes on "MTD file modes" for discussion on
60 * %MTD_OPS_RAW vs. %MTD_FILE_MODE_RAW.
6161 */
6262enum {
6363 MTD_OPS_PLACE_OOB = 0,
......@@ -69,8 +69,8 @@ enum {
6969 * struct mtd_write_req - data structure for requesting a write operation
7070 *
7171 * @start: start address
72 * @len: length of data buffer
73 * @ooblen: length of OOB buffer
72 * @len: length of data buffer (only lower 32 bits are used)
73 * @ooblen: length of OOB buffer (only lower 32 bits are used)
7474 * @usr_data: user-provided data buffer
7575 * @usr_oob: user-provided OOB buffer
7676 * @mode: MTD mode (see "MTD operation modes")
......@@ -91,6 +91,53 @@ struct mtd_write_req {
9191 __u8 padding[7];
9292};
9393
94/**
95 * struct mtd_read_req_ecc_stats - ECC statistics for a read operation
96 *
97 * @uncorrectable_errors: the number of uncorrectable errors that happened
98 * during the read operation
99 * @corrected_bitflips: the number of bitflips corrected during the read
100 * operation
101 * @max_bitflips: the maximum number of bitflips detected in any single ECC
102 * step for the data read during the operation; this information
103 * can be used to decide whether the data stored in a specific
104 * region of the MTD device should be moved somewhere else to
105 * avoid data loss.
106 */
107struct mtd_read_req_ecc_stats {
108 __u32 uncorrectable_errors;
109 __u32 corrected_bitflips;
110 __u32 max_bitflips;
111};
112
113/**
114 * struct mtd_read_req - data structure for requesting a read operation
115 *
116 * @start: start address
117 * @len: length of data buffer (only lower 32 bits are used)
118 * @ooblen: length of OOB buffer (only lower 32 bits are used)
119 * @usr_data: user-provided data buffer
120 * @usr_oob: user-provided OOB buffer
121 * @mode: MTD mode (see "MTD operation modes")
122 * @padding: reserved, must be set to 0
123 * @ecc_stats: ECC statistics for the read operation
124 *
125 * This structure supports ioctl(MEMREAD) operations, allowing data and/or OOB
126 * reads in various modes. To read from OOB-only, set @usr_data == NULL, and to
127 * read data-only, set @usr_oob == NULL. However, setting both @usr_data and
128 * @usr_oob to NULL is not allowed.
129 */
130struct mtd_read_req {
131 __u64 start;
132 __u64 len;
133 __u64 ooblen;
134 __u64 usr_data;
135 __u64 usr_oob;
136 __u8 mode;
137 __u8 padding[7];
138 struct mtd_read_req_ecc_stats ecc_stats;
139};
140
94141#define MTD_ABSENT 0
95142#define MTD_RAM 1
96143#define MTD_ROM 2
......@@ -207,6 +254,12 @@ struct otp_info {
207254#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
208255/* Erase a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
209256#define OTPERASE _IOW('M', 25, struct otp_info)
257/*
258 * Most generic read interface; can read in-band and/or out-of-band in various
259 * modes (see "struct mtd_read_req"). This ioctl is not supported for flashes
260 * without OOB, e.g., NOR flash.
261 */
262#define MEMREAD _IOWR('M', 26, struct mtd_read_req)
210263
211264/*
212265 * Obsolete legacy interface. Keep it in order not to break userspace
......@@ -270,8 +323,9 @@ struct mtd_ecc_stats {
270323 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
271324 * raw access to the flash, without error correction or autoplacement schemes.
272325 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
273 * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
274 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
326 * (e.g., when using ioctl(MEMWRITE) or ioctl(MEMREAD)), but in some cases, the
327 * MTD_FILE_MODE is used out of necessity (e.g., `write()',
328 * ioctl(MEMWRITEOOB64)).
275329 */
276330enum mtd_file_modes {
277331 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
lib/libc/include/any-linux-any/mtd/ubi-user.h+7-1
......@@ -247,6 +247,7 @@ enum {
247247 * @vid_hdr_offset: VID header offset (use defaults if %0)
248248 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
249249 * @padding: reserved for future, not used, has to be zeroed
250 * @disable_fm: whether disable fastmap
250251 *
251252 * This data structure is used to specify MTD device UBI has to attach and the
252253 * parameters it has to use. The number which should be assigned to the new UBI
......@@ -281,13 +282,18 @@ enum {
281282 * eraseblocks for new bad eraseblocks, but attempts to use available
282283 * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the
283284 * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used.
285 *
286 * If @disable_fm is not zero, ubi doesn't create new fastmap even the module
287 * param 'fm_autoconvert' is set, and existed old fastmap will be destroyed
288 * after doing full scanning.
284289 */
285290struct ubi_attach_req {
286291 __s32 ubi_num;
287292 __s32 mtd_num;
288293 __s32 vid_hdr_offset;
289294 __s16 max_beb_per1024;
290 __s8 padding[10];
295 __s8 disable_fm;
296 __s8 padding[9];
291297};
292298
293299/*
lib/libc/include/any-linux-any/rdma/efa-abi.h+3-1
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
22/*
3 * Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
3 * Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
44 */
55
66#ifndef EFA_ABI_USER_H
......@@ -54,6 +54,7 @@ struct efa_ibv_alloc_pd_resp {
5454
5555enum {
5656 EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
57 EFA_CREATE_CQ_WITH_SGID = 1 << 1,
5758};
5859
5960struct efa_ibv_create_cq {
......@@ -118,6 +119,7 @@ enum {
118119 EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
119120 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
120121 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
122 EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
121123};
122124
123125struct efa_ibv_ex_query_device_resp {
lib/libc/include/any-linux-any/rdma/erdma-abi.h created+49
......@@ -0,0 +1,49 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * Copyright (c) 2020-2022, Alibaba Group.
4 */
5
6#ifndef __ERDMA_USER_H__
7#define __ERDMA_USER_H__
8
9#include <linux/types.h>
10
11#define ERDMA_ABI_VERSION 1
12
13struct erdma_ureq_create_cq {
14 __aligned_u64 db_record_va;
15 __aligned_u64 qbuf_va;
16 __u32 qbuf_len;
17 __u32 rsvd0;
18};
19
20struct erdma_uresp_create_cq {
21 __u32 cq_id;
22 __u32 num_cqe;
23};
24
25struct erdma_ureq_create_qp {
26 __aligned_u64 db_record_va;
27 __aligned_u64 qbuf_va;
28 __u32 qbuf_len;
29 __u32 rsvd0;
30};
31
32struct erdma_uresp_create_qp {
33 __u32 qp_id;
34 __u32 num_sqe;
35 __u32 num_rqe;
36 __u32 rq_offset;
37};
38
39struct erdma_uresp_alloc_ctx {
40 __u32 dev_id;
41 __u32 pad;
42 __u32 sdb_type;
43 __u32 sdb_offset;
44 __aligned_u64 sdb;
45 __aligned_u64 rdb;
46 __aligned_u64 cdb;
47};
48
49#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/hfi/hfi1_user.h+1-1
......@@ -180,7 +180,7 @@ struct hfi1_sdma_comp_entry {
180180struct hfi1_status {
181181 __aligned_u64 dev; /* device/hw status bits */
182182 __aligned_u64 port; /* port state and status bits */
183 char freezemsg[0];
183 char freezemsg[];
184184};
185185
186186enum sdma_req_opcode {
lib/libc/include/any-linux-any/rdma/hns-abi.h+21
......@@ -77,10 +77,24 @@ enum hns_roce_qp_cap_flags {
7777 HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
7878 HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
7979 HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
80 HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5,
8081};
8182
8283struct hns_roce_ib_create_qp_resp {
8384 __aligned_u64 cap_flags;
85 __aligned_u64 dwqe_mmap_key;
86};
87
88enum {
89 HNS_ROCE_EXSGE_FLAGS = 1 << 0,
90 HNS_ROCE_RQ_INLINE_FLAGS = 1 << 1,
91 HNS_ROCE_CQE_INLINE_FLAGS = 1 << 2,
92};
93
94enum {
95 HNS_ROCE_RSP_EXSGE_FLAGS = 1 << 0,
96 HNS_ROCE_RSP_RQ_INLINE_FLAGS = 1 << 1,
97 HNS_ROCE_RSP_CQE_INLINE_FLAGS = 1 << 2,
8498};
8599
86100struct hns_roce_ib_alloc_ucontext_resp {
......@@ -88,6 +102,13 @@ struct hns_roce_ib_alloc_ucontext_resp {
88102 __u32 cqe_size;
89103 __u32 srq_tab_size;
90104 __u32 reserved;
105 __u32 config;
106 __u32 max_inline_data;
107};
108
109struct hns_roce_ib_alloc_ucontext {
110 __u32 config;
111 __u32 reserved;
91112};
92113
93114struct hns_roce_ib_alloc_pd_resp {
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_verbs.h+4
......@@ -57,6 +57,8 @@ enum ib_uverbs_access_flags {
5757 IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
5858 IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
5959 IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
60 IB_UVERBS_ACCESS_FLUSH_GLOBAL = 1 << 8,
61 IB_UVERBS_ACCESS_FLUSH_PERSISTENT = 1 << 9,
6062
6163 IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,
6264 IB_UVERBS_ACCESS_OPTIONAL_RANGE =
......@@ -250,6 +252,8 @@ enum rdma_driver_id {
250252 RDMA_DRIVER_QIB,
251253 RDMA_DRIVER_EFA,
252254 RDMA_DRIVER_SIW,
255 RDMA_DRIVER_ERDMA,
256 RDMA_DRIVER_MANA,
253257};
254258
255259enum ib_uverbs_gid_type {
lib/libc/include/any-linux-any/rdma/ib_user_verbs.h+99-36
......@@ -105,6 +105,18 @@ enum {
105105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
106106};
107107
108/* see IBA A19.4.1.1 Placement Types */
109enum ib_placement_type {
110 IB_FLUSH_GLOBAL = 1U << 0,
111 IB_FLUSH_PERSISTENT = 1U << 1,
112};
113
114/* see IBA A19.4.1.2 Selectivity Level */
115enum ib_selectivity_level {
116 IB_FLUSH_RANGE = 0,
117 IB_FLUSH_MR,
118};
119
108120/*
109121 * Make sure that all structs defined in this file remain laid out so
110122 * that they pack the same way on 32-bit and 64-bit architectures (to
......@@ -158,18 +170,18 @@ struct ib_uverbs_ex_cmd_hdr {
158170
159171struct ib_uverbs_get_context {
160172 __aligned_u64 response;
161 __aligned_u64 driver_data[0];
173 __aligned_u64 driver_data[];
162174};
163175
164176struct ib_uverbs_get_context_resp {
165177 __u32 async_fd;
166178 __u32 num_comp_vectors;
167 __aligned_u64 driver_data[0];
179 __aligned_u64 driver_data[];
168180};
169181
170182struct ib_uverbs_query_device {
171183 __aligned_u64 response;
172 __aligned_u64 driver_data[0];
184 __aligned_u64 driver_data[];
173185};
174186
175187struct ib_uverbs_query_device_resp {
......@@ -278,7 +290,7 @@ struct ib_uverbs_query_port {
278290 __aligned_u64 response;
279291 __u8 port_num;
280292 __u8 reserved[7];
281 __aligned_u64 driver_data[0];
293 __aligned_u64 driver_data[];
282294};
283295
284296struct ib_uverbs_query_port_resp {
......@@ -308,12 +320,12 @@ struct ib_uverbs_query_port_resp {
308320
309321struct ib_uverbs_alloc_pd {
310322 __aligned_u64 response;
311 __aligned_u64 driver_data[0];
323 __aligned_u64 driver_data[];
312324};
313325
314326struct ib_uverbs_alloc_pd_resp {
315327 __u32 pd_handle;
316 __u32 driver_data[0];
328 __u32 driver_data[];
317329};
318330
319331struct ib_uverbs_dealloc_pd {
......@@ -324,12 +336,12 @@ struct ib_uverbs_open_xrcd {
324336 __aligned_u64 response;
325337 __u32 fd;
326338 __u32 oflags;
327 __aligned_u64 driver_data[0];
339 __aligned_u64 driver_data[];
328340};
329341
330342struct ib_uverbs_open_xrcd_resp {
331343 __u32 xrcd_handle;
332 __u32 driver_data[0];
344 __u32 driver_data[];
333345};
334346
335347struct ib_uverbs_close_xrcd {
......@@ -343,14 +355,14 @@ struct ib_uverbs_reg_mr {
343355 __aligned_u64 hca_va;
344356 __u32 pd_handle;
345357 __u32 access_flags;
346 __aligned_u64 driver_data[0];
358 __aligned_u64 driver_data[];
347359};
348360
349361struct ib_uverbs_reg_mr_resp {
350362 __u32 mr_handle;
351363 __u32 lkey;
352364 __u32 rkey;
353 __u32 driver_data[0];
365 __u32 driver_data[];
354366};
355367
356368struct ib_uverbs_rereg_mr {
......@@ -362,13 +374,13 @@ struct ib_uverbs_rereg_mr {
362374 __aligned_u64 hca_va;
363375 __u32 pd_handle;
364376 __u32 access_flags;
365 __aligned_u64 driver_data[0];
377 __aligned_u64 driver_data[];
366378};
367379
368380struct ib_uverbs_rereg_mr_resp {
369381 __u32 lkey;
370382 __u32 rkey;
371 __aligned_u64 driver_data[0];
383 __aligned_u64 driver_data[];
372384};
373385
374386struct ib_uverbs_dereg_mr {
......@@ -380,13 +392,13 @@ struct ib_uverbs_alloc_mw {
380392 __u32 pd_handle;
381393 __u8 mw_type;
382394 __u8 reserved[3];
383 __aligned_u64 driver_data[0];
395 __aligned_u64 driver_data[];
384396};
385397
386398struct ib_uverbs_alloc_mw_resp {
387399 __u32 mw_handle;
388400 __u32 rkey;
389 __aligned_u64 driver_data[0];
401 __aligned_u64 driver_data[];
390402};
391403
392404struct ib_uverbs_dealloc_mw {
......@@ -408,7 +420,7 @@ struct ib_uverbs_create_cq {
408420 __u32 comp_vector;
409421 __s32 comp_channel;
410422 __u32 reserved;
411 __aligned_u64 driver_data[0];
423 __aligned_u64 driver_data[];
412424};
413425
414426enum ib_uverbs_ex_create_cq_flags {
......@@ -442,13 +454,13 @@ struct ib_uverbs_resize_cq {
442454 __aligned_u64 response;
443455 __u32 cq_handle;
444456 __u32 cqe;
445 __aligned_u64 driver_data[0];
457 __aligned_u64 driver_data[];
446458};
447459
448460struct ib_uverbs_resize_cq_resp {
449461 __u32 cqe;
450462 __u32 reserved;
451 __aligned_u64 driver_data[0];
463 __aligned_u64 driver_data[];
452464};
453465
454466struct ib_uverbs_poll_cq {
......@@ -466,6 +478,8 @@ enum ib_uverbs_wc_opcode {
466478 IB_UVERBS_WC_BIND_MW = 5,
467479 IB_UVERBS_WC_LOCAL_INV = 6,
468480 IB_UVERBS_WC_TSO = 7,
481 IB_UVERBS_WC_FLUSH = 8,
482 IB_UVERBS_WC_ATOMIC_WRITE = 9,
469483};
470484
471485struct ib_uverbs_wc {
......@@ -492,7 +506,7 @@ struct ib_uverbs_wc {
492506struct ib_uverbs_poll_cq_resp {
493507 __u32 count;
494508 __u32 reserved;
495 struct ib_uverbs_wc wc[0];
509 struct ib_uverbs_wc wc[];
496510};
497511
498512struct ib_uverbs_req_notify_cq {
......@@ -585,7 +599,7 @@ struct ib_uverbs_create_qp {
585599 __u8 qp_type;
586600 __u8 is_srq;
587601 __u8 reserved;
588 __aligned_u64 driver_data[0];
602 __aligned_u64 driver_data[];
589603};
590604
591605enum ib_uverbs_create_qp_mask {
......@@ -624,7 +638,7 @@ struct ib_uverbs_open_qp {
624638 __u32 qpn;
625639 __u8 qp_type;
626640 __u8 reserved[7];
627 __aligned_u64 driver_data[0];
641 __aligned_u64 driver_data[];
628642};
629643
630644/* also used for open response */
......@@ -669,7 +683,7 @@ struct ib_uverbs_query_qp {
669683 __aligned_u64 response;
670684 __u32 qp_handle;
671685 __u32 attr_mask;
672 __aligned_u64 driver_data[0];
686 __aligned_u64 driver_data[];
673687};
674688
675689struct ib_uverbs_query_qp_resp {
......@@ -703,7 +717,7 @@ struct ib_uverbs_query_qp_resp {
703717 __u8 alt_timeout;
704718 __u8 sq_sig_all;
705719 __u8 reserved[5];
706 __aligned_u64 driver_data[0];
720 __aligned_u64 driver_data[];
707721};
708722
709723struct ib_uverbs_modify_qp {
......@@ -784,6 +798,8 @@ enum ib_uverbs_wr_opcode {
784798 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
785799 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
786800 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
801 IB_UVERBS_WR_FLUSH = 14,
802 IB_UVERBS_WR_ATOMIC_WRITE = 15,
787803 /* Review enum ib_wr_opcode before modifying this */
788804};
789805
......@@ -824,7 +840,7 @@ struct ib_uverbs_post_send {
824840 __u32 wr_count;
825841 __u32 sge_count;
826842 __u32 wqe_size;
827 struct ib_uverbs_send_wr send_wr[0];
843 struct ib_uverbs_send_wr send_wr[];
828844};
829845
830846struct ib_uverbs_post_send_resp {
......@@ -843,7 +859,7 @@ struct ib_uverbs_post_recv {
843859 __u32 wr_count;
844860 __u32 sge_count;
845861 __u32 wqe_size;
846 struct ib_uverbs_recv_wr recv_wr[0];
862 struct ib_uverbs_recv_wr recv_wr[];
847863};
848864
849865struct ib_uverbs_post_recv_resp {
......@@ -856,7 +872,7 @@ struct ib_uverbs_post_srq_recv {
856872 __u32 wr_count;
857873 __u32 sge_count;
858874 __u32 wqe_size;
859 struct ib_uverbs_recv_wr recv[0];
875 struct ib_uverbs_recv_wr recv[];
860876};
861877
862878struct ib_uverbs_post_srq_recv_resp {
......@@ -869,12 +885,12 @@ struct ib_uverbs_create_ah {
869885 __u32 pd_handle;
870886 __u32 reserved;
871887 struct ib_uverbs_ah_attr attr;
872 __aligned_u64 driver_data[0];
888 __aligned_u64 driver_data[];
873889};
874890
875891struct ib_uverbs_create_ah_resp {
876892 __u32 ah_handle;
877 __u32 driver_data[0];
893 __u32 driver_data[];
878894};
879895
880896struct ib_uverbs_destroy_ah {
......@@ -886,7 +902,7 @@ struct ib_uverbs_attach_mcast {
886902 __u32 qp_handle;
887903 __u16 mlid;
888904 __u16 reserved;
889 __aligned_u64 driver_data[0];
905 __aligned_u64 driver_data[];
890906};
891907
892908struct ib_uverbs_detach_mcast {
......@@ -894,7 +910,7 @@ struct ib_uverbs_detach_mcast {
894910 __u32 qp_handle;
895911 __u16 mlid;
896912 __u16 reserved;
897 __aligned_u64 driver_data[0];
913 __aligned_u64 driver_data[];
898914};
899915
900916struct ib_uverbs_flow_spec_hdr {
......@@ -1135,7 +1151,7 @@ struct ib_uverbs_flow_attr {
11351151 * struct ib_flow_spec_xxx
11361152 * struct ib_flow_spec_yyy
11371153 */
1138 struct ib_uverbs_flow_spec_hdr flow_specs[0];
1154 struct ib_uverbs_flow_spec_hdr flow_specs[];
11391155};
11401156
11411157struct ib_uverbs_create_flow {
......@@ -1161,7 +1177,7 @@ struct ib_uverbs_create_srq {
11611177 __u32 max_wr;
11621178 __u32 max_sge;
11631179 __u32 srq_limit;
1164 __aligned_u64 driver_data[0];
1180 __aligned_u64 driver_data[];
11651181};
11661182
11671183struct ib_uverbs_create_xsrq {
......@@ -1175,7 +1191,7 @@ struct ib_uverbs_create_xsrq {
11751191 __u32 max_num_tags;
11761192 __u32 xrcd_handle;
11771193 __u32 cq_handle;
1178 __aligned_u64 driver_data[0];
1194 __aligned_u64 driver_data[];
11791195};
11801196
11811197struct ib_uverbs_create_srq_resp {
......@@ -1183,7 +1199,7 @@ struct ib_uverbs_create_srq_resp {
11831199 __u32 max_wr;
11841200 __u32 max_sge;
11851201 __u32 srqn;
1186 __u32 driver_data[0];
1202 __u32 driver_data[];
11871203};
11881204
11891205struct ib_uverbs_modify_srq {
......@@ -1191,14 +1207,14 @@ struct ib_uverbs_modify_srq {
11911207 __u32 attr_mask;
11921208 __u32 max_wr;
11931209 __u32 srq_limit;
1194 __aligned_u64 driver_data[0];
1210 __aligned_u64 driver_data[];
11951211};
11961212
11971213struct ib_uverbs_query_srq {
11981214 __aligned_u64 response;
11991215 __u32 srq_handle;
12001216 __u32 reserved;
1201 __aligned_u64 driver_data[0];
1217 __aligned_u64 driver_data[];
12021218};
12031219
12041220struct ib_uverbs_query_srq_resp {
......@@ -1269,7 +1285,7 @@ struct ib_uverbs_ex_create_rwq_ind_table {
12691285 * wq_handle1
12701286 * wq_handle2
12711287 */
1272 __u32 wq_handles[0];
1288 __u32 wq_handles[];
12731289};
12741290
12751291struct ib_uverbs_ex_create_rwq_ind_table_resp {
......@@ -1298,4 +1314,51 @@ struct ib_uverbs_ex_modify_cq {
12981314
12991315#define IB_DEVICE_NAME_MAX 64
13001316
1317/*
1318 * bits 9, 15, 16, 19, 22, 27, 30, 31, 32, 33, 35 and 37 may be set by old
1319 * kernels and should not be used.
1320 */
1321enum ib_uverbs_device_cap_flags {
1322 IB_UVERBS_DEVICE_RESIZE_MAX_WR = 1 << 0,
1323 IB_UVERBS_DEVICE_BAD_PKEY_CNTR = 1 << 1,
1324 IB_UVERBS_DEVICE_BAD_QKEY_CNTR = 1 << 2,
1325 IB_UVERBS_DEVICE_RAW_MULTI = 1 << 3,
1326 IB_UVERBS_DEVICE_AUTO_PATH_MIG = 1 << 4,
1327 IB_UVERBS_DEVICE_CHANGE_PHY_PORT = 1 << 5,
1328 IB_UVERBS_DEVICE_UD_AV_PORT_ENFORCE = 1 << 6,
1329 IB_UVERBS_DEVICE_CURR_QP_STATE_MOD = 1 << 7,
1330 IB_UVERBS_DEVICE_SHUTDOWN_PORT = 1 << 8,
1331 /* IB_UVERBS_DEVICE_INIT_TYPE = 1 << 9, (not in use) */
1332 IB_UVERBS_DEVICE_PORT_ACTIVE_EVENT = 1 << 10,
1333 IB_UVERBS_DEVICE_SYS_IMAGE_GUID = 1 << 11,
1334 IB_UVERBS_DEVICE_RC_RNR_NAK_GEN = 1 << 12,
1335 IB_UVERBS_DEVICE_SRQ_RESIZE = 1 << 13,
1336 IB_UVERBS_DEVICE_N_NOTIFY_CQ = 1 << 14,
1337 IB_UVERBS_DEVICE_MEM_WINDOW = 1 << 17,
1338 IB_UVERBS_DEVICE_UD_IP_CSUM = 1 << 18,
1339 IB_UVERBS_DEVICE_XRC = 1 << 20,
1340 IB_UVERBS_DEVICE_MEM_MGT_EXTENSIONS = 1 << 21,
1341 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2A = 1 << 23,
1342 IB_UVERBS_DEVICE_MEM_WINDOW_TYPE_2B = 1 << 24,
1343 IB_UVERBS_DEVICE_RC_IP_CSUM = 1 << 25,
1344 /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_IP_CSUM. */
1345 IB_UVERBS_DEVICE_RAW_IP_CSUM = 1 << 26,
1346 IB_UVERBS_DEVICE_MANAGED_FLOW_STEERING = 1 << 29,
1347 /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */
1348 IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34,
1349 IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36,
1350 /* Flush placement types */
1351 IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38,
1352 IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39,
1353 /* Atomic write attributes */
1354 IB_UVERBS_DEVICE_ATOMIC_WRITE = 1ULL << 40,
1355};
1356
1357enum ib_uverbs_raw_packet_caps {
1358 IB_UVERBS_RAW_PACKET_CAP_CVLAN_STRIPPING = 1 << 0,
1359 IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS = 1 << 1,
1360 IB_UVERBS_RAW_PACKET_CAP_IP_CSUM = 1 << 2,
1361 IB_UVERBS_RAW_PACKET_CAP_DELAY_DROP = 1 << 3,
1362};
1363
13011364#endif /* IB_USER_VERBS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mana-abi.h created+66
......@@ -0,0 +1,66 @@
1/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) */
2/*
3 * Copyright (c) 2022, Microsoft Corporation. All rights reserved.
4 */
5
6#ifndef MANA_ABI_USER_H
7#define MANA_ABI_USER_H
8
9#include <linux/types.h>
10#include <rdma/ib_user_ioctl_verbs.h>
11
12/*
13 * Increment this value if any changes that break userspace ABI
14 * compatibility are made.
15 */
16
17#define MANA_IB_UVERBS_ABI_VERSION 1
18
19struct mana_ib_create_cq {
20 __aligned_u64 buf_addr;
21};
22
23struct mana_ib_create_qp {
24 __aligned_u64 sq_buf_addr;
25 __u32 sq_buf_size;
26 __u32 port;
27};
28
29struct mana_ib_create_qp_resp {
30 __u32 sqid;
31 __u32 cqid;
32 __u32 tx_vp_offset;
33 __u32 reserved;
34};
35
36struct mana_ib_create_wq {
37 __aligned_u64 wq_buf_addr;
38 __u32 wq_buf_size;
39 __u32 reserved;
40};
41
42/* RX Hash function flags */
43enum mana_ib_rx_hash_function_flags {
44 MANA_IB_RX_HASH_FUNC_TOEPLITZ = 1 << 0,
45};
46
47struct mana_ib_create_qp_rss {
48 __aligned_u64 rx_hash_fields_mask;
49 __u8 rx_hash_function;
50 __u8 reserved[7];
51 __u32 rx_hash_key_len;
52 __u8 rx_hash_key[40];
53 __u32 port;
54};
55
56struct rss_resp_entry {
57 __u32 cqid;
58 __u32 wqid;
59};
60
61struct mana_ib_create_qp_rss_resp {
62 __aligned_u64 num_entries;
63 struct rss_resp_entry entries[64];
64};
65
66#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/mlx5-abi.h+1
......@@ -104,6 +104,7 @@ enum mlx5_ib_alloc_ucontext_resp_mask {
104104 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2,
105105 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS = 1UL << 3,
106106 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS = 1UL << 4,
107 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_MKEY_UPDATE_TAG = 1UL << 5,
107108};
108109
109110enum mlx5_user_cmds_supp_uhw {
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_cmds.h+19-1
......@@ -174,6 +174,7 @@ enum mlx5_ib_devx_umem_reg_attrs {
174174 MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
175175 MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
176176 MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP,
177 MLX5_IB_ATTR_DEVX_UMEM_REG_DMABUF_FD,
177178};
178179
179180enum mlx5_ib_devx_umem_dereg_attrs {
......@@ -228,6 +229,7 @@ enum mlx5_ib_objects {
228229 MLX5_IB_OBJECT_VAR,
229230 MLX5_IB_OBJECT_PP,
230231 MLX5_IB_OBJECT_UAR,
232 MLX5_IB_OBJECT_STEERING_ANCHOR,
231233};
232234
233235enum mlx5_ib_flow_matcher_create_attrs {
......@@ -248,11 +250,27 @@ enum mlx5_ib_flow_matcher_methods {
248250 MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
249251};
250252
253enum mlx5_ib_flow_steering_anchor_create_attrs {
254 MLX5_IB_ATTR_STEERING_ANCHOR_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
255 MLX5_IB_ATTR_STEERING_ANCHOR_FT_TYPE,
256 MLX5_IB_ATTR_STEERING_ANCHOR_PRIORITY,
257 MLX5_IB_ATTR_STEERING_ANCHOR_FT_ID,
258};
259
260enum mlx5_ib_flow_steering_anchor_destroy_attrs {
261 MLX5_IB_ATTR_STEERING_ANCHOR_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
262};
263
264enum mlx5_ib_steering_anchor_methods {
265 MLX5_IB_METHOD_STEERING_ANCHOR_CREATE = (1U << UVERBS_ID_NS_SHIFT),
266 MLX5_IB_METHOD_STEERING_ANCHOR_DESTROY,
267};
268
251269enum mlx5_ib_device_query_context_attrs {
252270 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),
253271};
254272
255#define MLX5_IB_DW_MATCH_PARAM 0x90
273#define MLX5_IB_DW_MATCH_PARAM 0xA0
256274
257275struct mlx5_ib_match_params {
258276 __u32 match_params[MLX5_IB_DW_MATCH_PARAM];
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_verbs.h+1
......@@ -63,6 +63,7 @@ enum mlx5_ib_uapi_dm_type {
6363 MLX5_IB_UAPI_DM_TYPE_MEMIC,
6464 MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM,
6565 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM,
66 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM,
6667};
6768
6869enum mlx5_ib_uapi_devx_create_event_channel_flags {
lib/libc/include/any-linux-any/rdma/rdma_user_cm.h+1-1
......@@ -184,7 +184,7 @@ struct rdma_ucm_query_addr_resp {
184184struct rdma_ucm_query_path_resp {
185185 __u32 num_paths;
186186 __u32 reserved;
187 struct ib_path_rec_data path_data[0];
187 struct ib_path_rec_data path_data[];
188188};
189189
190190struct rdma_ucm_conn_param {
lib/libc/include/any-linux-any/rdma/rdma_user_ioctl_cmds.h+1-1
......@@ -81,7 +81,7 @@ struct ib_uverbs_ioctl_hdr {
8181 __aligned_u64 reserved1;
8282 __u32 driver_id;
8383 __u32 reserved2;
84 struct ib_uverbs_attr attrs[0];
84 struct ib_uverbs_attr attrs[];
8585};
8686
8787#endif
\ No newline at end of file
lib/libc/include/any-linux-any/rdma/rdma_user_rxe.h+10-2
......@@ -74,7 +74,7 @@ struct rxe_av {
7474
7575struct rxe_send_wr {
7676 __aligned_u64 wr_id;
77 __u32 num_sge;
77 __u32 reserved;
7878 __u32 opcode;
7979 __u32 send_flags;
8080 union {
......@@ -82,6 +82,13 @@ struct rxe_send_wr {
8282 __u32 invalidate_rkey;
8383 } ex;
8484 union {
85 struct {
86 __aligned_u64 remote_addr;
87 __u32 length;
88 __u32 rkey;
89 __u8 type;
90 __u8 level;
91 } flush;
8592 struct {
8693 __aligned_u64 remote_addr;
8794 __u32 rkey;
......@@ -136,6 +143,7 @@ struct rxe_dma_info {
136143 __u32 reserved;
137144 union {
138145 __DECLARE_FLEX_ARRAY(__u8, inline_data);
146 __DECLARE_FLEX_ARRAY(__u8, atomic_wr);
139147 __DECLARE_FLEX_ARRAY(struct rxe_sge, sge);
140148 };
141149};
......@@ -156,7 +164,7 @@ struct rxe_send_wqe {
156164
157165struct rxe_recv_wqe {
158166 __aligned_u64 wr_id;
159 __u32 num_sge;
167 __u32 reserved;
160168 __u32 padding;
161169 struct rxe_dma_info dma;
162170};
lib/libc/include/any-linux-any/scsi/fc/fc_els.h+9-9
......@@ -264,7 +264,7 @@ struct fc_tlv_desc {
264264 * Size of descriptor excluding
265265 * desc_tag and desc_len fields.
266266 */
267 __u8 desc_value[0]; /* Descriptor Value */
267 __u8 desc_value[]; /* Descriptor Value */
268268};
269269
270270/* Descriptor tag and len fields are considered the mandatory header
......@@ -1027,7 +1027,7 @@ struct fc_fn_li_desc {
10271027 * threshold to caause the LI event
10281028 */
10291029 __be32 pname_count; /* number of portname_list elements */
1030 __be64 pname_list[0]; /* list of N_Port_Names accessible
1030 __be64 pname_list[]; /* list of N_Port_Names accessible
10311031 * through the attached port
10321032 */
10331033};
......@@ -1069,7 +1069,7 @@ struct fc_fn_peer_congn_desc {
10691069 * congestion event
10701070 */
10711071 __be32 pname_count; /* number of portname_list elements */
1072 __be64 pname_list[0]; /* list of N_Port_Names accessible
1072 __be64 pname_list[]; /* list of N_Port_Names accessible
10731073 * through the attached port
10741074 */
10751075};
......@@ -1104,7 +1104,7 @@ struct fc_els_fpin {
11041104 * Size of ELS excluding fpin_cmd,
11051105 * fpin_zero and desc_len fields.
11061106 */
1107 struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */
1107 struct fc_tlv_desc fpin_desc[]; /* Descriptor list */
11081108};
11091109
11101110/* Diagnostic Function Descriptor - FPIN Registration */
......@@ -1115,7 +1115,7 @@ struct fc_df_desc_fpin_reg {
11151115 * desc_tag and desc_len fields.
11161116 */
11171117 __be32 count; /* Number of desc_tags elements */
1118 __be32 desc_tags[0]; /* Array of Descriptor Tags.
1118 __be32 desc_tags[]; /* Array of Descriptor Tags.
11191119 * Each tag indicates a function
11201120 * supported by the N_Port (request)
11211121 * or by the N_Port and Fabric
......@@ -1135,7 +1135,7 @@ struct fc_els_rdf {
11351135 * Size of ELS excluding fpin_cmd,
11361136 * fpin_zero and desc_len fields.
11371137 */
1138 struct fc_tlv_desc desc[0]; /* Descriptor list */
1138 struct fc_tlv_desc desc[]; /* Descriptor list */
11391139};
11401140
11411141/*
......@@ -1148,7 +1148,7 @@ struct fc_els_rdf_resp {
11481148 * and desc_list_len fields.
11491149 */
11501150 struct fc_els_lsri_desc lsri;
1151 struct fc_tlv_desc desc[0]; /* Supported Descriptor list */
1151 struct fc_tlv_desc desc[]; /* Supported Descriptor list */
11521152};
11531153
11541154
......@@ -1231,7 +1231,7 @@ struct fc_els_edc {
12311231 * Size of ELS excluding edc_cmd,
12321232 * edc_zero and desc_len fields.
12331233 */
1234 struct fc_tlv_desc desc[0];
1234 struct fc_tlv_desc desc[];
12351235 /* Diagnostic Descriptor list */
12361236};
12371237
......@@ -1245,7 +1245,7 @@ struct fc_els_edc_resp {
12451245 * and desc_list_len fields.
12461246 */
12471247 struct fc_els_lsri_desc lsri;
1248 struct fc_tlv_desc desc[0];
1248 struct fc_tlv_desc desc[];
12491249 /* Supported Diagnostic Descriptor list */
12501250};
12511251
lib/libc/include/any-linux-any/scsi/scsi_bsg_fc.h+2-2
......@@ -209,14 +209,14 @@ struct fc_bsg_host_vendor {
209209 __u64 vendor_id;
210210
211211 /* start of vendor command area */
212 __u32 vendor_cmd[0];
212 __u32 vendor_cmd[];
213213};
214214
215215/* Response:
216216 */
217217struct fc_bsg_host_vendor_reply {
218218 /* start of vendor response area */
219 __u32 vendor_rsp[0];
219 __DECLARE_FLEX_ARRAY(__u32, vendor_rsp);
220220};
221221
222222
lib/libc/include/any-linux-any/scsi/scsi_bsg_mpi3mr.h created+576
......@@ -0,0 +1,576 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
2/*
3 * Driver for Broadcom MPI3 Storage Controllers
4 *
5 * Copyright (C) 2017-2022 Broadcom Inc.
6 * (mailto: mpi3mr-linuxdrv.pdl@broadcom.com)
7 *
8 */
9
10#ifndef SCSI_BSG_MPI3MR_H_INCLUDED
11#define SCSI_BSG_MPI3MR_H_INCLUDED
12
13#include <linux/types.h>
14
15/* Definitions for BSG commands */
16#define MPI3MR_IOCTL_VERSION 0x06
17
18#define MPI3MR_APP_DEFAULT_TIMEOUT (60) /*seconds*/
19
20#define MPI3MR_BSG_ADPTYPE_UNKNOWN 0
21#define MPI3MR_BSG_ADPTYPE_AVGFAMILY 1
22
23#define MPI3MR_BSG_ADPSTATE_UNKNOWN 0
24#define MPI3MR_BSG_ADPSTATE_OPERATIONAL 1
25#define MPI3MR_BSG_ADPSTATE_FAULT 2
26#define MPI3MR_BSG_ADPSTATE_IN_RESET 3
27#define MPI3MR_BSG_ADPSTATE_UNRECOVERABLE 4
28
29#define MPI3MR_BSG_ADPRESET_UNKNOWN 0
30#define MPI3MR_BSG_ADPRESET_SOFT 1
31#define MPI3MR_BSG_ADPRESET_DIAG_FAULT 2
32
33#define MPI3MR_BSG_LOGDATA_MAX_ENTRIES 400
34#define MPI3MR_BSG_LOGDATA_ENTRY_HEADER_SZ 4
35
36#define MPI3MR_DRVBSG_OPCODE_UNKNOWN 0
37#define MPI3MR_DRVBSG_OPCODE_ADPINFO 1
38#define MPI3MR_DRVBSG_OPCODE_ADPRESET 2
39#define MPI3MR_DRVBSG_OPCODE_ALLTGTDEVINFO 4
40#define MPI3MR_DRVBSG_OPCODE_GETCHGCNT 5
41#define MPI3MR_DRVBSG_OPCODE_LOGDATAENABLE 6
42#define MPI3MR_DRVBSG_OPCODE_PELENABLE 7
43#define MPI3MR_DRVBSG_OPCODE_GETLOGDATA 8
44#define MPI3MR_DRVBSG_OPCODE_QUERY_HDB 9
45#define MPI3MR_DRVBSG_OPCODE_REPOST_HDB 10
46#define MPI3MR_DRVBSG_OPCODE_UPLOAD_HDB 11
47#define MPI3MR_DRVBSG_OPCODE_REFRESH_HDB_TRIGGERS 12
48
49
50#define MPI3MR_BSG_BUFTYPE_UNKNOWN 0
51#define MPI3MR_BSG_BUFTYPE_RAIDMGMT_CMD 1
52#define MPI3MR_BSG_BUFTYPE_RAIDMGMT_RESP 2
53#define MPI3MR_BSG_BUFTYPE_DATA_IN 3
54#define MPI3MR_BSG_BUFTYPE_DATA_OUT 4
55#define MPI3MR_BSG_BUFTYPE_MPI_REPLY 5
56#define MPI3MR_BSG_BUFTYPE_ERR_RESPONSE 6
57#define MPI3MR_BSG_BUFTYPE_MPI_REQUEST 0xFE
58
59#define MPI3MR_BSG_MPI_REPLY_BUFTYPE_UNKNOWN 0
60#define MPI3MR_BSG_MPI_REPLY_BUFTYPE_STATUS 1
61#define MPI3MR_BSG_MPI_REPLY_BUFTYPE_ADDRESS 2
62
63#define MPI3MR_HDB_BUFTYPE_UNKNOWN 0
64#define MPI3MR_HDB_BUFTYPE_TRACE 1
65#define MPI3MR_HDB_BUFTYPE_FIRMWARE 2
66#define MPI3MR_HDB_BUFTYPE_RESERVED 3
67
68#define MPI3MR_HDB_BUFSTATUS_UNKNOWN 0
69#define MPI3MR_HDB_BUFSTATUS_NOT_ALLOCATED 1
70#define MPI3MR_HDB_BUFSTATUS_POSTED_UNPAUSED 2
71#define MPI3MR_HDB_BUFSTATUS_POSTED_PAUSED 3
72#define MPI3MR_HDB_BUFSTATUS_RELEASED 4
73
74#define MPI3MR_HDB_TRIGGER_TYPE_UNKNOWN 0
75#define MPI3MR_HDB_TRIGGER_TYPE_DIAGFAULT 1
76#define MPI3MR_HDB_TRIGGER_TYPE_ELEMENT 2
77#define MPI3MR_HDB_TRIGGER_TYPE_MASTER 3
78
79
80/* Supported BSG commands */
81enum command {
82 MPI3MR_DRV_CMD = 1,
83 MPI3MR_MPT_CMD = 2,
84};
85
86/**
87 * struct mpi3_driver_info_layout - Information about driver
88 *
89 * @information_length: Length of this structure in bytes
90 * @driver_signature: Driver Vendor name
91 * @os_name: Operating System Name
92 * @driver_name: Driver name
93 * @driver_version: Driver version
94 * @driver_release_date: Driver release date
95 * @driver_capabilities: Driver capabilities
96 */
97struct mpi3_driver_info_layout {
98 __le32 information_length;
99 __u8 driver_signature[12];
100 __u8 os_name[16];
101 __u8 os_version[12];
102 __u8 driver_name[20];
103 __u8 driver_version[32];
104 __u8 driver_release_date[20];
105 __le32 driver_capabilities;
106};
107
108/**
109 * struct mpi3mr_bsg_in_adpinfo - Adapter information request
110 * data returned by the driver.
111 *
112 * @adp_type: Adapter type
113 * @rsvd1: Reserved
114 * @pci_dev_id: PCI device ID of the adapter
115 * @pci_dev_hw_rev: PCI revision of the adapter
116 * @pci_subsys_dev_id: PCI subsystem device ID of the adapter
117 * @pci_subsys_ven_id: PCI subsystem vendor ID of the adapter
118 * @pci_dev: PCI device
119 * @pci_func: PCI function
120 * @pci_bus: PCI bus
121 * @rsvd2: Reserved
122 * @pci_seg_id: PCI segment ID
123 * @app_intfc_ver: version of the application interface definition
124 * @rsvd3: Reserved
125 * @rsvd4: Reserved
126 * @rsvd5: Reserved
127 * @driver_info: Driver Information (Version/Name)
128 */
129struct mpi3mr_bsg_in_adpinfo {
130 __u32 adp_type;
131 __u32 rsvd1;
132 __u32 pci_dev_id;
133 __u32 pci_dev_hw_rev;
134 __u32 pci_subsys_dev_id;
135 __u32 pci_subsys_ven_id;
136 __u32 pci_dev:5;
137 __u32 pci_func:3;
138 __u32 pci_bus:8;
139 __u16 rsvd2;
140 __u32 pci_seg_id;
141 __u32 app_intfc_ver;
142 __u8 adp_state;
143 __u8 rsvd3;
144 __u16 rsvd4;
145 __u32 rsvd5[2];
146 struct mpi3_driver_info_layout driver_info;
147};
148
149/**
150 * struct mpi3mr_bsg_adp_reset - Adapter reset request
151 * payload data to the driver.
152 *
153 * @reset_type: Reset type
154 * @rsvd1: Reserved
155 * @rsvd2: Reserved
156 */
157struct mpi3mr_bsg_adp_reset {
158 __u8 reset_type;
159 __u8 rsvd1;
160 __u16 rsvd2;
161};
162
163/**
164 * struct mpi3mr_change_count - Topology change count
165 * returned by the driver.
166 *
167 * @change_count: Topology change count
168 * @rsvd: Reserved
169 */
170struct mpi3mr_change_count {
171 __u16 change_count;
172 __u16 rsvd;
173};
174
175/**
176 * struct mpi3mr_device_map_info - Target device mapping
177 * information
178 *
179 * @handle: Firmware device handle
180 * @perst_id: Persistent ID assigned by the firmware
181 * @target_id: Target ID assigned by the driver
182 * @bus_id: Bus ID assigned by the driver
183 * @rsvd1: Reserved
184 * @rsvd2: Reserved
185 */
186struct mpi3mr_device_map_info {
187 __u16 handle;
188 __u16 perst_id;
189 __u32 target_id;
190 __u8 bus_id;
191 __u8 rsvd1;
192 __u16 rsvd2;
193};
194
195/**
196 * struct mpi3mr_all_tgt_info - Target device mapping
197 * information returned by the driver
198 *
199 * @num_devices: The number of devices in driver's inventory
200 * @rsvd1: Reserved
201 * @rsvd2: Reserved
202 * @dmi: Variable length array of mapping information of targets
203 */
204struct mpi3mr_all_tgt_info {
205 __u16 num_devices;
206 __u16 rsvd1;
207 __u32 rsvd2;
208 struct mpi3mr_device_map_info dmi[1];
209};
210
211/**
212 * struct mpi3mr_logdata_enable - Number of log data
213 * entries saved by the driver returned as payload data for
214 * enable logdata BSG request by the driver.
215 *
216 * @max_entries: Number of log data entries cached by the driver
217 * @rsvd: Reserved
218 */
219struct mpi3mr_logdata_enable {
220 __u16 max_entries;
221 __u16 rsvd;
222};
223
224/**
225 * struct mpi3mr_bsg_out_pel_enable - PEL enable request payload
226 * data to the driver.
227 *
228 * @pel_locale: PEL locale to the firmware
229 * @pel_class: PEL class to the firmware
230 * @rsvd: Reserved
231 */
232struct mpi3mr_bsg_out_pel_enable {
233 __u16 pel_locale;
234 __u8 pel_class;
235 __u8 rsvd;
236};
237
238/**
239 * struct mpi3mr_logdata_entry - Log data entry cached by the
240 * driver.
241 *
242 * @valid_entry: Is the entry valid
243 * @rsvd1: Reserved
244 * @rsvd2: Reserved
245 * @data: Variable length Log entry data
246 */
247struct mpi3mr_logdata_entry {
248 __u8 valid_entry;
249 __u8 rsvd1;
250 __u16 rsvd2;
251 __u8 data[1]; /* Variable length Array */
252};
253
254/**
255 * struct mpi3mr_bsg_in_log_data - Log data entries saved by
256 * the driver returned as payload data for Get logdata request
257 * by the driver.
258 *
259 * @entry: Variable length Log data entry array
260 */
261struct mpi3mr_bsg_in_log_data {
262 struct mpi3mr_logdata_entry entry[1];
263};
264
265/**
266 * struct mpi3mr_hdb_entry - host diag buffer entry.
267 *
268 * @buf_type: Buffer type
269 * @status: Buffer status
270 * @trigger_type: Trigger type
271 * @rsvd1: Reserved
272 * @size: Buffer size
273 * @rsvd2: Reserved
274 * @trigger_data: Trigger specific data
275 * @rsvd3: Reserved
276 * @rsvd4: Reserved
277 */
278struct mpi3mr_hdb_entry {
279 __u8 buf_type;
280 __u8 status;
281 __u8 trigger_type;
282 __u8 rsvd1;
283 __u16 size;
284 __u16 rsvd2;
285 __u64 trigger_data;
286 __u32 rsvd3;
287 __u32 rsvd4;
288};
289
290
291/**
292 * struct mpi3mr_bsg_in_hdb_status - This structure contains
293 * return data for the BSG request to retrieve the number of host
294 * diagnostic buffers supported by the driver and their current
295 * status and additional status specific data if any in forms of
296 * multiple hdb entries.
297 *
298 * @num_hdb_types: Number of host diag buffer types supported
299 * @rsvd1: Reserved
300 * @rsvd2: Reserved
301 * @rsvd3: Reserved
302 * @entry: Variable length Diag buffer status entry array
303 */
304struct mpi3mr_bsg_in_hdb_status {
305 __u8 num_hdb_types;
306 __u8 rsvd1;
307 __u16 rsvd2;
308 __u32 rsvd3;
309 struct mpi3mr_hdb_entry entry[1];
310};
311
312/**
313 * struct mpi3mr_bsg_out_repost_hdb - Repost host diagnostic
314 * buffer request payload data to the driver.
315 *
316 * @buf_type: Buffer type
317 * @rsvd1: Reserved
318 * @rsvd2: Reserved
319 */
320struct mpi3mr_bsg_out_repost_hdb {
321 __u8 buf_type;
322 __u8 rsvd1;
323 __u16 rsvd2;
324};
325
326/**
327 * struct mpi3mr_bsg_out_upload_hdb - Upload host diagnostic
328 * buffer request payload data to the driver.
329 *
330 * @buf_type: Buffer type
331 * @rsvd1: Reserved
332 * @rsvd2: Reserved
333 * @start_offset: Start offset of the buffer from where to copy
334 * @length: Length of the buffer to copy
335 */
336struct mpi3mr_bsg_out_upload_hdb {
337 __u8 buf_type;
338 __u8 rsvd1;
339 __u16 rsvd2;
340 __u32 start_offset;
341 __u32 length;
342};
343
344/**
345 * struct mpi3mr_bsg_out_refresh_hdb_triggers - Refresh host
346 * diagnostic buffer triggers request payload data to the driver.
347 *
348 * @page_type: Page type
349 * @rsvd1: Reserved
350 * @rsvd2: Reserved
351 */
352struct mpi3mr_bsg_out_refresh_hdb_triggers {
353 __u8 page_type;
354 __u8 rsvd1;
355 __u16 rsvd2;
356};
357/**
358 * struct mpi3mr_bsg_drv_cmd - Generic bsg data
359 * structure for all driver specific requests.
360 *
361 * @mrioc_id: Controller ID
362 * @opcode: Driver specific opcode
363 * @rsvd1: Reserved
364 * @rsvd2: Reserved
365 */
366struct mpi3mr_bsg_drv_cmd {
367 __u8 mrioc_id;
368 __u8 opcode;
369 __u16 rsvd1;
370 __u32 rsvd2[4];
371};
372/**
373 * struct mpi3mr_bsg_in_reply_buf - MPI reply buffer returned
374 * for MPI Passthrough request .
375 *
376 * @mpi_reply_type: Type of MPI reply
377 * @rsvd1: Reserved
378 * @rsvd2: Reserved
379 * @reply_buf: Variable Length buffer based on mpirep type
380 */
381struct mpi3mr_bsg_in_reply_buf {
382 __u8 mpi_reply_type;
383 __u8 rsvd1;
384 __u16 rsvd2;
385 __u8 reply_buf[1];
386};
387
388/**
389 * struct mpi3mr_buf_entry - User buffer descriptor for MPI
390 * Passthrough requests.
391 *
392 * @buf_type: Buffer type
393 * @rsvd1: Reserved
394 * @rsvd2: Reserved
395 * @buf_len: Buffer length
396 */
397struct mpi3mr_buf_entry {
398 __u8 buf_type;
399 __u8 rsvd1;
400 __u16 rsvd2;
401 __u32 buf_len;
402};
403/**
404 * struct mpi3mr_bsg_buf_entry_list - list of user buffer
405 * descriptor for MPI Passthrough requests.
406 *
407 * @num_of_entries: Number of buffer descriptors
408 * @rsvd1: Reserved
409 * @rsvd2: Reserved
410 * @rsvd3: Reserved
411 * @buf_entry: Variable length array of buffer descriptors
412 */
413struct mpi3mr_buf_entry_list {
414 __u8 num_of_entries;
415 __u8 rsvd1;
416 __u16 rsvd2;
417 __u32 rsvd3;
418 struct mpi3mr_buf_entry buf_entry[1];
419};
420/**
421 * struct mpi3mr_bsg_mptcmd - Generic bsg data
422 * structure for all MPI Passthrough requests .
423 *
424 * @mrioc_id: Controller ID
425 * @rsvd1: Reserved
426 * @timeout: MPI request timeout
427 * @buf_entry_list: Buffer descriptor list
428 */
429struct mpi3mr_bsg_mptcmd {
430 __u8 mrioc_id;
431 __u8 rsvd1;
432 __u16 timeout;
433 __u32 rsvd2;
434 struct mpi3mr_buf_entry_list buf_entry_list;
435};
436
437/**
438 * struct mpi3mr_bsg_packet - Generic bsg data
439 * structure for all supported requests .
440 *
441 * @cmd_type: represents drvrcmd or mptcmd
442 * @rsvd1: Reserved
443 * @rsvd2: Reserved
444 * @drvrcmd: driver request structure
445 * @mptcmd: mpt request structure
446 */
447struct mpi3mr_bsg_packet {
448 __u8 cmd_type;
449 __u8 rsvd1;
450 __u16 rsvd2;
451 __u32 rsvd3;
452 union {
453 struct mpi3mr_bsg_drv_cmd drvrcmd;
454 struct mpi3mr_bsg_mptcmd mptcmd;
455 } cmd;
456};
457
458struct mpi3_nvme_encapsulated_request {
459 __le16 host_tag;
460 __u8 ioc_use_only02;
461 __u8 function;
462 __le16 ioc_use_only04;
463 __u8 ioc_use_only06;
464 __u8 msg_flags;
465 __le16 change_count;
466 __le16 dev_handle;
467 __le16 encapsulated_command_length;
468 __le16 flags;
469 __le32 data_length;
470 __le32 reserved14[3];
471 __le32 command[];
472};
473
474struct mpi3_nvme_encapsulated_error_reply {
475 __le16 host_tag;
476 __u8 ioc_use_only02;
477 __u8 function;
478 __le16 ioc_use_only04;
479 __u8 ioc_use_only06;
480 __u8 msg_flags;
481 __le16 ioc_use_only08;
482 __le16 ioc_status;
483 __le32 ioc_log_info;
484 __le32 nvme_completion_entry[4];
485};
486
487#define MPI3MR_NVME_PRP_SIZE 8 /* PRP size */
488#define MPI3MR_NVME_CMD_PRP1_OFFSET 24 /* PRP1 offset in NVMe cmd */
489#define MPI3MR_NVME_CMD_PRP2_OFFSET 32 /* PRP2 offset in NVMe cmd */
490#define MPI3MR_NVME_CMD_SGL_OFFSET 24 /* SGL offset in NVMe cmd */
491#define MPI3MR_NVME_DATA_FORMAT_PRP 0
492#define MPI3MR_NVME_DATA_FORMAT_SGL1 1
493#define MPI3MR_NVME_DATA_FORMAT_SGL2 2
494
495/* MPI3: task management related definitions */
496struct mpi3_scsi_task_mgmt_request {
497 __le16 host_tag;
498 __u8 ioc_use_only02;
499 __u8 function;
500 __le16 ioc_use_only04;
501 __u8 ioc_use_only06;
502 __u8 msg_flags;
503 __le16 change_count;
504 __le16 dev_handle;
505 __le16 task_host_tag;
506 __u8 task_type;
507 __u8 reserved0f;
508 __le16 task_request_queue_id;
509 __le16 reserved12;
510 __le32 reserved14;
511 __u8 lun[8];
512};
513
514#define MPI3_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x08)
515#define MPI3_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01)
516#define MPI3_SCSITASKMGMT_TASKTYPE_ABORT_TASK_SET (0x02)
517#define MPI3_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03)
518#define MPI3_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05)
519#define MPI3_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06)
520#define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07)
521#define MPI3_SCSITASKMGMT_TASKTYPE_CLEAR_ACA (0x08)
522#define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_TASK_SET (0x09)
523#define MPI3_SCSITASKMGMT_TASKTYPE_QUERY_ASYNC_EVENT (0x0a)
524#define MPI3_SCSITASKMGMT_TASKTYPE_I_T_NEXUS_RESET (0x0b)
525struct mpi3_scsi_task_mgmt_reply {
526 __le16 host_tag;
527 __u8 ioc_use_only02;
528 __u8 function;
529 __le16 ioc_use_only04;
530 __u8 ioc_use_only06;
531 __u8 msg_flags;
532 __le16 ioc_use_only08;
533 __le16 ioc_status;
534 __le32 ioc_log_info;
535 __le32 termination_count;
536 __le32 response_data;
537 __le32 reserved18;
538};
539
540#define MPI3_SCSITASKMGMT_RSPCODE_TM_COMPLETE (0x00)
541#define MPI3_SCSITASKMGMT_RSPCODE_INVALID_FRAME (0x02)
542#define MPI3_SCSITASKMGMT_RSPCODE_TM_FUNCTION_NOT_SUPPORTED (0x04)
543#define MPI3_SCSITASKMGMT_RSPCODE_TM_FAILED (0x05)
544#define MPI3_SCSITASKMGMT_RSPCODE_TM_SUCCEEDED (0x08)
545#define MPI3_SCSITASKMGMT_RSPCODE_TM_INVALID_LUN (0x09)
546#define MPI3_SCSITASKMGMT_RSPCODE_TM_OVERLAPPED_TAG (0x0a)
547#define MPI3_SCSITASKMGMT_RSPCODE_IO_QUEUED_ON_IOC (0x80)
548#define MPI3_SCSITASKMGMT_RSPCODE_TM_NVME_DENIED (0x81)
549
550/* MPI3: PEL related definitions */
551#define MPI3_PEL_LOCALE_FLAGS_NON_BLOCKING_BOOT_EVENT (0x0200)
552#define MPI3_PEL_LOCALE_FLAGS_BLOCKING_BOOT_EVENT (0x0100)
553#define MPI3_PEL_LOCALE_FLAGS_PCIE (0x0080)
554#define MPI3_PEL_LOCALE_FLAGS_CONFIGURATION (0x0040)
555#define MPI3_PEL_LOCALE_FLAGS_CONTROLER (0x0020)
556#define MPI3_PEL_LOCALE_FLAGS_SAS (0x0010)
557#define MPI3_PEL_LOCALE_FLAGS_EPACK (0x0008)
558#define MPI3_PEL_LOCALE_FLAGS_ENCLOSURE (0x0004)
559#define MPI3_PEL_LOCALE_FLAGS_PD (0x0002)
560#define MPI3_PEL_LOCALE_FLAGS_VD (0x0001)
561#define MPI3_PEL_CLASS_DEBUG (0x00)
562#define MPI3_PEL_CLASS_PROGRESS (0x01)
563#define MPI3_PEL_CLASS_INFORMATIONAL (0x02)
564#define MPI3_PEL_CLASS_WARNING (0x03)
565#define MPI3_PEL_CLASS_CRITICAL (0x04)
566#define MPI3_PEL_CLASS_FATAL (0x05)
567#define MPI3_PEL_CLASS_FAULT (0x06)
568
569/* MPI3: Function definitions */
570#define MPI3_BSG_FUNCTION_MGMT_PASSTHROUGH (0x0a)
571#define MPI3_BSG_FUNCTION_SCSI_IO (0x20)
572#define MPI3_BSG_FUNCTION_SCSI_TASK_MGMT (0x21)
573#define MPI3_BSG_FUNCTION_SMP_PASSTHROUGH (0x22)
574#define MPI3_BSG_FUNCTION_NVME_ENCAPSULATED (0x24)
575
576#endif
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_bsg_ufs.h+46-2
......@@ -14,10 +14,27 @@
1414 */
1515
1616#define UFS_CDB_SIZE 16
17#define UPIU_TRANSACTION_UIC_CMD 0x1F
1817/* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */
1918#define UIC_CMD_SIZE (sizeof(__u32) * 4)
2019
20enum ufs_bsg_msg_code {
21 UPIU_TRANSACTION_UIC_CMD = 0x1F,
22 UPIU_TRANSACTION_ARPMB_CMD,
23};
24
25/* UFS RPMB Request Message Types */
26enum ufs_rpmb_op_type {
27 UFS_RPMB_WRITE_KEY = 0x01,
28 UFS_RPMB_READ_CNT = 0x02,
29 UFS_RPMB_WRITE = 0x03,
30 UFS_RPMB_READ = 0x04,
31 UFS_RPMB_READ_RESP = 0x05,
32 UFS_RPMB_SEC_CONF_WRITE = 0x06,
33 UFS_RPMB_SEC_CONF_READ = 0x07,
34 UFS_RPMB_PURGE_ENABLE = 0x08,
35 UFS_RPMB_PURGE_STATUS_READ = 0x09,
36};
37
2138/**
2239 * struct utp_upiu_header - UPIU header structure
2340 * @dword_0: UPIU header DW-0
......@@ -79,6 +96,23 @@ struct utp_upiu_req {
7996 };
8097};
8198
99struct ufs_arpmb_meta {
100 __be16 req_resp_type;
101 __u8 nonce[16];
102 __be32 write_counter;
103 __be16 addr_lun;
104 __be16 block_count;
105 __be16 result;
106} __attribute__((__packed__));
107
108struct ufs_ehs {
109 __u8 length;
110 __u8 ehs_type;
111 __be16 ehssub_type;
112 struct ufs_arpmb_meta meta;
113 __u8 mac_key[32];
114} __attribute__((__packed__));
115
82116/* request (CDB) structure of the sg_io_v4 */
83117struct ufs_bsg_request {
84118 __u32 msgcode;
......@@ -95,11 +129,21 @@ struct ufs_bsg_reply {
95129 * msg and status fields. The per-msgcode reply structure
96130 * will contain valid data.
97131 */
98 __u32 result;
132 int result;
99133
100134 /* If there was reply_payload, how much was received? */
101135 __u32 reply_payload_rcv_len;
102136
103137 struct utp_upiu_req upiu_rsp;
104138};
139
140struct ufs_rpmb_request {
141 struct ufs_bsg_request bsg_request;
142 struct ufs_ehs ehs_req;
143};
144
145struct ufs_rpmb_reply {
146 struct ufs_bsg_reply bsg_reply;
147 struct ufs_ehs ehs_rsp;
148};
105149#endif /* UFS_BSG_H */
\ No newline at end of file
lib/libc/include/any-linux-any/scsi/scsi_netlink_fc.h+5-2
......@@ -35,7 +35,7 @@
3535 * FC Transport Broadcast Event Message :
3636 * FC_NL_ASYNC_EVENT
3737 *
38 * Note: if Vendor Unique message, &event_data will be start of
38 * Note: if Vendor Unique message, event_data_flex will be start of
3939 * vendor unique payload, and the length of the payload is
4040 * per event_datalen
4141 *
......@@ -50,7 +50,10 @@ struct fc_nl_event {
5050 __u16 event_datalen;
5151 __u32 event_num;
5252 __u32 event_code;
53 __u32 event_data;
53 union {
54 __u32 event_data;
55 __DECLARE_FLEX_ARRAY(__u8, event_data_flex);
56 };
5457} __attribute__((aligned(sizeof(__u64))));
5558
5659
lib/libc/include/any-linux-any/sound/asequencer.h+4-20
......@@ -3,22 +3,6 @@
33 * Main header file for the ALSA sequencer
44 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
55 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
226 */
237#ifndef __SOUND_ASEQUENCER_H
248#define __SOUND_ASEQUENCER_H
......@@ -344,10 +328,10 @@ typedef int __bitwise snd_seq_client_type_t;
344328#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
345329
346330 /* event filter flags */
347#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
348#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
349#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
350#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
331#define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */
332#define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */
333#define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */
334#define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */
351335
352336struct snd_seq_client_info {
353337 int client; /* client number to inquire */
lib/libc/include/any-linux-any/sound/asoc.h-4
......@@ -5,10 +5,6 @@
55 * Copyright (C) 2012 Texas Instruments Inc.
66 * Copyright (C) 2015 Intel Corporation.
77 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
128 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
139 * algorithms, equalisers, DAIs, widgets etc.
1410*/
lib/libc/include/any-linux-any/sound/asound.h+10-19
......@@ -3,22 +3,6 @@
33 * Advanced Linux Sound Architecture - ALSA - Driver
44 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
55 * Abramo Bagnara <abramo@alsa-project.org>
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
226 */
237
248#ifndef __SOUND_ASOUND_H
......@@ -54,8 +38,10 @@
5438 * *
5539 ****************************************************************************/
5640
41#define AES_IEC958_STATUS_SIZE 24
42
5743struct snd_aes_iec958 {
58 unsigned char status[24]; /* AES/IEC958 channel status bits */
44 unsigned char status[AES_IEC958_STATUS_SIZE]; /* AES/IEC958 channel status bits */
5945 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
6046 unsigned char pad; /* nothing */
6147 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
......@@ -200,6 +186,11 @@ typedef int __bitwise snd_pcm_format_t;
200186#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */
201187#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */
202188#define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9) /* low three bytes */
189/*
190 * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
191 * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
192 * `right-padding` sample which has less width than 32 bit.
193 */
203194#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
204195#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
205196#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
......@@ -298,7 +289,7 @@ typedef int __bitwise snd_pcm_subformat_t;
298289#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
299290#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
300291#define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
301
292#define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */
302293#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
303294#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
304295
......@@ -1085,7 +1076,7 @@ struct snd_ctl_elem_value {
10851076struct snd_ctl_tlv {
10861077 unsigned int numid; /* control element numeric identification */
10871078 unsigned int length; /* in bytes aligned to 4 */
1088 unsigned int tlv[0]; /* first TLV */
1079 unsigned int tlv[]; /* first TLV */
10891080};
10901081
10911082#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
lib/libc/include/any-linux-any/sound/asound_fm.h-15
......@@ -10,21 +10,6 @@
1010 * 4Front Technologies
1111 *
1212 * Direct FM control
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 *
2813 */
2914
3015#define SNDRV_DM_FM_MODE_OPL2 0x00
lib/libc/include/any-linux-any/sound/compress_offload.h+1-18
......@@ -5,23 +5,6 @@
55 * Copyright (C) 2011 Intel Corporation
66 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
77 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *
23 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 *
258 */
269#ifndef __COMPRESS_OFFLOAD_H
2710#define __COMPRESS_OFFLOAD_H
......@@ -123,7 +106,7 @@ struct snd_compr_codec_caps {
123106} __attribute__((packed, aligned(4)));
124107
125108/**
126 * enum sndrv_compress_encoder
109 * enum sndrv_compress_encoder - encoder metadata key
127110 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
128111 * end of the track
129112 * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
lib/libc/include/any-linux-any/sound/compress_params.h+5-39
......@@ -7,47 +7,13 @@
77 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
88 * Vinod Koul <vinod.koul@linux.intel.com>
99 *
10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *
2510 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2611 *
2712 * The definitions in this file are derived from the OpenMAX AL version 1.1
28 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below.
13 * and OpenMAX IL v 1.1.2 header files which contain the copyright notice below
14 * and are licensed under the MIT license.
2915 *
3016 * Copyright (c) 2007-2010 The Khronos Group Inc.
31 *
32 * Permission is hereby granted, free of charge, to any person obtaining
33 * a copy of this software and/or associated documentation files (the
34 * "Materials "), to deal in the Materials without restriction, including
35 * without limitation the rights to use, copy, modify, merge, publish,
36 * distribute, sublicense, and/or sell copies of the Materials, and to
37 * permit persons to whom the Materials are furnished to do so, subject to
38 * the following conditions:
39 *
40 * The above copyright notice and this permission notice shall be included
41 * in all copies or substantial portions of the Materials.
42 *
43 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
44 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
46 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
47 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
48 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
49 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
50 *
5117 */
5218#ifndef __SND_COMPRESS_PARAMS_H
5319#define __SND_COMPRESS_PARAMS_H
......@@ -250,7 +216,7 @@ struct snd_enc_wma {
250216
251217
252218/**
253 * struct snd_enc_vorbis
219 * struct snd_enc_vorbis - Vorbis encoder parameters
254220 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
255221 * In the default mode of operation, the quality level is 3.
256222 * Normal quality range is 0 - 10.
......@@ -279,7 +245,7 @@ struct snd_enc_vorbis {
279245
280246
281247/**
282 * struct snd_enc_real
248 * struct snd_enc_real - RealAudio encoder parameters
283249 * @quant_bits: number of coupling quantization bits in the stream
284250 * @start_region: coupling start region in the stream
285251 * @num_regions: number of regions value
......@@ -294,7 +260,7 @@ struct snd_enc_real {
294260} __attribute__((packed, aligned(4)));
295261
296262/**
297 * struct snd_enc_flac
263 * struct snd_enc_flac - FLAC encoder parameters
298264 * @num: serial number, valid only for OGG formats
299265 * needs to be set by application
300266 * @gain: Add replay gain tags
lib/libc/include/any-linux-any/sound/emu10k1.h-16
......@@ -3,22 +3,6 @@
33 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
44 * Creative Labs, Inc.
55 * Definitions for EMU10K1 (SB Live!) chips
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
226 */
237#ifndef __SOUND_EMU10K1_H
248#define __SOUND_EMU10K1_H
lib/libc/include/any-linux-any/sound/firewire.h+29-3
......@@ -14,6 +14,7 @@
1414#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
1515#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
1616#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d545244
17#define SNDRV_FIREWIRE_EVENT_FF400_MESSAGE 0x4f6c6761
1718
1819struct snd_firewire_event_common {
1920 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
......@@ -38,11 +39,11 @@ struct snd_efw_transaction {
3839 __be32 category;
3940 __be32 command;
4041 __be32 status;
41 __be32 params[0];
42 __be32 params[];
4243};
4344struct snd_firewire_event_efw_response {
4445 unsigned int type;
45 __be32 response[0]; /* some responses */
46 __be32 response[]; /* some responses */
4647};
4748
4849struct snd_firewire_event_digi00x_message {
......@@ -63,7 +64,7 @@ struct snd_firewire_tascam_change {
6364
6465struct snd_firewire_event_tascam_control {
6566 unsigned int type;
66 struct snd_firewire_tascam_change changes[0];
67 struct snd_firewire_tascam_change changes[];
6768};
6869
6970struct snd_firewire_event_motu_register_dsp_change {
......@@ -72,6 +73,30 @@ struct snd_firewire_event_motu_register_dsp_change {
7273 __u32 changes[]; /* Encoded event for change of register DSP. */
7374};
7475
76/**
77 * struct snd_firewire_event_ff400_message - the container for message from Fireface 400 when
78 * operating hardware knob.
79 *
80 * @type: Fixed to SNDRV_FIREWIRE_EVENT_FF400_MESSAGE.
81 * @message_count: The number of messages.
82 * @messages.message: The messages expressing hardware knob operation.
83 * @messages.tstamp: The isochronous cycle at which the request subaction of asynchronous
84 * transaction was sent to deliver the message. It has 16 bit unsigned integer
85 * value. The higher 3 bits of value expresses the lower three bits of second
86 * field in the format of CYCLE_TIME, up to 7. The rest 13 bits expresses cycle
87 * field up to 7999.
88 *
89 * The structure expresses message transmitted by Fireface 400 when operating hardware knob.
90 */
91struct snd_firewire_event_ff400_message {
92 unsigned int type;
93 unsigned int message_count;
94 struct {
95 __u32 message;
96 __u32 tstamp;
97 } messages[];
98};
99
75100union snd_firewire_event {
76101 struct snd_firewire_event_common common;
77102 struct snd_firewire_event_lock_status lock_status;
......@@ -81,6 +106,7 @@ union snd_firewire_event {
81106 struct snd_firewire_event_tascam_control tascam_control;
82107 struct snd_firewire_event_motu_notification motu_notification;
83108 struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;
109 struct snd_firewire_event_ff400_message ff400_message;
84110};
85111
86112
lib/libc/include/any-linux-any/sound/hdsp.h-14
......@@ -4,20 +4,6 @@
44
55/*
66 * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
217 */
228
239#ifdef __linux__
lib/libc/include/any-linux-any/sound/hdspm.h-15
......@@ -4,21 +4,6 @@
44/*
55 * Copyright (C) 2003 Winfried Ritsch (IEM)
66 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
227 */
238
249#ifdef __linux__
lib/libc/include/any-linux-any/sound/intel/avs/tokens.h created+130
......@@ -0,0 +1,130 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright(c) 2021 Intel Corporation. All rights reserved.
4 *
5 * Authors: Cezary Rojewski <cezary.rojewski@intel.com>
6 * Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
7 */
8
9#ifndef __UAPI_SOUND_INTEL_AVS_TOKENS_H
10#define __UAPI_SOUND_INTEL_AVS_TOKENS_H
11
12enum avs_tplg_token {
13 /* struct avs_tplg */
14 AVS_TKN_MANIFEST_NAME_STRING = 1,
15 AVS_TKN_MANIFEST_VERSION_U32 = 2,
16 AVS_TKN_MANIFEST_NUM_LIBRARIES_U32 = 3,
17 AVS_TKN_MANIFEST_NUM_AFMTS_U32 = 4,
18 AVS_TKN_MANIFEST_NUM_MODCFGS_BASE_U32 = 5,
19 AVS_TKN_MANIFEST_NUM_MODCFGS_EXT_U32 = 6,
20 AVS_TKN_MANIFEST_NUM_PPLCFGS_U32 = 7,
21 AVS_TKN_MANIFEST_NUM_BINDINGS_U32 = 8,
22
23 /* struct avs_tplg_library */
24 AVS_TKN_LIBRARY_ID_U32 = 101,
25 AVS_TKN_LIBRARY_NAME_STRING = 102,
26
27 /* struct avs_audio_format */
28 AVS_TKN_AFMT_ID_U32 = 201,
29 AVS_TKN_AFMT_SAMPLE_RATE_U32 = 202,
30 AVS_TKN_AFMT_BIT_DEPTH_U32 = 203,
31 AVS_TKN_AFMT_CHANNEL_MAP_U32 = 204,
32 AVS_TKN_AFMT_CHANNEL_CFG_U32 = 205,
33 AVS_TKN_AFMT_INTERLEAVING_U32 = 206,
34 AVS_TKN_AFMT_NUM_CHANNELS_U32 = 207,
35 AVS_TKN_AFMT_VALID_BIT_DEPTH_U32 = 208,
36 AVS_TKN_AFMT_SAMPLE_TYPE_U32 = 209,
37
38 /* struct avs_tplg_modcfg_base */
39 AVS_TKN_MODCFG_BASE_ID_U32 = 301,
40 AVS_TKN_MODCFG_BASE_CPC_U32 = 302,
41 AVS_TKN_MODCFG_BASE_IBS_U32 = 303,
42 AVS_TKN_MODCFG_BASE_OBS_U32 = 304,
43 AVS_TKN_MODCFG_BASE_PAGES_U32 = 305,
44
45 /* struct avs_tplg_modcfg_ext */
46 AVS_TKN_MODCFG_EXT_ID_U32 = 401,
47 AVS_TKN_MODCFG_EXT_TYPE_UUID = 402,
48 AVS_TKN_MODCFG_CPR_OUT_AFMT_ID_U32 = 403,
49 AVS_TKN_MODCFG_CPR_FEATURE_MASK_U32 = 404,
50 AVS_TKN_MODCFG_CPR_DMA_TYPE_U32 = 405,
51 AVS_TKN_MODCFG_CPR_DMABUFF_SIZE_U32 = 406,
52 AVS_TKN_MODCFG_CPR_VINDEX_U8 = 407,
53 AVS_TKN_MODCFG_CPR_BLOB_FMT_ID_U32 = 408,
54 AVS_TKN_MODCFG_MICSEL_OUT_AFMT_ID_U32 = 409,
55 AVS_TKN_MODCFG_INTELWOV_CPC_LP_MODE_U32 = 410,
56 AVS_TKN_MODCFG_SRC_OUT_FREQ_U32 = 411,
57 AVS_TKN_MODCFG_MUX_REF_AFMT_ID_U32 = 412,
58 AVS_TKN_MODCFG_MUX_OUT_AFMT_ID_U32 = 413,
59 AVS_TKN_MODCFG_AEC_REF_AFMT_ID_U32 = 414,
60 AVS_TKN_MODCFG_AEC_OUT_AFMT_ID_U32 = 415,
61 AVS_TKN_MODCFG_AEC_CPC_LP_MODE_U32 = 416,
62 AVS_TKN_MODCFG_ASRC_OUT_FREQ_U32 = 417,
63 AVS_TKN_MODCFG_ASRC_MODE_U8 = 418,
64 AVS_TKN_MODCFG_ASRC_DISABLE_JITTER_U8 = 419,
65 AVS_TKN_MODCFG_UPDOWN_MIX_OUT_CHAN_CFG_U32 = 420,
66 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_SELECT_U32 = 421,
67 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_0_S32 = 422,
68 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_1_S32 = 423,
69 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_2_S32 = 424,
70 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_3_S32 = 425,
71 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_4_S32 = 426,
72 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_5_S32 = 427,
73 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_6_S32 = 428,
74 AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_7_S32 = 429,
75 AVS_TKN_MODCFG_UPDOWN_MIX_CHAN_MAP_U32 = 430,
76 AVS_TKN_MODCFG_EXT_NUM_INPUT_PINS_U16 = 431,
77 AVS_TKN_MODCFG_EXT_NUM_OUTPUT_PINS_U16 = 432,
78
79 /* struct avs_tplg_pplcfg */
80 AVS_TKN_PPLCFG_ID_U32 = 1401,
81 AVS_TKN_PPLCFG_REQ_SIZE_U16 = 1402,
82 AVS_TKN_PPLCFG_PRIORITY_U8 = 1403,
83 AVS_TKN_PPLCFG_LOW_POWER_BOOL = 1404,
84 AVS_TKN_PPLCFG_ATTRIBUTES_U16 = 1405,
85 AVS_TKN_PPLCFG_TRIGGER_U32 = 1406,
86
87 /* struct avs_tplg_binding */
88 AVS_TKN_BINDING_ID_U32 = 1501,
89 AVS_TKN_BINDING_TARGET_TPLG_NAME_STRING = 1502,
90 AVS_TKN_BINDING_TARGET_PATH_TMPL_ID_U32 = 1503,
91 AVS_TKN_BINDING_TARGET_PPL_ID_U32 = 1504,
92 AVS_TKN_BINDING_TARGET_MOD_ID_U32 = 1505,
93 AVS_TKN_BINDING_TARGET_MOD_PIN_U8 = 1506,
94 AVS_TKN_BINDING_MOD_ID_U32 = 1507,
95 AVS_TKN_BINDING_MOD_PIN_U8 = 1508,
96 AVS_TKN_BINDING_IS_SINK_U8 = 1509,
97
98 /* struct avs_tplg_pipeline */
99 AVS_TKN_PPL_ID_U32 = 1601,
100 AVS_TKN_PPL_PPLCFG_ID_U32 = 1602,
101 AVS_TKN_PPL_NUM_BINDING_IDS_U32 = 1603,
102 AVS_TKN_PPL_BINDING_ID_U32 = 1604,
103
104 /* struct avs_tplg_module */
105 AVS_TKN_MOD_ID_U32 = 1701,
106 AVS_TKN_MOD_MODCFG_BASE_ID_U32 = 1702,
107 AVS_TKN_MOD_IN_AFMT_ID_U32 = 1703,
108 AVS_TKN_MOD_CORE_ID_U8 = 1704,
109 AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705,
110 AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706,
111 AVS_TKN_MOD_KCONTROL_ID_U32 = 1707,
112
113 /* struct avs_tplg_path_template */
114 AVS_TKN_PATH_TMPL_ID_U32 = 1801,
115
116 /* struct avs_tplg_path */
117 AVS_TKN_PATH_ID_U32 = 1901,
118 AVS_TKN_PATH_FE_FMT_ID_U32 = 1902,
119 AVS_TKN_PATH_BE_FMT_ID_U32 = 1903,
120
121 /* struct avs_tplg_pin_format */
122 AVS_TKN_PIN_FMT_INDEX_U32 = 2201,
123 AVS_TKN_PIN_FMT_IOBS_U32 = 2202,
124 AVS_TKN_PIN_FMT_AFMT_ID_U32 = 2203,
125
126 /* struct avs_tplg_kcontrol */
127 AVS_TKN_KCONTROL_ID_U32 = 2301,
128};
129
130#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sb16_csp.h-15
......@@ -4,21 +4,6 @@
44 * Takashi Iwai <tiwai@suse.de>
55 *
66 * SB16ASP/AWE32 CSP control
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
227 */
238#ifndef __SOUND_SB16_CSP_H
249#define __SOUND_SB16_CSP_H
lib/libc/include/any-linux-any/sound/sfnt_info.h-15
......@@ -6,21 +6,6 @@
66 * Patch record compatible with AWE driver on OSS
77 *
88 * Copyright (C) 1999-2000 Takashi Iwai
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
249 */
2510
2611#include <sound/asound.h>
lib/libc/include/any-linux-any/sound/skl-tplg-interface.h+3-2
......@@ -66,7 +66,8 @@ enum skl_ch_cfg {
6666 SKL_CH_CFG_DUAL_MONO = 9,
6767 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
6868 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,
69 SKL_CH_CFG_4_CHANNEL = 12,
69 SKL_CH_CFG_7_1 = 12,
70 SKL_CH_CFG_4_CHANNEL = SKL_CH_CFG_7_1,
7071 SKL_CH_CFG_INVALID
7172};
7273
......@@ -151,7 +152,7 @@ struct skl_dfw_algo_data {
151152 __u32 rsvd:30;
152153 __u32 param_id;
153154 __u32 max;
154 char params[0];
155 char params[];
155156} __attribute__((packed));
156157
157158enum skl_tkn_dir {
lib/libc/include/any-linux-any/sound/snd_ar_tokens.h+27
......@@ -191,6 +191,33 @@ enum ar_event_types {
191191#define AR_TKN_U32_MODULE_SRC_INSTANCE_ID 208
192192#define AR_TKN_U32_MODULE_DST_INSTANCE_ID 209
193193
194#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID1 210
195#define AR_TKN_U32_MODULE_DST_IN_PORT_ID1 211
196#define AR_TKN_U32_MODULE_DST_INSTANCE_ID1 212
197
198#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID2 213
199#define AR_TKN_U32_MODULE_DST_IN_PORT_ID2 214
200#define AR_TKN_U32_MODULE_DST_INSTANCE_ID2 215
201
202#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID3 216
203#define AR_TKN_U32_MODULE_DST_IN_PORT_ID3 217
204#define AR_TKN_U32_MODULE_DST_INSTANCE_ID3 218
205
206#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID4 219
207#define AR_TKN_U32_MODULE_DST_IN_PORT_ID4 220
208#define AR_TKN_U32_MODULE_DST_INSTANCE_ID4 221
209
210#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID5 222
211#define AR_TKN_U32_MODULE_DST_IN_PORT_ID5 223
212#define AR_TKN_U32_MODULE_DST_INSTANCE_ID5 224
213
214#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID6 225
215#define AR_TKN_U32_MODULE_DST_IN_PORT_ID6 226
216#define AR_TKN_U32_MODULE_DST_INSTANCE_ID6 227
217
218#define AR_TKN_U32_MODULE_SRC_OP_PORT_ID7 228
219#define AR_TKN_U32_MODULE_DST_IN_PORT_ID7 229
220#define AR_TKN_U32_MODULE_DST_INSTANCE_ID7 230
194221
195222#define AR_TKN_U32_MODULE_HW_IF_IDX 250
196223#define AR_TKN_U32_MODULE_HW_IF_TYPE 251
lib/libc/include/any-linux-any/sound/snd_sst_tokens.h-10
......@@ -4,16 +4,6 @@
44 *
55 * Copyright (C) 2016 Intel Corp
66 * Author: Shreyas NC <shreyas.nc@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
177 */
188#ifndef __SND_SST_TOKENS_H__
199#define __SND_SST_TOKENS_H__
lib/libc/include/any-linux-any/sound/sof/abi.h+3-1
......@@ -24,9 +24,11 @@
2424#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
2525#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
2626
27#include <linux/types.h>
28
2729/* SOF ABI version major, minor and patch numbers */
2830#define SOF_ABI_MAJOR 3
29#define SOF_ABI_MINOR 18
31#define SOF_ABI_MINOR 23
3032#define SOF_ABI_PATCH 0
3133
3234/* SOF ABI version number. Format within 32bit word is MMmmmppp */
lib/libc/include/any-linux-any/sound/sof/header.h+31-1
......@@ -23,7 +23,37 @@ struct sof_abi_hdr {
2323 __u32 size; /**< size in bytes of data excl. this struct */
2424 __u32 abi; /**< SOF ABI version */
2525 __u32 reserved[4]; /**< reserved for future use */
26 __u32 data[0]; /**< Component data - opaque to core */
26 __u32 data[]; /**< Component data - opaque to core */
2727} __attribute__((packed));
2828
29#define SOF_MANIFEST_DATA_TYPE_NHLT 1
30
31/**
32 * struct sof_manifest_tlv - SOF manifest TLV data
33 * @type: type of data
34 * @size: data size (not including the size of this struct)
35 * @data: payload data
36 */
37struct sof_manifest_tlv {
38 __le32 type;
39 __le32 size;
40 __u8 data[];
41};
42
43/**
44 * struct sof_manifest - SOF topology manifest
45 * @abi_major: Major ABI version
46 * @abi_minor: Minor ABI version
47 * @abi_patch: ABI patch
48 * @count: count of tlv items
49 * @items: consecutive variable size tlv items
50 */
51struct sof_manifest {
52 __le16 abi_major;
53 __le16 abi_minor;
54 __le16 abi_patch;
55 __le16 count;
56 struct sof_manifest_tlv items[];
57};
58
2959#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/tokens.h+63
......@@ -52,11 +52,17 @@
5252#define SOF_TKN_SCHED_FRAMES 204
5353#define SOF_TKN_SCHED_TIME_DOMAIN 205
5454#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 206
55#define SOF_TKN_SCHED_LP_MODE 207
56#define SOF_TKN_SCHED_MEM_USAGE 208
5557
5658/* volume */
5759#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
5860#define SOF_TKN_VOLUME_RAMP_STEP_MS 251
5961
62#define SOF_TKN_GAIN_RAMP_TYPE 260
63#define SOF_TKN_GAIN_RAMP_DURATION 261
64#define SOF_TKN_GAIN_VAL 262
65
6066/* SRC */
6167#define SOF_TKN_SRC_RATE_IN 300
6268#define SOF_TKN_SRC_RATE_OUT 301
......@@ -79,6 +85,18 @@
7985 */
8086#define SOF_TKN_COMP_CORE_ID 404
8187#define SOF_TKN_COMP_UUID 405
88#define SOF_TKN_COMP_CPC 406
89#define SOF_TKN_COMP_IS_PAGES 409
90#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/*
94 * The token for sink/source pin binding, it specifies the widget
95 * name that the sink/source pin is connected from/to.
96 */
97#define SOF_TKN_COMP_SINK_PIN_BINDING_WNAME 413
98#define SOF_TKN_COMP_SRC_PIN_BINDING_WNAME 414
99
82100
83101/* SSP */
84102#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
......@@ -140,4 +158,49 @@
140158#define SOF_TKN_INTEL_HDA_RATE 1500
141159#define SOF_TKN_INTEL_HDA_CH 1501
142160
161/* AFE */
162#define SOF_TKN_MEDIATEK_AFE_RATE 1600
163#define SOF_TKN_MEDIATEK_AFE_CH 1601
164#define SOF_TKN_MEDIATEK_AFE_FORMAT 1602
165
166/* MIXER */
167#define SOF_TKN_MIXER_TYPE 1700
168
169/* ACPDMIC */
170#define SOF_TKN_AMD_ACPDMIC_RATE 1800
171#define SOF_TKN_AMD_ACPDMIC_CH 1801
172
173/* CAVS AUDIO FORMAT */
174#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_RATE 1900
175#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_BIT_DEPTH 1901
176#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_VALID_BIT 1902
177#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CHANNELS 1903
178#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_MAP 1904
179#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_CH_CFG 1905
180#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_INTERLEAVING_STYLE 1906
181#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_FMT_CFG 1907
182#define SOF_TKN_CAVS_AUDIO_FORMAT_IN_SAMPLE_TYPE 1908
183/* intentional token numbering discontinuity, reserved for future use */
184#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_RATE 1930
185#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_BIT_DEPTH 1931
186#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_VALID_BIT 1932
187#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CHANNELS 1933
188#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_MAP 1934
189#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_CH_CFG 1935
190#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_INTERLEAVING_STYLE 1936
191#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_FMT_CFG 1937
192#define SOF_TKN_CAVS_AUDIO_FORMAT_OUT_SAMPLE_TYPE 1938
193/* intentional token numbering discontinuity, reserved for future use */
194#define SOF_TKN_CAVS_AUDIO_FORMAT_IBS 1970
195#define SOF_TKN_CAVS_AUDIO_FORMAT_OBS 1971
196#define SOF_TKN_CAVS_AUDIO_FORMAT_DMA_BUFFER_SIZE 1972
197
198/* COPIER */
199#define SOF_TKN_INTEL_COPIER_NODE_TYPE 1980
200
201/* ACP I2S */
202#define SOF_TKN_AMD_ACPI2S_RATE 1700
203#define SOF_TKN_AMD_ACPI2S_CH 1701
204#define SOF_TKN_AMD_ACPI2S_TDM_MODE 1702
205
143206#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/tlv.h-11
......@@ -1,15 +1,4 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
132
143#ifndef __UAPI_SOUND_TLV_H
154#define __UAPI_SOUND_TLV_H
lib/libc/include/any-linux-any/sound/usb_stream.h+1-15
......@@ -1,20 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
22/*
33 * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
184 */
195
206#ifndef __SOUND_USB_STREAM_H
......@@ -61,7 +47,7 @@ struct usb_stream {
6147 unsigned inpacket_split_at;
6248 unsigned next_inpacket_split;
6349 unsigned next_inpacket_split_at;
64 struct usb_stream_packet inpacket[0];
50 struct usb_stream_packet inpacket[];
6551};
6652
6753enum usb_stream_state {
lib/libc/include/any-linux-any/xen/gntdev.h+7-1
......@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {
4747/*
4848 * Inserts the grant references into the mapping table of an instance
4949 * of gntdev. N.B. This does not perform the mapping, which is deferred
50 * until mmap() is called with @index as the offset.
50 * until mmap() is called with @index as the offset. @index should be
51 * considered opaque to userspace, with one exception: if no grant
52 * references have ever been inserted into the mapping table of this
53 * instance, @index will be set to 0. This is necessary to use gntdev
54 * with userspace APIs that expect a file descriptor that can be
55 * mmap()'d at offset 0, such as Wayland. If @count is set to 0, this
56 * ioctl will fail.
5157 */
5258#define IOCTL_GNTDEV_MAP_GRANT_REF \
5359_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
lib/libc/include/arc-linux-any/asm/bpf_perf_event.h created+9
......@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_regs_struct bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/hwcap.h+8
......@@ -28,6 +28,12 @@
2828#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
2929#define HWCAP_LPAE (1 << 20)
3030#define HWCAP_EVTSTRM (1 << 21)
31#define HWCAP_FPHP (1 << 22)
32#define HWCAP_ASIMDHP (1 << 23)
33#define HWCAP_ASIMDDP (1 << 24)
34#define HWCAP_ASIMDFHM (1 << 25)
35#define HWCAP_ASIMDBF16 (1 << 26)
36#define HWCAP_I8MM (1 << 27)
3137
3238/*
3339 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
......@@ -37,5 +43,7 @@
3743#define HWCAP2_SHA1 (1 << 2)
3844#define HWCAP2_SHA2 (1 << 3)
3945#define HWCAP2_CRC32 (1 << 4)
46#define HWCAP2_SB (1 << 5)
47#define HWCAP2_SSBS (1 << 6)
4048
4149#endif /* __ASMARM_HWCAP_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/signal.h+1-1
......@@ -89,7 +89,7 @@ struct sigaction {
8989typedef struct sigaltstack {
9090 void *ss_sp;
9191 int ss_flags;
92 size_t ss_size;
92 __kernel_size_t ss_size;
9393} stack_t;
9494
9595
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+1
......@@ -403,5 +403,6 @@
403403#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
404404#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
405405#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
406#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
406407
407408#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h+1
......@@ -415,5 +415,6 @@
415415#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
416416#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
417417#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
418#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
418419
419420#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/auxvec.h created+17
......@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Author: Hanlu Li <lihanlu@loongson.cn>
4 * Huacai Chen <chenhuacai@loongson.cn>
5 *
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
8
9#ifndef __ASM_AUXVEC_H
10#define __ASM_AUXVEC_H
11
12/* Location of VDSO image. */
13#define AT_SYSINFO_EHDR 33
14
15#define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */
16
17#endif /* __ASM_AUXVEC_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/bitsperlong.h created+9
......@@ -0,0 +1,9 @@
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/bpf_perf_event.h created+9
......@@ -0,0 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <linux/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/break.h created+23
......@@ -0,0 +1,23 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4 */
5#ifndef __UAPI_ASM_BREAK_H
6#define __UAPI_ASM_BREAK_H
7
8#define BRK_DEFAULT 0 /* Used as default */
9#define BRK_BUG 1 /* Used by BUG() */
10#define BRK_KDB 2 /* Used in KDB_ENTER() */
11#define BRK_MATHEMU 3 /* Used by FPU emulator */
12#define BRK_USERBP 4 /* User bp (used by debuggers) */
13#define BRK_SSTEPBP 5 /* User bp (used by debuggers) */
14#define BRK_OVERFLOW 6 /* Overflow check */
15#define BRK_DIVZERO 7 /* Divide by zero check */
16#define BRK_RANGE 8 /* Range error check */
17#define BRK_MULOVFL 9 /* Multiply overflow */
18#define BRK_KPROBE_BP 10 /* Kprobe break */
19#define BRK_KPROBE_SSTEPBP 11 /* Kprobe single step break */
20#define BRK_UPROBE_BP 12 /* See <asm/uprobes.h> */
21#define BRK_UPROBE_XOLBP 13 /* See <asm/uprobes.h> */
22
23#endif /* __UAPI_ASM_BREAK_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/byteorder.h created+13
......@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Author: Hanlu Li <lihanlu@loongson.cn>
4 * Huacai Chen <chenhuacai@loongson.cn>
5 *
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H
10
11#include <linux/byteorder/little_endian.h>
12
13#endif /* _ASM_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/hwcap.h created+20
......@@ -0,0 +1,20 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_HWCAP_H
3#define _ASM_HWCAP_H
4
5/* HWCAP flags */
6#define HWCAP_LOONGARCH_CPUCFG (1 << 0)
7#define HWCAP_LOONGARCH_LAM (1 << 1)
8#define HWCAP_LOONGARCH_UAL (1 << 2)
9#define HWCAP_LOONGARCH_FPU (1 << 3)
10#define HWCAP_LOONGARCH_LSX (1 << 4)
11#define HWCAP_LOONGARCH_LASX (1 << 5)
12#define HWCAP_LOONGARCH_CRC32 (1 << 6)
13#define HWCAP_LOONGARCH_COMPLEX (1 << 7)
14#define HWCAP_LOONGARCH_CRYPTO (1 << 8)
15#define HWCAP_LOONGARCH_LVZ (1 << 9)
16#define HWCAP_LOONGARCH_LBT_X86 (1 << 10)
17#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
18#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
19
20#endif /* _ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/perf_regs.h created+40
......@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_LOONGARCH_PERF_REGS_H
3#define _ASM_LOONGARCH_PERF_REGS_H
4
5enum perf_event_loongarch_regs {
6 PERF_REG_LOONGARCH_PC,
7 PERF_REG_LOONGARCH_R1,
8 PERF_REG_LOONGARCH_R2,
9 PERF_REG_LOONGARCH_R3,
10 PERF_REG_LOONGARCH_R4,
11 PERF_REG_LOONGARCH_R5,
12 PERF_REG_LOONGARCH_R6,
13 PERF_REG_LOONGARCH_R7,
14 PERF_REG_LOONGARCH_R8,
15 PERF_REG_LOONGARCH_R9,
16 PERF_REG_LOONGARCH_R10,
17 PERF_REG_LOONGARCH_R11,
18 PERF_REG_LOONGARCH_R12,
19 PERF_REG_LOONGARCH_R13,
20 PERF_REG_LOONGARCH_R14,
21 PERF_REG_LOONGARCH_R15,
22 PERF_REG_LOONGARCH_R16,
23 PERF_REG_LOONGARCH_R17,
24 PERF_REG_LOONGARCH_R18,
25 PERF_REG_LOONGARCH_R19,
26 PERF_REG_LOONGARCH_R20,
27 PERF_REG_LOONGARCH_R21,
28 PERF_REG_LOONGARCH_R22,
29 PERF_REG_LOONGARCH_R23,
30 PERF_REG_LOONGARCH_R24,
31 PERF_REG_LOONGARCH_R25,
32 PERF_REG_LOONGARCH_R26,
33 PERF_REG_LOONGARCH_R27,
34 PERF_REG_LOONGARCH_R28,
35 PERF_REG_LOONGARCH_R29,
36 PERF_REG_LOONGARCH_R30,
37 PERF_REG_LOONGARCH_R31,
38 PERF_REG_LOONGARCH_MAX,
39};
40#endif /* _ASM_LOONGARCH_PERF_REGS_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/ptrace.h created+60
......@@ -0,0 +1,60 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Author: Hanlu Li <lihanlu@loongson.cn>
4 * Huacai Chen <chenhuacai@loongson.cn>
5 *
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
8#ifndef _ASM_PTRACE_H
9#define _ASM_PTRACE_H
10
11#include <linux/types.h>
12
13#include <stdint.h>
14
15/*
16 * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs,
17 * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR.
18 */
19#define GPR_BASE 0
20#define GPR_NUM 32
21#define GPR_END (GPR_BASE + GPR_NUM - 1)
22#define ARG0 (GPR_END + 1)
23#define PC (GPR_END + 2)
24#define BADVADDR (GPR_END + 3)
25
26#define NUM_FPU_REGS 32
27
28struct user_pt_regs {
29 /* Main processor registers. */
30 unsigned long regs[32];
31
32 /* Original syscall arg0. */
33 unsigned long orig_a0;
34
35 /* Special CSR registers. */
36 unsigned long csr_era;
37 unsigned long csr_badv;
38 unsigned long reserved[10];
39} __attribute__((aligned(8)));
40
41struct user_fp_state {
42 uint64_t fpr[32];
43 uint64_t fcc;
44 uint32_t fcsr;
45};
46
47struct user_watch_state {
48 uint64_t dbg_info;
49 struct {
50 uint64_t addr;
51 uint64_t mask;
52 uint32_t ctrl;
53 uint32_t pad;
54 } dbg_regs[8];
55};
56
57#define PTRACE_SYSEMU 0x1f
58#define PTRACE_SYSEMU_SINGLESTEP 0x20
59
60#endif /* _ASM_PTRACE_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/reg.h created+59
......@@ -0,0 +1,59 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Various register offset definitions for debuggers, core file
4 * examiners and whatnot.
5 *
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
8
9#ifndef __UAPI_ASM_LOONGARCH_REG_H
10#define __UAPI_ASM_LOONGARCH_REG_H
11
12#define LOONGARCH_EF_R0 0
13#define LOONGARCH_EF_R1 1
14#define LOONGARCH_EF_R2 2
15#define LOONGARCH_EF_R3 3
16#define LOONGARCH_EF_R4 4
17#define LOONGARCH_EF_R5 5
18#define LOONGARCH_EF_R6 6
19#define LOONGARCH_EF_R7 7
20#define LOONGARCH_EF_R8 8
21#define LOONGARCH_EF_R9 9
22#define LOONGARCH_EF_R10 10
23#define LOONGARCH_EF_R11 11
24#define LOONGARCH_EF_R12 12
25#define LOONGARCH_EF_R13 13
26#define LOONGARCH_EF_R14 14
27#define LOONGARCH_EF_R15 15
28#define LOONGARCH_EF_R16 16
29#define LOONGARCH_EF_R17 17
30#define LOONGARCH_EF_R18 18
31#define LOONGARCH_EF_R19 19
32#define LOONGARCH_EF_R20 20
33#define LOONGARCH_EF_R21 21
34#define LOONGARCH_EF_R22 22
35#define LOONGARCH_EF_R23 23
36#define LOONGARCH_EF_R24 24
37#define LOONGARCH_EF_R25 25
38#define LOONGARCH_EF_R26 26
39#define LOONGARCH_EF_R27 27
40#define LOONGARCH_EF_R28 28
41#define LOONGARCH_EF_R29 29
42#define LOONGARCH_EF_R30 30
43#define LOONGARCH_EF_R31 31
44
45/*
46 * Saved special registers
47 */
48#define LOONGARCH_EF_ORIG_A0 32
49#define LOONGARCH_EF_CSR_ERA 33
50#define LOONGARCH_EF_CSR_BADV 34
51#define LOONGARCH_EF_CSR_CRMD 35
52#define LOONGARCH_EF_CSR_PRMD 36
53#define LOONGARCH_EF_CSR_EUEN 37
54#define LOONGARCH_EF_CSR_ECFG 38
55#define LOONGARCH_EF_CSR_ESTAT 39
56
57#define LOONGARCH_EF_SIZE 320 /* size in bytes */
58
59#endif /* __UAPI_ASM_LOONGARCH_REG_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/sigcontext.h created+44
......@@ -0,0 +1,44 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Author: Hanlu Li <lihanlu@loongson.cn>
4 * Huacai Chen <chenhuacai@loongson.cn>
5 *
6 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
7 */
8#ifndef _ASM_SIGCONTEXT_H
9#define _ASM_SIGCONTEXT_H
10
11#include <linux/types.h>
12#include <linux/posix_types.h>
13
14/* FP context was used */
15#define SC_USED_FP (1 << 0)
16/* Address error was due to memory load */
17#define SC_ADDRERR_RD (1 << 30)
18/* Address error was due to memory store */
19#define SC_ADDRERR_WR (1 << 31)
20
21struct sigcontext {
22 __u64 sc_pc;
23 __u64 sc_regs[32];
24 __u32 sc_flags;
25 __u64 sc_extcontext[0] __attribute__((__aligned__(16)));
26};
27
28#define CONTEXT_INFO_ALIGN 16
29struct sctx_info {
30 __u32 magic;
31 __u32 size;
32 __u64 padding; /* padding to 16 bytes */
33};
34
35/* FPU context */
36#define FPU_CTX_MAGIC 0x46505501
37#define FPU_CTX_ALIGN 8
38struct fpu_context {
39 __u64 regs[32];
40 __u64 fcc;
41 __u32 fcsr;
42};
43
44#endif /* _ASM_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/signal.h created+13
......@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
4 */
5#ifndef _ASM_SIGNAL_H
6#define _ASM_SIGNAL_H
7
8#define MINSIGSTKSZ 4096
9#define SIGSTKSZ 16384
10
11#include <asm-generic/signal.h>
12
13#endif
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/ucontext.h created+35
......@@ -0,0 +1,35 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __LOONGARCH_UAPI_ASM_UCONTEXT_H
3#define __LOONGARCH_UAPI_ASM_UCONTEXT_H
4
5/**
6 * struct ucontext - user context structure
7 * @uc_flags:
8 * @uc_link:
9 * @uc_stack:
10 * @uc_mcontext: holds basic processor state
11 * @uc_sigmask:
12 * @uc_extcontext: holds extended processor state
13 */
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 sigset_t uc_sigmask;
19 /* There's some padding here to allow sigset_t to be expanded in the
20 * future. Though this is unlikely, other architectures put uc_sigmask
21 * at the end of this structure and explicitly state it can be
22 * expanded, so we didn't want to box ourselves in here. */
23 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
24 /* We can't put uc_sigmask at the end of this structure because we need
25 * to be able to expand sigcontext in the future. For example, the
26 * vector ISA extension will almost certainly add ISA state. We want
27 * to ensure all user-visible ISA state can be saved and restored via a
28 * ucontext, so we're putting this at the end in order to allow for
29 * infinite extensibility. Since we know this will be extended and we
30 * assume sigset_t won't be extended an extreme amount, we're
31 * prioritizing this. */
32 struct sigcontext uc_mcontext;
33};
34
35#endif /* __LOONGARCH_UAPI_ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/unistd.h created+5
......@@ -0,0 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#define __ARCH_WANT_SYS_CLONE
3#define __ARCH_WANT_SYS_CLONE3
4
5#include <asm-generic/unistd.h>
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-virt.h created+21
......@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * asm/bootinfo-virt.h -- Virtual-m68k-specific boot information definitions
4 */
5
6#ifndef _ASM_M68K_BOOTINFO_VIRT_H
7#define _ASM_M68K_BOOTINFO_VIRT_H
8
9#define BI_VIRT_QEMU_VERSION 0x8000
10#define BI_VIRT_GF_PIC_BASE 0x8001
11#define BI_VIRT_GF_RTC_BASE 0x8002
12#define BI_VIRT_GF_TTY_BASE 0x8003
13#define BI_VIRT_VIRTIO_BASE 0x8004
14#define BI_VIRT_CTRL_BASE 0x8005
15
16/* No longer used -- replaced with BI_RNG_SEED -- but don't reuse this index:
17 * #define BI_VIRT_RNG_SEED 0x8006 */
18
19#define VIRT_BOOTI_VERSION MK_BI_VERSION(2, 0)
20
21#endif /* _ASM_M68K_BOOTINFO_MAC_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo.h+10-2
......@@ -34,7 +34,7 @@
3434struct bi_record {
3535 __be16 tag; /* tag ID */
3636 __be16 size; /* size of record (in bytes) */
37 __be32 data[0]; /* data */
37 __be32 data[]; /* data */
3838};
3939
4040
......@@ -64,6 +64,13 @@ struct mem_info {
6464 /* (struct mem_info) */
6565#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
6666 /* (string) */
67/*
68 * A random seed used to initialize the RNG. Record format:
69 *
70 * - length [ 2 bytes, 16-bit big endian ]
71 * - seed data [ `length` bytes, padded to preserve 4-byte struct alignment ]
72 */
73#define BI_RNG_SEED 0x0008
6774
6875
6976 /*
......@@ -83,6 +90,7 @@ struct mem_info {
8390#define MACH_SUN3X 11
8491#define MACH_M54XX 12
8592#define MACH_M5441X 13
93#define MACH_VIRT 14
8694
8795
8896 /*
......@@ -167,7 +175,7 @@ struct bootversion {
167175 struct {
168176 __be32 machtype;
169177 __be32 version;
170 } machversions[0];
178 } machversions[];
171179} __attribute__((packed));
172180
173181#endif /* __ASSEMBLY__ */
lib/libc/include/m68k-linux-any/asm/ptrace.h+5
......@@ -74,7 +74,12 @@ struct switch_stack {
7474
7575#define PTRACE_GET_THREAD_AREA 25
7676
77#define PTRACE_GETFDPIC 31
78
7779#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
7880
81#define PTRACE_GETFDPIC_EXEC 0
82#define PTRACE_GETFDPIC_INTERP 1
83
7984#endif /* __ASSEMBLY__ */
8085#endif /* _M68K_PTRACE_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/signal.h+1-1
......@@ -79,7 +79,7 @@ struct sigaction {
7979typedef struct sigaltstack {
8080 void *ss_sp;
8181 int ss_flags;
82 size_t ss_size;
82 __kernel_size_t ss_size;
8383} stack_t;
8484
8585#endif /* _M68K_SIGNAL_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd_32.h+1
......@@ -422,6 +422,7 @@
422422#define __NR_landlock_restrict_self 446
423423#define __NR_process_mrelease 448
424424#define __NR_futex_waitv 449
425#define __NR_set_mempolicy_home_node 450
425426
426427
427428#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/fcntl.h+5-25
......@@ -44,36 +44,16 @@
4444#define F_SETOWN 24 /* for sockets. */
4545#define F_GETOWN 23 /* for sockets. */
4646
47#ifndef __mips64
47#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
4848#define F_GETLK64 33 /* using 'struct flock64' */
4949#define F_SETLK64 34
5050#define F_SETLKW64 35
51#endif
52
53/*
54 * The flavours of struct flock. "struct flock" is the ABI compliant
55 * variant. Finally struct flock64 is the LFS variant of struct flock. As
56 * a historic accident and inconsistence with the ABI definition it doesn't
57 * contain all the same fields as struct flock.
58 */
51#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
5952
6053#if _MIPS_SIM != _MIPS_SIM_ABI64
61
62#include <linux/types.h>
63
64struct flock {
65 short l_type;
66 short l_whence;
67 __kernel_off_t l_start;
68 __kernel_off_t l_len;
69 long l_sysid;
70 __kernel_pid_t l_pid;
71 long pad[4];
72};
73
74#define HAVE_ARCH_STRUCT_FLOCK
75
76#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
54#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid;
55#define __ARCH_FLOCK_PAD long pad[4];
56#endif
7757
7858#include <asm-generic/fcntl.h>
7959
lib/libc/include/mips-linux-any/asm/mman.h+4
......@@ -101,6 +101,10 @@
101101#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
102102#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
103103
104#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
105
106#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
107
104108/* compatibility flags */
105109#define MAP_FILE 0
106110
lib/libc/include/mips-linux-any/asm/shmbuf.h+5-2
......@@ -2,6 +2,9 @@
22#ifndef _ASM_SHMBUF_H
33#define _ASM_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
58/*
69 * The shmid64_ds structure for the MIPS architecture.
710 * Note extra padding because this structure is passed back and forth
......@@ -16,7 +19,7 @@
1619#ifdef __mips64
1720struct shmid64_ds {
1821 struct ipc64_perm shm_perm; /* operation perms */
19 size_t shm_segsz; /* size of segment (bytes) */
22 __kernel_size_t shm_segsz; /* size of segment (bytes) */
2023 long shm_atime; /* last attach time */
2124 long shm_dtime; /* last detach time */
2225 long shm_ctime; /* last change time */
......@@ -29,7 +32,7 @@ struct shmid64_ds {
2932#else
3033struct shmid64_ds {
3134 struct ipc64_perm shm_perm; /* operation perms */
32 size_t shm_segsz; /* size of segment (bytes) */
35 __kernel_size_t shm_segsz; /* size of segment (bytes) */
3336 unsigned long shm_atime; /* last attach time */
3437 unsigned long shm_dtime; /* last detach time */
3538 unsigned long shm_ctime; /* last change time */
lib/libc/include/mips-linux-any/asm/signal.h+1-1
......@@ -98,7 +98,7 @@ struct sigaction {
9898/* IRIX compatible stack_t */
9999typedef struct sigaltstack {
100100 void *ss_sp;
101 size_t ss_size;
101 __kernel_size_t ss_size;
102102 int ss_flags;
103103} stack_t;
104104
lib/libc/include/mips-linux-any/asm/socket.h+4
......@@ -144,6 +144,10 @@
144144
145145#define SO_RESERVE_MEM 73
146146
147#define SO_TXREHASH 74
148
149#define SO_RCVMARK 75
150
147151
148152#if __BITS_PER_LONG == 64
149153#define SO_TIMESTAMP SO_TIMESTAMP_OLD
lib/libc/include/mips-linux-any/asm/stat.h+10-10
......@@ -19,11 +19,11 @@
1919struct stat {
2020 unsigned st_dev;
2121 long st_pad1[3]; /* Reserved for network id */
22 ino_t st_ino;
23 mode_t st_mode;
22 __kernel_ino_t st_ino;
23 __kernel_mode_t st_mode;
2424 __u32 st_nlink;
25 uid_t st_uid;
26 gid_t st_gid;
25 __kernel_uid32_t st_uid;
26 __kernel_gid32_t st_gid;
2727 unsigned st_rdev;
2828 long st_pad2[2];
2929 long st_size;
......@@ -55,11 +55,11 @@ struct stat64 {
5555
5656 unsigned long long st_ino;
5757
58 mode_t st_mode;
58 __kernel_mode_t st_mode;
5959 __u32 st_nlink;
6060
61 uid_t st_uid;
62 gid_t st_gid;
61 __kernel_uid32_t st_uid;
62 __kernel_gid32_t st_gid;
6363
6464 unsigned long st_rdev;
6565 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
......@@ -96,11 +96,11 @@ struct stat {
9696
9797 unsigned long st_ino;
9898
99 mode_t st_mode;
99 __kernel_mode_t st_mode;
100100 __u32 st_nlink;
101101
102 uid_t st_uid;
103 gid_t st_gid;
102 __kernel_uid32_t st_uid;
103 __kernel_gid32_t st_gid;
104104
105105 unsigned int st_rdev;
106106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
lib/libc/include/mips-linux-any/asm/termbits.h+99-150
......@@ -11,11 +11,9 @@
1111#ifndef _ASM_TERMBITS_H
1212#define _ASM_TERMBITS_H
1313
14#include <linux/posix_types.h>
14#include <asm-generic/termbits-common.h>
1515
16typedef unsigned char cc_t;
17typedef unsigned int speed_t;
18typedef unsigned int tcflag_t;
16typedef unsigned int tcflag_t;
1917
2018/*
2119 * The ABI says nothing about NCC but seems to use NCCS as
......@@ -54,175 +52,126 @@ struct ktermios {
5452};
5553
5654/* c_cc characters */
57#define VINTR 0 /* Interrupt character [ISIG]. */
58#define VQUIT 1 /* Quit character [ISIG]. */
59#define VERASE 2 /* Erase character [ICANON]. */
60#define VKILL 3 /* Kill-line character [ICANON]. */
61#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */
62#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */
63#define VEOL2 6 /* Second EOL character [ICANON]. */
55#define VINTR 0 /* Interrupt character [ISIG] */
56#define VQUIT 1 /* Quit character [ISIG] */
57#define VERASE 2 /* Erase character [ICANON] */
58#define VKILL 3 /* Kill-line character [ICANON] */
59#define VMIN 4 /* Minimum number of bytes read at once [!ICANON] */
60#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON] */
61#define VEOL2 6 /* Second EOL character [ICANON] */
6462#define VSWTC 7 /* ??? */
6563#define VSWTCH VSWTC
66#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */
67#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */
68#define VSUSP 10 /* Suspend character [ISIG]. */
64#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF] */
65#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF] */
66#define VSUSP 10 /* Suspend character [ISIG] */
6967#if 0
7068/*
7169 * VDSUSP is not supported
7270 */
73#define VDSUSP 11 /* Delayed suspend character [ISIG]. */
71#define VDSUSP 11 /* Delayed suspend character [ISIG] */
7472#endif
75#define VREPRINT 12 /* Reprint-line character [ICANON]. */
76#define VDISCARD 13 /* Discard character [IEXTEN]. */
77#define VWERASE 14 /* Word-erase character [ICANON]. */
78#define VLNEXT 15 /* Literal-next character [IEXTEN]. */
79#define VEOF 16 /* End-of-file character [ICANON]. */
80#define VEOL 17 /* End-of-line character [ICANON]. */
73#define VREPRINT 12 /* Reprint-line character [ICANON] */
74#define VDISCARD 13 /* Discard character [IEXTEN] */
75#define VWERASE 14 /* Word-erase character [ICANON] */
76#define VLNEXT 15 /* Literal-next character [IEXTEN] */
77#define VEOF 16 /* End-of-file character [ICANON] */
78#define VEOL 17 /* End-of-line character [ICANON] */
8179
8280/* c_iflag bits */
83#define IGNBRK 0000001 /* Ignore break condition. */
84#define BRKINT 0000002 /* Signal interrupt on break. */
85#define IGNPAR 0000004 /* Ignore characters with parity errors. */
86#define PARMRK 0000010 /* Mark parity and framing errors. */
87#define INPCK 0000020 /* Enable input parity check. */
88#define ISTRIP 0000040 /* Strip 8th bit off characters. */
89#define INLCR 0000100 /* Map NL to CR on input. */
90#define IGNCR 0000200 /* Ignore CR. */
91#define ICRNL 0000400 /* Map CR to NL on input. */
92#define IUCLC 0001000 /* Map upper case to lower case on input. */
93#define IXON 0002000 /* Enable start/stop output control. */
94#define IXANY 0004000 /* Any character will restart after stop. */
95#define IXOFF 0010000 /* Enable start/stop input control. */
96#define IMAXBEL 0020000 /* Ring bell when input queue is full. */
97#define IUTF8 0040000 /* Input is UTF-8 */
81#define IUCLC 0x0200 /* Map upper case to lower case on input */
82#define IXON 0x0400 /* Enable start/stop output control */
83#define IXOFF 0x1000 /* Enable start/stop input control */
84#define IMAXBEL 0x2000 /* Ring bell when input queue is full */
85#define IUTF8 0x4000 /* Input is UTF-8 */
9886
9987/* c_oflag bits */
100#define OPOST 0000001 /* Perform output processing. */
101#define OLCUC 0000002 /* Map lower case to upper case on output. */
102#define ONLCR 0000004 /* Map NL to CR-NL on output. */
103#define OCRNL 0000010
104#define ONOCR 0000020
105#define ONLRET 0000040
106#define OFILL 0000100
107#define OFDEL 0000200
108#define NLDLY 0000400
109#define NL0 0000000
110#define NL1 0000400
111#define CRDLY 0003000
112#define CR0 0000000
113#define CR1 0001000
114#define CR2 0002000
115#define CR3 0003000
116#define TABDLY 0014000
117#define TAB0 0000000
118#define TAB1 0004000
119#define TAB2 0010000
120#define TAB3 0014000
121#define XTABS 0014000
122#define BSDLY 0020000
123#define BS0 0000000
124#define BS1 0020000
125#define VTDLY 0040000
126#define VT0 0000000
127#define VT1 0040000
128#define FFDLY 0100000
129#define FF0 0000000
130#define FF1 0100000
88#define OLCUC 0x00002 /* Map lower case to upper case on output */
89#define ONLCR 0x00004 /* Map NL to CR-NL on output */
90#define NLDLY 0x00100
91#define NL0 0x00000
92#define NL1 0x00100
93#define CRDLY 0x00600
94#define CR0 0x00000
95#define CR1 0x00200
96#define CR2 0x00400
97#define CR3 0x00600
98#define TABDLY 0x01800
99#define TAB0 0x00000
100#define TAB1 0x00800
101#define TAB2 0x01000
102#define TAB3 0x01800
103#define XTABS 0x01800
104#define BSDLY 0x02000
105#define BS0 0x00000
106#define BS1 0x02000
107#define VTDLY 0x04000
108#define VT0 0x00000
109#define VT1 0x04000
110#define FFDLY 0x08000
111#define FF0 0x00000
112#define FF1 0x08000
131113/*
132114#define PAGEOUT ???
133115#define WRAP ???
134116 */
135117
136118/* c_cflag bit meaning */
137#define CBAUD 0010017
138#define B0 0000000 /* hang up */
139#define B50 0000001
140#define B75 0000002
141#define B110 0000003
142#define B134 0000004
143#define B150 0000005
144#define B200 0000006
145#define B300 0000007
146#define B600 0000010
147#define B1200 0000011
148#define B1800 0000012
149#define B2400 0000013
150#define B4800 0000014
151#define B9600 0000015
152#define B19200 0000016
153#define B38400 0000017
154#define EXTA B19200
155#define EXTB B38400
156#define CSIZE 0000060 /* Number of bits per byte (mask). */
157#define CS5 0000000 /* 5 bits per byte. */
158#define CS6 0000020 /* 6 bits per byte. */
159#define CS7 0000040 /* 7 bits per byte. */
160#define CS8 0000060 /* 8 bits per byte. */
161#define CSTOPB 0000100 /* Two stop bits instead of one. */
162#define CREAD 0000200 /* Enable receiver. */
163#define PARENB 0000400 /* Parity enable. */
164#define PARODD 0001000 /* Odd parity instead of even. */
165#define HUPCL 0002000 /* Hang up on last close. */
166#define CLOCAL 0004000 /* Ignore modem status lines. */
167#define CBAUDEX 0010000
168#define BOTHER 0010000
169#define B57600 0010001
170#define B115200 0010002
171#define B230400 0010003
172#define B460800 0010004
173#define B500000 0010005
174#define B576000 0010006
175#define B921600 0010007
176#define B1000000 0010010
177#define B1152000 0010011
178#define B1500000 0010012
179#define B2000000 0010013
180#define B2500000 0010014
181#define B3000000 0010015
182#define B3500000 0010016
183#define B4000000 0010017
184#define CIBAUD 002003600000 /* input baud rate */
185#define CMSPAR 010000000000 /* mark or space (stick) parity */
186#define CRTSCTS 020000000000 /* flow control */
187
188#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
119#define CBAUD 0x0000100f
120#define CSIZE 0x00000030 /* Number of bits per byte (mask) */
121#define CS5 0x00000000 /* 5 bits per byte */
122#define CS6 0x00000010 /* 6 bits per byte */
123#define CS7 0x00000020 /* 7 bits per byte */
124#define CS8 0x00000030 /* 8 bits per byte */
125#define CSTOPB 0x00000040 /* Two stop bits instead of one */
126#define CREAD 0x00000080 /* Enable receiver */
127#define PARENB 0x00000100 /* Parity enable */
128#define PARODD 0x00000200 /* Odd parity instead of even */
129#define HUPCL 0x00000400 /* Hang up on last close */
130#define CLOCAL 0x00000800 /* Ignore modem status lines */
131#define CBAUDEX 0x00001000
132#define BOTHER 0x00001000
133#define B57600 0x00001001
134#define B115200 0x00001002
135#define B230400 0x00001003
136#define B460800 0x00001004
137#define B500000 0x00001005
138#define B576000 0x00001006
139#define B921600 0x00001007
140#define B1000000 0x00001008
141#define B1152000 0x00001009
142#define B1500000 0x0000100a
143#define B2000000 0x0000100b
144#define B2500000 0x0000100c
145#define B3000000 0x0000100d
146#define B3500000 0x0000100e
147#define B4000000 0x0000100f
148#define CIBAUD 0x100f0000 /* input baud rate */
189149
190150/* c_lflag bits */
191#define ISIG 0000001 /* Enable signals. */
192#define ICANON 0000002 /* Do erase and kill processing. */
193#define XCASE 0000004
194#define ECHO 0000010 /* Enable echo. */
195#define ECHOE 0000020 /* Visual erase for ERASE. */
196#define ECHOK 0000040 /* Echo NL after KILL. */
197#define ECHONL 0000100 /* Echo NL even if ECHO is off. */
198#define NOFLSH 0000200 /* Disable flush after interrupt. */
199#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */
200#define ECHOCTL 0001000 /* Echo control characters as ^X. */
201#define ECHOPRT 0002000 /* Hardcopy visual erase. */
202#define ECHOKE 0004000 /* Visual erase for KILL. */
203#define FLUSHO 0020000
204#define PENDIN 0040000 /* Retype pending input (state). */
205#define TOSTOP 0100000 /* Send SIGTTOU for background output. */
206#define ITOSTOP TOSTOP
207#define EXTPROC 0200000 /* External processing on pty */
151#define ISIG 0x00001 /* Enable signals */
152#define ICANON 0x00002 /* Do erase and kill processing */
153#define XCASE 0x00004
154#define ECHO 0x00008 /* Enable echo */
155#define ECHOE 0x00010 /* Visual erase for ERASE */
156#define ECHOK 0x00020 /* Echo NL after KILL */
157#define ECHONL 0x00040 /* Echo NL even if ECHO is off */
158#define NOFLSH 0x00080 /* Disable flush after interrupt */
159#define IEXTEN 0x00100 /* Enable DISCARD and LNEXT */
160#define ECHOCTL 0x00200 /* Echo control characters as ^X */
161#define ECHOPRT 0x00400 /* Hardcopy visual erase */
162#define ECHOKE 0x00800 /* Visual erase for KILL */
163#define FLUSHO 0x02000
164#define PENDIN 0x04000 /* Retype pending input (state) */
165#define TOSTOP 0x08000 /* Send SIGTTOU for background output */
166#define ITOSTOP TOSTOP
167#define EXTPROC 0x10000 /* External processing on pty */
208168
209169/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
210170#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
211171
212/* tcflow() and TCXONC use these */
213#define TCOOFF 0 /* Suspend output. */
214#define TCOON 1 /* Restart suspended output. */
215#define TCIOFF 2 /* Send a STOP character. */
216#define TCION 3 /* Send a START character. */
217
218/* tcflush() and TCFLSH use these */
219#define TCIFLUSH 0 /* Discard data received but not yet read. */
220#define TCOFLUSH 1 /* Discard data written but not yet sent. */
221#define TCIOFLUSH 2 /* Discard all pending data. */
222
223172/* tcsetattr uses these */
224#define TCSANOW TCSETS /* Change immediately. */
225#define TCSADRAIN TCSETSW /* Change when pending output is written. */
226#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */
173#define TCSANOW TCSETS /* Change immediately */
174#define TCSADRAIN TCSETSW /* Change when pending output is written */
175#define TCSAFLUSH TCSETSF /* Flush pending input before changing */
227176
228177#endif /* _ASM_TERMBITS_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/ucontext.h+1-1
......@@ -60,7 +60,7 @@ struct ucontext {
6060 sigset_t uc_sigmask;
6161
6262 /* Extended context structures may follow ucontext */
63 unsigned long long uc_extcontext[0];
63 unsigned long long uc_extcontext[];
6464};
6565
6666#endif /* __MIPS_UAPI_ASM_UCONTEXT_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n32.h+1
......@@ -378,5 +378,6 @@
378378#define __NR_landlock_restrict_self (__NR_Linux + 446)
379379#define __NR_process_mrelease (__NR_Linux + 448)
380380#define __NR_futex_waitv (__NR_Linux + 449)
381#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
381382
382383#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h+1
......@@ -354,5 +354,6 @@
354354#define __NR_landlock_restrict_self (__NR_Linux + 446)
355355#define __NR_process_mrelease (__NR_Linux + 448)
356356#define __NR_futex_waitv (__NR_Linux + 449)
357#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
357358
358359#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h+1
......@@ -424,5 +424,6 @@
424424#define __NR_landlock_restrict_self (__NR_Linux + 446)
425425#define __NR_process_mrelease (__NR_Linux + 448)
426426#define __NR_futex_waitv (__NR_Linux + 449)
427#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
427428
428429#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/auxvec.h+3-1
......@@ -48,6 +48,8 @@
4848#define AT_L3_CACHESIZE 46
4949#define AT_L3_CACHEGEOMETRY 47
5050
51#define AT_VECTOR_SIZE_ARCH 14 /* entries in ARCH_DLINFO */
51#define AT_MINSIGSTKSZ 51 /* stack needed for signal delivery */
52
53#define AT_VECTOR_SIZE_ARCH 15 /* entries in ARCH_DLINFO */
5254
5355#endif
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/bpf_perf_event.h deleted-9
......@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_BPF_PERF_EVENT_H__
3#define __ASM_BPF_PERF_EVENT_H__
4
5#include <asm/ptrace.h>
6
7typedef struct user_pt_regs bpf_user_pt_regs_t;
8
9#endif /* __ASM_BPF_PERF_EVENT_H__ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/elf.h-8
......@@ -289,12 +289,4 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
289289/* Keep this the last entry. */
290290#define R_PPC64_NUM 253
291291
292/* There's actually a third entry here, but it's unused */
293struct ppc64_opd_entry
294{
295 unsigned long funcaddr;
296 unsigned long r2;
297};
298
299
300292#endif /* _ASM_POWERPC_ELF_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr_pdsm.h+18
......@@ -116,6 +116,22 @@ struct nd_papr_pdsm_health {
116116 };
117117};
118118
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
119135/*
120136 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
121137 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
......@@ -123,12 +139,14 @@ struct nd_papr_pdsm_health {
123139enum papr_pdsm {
124140 PAPR_PDSM_MIN = 0x0,
125141 PAPR_PDSM_HEALTH,
142 PAPR_PDSM_SMART_INJECT,
126143 PAPR_PDSM_MAX,
127144};
128145
129146/* Maximal union that can hold all possible payload types */
130147union nd_pdsm_payload {
131148 struct nd_papr_pdsm_health health;
149 struct nd_papr_pdsm_smart_inject smart_inject;
132150 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
133151} __attribute__((packed));
134152
lib/libc/include/powerpc-linux-any/asm/shmbuf.h+4-1
......@@ -2,6 +2,9 @@
22#ifndef _ASM_POWERPC_SHMBUF_H
33#define _ASM_POWERPC_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
58/*
69 * This program is free software; you can redistribute it and/or
710 * modify it under the terms of the GNU General Public License
......@@ -34,7 +37,7 @@ struct shmid64_ds {
3437 unsigned long shm_ctime; /* last change time */
3538 unsigned long __unused4;
3639#endif
37 size_t shm_segsz; /* size of segment (bytes) */
40 __kernel_size_t shm_segsz; /* size of segment (bytes) */
3841 __kernel_pid_t shm_cpid; /* pid of creator */
3942 __kernel_pid_t shm_lpid; /* pid of last operator */
4043 unsigned long shm_nattch; /* no. of current attaches */
lib/libc/include/powerpc-linux-any/asm/signal.h+6-1
......@@ -62,8 +62,13 @@ typedef struct {
6262
6363#define SA_RESTORER 0x04000000U
6464
65#ifdef __powerpc64__
66#define MINSIGSTKSZ 8192
67#define SIGSTKSZ 32768
68#else
6569#define MINSIGSTKSZ 2048
6670#define SIGSTKSZ 8192
71#endif
6772
6873#include <asm-generic/signal-defs.h>
6974
......@@ -84,7 +89,7 @@ struct sigaction {
8489typedef struct sigaltstack {
8590 void *ss_sp;
8691 int ss_flags;
87 size_t ss_size;
92 __kernel_size_t ss_size;
8893} stack_t;
8994
9095
lib/libc/include/powerpc-linux-any/asm/stat.h+5-5
......@@ -29,16 +29,16 @@ struct __old_kernel_stat {
2929
3030struct stat {
3131 unsigned long st_dev;
32 ino_t st_ino;
32 __kernel_ino_t st_ino;
3333#ifdef __powerpc64__
3434 unsigned long st_nlink;
35 mode_t st_mode;
35 __kernel_mode_t st_mode;
3636#else
37 mode_t st_mode;
37 __kernel_mode_t st_mode;
3838 unsigned short st_nlink;
3939#endif
40 uid_t st_uid;
41 gid_t st_gid;
40 __kernel_uid32_t st_uid;
41 __kernel_gid32_t st_gid;
4242 unsigned long st_rdev;
4343 long st_size;
4444 unsigned long st_blksize;
lib/libc/include/powerpc-linux-any/asm/termbits.h+64-118
......@@ -9,8 +9,8 @@
99 * 2 of the License, or (at your option) any later version.
1010 */
1111
12typedef unsigned char cc_t;
13typedef unsigned int speed_t;
12#include <asm-generic/termbits-common.h>
13
1414typedef unsigned int tcflag_t;
1515
1616/*
......@@ -64,115 +64,72 @@ struct ktermios {
6464#define VDISCARD 16
6565
6666/* c_iflag bits */
67#define IGNBRK 0000001
68#define BRKINT 0000002
69#define IGNPAR 0000004
70#define PARMRK 0000010
71#define INPCK 0000020
72#define ISTRIP 0000040
73#define INLCR 0000100
74#define IGNCR 0000200
75#define ICRNL 0000400
76#define IXON 0001000
77#define IXOFF 0002000
78#define IXANY 0004000
79#define IUCLC 0010000
80#define IMAXBEL 0020000
81#define IUTF8 0040000
67#define IXON 0x0200
68#define IXOFF 0x0400
69#define IUCLC 0x1000
70#define IMAXBEL 0x2000
71#define IUTF8 0x4000
8272
8373/* c_oflag bits */
84#define OPOST 0000001
85#define ONLCR 0000002
86#define OLCUC 0000004
87
88#define OCRNL 0000010
89#define ONOCR 0000020
90#define ONLRET 0000040
91
92#define OFILL 00000100
93#define OFDEL 00000200
94#define NLDLY 00001400
95#define NL0 00000000
96#define NL1 00000400
97#define NL2 00001000
98#define NL3 00001400
99#define TABDLY 00006000
100#define TAB0 00000000
101#define TAB1 00002000
102#define TAB2 00004000
103#define TAB3 00006000
104#define XTABS 00006000 /* required by POSIX to == TAB3 */
105#define CRDLY 00030000
106#define CR0 00000000
107#define CR1 00010000
108#define CR2 00020000
109#define CR3 00030000
110#define FFDLY 00040000
111#define FF0 00000000
112#define FF1 00040000
113#define BSDLY 00100000
114#define BS0 00000000
115#define BS1 00100000
116#define VTDLY 00200000
117#define VT0 00000000
118#define VT1 00200000
74#define ONLCR 0x00002
75#define OLCUC 0x00004
76#define NLDLY 0x00300
77#define NL0 0x00000
78#define NL1 0x00100
79#define NL2 0x00200
80#define NL3 0x00300
81#define TABDLY 0x00c00
82#define TAB0 0x00000
83#define TAB1 0x00400
84#define TAB2 0x00800
85#define TAB3 0x00c00
86#define XTABS 0x00c00 /* required by POSIX to == TAB3 */
87#define CRDLY 0x03000
88#define CR0 0x00000
89#define CR1 0x01000
90#define CR2 0x02000
91#define CR3 0x03000
92#define FFDLY 0x04000
93#define FF0 0x00000
94#define FF1 0x04000
95#define BSDLY 0x08000
96#define BS0 0x00000
97#define BS1 0x08000
98#define VTDLY 0x10000
99#define VT0 0x00000
100#define VT1 0x10000
119101
120102/* c_cflag bit meaning */
121#define CBAUD 0000377
122#define B0 0000000 /* hang up */
123#define B50 0000001
124#define B75 0000002
125#define B110 0000003
126#define B134 0000004
127#define B150 0000005
128#define B200 0000006
129#define B300 0000007
130#define B600 0000010
131#define B1200 0000011
132#define B1800 0000012
133#define B2400 0000013
134#define B4800 0000014
135#define B9600 0000015
136#define B19200 0000016
137#define B38400 0000017
138#define EXTA B19200
139#define EXTB B38400
140#define CBAUDEX 0000000
141#define B57600 00020
142#define B115200 00021
143#define B230400 00022
144#define B460800 00023
145#define B500000 00024
146#define B576000 00025
147#define B921600 00026
148#define B1000000 00027
149#define B1152000 00030
150#define B1500000 00031
151#define B2000000 00032
152#define B2500000 00033
153#define B3000000 00034
154#define B3500000 00035
155#define B4000000 00036
156#define BOTHER 00037
157
158#define CIBAUD 077600000
159#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
160
161#define CSIZE 00001400
162#define CS5 00000000
163#define CS6 00000400
164#define CS7 00001000
165#define CS8 00001400
166
167#define CSTOPB 00002000
168#define CREAD 00004000
169#define PARENB 00010000
170#define PARODD 00020000
171#define HUPCL 00040000
172
173#define CLOCAL 00100000
174#define CMSPAR 010000000000 /* mark or space (stick) parity */
175#define CRTSCTS 020000000000 /* flow control */
103#define CBAUD 0x000000ff
104#define CBAUDEX 0x00000000
105#define BOTHER 0x0000001f
106#define B57600 0x00000010
107#define B115200 0x00000011
108#define B230400 0x00000012
109#define B460800 0x00000013
110#define B500000 0x00000014
111#define B576000 0x00000015
112#define B921600 0x00000016
113#define B1000000 0x00000017
114#define B1152000 0x00000018
115#define B1500000 0x00000019
116#define B2000000 0x0000001a
117#define B2500000 0x0000001b
118#define B3000000 0x0000001c
119#define B3500000 0x0000001d
120#define B4000000 0x0000001e
121#define CSIZE 0x00000300
122#define CS5 0x00000000
123#define CS6 0x00000100
124#define CS7 0x00000200
125#define CS8 0x00000300
126#define CSTOPB 0x00000400
127#define CREAD 0x00000800
128#define PARENB 0x00001000
129#define PARODD 0x00002000
130#define HUPCL 0x00004000
131#define CLOCAL 0x00008000
132#define CIBAUD 0x00ff0000
176133
177134/* c_lflag bits */
178135#define ISIG 0x00000080
......@@ -192,17 +149,6 @@ struct ktermios {
192149#define IEXTEN 0x00000400
193150#define EXTPROC 0x10000000
194151
195/* Values for the ACTION argument to `tcflow'. */
196#define TCOOFF 0
197#define TCOON 1
198#define TCIOFF 2
199#define TCION 3
200
201/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
202#define TCIFLUSH 0
203#define TCOFLUSH 1
204#define TCIOFLUSH 2
205
206152/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
207153#define TCSANOW 0
208154#define TCSADRAIN 1
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+1
......@@ -431,6 +431,7 @@
431431#define __NR_landlock_restrict_self 446
432432#define __NR_process_mrelease 448
433433#define __NR_futex_waitv 449
434#define __NR_set_mempolicy_home_node 450
434435
435436
436437#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h+1
......@@ -403,6 +403,7 @@
403403#define __NR_landlock_restrict_self 446
404404#define __NR_process_mrelease 448
405405#define __NR_futex_waitv 449
406#define __NR_set_mempolicy_home_node 450
406407
407408
408409#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/auxvec.h+3-1
......@@ -30,8 +30,10 @@
3030#define AT_L1D_CACHEGEOMETRY 43
3131#define AT_L2_CACHESIZE 44
3232#define AT_L2_CACHEGEOMETRY 45
33#define AT_L3_CACHESIZE 46
34#define AT_L3_CACHEGEOMETRY 47
3335
3436/* entries in ARCH_DLINFO */
35#define AT_VECTOR_SIZE_ARCH 7
37#define AT_VECTOR_SIZE_ARCH 9
3638
3739#endif /* _ASM_RISCV_AUXVEC_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/kvm.h+29
......@@ -48,6 +48,10 @@ struct kvm_sregs {
4848/* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
4949struct kvm_riscv_config {
5050 unsigned long isa;
51 unsigned long zicbom_block_size;
52 unsigned long mvendorid;
53 unsigned long marchid;
54 unsigned long mimpid;
5155};
5256
5357/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
......@@ -82,6 +86,28 @@ struct kvm_riscv_timer {
8286 __u64 state;
8387};
8488
89/*
90 * ISA extension IDs specific to KVM. This is not the same as the host ISA
91 * extension IDs as that is internal to the host and should not be exposed
92 * to the guest. This should always be contiguous to keep the mapping simple
93 * in KVM implementation.
94 */
95enum KVM_RISCV_ISA_EXT_ID {
96 KVM_RISCV_ISA_EXT_A = 0,
97 KVM_RISCV_ISA_EXT_C,
98 KVM_RISCV_ISA_EXT_D,
99 KVM_RISCV_ISA_EXT_F,
100 KVM_RISCV_ISA_EXT_H,
101 KVM_RISCV_ISA_EXT_I,
102 KVM_RISCV_ISA_EXT_M,
103 KVM_RISCV_ISA_EXT_SVPBMT,
104 KVM_RISCV_ISA_EXT_SSTC,
105 KVM_RISCV_ISA_EXT_SVINVAL,
106 KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
107 KVM_RISCV_ISA_EXT_ZICBOM,
108 KVM_RISCV_ISA_EXT_MAX,
109};
110
85111/* Possible states for kvm_riscv_timer */
86112#define KVM_RISCV_TIMER_STATE_OFF 0
87113#define KVM_RISCV_TIMER_STATE_ON 1
......@@ -123,6 +149,9 @@ struct kvm_riscv_timer {
123149#define KVM_REG_RISCV_FP_D_REG(name) \
124150 (offsetof(struct __riscv_d_ext_state, name) / sizeof(__u64))
125151
152/* ISA Extension registers are mapped as type 7 */
153#define KVM_REG_RISCV_ISA_EXT (0x07 << KVM_REG_RISCV_TYPE_SHIFT)
154
126155#endif
127156
128157#endif /* __LINUX_KVM_RISCV_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/setup.h created+8
......@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2
3#ifndef _ASM_RISCV_SETUP_H
4#define _ASM_RISCV_SETUP_H
5
6#define COMMAND_LINE_SIZE 1024
7
8#endif /* _ASM_RISCV_SETUP_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/ucontext.h+8-4
......@@ -15,19 +15,23 @@ struct ucontext {
1515 struct ucontext *uc_link;
1616 stack_t uc_stack;
1717 sigset_t uc_sigmask;
18 /* There's some padding here to allow sigset_t to be expanded in the
18 /*
19 * There's some padding here to allow sigset_t to be expanded in the
1920 * future. Though this is unlikely, other architectures put uc_sigmask
2021 * at the end of this structure and explicitly state it can be
21 * expanded, so we didn't want to box ourselves in here. */
22 * expanded, so we didn't want to box ourselves in here.
23 */
2224 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
23 /* We can't put uc_sigmask at the end of this structure because we need
25 /*
26 * We can't put uc_sigmask at the end of this structure because we need
2427 * to be able to expand sigcontext in the future. For example, the
2528 * vector ISA extension will almost certainly add ISA state. We want
2629 * to ensure all user-visible ISA state can be saved and restored via a
2730 * ucontext, so we're putting this at the end in order to allow for
2831 * infinite extensibility. Since we know this will be extended and we
2932 * assume sigset_t won't be extended an extreme amount, we're
30 * prioritizing this. */
33 * prioritizing this.
34 */
3135 struct sigcontext uc_mcontext;
3236};
3337
lib/libc/include/riscv-linux-any/asm/unistd.h+2-1
......@@ -15,12 +15,13 @@
1515 * along with this program. If not, see <https://www.gnu.org/licenses/>.
1616 */
1717
18#ifdef __LP64__
18#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
1919#define __ARCH_WANT_NEW_STAT
2020#define __ARCH_WANT_SET_GET_RLIMIT
2121#endif /* __LP64__ */
2222
2323#define __ARCH_WANT_SYS_CLONE3
24#define __ARCH_WANT_MEMFD_SECRET
2425
2526#include <asm-generic/unistd.h>
2627
lib/libc/include/s390x-linux-any/asm/dasd.h+14
......@@ -182,6 +182,18 @@ typedef struct format_data_t {
182182 unsigned int intensity;
183183} format_data_t;
184184
185/*
186 * struct dasd_copypair_swap_data_t
187 * represents all data necessary to issue a swap of the copy pair relation
188 */
189struct dasd_copypair_swap_data_t {
190 char primary[20]; /* BUSID of primary */
191 char secondary[20]; /* BUSID of secondary */
192
193 /* Reserved for future updates. */
194 __u8 reserved[64];
195};
196
185197/*
186198 * values to be used for format_data_t.intensity
187199 * 0/8: normal format
......@@ -326,6 +338,8 @@ struct dasd_snid_ioctl_data {
326338#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
327339/* Release Allocated Space */
328340#define BIODASDRAS _IOW(DASD_IOCTL_LETTER, 3, format_data_t)
341/* Swap copy pair relation */
342#define BIODASDCOPYPAIRSWAP _IOW(DASD_IOCTL_LETTER, 4, struct dasd_copypair_swap_data_t)
329343
330344/* Get Sense Path Group ID (SNID) data */
331345#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)
lib/libc/include/s390x-linux-any/asm/fs3270.h created+25
......@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_S390_UAPI_FS3270_H
3#define __ASM_S390_UAPI_FS3270_H
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7
8/* ioctls for fullscreen 3270 */
9#define TUBICMD _IO('3', 3) /* set ccw command for fs reads. */
10#define TUBOCMD _IO('3', 4) /* set ccw command for fs writes. */
11#define TUBGETI _IO('3', 7) /* get ccw command for fs reads. */
12#define TUBGETO _IO('3', 8) /* get ccw command for fs writes. */
13#define TUBGETMOD _IO('3', 13) /* get characteristics like model, cols, rows */
14
15/* For TUBGETMOD */
16struct raw3270_iocb {
17 __u16 model;
18 __u16 line_cnt;
19 __u16 col_cnt;
20 __u16 pf_cnt;
21 __u16 re_cnt;
22 __u16 map;
23};
24
25#endif /* __ASM_S390_UAPI_FS3270_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/hwctrset.h+3-3
......@@ -30,18 +30,18 @@ struct s390_ctrset_start { /* Set CPUs to operate on */
3030struct s390_ctrset_setdata { /* Counter set data */
3131 __u32 set; /* Counter set number */
3232 __u32 no_cnts; /* # of counters stored in cv[] */
33 __u64 cv[0]; /* Counter values (variable length) */
33 __u64 cv[]; /* Counter values (variable length) */
3434};
3535
3636struct s390_ctrset_cpudata { /* Counter set data per CPU */
3737 __u32 cpu_nr; /* CPU number */
3838 __u32 no_sets; /* # of counters sets in data[] */
39 struct s390_ctrset_setdata data[0];
39 struct s390_ctrset_setdata data[];
4040};
4141
4242struct s390_ctrset_read { /* Structure to get all ctr sets */
4343 __u64 no_cpus; /* Total # of CPUs data taken from */
44 struct s390_ctrset_cpudata data[0];
44 struct s390_ctrset_cpudata data[];
4545};
4646
4747#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
lib/libc/include/s390x-linux-any/asm/ipl.h+29
......@@ -27,6 +27,7 @@ enum ipl_pbt {
2727 IPL_PBT_FCP = 0,
2828 IPL_PBT_SCP_DATA = 1,
2929 IPL_PBT_CCW = 2,
30 IPL_PBT_ECKD = 3,
3031 IPL_PBT_NVME = 4,
3132};
3233
......@@ -111,6 +112,34 @@ struct ipl_pb0_ccw {
111112 __u8 reserved5[8];
112113} __attribute__((packed));
113114
115/* IPL Parameter Block 0 for ECKD */
116struct ipl_pb0_eckd {
117 __u32 len;
118 __u8 pbt;
119 __u8 reserved1[3];
120 __u32 reserved2[78];
121 __u8 opt;
122 __u8 reserved4[4];
123 __u8 reserved5:5;
124 __u8 ssid:3;
125 __u16 devno;
126 __u32 reserved6[5];
127 __u32 bootprog;
128 __u8 reserved7[12];
129 struct {
130 __u16 cyl;
131 __u8 head;
132 __u8 record;
133 __u32 reserved;
134 } br_chr __attribute__((packed));
135 __u32 scp_data_len;
136 __u8 reserved8[260];
137 __u8 scp_data[];
138} __attribute__((packed));
139
140#define IPL_PB0_ECKD_OPT_IPL 0x10
141#define IPL_PB0_ECKD_OPT_DUMP 0x20
142
114143#define IPL_PB0_CCW_VM_FLAG_NSS 0x80
115144#define IPL_PB0_CCW_VM_FLAG_VP 0x40
116145
lib/libc/include/s390x-linux-any/asm/kvm.h+1
......@@ -74,6 +74,7 @@ struct kvm_s390_io_adapter_req {
7474#define KVM_S390_VM_CRYPTO 2
7575#define KVM_S390_VM_CPU_MODEL 3
7676#define KVM_S390_VM_MIGRATION 4
77#define KVM_S390_VM_CPU_TOPOLOGY 5
7778
7879/* kvm attributes for mem_ctrl */
7980#define KVM_S390_VM_MEM_ENABLE_CMMA 0
lib/libc/include/s390x-linux-any/asm/pkey.h+1-1
......@@ -171,7 +171,7 @@ struct pkey_skey2pkey {
171171#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)
172172
173173/*
174 * Verify the given CCA AES secure key for being able to be useable with
174 * Verify the given CCA AES secure key for being able to be usable with
175175 * the pkey module. Check for correct key type and check for having at
176176 * least one crypto card being able to handle this key (master key
177177 * or old master key verification pattern matches).
lib/libc/include/s390x-linux-any/asm/raw3270.h created+75
......@@ -0,0 +1,75 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef __ASM_S390_UAPI_RAW3270_H
3#define __ASM_S390_UAPI_RAW3270_H
4
5/* Local Channel Commands */
6#define TC_WRITE 0x01 /* Write */
7#define TC_RDBUF 0x02 /* Read Buffer */
8#define TC_EWRITE 0x05 /* Erase write */
9#define TC_READMOD 0x06 /* Read modified */
10#define TC_EWRITEA 0x0d /* Erase write alternate */
11#define TC_WRITESF 0x11 /* Write structured field */
12
13/* Buffer Control Orders */
14#define TO_GE 0x08 /* Graphics Escape */
15#define TO_SF 0x1d /* Start field */
16#define TO_SBA 0x11 /* Set buffer address */
17#define TO_IC 0x13 /* Insert cursor */
18#define TO_PT 0x05 /* Program tab */
19#define TO_RA 0x3c /* Repeat to address */
20#define TO_SFE 0x29 /* Start field extended */
21#define TO_EUA 0x12 /* Erase unprotected to address */
22#define TO_MF 0x2c /* Modify field */
23#define TO_SA 0x28 /* Set attribute */
24
25/* Field Attribute Bytes */
26#define TF_INPUT 0x40 /* Visible input */
27#define TF_INPUTN 0x4c /* Invisible input */
28#define TF_INMDT 0xc1 /* Visible, Set-MDT */
29#define TF_LOG 0x60
30
31/* Character Attribute Bytes */
32#define TAT_RESET 0x00
33#define TAT_FIELD 0xc0
34#define TAT_EXTHI 0x41
35#define TAT_FGCOLOR 0x42
36#define TAT_CHARS 0x43
37#define TAT_BGCOLOR 0x45
38#define TAT_TRANS 0x46
39
40/* Extended-Highlighting Bytes */
41#define TAX_RESET 0x00
42#define TAX_BLINK 0xf1
43#define TAX_REVER 0xf2
44#define TAX_UNDER 0xf4
45
46/* Reset value */
47#define TAR_RESET 0x00
48
49/* Color values */
50#define TAC_RESET 0x00
51#define TAC_BLUE 0xf1
52#define TAC_RED 0xf2
53#define TAC_PINK 0xf3
54#define TAC_GREEN 0xf4
55#define TAC_TURQ 0xf5
56#define TAC_YELLOW 0xf6
57#define TAC_WHITE 0xf7
58#define TAC_DEFAULT 0x00
59
60/* Write Control Characters */
61#define TW_NONE 0x40 /* No particular action */
62#define TW_KR 0xc2 /* Keyboard restore */
63#define TW_PLUSALARM 0x04 /* Add this bit for alarm */
64
65#define RAW3270_FIRSTMINOR 1 /* First minor number */
66#define RAW3270_MAXDEVS 255 /* Max number of 3270 devices */
67
68#define AID_CLEAR 0x6d
69#define AID_ENTER 0x7d
70#define AID_PF3 0xf3
71#define AID_PF7 0xf7
72#define AID_PF8 0xf8
73#define AID_READ_PARTITION 0x88
74
75#endif /* __ASM_S390_UAPI_RAW3270_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/signal.h+1-1
......@@ -104,7 +104,7 @@ struct sigaction {
104104typedef struct sigaltstack {
105105 void *ss_sp;
106106 int ss_flags;
107 size_t ss_size;
107 __kernel_size_t ss_size;
108108} stack_t;
109109
110110
lib/libc/include/s390x-linux-any/asm/termios.h deleted-50
......@@ -1,50 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * S390 version
4 *
5 * Derived from "include/asm-i386/termios.h"
6 */
7
8#ifndef _S390_TERMIOS_H
9#define _S390_TERMIOS_H
10
11#include <asm/termbits.h>
12#include <asm/ioctls.h>
13
14struct winsize {
15 unsigned short ws_row;
16 unsigned short ws_col;
17 unsigned short ws_xpixel;
18 unsigned short ws_ypixel;
19};
20
21#define NCC 8
22struct termio {
23 unsigned short c_iflag; /* input mode flags */
24 unsigned short c_oflag; /* output mode flags */
25 unsigned short c_cflag; /* control mode flags */
26 unsigned short c_lflag; /* local mode flags */
27 unsigned char c_line; /* line discipline */
28 unsigned char c_cc[NCC]; /* control characters */
29};
30
31/* modem lines */
32#define TIOCM_LE 0x001
33#define TIOCM_DTR 0x002
34#define TIOCM_RTS 0x004
35#define TIOCM_ST 0x008
36#define TIOCM_SR 0x010
37#define TIOCM_CTS 0x020
38#define TIOCM_CAR 0x040
39#define TIOCM_RNG 0x080
40#define TIOCM_DSR 0x100
41#define TIOCM_CD TIOCM_CAR
42#define TIOCM_RI TIOCM_RNG
43#define TIOCM_OUT1 0x2000
44#define TIOCM_OUT2 0x4000
45#define TIOCM_LOOP 0x8000
46
47/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
48
49
50#endif /* _S390_TERMIOS_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/types.h+9-6
......@@ -12,15 +12,18 @@
1212
1313#ifndef __ASSEMBLY__
1414
15/* A address type so that arithmetic can be done on it & it can be upgraded to
16 64 bit when necessary
17*/
18typedef unsigned long addr_t;
15typedef unsigned long addr_t;
1916typedef __signed__ long saddr_t;
2017
2118typedef struct {
22 __u32 u[4];
23} __vector128;
19 union {
20 struct {
21 __u64 high;
22 __u64 low;
23 };
24 __u32 u[4];
25 };
26} __attribute__((packed, aligned(4))) __vector128;
2427
2528#endif /* __ASSEMBLY__ */
2629
lib/libc/include/s390x-linux-any/asm/unistd_32.h+1
......@@ -421,5 +421,6 @@
421421#define __NR_landlock_restrict_self 446
422422#define __NR_process_mrelease 448
423423#define __NR_futex_waitv 449
424#define __NR_set_mempolicy_home_node 450
424425
425426#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+1
......@@ -369,5 +369,6 @@
369369#define __NR_landlock_restrict_self 446
370370#define __NR_process_mrelease 448
371371#define __NR_futex_waitv 449
372#define __NR_set_mempolicy_home_node 450
372373
373374#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/uvdevice.h created+51
......@@ -0,0 +1,51 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright IBM Corp. 2022
4 * Author(s): Steffen Eiden <seiden@linux.ibm.com>
5 */
6#ifndef __S390_ASM_UVDEVICE_H
7#define __S390_ASM_UVDEVICE_H
8
9#include <linux/types.h>
10
11struct uvio_ioctl_cb {
12 __u32 flags;
13 __u16 uv_rc; /* UV header rc value */
14 __u16 uv_rrc; /* UV header rrc value */
15 __u64 argument_addr; /* Userspace address of uvio argument */
16 __u32 argument_len;
17 __u8 reserved14[0x40 - 0x14]; /* must be zero */
18};
19
20#define UVIO_ATT_USER_DATA_LEN 0x100
21#define UVIO_ATT_UID_LEN 0x10
22struct uvio_attest {
23 __u64 arcb_addr; /* 0x0000 */
24 __u64 meas_addr; /* 0x0008 */
25 __u64 add_data_addr; /* 0x0010 */
26 __u8 user_data[UVIO_ATT_USER_DATA_LEN]; /* 0x0018 */
27 __u8 config_uid[UVIO_ATT_UID_LEN]; /* 0x0118 */
28 __u32 arcb_len; /* 0x0128 */
29 __u32 meas_len; /* 0x012c */
30 __u32 add_data_len; /* 0x0130 */
31 __u16 user_data_len; /* 0x0134 */
32 __u16 reserved136; /* 0x0136 */
33};
34
35/*
36 * The following max values define an upper length for the IOCTL in/out buffers.
37 * However, they do not represent the maximum the Ultravisor allows which is
38 * often way smaller. By allowing larger buffer sizes we hopefully do not need
39 * to update the code with every machine update. It is therefore possible for
40 * userspace to request more memory than actually used by kernel/UV.
41 */
42#define UVIO_ATT_ARCB_MAX_LEN 0x100000
43#define UVIO_ATT_MEASUREMENT_MAX_LEN 0x8000
44#define UVIO_ATT_ADDITIONAL_MAX_LEN 0x8000
45
46#define UVIO_DEVICE_NAME "uv"
47#define UVIO_TYPE_UVC 'u'
48
49#define UVIO_IOCTL_ATT _IOWR(UVIO_TYPE_UVC, 0x01, struct uvio_ioctl_cb)
50
51#endif /* __S390_ASM_UVDEVICE_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/zcrypt.h+22-23
......@@ -4,7 +4,7 @@
44 *
55 * zcrypt 2.2.1 (user-visible header)
66 *
7 * Copyright IBM Corp. 2001, 2019
7 * Copyright IBM Corp. 2001, 2022
88 * Author(s): Robert Burroughs
99 * Eric Rossman (edrossma@us.ibm.com)
1010 *
......@@ -85,7 +85,8 @@ struct ica_rsa_modexpo_crt {
8585struct CPRBX {
8686 __u16 cprb_len; /* CPRB length 220 */
8787 __u8 cprb_ver_id; /* CPRB version id. 0x02 */
88 __u8 pad_000[3]; /* Alignment pad bytes */
88 __u8 ctfm; /* Command Type Filtering Mask */
89 __u8 pad_000[2]; /* Alignment pad bytes */
8990 __u8 func_id[2]; /* function id 0x5432 */
9091 __u8 cprb_flags[4]; /* Flags */
9192 __u32 req_parml; /* request parameter buffer len */
......@@ -95,19 +96,19 @@ struct CPRBX {
9596 __u32 rpl_datal; /* reply data block len */
9697 __u32 rpld_datal; /* replied data block len */
9798 __u32 req_extbl; /* request extension block len */
98 __u8 pad_001[4]; /* reserved */
99 __u8 _pad_001[4]; /* reserved */
99100 __u32 rpld_extbl; /* replied extension block len */
100 __u8 padx000[16 - sizeof(__u8 *)];
101 __u8 _pad_002[16 - sizeof(__u8 *)];
101102 __u8 *req_parmb; /* request parm block 'address' */
102 __u8 padx001[16 - sizeof(__u8 *)];
103 __u8 _pad_003[16 - sizeof(__u8 *)];
103104 __u8 *req_datab; /* request data block 'address' */
104 __u8 padx002[16 - sizeof(__u8 *)];
105 __u8 _pad_004[16 - sizeof(__u8 *)];
105106 __u8 *rpl_parmb; /* reply parm block 'address' */
106 __u8 padx003[16 - sizeof(__u8 *)];
107 __u8 _pad_005[16 - sizeof(__u8 *)];
107108 __u8 *rpl_datab; /* reply data block 'address' */
108 __u8 padx004[16 - sizeof(__u8 *)];
109 __u8 _pad_006[16 - sizeof(__u8 *)];
109110 __u8 *req_extb; /* request extension block 'addr'*/
110 __u8 padx005[16 - sizeof(__u8 *)];
111 __u8 _pad_007[16 - sizeof(__u8 *)];
111112 __u8 *rpl_extb; /* reply extension block 'address'*/
112113 __u16 ccp_rtcode; /* server return code */
113114 __u16 ccp_rscode; /* server reason code */
......@@ -115,12 +116,10 @@ struct CPRBX {
115116 __u8 logon_id[8]; /* Logon Identifier */
116117 __u8 mac_value[8]; /* Mac Value */
117118 __u8 mac_content_flgs; /* Mac content flag byte */
118 __u8 pad_002; /* Alignment */
119 __u8 _pad_008; /* Alignment */
119120 __u16 domain; /* Domain */
120 __u8 usage_domain[4]; /* Usage domain */
121 __u8 cntrl_domain[4]; /* Control domain */
122 __u8 S390enf_mask[4]; /* S/390 enforcement mask */
123 __u8 pad_004[36]; /* reserved */
121 __u8 _pad_009[12]; /* reserved, checked for zeros */
122 __u8 _pad_010[36]; /* reserved */
124123} __attribute__((packed));
125124
126125/**
......@@ -238,8 +237,8 @@ struct zcrypt_device_matrix_ext {
238237};
239238
240239#define AUTOSELECT 0xFFFFFFFF
241#define AUTOSEL_AP ((__u16) 0xFFFF)
242#define AUTOSEL_DOM ((__u16) 0xFFFF)
240#define AUTOSEL_AP ((__u16)0xFFFF)
241#define AUTOSEL_DOM ((__u16)0xFFFF)
243242
244243#define ZCRYPT_IOCTL_MAGIC 'z'
245244
......@@ -288,7 +287,7 @@ struct zcrypt_device_matrix_ext {
288287 * 0x08: CEX3A
289288 * 0x0a: CEX4
290289 * 0x0b: CEX5
291 * 0x0c: CEX6 and CEX7
290 * 0x0c: CEX6, CEX7 or CEX8
292291 * 0x0d: device is disabled
293292 *
294293 * ZCRYPT_QDEPTH_MASK
......@@ -305,12 +304,12 @@ struct zcrypt_device_matrix_ext {
305304/**
306305 * Supported ioctl calls
307306 */
308#define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x05, 0)
309#define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x06, 0)
310#define ZSECSENDCPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x81, 0)
311#define ZSENDEP11CPRB _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0)
307#define ICARSAMODEXPO _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x05, 0)
308#define ICARSACRT _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x06, 0)
309#define ZSECSENDCPRB _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x81, 0)
310#define ZSENDEP11CPRB _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x04, 0)
312311
313#define ZCRYPT_DEVICE_STATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x5f, 0)
312#define ZCRYPT_DEVICE_STATUS _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x5f, 0)
314313#define ZCRYPT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x58, char[MAX_ZDEV_CARDIDS_EXT])
315314#define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])
316315#define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])
......@@ -352,7 +351,7 @@ struct zcrypt_device_matrix {
352351};
353352
354353/* Deprecated: use ZCRYPT_DEVICE_STATUS */
355#define ZDEVICESTATUS _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0)
354#define ZDEVICESTATUS _IOC(_IOC_READ | _IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x4f, 0)
356355/* Deprecated: use ZCRYPT_STATUS_MASK */
357356#define Z90STAT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x48, char[64])
358357/* Deprecated: use ZCRYPT_QDEPTH_MASK */
lib/libc/include/sparc-linux-any/asm/shmbuf.h+4-1
......@@ -2,6 +2,9 @@
22#ifndef _SPARC_SHMBUF_H
33#define _SPARC_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
58/*
69 * The shmid64_ds structure for sparc architecture.
710 * Note extra padding because this structure is passed back and forth
......@@ -25,7 +28,7 @@ struct shmid64_ds {
2528 unsigned long shm_ctime_high;
2629 unsigned long shm_ctime; /* last change time */
2730#endif
28 size_t shm_segsz; /* size of segment (bytes) */
31 __kernel_size_t shm_segsz; /* size of segment (bytes) */
2932 __kernel_pid_t shm_cpid; /* pid of creator */
3033 __kernel_pid_t shm_lpid; /* pid of last operator */
3134 unsigned long shm_nattch; /* no. of current attaches */
lib/libc/include/sparc-linux-any/asm/signal.h+2-1
......@@ -151,6 +151,7 @@ struct sigstack {
151151
152152
153153#include <asm-generic/signal-defs.h>
154#include <asm/posix_types.h>
154155
155156struct __new_sigaction {
156157 __sighandler_t sa_handler;
......@@ -169,7 +170,7 @@ struct __old_sigaction {
169170typedef struct sigaltstack {
170171 void *ss_sp;
171172 int ss_flags;
172 size_t ss_size;
173 __kernel_size_t ss_size;
173174} stack_t;
174175
175176
lib/libc/include/sparc-linux-any/asm/socket.h+3
......@@ -126,6 +126,9 @@
126126
127127#define SO_RESERVE_MEM 0x0052
128128
129#define SO_TXREHASH 0x0053
130
131#define SO_RCVMARK 0x0054
129132
130133
131134
lib/libc/include/sparc-linux-any/asm/stat.h+6-6
......@@ -8,11 +8,11 @@
88/* 64 bit sparc */
99struct stat {
1010 unsigned int st_dev;
11 ino_t st_ino;
12 mode_t st_mode;
11 __kernel_ino_t st_ino;
12 __kernel_mode_t st_mode;
1313 short st_nlink;
14 uid_t st_uid;
15 gid_t st_gid;
14 __kernel_uid32_t st_uid;
15 __kernel_gid32_t st_gid;
1616 unsigned int st_rdev;
1717 long st_size;
1818 long st_atime;
......@@ -51,8 +51,8 @@ struct stat64 {
5151/* 32 bit sparc */
5252struct stat {
5353 unsigned short st_dev;
54 ino_t st_ino;
55 mode_t st_mode;
54 __kernel_ino_t st_ino;
55 __kernel_mode_t st_mode;
5656 short st_nlink;
5757 unsigned short st_uid;
5858 unsigned short st_gid;
lib/libc/include/sparc-linux-any/asm/termbits.h+84-139
......@@ -2,15 +2,12 @@
22#ifndef _SPARC_TERMBITS_H
33#define _SPARC_TERMBITS_H
44
5#include <linux/posix_types.h>
6
7typedef unsigned char cc_t;
8typedef unsigned int speed_t;
5#include <asm-generic/termbits-common.h>
96
107#if defined(__sparc__) && defined(__arch64__)
11typedef unsigned int tcflag_t;
8typedef unsigned int tcflag_t;
129#else
13typedef unsigned long tcflag_t;
10typedef unsigned long tcflag_t;
1411#endif
1512
1613#define NCC 8
......@@ -56,21 +53,19 @@ struct ktermios {
5653};
5754
5855/* c_cc characters */
59#define VINTR 0
60#define VQUIT 1
61#define VERASE 2
62#define VKILL 3
63#define VEOF 4
64#define VEOL 5
65#define VEOL2 6
66#define VSWTC 7
67#define VSTART 8
68#define VSTOP 9
69
70
56#define VINTR 0
57#define VQUIT 1
58#define VERASE 2
59#define VKILL 3
60#define VEOF 4
61#define VEOL 5
62#define VEOL2 6
63#define VSWTC 7
64#define VSTART 8
65#define VSTOP 9
7166
7267#define VSUSP 10
73#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
68#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
7469#define VREPRINT 12
7570#define VDISCARD 13
7671#define VWERASE 14
......@@ -83,121 +78,83 @@ struct ktermios {
8378#define VTIME VEOL
8479
8580/* c_iflag bits */
86#define IGNBRK 0x00000001
87#define BRKINT 0x00000002
88#define IGNPAR 0x00000004
89#define PARMRK 0x00000008
90#define INPCK 0x00000010
91#define ISTRIP 0x00000020
92#define INLCR 0x00000040
93#define IGNCR 0x00000080
94#define ICRNL 0x00000100
95#define IUCLC 0x00000200
96#define IXON 0x00000400
97#define IXANY 0x00000800
98#define IXOFF 0x00001000
99#define IMAXBEL 0x00002000
100#define IUTF8 0x00004000
81#define IUCLC 0x0200
82#define IXON 0x0400
83#define IXOFF 0x1000
84#define IMAXBEL 0x2000
85#define IUTF8 0x4000
10186
10287/* c_oflag bits */
103#define OPOST 0x00000001
104#define OLCUC 0x00000002
105#define ONLCR 0x00000004
106#define OCRNL 0x00000008
107#define ONOCR 0x00000010
108#define ONLRET 0x00000020
109#define OFILL 0x00000040
110#define OFDEL 0x00000080
111#define NLDLY 0x00000100
112#define NL0 0x00000000
113#define NL1 0x00000100
114#define CRDLY 0x00000600
115#define CR0 0x00000000
116#define CR1 0x00000200
117#define CR2 0x00000400
118#define CR3 0x00000600
119#define TABDLY 0x00001800
120#define TAB0 0x00000000
121#define TAB1 0x00000800
122#define TAB2 0x00001000
123#define TAB3 0x00001800
124#define XTABS 0x00001800
125#define BSDLY 0x00002000
126#define BS0 0x00000000
127#define BS1 0x00002000
128#define VTDLY 0x00004000
129#define VT0 0x00000000
130#define VT1 0x00004000
131#define FFDLY 0x00008000
132#define FF0 0x00000000
133#define FF1 0x00008000
134#define PAGEOUT 0x00010000 /* SUNOS specific */
135#define WRAP 0x00020000 /* SUNOS specific */
88#define OLCUC 0x00002
89#define ONLCR 0x00004
90#define NLDLY 0x00100
91#define NL0 0x00000
92#define NL1 0x00100
93#define CRDLY 0x00600
94#define CR0 0x00000
95#define CR1 0x00200
96#define CR2 0x00400
97#define CR3 0x00600
98#define TABDLY 0x01800
99#define TAB0 0x00000
100#define TAB1 0x00800
101#define TAB2 0x01000
102#define TAB3 0x01800
103#define XTABS 0x01800
104#define BSDLY 0x02000
105#define BS0 0x00000
106#define BS1 0x02000
107#define VTDLY 0x04000
108#define VT0 0x00000
109#define VT1 0x04000
110#define FFDLY 0x08000
111#define FF0 0x00000
112#define FF1 0x08000
113#define PAGEOUT 0x10000 /* SUNOS specific */
114#define WRAP 0x20000 /* SUNOS specific */
136115
137116/* c_cflag bit meaning */
138#define CBAUD 0x0000100f
139#define B0 0x00000000 /* hang up */
140#define B50 0x00000001
141#define B75 0x00000002
142#define B110 0x00000003
143#define B134 0x00000004
144#define B150 0x00000005
145#define B200 0x00000006
146#define B300 0x00000007
147#define B600 0x00000008
148#define B1200 0x00000009
149#define B1800 0x0000000a
150#define B2400 0x0000000b
151#define B4800 0x0000000c
152#define B9600 0x0000000d
153#define B19200 0x0000000e
154#define B38400 0x0000000f
155#define EXTA B19200
156#define EXTB B38400
157#define CSIZE 0x00000030
158#define CS5 0x00000000
159#define CS6 0x00000010
160#define CS7 0x00000020
161#define CS8 0x00000030
162#define CSTOPB 0x00000040
163#define CREAD 0x00000080
164#define PARENB 0x00000100
165#define PARODD 0x00000200
166#define HUPCL 0x00000400
167#define CLOCAL 0x00000800
168#define CBAUDEX 0x00001000
117#define CBAUD 0x0000100f
118#define CSIZE 0x00000030
119#define CS5 0x00000000
120#define CS6 0x00000010
121#define CS7 0x00000020
122#define CS8 0x00000030
123#define CSTOPB 0x00000040
124#define CREAD 0x00000080
125#define PARENB 0x00000100
126#define PARODD 0x00000200
127#define HUPCL 0x00000400
128#define CLOCAL 0x00000800
129#define CBAUDEX 0x00001000
169130/* We'll never see these speeds with the Zilogs, but for completeness... */
170#define BOTHER 0x00001000
171#define B57600 0x00001001
172#define B115200 0x00001002
173#define B230400 0x00001003
174#define B460800 0x00001004
131#define BOTHER 0x00001000
132#define B57600 0x00001001
133#define B115200 0x00001002
134#define B230400 0x00001003
135#define B460800 0x00001004
175136/* This is what we can do with the Zilogs. */
176#define B76800 0x00001005
137#define B76800 0x00001005
177138/* This is what we can do with the SAB82532. */
178#define B153600 0x00001006
179#define B307200 0x00001007
180#define B614400 0x00001008
181#define B921600 0x00001009
139#define B153600 0x00001006
140#define B307200 0x00001007
141#define B614400 0x00001008
142#define B921600 0x00001009
182143/* And these are the rest... */
183#define B500000 0x0000100a
184#define B576000 0x0000100b
185#define B1000000 0x0000100c
186#define B1152000 0x0000100d
187#define B1500000 0x0000100e
188#define B2000000 0x0000100f
144#define B500000 0x0000100a
145#define B576000 0x0000100b
146#define B1000000 0x0000100c
147#define B1152000 0x0000100d
148#define B1500000 0x0000100e
149#define B2000000 0x0000100f
189150/* These have totally bogus values and nobody uses them
190151 so far. Later on we'd have to use say 0x10000x and
191152 adjust CBAUD constant and drivers accordingly.
192#define B2500000 0x00001010
193#define B3000000 0x00001011
194#define B3500000 0x00001012
195#define B4000000 0x00001013 */
196#define CIBAUD 0x100f0000 /* input baud rate (not used) */
197#define CMSPAR 0x40000000 /* mark or space (stick) parity */
198#define CRTSCTS 0x80000000 /* flow control */
199
200#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
153#define B2500000 0x00001010
154#define B3000000 0x00001011
155#define B3500000 0x00001012
156#define B4000000 0x00001013 */
157#define CIBAUD 0x100f0000 /* input baud rate (not used) */
201158
202159/* c_lflag bits */
203160#define ISIG 0x00000001
......@@ -212,7 +169,7 @@ struct ktermios {
212169#define ECHOCTL 0x00000200
213170#define ECHOPRT 0x00000400
214171#define ECHOKE 0x00000800
215#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
172#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
216173#define FLUSHO 0x00002000
217174#define PENDIN 0x00004000
218175#define IEXTEN 0x00008000
......@@ -237,21 +194,9 @@ struct ktermios {
237194/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
238195#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
239196
240
241/* tcflow() and TCXONC use these */
242#define TCOOFF 0
243#define TCOON 1
244#define TCIOFF 2
245#define TCION 3
246
247/* tcflush() and TCFLSH use these */
248#define TCIFLUSH 0
249#define TCOFLUSH 1
250#define TCIOFLUSH 2
251
252197/* tcsetattr uses these */
253#define TCSANOW 0
254#define TCSADRAIN 1
255#define TCSAFLUSH 2
198#define TCSANOW 0
199#define TCSADRAIN 1
200#define TCSAFLUSH 2
256201
257202#endif /* _SPARC_TERMBITS_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_32.h+1
......@@ -419,6 +419,7 @@
419419#define __NR_landlock_restrict_self 446
420420#define __NR_process_mrelease 448
421421#define __NR_futex_waitv 449
422#define __NR_set_mempolicy_home_node 450
422423
423424
424425#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h+1
......@@ -382,6 +382,7 @@
382382#define __NR_landlock_restrict_self 446
383383#define __NR_process_mrelease 448
384384#define __NR_futex_waitv 449
385#define __NR_set_mempolicy_home_node 450
385386
386387
387388#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/amd_hsmp.h created+307
......@@ -0,0 +1,307 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _ASM_X86_AMD_HSMP_H_
4#define _ASM_X86_AMD_HSMP_H_
5
6#include <linux/types.h>
7
8#pragma pack(4)
9
10#define HSMP_MAX_MSG_LEN 8
11
12/*
13 * HSMP Messages supported
14 */
15enum hsmp_message_ids {
16 HSMP_TEST = 1, /* 01h Increments input value by 1 */
17 HSMP_GET_SMU_VER, /* 02h SMU FW version */
18 HSMP_GET_PROTO_VER, /* 03h HSMP interface version */
19 HSMP_GET_SOCKET_POWER, /* 04h average package power consumption */
20 HSMP_SET_SOCKET_POWER_LIMIT, /* 05h Set the socket power limit */
21 HSMP_GET_SOCKET_POWER_LIMIT, /* 06h Get current socket power limit */
22 HSMP_GET_SOCKET_POWER_LIMIT_MAX,/* 07h Get maximum socket power value */
23 HSMP_SET_BOOST_LIMIT, /* 08h Set a core maximum frequency limit */
24 HSMP_SET_BOOST_LIMIT_SOCKET, /* 09h Set socket maximum frequency level */
25 HSMP_GET_BOOST_LIMIT, /* 0Ah Get current frequency limit */
26 HSMP_GET_PROC_HOT, /* 0Bh Get PROCHOT status */
27 HSMP_SET_XGMI_LINK_WIDTH, /* 0Ch Set max and min width of xGMI Link */
28 HSMP_SET_DF_PSTATE, /* 0Dh Alter APEnable/Disable messages behavior */
29 HSMP_SET_AUTO_DF_PSTATE, /* 0Eh Enable DF P-State Performance Boost algorithm */
30 HSMP_GET_FCLK_MCLK, /* 0Fh Get FCLK and MEMCLK for current socket */
31 HSMP_GET_CCLK_THROTTLE_LIMIT, /* 10h Get CCLK frequency limit in socket */
32 HSMP_GET_C0_PERCENT, /* 11h Get average C0 residency in socket */
33 HSMP_SET_NBIO_DPM_LEVEL, /* 12h Set max/min LCLK DPM Level for a given NBIO */
34 HSMP_GET_NBIO_DPM_LEVEL, /* 13h Get LCLK DPM level min and max for a given NBIO */
35 HSMP_GET_DDR_BANDWIDTH, /* 14h Get theoretical maximum and current DDR Bandwidth */
36 HSMP_GET_TEMP_MONITOR, /* 15h Get socket temperature */
37 HSMP_GET_DIMM_TEMP_RANGE, /* 16h Get per-DIMM temperature range and refresh rate */
38 HSMP_GET_DIMM_POWER, /* 17h Get per-DIMM power consumption */
39 HSMP_GET_DIMM_THERMAL, /* 18h Get per-DIMM thermal sensors */
40 HSMP_GET_SOCKET_FREQ_LIMIT, /* 19h Get current active frequency per socket */
41 HSMP_GET_CCLK_CORE_LIMIT, /* 1Ah Get CCLK frequency limit per core */
42 HSMP_GET_RAILS_SVI, /* 1Bh Get SVI-based Telemetry for all rails */
43 HSMP_GET_SOCKET_FMAX_FMIN, /* 1Ch Get Fmax and Fmin per socket */
44 HSMP_GET_IOLINK_BANDWITH, /* 1Dh Get current bandwidth on IO Link */
45 HSMP_GET_XGMI_BANDWITH, /* 1Eh Get current bandwidth on xGMI Link */
46 HSMP_SET_GMI3_WIDTH, /* 1Fh Set max and min GMI3 Link width */
47 HSMP_SET_PCI_RATE, /* 20h Control link rate on PCIe devices */
48 HSMP_SET_POWER_MODE, /* 21h Select power efficiency profile policy */
49 HSMP_SET_PSTATE_MAX_MIN, /* 22h Set the max and min DF P-State */
50 HSMP_MSG_ID_MAX,
51};
52
53struct hsmp_message {
54 __u32 msg_id; /* Message ID */
55 __u16 num_args; /* Number of input argument words in message */
56 __u16 response_sz; /* Number of expected output/response words */
57 __u32 args[HSMP_MAX_MSG_LEN]; /* argument/response buffer */
58 __u16 sock_ind; /* socket number */
59};
60
61enum hsmp_msg_type {
62 HSMP_RSVD = -1,
63 HSMP_SET = 0,
64 HSMP_GET = 1,
65};
66
67struct hsmp_msg_desc {
68 int num_args;
69 int response_sz;
70 enum hsmp_msg_type type;
71};
72
73/*
74 * User may use these comments as reference, please find the
75 * supported list of messages and message definition in the
76 * HSMP chapter of respective family/model PPR.
77 *
78 * Not supported messages would return -ENOMSG.
79 */
80static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
81 /* RESERVED */
82 {0, 0, HSMP_RSVD},
83
84 /*
85 * HSMP_TEST, num_args = 1, response_sz = 1
86 * input: args[0] = xx
87 * output: args[0] = xx + 1
88 */
89 {1, 1, HSMP_GET},
90
91 /*
92 * HSMP_GET_SMU_VER, num_args = 0, response_sz = 1
93 * output: args[0] = smu fw ver
94 */
95 {0, 1, HSMP_GET},
96
97 /*
98 * HSMP_GET_PROTO_VER, num_args = 0, response_sz = 1
99 * output: args[0] = proto version
100 */
101 {0, 1, HSMP_GET},
102
103 /*
104 * HSMP_GET_SOCKET_POWER, num_args = 0, response_sz = 1
105 * output: args[0] = socket power in mWatts
106 */
107 {0, 1, HSMP_GET},
108
109 /*
110 * HSMP_SET_SOCKET_POWER_LIMIT, num_args = 1, response_sz = 0
111 * input: args[0] = power limit value in mWatts
112 */
113 {1, 0, HSMP_SET},
114
115 /*
116 * HSMP_GET_SOCKET_POWER_LIMIT, num_args = 0, response_sz = 1
117 * output: args[0] = socket power limit value in mWatts
118 */
119 {0, 1, HSMP_GET},
120
121 /*
122 * HSMP_GET_SOCKET_POWER_LIMIT_MAX, num_args = 0, response_sz = 1
123 * output: args[0] = maximuam socket power limit in mWatts
124 */
125 {0, 1, HSMP_GET},
126
127 /*
128 * HSMP_SET_BOOST_LIMIT, num_args = 1, response_sz = 0
129 * input: args[0] = apic id[31:16] + boost limit value in MHz[15:0]
130 */
131 {1, 0, HSMP_SET},
132
133 /*
134 * HSMP_SET_BOOST_LIMIT_SOCKET, num_args = 1, response_sz = 0
135 * input: args[0] = boost limit value in MHz
136 */
137 {1, 0, HSMP_SET},
138
139 /*
140 * HSMP_GET_BOOST_LIMIT, num_args = 1, response_sz = 1
141 * input: args[0] = apic id
142 * output: args[0] = boost limit value in MHz
143 */
144 {1, 1, HSMP_GET},
145
146 /*
147 * HSMP_GET_PROC_HOT, num_args = 0, response_sz = 1
148 * output: args[0] = proc hot status
149 */
150 {0, 1, HSMP_GET},
151
152 /*
153 * HSMP_SET_XGMI_LINK_WIDTH, num_args = 1, response_sz = 0
154 * input: args[0] = min link width[15:8] + max link width[7:0]
155 */
156 {1, 0, HSMP_SET},
157
158 /*
159 * HSMP_SET_DF_PSTATE, num_args = 1, response_sz = 0
160 * input: args[0] = df pstate[7:0]
161 */
162 {1, 0, HSMP_SET},
163
164 /* HSMP_SET_AUTO_DF_PSTATE, num_args = 0, response_sz = 0 */
165 {0, 0, HSMP_SET},
166
167 /*
168 * HSMP_GET_FCLK_MCLK, num_args = 0, response_sz = 2
169 * output: args[0] = fclk in MHz, args[1] = mclk in MHz
170 */
171 {0, 2, HSMP_GET},
172
173 /*
174 * HSMP_GET_CCLK_THROTTLE_LIMIT, num_args = 0, response_sz = 1
175 * output: args[0] = core clock in MHz
176 */
177 {0, 1, HSMP_GET},
178
179 /*
180 * HSMP_GET_C0_PERCENT, num_args = 0, response_sz = 1
181 * output: args[0] = average c0 residency
182 */
183 {0, 1, HSMP_GET},
184
185 /*
186 * HSMP_SET_NBIO_DPM_LEVEL, num_args = 1, response_sz = 0
187 * input: args[0] = nbioid[23:16] + max dpm level[15:8] + min dpm level[7:0]
188 */
189 {1, 0, HSMP_SET},
190
191 /*
192 * HSMP_GET_NBIO_DPM_LEVEL, num_args = 1, response_sz = 1
193 * input: args[0] = nbioid[23:16]
194 * output: args[0] = max dpm level[15:8] + min dpm level[7:0]
195 */
196 {1, 1, HSMP_GET},
197
198 /*
199 * HSMP_GET_DDR_BANDWIDTH, num_args = 0, response_sz = 1
200 * output: args[0] = max bw in Gbps[31:20] + utilised bw in Gbps[19:8] +
201 * bw in percentage[7:0]
202 */
203 {0, 1, HSMP_GET},
204
205 /*
206 * HSMP_GET_TEMP_MONITOR, num_args = 0, response_sz = 1
207 * output: args[0] = temperature in degree celsius. [15:8] integer part +
208 * [7:5] fractional part
209 */
210 {0, 1, HSMP_GET},
211
212 /*
213 * HSMP_GET_DIMM_TEMP_RANGE, num_args = 1, response_sz = 1
214 * input: args[0] = DIMM address[7:0]
215 * output: args[0] = refresh rate[3] + temperature range[2:0]
216 */
217 {1, 1, HSMP_GET},
218
219 /*
220 * HSMP_GET_DIMM_POWER, num_args = 1, response_sz = 1
221 * input: args[0] = DIMM address[7:0]
222 * output: args[0] = DIMM power in mW[31:17] + update rate in ms[16:8] +
223 * DIMM address[7:0]
224 */
225 {1, 1, HSMP_GET},
226
227 /*
228 * HSMP_GET_DIMM_THERMAL, num_args = 1, response_sz = 1
229 * input: args[0] = DIMM address[7:0]
230 * output: args[0] = temperature in degree celcius[31:21] + update rate in ms[16:8] +
231 * DIMM address[7:0]
232 */
233 {1, 1, HSMP_GET},
234
235 /*
236 * HSMP_GET_SOCKET_FREQ_LIMIT, num_args = 0, response_sz = 1
237 * output: args[0] = frequency in MHz[31:16] + frequency source[15:0]
238 */
239 {0, 1, HSMP_GET},
240
241 /*
242 * HSMP_GET_CCLK_CORE_LIMIT, num_args = 1, response_sz = 1
243 * input: args[0] = apic id [31:0]
244 * output: args[0] = frequency in MHz[31:0]
245 */
246 {1, 1, HSMP_GET},
247
248 /*
249 * HSMP_GET_RAILS_SVI, num_args = 0, response_sz = 1
250 * output: args[0] = power in mW[31:0]
251 */
252 {0, 1, HSMP_GET},
253
254 /*
255 * HSMP_GET_SOCKET_FMAX_FMIN, num_args = 0, response_sz = 1
256 * output: args[0] = fmax in MHz[31:16] + fmin in MHz[15:0]
257 */
258 {0, 1, HSMP_GET},
259
260 /*
261 * HSMP_GET_IOLINK_BANDWITH, num_args = 1, response_sz = 1
262 * input: args[0] = link id[15:8] + bw type[2:0]
263 * output: args[0] = io bandwidth in Mbps[31:0]
264 */
265 {1, 1, HSMP_GET},
266
267 /*
268 * HSMP_GET_XGMI_BANDWITH, num_args = 1, response_sz = 1
269 * input: args[0] = link id[15:8] + bw type[2:0]
270 * output: args[0] = xgmi bandwidth in Mbps[31:0]
271 */
272 {1, 1, HSMP_GET},
273
274 /*
275 * HSMP_SET_GMI3_WIDTH, num_args = 1, response_sz = 0
276 * input: args[0] = min link width[15:8] + max link width[7:0]
277 */
278 {1, 0, HSMP_SET},
279
280 /*
281 * HSMP_SET_PCI_RATE, num_args = 1, response_sz = 1
282 * input: args[0] = link rate control value
283 * output: args[0] = previous link rate control value
284 */
285 {1, 1, HSMP_SET},
286
287 /*
288 * HSMP_SET_POWER_MODE, num_args = 1, response_sz = 0
289 * input: args[0] = power efficiency mode[2:0]
290 */
291 {1, 0, HSMP_SET},
292
293 /*
294 * HSMP_SET_PSTATE_MAX_MIN, num_args = 1, response_sz = 0
295 * input: args[0] = min df pstate[15:8] + max df pstate[7:0]
296 */
297 {1, 0, HSMP_SET},
298};
299
300/* Reset to default packing */
301#pragma pack()
302
303/* Define unique ioctl command for hsmp msgs using generic _IOWR */
304#define HSMP_BASE_IOCTL_NR 0xF8
305#define HSMP_IOCTL_CMD _IOWR(HSMP_BASE_IOCTL_NR, 0, struct hsmp_message)
306
307#endif /*_ASM_X86_AMD_HSMP_H_*/
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/bootparam.h+16-5
......@@ -10,11 +10,13 @@
1010#define SETUP_EFI 4
1111#define SETUP_APPLE_PROPERTIES 5
1212#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
1317
1418#define SETUP_INDIRECT (1<<31)
15
16/* SETUP_INDIRECT | max(SETUP_*) */
17#define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE)
19#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
1820
1921/* ram_size flags */
2022#define RAMDISK_IMAGE_START_MASK 0x07FF
......@@ -51,7 +53,7 @@ struct setup_data {
5153 __u64 next;
5254 __u32 type;
5355 __u32 len;
54 __u8 data[0];
56 __u8 data[];
5557};
5658
5759/* extensible setup indirect data node */
......@@ -171,6 +173,14 @@ struct jailhouse_setup_data {
171173 } __attribute__((packed)) v2;
172174} __attribute__((packed));
173175
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
174184/* The so-called "zeropage" */
175185struct boot_params {
176186 struct screen_info screen_info; /* 0x000 */
......@@ -187,7 +197,8 @@ struct boot_params {
187197 __u32 ext_ramdisk_image; /* 0x0c0 */
188198 __u32 ext_ramdisk_size; /* 0x0c4 */
189199 __u32 ext_cmd_line_ptr; /* 0x0c8 */
190 __u8 _pad4[116]; /* 0x0cc */
200 __u8 _pad4[112]; /* 0x0cc */
201 __u32 cc_blob_address; /* 0x13c */
191202 struct edid_info edid_info; /* 0x140 */
192203 struct efi_info efi_info; /* 0x1c0 */
193204 __u32 alt_mem_k; /* 0x1e0 */
lib/libc/include/x86-linux-any/asm/kvm.h+72-23
......@@ -9,6 +9,7 @@
99
1010#include <linux/types.h>
1111#include <linux/ioctl.h>
12#include <linux/stddef.h>
1213
1314#define KVM_PIO_PAGE_OFFSET 1
1415#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
......@@ -53,14 +54,6 @@
5354/* Architectural interrupt line count. */
5455#define KVM_NR_INTERRUPTS 256
5556
56struct kvm_memory_alias {
57 __u32 slot; /* this has a different namespace than memory slots */
58 __u32 flags;
59 __u64 guest_phys_addr;
60 __u64 memory_size;
61 __u64 target_phys_addr;
62};
63
6457/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
6558struct kvm_pic_state {
6659 __u8 last_irr; /* edge detection */
......@@ -198,13 +191,13 @@ struct kvm_msrs {
198191 __u32 nmsrs; /* number of msrs in entries */
199192 __u32 pad;
200193
201 struct kvm_msr_entry entries[0];
194 struct kvm_msr_entry entries[];
202195};
203196
204197/* for KVM_GET_MSR_INDEX_LIST */
205198struct kvm_msr_list {
206199 __u32 nmsrs; /* number of msrs in entries */
207 __u32 indices[0];
200 __u32 indices[];
208201};
209202
210203/* Maximum size of any access bitmap in bytes */
......@@ -214,6 +207,8 @@ struct kvm_msr_list {
214207struct kvm_msr_filter_range {
215208#define KVM_MSR_FILTER_READ (1 << 0)
216209#define KVM_MSR_FILTER_WRITE (1 << 1)
210#define KVM_MSR_FILTER_RANGE_VALID_MASK (KVM_MSR_FILTER_READ | \
211 KVM_MSR_FILTER_WRITE)
217212 __u32 flags;
218213 __u32 nmsrs; /* number of msrs in bitmap */
219214 __u32 base; /* MSR index the bitmap starts at */
......@@ -224,6 +219,7 @@ struct kvm_msr_filter_range {
224219struct kvm_msr_filter {
225220#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)
226221#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)
222#define KVM_MSR_FILTER_VALID_MASK (KVM_MSR_FILTER_DEFAULT_DENY)
227223 __u32 flags;
228224 struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];
229225};
......@@ -241,7 +237,7 @@ struct kvm_cpuid_entry {
241237struct kvm_cpuid {
242238 __u32 nent;
243239 __u32 padding;
244 struct kvm_cpuid_entry entries[0];
240 struct kvm_cpuid_entry entries[];
245241};
246242
247243struct kvm_cpuid_entry2 {
......@@ -263,7 +259,7 @@ struct kvm_cpuid_entry2 {
263259struct kvm_cpuid2 {
264260 __u32 nent;
265261 __u32 padding;
266 struct kvm_cpuid_entry2 entries[0];
262 struct kvm_cpuid_entry2 entries[];
267263};
268264
269265/* for KVM_GET_PIT and KVM_SET_PIT */
......@@ -306,7 +302,8 @@ struct kvm_pit_state {
306302 struct kvm_pit_channel_state channels[3];
307303};
308304
309#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
305#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
306#define KVM_PIT_FLAGS_SPEAKER_DATA_ON 0x00000002
310307
311308struct kvm_pit_state2 {
312309 struct kvm_pit_channel_state channels[3];
......@@ -325,6 +322,7 @@ struct kvm_reinject_control {
325322#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
326323#define KVM_VCPUEVENT_VALID_SMM 0x00000008
327324#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
325#define KVM_VCPUEVENT_VALID_TRIPLE_FAULT 0x00000020
328326
329327/* Interrupt shadow states */
330328#define KVM_X86_SHADOW_INT_MOV_SS 0x01
......@@ -359,7 +357,10 @@ struct kvm_vcpu_events {
359357 __u8 smm_inside_nmi;
360358 __u8 latched_init;
361359 } smi;
362 __u8 reserved[27];
360 struct {
361 __u8 pending;
362 } triple_fault;
363 __u8 reserved[26];
363364 __u8 exception_has_payload;
364365 __u64 exception_payload;
365366};
......@@ -373,9 +374,23 @@ struct kvm_debugregs {
373374 __u64 reserved[9];
374375};
375376
376/* for KVM_CAP_XSAVE */
377/* for KVM_CAP_XSAVE and KVM_CAP_XSAVE2 */
377378struct kvm_xsave {
379 /*
380 * KVM_GET_XSAVE2 and KVM_SET_XSAVE write and read as many bytes
381 * as are returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)
382 * respectively, when invoked on the vm file descriptor.
383 *
384 * The size value returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)
385 * will always be at least 4096. Currently, it is only greater
386 * than 4096 if a dynamic feature has been enabled with
387 * ``arch_prctl()``, but this may change in the future.
388 *
389 * The offsets of the state save areas in struct kvm_xsave follow
390 * the contents of CPUID leaf 0xD on the host.
391 */
378392 __u32 region[1024];
393 __u32 extra[];
379394};
380395
381396#define KVM_MAX_XCRS 16
......@@ -414,11 +429,13 @@ struct kvm_sync_regs {
414429 struct kvm_vcpu_events events;
415430};
416431
417#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
418#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
419#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
420#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
421#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
432#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
433#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
434#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
435#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
436#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
437#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5)
438#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)
422439
423440#define KVM_STATE_NESTED_FORMAT_VMX 0
424441#define KVM_STATE_NESTED_FORMAT_SVM 1
......@@ -438,6 +455,9 @@ struct kvm_sync_regs {
438455
439456#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001
440457
458/* attributes for system fd (group 0) */
459#define KVM_X86_XCOMP_GUEST_SUPP 0
460
441461struct kvm_vmx_nested_state_data {
442462 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
443463 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
......@@ -486,8 +506,8 @@ struct kvm_nested_state {
486506 * KVM_{GET,PUT}_NESTED_STATE ioctl values.
487507 */
488508 union {
489 struct kvm_vmx_nested_state_data vmx[0];
490 struct kvm_svm_nested_state_data svm[0];
509 __DECLARE_FLEX_ARRAY(struct kvm_vmx_nested_state_data, vmx);
510 __DECLARE_FLEX_ARRAY(struct kvm_svm_nested_state_data, svm);
491511 } data;
492512};
493513
......@@ -498,12 +518,41 @@ struct kvm_pmu_event_filter {
498518 __u32 fixed_counter_bitmap;
499519 __u32 flags;
500520 __u32 pad[4];
501 __u64 events[0];
521 __u64 events[];
502522};
503523
504524#define KVM_PMU_EVENT_ALLOW 0
505525#define KVM_PMU_EVENT_DENY 1
506526
527#define KVM_PMU_EVENT_FLAG_MASKED_EVENTS BIT(0)
528#define KVM_PMU_EVENT_FLAGS_VALID_MASK (KVM_PMU_EVENT_FLAG_MASKED_EVENTS)
529
530/*
531 * Masked event layout.
532 * Bits Description
533 * ---- -----------
534 * 7:0 event select (low bits)
535 * 15:8 umask match
536 * 31:16 unused
537 * 35:32 event select (high bits)
538 * 36:54 unused
539 * 55 exclude bit
540 * 63:56 umask mask
541 */
542
543#define KVM_PMU_ENCODE_MASKED_ENTRY(event_select, mask, match, exclude) \
544 (((event_select) & 0xFFULL) | (((event_select) & 0XF00ULL) << 24) | \
545 (((mask) & 0xFFULL) << 56) | \
546 (((match) & 0xFFULL) << 8) | \
547 ((__u64)(!!(exclude)) << 55))
548
549#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))
554#define KVM_PMU_MASKED_ENTRY_UMASK_MASK_SHIFT (56)
555
507556/* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
508557#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
509558#define KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */
lib/libc/include/x86-linux-any/asm/mman.h-14
......@@ -5,20 +5,6 @@
55#define MAP_32BIT 0x40 /* only give out 32bit addresses */
66
77#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8/*
9 * Take the 4 protection key bits out of the vma->vm_flags
10 * value and turn them in to the bits that we can put in
11 * to a pte.
12 *
13 * Only override these if Protection Keys are available
14 * (which is only on 64-bit).
15 */
16#define arch_vm_get_page_prot(vm_flags) __pgprot( \
17 ((vm_flags) & VM_PKEY_BIT0 ? _PAGE_PKEY_BIT0 : 0) | \
18 ((vm_flags) & VM_PKEY_BIT1 ? _PAGE_PKEY_BIT1 : 0) | \
19 ((vm_flags) & VM_PKEY_BIT2 ? _PAGE_PKEY_BIT2 : 0) | \
20 ((vm_flags) & VM_PKEY_BIT3 ? _PAGE_PKEY_BIT3 : 0))
21
228#define arch_calc_vm_prot_bits(prot, key) ( \
239 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
2410 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
lib/libc/include/x86-linux-any/asm/prctl.h+14-12
......@@ -2,20 +2,22 @@
22#ifndef _ASM_X86_PRCTL_H
33#define _ASM_X86_PRCTL_H
44
5#define ARCH_SET_GS 0x1001
6#define ARCH_SET_FS 0x1002
7#define ARCH_GET_FS 0x1003
8#define ARCH_GET_GS 0x1004
5#define ARCH_SET_GS 0x1001
6#define ARCH_SET_FS 0x1002
7#define ARCH_GET_FS 0x1003
8#define ARCH_GET_GS 0x1004
99
10#define ARCH_GET_CPUID 0x1011
11#define ARCH_SET_CPUID 0x1012
10#define ARCH_GET_CPUID 0x1011
11#define ARCH_SET_CPUID 0x1012
1212
13#define ARCH_GET_XCOMP_SUPP 0x1021
14#define ARCH_GET_XCOMP_PERM 0x1022
15#define ARCH_REQ_XCOMP_PERM 0x1023
13#define ARCH_GET_XCOMP_SUPP 0x1021
14#define ARCH_GET_XCOMP_PERM 0x1022
15#define ARCH_REQ_XCOMP_PERM 0x1023
16#define ARCH_GET_XCOMP_GUEST_PERM 0x1024
17#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025
1618
17#define ARCH_MAP_VDSO_X32 0x2001
18#define ARCH_MAP_VDSO_32 0x2002
19#define ARCH_MAP_VDSO_64 0x2003
19#define ARCH_MAP_VDSO_X32 0x2001
20#define ARCH_MAP_VDSO_32 0x2002
21#define ARCH_MAP_VDSO_64 0x2003
2022
2123#endif /* _ASM_X86_PRCTL_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/processor-flags.h+2
......@@ -130,6 +130,8 @@
130130#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT)
131131#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */
132132#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)
133#define X86_CR4_CET_BIT 23 /* enable Control-flow Enforcement Technology */
134#define X86_CR4_CET _BITUL(X86_CR4_CET_BIT)
133135
134136/*
135137 * x86-64 Task Priority Register, CR8
lib/libc/include/x86-linux-any/asm/sgx.h+62
......@@ -29,6 +29,12 @@ enum sgx_page_flags {
2929 _IOW(SGX_MAGIC, 0x03, struct sgx_enclave_provision)
3030#define SGX_IOC_VEPC_REMOVE_ALL \
3131 _IO(SGX_MAGIC, 0x04)
32#define SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS \
33 _IOWR(SGX_MAGIC, 0x05, struct sgx_enclave_restrict_permissions)
34#define SGX_IOC_ENCLAVE_MODIFY_TYPES \
35 _IOWR(SGX_MAGIC, 0x06, struct sgx_enclave_modify_types)
36#define SGX_IOC_ENCLAVE_REMOVE_PAGES \
37 _IOWR(SGX_MAGIC, 0x07, struct sgx_enclave_remove_pages)
3238
3339/**
3440 * struct sgx_enclave_create - parameter structure for the
......@@ -76,6 +82,62 @@ struct sgx_enclave_provision {
7682 __u64 fd;
7783};
7884
85/**
86 * struct sgx_enclave_restrict_permissions - parameters for ioctl
87 * %SGX_IOC_ENCLAVE_RESTRICT_PERMISSIONS
88 * @offset: starting page offset (page aligned relative to enclave base
89 * address defined in SECS)
90 * @length: length of memory (multiple of the page size)
91 * @permissions:new permission bits for pages in range described by @offset
92 * and @length
93 * @result: (output) SGX result code of ENCLS[EMODPR] function
94 * @count: (output) bytes successfully changed (multiple of page size)
95 */
96struct sgx_enclave_restrict_permissions {
97 __u64 offset;
98 __u64 length;
99 __u64 permissions;
100 __u64 result;
101 __u64 count;
102};
103
104/**
105 * struct sgx_enclave_modify_types - parameters for ioctl
106 * %SGX_IOC_ENCLAVE_MODIFY_TYPES
107 * @offset: starting page offset (page aligned relative to enclave base
108 * address defined in SECS)
109 * @length: length of memory (multiple of the page size)
110 * @page_type: new type for pages in range described by @offset and @length
111 * @result: (output) SGX result code of ENCLS[EMODT] function
112 * @count: (output) bytes successfully changed (multiple of page size)
113 */
114struct sgx_enclave_modify_types {
115 __u64 offset;
116 __u64 length;
117 __u64 page_type;
118 __u64 result;
119 __u64 count;
120};
121
122/**
123 * struct sgx_enclave_remove_pages - %SGX_IOC_ENCLAVE_REMOVE_PAGES parameters
124 * @offset: starting page offset (page aligned relative to enclave base
125 * address defined in SECS)
126 * @length: length of memory (multiple of the page size)
127 * @count: (output) bytes successfully changed (multiple of page size)
128 *
129 * Regular (PT_REG) or TCS (PT_TCS) can be removed from an initialized
130 * enclave if the system supports SGX2. First, the %SGX_IOC_ENCLAVE_MODIFY_TYPES
131 * ioctl() should be used to change the page type to PT_TRIM. After that
132 * succeeds ENCLU[EACCEPT] should be run from within the enclave and then
133 * %SGX_IOC_ENCLAVE_REMOVE_PAGES can be used to complete the page removal.
134 */
135struct sgx_enclave_remove_pages {
136 __u64 offset;
137 __u64 length;
138 __u64 count;
139};
140
79141struct sgx_enclave_run;
80142
81143/**
lib/libc/include/x86-linux-any/asm/shmbuf.h+5-1
......@@ -5,6 +5,10 @@
55#if !defined(__x86_64__) || !defined(__ILP32__)
66#include <asm-generic/shmbuf.h>
77#else
8
9#include <asm/ipcbuf.h>
10#include <asm/posix_types.h>
11
812/*
913 * The shmid64_ds structure for x86 architecture with x32 ABI.
1014 *
......@@ -15,7 +19,7 @@
1519
1620struct shmid64_ds {
1721 struct ipc64_perm shm_perm; /* operation perms */
18 size_t shm_segsz; /* size of segment (bytes) */
22 __kernel_size_t shm_segsz; /* size of segment (bytes) */
1923 __kernel_long_t shm_atime; /* last attach time */
2024 __kernel_long_t shm_dtime; /* last detach time */
2125 __kernel_long_t shm_ctime; /* last change time */
lib/libc/include/x86-linux-any/asm/signal.h+1-1
......@@ -100,7 +100,7 @@ struct sigaction {
100100typedef struct sigaltstack {
101101 void *ss_sp;
102102 int ss_flags;
103 size_t ss_size;
103 __kernel_size_t ss_size;
104104} stack_t;
105105
106106#endif /* __ASSEMBLY__ */
lib/libc/include/x86-linux-any/asm/svm.h+19
......@@ -108,6 +108,20 @@
108108#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005
109109#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0
110110#define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1
111#define SVM_VMGEXIT_PSC 0x80000010
112#define SVM_VMGEXIT_GUEST_REQUEST 0x80000011
113#define SVM_VMGEXIT_EXT_GUEST_REQUEST 0x80000012
114#define SVM_VMGEXIT_AP_CREATION 0x80000013
115#define SVM_VMGEXIT_AP_CREATE_ON_INIT 0
116#define SVM_VMGEXIT_AP_CREATE 1
117#define SVM_VMGEXIT_AP_DESTROY 2
118#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd
119#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe
120#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \
121 /* SW_EXITINFO1[3:0] */ \
122 (((((u64)reason_set) & 0xf)) | \
123 /* SW_EXITINFO1[11:4] */ \
124 ((((u64)reason_code) & 0xff) << 4))
111125#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
112126
113127/* Exit code reserved for hypervisor/software use */
......@@ -218,6 +232,11 @@
218232 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \
219233 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \
220234 { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \
235 { SVM_VMGEXIT_PSC, "vmgexit_page_state_change" }, \
236 { SVM_VMGEXIT_GUEST_REQUEST, "vmgexit_guest_request" }, \
237 { SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \
238 { SVM_VMGEXIT_AP_CREATION, "vmgexit_ap_creation" }, \
239 { SVM_VMGEXIT_HV_FEATURES, "vmgexit_hypervisor_feature" }, \
221240 { SVM_EXIT_ERR, "invalid_guest_state" }
222241
223242
lib/libc/include/x86-linux-any/asm/unistd_32.h+1
......@@ -440,6 +440,7 @@
440440#define __NR_memfd_secret 447
441441#define __NR_process_mrelease 448
442442#define __NR_futex_waitv 449
443#define __NR_set_mempolicy_home_node 450
443444
444445
445446#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h+1
......@@ -362,6 +362,7 @@
362362#define __NR_memfd_secret 447
363363#define __NR_process_mrelease 448
364364#define __NR_futex_waitv 449
365#define __NR_set_mempolicy_home_node 450
365366
366367
367368#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h+1
......@@ -315,6 +315,7 @@
315315#define __NR_memfd_secret (__X32_SYSCALL_BIT + 447)
316316#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)
317317#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)
318#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)
318319#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
319320#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
320321#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/x86-linux-any/asm/vmx.h+3-1
......@@ -91,6 +91,7 @@
9191#define EXIT_REASON_UMWAIT 67
9292#define EXIT_REASON_TPAUSE 68
9393#define EXIT_REASON_BUS_LOCK 74
94#define EXIT_REASON_NOTIFY 75
9495
9596#define VMX_EXIT_REASONS \
9697 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
......@@ -153,7 +154,8 @@
153154 { EXIT_REASON_XRSTORS, "XRSTORS" }, \
154155 { EXIT_REASON_UMWAIT, "UMWAIT" }, \
155156 { EXIT_REASON_TPAUSE, "TPAUSE" }, \
156 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }
157 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
158 { EXIT_REASON_NOTIFY, "NOTIFY" }
157159
158160#define VMX_EXIT_REASON_FLAGS \
159161 { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }
lib/libc/include/xtensa-linux-any/asm/auxvec.h created+4
......@@ -0,0 +1,4 @@
1#ifndef __XTENSA_AUXVEC_H
2#define __XTENSA_AUXVEC_H
3
4#endif
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/byteorder.h created+13
......@@ -0,0 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XTENSA_BYTEORDER_H
3#define _XTENSA_BYTEORDER_H
4
5#ifdef __XTENSA_EL__
6#include <linux/byteorder/little_endian.h>
7#elif defined(__XTENSA_EB__)
8#include <linux/byteorder/big_endian.h>
9#else
10# error processor byte order undefined!
11#endif
12
13#endif /* _XTENSA_BYTEORDER_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/ioctls.h created+130
......@@ -0,0 +1,130 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/ioctls.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2003 - 2005 Tensilica Inc.
10 *
11 * Derived from "include/asm-i386/ioctls.h"
12 */
13
14#ifndef _XTENSA_IOCTLS_H
15#define _XTENSA_IOCTLS_H
16
17#include <asm/ioctl.h>
18
19#define FIOCLEX _IO('f', 1)
20#define FIONCLEX _IO('f', 2)
21#define FIOASYNC _IOW('f', 125, int)
22#define FIONBIO _IOW('f', 126, int)
23#define FIONREAD _IOR('f', 127, int)
24#define TIOCINQ FIONREAD
25#define FIOQSIZE _IOR('f', 128, loff_t)
26
27#define TCGETS 0x5401
28#define TCSETS 0x5402
29#define TCSETSW 0x5403
30#define TCSETSF 0x5404
31
32#define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */
33#define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */
34#define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */
35#define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */
36
37#define TCSBRK _IO('t', 29)
38#define TCXONC _IO('t', 30)
39#define TCFLSH _IO('t', 31)
40
41#define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */
42#define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */
43#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
44#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
45#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
46
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49
50#define TIOCEXCL _IO('T', 12)
51#define TIOCNXCL _IO('T', 13)
52#define TIOCSCTTY _IO('T', 14)
53
54#define TIOCSTI _IOW('T', 18, char)
55#define TIOCMGET _IOR('T', 21, unsigned int)
56#define TIOCMBIS _IOW('T', 22, unsigned int)
57#define TIOCMBIC _IOW('T', 23, unsigned int)
58#define TIOCMSET _IOW('T', 24, unsigned int)
59# define TIOCM_LE 0x001
60# define TIOCM_DTR 0x002
61# define TIOCM_RTS 0x004
62# define TIOCM_ST 0x008
63# define TIOCM_SR 0x010
64# define TIOCM_CTS 0x020
65# define TIOCM_CAR 0x040
66# define TIOCM_RNG 0x080
67# define TIOCM_DSR 0x100
68# define TIOCM_CD TIOCM_CAR
69# define TIOCM_RI TIOCM_RNG
70
71#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
72#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
73#define TIOCLINUX _IOW('T', 28, char)
74#define TIOCCONS _IO('T', 29)
75#define TIOCGSERIAL 0x803C541E /*_IOR('T', 30, struct serial_struct)*/
76#define TIOCSSERIAL 0x403C541F /*_IOW('T', 31, struct serial_struct)*/
77#define TIOCPKT _IOW('T', 32, int)
78# define TIOCPKT_DATA 0
79# define TIOCPKT_FLUSHREAD 1
80# define TIOCPKT_FLUSHWRITE 2
81# define TIOCPKT_STOP 4
82# define TIOCPKT_START 8
83# define TIOCPKT_NOSTOP 16
84# define TIOCPKT_DOSTOP 32
85# define TIOCPKT_IOCTL 64
86
87
88#define TIOCNOTTY _IO('T', 34)
89#define TIOCSETD _IOW('T', 35, int)
90#define TIOCGETD _IOR('T', 36, int)
91#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
92#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
93#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
94#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
95#define TCGETS2 _IOR('T', 42, struct termios2)
96#define TCSETS2 _IOW('T', 43, struct termios2)
97#define TCSETSW2 _IOW('T', 44, struct termios2)
98#define TCSETSF2 _IOW('T', 45, struct termios2)
99#define TIOCGRS485 _IOR('T', 46, struct serial_rs485)
100#define TIOCSRS485 _IOWR('T', 47, struct serial_rs485)
101#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
102#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
103#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
104#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
105#define TIOCVHANGUP _IO('T', 0x37)
106#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
107#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
108#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
109#define TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
110#define TIOCGISO7816 _IOR('T', 0x42, struct serial_iso7816)
111#define TIOCSISO7816 _IOWR('T', 0x43, struct serial_iso7816)
112
113#define TIOCSERCONFIG _IO('T', 83)
114#define TIOCSERGWILD _IOR('T', 84, int)
115#define TIOCSERSWILD _IOW('T', 85, int)
116#define TIOCGLCKTRMIOS 0x5456
117#define TIOCSLCKTRMIOS 0x5457
118#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
119#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
120 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
121# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
122#define TIOCSERGETMULTI 0x80a8545a /* Get multiport config */
123 /* _IOR('T', 90, struct serial_multiport_struct) */
124#define TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
125 /* _IOW('T', 91, struct serial_multiport_struct) */
126
127#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
128#define TIOCGICOUNT 0x545D /* read serial port __inline__ interrupt counts */
129
130#endif /* _XTENSA_IOCTLS_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/ipcbuf.h created+40
......@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/ipcbuf.h
4 *
5 * The ipc64_perm structure for the Xtensa architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_IPCBUF_H
13#define _XTENSA_IPCBUF_H
14
15#include <linux/posix_types.h>
16
17/*
18 * Pad space is left for:
19 * - 32-bit mode_t and seq
20 * - 2 miscellaneous 32-bit values
21 *
22 * This file is subject to the terms and conditions of the GNU General
23 * Public License. See the file "COPYING" in the main directory of
24 * this archive for more details.
25 */
26
27struct ipc64_perm
28{
29 __kernel_key_t key;
30 __kernel_uid32_t uid;
31 __kernel_gid32_t gid;
32 __kernel_uid32_t cuid;
33 __kernel_gid32_t cgid;
34 __kernel_mode_t mode;
35 unsigned long seq;
36 unsigned long __unused1;
37 unsigned long __unused2;
38};
39
40#endif /* _XTENSA_IPCBUF_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/mman.h created+124
......@@ -0,0 +1,124 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/mman.h
4 *
5 * Xtensa Processor memory-manager definitions
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 1995 by Ralf Baechle
12 * Copyright (C) 2001 - 2005 Tensilica Inc.
13 */
14
15#ifndef _XTENSA_MMAN_H
16#define _XTENSA_MMAN_H
17
18/*
19 * Protections are chosen from these bits, OR'd together. The
20 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
21 * without PROT_READ. The only guarantees are that no writing will be
22 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
23 */
24
25#define PROT_NONE 0x0 /* page can not be accessed */
26#define PROT_READ 0x1 /* page can be read */
27#define PROT_WRITE 0x2 /* page can be written */
28#define PROT_EXEC 0x4 /* page can be executed */
29
30#define PROT_SEM 0x10 /* page may be used for atomic ops */
31#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
32#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end fo growsup vma */
33
34/*
35 * Flags for mmap
36 */
37/* 0x01 - 0x03 are defined in linux/mman.h */
38#define MAP_TYPE 0x00f /* Mask for type of mapping */
39#define MAP_FIXED 0x010 /* Interpret addr exactly */
40
41/* not used by linux, but here to make sure we don't clash with ABI defines */
42#define MAP_RENAME 0x020 /* Assign page to file */
43#define MAP_AUTOGROW 0x040 /* File may grow by writing */
44#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
45#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
46
47/* These are linux-specific */
48#define MAP_NORESERVE 0x0400 /* don't check for reservations */
49#define MAP_ANONYMOUS 0x0800 /* don't use a file */
50#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
51#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
52#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
53#define MAP_LOCKED 0x8000 /* pages are locked */
54#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
55#define MAP_NONBLOCK 0x20000 /* do not block on IO */
56#define MAP_STACK 0x40000 /* give out an address that is best suited for process/thread stacks */
57#define MAP_HUGETLB 0x80000 /* create a huge page mapping */
58#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
59#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be
60 * uninitialized */
61
62/*
63 * Flags for msync
64 */
65#define MS_ASYNC 0x0001 /* sync memory asynchronously */
66#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
67#define MS_SYNC 0x0004 /* synchronous memory sync */
68
69/*
70 * Flags for mlockall
71 */
72#define MCL_CURRENT 1 /* lock all current mappings */
73#define MCL_FUTURE 2 /* lock all future mappings */
74#define MCL_ONFAULT 4 /* lock all pages that are faulted in */
75
76/*
77 * Flags for mlock
78 */
79#define MLOCK_ONFAULT 0x01 /* Lock pages in range after they are faulted in, do not prefault */
80
81#define MADV_NORMAL 0 /* no further special treatment */
82#define MADV_RANDOM 1 /* expect random page references */
83#define MADV_SEQUENTIAL 2 /* expect sequential page references */
84#define MADV_WILLNEED 3 /* will need these pages */
85#define MADV_DONTNEED 4 /* don't need these pages */
86
87/* common parameters: try to keep these consistent across architectures */
88#define MADV_FREE 8 /* free pages only if memory pressure */
89#define MADV_REMOVE 9 /* remove these pages & resources */
90#define MADV_DONTFORK 10 /* don't inherit across fork */
91#define MADV_DOFORK 11 /* do inherit across fork */
92
93#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
94#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
95
96#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */
97#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */
98
99#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump,
100 overrides the coredump filter bits */
101#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */
102
103#define MADV_WIPEONFORK 18 /* Zero memory on fork, child only */
104#define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK */
105
106#define MADV_COLD 20 /* deactivate these pages */
107#define MADV_PAGEOUT 21 /* reclaim these pages */
108
109#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
110#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */
111
112#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */
113
114#define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */
115
116/* compatibility flags */
117#define MAP_FILE 0
118
119#define PKEY_DISABLE_ACCESS 0x1
120#define PKEY_DISABLE_WRITE 0x2
121#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
122 PKEY_DISABLE_WRITE)
123
124#endif /* _XTENSA_MMAN_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/msgbuf.h created+50
......@@ -0,0 +1,50 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/msgbuf.h
4 *
5 * The msqid64_ds structure for the Xtensa architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 2 miscellaneous 32-bit values
11 *
12 * This file is subject to the terms and conditions of the GNU General
13 * Public License. See the file "COPYING" in the main directory of
14 * this archive for more details.
15 */
16
17#ifndef _XTENSA_MSGBUF_H
18#define _XTENSA_MSGBUF_H
19
20#include <asm/ipcbuf.h>
21
22struct msqid64_ds {
23 struct ipc64_perm msg_perm;
24#ifdef __XTENSA_EB__
25 unsigned long msg_stime_high;
26 unsigned long msg_stime; /* last msgsnd time */
27 unsigned long msg_rtime_high;
28 unsigned long msg_rtime; /* last msgrcv time */
29 unsigned long msg_ctime_high;
30 unsigned long msg_ctime; /* last change time */
31#elif defined(__XTENSA_EL__)
32 unsigned long msg_stime; /* last msgsnd time */
33 unsigned long msg_stime_high;
34 unsigned long msg_rtime; /* last msgrcv time */
35 unsigned long msg_rtime_high;
36 unsigned long msg_ctime; /* last change time */
37 unsigned long msg_ctime_high;
38#else
39# error processor byte order undefined!
40#endif
41 unsigned long msg_cbytes; /* current number of bytes on queue */
42 unsigned long msg_qnum; /* number of messages in queue */
43 unsigned long msg_qbytes; /* max number of bytes on queue */
44 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
45 __kernel_pid_t msg_lrpid; /* last receive pid */
46 unsigned long __unused4;
47 unsigned long __unused5;
48};
49
50#endif /* _XTENSA_MSGBUF_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/param.h created+29
......@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/param.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_PARAM_H
13#define _XTENSA_PARAM_H
14
15# define HZ 100
16
17#define EXEC_PAGESIZE 4096
18
19#ifndef NGROUPS
20#define NGROUPS 32
21#endif
22
23#ifndef NOGROUP
24#define NOGROUP (-1)
25#endif
26
27#define MAXHOSTNAMELEN 64 /* max length of hostname */
28
29#endif /* _XTENSA_PARAM_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/poll.h created+21
......@@ -0,0 +1,21 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/poll.h
4 *
5 * This file is subject to the terms and conditions of the GNU General
6 * Public License. See the file "COPYING" in the main directory of
7 * this archive for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_POLL_H
13#define _XTENSA_POLL_H
14
15#define POLLWRNORM POLLOUT
16#define POLLWRBAND 0x0100
17#define POLLREMOVE 0x0800
18
19#include <asm-generic/poll.h>
20
21#endif /* _XTENSA_POLL_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/posix_types.h created+40
......@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/posix_types.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Largely copied from include/asm-ppc/posix_types.h
10 *
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_POSIX_TYPES_H
15#define _XTENSA_POSIX_TYPES_H
16
17/*
18 * This file is generally used by user-level software, so you need to
19 * be a little careful about namespace pollution etc. Also, we cannot
20 * assume GCC is being used.
21 */
22
23typedef unsigned short __kernel_ipc_pid_t;
24#define __kernel_ipc_pid_t __kernel_ipc_pid_t
25
26typedef unsigned int __kernel_size_t;
27typedef int __kernel_ssize_t;
28typedef long __kernel_ptrdiff_t;
29#define __kernel_size_t __kernel_size_t
30
31typedef unsigned short __kernel_old_uid_t;
32typedef unsigned short __kernel_old_gid_t;
33#define __kernel_old_uid_t __kernel_old_uid_t
34
35typedef unsigned short __kernel_old_dev_t;
36#define __kernel_old_dev_t __kernel_old_dev_t
37
38#include <asm-generic/posix_types.h>
39
40#endif /* _XTENSA_POSIX_TYPES_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/ptrace.h created+63
......@@ -0,0 +1,63 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/ptrace.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_PTRACE_H
13#define _XTENSA_PTRACE_H
14
15#include <linux/types.h>
16
17/* Registers used by strace */
18
19#define REG_A_BASE 0x0000
20#define REG_AR_BASE 0x0100
21#define REG_PC 0x0020
22#define REG_PS 0x02e6
23#define REG_WB 0x0248
24#define REG_WS 0x0249
25#define REG_LBEG 0x0200
26#define REG_LEND 0x0201
27#define REG_LCOUNT 0x0202
28#define REG_SAR 0x0203
29
30#define SYSCALL_NR 0x00ff
31
32/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
33
34#define PTRACE_GETREGS 12
35#define PTRACE_SETREGS 13
36#define PTRACE_GETXTREGS 18
37#define PTRACE_SETXTREGS 19
38#define PTRACE_GETHBPREGS 20
39#define PTRACE_SETHBPREGS 21
40#define PTRACE_GETFDPIC 22
41
42#define PTRACE_GETFDPIC_EXEC 0
43#define PTRACE_GETFDPIC_INTERP 1
44
45#ifndef __ASSEMBLY__
46
47struct user_pt_regs {
48 __u32 pc;
49 __u32 ps;
50 __u32 lbeg;
51 __u32 lend;
52 __u32 lcount;
53 __u32 sar;
54 __u32 windowstart;
55 __u32 windowbase;
56 __u32 threadptr;
57 __u32 syscall;
58 __u32 reserved[6 + 48];
59 __u32 a[64];
60};
61
62#endif
63#endif /* _XTENSA_PTRACE_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/sembuf.h created+45
......@@ -0,0 +1,45 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/sembuf.h
4 *
5 * The semid64_ds structure for Xtensa architecture.
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 *
13 * Note extra padding because this structure is passed back and forth
14 * between kernel and user space.
15 *
16 * Pad space is left for:
17 * - 2 miscellaneous 32-bit values
18 *
19 */
20
21#ifndef _XTENSA_SEMBUF_H
22#define _XTENSA_SEMBUF_H
23
24#include <asm/byteorder.h>
25#include <asm/ipcbuf.h>
26
27struct semid64_ds {
28 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
29#ifdef __XTENSA_EL__
30 unsigned long sem_otime; /* last semop time */
31 unsigned long sem_otime_high;
32 unsigned long sem_ctime; /* last change time */
33 unsigned long sem_ctime_high;
34#else
35 unsigned long sem_otime_high;
36 unsigned long sem_otime; /* last semop time */
37 unsigned long sem_ctime_high;
38 unsigned long sem_ctime; /* last change time */
39#endif
40 unsigned long sem_nsems; /* no. of semaphores in array */
41 unsigned long __unused3;
42 unsigned long __unused4;
43};
44
45#endif /* __ASM_XTENSA_SEMBUF_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/setup.h created+17
......@@ -0,0 +1,17 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/setup.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_SETUP_H
13#define _XTENSA_SETUP_H
14
15#define COMMAND_LINE_SIZE 256
16
17#endif
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/shmbuf.h created+54
......@@ -0,0 +1,54 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/shmbuf.h
4 *
5 * The shmid64_ds structure for Xtensa architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space, but the padding is on the wrong
8 * side for big-endian xtensa, for historic reasons.
9 *
10 * Pad space is left for:
11 * - 2 miscellaneous 32-bit values
12 *
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
15 * for more details.
16 *
17 * Copyright (C) 2001 - 2005 Tensilica Inc.
18 */
19
20#ifndef _XTENSA_SHMBUF_H
21#define _XTENSA_SHMBUF_H
22
23#include <asm/ipcbuf.h>
24#include <asm/posix_types.h>
25
26struct shmid64_ds {
27 struct ipc64_perm shm_perm; /* operation perms */
28 __kernel_size_t shm_segsz; /* size of segment (bytes) */
29 unsigned long shm_atime; /* last attach time */
30 unsigned long shm_atime_high;
31 unsigned long shm_dtime; /* last detach time */
32 unsigned long shm_dtime_high;
33 unsigned long shm_ctime; /* last change time */
34 unsigned long shm_ctime_high;
35 __kernel_pid_t shm_cpid; /* pid of creator */
36 __kernel_pid_t shm_lpid; /* pid of last operator */
37 unsigned long shm_nattch; /* no. of current attaches */
38 unsigned long __unused4;
39 unsigned long __unused5;
40};
41
42struct shminfo64 {
43 unsigned long shmmax;
44 unsigned long shmmin;
45 unsigned long shmmni;
46 unsigned long shmseg;
47 unsigned long shmall;
48 unsigned long __unused1;
49 unsigned long __unused2;
50 unsigned long __unused3;
51 unsigned long __unused4;
52};
53
54#endif /* _XTENSA_SHMBUF_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/sigcontext.h created+29
......@@ -0,0 +1,29 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/sigcontext.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2007 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_SIGCONTEXT_H
13#define _XTENSA_SIGCONTEXT_H
14
15
16struct sigcontext {
17 unsigned long sc_pc;
18 unsigned long sc_ps;
19 unsigned long sc_lbeg;
20 unsigned long sc_lend;
21 unsigned long sc_lcount;
22 unsigned long sc_sar;
23 unsigned long sc_acclo;
24 unsigned long sc_acchi;
25 unsigned long sc_a[16];
26 void *sc_xtregs;
27};
28
29#endif /* _XTENSA_SIGCONTEXT_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/signal.h created+108
......@@ -0,0 +1,108 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/signal.h
4 *
5 * Swiped from SH.
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_SIGNAL_H
15#define _XTENSA_SIGNAL_H
16
17
18#define _NSIG 64
19#define _NSIG_BPW 32
20#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
21
22#ifndef __ASSEMBLY__
23
24#include <linux/types.h>
25
26/* Avoid too many header ordering problems. */
27struct siginfo;
28typedef unsigned long old_sigset_t; /* at least 32 bits */
29typedef struct {
30 unsigned long sig[_NSIG_WORDS];
31} sigset_t;
32
33#endif
34
35#define SIGHUP 1
36#define SIGINT 2
37#define SIGQUIT 3
38#define SIGILL 4
39#define SIGTRAP 5
40#define SIGABRT 6
41#define SIGIOT 6
42#define SIGBUS 7
43#define SIGFPE 8
44#define SIGKILL 9
45#define SIGUSR1 10
46#define SIGSEGV 11
47#define SIGUSR2 12
48#define SIGPIPE 13
49#define SIGALRM 14
50#define SIGTERM 15
51#define SIGSTKFLT 16
52#define SIGCHLD 17
53#define SIGCONT 18
54#define SIGSTOP 19
55#define SIGTSTP 20
56#define SIGTTIN 21
57#define SIGTTOU 22
58#define SIGURG 23
59#define SIGXCPU 24
60#define SIGXFSZ 25
61#define SIGVTALRM 26
62#define SIGPROF 27
63#define SIGWINCH 28
64#define SIGIO 29
65#define SIGPOLL SIGIO
66/* #define SIGLOST 29 */
67#define SIGPWR 30
68#define SIGSYS 31
69#define SIGUNUSED 31
70
71/* These should not be considered constants from userland. */
72#define SIGRTMIN 32
73#define SIGRTMAX (_NSIG-1)
74
75#define SA_RESTORER 0x04000000
76
77#define MINSIGSTKSZ 2048
78#define SIGSTKSZ 8192
79
80#ifndef __ASSEMBLY__
81
82#include <asm-generic/signal-defs.h>
83
84
85/* Here we must cater to libcs that poke about in kernel headers. */
86
87struct sigaction {
88 union {
89 __sighandler_t _sa_handler;
90 void (*_sa_sigaction)(int, struct siginfo *, void *);
91 } _u;
92 sigset_t sa_mask;
93 unsigned long sa_flags;
94 void (*sa_restorer)(void);
95};
96
97#define sa_handler _u._sa_handler
98#define sa_sigaction _u._sa_sigaction
99
100
101typedef struct sigaltstack {
102 void *ss_sp;
103 int ss_flags;
104 __kernel_size_t ss_size;
105} stack_t;
106
107#endif /* __ASSEMBLY__ */
108#endif /* _XTENSA_SIGNAL_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/sockios.h created+32
......@@ -0,0 +1,32 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/sockios.h
4 *
5 * Socket-level I/O control calls. Copied from MIPS.
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 1995 by Ralf Baechle
12 * Copyright (C) 2001 Tensilica Inc.
13 */
14
15#ifndef _XTENSA_SOCKIOS_H
16#define _XTENSA_SOCKIOS_H
17
18#include <asm/ioctl.h>
19
20/* Socket-level I/O control calls. */
21
22#define FIOGETOWN _IOR('f', 123, int)
23#define FIOSETOWN _IOW('f', 124, int)
24
25#define SIOCATMARK _IOR('s', 7, int)
26#define SIOCSPGRP _IOW('s', 8, pid_t)
27#define SIOCGPGRP _IOR('s', 9, pid_t)
28
29#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
30#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
31
32#endif /* _XTENSA_SOCKIOS_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/stat.h created+60
......@@ -0,0 +1,60 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/stat.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2007 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_STAT_H
13#define _XTENSA_STAT_H
14
15#define STAT_HAVE_NSEC 1
16
17struct stat {
18 unsigned long st_dev;
19 unsigned long st_ino;
20 unsigned int st_mode;
21 unsigned int st_nlink;
22 unsigned int st_uid;
23 unsigned int st_gid;
24 unsigned long st_rdev;
25 long st_size;
26 unsigned long st_blksize;
27 unsigned long st_blocks;
28 unsigned long st_atime;
29 unsigned long st_atime_nsec;
30 unsigned long st_mtime;
31 unsigned long st_mtime_nsec;
32 unsigned long st_ctime;
33 unsigned long st_ctime_nsec;
34 unsigned long __unused4;
35 unsigned long __unused5;
36};
37
38struct stat64 {
39 unsigned long long st_dev; /* Device */
40 unsigned long long st_ino; /* File serial number */
41 unsigned int st_mode; /* File mode. */
42 unsigned int st_nlink; /* Link count. */
43 unsigned int st_uid; /* User ID of the file's owner. */
44 unsigned int st_gid; /* Group ID of the file's group. */
45 unsigned long long st_rdev; /* Device number, if device. */
46 long long st_size; /* Size of file, in bytes. */
47 unsigned long st_blksize; /* Optimal block size for I/O. */
48 unsigned long __unused2;
49 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
50 unsigned long st_atime; /* Time of last access. */
51 unsigned long st_atime_nsec;
52 unsigned long st_mtime; /* Time of last modification. */
53 unsigned long st_mtime_nsec;
54 unsigned long st_ctime; /* Time of last status change. */
55 unsigned long st_ctime_nsec;
56 unsigned long __unused4;
57 unsigned long __unused5;
58};
59
60#endif /* _XTENSA_STAT_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/swab.h created+71
......@@ -0,0 +1,71 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/swab.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_SWAB_H
13#define _XTENSA_SWAB_H
14
15#include <linux/types.h>
16
17
18#define __SWAB_64_THRU_32__
19
20static __inline__ __u32 __arch_swab32(__u32 x)
21{
22 __u32 res;
23 /* instruction sequence from Xtensa ISA release 2/2000 */
24 __asm__("ssai 8 \n\t"
25 "srli %0, %1, 16 \n\t"
26 "src %0, %0, %1 \n\t"
27 "src %0, %0, %0 \n\t"
28 "src %0, %1, %0 \n"
29 : "=&a" (res)
30 : "a" (x)
31 );
32 return res;
33}
34#define __arch_swab32 __arch_swab32
35
36static __inline__ __u16 __arch_swab16(__u16 x)
37{
38 /* Given that 'short' values are signed (i.e., can be negative),
39 * we cannot assume that the upper 16-bits of the register are
40 * zero. We are careful to mask values after shifting.
41 */
42
43 /* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc
44 * inserts an extui instruction after putting this function __inline__
45 * to ensure that it uses only the least-significant 16 bits of
46 * the result. xt-xcc doesn't use an extui, but assumes the
47 * __asm__ macro follows convention that the upper 16 bits of an
48 * 'unsigned short' result are still zero. This macro doesn't
49 * follow convention; indeed, it leaves garbage in the upport 16
50 * bits of the register.
51
52 * Declaring the temporary variables 'res' and 'tmp' to be 32-bit
53 * types while the return type of the function is a 16-bit type
54 * forces both compilers to insert exactly one extui instruction
55 * (or equivalent) to mask off the upper 16 bits. */
56
57 __u32 res;
58 __u32 tmp;
59
60 __asm__("extui %1, %2, 8, 8\n\t"
61 "slli %0, %2, 8 \n\t"
62 "or %0, %0, %1 \n"
63 : "=&a" (res), "=&a" (tmp)
64 : "a" (x)
65 );
66
67 return res;
68}
69#define __arch_swab16 __arch_swab16
70
71#endif /* _XTENSA_SWAB_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/types.h created+30
......@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * include/asm-xtensa/types.h
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_TYPES_H
13#define _XTENSA_TYPES_H
14
15#include <asm-generic/int-ll64.h>
16
17#ifdef __ASSEMBLY__
18# define __XTENSA_UL(x) (x)
19# define __XTENSA_UL_CONST(x) x
20#else
21# define __XTENSA_UL(x) ((unsigned long)(x))
22# define ___XTENSA_UL_CONST(x) x##UL
23# define __XTENSA_UL_CONST(x) ___XTENSA_UL_CONST(x)
24#endif
25
26#ifndef __ASSEMBLY__
27
28#endif
29
30#endif /* _XTENSA_TYPES_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/unistd.h created+26
......@@ -0,0 +1,26 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _XTENSA_UNISTD_H
3#define _XTENSA_UNISTD_H
4
5#include <asm/unistd_32.h>
6
7#define __ARCH_WANT_SYS_OLDUMOUNT
8
9/*
10 * sysxtensa syscall handler
11 *
12 * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused);
13 * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused);
14 * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused);
15 * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
16 * a2 a6 a3 a4 a5
17 */
18
19#define SYS_XTENSA_RESERVED 0 /* don't use this */
20#define SYS_XTENSA_ATOMIC_SET 1 /* set variable */
21#define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */
22#define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */
23#define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
24#define SYS_XTENSA_COUNT 5 /* count */
25
26#endif /* _XTENSA_UNISTD_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/unistd_32.h created+402
......@@ -0,0 +1,402 @@
1#ifndef _ASM_UNISTD_32_H
2#define _ASM_UNISTD_32_H
3
4#define __NR_spill 0
5#define __NR_xtensa 1
6#define __NR_available4 2
7#define __NR_available5 3
8#define __NR_available6 4
9#define __NR_available7 5
10#define __NR_available8 6
11#define __NR_available9 7
12#define __NR_open 8
13#define __NR_close 9
14#define __NR_dup 10
15#define __NR_dup2 11
16#define __NR_read 12
17#define __NR_write 13
18#define __NR_select 14
19#define __NR_lseek 15
20#define __NR_poll 16
21#define __NR__llseek 17
22#define __NR_epoll_wait 18
23#define __NR_epoll_ctl 19
24#define __NR_epoll_create 20
25#define __NR_creat 21
26#define __NR_truncate 22
27#define __NR_ftruncate 23
28#define __NR_readv 24
29#define __NR_writev 25
30#define __NR_fsync 26
31#define __NR_fdatasync 27
32#define __NR_truncate64 28
33#define __NR_ftruncate64 29
34#define __NR_pread64 30
35#define __NR_pwrite64 31
36#define __NR_link 32
37#define __NR_rename 33
38#define __NR_symlink 34
39#define __NR_readlink 35
40#define __NR_mknod 36
41#define __NR_pipe 37
42#define __NR_unlink 38
43#define __NR_rmdir 39
44#define __NR_mkdir 40
45#define __NR_chdir 41
46#define __NR_fchdir 42
47#define __NR_getcwd 43
48#define __NR_chmod 44
49#define __NR_chown 45
50#define __NR_stat 46
51#define __NR_stat64 47
52#define __NR_lchown 48
53#define __NR_lstat 49
54#define __NR_lstat64 50
55#define __NR_available51 51
56#define __NR_fchmod 52
57#define __NR_fchown 53
58#define __NR_fstat 54
59#define __NR_fstat64 55
60#define __NR_flock 56
61#define __NR_access 57
62#define __NR_umask 58
63#define __NR_getdents 59
64#define __NR_getdents64 60
65#define __NR_fcntl64 61
66#define __NR_fallocate 62
67#define __NR_fadvise64_64 63
68#define __NR_utime 64
69#define __NR_utimes 65
70#define __NR_ioctl 66
71#define __NR_fcntl 67
72#define __NR_setxattr 68
73#define __NR_getxattr 69
74#define __NR_listxattr 70
75#define __NR_removexattr 71
76#define __NR_lsetxattr 72
77#define __NR_lgetxattr 73
78#define __NR_llistxattr 74
79#define __NR_lremovexattr 75
80#define __NR_fsetxattr 76
81#define __NR_fgetxattr 77
82#define __NR_flistxattr 78
83#define __NR_fremovexattr 79
84#define __NR_mmap2 80
85#define __NR_munmap 81
86#define __NR_mprotect 82
87#define __NR_brk 83
88#define __NR_mlock 84
89#define __NR_munlock 85
90#define __NR_mlockall 86
91#define __NR_munlockall 87
92#define __NR_mremap 88
93#define __NR_msync 89
94#define __NR_mincore 90
95#define __NR_madvise 91
96#define __NR_shmget 92
97#define __NR_shmat 93
98#define __NR_shmctl 94
99#define __NR_shmdt 95
100#define __NR_socket 96
101#define __NR_setsockopt 97
102#define __NR_getsockopt 98
103#define __NR_shutdown 99
104#define __NR_bind 100
105#define __NR_connect 101
106#define __NR_listen 102
107#define __NR_accept 103
108#define __NR_getsockname 104
109#define __NR_getpeername 105
110#define __NR_sendmsg 106
111#define __NR_recvmsg 107
112#define __NR_send 108
113#define __NR_recv 109
114#define __NR_sendto 110
115#define __NR_recvfrom 111
116#define __NR_socketpair 112
117#define __NR_sendfile 113
118#define __NR_sendfile64 114
119#define __NR_sendmmsg 115
120#define __NR_clone 116
121#define __NR_execve 117
122#define __NR_exit 118
123#define __NR_exit_group 119
124#define __NR_getpid 120
125#define __NR_wait4 121
126#define __NR_waitid 122
127#define __NR_kill 123
128#define __NR_tkill 124
129#define __NR_tgkill 125
130#define __NR_set_tid_address 126
131#define __NR_gettid 127
132#define __NR_setsid 128
133#define __NR_getsid 129
134#define __NR_prctl 130
135#define __NR_personality 131
136#define __NR_getpriority 132
137#define __NR_setpriority 133
138#define __NR_setitimer 134
139#define __NR_getitimer 135
140#define __NR_setuid 136
141#define __NR_getuid 137
142#define __NR_setgid 138
143#define __NR_getgid 139
144#define __NR_geteuid 140
145#define __NR_getegid 141
146#define __NR_setreuid 142
147#define __NR_setregid 143
148#define __NR_setresuid 144
149#define __NR_getresuid 145
150#define __NR_setresgid 146
151#define __NR_getresgid 147
152#define __NR_setpgid 148
153#define __NR_getpgid 149
154#define __NR_getppid 150
155#define __NR_getpgrp 151
156#define __NR_reserved152 152
157#define __NR_reserved153 153
158#define __NR_times 154
159#define __NR_acct 155
160#define __NR_sched_setaffinity 156
161#define __NR_sched_getaffinity 157
162#define __NR_capget 158
163#define __NR_capset 159
164#define __NR_ptrace 160
165#define __NR_semtimedop 161
166#define __NR_semget 162
167#define __NR_semop 163
168#define __NR_semctl 164
169#define __NR_available165 165
170#define __NR_msgget 166
171#define __NR_msgsnd 167
172#define __NR_msgrcv 168
173#define __NR_msgctl 169
174#define __NR_available170 170
175#define __NR_umount2 171
176#define __NR_mount 172
177#define __NR_swapon 173
178#define __NR_chroot 174
179#define __NR_pivot_root 175
180#define __NR_umount 176
181#define __NR_swapoff 177
182#define __NR_sync 178
183#define __NR_syncfs 179
184#define __NR_setfsuid 180
185#define __NR_setfsgid 181
186#define __NR_sysfs 182
187#define __NR_ustat 183
188#define __NR_statfs 184
189#define __NR_fstatfs 185
190#define __NR_statfs64 186
191#define __NR_fstatfs64 187
192#define __NR_setrlimit 188
193#define __NR_getrlimit 189
194#define __NR_getrusage 190
195#define __NR_futex 191
196#define __NR_gettimeofday 192
197#define __NR_settimeofday 193
198#define __NR_adjtimex 194
199#define __NR_nanosleep 195
200#define __NR_getgroups 196
201#define __NR_setgroups 197
202#define __NR_sethostname 198
203#define __NR_setdomainname 199
204#define __NR_syslog 200
205#define __NR_vhangup 201
206#define __NR_uselib 202
207#define __NR_reboot 203
208#define __NR_quotactl 204
209#define __NR_nfsservctl 205
210#define __NR__sysctl 206
211#define __NR_bdflush 207
212#define __NR_uname 208
213#define __NR_sysinfo 209
214#define __NR_init_module 210
215#define __NR_delete_module 211
216#define __NR_sched_setparam 212
217#define __NR_sched_getparam 213
218#define __NR_sched_setscheduler 214
219#define __NR_sched_getscheduler 215
220#define __NR_sched_get_priority_max 216
221#define __NR_sched_get_priority_min 217
222#define __NR_sched_rr_get_interval 218
223#define __NR_sched_yield 219
224#define __NR_available222 222
225#define __NR_restart_syscall 223
226#define __NR_sigaltstack 224
227#define __NR_rt_sigreturn 225
228#define __NR_rt_sigaction 226
229#define __NR_rt_sigprocmask 227
230#define __NR_rt_sigpending 228
231#define __NR_rt_sigtimedwait 229
232#define __NR_rt_sigqueueinfo 230
233#define __NR_rt_sigsuspend 231
234#define __NR_mq_open 232
235#define __NR_mq_unlink 233
236#define __NR_mq_timedsend 234
237#define __NR_mq_timedreceive 235
238#define __NR_mq_notify 236
239#define __NR_mq_getsetattr 237
240#define __NR_available238 238
241#define __NR_io_setup 239
242#define __NR_io_destroy 240
243#define __NR_io_submit 241
244#define __NR_io_getevents 242
245#define __NR_io_cancel 243
246#define __NR_clock_settime 244
247#define __NR_clock_gettime 245
248#define __NR_clock_getres 246
249#define __NR_clock_nanosleep 247
250#define __NR_timer_create 248
251#define __NR_timer_delete 249
252#define __NR_timer_settime 250
253#define __NR_timer_gettime 251
254#define __NR_timer_getoverrun 252
255#define __NR_reserved253 253
256#define __NR_lookup_dcookie 254
257#define __NR_available255 255
258#define __NR_add_key 256
259#define __NR_request_key 257
260#define __NR_keyctl 258
261#define __NR_available259 259
262#define __NR_readahead 260
263#define __NR_remap_file_pages 261
264#define __NR_migrate_pages 262
265#define __NR_mbind 263
266#define __NR_get_mempolicy 264
267#define __NR_set_mempolicy 265
268#define __NR_unshare 266
269#define __NR_move_pages 267
270#define __NR_splice 268
271#define __NR_tee 269
272#define __NR_vmsplice 270
273#define __NR_available271 271
274#define __NR_pselect6 272
275#define __NR_ppoll 273
276#define __NR_epoll_pwait 274
277#define __NR_epoll_create1 275
278#define __NR_inotify_init 276
279#define __NR_inotify_add_watch 277
280#define __NR_inotify_rm_watch 278
281#define __NR_inotify_init1 279
282#define __NR_getcpu 280
283#define __NR_kexec_load 281
284#define __NR_ioprio_set 282
285#define __NR_ioprio_get 283
286#define __NR_set_robust_list 284
287#define __NR_get_robust_list 285
288#define __NR_available286 286
289#define __NR_available287 287
290#define __NR_openat 288
291#define __NR_mkdirat 289
292#define __NR_mknodat 290
293#define __NR_unlinkat 291
294#define __NR_renameat 292
295#define __NR_linkat 293
296#define __NR_symlinkat 294
297#define __NR_readlinkat 295
298#define __NR_utimensat 296
299#define __NR_fchownat 297
300#define __NR_futimesat 298
301#define __NR_fstatat64 299
302#define __NR_fchmodat 300
303#define __NR_faccessat 301
304#define __NR_available302 302
305#define __NR_available303 303
306#define __NR_signalfd 304
307#define __NR_eventfd 306
308#define __NR_recvmmsg 307
309#define __NR_setns 308
310#define __NR_signalfd4 309
311#define __NR_dup3 310
312#define __NR_pipe2 311
313#define __NR_timerfd_create 312
314#define __NR_timerfd_settime 313
315#define __NR_timerfd_gettime 314
316#define __NR_available315 315
317#define __NR_eventfd2 316
318#define __NR_preadv 317
319#define __NR_pwritev 318
320#define __NR_available319 319
321#define __NR_fanotify_init 320
322#define __NR_fanotify_mark 321
323#define __NR_process_vm_readv 322
324#define __NR_process_vm_writev 323
325#define __NR_name_to_handle_at 324
326#define __NR_open_by_handle_at 325
327#define __NR_sync_file_range2 326
328#define __NR_perf_event_open 327
329#define __NR_rt_tgsigqueueinfo 328
330#define __NR_clock_adjtime 329
331#define __NR_prlimit64 330
332#define __NR_kcmp 331
333#define __NR_finit_module 332
334#define __NR_accept4 333
335#define __NR_sched_setattr 334
336#define __NR_sched_getattr 335
337#define __NR_renameat2 336
338#define __NR_seccomp 337
339#define __NR_getrandom 338
340#define __NR_memfd_create 339
341#define __NR_bpf 340
342#define __NR_execveat 341
343#define __NR_userfaultfd 342
344#define __NR_membarrier 343
345#define __NR_mlock2 344
346#define __NR_copy_file_range 345
347#define __NR_preadv2 346
348#define __NR_pwritev2 347
349#define __NR_pkey_mprotect 348
350#define __NR_pkey_alloc 349
351#define __NR_pkey_free 350
352#define __NR_statx 351
353#define __NR_rseq 352
354#define __NR_clock_gettime64 403
355#define __NR_clock_settime64 404
356#define __NR_clock_adjtime64 405
357#define __NR_clock_getres_time64 406
358#define __NR_clock_nanosleep_time64 407
359#define __NR_timer_gettime64 408
360#define __NR_timer_settime64 409
361#define __NR_timerfd_gettime64 410
362#define __NR_timerfd_settime64 411
363#define __NR_utimensat_time64 412
364#define __NR_pselect6_time64 413
365#define __NR_ppoll_time64 414
366#define __NR_io_pgetevents_time64 416
367#define __NR_recvmmsg_time64 417
368#define __NR_mq_timedsend_time64 418
369#define __NR_mq_timedreceive_time64 419
370#define __NR_semtimedop_time64 420
371#define __NR_rt_sigtimedwait_time64 421
372#define __NR_futex_time64 422
373#define __NR_sched_rr_get_interval_time64 423
374#define __NR_pidfd_send_signal 424
375#define __NR_io_uring_setup 425
376#define __NR_io_uring_enter 426
377#define __NR_io_uring_register 427
378#define __NR_open_tree 428
379#define __NR_move_mount 429
380#define __NR_fsopen 430
381#define __NR_fsconfig 431
382#define __NR_fsmount 432
383#define __NR_fspick 433
384#define __NR_pidfd_open 434
385#define __NR_clone3 435
386#define __NR_close_range 436
387#define __NR_openat2 437
388#define __NR_pidfd_getfd 438
389#define __NR_faccessat2 439
390#define __NR_process_madvise 440
391#define __NR_epoll_pwait2 441
392#define __NR_mount_setattr 442
393#define __NR_quotactl_fd 443
394#define __NR_landlock_create_ruleset 444
395#define __NR_landlock_add_rule 445
396#define __NR_landlock_restrict_self 446
397#define __NR_process_mrelease 448
398#define __NR_futex_waitv 449
399#define __NR_set_mempolicy_home_node 450
400
401
402#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
tools/update-linux-headers.zig+9
......@@ -28,6 +28,7 @@ const LibCTarget = struct {
2828const MultiArch = union(enum) {
2929 arm,
3030 arm64,
31 loongarch,
3132 mips,
3233 powerpc,
3334 riscv,
......@@ -69,6 +70,10 @@ const linux_targets = [_]LibCTarget{
6970 .name = "m68k",
7071 .arch = .{ .specific = .m68k },
7172 },
73 LibCTarget{
74 .name = "loongarch",
75 .arch = .loongarch,
76 },
7277 LibCTarget{
7378 .name = "mips",
7479 .arch = .mips,
......@@ -93,6 +98,10 @@ const linux_targets = [_]LibCTarget{
9398 .name = "x86",
9499 .arch = .x86,
95100 },
101 LibCTarget{
102 .name = "xtensa",
103 .arch = .{ .specific = .xtensa },
104 },
96105};
97106
98107const DestTarget = struct {