authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-15 12:04:36-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-15 12:04:36-07:00
log6bd93ef4eb4c80c2e38d17de118ef049d93a3f77
treeb4ba3eeef21260015c7d8d9329ab995177474349
parent6946a26adc2d27c6da135577898e840513873b96

update linux kernel headers to 6.3.8


432 files changed, 18124 insertions(+), 6298 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+26
...@@ -19,6 +19,9 @@...@@ -19,6 +19,9 @@
1919
20/*20/*
21 * HWCAP flags - for AT_HWCAP21 * 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.
22 */25 */
23#define HWCAP_FP (1 << 0)26#define HWCAP_FP (1 << 0)
24#define HWCAP_ASIMD (1 << 1)27#define HWCAP_ASIMD (1 << 1)
...@@ -76,5 +79,28 @@...@@ -76,5 +79,28 @@
76#define HWCAP2_BTI (1 << 17)79#define HWCAP2_BTI (1 << 17)
77#define HWCAP2_MTE (1 << 18)80#define HWCAP2_MTE (1 << 18)
78#define HWCAP2_ECV (1 << 19)81#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
80#endif /* __ASM_HWCAP_H */106#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 @@...@@ -43,6 +43,7 @@
43#define __KVM_HAVE_VCPU_EVENTS43#define __KVM_HAVE_VCPU_EVENTS
4444
45#define KVM_COALESCED_MMIO_PAGE_OFFSET 145#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
46#define KVM_DIRTY_LOG_PAGE_OFFSET 64
4647
47#define KVM_REG_SIZE(id) \48#define KVM_REG_SIZE(id) \
48 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))49 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
...@@ -75,9 +76,11 @@ struct kvm_regs {...@@ -75,9 +76,11 @@ struct kvm_regs {
7576
76/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */77/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */
77#define KVM_ARM_DEVICE_TYPE_SHIFT 078#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)
79#define KVM_ARM_DEVICE_ID_SHIFT 1681#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
82/* Supported device IDs */85/* Supported device IDs */
83#define KVM_ARM_DEVICE_VGIC_V2 086#define KVM_ARM_DEVICE_VGIC_V2 0
...@@ -106,6 +109,7 @@ struct kvm_regs {...@@ -106,6 +109,7 @@ struct kvm_regs {
106#define KVM_ARM_VCPU_SVE 4 /* enable SVE for this CPU */109#define KVM_ARM_VCPU_SVE 4 /* enable SVE for this CPU */
107#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */110#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */
108#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */111#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */
112#define KVM_ARM_VCPU_HAS_EL2 7 /* Support nested virtualization */
109113
110struct kvm_vcpu_init {114struct kvm_vcpu_init {
111 __u32 target;115 __u32 target;
...@@ -139,8 +143,10 @@ struct kvm_guest_debug_arch {...@@ -139,8 +143,10 @@ struct kvm_guest_debug_arch {
139 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];143 __u64 dbg_wvr[KVM_ARM_MAX_DBG_REGS];
140};144};
141145
146#define KVM_DEBUG_ARCH_HSR_HIGH_VALID (1 << 0)
142struct kvm_debug_exit_arch {147struct kvm_debug_exit_arch {
143 __u32 hsr;148 __u32 hsr;
149 __u32 hsr_high; /* ESR_EL2[61:32] */
144 __u64 far; /* used for watchpoints */150 __u64 far; /* used for watchpoints */
145};151};
146152
...@@ -281,6 +287,11 @@ struct kvm_arm_copy_mte_tags {...@@ -281,6 +287,11 @@ struct kvm_arm_copy_mte_tags {
281#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3287#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3
282#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4)288#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
284/* SVE registers */295/* SVE registers */
285#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT)296#define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT)
286297
...@@ -327,6 +338,31 @@ struct kvm_arm_copy_mte_tags {...@@ -327,6 +338,31 @@ struct kvm_arm_copy_mte_tags {
327#define KVM_ARM64_SVE_VLS_WORDS \338#define KVM_ARM64_SVE_VLS_WORDS \
328 ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)339 ((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
330/* Device Control API: ARM VGIC */366/* Device Control API: ARM VGIC */
331#define KVM_DEV_ARM_VGIC_GRP_ADDR 0367#define KVM_DEV_ARM_VGIC_GRP_ADDR 0
332#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1368#define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
...@@ -362,6 +398,7 @@ struct kvm_arm_copy_mte_tags {...@@ -362,6 +398,7 @@ struct kvm_arm_copy_mte_tags {
362#define KVM_ARM_VCPU_PMU_V3_IRQ 0398#define KVM_ARM_VCPU_PMU_V3_IRQ 0
363#define KVM_ARM_VCPU_PMU_V3_INIT 1399#define KVM_ARM_VCPU_PMU_V3_INIT 1
364#define KVM_ARM_VCPU_PMU_V3_FILTER 2400#define KVM_ARM_VCPU_PMU_V3_FILTER 2
401#define KVM_ARM_VCPU_PMU_V3_SET_PMU 3
365#define KVM_ARM_VCPU_TIMER_CTRL 1402#define KVM_ARM_VCPU_TIMER_CTRL 1
366#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0403#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
367#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1404#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
...@@ -411,6 +448,16 @@ struct kvm_arm_copy_mte_tags {...@@ -411,6 +448,16 @@ struct kvm_arm_copy_mte_tags {
411#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS448#define KVM_PSCI_RET_INVAL PSCI_RET_INVALID_PARAMS
412#define KVM_PSCI_RET_DENIED PSCI_RET_DENIED449#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
414#endif461#endif
415462
416#endif /* __ARM_KVM_H__ */463#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 {...@@ -37,5 +37,12 @@ enum perf_event_arm_regs {
37 PERF_REG_ARM64_SP,37 PERF_REG_ARM64_SP,
38 PERF_REG_ARM64_PC,38 PERF_REG_ARM64_PC,
39 PERF_REG_ARM64_MAX,39 PERF_REG_ARM64_MAX,
40
41 /* Extended/pseudo registers */
42 PERF_REG_ARM64_VG = 46, /* SVE Vector Granule */
43 PERF_REG_ARM64_EXTENDED_MAX
40};44};
45
46#define PERF_REG_EXTENDED_MASK (1ULL << PERF_REG_ARM64_VG)
47
41#endif /* _ASM_ARM64_PERF_REGS_H */48#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 {...@@ -109,7 +109,7 @@ struct user_hwdebug_state {
109 } dbg_regs[16];109 } dbg_regs[16];
110};110};
111111
112/* SVE/FP/SIMD state (NT_ARM_SVE) */112/* SVE/FP/SIMD state (NT_ARM_SVE & NT_ARM_SSVE) */
113113
114struct user_sve_header {114struct user_sve_header {
115 __u32 size; /* total meaningful regset content in bytes */115 __u32 size; /* total meaningful regset content in bytes */
...@@ -220,6 +220,7 @@ struct user_sve_header {...@@ -220,6 +220,7 @@ struct user_sve_header {
220 (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \220 (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \
221 SVE_PT_SVE_PREGS_OFFSET(vq))221 SVE_PT_SVE_PREGS_OFFSET(vq))
222222
223/* For streaming mode SVE (SSVE) FFR must be read and written as zero */
223#define SVE_PT_SVE_FFR_OFFSET(vq) \224#define SVE_PT_SVE_FFR_OFFSET(vq) \
224 (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))225 (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq))
225226
...@@ -240,10 +241,12 @@ struct user_sve_header {...@@ -240,10 +241,12 @@ struct user_sve_header {
240 - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) \241 - SVE_PT_SVE_OFFSET + (__SVE_VQ_BYTES - 1)) \
241 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)242 / __SVE_VQ_BYTES * __SVE_VQ_BYTES)
242243
243#define SVE_PT_SIZE(vq, flags) \244#define SVE_PT_SIZE(vq, flags) \
244 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \245 (((flags) & SVE_PT_REGS_MASK) == SVE_PT_REGS_SVE ? \
245 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \246 SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \
246 : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_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
248/* pointer authentication masks (NT_ARM_PAC_MASK) */251/* pointer authentication masks (NT_ARM_PAC_MASK) */
249252
...@@ -265,6 +268,62 @@ struct user_pac_generic_keys {...@@ -265,6 +268,62 @@ struct user_pac_generic_keys {
265 __uint128_t apgakey;268 __uint128_t apgakey;
266};269};
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
268#endif /* __ASSEMBLY__ */327#endif /* __ASSEMBLY__ */
269328
270#endif /* __ASM_PTRACE_H */329#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 {...@@ -62,6 +62,10 @@ struct sigcontext {
62 * context. Such structures must be placed after the rt_sigframe on the stack62 * context. Such structures must be placed after the rt_sigframe on the stack
63 * and be 16-byte aligned. The last structure must be a dummy one with the63 * and be 16-byte aligned. The last structure must be a dummy one with the
64 * magic and size set to 0.64 * 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.
65 */69 */
66struct _aarch64_ctx {70struct _aarch64_ctx {
67 __u32 magic;71 __u32 magic;
...@@ -132,11 +136,38 @@ struct extra_context {...@@ -132,11 +136,38 @@ struct extra_context {
132#define SVE_MAGIC 0x53564501136#define SVE_MAGIC 0x53564501
133137
134struct sve_context {138struct 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 {
135 struct _aarch64_ctx head;158 struct _aarch64_ctx head;
136 __u16 vl;159 __u16 vl;
137 __u16 __reserved[3];160 __u16 __reserved[3];
138};161};
139162
163#define ZT_MAGIC 0x5a544e01
164
165struct zt_context {
166 struct _aarch64_ctx head;
167 __u16 nregs;
168 __u16 __reserved[3];
169};
170
140#endif /* !__ASSEMBLY__ */171#endif /* !__ASSEMBLY__ */
141172
142#include <asm/sve_context.h>173#include <asm/sve_context.h>
...@@ -186,9 +217,16 @@ struct sve_context {...@@ -186,9 +217,16 @@ struct sve_context {
186 * sve_context.vl must equal the thread's current vector length when217 * sve_context.vl must equal the thread's current vector length when
187 * doing a sigreturn.218 * doing a sigreturn.
188 *219 *
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.
189 *227 *
190 * Note: for all these macros, the "vq" argument denotes the SVE228 * Note: for all these macros, the "vq" argument denotes the vector length
191 * vector length in quadwords (i.e., units of 128 bits).229 * in quadwords (i.e., units of 128 bits).
192 *230 *
193 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The231 * The correct way to obtain vq is to use sve_vq_from_vl(vl). The
194 * result is valid if and only if sve_vl_valid(vl) is true. This is232 * result is valid if and only if sve_vl_valid(vl) is true. This is
...@@ -249,4 +287,48 @@ struct sve_context {...@@ -249,4 +287,48 @@ struct sve_context {
249#define SVE_SIG_CONTEXT_SIZE(vq) \287#define SVE_SIG_CONTEXT_SIZE(vq) \
250 (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))288 (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
252#endif /* __ASM_SIGCONTEXT_H */334#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 @@...@@ -91,7 +91,6 @@
9191
92/* a horrid kludge trying to make sure that this will fail on old kernels */92/* a horrid kludge trying to make sure that this will fail on old kernels */
93#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)93#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
94#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
9594
96#ifndef O_NDELAY95#ifndef O_NDELAY
97#define O_NDELAY O_NONBLOCK96#define O_NDELAY O_NONBLOCK
...@@ -116,13 +115,13 @@...@@ -116,13 +115,13 @@
116#define F_GETSIG 11 /* for sockets. */115#define F_GETSIG 11 /* for sockets. */
117#endif116#endif
118117
119#ifndef CONFIG_64BIT118#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
120#ifndef F_GETLK64119#ifndef F_GETLK64
121#define F_GETLK64 12 /* using 'struct flock64' */120#define F_GETLK64 12 /* using 'struct flock64' */
122#define F_SETLK64 13121#define F_SETLK64 13
123#define F_SETLKW64 14122#define F_SETLKW64 14
124#endif123#endif
125#endif124#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
126125
127#ifndef F_SETOWN_EX126#ifndef F_SETOWN_EX
128#define F_SETOWN_EX 15127#define F_SETOWN_EX 15
...@@ -193,24 +192,19 @@ struct f_owner_ex {...@@ -193,24 +192,19 @@ struct f_owner_ex {
193#define F_LINUX_SPECIFIC_BASE 1024192#define F_LINUX_SPECIFIC_BASE 1024
194193
195#ifndef HAVE_ARCH_STRUCT_FLOCK194#ifndef HAVE_ARCH_STRUCT_FLOCK
196#ifndef __ARCH_FLOCK_PAD
197#define __ARCH_FLOCK_PAD
198#endif
199
200struct flock {195struct flock {
201 short l_type;196 short l_type;
202 short l_whence;197 short l_whence;
203 __kernel_off_t l_start;198 __kernel_off_t l_start;
204 __kernel_off_t l_len;199 __kernel_off_t l_len;
205 __kernel_pid_t l_pid;200 __kernel_pid_t l_pid;
206 __ARCH_FLOCK_PAD201#ifdef __ARCH_FLOCK_EXTRA_SYSID
207};202 __ARCH_FLOCK_EXTRA_SYSID
208#endif203#endif
209204#ifdef __ARCH_FLOCK_PAD
210#ifndef HAVE_ARCH_STRUCT_FLOCK64205 __ARCH_FLOCK_PAD
211#ifndef __ARCH_FLOCK64_PAD
212#define __ARCH_FLOCK64_PAD
213#endif206#endif
207};
214208
215struct flock64 {209struct flock64 {
216 short l_type;210 short l_type;
...@@ -218,8 +212,10 @@ struct flock64 {...@@ -218,8 +212,10 @@ struct flock64 {
218 __kernel_loff_t l_start;212 __kernel_loff_t l_start;
219 __kernel_loff_t l_len;213 __kernel_loff_t l_len;
220 __kernel_pid_t l_pid;214 __kernel_pid_t l_pid;
215#ifdef __ARCH_FLOCK64_PAD
221 __ARCH_FLOCK64_PAD216 __ARCH_FLOCK64_PAD
222};
223#endif217#endif
218};
219#endif /* HAVE_ARCH_STRUCT_FLOCK */
224220
225#endif /* _ASM_GENERIC_FCNTL_H */221#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 @@...@@ -20,18 +20,18 @@
20#define HUGETLB_FLAG_ENCODE_SHIFT 2620#define HUGETLB_FLAG_ENCODE_SHIFT 26
21#define HUGETLB_FLAG_ENCODE_MASK 0x3f21#define HUGETLB_FLAG_ENCODE_MASK 0x3f
2222
23#define HUGETLB_FLAG_ENCODE_16KB (14 << HUGETLB_FLAG_ENCODE_SHIFT)23#define HUGETLB_FLAG_ENCODE_16KB (14U << HUGETLB_FLAG_ENCODE_SHIFT)
24#define HUGETLB_FLAG_ENCODE_64KB (16 << HUGETLB_FLAG_ENCODE_SHIFT)24#define HUGETLB_FLAG_ENCODE_64KB (16U << HUGETLB_FLAG_ENCODE_SHIFT)
25#define HUGETLB_FLAG_ENCODE_512KB (19 << HUGETLB_FLAG_ENCODE_SHIFT)25#define HUGETLB_FLAG_ENCODE_512KB (19U << HUGETLB_FLAG_ENCODE_SHIFT)
26#define HUGETLB_FLAG_ENCODE_1MB (20 << HUGETLB_FLAG_ENCODE_SHIFT)26#define HUGETLB_FLAG_ENCODE_1MB (20U << HUGETLB_FLAG_ENCODE_SHIFT)
27#define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT)27#define HUGETLB_FLAG_ENCODE_2MB (21U << HUGETLB_FLAG_ENCODE_SHIFT)
28#define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT)28#define HUGETLB_FLAG_ENCODE_8MB (23U << HUGETLB_FLAG_ENCODE_SHIFT)
29#define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT)29#define HUGETLB_FLAG_ENCODE_16MB (24U << HUGETLB_FLAG_ENCODE_SHIFT)
30#define HUGETLB_FLAG_ENCODE_32MB (25 << HUGETLB_FLAG_ENCODE_SHIFT)30#define HUGETLB_FLAG_ENCODE_32MB (25U << HUGETLB_FLAG_ENCODE_SHIFT)
31#define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT)31#define HUGETLB_FLAG_ENCODE_256MB (28U << HUGETLB_FLAG_ENCODE_SHIFT)
32#define HUGETLB_FLAG_ENCODE_512MB (29 << HUGETLB_FLAG_ENCODE_SHIFT)32#define HUGETLB_FLAG_ENCODE_512MB (29U << HUGETLB_FLAG_ENCODE_SHIFT)
33#define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT)33#define HUGETLB_FLAG_ENCODE_1GB (30U << HUGETLB_FLAG_ENCODE_SHIFT)
34#define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT)34#define HUGETLB_FLAG_ENCODE_2GB (31U << HUGETLB_FLAG_ENCODE_SHIFT)
35#define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT)35#define HUGETLB_FLAG_ENCODE_16GB (34U << HUGETLB_FLAG_ENCODE_SHIFT)
3636
37#endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */37#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 @@...@@ -75,6 +75,10 @@
75#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */75#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
76#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */76#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
78/* compatibility flags */82/* compatibility flags */
79#define MAP_FILE 083#define MAP_FILE 0
8084
lib/libc/include/any-linux-any/asm-generic/shmbuf.h+3-1
...@@ -3,6 +3,8 @@...@@ -3,6 +3,8 @@
3#define __ASM_GENERIC_SHMBUF_H3#define __ASM_GENERIC_SHMBUF_H
44
5#include <asm/bitsperlong.h>5#include <asm/bitsperlong.h>
6#include <asm/ipcbuf.h>
7#include <asm/posix_types.h>
68
7/*9/*
8 * The shmid64_ds structure for x86 architecture.10 * The shmid64_ds structure for x86 architecture.
...@@ -24,7 +26,7 @@...@@ -24,7 +26,7 @@
2426
25struct shmid64_ds {27struct shmid64_ds {
26 struct ipc64_perm shm_perm; /* operation perms */28 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) */
28#if __BITS_PER_LONG == 6430#if __BITS_PER_LONG == 64
29 long shm_atime; /* last attach time */31 long shm_atime; /* last attach time */
30 long shm_dtime; /* last detach time */32 long shm_dtime; /* last detach time */
lib/libc/include/any-linux-any/asm-generic/siginfo.h+7
...@@ -99,6 +99,7 @@ union __sifields {...@@ -99,6 +99,7 @@ union __sifields {
99 struct {99 struct {
100 unsigned long _data;100 unsigned long _data;
101 __u32 _type;101 __u32 _type;
102 __u32 _flags;
102 } _perf;103 } _perf;
103 };104 };
104 } _sigfault;105 } _sigfault;
...@@ -164,6 +165,7 @@ typedef struct siginfo {...@@ -164,6 +165,7 @@ typedef struct siginfo {
164#define si_pkey _sifields._sigfault._addr_pkey._pkey165#define si_pkey _sifields._sigfault._addr_pkey._pkey
165#define si_perf_data _sifields._sigfault._perf._data166#define si_perf_data _sifields._sigfault._perf._data
166#define si_perf_type _sifields._sigfault._perf._type167#define si_perf_type _sifields._sigfault._perf._type
168#define si_perf_flags _sifields._sigfault._perf._flags
167#define si_band _sifields._sigpoll._band169#define si_band _sifields._sigpoll._band
168#define si_fd _sifields._sigpoll._fd170#define si_fd _sifields._sigpoll._fd
169#define si_call_addr _sifields._sigsys._call_addr171#define si_call_addr _sifields._sigsys._call_addr
...@@ -270,6 +272,11 @@ typedef struct siginfo {...@@ -270,6 +272,11 @@ typedef struct siginfo {
270 * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)272 * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
271 */273 */
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
273/*280/*
274 * SIGCHLD si_codes281 * SIGCHLD si_codes
275 */282 */
lib/libc/include/any-linux-any/asm-generic/signal.h+1-1
...@@ -83,7 +83,7 @@ struct sigaction {...@@ -83,7 +83,7 @@ struct sigaction {
83typedef struct sigaltstack {83typedef struct sigaltstack {
84 void *ss_sp;84 void *ss_sp;
85 int ss_flags;85 int ss_flags;
86 size_t ss_size;86 __kernel_size_t ss_size;
87} stack_t;87} stack_t;
8888
89#endif /* __ASSEMBLY__ */89#endif /* __ASSEMBLY__ */
lib/libc/include/any-linux-any/asm-generic/socket.h+4
...@@ -128,6 +128,10 @@...@@ -128,6 +128,10 @@
128128
129#define SO_RESERVE_MEM 73129#define SO_RESERVE_MEM 73
130130
131#define SO_TXREHASH 74
132
133#define SO_RCVMARK 75
134
131135
132#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))136#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
133/* on 64-bit and x32, avoid the ?: operator */137/* 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 @@...@@ -2,10 +2,8 @@
2#ifndef __ASM_GENERIC_TERMBITS_H2#ifndef __ASM_GENERIC_TERMBITS_H
3#define __ASM_GENERIC_TERMBITS_H3#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;
9typedef unsigned int tcflag_t;7typedef unsigned int tcflag_t;
108
11#define NCCS 199#define NCCS 19
...@@ -41,156 +39,107 @@ struct ktermios {...@@ -41,156 +39,107 @@ struct ktermios {
41};39};
4240
43/* c_cc characters */41/* c_cc characters */
44#define VINTR 042#define VINTR 0
45#define VQUIT 143#define VQUIT 1
46#define VERASE 244#define VERASE 2
47#define VKILL 345#define VKILL 3
48#define VEOF 446#define VEOF 4
49#define VTIME 547#define VTIME 5
50#define VMIN 648#define VMIN 6
51#define VSWTC 749#define VSWTC 7
52#define VSTART 850#define VSTART 8
53#define VSTOP 951#define VSTOP 9
54#define VSUSP 1052#define VSUSP 10
55#define VEOL 1153#define VEOL 11
56#define VREPRINT 1254#define VREPRINT 12
57#define VDISCARD 1355#define VDISCARD 13
58#define VWERASE 1456#define VWERASE 14
59#define VLNEXT 1557#define VLNEXT 15
60#define VEOL2 1658#define VEOL2 16
6159
62/* c_iflag bits */60/* c_iflag bits */
63#define IGNBRK 000000161#define IUCLC 0x0200
64#define BRKINT 000000262#define IXON 0x0400
65#define IGNPAR 000000463#define IXOFF 0x1000
66#define PARMRK 000001064#define IMAXBEL 0x2000
67#define INPCK 000002065#define IUTF8 0x4000
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
7866
79/* c_oflag bits */67/* c_oflag bits */
80#define OPOST 000000168#define OLCUC 0x00002
81#define OLCUC 000000269#define ONLCR 0x00004
82#define ONLCR 000000470#define NLDLY 0x00100
83#define OCRNL 000001071#define NL0 0x00000
84#define ONOCR 000002072#define NL1 0x00100
85#define ONLRET 000004073#define CRDLY 0x00600
86#define OFILL 000010074#define CR0 0x00000
87#define OFDEL 000020075#define CR1 0x00200
88#define NLDLY 000040076#define CR2 0x00400
89#define NL0 000000077#define CR3 0x00600
90#define NL1 000040078#define TABDLY 0x01800
91#define CRDLY 000300079#define TAB0 0x00000
92#define CR0 000000080#define TAB1 0x00800
93#define CR1 000100081#define TAB2 0x01000
94#define CR2 000200082#define TAB3 0x01800
95#define CR3 000300083#define XTABS 0x01800
96#define TABDLY 001400084#define BSDLY 0x02000
97#define TAB0 000000085#define BS0 0x00000
98#define TAB1 000400086#define BS1 0x02000
99#define TAB2 001000087#define VTDLY 0x04000
100#define TAB3 001400088#define VT0 0x00000
101#define XTABS 001400089#define VT1 0x04000
102#define BSDLY 002000090#define FFDLY 0x08000
103#define BS0 000000091#define FF0 0x00000
104#define BS1 002000092#define FF1 0x08000
105#define VTDLY 0040000
106#define VT0 0000000
107#define VT1 0040000
108#define FFDLY 0100000
109#define FF0 0000000
110#define FF1 0100000
11193
112/* c_cflag bit meaning */94/* c_cflag bit meaning */
113#define CBAUD 001001795#define CBAUD 0x0000100f
114#define B0 0000000 /* hang up */96#define CSIZE 0x00000030
115#define B50 000000197#define CS5 0x00000000
116#define B75 000000298#define CS6 0x00000010
117#define B110 000000399#define CS7 0x00000020
118#define B134 0000004100#define CS8 0x00000030
119#define B150 0000005101#define CSTOPB 0x00000040
120#define B200 0000006102#define CREAD 0x00000080
121#define B300 0000007103#define PARENB 0x00000100
122#define B600 0000010104#define PARODD 0x00000200
123#define B1200 0000011105#define HUPCL 0x00000400
124#define B1800 0000012106#define CLOCAL 0x00000800
125#define B2400 0000013107#define CBAUDEX 0x00001000
126#define B4800 0000014108#define BOTHER 0x00001000
127#define B9600 0000015109#define B57600 0x00001001
128#define B19200 0000016110#define B115200 0x00001002
129#define B38400 0000017111#define B230400 0x00001003
130#define EXTA B19200112#define B460800 0x00001004
131#define EXTB B38400113#define B500000 0x00001005
132#define CSIZE 0000060114#define B576000 0x00001006
133#define CS5 0000000115#define B921600 0x00001007
134#define CS6 0000020116#define B1000000 0x00001008
135#define CS7 0000040117#define B1152000 0x00001009
136#define CS8 0000060118#define B1500000 0x0000100a
137#define CSTOPB 0000100119#define B2000000 0x0000100b
138#define CREAD 0000200120#define B2500000 0x0000100c
139#define PARENB 0000400121#define B3000000 0x0000100d
140#define PARODD 0001000122#define B3500000 0x0000100e
141#define HUPCL 0002000123#define B4000000 0x0000100f
142#define CLOCAL 0004000124#define CIBAUD 0x100f0000 /* input baud rate */
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 */
165125
166/* c_lflag bits */126/* c_lflag bits */
167#define ISIG 0000001127#define ISIG 0x00001
168#define ICANON 0000002128#define ICANON 0x00002
169#define XCASE 0000004129#define XCASE 0x00004
170#define ECHO 0000010130#define ECHO 0x00008
171#define ECHOE 0000020131#define ECHOE 0x00010
172#define ECHOK 0000040132#define ECHOK 0x00020
173#define ECHONL 0000100133#define ECHONL 0x00040
174#define NOFLSH 0000200134#define NOFLSH 0x00080
175#define TOSTOP 0000400135#define TOSTOP 0x00100
176#define ECHOCTL 0001000136#define ECHOCTL 0x00200
177#define ECHOPRT 0002000137#define ECHOPRT 0x00400
178#define ECHOKE 0004000138#define ECHOKE 0x00800
179#define FLUSHO 0010000139#define FLUSHO 0x01000
180#define PENDIN 0040000140#define PENDIN 0x04000
181#define IEXTEN 0100000141#define IEXTEN 0x08000
182#define EXTPROC 0200000142#define EXTPROC 0x10000
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
194143
195/* tcsetattr uses these */144/* tcsetattr uses these */
196#define TCSANOW 0145#define TCSANOW 0
lib/libc/include/any-linux-any/asm-generic/unistd.h+6-3
...@@ -383,7 +383,7 @@ __SYSCALL(__NR_syslog, sys_syslog)...@@ -383,7 +383,7 @@ __SYSCALL(__NR_syslog, sys_syslog)
383383
384/* kernel/ptrace.c */384/* kernel/ptrace.c */
385#define __NR_ptrace 117385#define __NR_ptrace 117
386__SYSCALL(__NR_ptrace, sys_ptrace)386__SC_COMP(__NR_ptrace, sys_ptrace, compat_sys_ptrace)
387387
388/* kernel/sched/core.c */388/* kernel/sched/core.c */
389#define __NR_sched_setparam 118389#define __NR_sched_setparam 118
...@@ -779,7 +779,7 @@ __SYSCALL(__NR_rseq, sys_rseq)...@@ -779,7 +779,7 @@ __SYSCALL(__NR_rseq, sys_rseq)
779#define __NR_kexec_file_load 294779#define __NR_kexec_file_load 294
780__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)780__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
781/* 295 through 402 are unassigned to sync up with generic numbers, don't use */781/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
782#if __BITS_PER_LONG == 32782#if defined(__SYSCALL_COMPAT) || __BITS_PER_LONG == 32
783#define __NR_clock_gettime64 403783#define __NR_clock_gettime64 403
784__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)784__SYSCALL(__NR_clock_gettime64, sys_clock_gettime)
785#define __NR_clock_settime64 404785#define __NR_clock_settime64 404
...@@ -883,8 +883,11 @@ __SYSCALL(__NR_process_mrelease, sys_process_mrelease)...@@ -883,8 +883,11 @@ __SYSCALL(__NR_process_mrelease, sys_process_mrelease)
883#define __NR_futex_waitv 449883#define __NR_futex_waitv 449
884__SYSCALL(__NR_futex_waitv, sys_futex_waitv)884__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
886#undef __NR_syscalls889#undef __NR_syscalls
887#define __NR_syscalls 450890#define __NR_syscalls 451
888891
889/*892/*
890 * 32 bit systems traditionally used different893 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+82-5
...@@ -80,7 +80,7 @@ extern "C" {...@@ -80,7 +80,7 @@ extern "C" {
80 *80 *
81 * %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the81 * %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the
82 * GPU's virtual address space via gart. Gart memory linearizes non-contiguous82 * GPU's virtual address space via gart. Gart memory linearizes non-contiguous
83 * pages of system memory, allows GPU access system memory in a linezrized83 * pages of system memory, allows GPU access system memory in a linearized
84 * fashion.84 * fashion.
85 *85 *
86 * %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory86 * %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory
...@@ -140,6 +140,24 @@ extern "C" {...@@ -140,6 +140,24 @@ extern "C" {
140 * not require GTT memory accounting140 * not require GTT memory accounting
141 */141 */
142#define AMDGPU_GEM_CREATE_PREEMPTIBLE (1 << 11)142#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
144struct drm_amdgpu_gem_create_in {162struct drm_amdgpu_gem_create_in {
145 /** the requested memory size */163 /** the requested memory size */
...@@ -206,6 +224,8 @@ union drm_amdgpu_bo_list {...@@ -206,6 +224,8 @@ union drm_amdgpu_bo_list {
206#define AMDGPU_CTX_OP_FREE_CTX 2224#define AMDGPU_CTX_OP_FREE_CTX 2
207#define AMDGPU_CTX_OP_QUERY_STATE 3225#define AMDGPU_CTX_OP_QUERY_STATE 3
208#define AMDGPU_CTX_OP_QUERY_STATE2 4226#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
210/* GPU reset status */230/* GPU reset status */
211#define AMDGPU_CTX_NO_RESET 0231#define AMDGPU_CTX_NO_RESET 0
...@@ -238,10 +258,18 @@ union drm_amdgpu_bo_list {...@@ -238,10 +258,18 @@ union drm_amdgpu_bo_list {
238#define AMDGPU_CTX_PRIORITY_HIGH 512258#define AMDGPU_CTX_PRIORITY_HIGH 512
239#define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023259#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
241struct drm_amdgpu_ctx_in {269struct drm_amdgpu_ctx_in {
242 /** AMDGPU_CTX_OP_* */270 /** AMDGPU_CTX_OP_* */
243 __u32 op;271 __u32 op;
244 /** For future use, no flags defined so far */272 /** Flags */
245 __u32 flags;273 __u32 flags;
246 __u32 ctx_id;274 __u32 ctx_id;
247 /** AMDGPU_CTX_PRIORITY_* */275 /** AMDGPU_CTX_PRIORITY_* */
...@@ -262,6 +290,11 @@ union drm_amdgpu_ctx_out {...@@ -262,6 +290,11 @@ union drm_amdgpu_ctx_out {
262 /** Reset status since the last call of the ioctl. */290 /** Reset status since the last call of the ioctl. */
263 __u32 reset_status;291 __u32 reset_status;
264 } state;292 } state;
293
294 struct {
295 __u32 flags;
296 __u32 _pad;
297 } pstate;
265};298};
266299
267union drm_amdgpu_ctx {300union drm_amdgpu_ctx {
...@@ -514,6 +547,8 @@ struct drm_amdgpu_gem_op {...@@ -514,6 +547,8 @@ struct drm_amdgpu_gem_op {
514#define AMDGPU_VM_MTYPE_UC (4 << 5)547#define AMDGPU_VM_MTYPE_UC (4 << 5)
515/* Use Read Write MTYPE instead of default MTYPE */548/* Use Read Write MTYPE instead of default MTYPE */
516#define AMDGPU_VM_MTYPE_RW (5 << 5)549#define AMDGPU_VM_MTYPE_RW (5 << 5)
550/* don't allocate MALL */
551#define AMDGPU_VM_PAGE_NOALLOC (1 << 9)
517552
518struct drm_amdgpu_gem_va {553struct drm_amdgpu_gem_va {
519 /** GEM object handle */554 /** GEM object handle */
...@@ -538,6 +573,10 @@ struct drm_amdgpu_gem_va {...@@ -538,6 +573,10 @@ struct drm_amdgpu_gem_va {
538#define AMDGPU_HW_IP_VCE 4573#define AMDGPU_HW_IP_VCE 4
539#define AMDGPU_HW_IP_UVD_ENC 5574#define AMDGPU_HW_IP_UVD_ENC 5
540#define AMDGPU_HW_IP_VCN_DEC 6575#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 */
541#define AMDGPU_HW_IP_VCN_ENC 7580#define AMDGPU_HW_IP_VCN_ENC 7
542#define AMDGPU_HW_IP_VCN_JPEG 8581#define AMDGPU_HW_IP_VCN_JPEG 8
543#define AMDGPU_HW_IP_NUM 9582#define AMDGPU_HW_IP_NUM 9
...@@ -676,6 +715,7 @@ struct drm_amdgpu_cs_chunk_data {...@@ -676,6 +715,7 @@ struct drm_amdgpu_cs_chunk_data {
676#define AMDGPU_IDS_FLAGS_FUSION 0x1715#define AMDGPU_IDS_FLAGS_FUSION 0x1
677#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2716#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
678#define AMDGPU_IDS_FLAGS_TMZ 0x4717#define AMDGPU_IDS_FLAGS_TMZ 0x4
718#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
679719
680/* indicate if acceleration can be working */720/* indicate if acceleration can be working */
681#define AMDGPU_INFO_ACCEL_WORKING 0x00721#define AMDGPU_INFO_ACCEL_WORKING 0x00
...@@ -728,6 +768,18 @@ struct drm_amdgpu_cs_chunk_data {...@@ -728,6 +768,18 @@ struct drm_amdgpu_cs_chunk_data {
728 #define AMDGPU_INFO_FW_DMCUB 0x14768 #define AMDGPU_INFO_FW_DMCUB 0x14
729 /* Subquery id: Query TOC firmware version */769 /* Subquery id: Query TOC firmware version */
730 #define AMDGPU_INFO_FW_TOC 0x15770 #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
732/* number of bytes moved for TTM migration */784/* number of bytes moved for TTM migration */
733#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f785#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
...@@ -781,6 +833,10 @@ struct drm_amdgpu_cs_chunk_data {...@@ -781,6 +833,10 @@ struct drm_amdgpu_cs_chunk_data {
781 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8833 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
782 /* Subquery id: Query GPU stable pstate memory clock */834 /* Subquery id: Query GPU stable pstate memory clock */
783 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9835 #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
784/* Number of VRAM page faults on CPU access. */840/* Number of VRAM page faults on CPU access. */
785#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E841#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
786#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F842#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
...@@ -971,6 +1027,8 @@ struct drm_amdgpu_info_vbios {...@@ -971,6 +1027,8 @@ struct drm_amdgpu_info_vbios {
971#define AMDGPU_VRAM_TYPE_DDR4 81027#define AMDGPU_VRAM_TYPE_DDR4 8
972#define AMDGPU_VRAM_TYPE_GDDR6 91028#define AMDGPU_VRAM_TYPE_GDDR6 9
973#define AMDGPU_VRAM_TYPE_DDR5 101029#define AMDGPU_VRAM_TYPE_DDR5 10
1030#define AMDGPU_VRAM_TYPE_LPDDR4 11
1031#define AMDGPU_VRAM_TYPE_LPDDR5 12
9741032
975struct drm_amdgpu_info_device {1033struct drm_amdgpu_info_device {
976 /** PCI Device ID */1034 /** PCI Device ID */
...@@ -996,7 +1054,8 @@ struct drm_amdgpu_info_device {...@@ -996,7 +1054,8 @@ struct drm_amdgpu_info_device {
996 __u32 enabled_rb_pipes_mask;1054 __u32 enabled_rb_pipes_mask;
997 __u32 num_rb_pipes;1055 __u32 num_rb_pipes;
998 __u32 num_hw_gfx_contexts;1056 __u32 num_hw_gfx_contexts;
999 __u32 _pad;1057 /* PCIe version (the smaller of the GPU and the CPU/motherboard) */
1058 __u32 pcie_gen;
1000 __u64 ids_flags;1059 __u64 ids_flags;
1001 /** Starting virtual address for UMDs. */1060 /** Starting virtual address for UMDs. */
1002 __u64 virtual_address_offset;1061 __u64 virtual_address_offset;
...@@ -1043,7 +1102,8 @@ struct drm_amdgpu_info_device {...@@ -1043,7 +1102,8 @@ struct drm_amdgpu_info_device {
1043 __u32 gs_prim_buffer_depth;1102 __u32 gs_prim_buffer_depth;
1044 /* max gs wavefront per vgt*/1103 /* max gs wavefront per vgt*/
1045 __u32 max_gs_waves_per_vgt;1104 __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;
1047 /* always on cu bitmap */1107 /* always on cu bitmap */
1048 __u32 cu_ao_bitmap[4][4];1108 __u32 cu_ao_bitmap[4][4];
1049 /** Starting high virtual address for UMDs. */1109 /** Starting high virtual address for UMDs. */
...@@ -1054,6 +1114,18 @@ struct drm_amdgpu_info_device {...@@ -1054,6 +1114,18 @@ struct drm_amdgpu_info_device {
1054 __u32 pa_sc_tile_steering_override;1114 __u32 pa_sc_tile_steering_override;
1055 /* disabled TCCs */1115 /* disabled TCCs */
1056 __u64 tcc_disabled_mask;1116 __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;
1057};1129};
10581130
1059struct drm_amdgpu_info_hw_ip {1131struct drm_amdgpu_info_hw_ip {
...@@ -1068,7 +1140,8 @@ struct drm_amdgpu_info_hw_ip {...@@ -1068,7 +1140,8 @@ struct drm_amdgpu_info_hw_ip {
1068 __u32 ib_size_alignment;1140 __u32 ib_size_alignment;
1069 /** Bitmask of available rings. Bit 0 means ring 0, etc. */1141 /** Bitmask of available rings. Bit 0 means ring 0, etc. */
1070 __u32 available_rings;1142 __u32 available_rings;
1071 __u32 _pad;1143 /** version info: bits 23:16 major, 15:8 minor, 7:0 revision */
1144 __u32 ip_discovery_version;
1072};1145};
10731146
1074struct drm_amdgpu_info_num_handles {1147struct drm_amdgpu_info_num_handles {
...@@ -1133,7 +1206,11 @@ struct drm_amdgpu_info_video_caps {...@@ -1133,7 +1206,11 @@ struct drm_amdgpu_info_video_caps {
1133#define AMDGPU_FAMILY_RV 142 /* Raven */1206#define AMDGPU_FAMILY_RV 142 /* Raven */
1134#define AMDGPU_FAMILY_NV 143 /* Navi10 */1207#define AMDGPU_FAMILY_NV 143 /* Navi10 */
1135#define AMDGPU_FAMILY_VGH 144 /* Van Gogh */1208#define AMDGPU_FAMILY_VGH 144 /* Van Gogh */
1209#define AMDGPU_FAMILY_GC_11_0_0 145 /* GC 11.0.0 */
1136#define AMDGPU_FAMILY_YC 146 /* Yellow Carp */1210#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
1138#if defined(__cplusplus)1215#if defined(__cplusplus)
1139}1216}
lib/libc/include/any-linux-any/drm/drm.h+18
...@@ -1090,6 +1090,24 @@ extern "C" {...@@ -1090,6 +1090,24 @@ extern "C" {
1090#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)1090#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
1091#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)1091#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 */
1093#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)1111#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
10941112
1095/*1113/*
lib/libc/include/any-linux-any/drm/drm_fourcc.h+156-7
...@@ -88,6 +88,18 @@ extern "C" {...@@ -88,6 +88,18 @@ extern "C" {
88 *88 *
89 * The authoritative list of format modifier codes is found in89 * The authoritative list of format modifier codes is found in
90 * `include/uapi/drm/drm_fourcc.h`90 * `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.
91 */103 */
92104
93#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \105#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
...@@ -99,18 +111,42 @@ extern "C" {...@@ -99,18 +111,42 @@ extern "C" {
99#define DRM_FORMAT_INVALID 0111#define DRM_FORMAT_INVALID 0
100112
101/* color index */113/* 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 */
102#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */117#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) */
105#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */141#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) */
108#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */144#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) */
111#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */147#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) */
114#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */150#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
115151
116/* 16 bpp RG */152/* 16 bpp RG */
...@@ -205,7 +241,9 @@ extern "C" {...@@ -205,7 +241,9 @@ extern "C" {
205#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */241#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
206242
207#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */243#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 */
208#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */245#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 */
209#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */247#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
210#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */248#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" {...@@ -314,6 +352,13 @@ extern "C" {
314 */352 */
315#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */353#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
317/* 3 plane non-subsampled (444) YCbCr362/* 3 plane non-subsampled (444) YCbCr
318 * 16 bits per component, but only 10 bits are used and 6 bits are padded363 * 16 bits per component, but only 10 bits are used and 6 bits are padded
319 * index 0: Y plane, [15:0] Y:x [10:6] little endian364 * index 0: Y plane, [15:0] Y:x [10:6] little endian
...@@ -552,7 +597,7 @@ extern "C" {...@@ -552,7 +597,7 @@ extern "C" {
552 *597 *
553 * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear598 * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
554 * and at index 1. The clear color is stored at index 2, and the pitch should599 * 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 bits600 * be 64 bytes aligned. The clear color structure is 256 bits. The first 128 bits
556 * represents Raw Clear Color Red, Green, Blue and Alpha color each represented601 * represents Raw Clear Color Red, Green, Blue and Alpha color each represented
557 * by 32 bits. The raw clear color is consumed by the 3d engine and generates602 * by 32 bits. The raw clear color is consumed by the 3d engine and generates
558 * the converted clear color of size 64 bits. The first 32 bits store the Lower603 * the converted clear color of size 64 bits. The first 32 bits store the Lower
...@@ -565,6 +610,53 @@ extern "C" {...@@ -565,6 +610,53 @@ extern "C" {
565 */610 */
566#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)611#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
568/*660/*
569 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks661 * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
570 *662 *
...@@ -602,6 +694,28 @@ extern "C" {...@@ -602,6 +694,28 @@ extern "C" {
602 */694 */
603#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)695#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
605/* Vivante framebuffer modifiers */719/* Vivante framebuffer modifiers */
606720
607/*721/*
...@@ -642,6 +756,35 @@ extern "C" {...@@ -642,6 +756,35 @@ extern "C" {
642 */756 */
643#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)757#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
645/* NVIDIA frame buffer modifiers */788/* NVIDIA frame buffer modifiers */
646789
647/*790/*
...@@ -854,6 +997,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)...@@ -854,6 +997,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
854 * and UV. Some SAND-using hardware stores UV in a separate tiled997 * and UV. Some SAND-using hardware stores UV in a separate tiled
855 * image from Y to reduce the column height, which is not supported998 * image from Y to reduce the column height, which is not supported
856 * with these modifiers.999 * 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.
857 */1004 */
8581005
859#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \1006#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \
...@@ -1283,6 +1430,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)...@@ -1283,6 +1430,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
1283#define AMD_FMT_MOD_TILE_VER_GFX9 11430#define AMD_FMT_MOD_TILE_VER_GFX9 1
1284#define AMD_FMT_MOD_TILE_VER_GFX10 21431#define AMD_FMT_MOD_TILE_VER_GFX10 2
1285#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 31432#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
1433#define AMD_FMT_MOD_TILE_VER_GFX11 4
12861434
1287/*1435/*
1288 * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical1436 * 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)...@@ -1298,6 +1446,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
1298#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 251446#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
1299#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 261447#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
1300#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 271448#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
1449#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31
13011450
1302#define AMD_FMT_MOD_DCC_BLOCK_64B 01451#define AMD_FMT_MOD_DCC_BLOCK_64B 0
1303#define AMD_FMT_MOD_DCC_BLOCK_128B 11452#define AMD_FMT_MOD_DCC_BLOCK_128B 1
...@@ -1364,11 +1513,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)...@@ -1364,11 +1513,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
1364#define AMD_FMT_MOD_PIPE_MASK 0x71513#define AMD_FMT_MOD_PIPE_MASK 0x7
13651514
1366#define AMD_FMT_MOD_SET(field, value) \1515#define AMD_FMT_MOD_SET(field, value) \
1367 ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)1516 ((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT)
1368#define AMD_FMT_MOD_GET(field, value) \1517#define AMD_FMT_MOD_GET(field, value) \
1369 (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)1518 (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
1370#define AMD_FMT_MOD_CLEAR(field) \1519#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
1373#if defined(__cplusplus)1522#if defined(__cplusplus)
1374}1523}
lib/libc/include/any-linux-any/drm/drm_mode.h+122-29
...@@ -663,41 +663,73 @@ struct drm_mode_fb_cmd {...@@ -663,41 +663,73 @@ struct drm_mode_fb_cmd {
663#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */663#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
664#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */664#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 */
666struct drm_mode_fb_cmd2 {700struct drm_mode_fb_cmd2 {
701 /** @fb_id: Object ID of the frame-buffer. */
667 __u32 fb_id;702 __u32 fb_id;
703 /** @width: Width of the frame-buffer. */
668 __u32 width;704 __u32 width;
705 /** @height: Height of the frame-buffer. */
669 __u32 height;706 __u32 height;
670 __u32 pixel_format; /* fourcc code from drm_fourcc.h */707 /**
671 __u32 flags; /* see above flags */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 /*718 /**
674 * In case of planar formats, this ioctl allows up to 4719 * @handles: GEM buffer handle, one per plane. Set to 0 if the plane is
675 * buffer objects with offsets and pitches per plane.720 * unused. The same handle can be used for multiple planes.
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.
696 */721 */
697 __u32 handles[4];722 __u32 handles[4];
698 __u32 pitches[4]; /* pitch for each plane */723 /** @pitches: Pitch (aka. stride) in bytes, one per plane. */
699 __u32 offsets[4]; /* offset of each plane */724 __u32 pitches[4];
700 __u64 modifier[4]; /* ie, tiling, compress */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];
701};733};
702734
703#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01735#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
...@@ -903,12 +935,31 @@ struct hdr_output_metadata {...@@ -903,12 +935,31 @@ struct hdr_output_metadata {
903 };935 };
904};936};
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 */
906#define DRM_MODE_PAGE_FLIP_EVENT 0x01945#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 */
907#define DRM_MODE_PAGE_FLIP_ASYNC 0x02953#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
908#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4954#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
909#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8955#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
910#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \956#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
911 DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)957 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 */
912#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \963#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
913 DRM_MODE_PAGE_FLIP_ASYNC | \964 DRM_MODE_PAGE_FLIP_ASYNC | \
914 DRM_MODE_PAGE_FLIP_TARGET)965 DRM_MODE_PAGE_FLIP_TARGET)
...@@ -1002,11 +1053,53 @@ struct drm_mode_destroy_dumb {...@@ -1002,11 +1053,53 @@ struct drm_mode_destroy_dumb {
1002 __u32 handle;1053 __u32 handle;
1003};1054};
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 */
1006#define DRM_MODE_ATOMIC_TEST_ONLY 0x01001065#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 */
1007#define DRM_MODE_ATOMIC_NONBLOCK 0x02001074#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 */
1008#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x04001095#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 */
1010#define DRM_MODE_ATOMIC_FLAGS (\1103#define DRM_MODE_ATOMIC_FLAGS (\
1011 DRM_MODE_PAGE_FLIP_EVENT |\1104 DRM_MODE_PAGE_FLIP_EVENT |\
1012 DRM_MODE_PAGE_FLIP_ASYNC |\1105 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 {...@@ -154,25 +154,77 @@ enum i915_mocs_table_index {
154 I915_MOCS_CACHED,154 I915_MOCS_CACHED,
155};155};
156156
157/*157/**
158 * enum drm_i915_gem_engine_class - uapi engine type enumeration
159 *
158 * Different engines serve different roles, and there may be more than one160 * Different engines serve different roles, and there may be more than one
159 * engine serving each role. enum drm_i915_gem_engine_class provides a161 * engine serving each role. This enum provides a classification of the role
160 * classification of the role of the engine, which may be used when requesting162 * of the engine, which may be used when requesting operations to be performed
161 * operations to be performed on a certain subset of engines, or for providing163 * on a certain subset of engines, or for providing information about that
162 * information about that group.164 * group.
163 */165 */
164enum drm_i915_gem_engine_class {166enum 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 */
165 I915_ENGINE_CLASS_RENDER = 0,176 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 */
166 I915_ENGINE_CLASS_COPY = 1,187 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 */
167 I915_ENGINE_CLASS_VIDEO = 2,196 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 */
168 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,204 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 */
172 I915_ENGINE_CLASS_INVALID = -1222 I915_ENGINE_CLASS_INVALID = -1
173};223};
174224
175/*225/**
226 * struct i915_engine_class_instance - Engine class/instance identifier
227 *
176 * There may be more than one engine fulfilling any role within the system.228 * There may be more than one engine fulfilling any role within the system.
177 * Each engine of a class is given a unique instance number and therefore229 * Each engine of a class is given a unique instance number and therefore
178 * any engine can be specified by its class:instance tuplet. APIs that allow230 * any engine can be specified by its class:instance tuplet. APIs that allow
...@@ -180,10 +232,21 @@ enum drm_i915_gem_engine_class {...@@ -180,10 +232,21 @@ enum drm_i915_gem_engine_class {
180 * for this identification.232 * for this identification.
181 */233 */
182struct i915_engine_class_instance {234struct i915_engine_class_instance {
183 __u16 engine_class; /* see enum drm_i915_gem_engine_class */235 /**
184 __u16 engine_instance;236 * @engine_class:
237 *
238 * Engine class from enum drm_i915_gem_engine_class
239 */
240 __u16 engine_class;
185#define I915_ENGINE_CLASS_INVALID_NONE -1241#define I915_ENGINE_CLASS_INVALID_NONE -1
186#define I915_ENGINE_CLASS_INVALID_VIRTUAL -2242#define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
243
244 /**
245 * @engine_instance:
246 *
247 * Engine instance.
248 */
249 __u16 engine_instance;
187};250};
188251
189/**252/**
...@@ -582,6 +645,22 @@ typedef struct drm_i915_irq_wait {...@@ -582,6 +645,22 @@ typedef struct drm_i915_irq_wait {
582 */645 */
583#define I915_SCHEDULER_CAP_STATIC_PRIORITY_MAP (1ul << 5)646#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 */
585#define I915_PARAM_HUC_STATUS 42664#define I915_PARAM_HUC_STATUS 42
586665
587/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of666/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to opt-out of
...@@ -686,16 +765,35 @@ typedef struct drm_i915_irq_wait {...@@ -686,16 +765,35 @@ typedef struct drm_i915_irq_wait {
686/* Query if the kernel supports the I915_USERPTR_PROBE flag. */765/* Query if the kernel supports the I915_USERPTR_PROBE flag. */
687#define I915_PARAM_HAS_USERPTR_PROBE 56766#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
689/* Must be kept compact -- no holes and well documented */774/* 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. */
692 __s32 param;781 __s32 param;
693 /*782
783 /**
784 * @value: Address of memory where queried value should be put.
785 *
694 * WARNING: Using pointers instead of fixed-size u64 means we need to write786 * WARNING: Using pointers instead of fixed-size u64 means we need to write
695 * compat32 code. Don't repeat this mistake.787 * compat32 code. Don't repeat this mistake.
696 */788 */
697 int *value;789 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
700/* Ioctl to set kernel params:798/* Ioctl to set kernel params:
701 */799 */
...@@ -1118,10 +1216,16 @@ struct drm_i915_gem_exec_object2 {...@@ -1118,10 +1216,16 @@ struct drm_i915_gem_exec_object2 {
1118 /**1216 /**
1119 * When the EXEC_OBJECT_PINNED flag is specified this is populated by1217 * When the EXEC_OBJECT_PINNED flag is specified this is populated by
1120 * the user with the GTT offset at which this object will be pinned.1218 * the user with the GTT offset at which this object will be pinned.
1219 *
1121 * When the I915_EXEC_NO_RELOC flag is specified this must contain the1220 * When the I915_EXEC_NO_RELOC flag is specified this must contain the
1122 * presumed_offset of the object.1221 * presumed_offset of the object.
1222 *
1123 * During execbuffer2 the kernel populates it with the value of the1223 * During execbuffer2 the kernel populates it with the value of the
1124 * current GTT offset of the object, for future presumed_offset writes.1224 * 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.
1125 */1229 */
1126 __u64 offset;1230 __u64 offset;
11271231
...@@ -1170,76 +1274,119 @@ struct drm_i915_gem_exec_object2 {...@@ -1170,76 +1274,119 @@ struct drm_i915_gem_exec_object2 {
1170 __u64 rsvd2;1274 __u64 rsvd2;
1171};1275};
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 */
1173struct drm_i915_gem_exec_fence {1286struct drm_i915_gem_exec_fence {
1174 /**1287 /** @handle: User's handle for a drm_syncobj to wait on or signal. */
1175 * User's handle for a drm_syncobj to wait on or signal.
1176 */
1177 __u32 handle;1288 __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;
1179#define I915_EXEC_FENCE_WAIT (1<<0)1300#define I915_EXEC_FENCE_WAIT (1<<0)
1180#define I915_EXEC_FENCE_SIGNAL (1<<1)1301#define I915_EXEC_FENCE_SIGNAL (1<<1)
1181#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))1302#define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1))
1182 __u32 flags;
1183};1303};
11841304
1185/*1305/**
1186 * See drm_i915_gem_execbuffer_ext_timeline_fences.1306 * struct drm_i915_gem_execbuffer_ext_timeline_fences - Timeline fences
1187 */1307 * for execbuf ioctl.
1188#define DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES 01308 *
1189
1190/*
1191 * This structure describes an array of drm_syncobj and associated points for1309 * This structure describes an array of drm_syncobj and associated points for
1192 * timeline variants of drm_syncobj. It is invalid to append this structure to1310 * timeline variants of drm_syncobj. It is invalid to append this structure to
1193 * the execbuf if I915_EXEC_FENCE_ARRAY is set.1311 * the execbuf if I915_EXEC_FENCE_ARRAY is set.
1194 */1312 */
1195struct drm_i915_gem_execbuffer_ext_timeline_fences {1313struct 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. */
1196 struct i915_user_extension base;1316 struct i915_user_extension base;
11971317
1198 /**1318 /**
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.
1200 */1321 */
1201 __u64 fence_count;1322 __u64 fence_count;
12021323
1203 /**1324 /**
1204 * Pointer to an array of struct drm_i915_gem_exec_fence of length1325 * @handles_ptr: Pointer to an array of struct drm_i915_gem_exec_fence
1205 * fence_count.1326 * of length @fence_count.
1206 */1327 */
1207 __u64 handles_ptr;1328 __u64 handles_ptr;
12081329
1209 /**1330 /**
1210 * Pointer to an array of u64 values of length fence_count. Values1331 * @values_ptr: Pointer to an array of u64 values of length
1211 * must be 0 for a binary drm_syncobj. A Value of 0 for a timeline1332 * @fence_count.
1212 * drm_syncobj is invalid as it turns a drm_syncobj into a binary one.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.
1213 */1336 */
1214 __u64 values_ptr;1337 __u64 values_ptr;
1215};1338};
12161339
1340/**
1341 * struct drm_i915_gem_execbuffer2 - Structure for DRM_I915_GEM_EXECBUFFER2
1342 * ioctl.
1343 */
1217struct drm_i915_gem_execbuffer2 {1344struct drm_i915_gem_execbuffer2 {
1218 /**1345 /** @buffers_ptr: Pointer to a list of gem_exec_object2 structs */
1219 * List of gem_exec_object2 structs
1220 */
1221 __u64 buffers_ptr;1346 __u64 buffers_ptr;
1347
1348 /** @buffer_count: Number of elements in @buffers_ptr array */
1222 __u32 buffer_count;1349 __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 */
1225 __u32 batch_start_offset;1355 __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 */
1227 __u32 batch_len;1362 __u32 batch_len;
1363
1364 /** @DR1: deprecated */
1228 __u32 DR1;1365 __u32 DR1;
1366
1367 /** @DR4: deprecated */
1229 __u32 DR4;1368 __u32 DR4;
1369
1370 /** @num_cliprects: See @cliprects_ptr */
1230 __u32 num_cliprects;1371 __u32 num_cliprects;
1372
1231 /**1373 /**
1232 * This is a struct drm_clip_rect *cliprects if I915_EXEC_FENCE_ARRAY1374 * @cliprects_ptr: Kernel clipping was a DRI1 misfeature.
1233 * & I915_EXEC_USE_EXTENSIONS are not set.1375 *
1376 * It is invalid to use this field if I915_EXEC_FENCE_ARRAY or
1377 * I915_EXEC_USE_EXTENSIONS flags are not set.
1234 *1378 *
1235 * If I915_EXEC_FENCE_ARRAY is set, then this is a pointer to an array1379 * 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 length1380 * of &drm_i915_gem_exec_fence and @num_cliprects is the length of the
1237 * of the array.1381 * array.
1238 *1382 *
1239 * If I915_EXEC_USE_EXTENSIONS is set, then this is a pointer to a1383 * 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.
1241 */1385 */
1242 __u64 cliprects_ptr;1386 __u64 cliprects_ptr;
1387
1388 /** @flags: Execbuf flags */
1389 __u64 flags;
1243#define I915_EXEC_RING_MASK (0x3f)1390#define I915_EXEC_RING_MASK (0x3f)
1244#define I915_EXEC_DEFAULT (0<<0)1391#define I915_EXEC_DEFAULT (0<<0)
1245#define I915_EXEC_RENDER (1<<0)1392#define I915_EXEC_RENDER (1<<0)
...@@ -1257,10 +1404,6 @@ struct drm_i915_gem_execbuffer2 {...@@ -1257,10 +1404,6 @@ struct drm_i915_gem_execbuffer2 {
1257#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */1404#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
1258#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)1405#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
1259#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */1406#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
1265/** Resets the SO write offset registers for transform feedback on gen7. */1408/** Resets the SO write offset registers for transform feedback on gen7. */
1266#define I915_EXEC_GEN7_SOL_RESET (1<<8)1409#define I915_EXEC_GEN7_SOL_RESET (1<<8)
...@@ -1363,9 +1506,23 @@ struct drm_i915_gem_execbuffer2 {...@@ -1363,9 +1506,23 @@ struct drm_i915_gem_execbuffer2 {
1363 * drm_i915_gem_execbuffer_ext enum.1506 * drm_i915_gem_execbuffer_ext enum.
1364 */1507 */
1365#define I915_EXEC_USE_EXTENSIONS (1 << 21)1508#define I915_EXEC_USE_EXTENSIONS (1 << 21)
1366
1367#define __I915_EXEC_UNKNOWN_FLAGS (-(I915_EXEC_USE_EXTENSIONS << 1))1509#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
1369#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)1526#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
1370#define i915_execbuffer2_set_context_id(eb2, context) \1527#define i915_execbuffer2_set_context_id(eb2, context) \
1371 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK1528 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
...@@ -1745,19 +1902,58 @@ struct drm_i915_gem_context_create {...@@ -1745,19 +1902,58 @@ struct drm_i915_gem_context_create {
1745 __u32 pad;1902 __u32 pad;
1746};1903};
17471904
1905/**
1906 * struct drm_i915_gem_context_create_ext - Structure for creating contexts.
1907 */
1748struct drm_i915_gem_context_create_ext {1908struct 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 */
1750 __u32 flags;1924 __u32 flags;
1751#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)1925#define I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS (1u << 0)
1752#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)1926#define I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE (1u << 1)
1753#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \1927#define I915_CONTEXT_CREATE_FLAGS_UNKNOWN \
1754 (-(I915_CONTEXT_CREATE_FLAGS_SINGLE_TIMELINE << 1))1928 (-(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 */
1755 __u64 extensions;1941 __u64 extensions;
1942#define I915_CONTEXT_CREATE_EXT_SETPARAM 0
1943#define I915_CONTEXT_CREATE_EXT_CLONE 1
1756};1944};
17571945
1946/**
1947 * struct drm_i915_gem_context_param - Context parameter to set or query.
1948 */
1758struct drm_i915_gem_context_param {1949struct drm_i915_gem_context_param {
1950 /** @ctx_id: Context id */
1759 __u32 ctx_id;1951 __u32 ctx_id;
1952
1953 /** @size: Size of the parameter @value */
1760 __u32 size;1954 __u32 size;
1955
1956 /** @param: Parameter to set or query */
1761 __u64 param;1957 __u64 param;
1762#define I915_CONTEXT_PARAM_BAN_PERIOD 0x11958#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
1763/* I915_CONTEXT_PARAM_NO_ZEROMAP has been removed. On the off chance1959/* I915_CONTEXT_PARAM_NO_ZEROMAP has been removed. On the off chance
...@@ -1904,6 +2100,7 @@ struct drm_i915_gem_context_param {...@@ -1904,6 +2100,7 @@ struct drm_i915_gem_context_param {
1904#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd2100#define I915_CONTEXT_PARAM_PROTECTED_CONTENT 0xd
1905/* Must be kept compact -- no holes and well documented */2101/* Must be kept compact -- no holes and well documented */
19062102
2103 /** @value: Context parameter value to be set or queried */
1907 __u64 value;2104 __u64 value;
1908};2105};
19092106
...@@ -2054,7 +2251,7 @@ struct i915_context_engines_load_balance {...@@ -2054,7 +2251,7 @@ struct i915_context_engines_load_balance {
20542251
2055 __u64 mbz64; /* reserved for future use; must be zero */2252 __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[];
2058} __attribute__((packed));2255} __attribute__((packed));
20592256
2060#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \2257#define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
...@@ -2092,7 +2289,7 @@ struct i915_context_engines_bond {...@@ -2092,7 +2289,7 @@ struct i915_context_engines_bond {
2092 __u64 flags; /* all undefined flags must be zero */2289 __u64 flags; /* all undefined flags must be zero */
2093 __u64 mbz64[4]; /* reserved for future use; must be zero */2290 __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[];
2096} __attribute__((packed));2293} __attribute__((packed));
20972294
2098#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \2295#define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
...@@ -2219,7 +2416,7 @@ struct i915_context_engines_parallel_submit {...@@ -2219,7 +2416,7 @@ struct i915_context_engines_parallel_submit {
2219 * length = width (i) * num_siblings (j)2416 * length = width (i) * num_siblings (j)
2220 * index = j + i * num_siblings2417 * index = j + i * num_siblings
2221 */2418 */
2222 struct i915_engine_class_instance engines[0];2419 struct i915_engine_class_instance engines[];
22232420
2224} __attribute__((packed));2421} __attribute__((packed));
22252422
...@@ -2302,23 +2499,29 @@ struct i915_context_param_engines {...@@ -2302,23 +2499,29 @@ struct i915_context_param_engines {
2302 struct i915_engine_class_instance engines[N__]; \2499 struct i915_engine_class_instance engines[N__]; \
2303} __attribute__((packed)) name__2500} __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 */
2305struct drm_i915_gem_context_create_ext_setparam {2506struct drm_i915_gem_context_create_ext_setparam {
2306#define I915_CONTEXT_CREATE_EXT_SETPARAM 02507 /** @base: Extension link. See struct i915_user_extension. */
2307 struct i915_user_extension base;2508 struct i915_user_extension base;
2509
2510 /**
2511 * @param: Context parameter to set or query.
2512 * See struct drm_i915_gem_context_param.
2513 */
2308 struct drm_i915_gem_context_param param;2514 struct drm_i915_gem_context_param param;
2309};2515};
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
2316struct drm_i915_gem_context_destroy {2517struct drm_i915_gem_context_destroy {
2317 __u32 ctx_id;2518 __u32 ctx_id;
2318 __u32 pad;2519 __u32 pad;
2319};2520};
23202521
2321/*2522/**
2523 * struct drm_i915_gem_vm_control - Structure to create or destroy VM.
2524 *
2322 * DRM_I915_GEM_VM_CREATE -2525 * DRM_I915_GEM_VM_CREATE -
2323 *2526 *
2324 * Create a new virtual memory address space (ppGTT) for use within a context2527 * Create a new virtual memory address space (ppGTT) for use within a context
...@@ -2328,20 +2531,23 @@ struct drm_i915_gem_context_destroy {...@@ -2328,20 +2531,23 @@ struct drm_i915_gem_context_destroy {
2328 * The id of new VM (bound to the fd) for use with I915_CONTEXT_PARAM_VM is2531 * The id of new VM (bound to the fd) for use with I915_CONTEXT_PARAM_VM is
2329 * returned in the outparam @id.2532 * returned in the outparam @id.
2330 *2533 *
2331 * No flags are defined, with all bits reserved and must be zero.
2332 *
2333 * An extension chain maybe provided, starting with @extensions, and terminated2534 * An extension chain maybe provided, starting with @extensions, and terminated
2334 * by the @next_extension being 0. Currently, no extensions are defined.2535 * by the @next_extension being 0. Currently, no extensions are defined.
2335 *2536 *
2336 * DRM_I915_GEM_VM_DESTROY -2537 * DRM_I915_GEM_VM_DESTROY -
2337 *2538 *
2338 * Destroys a previously created VM id, specified in @id.2539 * Destroys a previously created VM id, specified in @vm_id.
2339 *2540 *
2340 * No extensions or flags are allowed currently, and so must be zero.2541 * No extensions or flags are allowed currently, and so must be zero.
2341 */2542 */
2342struct drm_i915_gem_vm_control {2543struct drm_i915_gem_vm_control {
2544 /** @extensions: Zero-terminated chain of extensions. */
2343 __u64 extensions;2545 __u64 extensions;
2546
2547 /** @flags: reserved for future usage, currently MBZ */
2344 __u32 flags;2548 __u32 flags;
2549
2550 /** @vm_id: Id of the VM created or to be destroyed */
2345 __u32 vm_id;2551 __u32 vm_id;
2346};2552};
23472553
...@@ -2466,6 +2672,10 @@ enum drm_i915_oa_format {...@@ -2466,6 +2672,10 @@ enum drm_i915_oa_format {
2466 I915_OA_FORMAT_A12_B8_C8,2672 I915_OA_FORMAT_A12_B8_C8,
2467 I915_OA_FORMAT_A32u40_A4u32_B8_C8,2673 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
2469 I915_OA_FORMAT_MAX /* non-ABI */2679 I915_OA_FORMAT_MAX /* non-ABI */
2470};2680};
24712681
...@@ -2651,24 +2861,65 @@ enum drm_i915_perf_record_type {...@@ -2651,24 +2861,65 @@ enum drm_i915_perf_record_type {
2651 DRM_I915_PERF_RECORD_MAX /* non-ABI */2861 DRM_I915_PERF_RECORD_MAX /* non-ABI */
2652};2862};
26532863
2654/*2864/**
2865 * struct drm_i915_perf_oa_config
2866 *
2655 * Structure to upload perf dynamic configuration into the kernel.2867 * Structure to upload perf dynamic configuration into the kernel.
2656 */2868 */
2657struct drm_i915_perf_oa_config {2869struct 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 */
2659 char uuid[36];2875 char uuid[36];
26602876
2877 /**
2878 * @n_mux_regs:
2879 *
2880 * Number of mux regs in &mux_regs_ptr.
2881 */
2661 __u32 n_mux_regs;2882 __u32 n_mux_regs;
2883
2884 /**
2885 * @n_boolean_regs:
2886 *
2887 * Number of boolean regs in &boolean_regs_ptr.
2888 */
2662 __u32 n_boolean_regs;2889 __u32 n_boolean_regs;
2890
2891 /**
2892 * @n_flex_regs:
2893 *
2894 * Number of flex regs in &flex_regs_ptr.
2895 */
2663 __u32 n_flex_regs;2896 __u32 n_flex_regs;
26642897
2665 /*2898 /**
2666 * These fields are pointers to tuples of u32 values (register address,2899 * @mux_regs_ptr:
2667 * value). For example the expected length of the buffer pointed by2900 *
2668 * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).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).
2669 */2904 */
2670 __u64 mux_regs_ptr;2905 __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 */
2671 __u64 boolean_regs_ptr;2914 __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 */
2672 __u64 flex_regs_ptr;2923 __u64 flex_regs_ptr;
2673};2924};
26742925
...@@ -2679,12 +2930,24 @@ struct drm_i915_perf_oa_config {...@@ -2679,12 +2930,24 @@ struct drm_i915_perf_oa_config {
2679 * @data_ptr is also depends on the specific @query_id.2930 * @data_ptr is also depends on the specific @query_id.
2680 */2931 */
2681struct drm_i915_query_item {2932struct 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 */
2683 __u64 query_id;2944 __u64 query_id;
2684#define DRM_I915_QUERY_TOPOLOGY_INFO 12945#define DRM_I915_QUERY_TOPOLOGY_INFO 1
2685#define DRM_I915_QUERY_ENGINE_INFO 22946#define DRM_I915_QUERY_ENGINE_INFO 2
2686#define DRM_I915_QUERY_PERF_CONFIG 32947#define DRM_I915_QUERY_PERF_CONFIG 3
2687#define DRM_I915_QUERY_MEMORY_REGIONS 42948#define DRM_I915_QUERY_MEMORY_REGIONS 4
2949#define DRM_I915_QUERY_HWCONFIG_BLOB 5
2950#define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6
2688/* Must be kept compact -- no holes and well documented */2951/* Must be kept compact -- no holes and well documented */
26892952
2690 /**2953 /**
...@@ -2700,14 +2963,17 @@ struct drm_i915_query_item {...@@ -2700,14 +2963,17 @@ struct drm_i915_query_item {
2700 /**2963 /**
2701 * @flags:2964 * @flags:
2702 *2965 *
2703 * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.2966 * When &query_id == %DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
2704 *2967 *
2705 * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the2968 * When &query_id == %DRM_I915_QUERY_PERF_CONFIG, must be one of the
2706 * following:2969 * following:
2707 *2970 *
2708 * - DRM_I915_QUERY_PERF_CONFIG_LIST2971 * - %DRM_I915_QUERY_PERF_CONFIG_LIST
2709 * - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID2972 * - %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
2710 * - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID2973 * - %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.
2711 */2977 */
2712 __u32 flags;2978 __u32 flags;
2713#define DRM_I915_QUERY_PERF_CONFIG_LIST 12979#define DRM_I915_QUERY_PERF_CONFIG_LIST 1
...@@ -2765,66 +3031,112 @@ struct drm_i915_query {...@@ -2765,66 +3031,112 @@ struct drm_i915_query {
2765 __u64 items_ptr;3031 __u64 items_ptr;
2766};3032};
27673033
2768/*3034/**
2769 * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :3035 * struct 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 :
2792 *3036 *
2793 * (data[eu_offset +3037 * Describes slice/subslice/EU information queried by
2794 * (X * max_subslices + Y) * eu_stride +3038 * %DRM_I915_QUERY_TOPOLOGY_INFO
2795 * Z / 8] >> (Z % 8)) & 1
2796 */3039 */
2797struct drm_i915_query_topology_info {3040struct drm_i915_query_topology_info {
2798 /*3041 /**
3042 * @flags:
3043 *
2799 * Unused for now. Must be cleared to zero.3044 * Unused for now. Must be cleared to zero.
2800 */3045 */
2801 __u16 flags;3046 __u16 flags;
28023047
3048 /**
3049 * @max_slices:
3050 *
3051 * The number of bits used to express the slice mask.
3052 */
2803 __u16 max_slices;3053 __u16 max_slices;
3054
3055 /**
3056 * @max_subslices:
3057 *
3058 * The number of bits used to express the subslice mask.
3059 */
2804 __u16 max_subslices;3060 __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 */
2805 __u16 max_eus_per_subslice;3068 __u16 max_eus_per_subslice;
28063069
2807 /*3070 /**
3071 * @subslice_offset:
3072 *
2808 * Offset in data[] at which the subslice masks are stored.3073 * Offset in data[] at which the subslice masks are stored.
2809 */3074 */
2810 __u16 subslice_offset;3075 __u16 subslice_offset;
28113076
2812 /*3077 /**
3078 * @subslice_stride:
3079 *
2813 * Stride at which each of the subslice masks for each slice are3080 * Stride at which each of the subslice masks for each slice are
2814 * stored.3081 * stored.
2815 */3082 */
2816 __u16 subslice_stride;3083 __u16 subslice_stride;
28173084
2818 /*3085 /**
3086 * @eu_offset:
3087 *
2819 * Offset in data[] at which the EU masks are stored.3088 * Offset in data[] at which the EU masks are stored.
2820 */3089 */
2821 __u16 eu_offset;3090 __u16 eu_offset;
28223091
2823 /*3092 /**
3093 * @eu_stride:
3094 *
2824 * Stride at which each of the EU masks for each subslice are stored.3095 * Stride at which each of the EU masks for each subslice are stored.
2825 */3096 */
2826 __u16 eu_stride;3097 __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 */
2828 __u8 data[];3140 __u8 data[];
2829};3141};
28303142
...@@ -2945,52 +3257,68 @@ struct drm_i915_query_engine_info {...@@ -2945,52 +3257,68 @@ struct drm_i915_query_engine_info {
2945 struct drm_i915_engine_info engines[];3257 struct drm_i915_engine_info engines[];
2946};3258};
29473259
2948/*3260/**
2949 * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG.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.
2950 */3265 */
2951struct drm_i915_query_perf_config {3266struct drm_i915_query_perf_config {
2952 union {3267 union {
2953 /*3268 /**
2954 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets3269 * @n_configs:
2955 * this fields to the number of configurations available.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.
2956 */3274 */
2957 __u64 n_configs;3275 __u64 n_configs;
29583276
2959 /*3277 /**
2960 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID,3278 * @config:
2961 * i915 will use the value in this field as configuration3279 *
2962 * identifier to decide what data to write into config_ptr.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.
2963 */3284 */
2964 __u64 config;3285 __u64 config;
29653286
2966 /*3287 /**
2967 * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,3288 * @uuid:
2968 * i915 will use the value in this field as configuration3289 *
2969 * identifier to decide what data to write into config_ptr.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.
2970 *3294 *
2971 * String formatted like "%08x-%04x-%04x-%04x-%012x"3295 * String formatted like "%08x-%04x-%04x-%04x-%012x"
2972 */3296 */
2973 char uuid[36];3297 char uuid[36];
2974 };3298 };
29753299
2976 /*3300 /**
3301 * @flags:
3302 *
2977 * Unused for now. Must be cleared to zero.3303 * Unused for now. Must be cleared to zero.
2978 */3304 */
2979 __u32 flags;3305 __u32 flags;
29803306
2981 /*3307 /**
2982 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will3308 * @data:
2983 * write an array of __u64 of configuration identifiers.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.
2984 *3312 *
2985 * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will3313 * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_DATA,
2986 * write a struct drm_i915_perf_oa_config. If the following fields of3314 * i915 will write a struct drm_i915_perf_oa_config. If the following
2987 * drm_i915_perf_oa_config are set not set to 0, i915 will write into3315 * fields of struct drm_i915_perf_oa_config are not set to 0, i915 will
2988 * the associated pointers the values of submitted when the3316 * write into the associated pointers the values of submitted when the
2989 * configuration was created :3317 * configuration was created :
2990 *3318 *
2991 * - n_mux_regs3319 * - &drm_i915_perf_oa_config.n_mux_regs
2992 * - n_boolean_regs3320 * - &drm_i915_perf_oa_config.n_boolean_regs
2993 * - n_flex_regs3321 * - &drm_i915_perf_oa_config.n_flex_regs
2994 */3322 */
2995 __u8 data[];3323 __u8 data[];
2996};3324};
...@@ -3020,36 +3348,6 @@ struct drm_i915_gem_memory_class_instance {...@@ -3020,36 +3348,6 @@ struct drm_i915_gem_memory_class_instance {
3020 * struct drm_i915_memory_region_info - Describes one region as known to the3348 * struct drm_i915_memory_region_info - Describes one region as known to the
3021 * driver.3349 * driver.
3022 *3350 *
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 *
3053 * Note this is using both struct drm_i915_query_item and struct drm_i915_query.3351 * Note this is using both struct drm_i915_query_item and struct drm_i915_query.
3054 * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS3352 * For this new query we are adding the new query id DRM_I915_QUERY_MEMORY_REGIONS
3055 * at &drm_i915_query_item.query_id.3353 * at &drm_i915_query_item.query_id.
...@@ -3061,14 +3359,81 @@ struct drm_i915_memory_region_info {...@@ -3061,14 +3359,81 @@ struct drm_i915_memory_region_info {
3061 /** @rsvd0: MBZ */3359 /** @rsvd0: MBZ */
3062 __u32 rsvd0;3360 __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 */
3065 __u64 probed_size;3370 __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 */
3068 __u64 unallocated_size;3381 __u64 unallocated_size;
30693382
3070 /** @rsvd1: MBZ */3383 union {
3071 __u64 rsvd1[8];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 };
3072};3437};
30733438
3074/**3439/**
...@@ -3128,15 +3493,25 @@ struct drm_i915_query_memory_regions {...@@ -3128,15 +3493,25 @@ struct drm_i915_query_memory_regions {
3128 struct drm_i915_memory_region_info regions[];3493 struct drm_i915_memory_region_info regions[];
3129};3494};
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
3131/**3506/**
3132 * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added3507 * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
3133 * extension support using struct i915_user_extension.3508 * extension support using struct i915_user_extension.
3134 *3509 *
3135 * Note that in the future we want to have our buffer flags here, at least for3510 * Note that new buffer flags should be added here, at least for the stuff that
3136 * the stuff that is immutable. Previously we would have two ioctls, one to3511 * is immutable. Previously we would have two ioctls, one to create the object
3137 * create the object with gem_create, and another to apply various parameters,3512 * with gem_create, and another to apply various parameters, however this
3138 * however this creates some ambiguity for the params which are considered3513 * creates some ambiguity for the params which are considered immutable. Also in
3139 * immutable. Also in general we're phasing out the various SET/GET ioctls.3514 * general we're phasing out the various SET/GET ioctls.
3140 */3515 */
3141struct drm_i915_gem_create_ext {3516struct drm_i915_gem_create_ext {
3142 /**3517 /**
...@@ -3144,21 +3519,79 @@ struct drm_i915_gem_create_ext {...@@ -3144,21 +3519,79 @@ struct drm_i915_gem_create_ext {
3144 *3519 *
3145 * The (page-aligned) allocated size for the object will be returned.3520 * The (page-aligned) allocated size for the object will be returned.
3146 *3521 *
3147 * Note that for some devices we have might have further minimum3522 * On platforms like DG2/ATS the kernel will always use 64K or larger
3148 * page-size restrictions(larger than 4K), like for device local-memory.3523 * pages for I915_MEMORY_CLASS_DEVICE. The kernel also requires a
3149 * However in general the final size here should always reflect any3524 * minimum of 64K GTT alignment for such objects.
3150 * rounding up, if for example using the I915_GEM_CREATE_EXT_MEMORY_REGIONS3525 *
3151 * extension to place the object in device local-memory.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.
3152 */3541 */
3153 __u64 size;3542 __u64 size;
3543
3154 /**3544 /**
3155 * @handle: Returned handle for the object.3545 * @handle: Returned handle for the object.
3156 *3546 *
3157 * Object handles are nonzero.3547 * Object handles are nonzero.
3158 */3548 */
3159 __u32 handle;3549 __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)
3161 __u32 flags;3593 __u32 flags;
3594
3162 /**3595 /**
3163 * @extensions: The chain of extensions to apply to this object.3596 * @extensions: The chain of extensions to apply to this object.
3164 *3597 *
...@@ -3217,6 +3650,22 @@ struct drm_i915_gem_create_ext {...@@ -3217,6 +3650,22 @@ struct drm_i915_gem_create_ext {
3217 * At which point we get the object handle in &drm_i915_gem_create_ext.handle,3650 * At which point we get the object handle in &drm_i915_gem_create_ext.handle,
3218 * along with the final object size in &drm_i915_gem_create_ext.size, which3651 * along with the final object size in &drm_i915_gem_create_ext.size, which
3219 * should account for any rounding up, if required.3652 * 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.
3220 */3669 */
3221struct drm_i915_gem_create_ext_memory_regions {3670struct drm_i915_gem_create_ext_memory_regions {
3222 /** @base: Extension link. See struct i915_user_extension. */3671 /** @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 {...@@ -67,16 +67,25 @@ struct drm_msm_timespec {
67 __s64 tv_nsec; /* nanoseconds */67 __s64 tv_nsec; /* nanoseconds */
68};68};
6969
70#define MSM_PARAM_GPU_ID 0x0170/* Below "RO" indicates a read-only param, "WO" indicates write-only, and
71#define MSM_PARAM_GMEM_SIZE 0x0271 * "RW" indicates a param that can be both read (GET_PARAM) and written
72#define MSM_PARAM_CHIP_ID 0x0372 * (SET_PARAM)
73#define MSM_PARAM_MAX_FREQ 0x0473 */
74#define MSM_PARAM_TIMESTAMP 0x0574#define MSM_PARAM_GPU_ID 0x01 /* RO */
75#define MSM_PARAM_GMEM_BASE 0x0675#define MSM_PARAM_GMEM_SIZE 0x02 /* RO */
76#define MSM_PARAM_PRIORITIES 0x07 /* The # of priority levels */76#define MSM_PARAM_CHIP_ID 0x03 /* RO */
77#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */77#define MSM_PARAM_MAX_FREQ 0x04 /* RO */
78#define MSM_PARAM_FAULTS 0x0978#define MSM_PARAM_TIMESTAMP 0x05 /* RO */
79#define MSM_PARAM_SUSPENDS 0x0a79#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
81/* For backwards compat. The original support for preemption was based on90/* For backwards compat. The original support for preemption was based on
82 * a single ring per priority level so # of priority levels equals the #91 * a single ring per priority level so # of priority levels equals the #
...@@ -90,6 +99,8 @@ struct drm_msm_param {...@@ -90,6 +99,8 @@ struct drm_msm_param {
90 __u32 pipe; /* in, MSM_PIPE_x */99 __u32 pipe; /* in, MSM_PIPE_x */
91 __u32 param; /* in, MSM_PARAM_x */100 __u32 param; /* in, MSM_PARAM_x */
92 __u64 value; /* out (get_param) or in (set_param) */101 __u64 value; /* out (get_param) or in (set_param) */
102 __u32 len; /* zero for non-pointer params */
103 __u32 pad; /* must be zero */
93};104};
94105
95/*106/*
...@@ -126,6 +137,8 @@ struct drm_msm_gem_new {...@@ -126,6 +137,8 @@ struct drm_msm_gem_new {
126#define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */137#define MSM_INFO_GET_IOVA 0x01 /* get iova, returned by value */
127#define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */138#define MSM_INFO_SET_NAME 0x02 /* set the debug name (by pointer) */
128#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */139#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
130struct drm_msm_gem_info {143struct drm_msm_gem_info {
131 __u32 handle; /* in */144 __u32 handle; /* in */
...@@ -209,10 +222,12 @@ struct drm_msm_gem_submit_cmd {...@@ -209,10 +222,12 @@ struct drm_msm_gem_submit_cmd {
209#define MSM_SUBMIT_BO_READ 0x0001222#define MSM_SUBMIT_BO_READ 0x0001
210#define MSM_SUBMIT_BO_WRITE 0x0002223#define MSM_SUBMIT_BO_WRITE 0x0002
211#define MSM_SUBMIT_BO_DUMP 0x0004224#define MSM_SUBMIT_BO_DUMP 0x0004
225#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
212226
213#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \227#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \
214 MSM_SUBMIT_BO_WRITE | \228 MSM_SUBMIT_BO_WRITE | \
215 MSM_SUBMIT_BO_DUMP)229 MSM_SUBMIT_BO_DUMP | \
230 MSM_SUBMIT_BO_NO_IMPLICIT)
216231
217struct drm_msm_gem_submit_bo {232struct drm_msm_gem_submit_bo {
218 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */233 __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
...@@ -227,6 +242,7 @@ struct drm_msm_gem_submit_bo {...@@ -227,6 +242,7 @@ struct drm_msm_gem_submit_bo {
227#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */242#define MSM_SUBMIT_SUDO 0x10000000 /* run submitted cmds from RB */
228#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */243#define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 /* enable input syncobj */
229#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */244#define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 /* enable output syncobj */
245#define MSM_SUBMIT_FENCE_SN_IN 0x02000000 /* userspace passes in seqno fence */
230#define MSM_SUBMIT_FLAGS ( \246#define MSM_SUBMIT_FLAGS ( \
231 MSM_SUBMIT_NO_IMPLICIT | \247 MSM_SUBMIT_NO_IMPLICIT | \
232 MSM_SUBMIT_FENCE_FD_IN | \248 MSM_SUBMIT_FENCE_FD_IN | \
...@@ -234,6 +250,7 @@ struct drm_msm_gem_submit_bo {...@@ -234,6 +250,7 @@ struct drm_msm_gem_submit_bo {
234 MSM_SUBMIT_SUDO | \250 MSM_SUBMIT_SUDO | \
235 MSM_SUBMIT_SYNCOBJ_IN | \251 MSM_SUBMIT_SYNCOBJ_IN | \
236 MSM_SUBMIT_SYNCOBJ_OUT | \252 MSM_SUBMIT_SYNCOBJ_OUT | \
253 MSM_SUBMIT_FENCE_SN_IN | \
237 0)254 0)
238255
239#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */256#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
...@@ -253,7 +270,7 @@ struct drm_msm_gem_submit_syncobj {...@@ -253,7 +270,7 @@ struct drm_msm_gem_submit_syncobj {
253 */270 */
254struct drm_msm_gem_submit {271struct drm_msm_gem_submit {
255 __u32 flags; /* MSM_PIPE_x | MSM_SUBMIT_x */272 __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) */
257 __u32 nr_bos; /* in, number of submit_bo's */274 __u32 nr_bos; /* in, number of submit_bo's */
258 __u32 nr_cmds; /* in, number of submit_cmd's */275 __u32 nr_cmds; /* in, number of submit_cmd's */
259 __u64 bos; /* in, ptr to array of submit_bo's */276 __u64 bos; /* in, ptr to array of submit_bo's */
...@@ -333,9 +350,7 @@ struct drm_msm_submitqueue_query {...@@ -333,9 +350,7 @@ struct drm_msm_submitqueue_query {
333};350};
334351
335#define DRM_MSM_GET_PARAM 0x00352#define DRM_MSM_GET_PARAM 0x00
336/* placeholder:
337#define DRM_MSM_SET_PARAM 0x01353#define DRM_MSM_SET_PARAM 0x01
338 */
339#define DRM_MSM_GEM_NEW 0x02354#define DRM_MSM_GEM_NEW 0x02
340#define DRM_MSM_GEM_INFO 0x03355#define DRM_MSM_GEM_INFO 0x03
341#define DRM_MSM_GEM_CPU_PREP 0x04356#define DRM_MSM_GEM_CPU_PREP 0x04
...@@ -351,6 +366,7 @@ struct drm_msm_submitqueue_query {...@@ -351,6 +366,7 @@ struct drm_msm_submitqueue_query {
351#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C366#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
352367
353#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)368#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)
354#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)370#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
355#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)371#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
356#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)372#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 {...@@ -84,14 +84,14 @@ struct drm_panfrost_wait_bo {
84 __s64 timeout_ns; /* absolute */84 __s64 timeout_ns; /* absolute */
85};85};
8686
87/* Valid flags to pass to drm_panfrost_create_bo */
87#define PANFROST_BO_NOEXEC 188#define PANFROST_BO_NOEXEC 1
88#define PANFROST_BO_HEAP 289#define PANFROST_BO_HEAP 2
8990
90/**91/**
91 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.92 * struct drm_panfrost_create_bo - ioctl argument for creating Panfrost BOs.
92 *93 *
93 * There are currently no values for the flags argument, but it may be94 * The flags argument is a bit mask of PANFROST_BO_* flags.
94 * used in a future extension.
95 */95 */
96struct drm_panfrost_create_bo {96struct drm_panfrost_create_bo {
97 __u32 size;97 __u32 size;
...@@ -224,6 +224,57 @@ struct drm_panfrost_madvise {...@@ -224,6 +224,57 @@ struct drm_panfrost_madvise {
224 __u32 retained; /* out, whether backing store still exists */224 __u32 retained; /* out, whether backing store still exists */
225};225};
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
227#if defined(__cplusplus)278#if defined(__cplusplus)
228}279}
229#endif280#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 {...@@ -64,6 +64,7 @@ struct drm_virtgpu_map {
64 __u32 pad;64 __u32 pad;
65};65};
6666
67/* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */
67struct drm_virtgpu_execbuffer {68struct drm_virtgpu_execbuffer {
68 __u32 flags;69 __u32 flags;
69 __u32 size;70 __u32 size;
lib/libc/include/any-linux-any/drm/vmwgfx_drm.h+9-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/**************************************************************************1/**************************************************************************
2 *2 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA3 * Copyright © 2009-2022 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.4 * All Rights Reserved.
5 *5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a6 * Permission is hereby granted, free of charge, to any person obtaining a
...@@ -92,6 +92,12 @@ extern "C" {...@@ -92,6 +92,12 @@ extern "C" {
92 *92 *
93 * DRM_VMW_PARAM_SM593 * DRM_VMW_PARAM_SM5
94 * SM5 support is enabled.94 * 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.
95 */101 */
96102
97#define DRM_VMW_PARAM_NUM_STREAMS 0103#define DRM_VMW_PARAM_NUM_STREAMS 0
...@@ -110,6 +116,8 @@ extern "C" {...@@ -110,6 +116,8 @@ extern "C" {
110#define DRM_VMW_PARAM_HW_CAPS2 13116#define DRM_VMW_PARAM_HW_CAPS2 13
111#define DRM_VMW_PARAM_SM4_1 14117#define DRM_VMW_PARAM_SM4_1 14
112#define DRM_VMW_PARAM_SM5 15118#define DRM_VMW_PARAM_SM5 15
119#define DRM_VMW_PARAM_GL43 16
120#define DRM_VMW_PARAM_DEVICE_ID 17
113121
114/**122/**
115 * enum drm_vmw_handle_type - handle type for ref ioctls123 * 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...@@ -97,12 +97,13 @@ struct acct_v3
97/*97/*
98 * accounting flags98 * accounting flags
99 */99 */
100 /* bit set when the process ... */100 /* bit set when the process/task ... */
101#define AFORK 0x01 /* ... executed fork, but did not exec */101#define AFORK 0x01 /* ... executed fork, but did not exec */
102#define ASU 0x02 /* ... used super-user privileges */102#define ASU 0x02 /* ... used super-user privileges */
103#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */103#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */
104#define ACORE 0x08 /* ... dumped core */104#define ACORE 0x08 /* ... dumped core */
105#define AXSIG 0x10 /* ... was killed by a signal */105#define AXSIG 0x10 /* ... was killed by a signal */
106#define AGROUP 0x20 /* ... was the last task of the process (task group) */
106107
107#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)108#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
108#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */109#define ACCT_BYTEORDER 0x80 /* accounting file is big endian */
lib/libc/include/any-linux-any/linux/acrn.h+2-3
...@@ -12,7 +12,6 @@...@@ -12,7 +12,6 @@
12#define _ACRN_H12#define _ACRN_H
1313
14#include <linux/types.h>14#include <linux/types.h>
15#include <linux/uuid.h>
1615
17#define ACRN_IO_REQUEST_MAX 1616#define ACRN_IO_REQUEST_MAX 16
1817
...@@ -186,7 +185,7 @@ struct acrn_ioreq_notify {...@@ -186,7 +185,7 @@ struct acrn_ioreq_notify {
186 * @reserved0: Reserved and must be 0185 * @reserved0: Reserved and must be 0
187 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor.186 * @vcpu_num: Number of vCPU in the VM. Return from hypervisor.
188 * @reserved1: Reserved and must be 0187 * @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)
190 * @vm_flag: Flag of the VM creating. Pass to hypervisor directly.189 * @vm_flag: Flag of the VM creating. Pass to hypervisor directly.
191 * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to190 * @ioreq_buf: Service VM GPA of I/O request buffer. Pass to
192 * hypervisor directly.191 * hypervisor directly.
...@@ -198,7 +197,7 @@ struct acrn_vm_creation {...@@ -198,7 +197,7 @@ struct acrn_vm_creation {
198 __u16 reserved0;197 __u16 reserved0;
199 __u16 vcpu_num;198 __u16 vcpu_num;
200 __u16 reserved1;199 __u16 reserved1;
201 guid_t uuid;200 __u8 uuid[16];
202 __u64 vm_flag;201 __u64 vm_flag;
203 __u64 ioreq_buf;202 __u64 ioreq_buf;
204 __u64 cpu_affinity;203 __u64 cpu_affinity;
lib/libc/include/any-linux-any/linux/agpgart.h+4-5
...@@ -51,7 +51,6 @@...@@ -51,7 +51,6 @@
51#endif51#endif
5252
53#include <linux/types.h>53#include <linux/types.h>
54#include <stdlib.h>
5554
56struct agp_version {55struct agp_version {
57 __u16 major;56 __u16 major;
...@@ -63,10 +62,10 @@ typedef struct _agp_info {...@@ -63,10 +62,10 @@ typedef struct _agp_info {
63 __u32 bridge_id; /* bridge vendor/device */62 __u32 bridge_id; /* bridge vendor/device */
64 __u32 agp_mode; /* mode info of bridge */63 __u32 agp_mode; /* mode info of bridge */
65 unsigned long aper_base;/* base of aperture */64 unsigned long aper_base;/* base of aperture */
66 size_t aper_size; /* size of aperture */65 __kernel_size_t aper_size; /* size of aperture */
67 size_t pg_total; /* max pages (swap + system) */66 __kernel_size_t pg_total; /* max pages (swap + system) */
68 size_t pg_system; /* max pages (system) */67 __kernel_size_t pg_system; /* max pages (system) */
69 size_t pg_used; /* current pages used */68 __kernel_size_t pg_used; /* current pages used */
70} agp_info;69} agp_info;
7170
72typedef struct _agp_setup {71typedef struct _agp_setup {
lib/libc/include/any-linux-any/linux/android/binder.h+25-3
...@@ -236,6 +236,21 @@ struct binder_frozen_status_info {...@@ -236,6 +236,21 @@ struct binder_frozen_status_info {
236 __u32 async_recv;236 __u32 async_recv;
237};237};
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
239#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)254#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
240#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)255#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
241#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)256#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
...@@ -249,6 +264,7 @@ struct binder_frozen_status_info {...@@ -249,6 +264,7 @@ struct binder_frozen_status_info {
249#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)264#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
250#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)265#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
251#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)266#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
267#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error)
252268
253/*269/*
254 * NOTE: Two special error codes you should check for when calling270 * NOTE: Two special error codes you should check for when calling
...@@ -271,6 +287,7 @@ enum transaction_flags {...@@ -271,6 +287,7 @@ enum transaction_flags {
271 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */287 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
272 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */288 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
273 TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */289 TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */
290 TF_UPDATE_TXN = 0x40, /* update the outdated pending async txn */
274};291};
275292
276struct binder_transaction_data {293struct binder_transaction_data {
...@@ -288,8 +305,8 @@ struct binder_transaction_data {...@@ -288,8 +305,8 @@ struct binder_transaction_data {
288305
289 /* General information about the transaction. */306 /* General information about the transaction. */
290 __u32 flags;307 __u32 flags;
291 pid_t sender_pid;308 __kernel_pid_t sender_pid;
292 uid_t sender_euid;309 __kernel_uid32_t sender_euid;
293 binder_size_t data_size; /* number of bytes of data */310 binder_size_t data_size; /* number of bytes of data */
294 binder_size_t offsets_size; /* number of bytes of offsets */311 binder_size_t offsets_size; /* number of bytes of offsets */
295312
...@@ -433,7 +450,7 @@ enum binder_driver_return_protocol {...@@ -433,7 +450,7 @@ enum binder_driver_return_protocol {
433450
434 BR_FROZEN_REPLY = _IO('r', 18),451 BR_FROZEN_REPLY = _IO('r', 18),
435 /*452 /*
436 * The target of the last transaction (either a bcTRANSACTION or453 * The target of the last sync transaction (either a bcTRANSACTION or
437 * a bcATTEMPT_ACQUIRE) is frozen. No parameters.454 * a bcATTEMPT_ACQUIRE) is frozen. No parameters.
438 */455 */
439456
...@@ -443,6 +460,11 @@ enum binder_driver_return_protocol {...@@ -443,6 +460,11 @@ enum binder_driver_return_protocol {
443 * asynchronous transaction makes the allocated async buffer size exceed460 * asynchronous transaction makes the allocated async buffer size exceed
444 * detection threshold. No parameters.461 * detection threshold. No parameters.
445 */462 */
463
464 BR_TRANSACTION_PENDING_FROZEN = _IO('r', 20),
465 /*
466 * The target of the last async transaction is frozen. No parameters.
467 */
446};468};
447469
448enum binder_driver_command_protocol {470enum 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 @@...@@ -38,7 +38,7 @@
38 */38 */
39#define BR2684_ENCAPS_VC (0) /* VC-mux */39#define BR2684_ENCAPS_VC (0) /* VC-mux */
40#define BR2684_ENCAPS_LLC (1)40#define BR2684_ENCAPS_LLC (1)
41#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */41#define BR2684_ENCAPS_AUTODETECT (2) /* Unsupported */
4242
43/*43/*
44 * Is this VC bridged or routed?44 * Is this VC bridged or routed?
lib/libc/include/any-linux-any/linux/audit.h+4-2
...@@ -187,7 +187,7 @@...@@ -187,7 +187,7 @@
187#define AUDIT_MAX_KEY_LEN 256187#define AUDIT_MAX_KEY_LEN 256
188#define AUDIT_BITMASK_SIZE 64188#define AUDIT_BITMASK_SIZE 64
189#define AUDIT_WORD(nr) ((__u32)((nr)/32))189#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
192#define AUDIT_SYSCALL_CLASSES 16192#define AUDIT_SYSCALL_CLASSES 16
193#define AUDIT_CLASS_DIR_WRITE 0193#define AUDIT_CLASS_DIR_WRITE 0
...@@ -439,6 +439,8 @@ enum {...@@ -439,6 +439,8 @@ enum {
439#define AUDIT_ARCH_UNICORE (EM_UNICORE|__AUDIT_ARCH_LE)439#define AUDIT_ARCH_UNICORE (EM_UNICORE|__AUDIT_ARCH_LE)
440#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)440#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
441#define AUDIT_ARCH_XTENSA (EM_XTENSA)441#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
443#define AUDIT_PERM_EXEC 1445#define AUDIT_PERM_EXEC 1
444#define AUDIT_PERM_WRITE 2446#define AUDIT_PERM_WRITE 2
...@@ -514,7 +516,7 @@ struct audit_rule_data {...@@ -514,7 +516,7 @@ struct audit_rule_data {
514 __u32 values[AUDIT_MAX_FIELDS];516 __u32 values[AUDIT_MAX_FIELDS];
515 __u32 fieldflags[AUDIT_MAX_FIELDS];517 __u32 fieldflags[AUDIT_MAX_FIELDS];
516 __u32 buflen; /* total length of string fields */518 __u32 buflen; /* total length of string fields */
517 char buf[0]; /* string fields buffer */519 char buf[]; /* string fields buffer */
518};520};
519521
520#endif /* _LINUX_AUDIT_H_ */522#endif /* _LINUX_AUDIT_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/auxvec.h+2
...@@ -30,6 +30,8 @@...@@ -30,6 +30,8 @@
30 * differ from AT_PLATFORM. */30 * differ from AT_PLATFORM. */
31#define AT_RANDOM 25 /* address of 16 random bytes */31#define AT_RANDOM 25 /* address of 16 random bytes */
32#define AT_HWCAP2 26 /* extension of AT_HWCAP */32#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
34#define AT_EXECFN 31 /* filename of program */36#define AT_EXECFN 31 /* filename of program */
3537
lib/libc/include/any-linux-any/linux/batadv_packet.h+2
...@@ -26,6 +26,7 @@...@@ -26,6 +26,7 @@
26 * @BATADV_CODED: network coded packets26 * @BATADV_CODED: network coded packets
27 * @BATADV_ELP: echo location packets for B.A.T.M.A.N. V27 * @BATADV_ELP: echo location packets for B.A.T.M.A.N. V
28 * @BATADV_OGM2: originator messages for B.A.T.M.A.N. V28 * @BATADV_OGM2: originator messages for B.A.T.M.A.N. V
29 * @BATADV_MCAST: multicast packet with multiple destination addresses
29 *30 *
30 * @BATADV_UNICAST: unicast packets carrying unicast payload traffic31 * @BATADV_UNICAST: unicast packets carrying unicast payload traffic
31 * @BATADV_UNICAST_FRAG: unicast packets carrying a fragment of the original32 * @BATADV_UNICAST_FRAG: unicast packets carrying a fragment of the original
...@@ -42,6 +43,7 @@ enum batadv_packettype {...@@ -42,6 +43,7 @@ enum batadv_packettype {
42 BATADV_CODED = 0x02,43 BATADV_CODED = 0x02,
43 BATADV_ELP = 0x03,44 BATADV_ELP = 0x03,
44 BATADV_OGM2 = 0x04,45 BATADV_OGM2 = 0x04,
46 BATADV_MCAST = 0x05,
45 /* 0x40 - 0x7f: unicast */47 /* 0x40 - 0x7f: unicast */
46#define BATADV_UNICAST_MIN 0x4048#define BATADV_UNICAST_MIN 0x40
47 BATADV_UNICAST = 0x40,49 BATADV_UNICAST = 0x40,
lib/libc/include/any-linux-any/linux/blkzoned.h+1-1
...@@ -130,7 +130,7 @@ struct blk_zone_report {...@@ -130,7 +130,7 @@ struct blk_zone_report {
130 __u64 sector;130 __u64 sector;
131 __u32 nr_zones;131 __u32 nr_zones;
132 __u32 flags;132 __u32 flags;
133 struct blk_zone zones[0];133 struct blk_zone zones[];
134};134};
135135
136/**136/**
lib/libc/include/any-linux-any/linux/bpf.h+980-225
...@@ -87,10 +87,35 @@ struct bpf_cgroup_storage_key {...@@ -87,10 +87,35 @@ struct bpf_cgroup_storage_key {
87 __u32 attach_type; /* program attach type (enum bpf_attach_type) */87 __u32 attach_type; /* program attach type (enum bpf_attach_type) */
88};88};
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
90union bpf_iter_link_info {98union bpf_iter_link_info {
91 struct {99 struct {
92 __u32 map_fd;100 __u32 map_fd;
93 } map;101 } 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;
94};119};
95120
96/* BPF syscall commands, see bpf(2) man-page for more details. */121/* BPF syscall commands, see bpf(2) man-page for more details. */
...@@ -330,6 +355,8 @@ union bpf_iter_link_info {...@@ -330,6 +355,8 @@ union bpf_iter_link_info {
330 * *ctx_out*, *data_in* and *data_out* must be NULL.355 * *ctx_out*, *data_in* and *data_out* must be NULL.
331 * *repeat* must be zero.356 * *repeat* must be zero.
332 *357 *
358 * BPF_PROG_RUN is an alias for BPF_PROG_TEST_RUN.
359 *
333 * Return360 * Return
334 * Returns zero on success. On error, -1 is returned and *errno*361 * Returns zero on success. On error, -1 is returned and *errno*
335 * is set appropriately.362 * is set appropriately.
...@@ -895,7 +922,14 @@ enum bpf_map_type {...@@ -895,7 +922,14 @@ enum bpf_map_type {
895 BPF_MAP_TYPE_CPUMAP,922 BPF_MAP_TYPE_CPUMAP,
896 BPF_MAP_TYPE_XSKMAP,923 BPF_MAP_TYPE_XSKMAP,
897 BPF_MAP_TYPE_SOCKHASH,924 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,
899 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,933 BPF_MAP_TYPE_REUSEPORT_SOCKARRAY,
900 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,934 BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE,
901 BPF_MAP_TYPE_QUEUE,935 BPF_MAP_TYPE_QUEUE,
...@@ -907,6 +941,8 @@ enum bpf_map_type {...@@ -907,6 +941,8 @@ enum bpf_map_type {
907 BPF_MAP_TYPE_INODE_STORAGE,941 BPF_MAP_TYPE_INODE_STORAGE,
908 BPF_MAP_TYPE_TASK_STORAGE,942 BPF_MAP_TYPE_TASK_STORAGE,
909 BPF_MAP_TYPE_BLOOM_FILTER,943 BPF_MAP_TYPE_BLOOM_FILTER,
944 BPF_MAP_TYPE_USER_RINGBUF,
945 BPF_MAP_TYPE_CGRP_STORAGE,
910};946};
911947
912/* Note that tracing related programs such as948/* Note that tracing related programs such as
...@@ -995,6 +1031,8 @@ enum bpf_attach_type {...@@ -995,6 +1031,8 @@ enum bpf_attach_type {
995 BPF_SK_REUSEPORT_SELECT,1031 BPF_SK_REUSEPORT_SELECT,
996 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE,1032 BPF_SK_REUSEPORT_SELECT_OR_MIGRATE,
997 BPF_PERF_EVENT,1033 BPF_PERF_EVENT,
1034 BPF_TRACE_KPROBE_MULTI,
1035 BPF_LSM_CGROUP,
998 __MAX_BPF_ATTACH_TYPE1036 __MAX_BPF_ATTACH_TYPE
999};1037};
10001038
...@@ -1009,6 +1047,8 @@ enum bpf_link_type {...@@ -1009,6 +1047,8 @@ enum bpf_link_type {
1009 BPF_LINK_TYPE_NETNS = 5,1047 BPF_LINK_TYPE_NETNS = 5,
1010 BPF_LINK_TYPE_XDP = 6,1048 BPF_LINK_TYPE_XDP = 6,
1011 BPF_LINK_TYPE_PERF_EVENT = 7,1049 BPF_LINK_TYPE_PERF_EVENT = 7,
1050 BPF_LINK_TYPE_KPROBE_MULTI = 8,
1051 BPF_LINK_TYPE_STRUCT_OPS = 9,
10121052
1013 MAX_BPF_LINK_TYPE,1053 MAX_BPF_LINK_TYPE,
1014};1054};
...@@ -1111,6 +1151,21 @@ enum bpf_link_type {...@@ -1111,6 +1151,21 @@ enum bpf_link_type {
1111 */1151 */
1112#define BPF_F_SLEEPABLE (1U << 4)1152#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
1114/* When BPF ldimm64's insn[0].src_reg != 0 then this can have1169/* When BPF ldimm64's insn[0].src_reg != 0 then this can have
1115 * the following extensions:1170 * the following extensions:
1116 *1171 *
...@@ -1217,7 +1272,7 @@ enum {...@@ -1217,7 +1272,7 @@ enum {
12171272
1218/* Query effective (directly attached + inherited from ancestor cgroups)1273/* Query effective (directly attached + inherited from ancestor cgroups)
1219 * programs that will be executed for events within a cgroup.1274 * 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.
1221 */1276 */
1222#define BPF_F_QUERY_EFFECTIVE (1U << 0)1277#define BPF_F_QUERY_EFFECTIVE (1U << 0)
12231278
...@@ -1225,6 +1280,8 @@ enum {...@@ -1225,6 +1280,8 @@ enum {
12251280
1226/* If set, run the test on the cpu specified by bpf_attr.test.cpu */1281/* If set, run the test on the cpu specified by bpf_attr.test.cpu */
1227#define BPF_F_TEST_RUN_ON_CPU (1U << 0)1282#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
1229/* type for BPF_ENABLE_STATS */1286/* type for BPF_ENABLE_STATS */
1230enum bpf_stats_type {1287enum bpf_stats_type {
...@@ -1342,8 +1399,10 @@ union bpf_attr {...@@ -1342,8 +1399,10 @@ union bpf_attr {
1342 /* or valid module BTF object fd or 0 to attach to vmlinux */1399 /* or valid module BTF object fd or 0 to attach to vmlinux */
1343 __u32 attach_btf_obj_fd;1400 __u32 attach_btf_obj_fd;
1344 };1401 };
1345 __u32 :32; /* pad */1402 __u32 core_relo_cnt; /* number of bpf_core_relo */
1346 __aligned_u64 fd_array; /* array of FDs */1403 __aligned_u64 fd_array; /* array of FDs */
1404 __aligned_u64 core_relos;
1405 __u32 core_relo_rec_size; /* sizeof(struct bpf_core_relo) */
1347 };1406 };
13481407
1349 struct { /* anonymous struct used by BPF_OBJ_* commands */1408 struct { /* anonymous struct used by BPF_OBJ_* commands */
...@@ -1384,6 +1443,7 @@ union bpf_attr {...@@ -1384,6 +1443,7 @@ union bpf_attr {
1384 __aligned_u64 ctx_out;1443 __aligned_u64 ctx_out;
1385 __u32 flags;1444 __u32 flags;
1386 __u32 cpu;1445 __u32 cpu;
1446 __u32 batch_size;
1387 } test;1447 } test;
13881448
1389 struct { /* anonymous struct used by BPF_*_GET_*_ID */1449 struct { /* anonymous struct used by BPF_*_GET_*_ID */
...@@ -1411,6 +1471,10 @@ union bpf_attr {...@@ -1411,6 +1471,10 @@ union bpf_attr {
1411 __u32 attach_flags;1471 __u32 attach_flags;
1412 __aligned_u64 prog_ids;1472 __aligned_u64 prog_ids;
1413 __u32 prog_cnt;1473 __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;
1414 } query;1478 } query;
14151479
1416 struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */1480 struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */
...@@ -1463,6 +1527,22 @@ union bpf_attr {...@@ -1463,6 +1527,22 @@ union bpf_attr {
1463 */1527 */
1464 __u64 bpf_cookie;1528 __u64 bpf_cookie;
1465 } perf_event;1529 } 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;
1466 };1546 };
1467 } link_create;1547 } link_create;
14681548
...@@ -1744,7 +1824,7 @@ union bpf_attr {...@@ -1744,7 +1824,7 @@ union bpf_attr {
1744 * if the maximum number of tail calls has been reached for this1824 * if the maximum number of tail calls has been reached for this
1745 * chain of programs. This limit is defined in the kernel by the1825 * chain of programs. This limit is defined in the kernel by the
1746 * macro **MAX_TAIL_CALL_CNT** (not accessible to user space),1826 * macro **MAX_TAIL_CALL_CNT** (not accessible to user space),
1747 * which is currently set to 32.1827 * which is currently set to 33.
1748 * Return1828 * Return
1749 * 0 on success, or a negative error in case of failure.1829 * 0 on success, or a negative error in case of failure.
1750 *1830 *
...@@ -1773,6 +1853,8 @@ union bpf_attr {...@@ -1773,6 +1853,8 @@ union bpf_attr {
1773 * 0 on success, or a negative error in case of failure.1853 * 0 on success, or a negative error in case of failure.
1774 *1854 *
1775 * u64 bpf_get_current_pid_tgid(void)1855 * u64 bpf_get_current_pid_tgid(void)
1856 * Description
1857 * Get the current pid and tgid.
1776 * Return1858 * Return
1777 * A 64-bit integer containing the current tgid and pid, and1859 * A 64-bit integer containing the current tgid and pid, and
1778 * created as such:1860 * created as such:
...@@ -1780,6 +1862,8 @@ union bpf_attr {...@@ -1780,6 +1862,8 @@ union bpf_attr {
1780 * *current_task*\ **->pid**.1862 * *current_task*\ **->pid**.
1781 *1863 *
1782 * u64 bpf_get_current_uid_gid(void)1864 * u64 bpf_get_current_uid_gid(void)
1865 * Description
1866 * Get the current uid and gid.
1783 * Return1867 * Return
1784 * A 64-bit integer containing the current GID and UID, and1868 * A 64-bit integer containing the current GID and UID, and
1785 * created as such: *current_gid* **<< 32 \|** *current_uid*.1869 * created as such: *current_gid* **<< 32 \|** *current_uid*.
...@@ -1922,6 +2006,9 @@ union bpf_attr {...@@ -1922,6 +2006,9 @@ union bpf_attr {
1922 * sending the packet. This flag was added for GRE2006 * sending the packet. This flag was added for GRE
1923 * encapsulation, but might be used with other protocols2007 * encapsulation, but might be used with other protocols
1924 * as well in the future.2008 * 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.
1925 *2012 *
1926 * Here is a typical usage on the transmit path:2013 * Here is a typical usage on the transmit path:
1927 *2014 *
...@@ -2254,6 +2341,8 @@ union bpf_attr {...@@ -2254,6 +2341,8 @@ union bpf_attr {
2254 * The 32-bit hash.2341 * The 32-bit hash.
2255 *2342 *
2256 * u64 bpf_get_current_task(void)2343 * u64 bpf_get_current_task(void)
2344 * Description
2345 * Get the current task.
2257 * Return2346 * Return
2258 * A pointer to the current task struct.2347 * A pointer to the current task struct.
2259 *2348 *
...@@ -2284,8 +2373,8 @@ union bpf_attr {...@@ -2284,8 +2373,8 @@ union bpf_attr {
2284 * Return2373 * Return
2285 * The return value depends on the result of the test, and can be:2374 * The return value depends on the result of the test, and can be:
2286 *2375 *
2287 * * 0, if current task belongs to the cgroup2.2376 * * 1, if current task belongs to the cgroup2.
2288 * * 1, if current task does not belong to the cgroup2.2377 * * 0, if current task does not belong to the cgroup2.
2289 * * A negative error code, if an error occurred.2378 * * A negative error code, if an error occurred.
2290 *2379 *
2291 * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)2380 * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags)
...@@ -2317,7 +2406,8 @@ union bpf_attr {...@@ -2317,7 +2406,8 @@ union bpf_attr {
2317 * Pull in non-linear data in case the *skb* is non-linear and not2406 * Pull in non-linear data in case the *skb* is non-linear and not
2318 * all of *len* are part of the linear section. Make *len* bytes2407 * all of *len* are part of the linear section. Make *len* bytes
2319 * from *skb* readable and writable. If a zero value is passed for2408 * 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.
2321 *2411 *
2322 * This helper is only needed for reading and writing with direct2412 * This helper is only needed for reading and writing with direct
2323 * packet access.2413 * packet access.
...@@ -2367,6 +2457,8 @@ union bpf_attr {...@@ -2367,6 +2457,8 @@ union bpf_attr {
2367 * indicate that the hash is outdated and to trigger a2457 * indicate that the hash is outdated and to trigger a
2368 * recalculation the next time the kernel tries to access this2458 * recalculation the next time the kernel tries to access this
2369 * hash or when the **bpf_get_hash_recalc**\ () helper is called.2459 * hash or when the **bpf_get_hash_recalc**\ () helper is called.
2460 * Return
2461 * void.
2370 *2462 *
2371 * long bpf_get_numa_node_id(void)2463 * long bpf_get_numa_node_id(void)
2372 * Description2464 * Description
...@@ -2464,6 +2556,8 @@ union bpf_attr {...@@ -2464,6 +2556,8 @@ union bpf_attr {
2464 * A 8-byte long unique number or 0 if *sk* is NULL.2556 * A 8-byte long unique number or 0 if *sk* is NULL.
2465 *2557 *
2466 * u32 bpf_get_socket_uid(struct sk_buff *skb)2558 * u32 bpf_get_socket_uid(struct sk_buff *skb)
2559 * Description
2560 * Get the owner UID of the socked associated to *skb*.
2467 * Return2561 * Return
2468 * The owner UID of the socket associated to *skb*. If the socket2562 * The owner UID of the socket associated to *skb*. If the socket
2469 * is **NULL**, or if it is not a full socket (i.e. if it is a2563 * is **NULL**, or if it is not a full socket (i.e. if it is a
...@@ -2498,14 +2592,19 @@ union bpf_attr {...@@ -2498,14 +2592,19 @@ union bpf_attr {
2498 * * **SOL_SOCKET**, which supports the following *optname*\ s:2592 * * **SOL_SOCKET**, which supports the following *optname*\ s:
2499 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,2593 * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
2500 * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,2594 * **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**.
2502 * * **IPPROTO_TCP**, which supports the following *optname*\ s:2597 * * **IPPROTO_TCP**, which supports the following *optname*\ s:
2503 * **TCP_CONGESTION**, **TCP_BPF_IW**,2598 * **TCP_CONGESTION**, **TCP_BPF_IW**,
2504 * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,2599 * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
2505 * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,2600 * **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**.
2507 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.2605 * * **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**.
2509 * Return2608 * Return
2510 * 0 on success, or a negative error in case of failure.2609 * 0 on success, or a negative error in case of failure.
2511 *2610 *
...@@ -2524,10 +2623,12 @@ union bpf_attr {...@@ -2524,10 +2623,12 @@ union bpf_attr {
2524 * There are two supported modes at this time:2623 * There are two supported modes at this time:
2525 *2624 *
2526 * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer2625 * * **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).
2528 *2628 *
2529 * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer2629 * * **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).
2531 *2632 *
2532 * The following flags are supported at this time:2633 * The following flags are supported at this time:
2533 *2634 *
...@@ -2551,6 +2652,11 @@ union bpf_attr {...@@ -2551,6 +2652,11 @@ union bpf_attr {
2551 * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the2652 * Use with BPF_F_ADJ_ROOM_ENCAP_L2 flag to further specify the
2552 * L2 type as Ethernet.2653 * L2 type as Ethernet.
2553 *2654 *
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 *
2554 * A call to this helper is susceptible to change the underlying2660 * A call to this helper is susceptible to change the underlying
2555 * packet buffer. Therefore, at load time, all checks on pointers2661 * packet buffer. Therefore, at load time, all checks on pointers
2556 * previously done by the verifier are invalidated and must be2662 * previously done by the verifier are invalidated and must be
...@@ -2559,7 +2665,7 @@ union bpf_attr {...@@ -2559,7 +2665,7 @@ union bpf_attr {
2559 * Return2665 * Return
2560 * 0 on success, or a negative error in case of failure.2666 * 0 on success, or a negative error in case of failure.
2561 *2667 *
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)
2563 * Description2669 * Description
2564 * Redirect the packet to the endpoint referenced by *map* at2670 * Redirect the packet to the endpoint referenced by *map* at
2565 * index *key*. Depending on its type, this *map* can contain2671 * index *key*. Depending on its type, this *map* can contain
...@@ -2695,7 +2801,7 @@ union bpf_attr {...@@ -2695,7 +2801,7 @@ union bpf_attr {
2695 *2801 *
2696 * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)2802 * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size)
2697 * Description2803 * Description
2698 * For en eBPF program attached to a perf event, retrieve the2804 * For an eBPF program attached to a perf event, retrieve the
2699 * value of the event counter associated to *ctx* and store it in2805 * value of the event counter associated to *ctx* and store it in
2700 * the structure pointed by *buf* and of size *buf_size*. Enabled2806 * the structure pointed by *buf* and of size *buf_size*. Enabled
2701 * and running times are also stored in the structure (see2807 * and running times are also stored in the structure (see
...@@ -2720,12 +2826,10 @@ union bpf_attr {...@@ -2720,12 +2826,10 @@ union bpf_attr {
2720 * and **BPF_CGROUP_INET6_CONNECT**.2826 * and **BPF_CGROUP_INET6_CONNECT**.
2721 *2827 *
2722 * This helper actually implements a subset of **getsockopt()**.2828 * This helper actually implements a subset of **getsockopt()**.
2723 * It supports the following *level*\ s:2829 * It supports the same set of *optname*\ s that is supported by
2724 *2830 * the **bpf_setsockopt**\ () helper. The exceptions are
2725 * * **IPPROTO_TCP**, which supports *optname*2831 * **TCP_BPF_*** is **bpf_setsockopt**\ () only and
2726 * **TCP_CONGESTION**.2832 * **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only.
2727 * * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2728 * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
2729 * Return2833 * Return
2730 * 0 on success, or a negative error in case of failure.2834 * 0 on success, or a negative error in case of failure.
2731 *2835 *
...@@ -2959,8 +3063,18 @@ union bpf_attr {...@@ -2959,8 +3063,18 @@ union bpf_attr {
2959 * **BPF_F_USER_STACK**3063 * **BPF_F_USER_STACK**
2960 * Collect a user space stack instead of a kernel stack.3064 * Collect a user space stack instead of a kernel stack.
2961 * **BPF_F_USER_BUILD_ID**3065 * **BPF_F_USER_BUILD_ID**
2962 * Collect buildid+offset instead of ips for user stack,3066 * Collect (build_id, file_offset) instead of ips for user
2963 * only valid if **BPF_F_USER_STACK** is also specified.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.
2964 *3078 *
2965 * **bpf_get_stack**\ () can collect up to3079 * **bpf_get_stack**\ () can collect up to
2966 * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject3080 * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject
...@@ -2973,8 +3087,8 @@ union bpf_attr {...@@ -2973,8 +3087,8 @@ union bpf_attr {
2973 *3087 *
2974 * # sysctl kernel.perf_event_max_stack=<new value>3088 * # sysctl kernel.perf_event_max_stack=<new value>
2975 * Return3089 * Return
2976 * A non-negative value equal to or less than *size* on success,3090 * The non-negative copied *buf* length equal to or less than
2977 * or a negative error in case of failure.3091 * *size* on success, or a negative error in case of failure.
2978 *3092 *
2979 * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)3093 * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header)
2980 * Description3094 * Description
...@@ -3020,6 +3134,11 @@ union bpf_attr {...@@ -3020,6 +3134,11 @@ union bpf_attr {
3020 * **BPF_FIB_LOOKUP_OUTPUT**3134 * **BPF_FIB_LOOKUP_OUTPUT**
3021 * Perform lookup from an egress perspective (default is3135 * Perform lookup from an egress perspective (default is
3022 * ingress).3136 * 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**\ ().
3023 *3142 *
3024 * *ctx* is either **struct xdp_md** for XDP programs or3143 * *ctx* is either **struct xdp_md** for XDP programs or
3025 * **struct sk_buff** tc cls_act programs.3144 * **struct sk_buff** tc cls_act programs.
...@@ -3238,6 +3357,9 @@ union bpf_attr {...@@ -3238,6 +3357,9 @@ union bpf_attr {
3238 * The id is returned or 0 in case the id could not be retrieved.3357 * The id is returned or 0 in case the id could not be retrieved.
3239 *3358 *
3240 * u64 bpf_get_current_cgroup_id(void)3359 * 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.
3241 * Return3363 * Return
3242 * A 64-bit integer containing the current cgroup id based3364 * A 64-bit integer containing the current cgroup id based
3243 * on the cgroup within which the current task is running.3365 * on the cgroup within which the current task is running.
...@@ -3548,10 +3670,11 @@ union bpf_attr {...@@ -3548,10 +3670,11 @@ union bpf_attr {
3548 *3670 *
3549 * *iph* points to the start of the IPv4 or IPv6 header, while3671 * *iph* points to the start of the IPv4 or IPv6 header, while
3550 * *iph_len* contains **sizeof**\ (**struct iphdr**) or3672 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3551 * **sizeof**\ (**struct ip6hdr**).3673 * **sizeof**\ (**struct ipv6hdr**).
3552 *3674 *
3553 * *th* points to the start of the TCP header, while *th_len*3675 * *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**)).
3555 * Return3678 * Return
3556 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative3679 * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative
3557 * error otherwise.3680 * error otherwise.
...@@ -3734,10 +3857,11 @@ union bpf_attr {...@@ -3734,10 +3857,11 @@ union bpf_attr {
3734 *3857 *
3735 * *iph* points to the start of the IPv4 or IPv6 header, while3858 * *iph* points to the start of the IPv4 or IPv6 header, while
3736 * *iph_len* contains **sizeof**\ (**struct iphdr**) or3859 * *iph_len* contains **sizeof**\ (**struct iphdr**) or
3737 * **sizeof**\ (**struct ip6hdr**).3860 * **sizeof**\ (**struct ipv6hdr**).
3738 *3861 *
3739 * *th* points to the start of the TCP header, while *th_len*3862 * *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**)).
3741 * Return3865 * Return
3742 * On success, lower 32 bits hold the generated SYN cookie in3866 * On success, lower 32 bits hold the generated SYN cookie in
3743 * followed by 16 bits which hold the MSS value for that cookie,3867 * followed by 16 bits which hold the MSS value for that cookie,
...@@ -4277,8 +4401,8 @@ union bpf_attr {...@@ -4277,8 +4401,8 @@ union bpf_attr {
4277 *4401 *
4278 * # sysctl kernel.perf_event_max_stack=<new value>4402 * # sysctl kernel.perf_event_max_stack=<new value>
4279 * Return4403 * Return
4280 * A non-negative value equal to or less than *size* on success,4404 * The non-negative copied *buf* length equal to or less than
4281 * or a negative error in case of failure.4405 * *size* on success, or a negative error in case of failure.
4282 *4406 *
4283 * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags)4407 * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags)
4284 * Description4408 * Description
...@@ -4371,7 +4495,7 @@ union bpf_attr {...@@ -4371,7 +4495,7 @@ union bpf_attr {
4371 *4495 *
4372 * **-EEXIST** if the option already exists.4496 * **-EEXIST** if the option already exists.
4373 *4497 *
4374 * **-EFAULT** on failrue to parse the existing header options.4498 * **-EFAULT** on failure to parse the existing header options.
4375 *4499 *
4376 * **-EPERM** if the helper cannot be used under the current4500 * **-EPERM** if the helper cannot be used under the current
4377 * *skops*\ **->op**.4501 * *skops*\ **->op**.
...@@ -4580,7 +4704,7 @@ union bpf_attr {...@@ -4580,7 +4704,7 @@ union bpf_attr {
4580 * a *map* with *task* as the **key**. From this4704 * a *map* with *task* as the **key**. From this
4581 * perspective, the usage is not much different from4705 * perspective, the usage is not much different from
4582 * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this4706 * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this
4583 * helper enforces the key must be an task_struct and the map must also4707 * helper enforces the key must be a task_struct and the map must also
4584 * be a **BPF_MAP_TYPE_TASK_STORAGE**.4708 * be a **BPF_MAP_TYPE_TASK_STORAGE**.
4585 *4709 *
4586 * Underneath, the value is stored locally at *task* instead of4710 * Underneath, the value is stored locally at *task* instead of
...@@ -4638,7 +4762,7 @@ union bpf_attr {...@@ -4638,7 +4762,7 @@ union bpf_attr {
4638 *4762 *
4639 * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)4763 * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)
4640 * Description4764 * 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).
4642 * If the hash is larger than *size*, then only *size*4766 * If the hash is larger than *size*, then only *size*
4643 * bytes will be copied to *dst*4767 * bytes will be copied to *dst*
4644 * Return4768 * Return
...@@ -4662,12 +4786,12 @@ union bpf_attr {...@@ -4662,12 +4786,12 @@ union bpf_attr {
4662 *4786 *
4663 * The argument *len_diff* can be used for querying with a planned4787 * The argument *len_diff* can be used for querying with a planned
4664 * size change. This allows to check MTU prior to changing packet4788 * size change. This allows to check MTU prior to changing packet
4665 * ctx. Providing an *len_diff* adjustment that is larger than the4789 * ctx. Providing a *len_diff* adjustment that is larger than the
4666 * actual packet size (resulting in negative packet size) will in4790 * actual packet size (resulting in negative packet size) will in
4667 * principle not exceed the MTU, why it is not considered a4791 * principle not exceed the MTU, which is why it is not considered
4668 * failure. Other BPF-helpers are needed for performing the4792 * a failure. Other BPF helpers are needed for performing the
4669 * planned size change, why the responsability for catch a negative4793 * planned size change; therefore the responsibility for catching
4670 * packet size belong in those helpers.4794 * a negative packet size belongs in those helpers.
4671 *4795 *
4672 * Specifying *ifindex* zero means the MTU check is performed4796 * Specifying *ifindex* zero means the MTU check is performed
4673 * against the current net device. This is practical if this isn't4797 * against the current net device. This is practical if this isn't
...@@ -4865,6 +4989,7 @@ union bpf_attr {...@@ -4865,6 +4989,7 @@ union bpf_attr {
4865 * Get address of the traced function (for tracing and kprobe programs).4989 * Get address of the traced function (for tracing and kprobe programs).
4866 * Return4990 * Return
4867 * Address of the traced function.4991 * Address of the traced function.
4992 * 0 for kprobes placed within the function (not at the entry).
4868 *4993 *
4869 * u64 bpf_get_attach_cookie(void *ctx)4994 * u64 bpf_get_attach_cookie(void *ctx)
4870 * Description4995 * Description
...@@ -4938,196 +5063,673 @@ union bpf_attr {...@@ -4938,196 +5063,673 @@ union bpf_attr {
4938 * **-ENOENT** if symbol is not found.5063 * **-ENOENT** if symbol is not found.
4939 *5064 *
4940 * **-EPERM** if caller does not have permission to obtain kernel address.5065 * **-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.
4941 */5505 */
4942#define __BPF_FUNC_MAPPER(FN) \5506#define ___BPF_FUNC_MAPPER(FN, ctx...) \
4943 FN(unspec), \5507 FN(unspec, 0, ##ctx) \
4944 FN(map_lookup_elem), \5508 FN(map_lookup_elem, 1, ##ctx) \
4945 FN(map_update_elem), \5509 FN(map_update_elem, 2, ##ctx) \
4946 FN(map_delete_elem), \5510 FN(map_delete_elem, 3, ##ctx) \
4947 FN(probe_read), \5511 FN(probe_read, 4, ##ctx) \
4948 FN(ktime_get_ns), \5512 FN(ktime_get_ns, 5, ##ctx) \
4949 FN(trace_printk), \5513 FN(trace_printk, 6, ##ctx) \
4950 FN(get_prandom_u32), \5514 FN(get_prandom_u32, 7, ##ctx) \
4951 FN(get_smp_processor_id), \5515 FN(get_smp_processor_id, 8, ##ctx) \
4952 FN(skb_store_bytes), \5516 FN(skb_store_bytes, 9, ##ctx) \
4953 FN(l3_csum_replace), \5517 FN(l3_csum_replace, 10, ##ctx) \
4954 FN(l4_csum_replace), \5518 FN(l4_csum_replace, 11, ##ctx) \
4955 FN(tail_call), \5519 FN(tail_call, 12, ##ctx) \
4956 FN(clone_redirect), \5520 FN(clone_redirect, 13, ##ctx) \
4957 FN(get_current_pid_tgid), \5521 FN(get_current_pid_tgid, 14, ##ctx) \
4958 FN(get_current_uid_gid), \5522 FN(get_current_uid_gid, 15, ##ctx) \
4959 FN(get_current_comm), \5523 FN(get_current_comm, 16, ##ctx) \
4960 FN(get_cgroup_classid), \5524 FN(get_cgroup_classid, 17, ##ctx) \
4961 FN(skb_vlan_push), \5525 FN(skb_vlan_push, 18, ##ctx) \
4962 FN(skb_vlan_pop), \5526 FN(skb_vlan_pop, 19, ##ctx) \
4963 FN(skb_get_tunnel_key), \5527 FN(skb_get_tunnel_key, 20, ##ctx) \
4964 FN(skb_set_tunnel_key), \5528 FN(skb_set_tunnel_key, 21, ##ctx) \
4965 FN(perf_event_read), \5529 FN(perf_event_read, 22, ##ctx) \
4966 FN(redirect), \5530 FN(redirect, 23, ##ctx) \
4967 FN(get_route_realm), \5531 FN(get_route_realm, 24, ##ctx) \
4968 FN(perf_event_output), \5532 FN(perf_event_output, 25, ##ctx) \
4969 FN(skb_load_bytes), \5533 FN(skb_load_bytes, 26, ##ctx) \
4970 FN(get_stackid), \5534 FN(get_stackid, 27, ##ctx) \
4971 FN(csum_diff), \5535 FN(csum_diff, 28, ##ctx) \
4972 FN(skb_get_tunnel_opt), \5536 FN(skb_get_tunnel_opt, 29, ##ctx) \
4973 FN(skb_set_tunnel_opt), \5537 FN(skb_set_tunnel_opt, 30, ##ctx) \
4974 FN(skb_change_proto), \5538 FN(skb_change_proto, 31, ##ctx) \
4975 FN(skb_change_type), \5539 FN(skb_change_type, 32, ##ctx) \
4976 FN(skb_under_cgroup), \5540 FN(skb_under_cgroup, 33, ##ctx) \
4977 FN(get_hash_recalc), \5541 FN(get_hash_recalc, 34, ##ctx) \
4978 FN(get_current_task), \5542 FN(get_current_task, 35, ##ctx) \
4979 FN(probe_write_user), \5543 FN(probe_write_user, 36, ##ctx) \
4980 FN(current_task_under_cgroup), \5544 FN(current_task_under_cgroup, 37, ##ctx) \
4981 FN(skb_change_tail), \5545 FN(skb_change_tail, 38, ##ctx) \
4982 FN(skb_pull_data), \5546 FN(skb_pull_data, 39, ##ctx) \
4983 FN(csum_update), \5547 FN(csum_update, 40, ##ctx) \
4984 FN(set_hash_invalid), \5548 FN(set_hash_invalid, 41, ##ctx) \
4985 FN(get_numa_node_id), \5549 FN(get_numa_node_id, 42, ##ctx) \
4986 FN(skb_change_head), \5550 FN(skb_change_head, 43, ##ctx) \
4987 FN(xdp_adjust_head), \5551 FN(xdp_adjust_head, 44, ##ctx) \
4988 FN(probe_read_str), \5552 FN(probe_read_str, 45, ##ctx) \
4989 FN(get_socket_cookie), \5553 FN(get_socket_cookie, 46, ##ctx) \
4990 FN(get_socket_uid), \5554 FN(get_socket_uid, 47, ##ctx) \
4991 FN(set_hash), \5555 FN(set_hash, 48, ##ctx) \
4992 FN(setsockopt), \5556 FN(setsockopt, 49, ##ctx) \
4993 FN(skb_adjust_room), \5557 FN(skb_adjust_room, 50, ##ctx) \
4994 FN(redirect_map), \5558 FN(redirect_map, 51, ##ctx) \
4995 FN(sk_redirect_map), \5559 FN(sk_redirect_map, 52, ##ctx) \
4996 FN(sock_map_update), \5560 FN(sock_map_update, 53, ##ctx) \
4997 FN(xdp_adjust_meta), \5561 FN(xdp_adjust_meta, 54, ##ctx) \
4998 FN(perf_event_read_value), \5562 FN(perf_event_read_value, 55, ##ctx) \
4999 FN(perf_prog_read_value), \5563 FN(perf_prog_read_value, 56, ##ctx) \
5000 FN(getsockopt), \5564 FN(getsockopt, 57, ##ctx) \
5001 FN(override_return), \5565 FN(override_return, 58, ##ctx) \
5002 FN(sock_ops_cb_flags_set), \5566 FN(sock_ops_cb_flags_set, 59, ##ctx) \
5003 FN(msg_redirect_map), \5567 FN(msg_redirect_map, 60, ##ctx) \
5004 FN(msg_apply_bytes), \5568 FN(msg_apply_bytes, 61, ##ctx) \
5005 FN(msg_cork_bytes), \5569 FN(msg_cork_bytes, 62, ##ctx) \
5006 FN(msg_pull_data), \5570 FN(msg_pull_data, 63, ##ctx) \
5007 FN(bind), \5571 FN(bind, 64, ##ctx) \
5008 FN(xdp_adjust_tail), \5572 FN(xdp_adjust_tail, 65, ##ctx) \
5009 FN(skb_get_xfrm_state), \5573 FN(skb_get_xfrm_state, 66, ##ctx) \
5010 FN(get_stack), \5574 FN(get_stack, 67, ##ctx) \
5011 FN(skb_load_bytes_relative), \5575 FN(skb_load_bytes_relative, 68, ##ctx) \
5012 FN(fib_lookup), \5576 FN(fib_lookup, 69, ##ctx) \
5013 FN(sock_hash_update), \5577 FN(sock_hash_update, 70, ##ctx) \
5014 FN(msg_redirect_hash), \5578 FN(msg_redirect_hash, 71, ##ctx) \
5015 FN(sk_redirect_hash), \5579 FN(sk_redirect_hash, 72, ##ctx) \
5016 FN(lwt_push_encap), \5580 FN(lwt_push_encap, 73, ##ctx) \
5017 FN(lwt_seg6_store_bytes), \5581 FN(lwt_seg6_store_bytes, 74, ##ctx) \
5018 FN(lwt_seg6_adjust_srh), \5582 FN(lwt_seg6_adjust_srh, 75, ##ctx) \
5019 FN(lwt_seg6_action), \5583 FN(lwt_seg6_action, 76, ##ctx) \
5020 FN(rc_repeat), \5584 FN(rc_repeat, 77, ##ctx) \
5021 FN(rc_keydown), \5585 FN(rc_keydown, 78, ##ctx) \
5022 FN(skb_cgroup_id), \5586 FN(skb_cgroup_id, 79, ##ctx) \
5023 FN(get_current_cgroup_id), \5587 FN(get_current_cgroup_id, 80, ##ctx) \
5024 FN(get_local_storage), \5588 FN(get_local_storage, 81, ##ctx) \
5025 FN(sk_select_reuseport), \5589 FN(sk_select_reuseport, 82, ##ctx) \
5026 FN(skb_ancestor_cgroup_id), \5590 FN(skb_ancestor_cgroup_id, 83, ##ctx) \
5027 FN(sk_lookup_tcp), \5591 FN(sk_lookup_tcp, 84, ##ctx) \
5028 FN(sk_lookup_udp), \5592 FN(sk_lookup_udp, 85, ##ctx) \
5029 FN(sk_release), \5593 FN(sk_release, 86, ##ctx) \
5030 FN(map_push_elem), \5594 FN(map_push_elem, 87, ##ctx) \
5031 FN(map_pop_elem), \5595 FN(map_pop_elem, 88, ##ctx) \
5032 FN(map_peek_elem), \5596 FN(map_peek_elem, 89, ##ctx) \
5033 FN(msg_push_data), \5597 FN(msg_push_data, 90, ##ctx) \
5034 FN(msg_pop_data), \5598 FN(msg_pop_data, 91, ##ctx) \
5035 FN(rc_pointer_rel), \5599 FN(rc_pointer_rel, 92, ##ctx) \
5036 FN(spin_lock), \5600 FN(spin_lock, 93, ##ctx) \
5037 FN(spin_unlock), \5601 FN(spin_unlock, 94, ##ctx) \
5038 FN(sk_fullsock), \5602 FN(sk_fullsock, 95, ##ctx) \
5039 FN(tcp_sock), \5603 FN(tcp_sock, 96, ##ctx) \
5040 FN(skb_ecn_set_ce), \5604 FN(skb_ecn_set_ce, 97, ##ctx) \
5041 FN(get_listener_sock), \5605 FN(get_listener_sock, 98, ##ctx) \
5042 FN(skc_lookup_tcp), \5606 FN(skc_lookup_tcp, 99, ##ctx) \
5043 FN(tcp_check_syncookie), \5607 FN(tcp_check_syncookie, 100, ##ctx) \
5044 FN(sysctl_get_name), \5608 FN(sysctl_get_name, 101, ##ctx) \
5045 FN(sysctl_get_current_value), \5609 FN(sysctl_get_current_value, 102, ##ctx) \
5046 FN(sysctl_get_new_value), \5610 FN(sysctl_get_new_value, 103, ##ctx) \
5047 FN(sysctl_set_new_value), \5611 FN(sysctl_set_new_value, 104, ##ctx) \
5048 FN(strtol), \5612 FN(strtol, 105, ##ctx) \
5049 FN(strtoul), \5613 FN(strtoul, 106, ##ctx) \
5050 FN(sk_storage_get), \5614 FN(sk_storage_get, 107, ##ctx) \
5051 FN(sk_storage_delete), \5615 FN(sk_storage_delete, 108, ##ctx) \
5052 FN(send_signal), \5616 FN(send_signal, 109, ##ctx) \
5053 FN(tcp_gen_syncookie), \5617 FN(tcp_gen_syncookie, 110, ##ctx) \
5054 FN(skb_output), \5618 FN(skb_output, 111, ##ctx) \
5055 FN(probe_read_user), \5619 FN(probe_read_user, 112, ##ctx) \
5056 FN(probe_read_kernel), \5620 FN(probe_read_kernel, 113, ##ctx) \
5057 FN(probe_read_user_str), \5621 FN(probe_read_user_str, 114, ##ctx) \
5058 FN(probe_read_kernel_str), \5622 FN(probe_read_kernel_str, 115, ##ctx) \
5059 FN(tcp_send_ack), \5623 FN(tcp_send_ack, 116, ##ctx) \
5060 FN(send_signal_thread), \5624 FN(send_signal_thread, 117, ##ctx) \
5061 FN(jiffies64), \5625 FN(jiffies64, 118, ##ctx) \
5062 FN(read_branch_records), \5626 FN(read_branch_records, 119, ##ctx) \
5063 FN(get_ns_current_pid_tgid), \5627 FN(get_ns_current_pid_tgid, 120, ##ctx) \
5064 FN(xdp_output), \5628 FN(xdp_output, 121, ##ctx) \
5065 FN(get_netns_cookie), \5629 FN(get_netns_cookie, 122, ##ctx) \
5066 FN(get_current_ancestor_cgroup_id), \5630 FN(get_current_ancestor_cgroup_id, 123, ##ctx) \
5067 FN(sk_assign), \5631 FN(sk_assign, 124, ##ctx) \
5068 FN(ktime_get_boot_ns), \5632 FN(ktime_get_boot_ns, 125, ##ctx) \
5069 FN(seq_printf), \5633 FN(seq_printf, 126, ##ctx) \
5070 FN(seq_write), \5634 FN(seq_write, 127, ##ctx) \
5071 FN(sk_cgroup_id), \5635 FN(sk_cgroup_id, 128, ##ctx) \
5072 FN(sk_ancestor_cgroup_id), \5636 FN(sk_ancestor_cgroup_id, 129, ##ctx) \
5073 FN(ringbuf_output), \5637 FN(ringbuf_output, 130, ##ctx) \
5074 FN(ringbuf_reserve), \5638 FN(ringbuf_reserve, 131, ##ctx) \
5075 FN(ringbuf_submit), \5639 FN(ringbuf_submit, 132, ##ctx) \
5076 FN(ringbuf_discard), \5640 FN(ringbuf_discard, 133, ##ctx) \
5077 FN(ringbuf_query), \5641 FN(ringbuf_query, 134, ##ctx) \
5078 FN(csum_level), \5642 FN(csum_level, 135, ##ctx) \
5079 FN(skc_to_tcp6_sock), \5643 FN(skc_to_tcp6_sock, 136, ##ctx) \
5080 FN(skc_to_tcp_sock), \5644 FN(skc_to_tcp_sock, 137, ##ctx) \
5081 FN(skc_to_tcp_timewait_sock), \5645 FN(skc_to_tcp_timewait_sock, 138, ##ctx) \
5082 FN(skc_to_tcp_request_sock), \5646 FN(skc_to_tcp_request_sock, 139, ##ctx) \
5083 FN(skc_to_udp6_sock), \5647 FN(skc_to_udp6_sock, 140, ##ctx) \
5084 FN(get_task_stack), \5648 FN(get_task_stack, 141, ##ctx) \
5085 FN(load_hdr_opt), \5649 FN(load_hdr_opt, 142, ##ctx) \
5086 FN(store_hdr_opt), \5650 FN(store_hdr_opt, 143, ##ctx) \
5087 FN(reserve_hdr_opt), \5651 FN(reserve_hdr_opt, 144, ##ctx) \
5088 FN(inode_storage_get), \5652 FN(inode_storage_get, 145, ##ctx) \
5089 FN(inode_storage_delete), \5653 FN(inode_storage_delete, 146, ##ctx) \
5090 FN(d_path), \5654 FN(d_path, 147, ##ctx) \
5091 FN(copy_from_user), \5655 FN(copy_from_user, 148, ##ctx) \
5092 FN(snprintf_btf), \5656 FN(snprintf_btf, 149, ##ctx) \
5093 FN(seq_printf_btf), \5657 FN(seq_printf_btf, 150, ##ctx) \
5094 FN(skb_cgroup_classid), \5658 FN(skb_cgroup_classid, 151, ##ctx) \
5095 FN(redirect_neigh), \5659 FN(redirect_neigh, 152, ##ctx) \
5096 FN(per_cpu_ptr), \5660 FN(per_cpu_ptr, 153, ##ctx) \
5097 FN(this_cpu_ptr), \5661 FN(this_cpu_ptr, 154, ##ctx) \
5098 FN(redirect_peer), \5662 FN(redirect_peer, 155, ##ctx) \
5099 FN(task_storage_get), \5663 FN(task_storage_get, 156, ##ctx) \
5100 FN(task_storage_delete), \5664 FN(task_storage_delete, 157, ##ctx) \
5101 FN(get_current_task_btf), \5665 FN(get_current_task_btf, 158, ##ctx) \
5102 FN(bprm_opts_set), \5666 FN(bprm_opts_set, 159, ##ctx) \
5103 FN(ktime_get_coarse_ns), \5667 FN(ktime_get_coarse_ns, 160, ##ctx) \
5104 FN(ima_inode_hash), \5668 FN(ima_inode_hash, 161, ##ctx) \
5105 FN(sock_from_file), \5669 FN(sock_from_file, 162, ##ctx) \
5106 FN(check_mtu), \5670 FN(check_mtu, 163, ##ctx) \
5107 FN(for_each_map_elem), \5671 FN(for_each_map_elem, 164, ##ctx) \
5108 FN(snprintf), \5672 FN(snprintf, 165, ##ctx) \
5109 FN(sys_bpf), \5673 FN(sys_bpf, 166, ##ctx) \
5110 FN(btf_find_by_name_kind), \5674 FN(btf_find_by_name_kind, 167, ##ctx) \
5111 FN(sys_close), \5675 FN(sys_close, 168, ##ctx) \
5112 FN(timer_init), \5676 FN(timer_init, 169, ##ctx) \
5113 FN(timer_set_callback), \5677 FN(timer_set_callback, 170, ##ctx) \
5114 FN(timer_start), \5678 FN(timer_start, 171, ##ctx) \
5115 FN(timer_cancel), \5679 FN(timer_cancel, 172, ##ctx) \
5116 FN(get_func_ip), \5680 FN(get_func_ip, 173, ##ctx) \
5117 FN(get_attach_cookie), \5681 FN(get_attach_cookie, 174, ##ctx) \
5118 FN(task_pt_regs), \5682 FN(task_pt_regs, 175, ##ctx) \
5119 FN(get_branch_snapshot), \5683 FN(get_branch_snapshot, 176, ##ctx) \
5120 FN(trace_vprintk), \5684 FN(trace_vprintk, 177, ##ctx) \
5121 FN(skc_to_unix_sock), \5685 FN(skc_to_unix_sock, 178, ##ctx) \
5122 FN(kallsyms_lookup_name), \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) \
5123 /* */5719 /* */
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
5125/* integer value in 'imm' field of BPF_CALL instruction selects which helper5727/* integer value in 'imm' field of BPF_CALL instruction selects which helper
5126 * function eBPF program intends to call5728 * function eBPF program intends to call
5127 */5729 */
5128#define __BPF_ENUM_FN(x) BPF_FUNC_ ## x5730#define __BPF_ENUM_FN(x, y) BPF_FUNC_ ## x = y,
5129enum bpf_func_id {5731enum bpf_func_id {
5130 __BPF_FUNC_MAPPER(__BPF_ENUM_FN)5732 ___BPF_FUNC_MAPPER(__BPF_ENUM_FN)
5131 __BPF_FUNC_MAX_ID,5733 __BPF_FUNC_MAX_ID,
5132};5734};
5133#undef __BPF_ENUM_FN5735#undef __BPF_ENUM_FN
...@@ -5180,6 +5782,12 @@ enum {...@@ -5180,6 +5782,12 @@ enum {
5180 BPF_F_ZERO_CSUM_TX = (1ULL << 1),5782 BPF_F_ZERO_CSUM_TX = (1ULL << 1),
5181 BPF_F_DONT_FRAGMENT = (1ULL << 2),5783 BPF_F_DONT_FRAGMENT = (1ULL << 2),
5182 BPF_F_SEQ_NUMBER = (1ULL << 3),5784 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),
5183};5791};
51845792
5185/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and5793/* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and
...@@ -5214,6 +5822,8 @@ enum {...@@ -5214,6 +5822,8 @@ enum {
5214 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),5822 BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4),
5215 BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),5823 BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5),
5216 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = (1ULL << 6),5824 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),
5217};5827};
52185828
5219enum {5829enum {
...@@ -5309,6 +5919,15 @@ union { \...@@ -5309,6 +5919,15 @@ union { \
5309 __u64 :64; \5919 __u64 :64; \
5310} __attribute__((aligned(8)))5920} __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
5312/* user accessible mirror of in-kernel sk_buff.5931/* user accessible mirror of in-kernel sk_buff.
5313 * new fields can only be added to the end of this structure5932 * new fields can only be added to the end of this structure
5314 */5933 */
...@@ -5349,7 +5968,8 @@ struct __sk_buff {...@@ -5349,7 +5968,8 @@ struct __sk_buff {
5349 __u32 gso_segs;5968 __u32 gso_segs;
5350 __bpf_md_ptr(struct bpf_sock *, sk);5969 __bpf_md_ptr(struct bpf_sock *, sk);
5351 __u32 gso_size;5970 __u32 gso_size;
5352 __u32 :32; /* Padding, future use. */5971 __u8 tstamp_type;
5972 __u32 :24; /* Padding, future use. */
5353 __u64 hwtstamp;5973 __u64 hwtstamp;
5354};5974};
53555975
...@@ -5361,8 +5981,15 @@ struct bpf_tunnel_key {...@@ -5361,8 +5981,15 @@ struct bpf_tunnel_key {
5361 };5981 };
5362 __u8 tunnel_tos;5982 __u8 tunnel_tos;
5363 __u8 tunnel_ttl;5983 __u8 tunnel_ttl;
5364 __u16 tunnel_ext; /* Padding, future use. */5984 union {
5985 __u16 tunnel_ext; /* compat */
5986 __be16 tunnel_flags;
5987 };
5365 __u32 tunnel_label;5988 __u32 tunnel_label;
5989 union {
5990 __u32 local_ipv4;
5991 __u32 local_ipv6[4];
5992 };
5366};5993};
53675994
5368/* user accessible mirror of in-kernel xfrm_state.5995/* user accessible mirror of in-kernel xfrm_state.
...@@ -5401,6 +6028,11 @@ enum bpf_ret_code {...@@ -5401,6 +6028,11 @@ enum bpf_ret_code {
5401 * represented by BPF_REDIRECT above).6028 * represented by BPF_REDIRECT above).
5402 */6029 */
5403 BPF_LWT_REROUTE = 128,6030 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,
5404};6036};
54056037
5406struct bpf_sock {6038struct bpf_sock {
...@@ -5414,7 +6046,8 @@ struct bpf_sock {...@@ -5414,7 +6046,8 @@ struct bpf_sock {
5414 __u32 src_ip4;6046 __u32 src_ip4;
5415 __u32 src_ip6[4];6047 __u32 src_ip6[4];
5416 __u32 src_port; /* host byte order */6048 __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 */
5418 __u32 dst_ip4;6051 __u32 dst_ip4;
5419 __u32 dst_ip6[4];6052 __u32 dst_ip6[4];
5420 __u32 state;6053 __u32 state;
...@@ -5645,6 +6278,8 @@ struct bpf_prog_info {...@@ -5645,6 +6278,8 @@ struct bpf_prog_info {
5645 __u64 run_cnt;6278 __u64 run_cnt;
5646 __u64 recursion_misses;6279 __u64 recursion_misses;
5647 __u32 verified_insns;6280 __u32 verified_insns;
6281 __u32 attach_btf_obj_id;
6282 __u32 attach_btf_id;
5648} __attribute__((aligned(8)));6283} __attribute__((aligned(8)));
56496284
5650struct bpf_map_info {6285struct bpf_map_info {
...@@ -5696,11 +6331,26 @@ struct bpf_link_info {...@@ -5696,11 +6331,26 @@ struct bpf_link_info {
5696 struct {6331 struct {
5697 __aligned_u64 target_name; /* in/out: target_name buffer ptr */6332 __aligned_u64 target_name; /* in/out: target_name buffer ptr */
5698 __u32 target_name_len; /* in/out: target_name buffer len */6333 __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 */
5699 union {6339 union {
5700 struct {6340 struct {
5701 __u32 map_id;6341 __u32 map_id;
5702 } map;6342 } map;
5703 };6343 };
6344 union {
6345 struct {
6346 __u64 cgroup_id;
6347 __u32 order;
6348 } cgroup;
6349 struct {
6350 __u32 tid;
6351 __u32 pid;
6352 } task;
6353 };
5704 } iter;6354 } iter;
5705 struct {6355 struct {
5706 __u32 netns_ino;6356 __u32 netns_ino;
...@@ -5819,6 +6469,7 @@ struct bpf_sock_ops {...@@ -5819,6 +6469,7 @@ struct bpf_sock_ops {
5819 * the outgoing header has not6469 * the outgoing header has not
5820 * been written yet.6470 * been written yet.
5821 */6471 */
6472 __u64 skb_hwtstamp;
5822};6473};
58236474
5824/* Definitions for bpf_sock_ops_cb_flags */6475/* Definitions for bpf_sock_ops_cb_flags */
...@@ -6104,6 +6755,7 @@ struct bpf_raw_tracepoint_args {...@@ -6104,6 +6755,7 @@ struct bpf_raw_tracepoint_args {
6104enum {6755enum {
6105 BPF_FIB_LOOKUP_DIRECT = (1U << 0),6756 BPF_FIB_LOOKUP_DIRECT = (1U << 0),
6106 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),6757 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
6758 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
6107};6759};
61086760
6109enum {6761enum {
...@@ -6256,6 +6908,32 @@ struct bpf_timer {...@@ -6256,6 +6908,32 @@ struct bpf_timer {
6256 __u64 :64;6908 __u64 :64;
6257} __attribute__((aligned(8)));6909} __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
6259struct bpf_sysctl {6937struct bpf_sysctl {
6260 __u32 write; /* Sysctl is being read (= 0) or written (= 1).6938 __u32 write; /* Sysctl is being read (= 0) or written (= 1).
6261 * Allows 1,2,4-byte read, but no write.6939 * Allows 1,2,4-byte read, but no write.
...@@ -6292,10 +6970,12 @@ struct bpf_sk_lookup {...@@ -6292,10 +6970,12 @@ struct bpf_sk_lookup {
6292 __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */6970 __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */
6293 __u32 remote_ip4; /* Network byte order */6971 __u32 remote_ip4; /* Network byte order */
6294 __u32 remote_ip6[4]; /* Network byte order */6972 __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 */
6296 __u32 local_ip4; /* Network byte order */6975 __u32 local_ip4; /* Network byte order */
6297 __u32 local_ip6[4]; /* Network byte order */6976 __u32 local_ip6[4]; /* Network byte order */
6298 __u32 local_port; /* Host byte order */6977 __u32 local_port; /* Host byte order */
6978 __u32 ingress_ifindex; /* The arriving interface. Determined by inet_iif. */
6299};6979};
63006980
6301/*6981/*
...@@ -6328,4 +7008,79 @@ enum {...@@ -6328,4 +7008,79 @@ enum {
6328 BTF_F_ZERO = (1ULL << 3),7008 BTF_F_ZERO = (1ULL << 3),
6329};7009};
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
6331#endif /* __LINUX_BPF_H__ */7086#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 {...@@ -33,17 +33,17 @@ struct btf_type {
33 /* "info" bits arrangement33 /* "info" bits arrangement
34 * bits 0-15: vlen (e.g. # of struct's members)34 * bits 0-15: vlen (e.g. # of struct's members)
35 * bits 16-23: unused35 * bits 16-23: unused
36 * bits 24-27: kind (e.g. int, ptr, array...etc)36 * bits 24-28: kind (e.g. int, ptr, array...etc)
37 * bits 28-30: unused37 * bits 29-30: unused
38 * bit 31: kind_flag, currently used by38 * bit 31: kind_flag, currently used by
39 * struct, union and fwd39 * struct, union, enum, fwd and enum64
40 */40 */
41 __u32 info;41 __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.
43 * "size" tells the size of the type it is describing.43 * "size" tells the size of the type it is describing.
44 *44 *
45 * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,45 * "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.
47 * "type" is a type_id referring to another type.47 * "type" is a type_id referring to another type.
48 */48 */
49 union {49 union {
...@@ -63,7 +63,7 @@ enum {...@@ -63,7 +63,7 @@ enum {
63 BTF_KIND_ARRAY = 3, /* Array */63 BTF_KIND_ARRAY = 3, /* Array */
64 BTF_KIND_STRUCT = 4, /* Struct */64 BTF_KIND_STRUCT = 4, /* Struct */
65 BTF_KIND_UNION = 5, /* Union */65 BTF_KIND_UNION = 5, /* Union */
66 BTF_KIND_ENUM = 6, /* Enumeration */66 BTF_KIND_ENUM = 6, /* Enumeration up to 32-bit values */
67 BTF_KIND_FWD = 7, /* Forward */67 BTF_KIND_FWD = 7, /* Forward */
68 BTF_KIND_TYPEDEF = 8, /* Typedef */68 BTF_KIND_TYPEDEF = 8, /* Typedef */
69 BTF_KIND_VOLATILE = 9, /* Volatile */69 BTF_KIND_VOLATILE = 9, /* Volatile */
...@@ -75,6 +75,8 @@ enum {...@@ -75,6 +75,8 @@ enum {
75 BTF_KIND_DATASEC = 15, /* Section */75 BTF_KIND_DATASEC = 15, /* Section */
76 BTF_KIND_FLOAT = 16, /* Floating point */76 BTF_KIND_FLOAT = 16, /* Floating point */
77 BTF_KIND_DECL_TAG = 17, /* Decl Tag */77 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
79 NR_BTF_KINDS,81 NR_BTF_KINDS,
80 BTF_KIND_MAX = NR_BTF_KINDS - 1,82 BTF_KIND_MAX = NR_BTF_KINDS - 1,
...@@ -185,4 +187,14 @@ struct btf_decl_tag {...@@ -185,4 +187,14 @@ struct btf_decl_tag {
185 __s32 component_idx;187 __s32 component_idx;
186};188};
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
188#endif /* __LINUX_BTF_H__ */200#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 @@...@@ -19,8 +19,14 @@
1919
20#ifndef _LINUX_BTRFS_H20#ifndef _LINUX_BTRFS_H
21#define _LINUX_BTRFS_H21#define _LINUX_BTRFS_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
22#include <linux/types.h>27#include <linux/types.h>
23#include <linux/ioctl.h>28#include <linux/ioctl.h>
29#include <linux/fs.h>
2430
25#define BTRFS_IOCTL_MAGIC 0x9431#define BTRFS_IOCTL_MAGIC 0x94
26#define BTRFS_VOL_NAME_MAX 25532#define BTRFS_VOL_NAME_MAX 255
...@@ -91,7 +97,7 @@ struct btrfs_qgroup_inherit {...@@ -91,7 +97,7 @@ struct btrfs_qgroup_inherit {
91 __u64 num_ref_copies;97 __u64 num_ref_copies;
92 __u64 num_excl_copies;98 __u64 num_excl_copies;
93 struct btrfs_qgroup_limit lim;99 struct btrfs_qgroup_limit lim;
94 __u64 qgroups[0];100 __u64 qgroups[];
95};101};
96102
97struct btrfs_ioctl_qgroup_limit_args {103struct btrfs_ioctl_qgroup_limit_args {
...@@ -179,6 +185,7 @@ struct btrfs_scrub_progress {...@@ -179,6 +185,7 @@ struct btrfs_scrub_progress {
179};185};
180186
181#define BTRFS_SCRUB_READONLY 1187#define BTRFS_SCRUB_READONLY 1
188#define BTRFS_SCRUB_SUPPORTED_FLAGS (BTRFS_SCRUB_READONLY)
182struct btrfs_ioctl_scrub_args {189struct btrfs_ioctl_scrub_args {
183 __u64 devid; /* in */190 __u64 devid; /* in */
184 __u64 start; /* in */191 __u64 start; /* in */
...@@ -237,7 +244,17 @@ struct btrfs_ioctl_dev_info_args {...@@ -237,7 +244,17 @@ struct btrfs_ioctl_dev_info_args {
237 __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */244 __u8 uuid[BTRFS_UUID_SIZE]; /* in/out */
238 __u64 bytes_used; /* out */245 __u64 bytes_used; /* out */
239 __u64 total_bytes; /* out */246 __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 */
241 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */258 __u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
242};259};
243260
...@@ -288,6 +305,12 @@ struct btrfs_ioctl_fs_info_args {...@@ -288,6 +305,12 @@ struct btrfs_ioctl_fs_info_args {
288#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)305#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
289#define BTRFS_FEATURE_COMPAT_RO_VERITY (1ULL << 2)306#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
291#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)314#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
292#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)315#define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
293#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)316#define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
...@@ -307,6 +330,7 @@ struct btrfs_ioctl_fs_info_args {...@@ -307,6 +330,7 @@ struct btrfs_ioctl_fs_info_args {
307#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)330#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
308#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)331#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
309#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)332#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
333#define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
310334
311struct btrfs_ioctl_feature_flags {335struct btrfs_ioctl_feature_flags {
312 __u64 compat_flags;336 __u64 compat_flags;
...@@ -324,6 +348,12 @@ struct btrfs_ioctl_feature_flags {...@@ -324,6 +348,12 @@ struct btrfs_ioctl_feature_flags {
324 */348 */
325struct btrfs_balance_args {349struct btrfs_balance_args {
326 __u64 profiles;350 __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 */
327 union {357 union {
328 __u64 usage;358 __u64 usage;
329 struct {359 struct {
...@@ -540,7 +570,7 @@ struct btrfs_ioctl_search_header {...@@ -540,7 +570,7 @@ struct btrfs_ioctl_search_header {
540 __u64 offset;570 __u64 offset;
541 __u32 type;571 __u32 type;
542 __u32 len;572 __u32 len;
543};573} __attribute__ ((__may_alias__));
544574
545#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))575#define BTRFS_SEARCH_ARGS_BUFSIZE (4096 - sizeof(struct btrfs_ioctl_search_key))
546/*576/*
...@@ -553,18 +583,23 @@ struct btrfs_ioctl_search_args {...@@ -553,18 +583,23 @@ struct btrfs_ioctl_search_args {
553 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];583 char buf[BTRFS_SEARCH_ARGS_BUFSIZE];
554};584};
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 */
556struct btrfs_ioctl_search_args_v2 {590struct btrfs_ioctl_search_args_v2 {
557 struct btrfs_ioctl_search_key key; /* in/out - search parameters */591 struct btrfs_ioctl_search_key key; /* in/out - search parameters */
558 __u64 buf_size; /* in - size of buffer592 __u64 buf_size; /* in - size of buffer
559 * out - on EOVERFLOW: needed size593 * out - on EOVERFLOW: needed size
560 * to store item */594 * to store item */
561 __u64 buf[0]; /* out - found items */595 __u64 buf[]; /* out - found items */
562};596};
563597
598/* With a @src_length of zero, the range from @src_offset->EOF is cloned! */
564struct btrfs_ioctl_clone_range_args {599struct btrfs_ioctl_clone_range_args {
565 __s64 src_fd;600 __s64 src_fd;
566 __u64 src_offset, src_length;601 __u64 src_offset, src_length;
567 __u64 dest_offset;602 __u64 dest_offset;
568};603};
569604
570/*605/*
...@@ -629,7 +664,7 @@ struct btrfs_ioctl_same_args {...@@ -629,7 +664,7 @@ struct btrfs_ioctl_same_args {
629 __u16 dest_count; /* in - total elements in info array */664 __u16 dest_count; /* in - total elements in info array */
630 __u16 reserved1;665 __u16 reserved1;
631 __u32 reserved2;666 __u32 reserved2;
632 struct btrfs_ioctl_same_extent_info info[0];667 struct btrfs_ioctl_same_extent_info info[];
633};668};
634669
635struct btrfs_ioctl_space_info {670struct btrfs_ioctl_space_info {
...@@ -641,7 +676,7 @@ struct btrfs_ioctl_space_info {...@@ -641,7 +676,7 @@ struct btrfs_ioctl_space_info {
641struct btrfs_ioctl_space_args {676struct btrfs_ioctl_space_args {
642 __u64 space_slots;677 __u64 space_slots;
643 __u64 total_spaces;678 __u64 total_spaces;
644 struct btrfs_ioctl_space_info spaces[0];679 struct btrfs_ioctl_space_info spaces[];
645};680};
646681
647struct btrfs_data_container {682struct btrfs_data_container {
...@@ -649,7 +684,7 @@ struct btrfs_data_container {...@@ -649,7 +684,7 @@ struct btrfs_data_container {
649 __u32 bytes_missing; /* out -- additional bytes needed for result */684 __u32 bytes_missing; /* out -- additional bytes needed for result */
650 __u32 elem_cnt; /* out */685 __u32 elem_cnt; /* out */
651 __u32 elem_missed; /* out */686 __u32 elem_missed; /* out */
652 __u64 val[0]; /* out */687 __u64 val[]; /* out */
653};688};
654689
655struct btrfs_ioctl_ino_path_args {690struct btrfs_ioctl_ino_path_args {
...@@ -668,8 +703,11 @@ struct btrfs_ioctl_logical_ino_args {...@@ -668,8 +703,11 @@ struct btrfs_ioctl_logical_ino_args {
668 /* struct btrfs_data_container *inodes; out */703 /* struct btrfs_data_container *inodes; out */
669 __u64 inodes;704 __u64 inodes;
670};705};
671/* Return every ref to the extent, not just those containing logical block.706
672 * Requires logical == extent bytenr. */707/*
708 * Return every ref to the extent, not just those containing logical block.
709 * Requires logical == extent bytenr.
710 */
673#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)711#define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
674712
675enum btrfs_dev_stat_values {713enum btrfs_dev_stat_values {
...@@ -774,11 +812,19 @@ struct btrfs_ioctl_received_subvol_args {...@@ -774,11 +812,19 @@ struct btrfs_ioctl_received_subvol_args {
774 */812 */
775#define BTRFS_SEND_FLAG_VERSION 0x8813#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
777#define BTRFS_SEND_FLAG_MASK \822#define BTRFS_SEND_FLAG_MASK \
778 (BTRFS_SEND_FLAG_NO_FILE_DATA | \823 (BTRFS_SEND_FLAG_NO_FILE_DATA | \
779 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \824 BTRFS_SEND_FLAG_OMIT_STREAM_HEADER | \
780 BTRFS_SEND_FLAG_OMIT_END_CMD | \825 BTRFS_SEND_FLAG_OMIT_END_CMD | \
781 BTRFS_SEND_FLAG_VERSION)826 BTRFS_SEND_FLAG_VERSION | \
827 BTRFS_SEND_FLAG_COMPRESSED)
782828
783struct btrfs_ioctl_send_args {829struct btrfs_ioctl_send_args {
784 __s64 send_fd; /* in */830 __s64 send_fd; /* in */
...@@ -866,6 +912,134 @@ struct btrfs_ioctl_get_subvol_rootref_args {...@@ -866,6 +912,134 @@ struct btrfs_ioctl_get_subvol_rootref_args {
866 __u8 align[7];912 __u8 align[7];
867};913};
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
869/* Error codes as returned by the kernel */1043/* Error codes as returned by the kernel */
870enum btrfs_err_code {1044enum btrfs_err_code {
871 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,1045 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET = 1,
...@@ -994,5 +1168,13 @@ enum btrfs_err_code {...@@ -994,5 +1168,13 @@ enum btrfs_err_code {
994 struct btrfs_ioctl_ino_lookup_user_args)1168 struct btrfs_ioctl_ino_lookup_user_args)
995#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \1169#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
996 struct btrfs_ioctl_vol_args_v2)1170 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
998#endif /* _LINUX_BTRFS_H */1180#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 @@...@@ -6,6 +6,23 @@
6#include <linux/types.h>6#include <linux/types.h>
7#include <stddef.h>7#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
9/*26/*
10 * This header contains the structure definitions and constants used27 * This header contains the structure definitions and constants used
11 * by file system objects that can be retrieved using28 * by file system objects that can be retrieved using
...@@ -49,6 +66,9 @@...@@ -49,6 +66,9 @@
49/* tracks free space in block groups. */66/* tracks free space in block groups. */
50#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL67#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
52/* device stats in the device tree */72/* device stats in the device tree */
53#define BTRFS_DEV_STATS_OBJECTID 0ULL73#define BTRFS_DEV_STATS_OBJECTID 0ULL
5474
...@@ -142,7 +162,9 @@...@@ -142,7 +162,9 @@
142162
143/*163/*
144 * dir items are the name -> inode pointers in a directory. There is one164 * 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.
146 */168 */
147#define BTRFS_DIR_LOG_ITEM_KEY 60169#define BTRFS_DIR_LOG_ITEM_KEY 60
148#define BTRFS_DIR_LOG_INDEX_KEY 72170#define BTRFS_DIR_LOG_INDEX_KEY 72
...@@ -350,6 +372,50 @@ enum btrfs_csum_type {...@@ -350,6 +372,50 @@ enum btrfs_csum_type {
350#define BTRFS_FT_SYMLINK 7372#define BTRFS_FT_SYMLINK 7
351#define BTRFS_FT_XATTR 8373#define BTRFS_FT_XATTR 8
352#define BTRFS_FT_MAX 9374#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
354/*420/*
355 * The key defines the order in the tree, and so it also defines (optimal)421 * The key defines the order in the tree, and so it also defines (optimal)
...@@ -380,6 +446,109 @@ struct btrfs_key {...@@ -380,6 +446,109 @@ struct btrfs_key {
380 __u64 offset;446 __u64 offset;
381} __attribute__ ((__packed__));447} __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
383struct btrfs_dev_item {552struct btrfs_dev_item {
384 /* the internal btrfs device id */553 /* the internal btrfs device id */
385 __le64 devid;554 __le64 devid;
...@@ -463,6 +632,69 @@ struct btrfs_chunk {...@@ -463,6 +632,69 @@ struct btrfs_chunk {
463 /* additional stripes go here */632 /* additional stripes go here */
464} __attribute__ ((__packed__));633} __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
466#define BTRFS_FREE_SPACE_EXTENT 1698#define BTRFS_FREE_SPACE_EXTENT 1
467#define BTRFS_FREE_SPACE_BITMAP 2699#define BTRFS_FREE_SPACE_BITMAP 2
468700
...@@ -517,6 +749,14 @@ struct btrfs_extent_item_v0 {...@@ -517,6 +749,14 @@ struct btrfs_extent_item_v0 {
517/* use full backrefs for extent pointers in the block */749/* use full backrefs for extent pointers in the block */
518#define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8)750#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
520/*760/*
521 * this flag is only used internally by scrub and may be changed at any time761 * this flag is only used internally by scrub and may be changed at any time
522 * it is only declared here to avoid collisions762 * it is only declared here to avoid collisions
...@@ -566,7 +806,7 @@ struct btrfs_inode_extref {...@@ -566,7 +806,7 @@ struct btrfs_inode_extref {
566 __le64 parent_objectid;806 __le64 parent_objectid;
567 __le64 index;807 __le64 index;
568 __le16 name_len;808 __le16 name_len;
569 __u8 name[0];809 __u8 name[];
570 /* name goes here */810 /* name goes here */
571} __attribute__ ((__packed__));811} __attribute__ ((__packed__));
572812
...@@ -871,19 +1111,6 @@ struct btrfs_dev_replace_item {...@@ -871,19 +1111,6 @@ struct btrfs_dev_replace_item {
871#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \1111#define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
872 BTRFS_SPACE_INFO_GLOBAL_RSV)1112 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
887#define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \1114#define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \
888 BTRFS_BLOCK_GROUP_SYSTEM | \1115 BTRFS_BLOCK_GROUP_SYSTEM | \
889 BTRFS_BLOCK_GROUP_METADATA)1116 BTRFS_BLOCK_GROUP_METADATA)
...@@ -969,6 +1196,10 @@ static __inline__ __u16 btrfs_qgroup_level(__u64 qgroupid)...@@ -969,6 +1196,10 @@ static __inline__ __u16 btrfs_qgroup_level(__u64 qgroupid)
969 */1196 */
970#define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)1197#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
972#define BTRFS_QGROUP_STATUS_VERSION 11203#define BTRFS_QGROUP_STATUS_VERSION 1
9731204
974struct btrfs_qgroup_status_item {1205struct 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 @@...@@ -48,6 +48,7 @@
4848
49#include <linux/types.h>49#include <linux/types.h>
50#include <linux/socket.h>50#include <linux/socket.h>
51#include <linux/stddef.h> /* for offsetof */
5152
52/* controller area network (CAN) kernel definitions */53/* controller area network (CAN) kernel definitions */
5354
...@@ -60,6 +61,7 @@...@@ -60,6 +61,7 @@
60#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */61#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
61#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */62#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
62#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */63#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
64#define CANXL_PRIO_MASK CAN_SFF_MASK /* 11 bit priority mask */
6365
64/*66/*
65 * Controller Area Network Identifier structure67 * Controller Area Network Identifier structure
...@@ -73,6 +75,7 @@ typedef __u32 canid_t;...@@ -73,6 +75,7 @@ typedef __u32 canid_t;
7375
74#define CAN_SFF_ID_BITS 1176#define CAN_SFF_ID_BITS 11
75#define CAN_EFF_ID_BITS 2977#define CAN_EFF_ID_BITS 29
78#define CANXL_PRIO_BITS CAN_SFF_ID_BITS
7679
77/*80/*
78 * Controller Area Network Error Message Frame Mask structure81 * Controller Area Network Error Message Frame Mask structure
...@@ -91,6 +94,16 @@ typedef __u32 can_err_mask_t;...@@ -91,6 +94,16 @@ typedef __u32 can_err_mask_t;
91#define CANFD_MAX_DLC 1594#define CANFD_MAX_DLC 15
92#define CANFD_MAX_DLEN 6495#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
94/**107/**
95 * struct can_frame - Classical CAN frame structure (aka CAN 2.0B)108 * struct can_frame - Classical CAN frame structure (aka CAN 2.0B)
96 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition109 * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
...@@ -141,8 +154,8 @@ struct can_frame {...@@ -141,8 +154,8 @@ struct can_frame {
141 * When this is done the former differentiation via CAN_MTU / CANFD_MTU gets154 * When this is done the former differentiation via CAN_MTU / CANFD_MTU gets
142 * lost. CANFD_FDF allows programmers to mark CAN FD frames in the case of155 * lost. CANFD_FDF allows programmers to mark CAN FD frames in the case of
143 * using struct canfd_frame for mixed CAN / CAN FD content (dual use).156 * 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 of157 * Since the introduction of CAN XL the CANFD_FDF flag is set in all CAN FD
145 * struct canfd_frame therefore the CANFD_FDF flag is disregarded by Linux.158 * frame structures provided by the CAN subsystem of the Linux kernel.
146 */159 */
147#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */160#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
148#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */161#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
...@@ -166,8 +179,46 @@ struct canfd_frame {...@@ -166,8 +179,46 @@ struct canfd_frame {
166 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));179 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
167};180};
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
169#define CAN_MTU (sizeof(struct can_frame))216#define CAN_MTU (sizeof(struct can_frame))
170#define CANFD_MTU (sizeof(struct canfd_frame))217#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
172/* particular protocols of the protocol family PF_CAN */223/* particular protocols of the protocol family PF_CAN */
173#define CAN_RAW 1 /* RAW sockets */224#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 {...@@ -71,7 +71,7 @@ struct bcm_msg_head {
71 struct bcm_timeval ival1, ival2;71 struct bcm_timeval ival1, ival2;
72 canid_t can_id;72 canid_t can_id;
73 __u32 nframes;73 __u32 nframes;
74 struct can_frame frames[0];74 struct can_frame frames[];
75};75};
7676
77enum {77enum {
lib/libc/include/any-linux-any/linux/can/error.h+19-1
...@@ -57,6 +57,8 @@...@@ -57,6 +57,8 @@
57#define CAN_ERR_BUSOFF 0x00000040U /* bus off */57#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
58#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */58#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
59#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */59#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
61/* arbitration lost in bit ... / data[0] */63/* arbitration lost in bit ... / data[0] */
62#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */64#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
...@@ -120,6 +122,22 @@...@@ -120,6 +122,22 @@
120#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */122#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
121#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */123#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
125#endif /* _CAN_ERROR_H */143#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 {...@@ -124,33 +124,30 @@ struct can_isotp_ll_options {
124124
125/* flags for isotp behaviour */125/* flags for isotp behaviour */
126126
127#define CAN_ISOTP_LISTEN_MODE 0x001 /* listen only (do not send FC) */127#define CAN_ISOTP_LISTEN_MODE 0x0001 /* listen only (do not send FC) */
128#define CAN_ISOTP_EXTEND_ADDR 0x002 /* enable extended addressing */128#define CAN_ISOTP_EXTEND_ADDR 0x0002 /* enable extended addressing */
129#define CAN_ISOTP_TX_PADDING 0x004 /* enable CAN frame padding tx path */129#define CAN_ISOTP_TX_PADDING 0x0004 /* enable CAN frame padding tx path */
130#define CAN_ISOTP_RX_PADDING 0x008 /* enable CAN frame padding rx path */130#define CAN_ISOTP_RX_PADDING 0x0008 /* enable CAN frame padding rx path */
131#define CAN_ISOTP_CHK_PAD_LEN 0x010 /* check received CAN frame padding */131#define CAN_ISOTP_CHK_PAD_LEN 0x0010 /* check received CAN frame padding */
132#define CAN_ISOTP_CHK_PAD_DATA 0x020 /* check received CAN frame padding */132#define CAN_ISOTP_CHK_PAD_DATA 0x0020 /* check received CAN frame padding */
133#define CAN_ISOTP_HALF_DUPLEX 0x040 /* half duplex error state handling */133#define CAN_ISOTP_HALF_DUPLEX 0x0040 /* half duplex error state handling */
134#define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */134#define CAN_ISOTP_FORCE_TXSTMIN 0x0080 /* ignore stmin from received FC */
135#define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */135#define CAN_ISOTP_FORCE_RXSTMIN 0x0100 /* ignore CFs depending on rx stmin */
136#define CAN_ISOTP_RX_EXT_ADDR 0x200 /* different rx extended addressing */136#define CAN_ISOTP_RX_EXT_ADDR 0x0200 /* different rx extended addressing */
137#define CAN_ISOTP_WAIT_TX_DONE 0x400 /* wait for tx completion */137#define CAN_ISOTP_WAIT_TX_DONE 0x0400 /* wait for tx completion */
138#define CAN_ISOTP_SF_BROADCAST 0x800 /* 1-to-N functional addressing */138#define CAN_ISOTP_SF_BROADCAST 0x0800 /* 1-to-N functional addressing */
139139#define CAN_ISOTP_CF_BROADCAST 0x1000 /* 1-to-N transmission w/o FC */
140/* default values */140
141/* protocol machine default values */
141142
142#define CAN_ISOTP_DEFAULT_FLAGS 0143#define CAN_ISOTP_DEFAULT_FLAGS 0
143#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00144#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00
144#define CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */145#define CAN_ISOTP_DEFAULT_PAD_CONTENT 0xCC /* prevent bit-stuffing */
145#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0146#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 50000 /* 50 micro seconds */
146#define CAN_ISOTP_DEFAULT_RECV_BS 0147#define CAN_ISOTP_DEFAULT_RECV_BS 0
147#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00148#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00
148#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0149#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
154/*151/*
155 * Remark on CAN_ISOTP_DEFAULT_RECV_* values:152 * Remark on CAN_ISOTP_DEFAULT_RECV_* values:
156 *153 *
...@@ -162,4 +159,24 @@ struct can_isotp_ll_options {...@@ -162,4 +159,24 @@ struct can_isotp_ll_options {
162 * consistency and copied directly into the flow control (FC) frame.159 * consistency and copied directly into the flow control (FC) frame.
163 */160 */
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
165#endif /* !_UAPI_CAN_ISOTP_H */182#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 {...@@ -137,6 +137,7 @@ enum {
137 IFLA_CAN_DATA_BITRATE_CONST,137 IFLA_CAN_DATA_BITRATE_CONST,
138 IFLA_CAN_BITRATE_MAX,138 IFLA_CAN_BITRATE_MAX,
139 IFLA_CAN_TDC,139 IFLA_CAN_TDC,
140 IFLA_CAN_CTRLMODE_EXT,
140141
141 /* add new constants above here */142 /* add new constants above here */
142 __IFLA_CAN_MAX,143 __IFLA_CAN_MAX,
...@@ -166,6 +167,18 @@ enum {...@@ -166,6 +167,18 @@ enum {
166 IFLA_CAN_TDC_MAX = __IFLA_CAN_TDC - 1167 IFLA_CAN_TDC_MAX = __IFLA_CAN_TDC - 1
167};168};
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
169/* u16 termination range: 1..65535 Ohms */182/* u16 termination range: 1..65535 Ohms */
170#define CAN_TERMINATION_DISABLED 0183#define CAN_TERMINATION_DISABLED 0
171184
lib/libc/include/any-linux-any/linux/can/raw.h+1
...@@ -62,6 +62,7 @@ enum {...@@ -62,6 +62,7 @@ enum {
62 CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */62 CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
63 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */63 CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
64 CAN_RAW_JOIN_FILTERS, /* all filters must match to trigger */64 CAN_RAW_JOIN_FILTERS, /* all filters must match to trigger */
65 CAN_RAW_XL_FRAMES, /* allow CAN XL frames (default:off) */
65};66};
6667
67#endif /* !_UAPI_CAN_RAW_H */68#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 {...@@ -424,7 +424,7 @@ struct vfs_ns_cap_data {
424 */424 */
425425
426#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */426#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
430#endif /* _LINUX_CAPABILITY_H */430#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 @@...@@ -103,7 +103,7 @@
103#define CDROMREADALL 0x5318 /* read all 2646 bytes */103#define CDROMREADALL 0x5318 /* read all 2646 bytes */
104104
105/* 105/*
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
107 * drive spindown time. They should be implemented in the107 * drive spindown time. They should be implemented in the
108 * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,108 * Uniform driver, via generic packet commands, GPCMD_MODE_SELECT_10,
109 * GPCMD_MODE_SENSE_10 and the GPMODE_POWER_PAGE...109 * 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...@@ -1568,6 +1568,20 @@ static __inline__ void cec_ops_request_short_audio_descriptor(const struct cec_m
1568 }1568 }
1569}1569}
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
1572/* Audio Rate Control Feature */1586/* Audio Rate Control Feature */
1573static __inline__ void cec_msg_set_audio_rate(struct cec_msg *msg,1587static __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,...@@ -142,6 +142,26 @@ static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
142 msg->reply = msg->timeout = 0;142 msg->reply = msg->timeout = 0;
143}143}
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
145/* cec_msg flags field */165/* cec_msg flags field */
146#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)166#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
147#define CEC_MSG_FL_RAW (1 << 1)167#define CEC_MSG_FL_RAW (1 << 1)
...@@ -748,6 +768,7 @@ struct cec_event {...@@ -748,6 +768,7 @@ struct cec_event {
748#define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE 0x08768#define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE 0x08
749#define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX 0x04769#define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX 0x04
750#define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX 0x02770#define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX 0x02
771#define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_VOLUME_LEVEL 0x01
751772
752#define CEC_MSG_GIVE_FEATURES 0xa5 /* HDMI 2.0 */773#define CEC_MSG_GIVE_FEATURES 0xa5 /* HDMI 2.0 */
753774
...@@ -1039,6 +1060,7 @@ struct cec_event {...@@ -1039,6 +1060,7 @@ struct cec_event {
1039#define CEC_OP_AUD_FMT_ID_CEA861 01060#define CEC_OP_AUD_FMT_ID_CEA861 0
1040#define CEC_OP_AUD_FMT_ID_CEA861_CXT 11061#define CEC_OP_AUD_FMT_ID_CEA861_CXT 1
10411062
1063#define CEC_MSG_SET_AUDIO_VOLUME_LEVEL 0x73
10421064
1043/* Audio Rate Control Feature */1065/* Audio Rate Control Feature */
1044#define CEC_MSG_SET_AUDIO_RATE 0x9a1066#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 {...@@ -75,7 +75,7 @@ struct cn_msg {
7575
76 __u16 len; /* Length of the following data */76 __u16 len; /* Length of the following data */
77 __u16 flags;77 __u16 flags;
78 __u8 data[0];78 __u8 data[];
79};79};
8080
81#endif /* __CONNECTOR_H */81#endif /* __CONNECTOR_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/const.h+1-1
...@@ -28,7 +28,7 @@...@@ -28,7 +28,7 @@
28#define _BITUL(x) (_UL(1) << (x))28#define _BITUL(x) (_UL(1) << (x))
29#define _BITULL(x) (_ULL(1) << (x))29#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)
32#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))32#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
3333
34#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))34#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 {...@@ -61,6 +61,10 @@ enum counter_event_type {
61 COUNTER_EVENT_THRESHOLD,61 COUNTER_EVENT_THRESHOLD,
62 /* Index signal detected */62 /* Index signal detected */
63 COUNTER_EVENT_INDEX,63 COUNTER_EVENT_INDEX,
64 /* State of counter is changed */
65 COUNTER_EVENT_CHANGE_OF_STATE,
66 /* Count value captured */
67 COUNTER_EVENT_CAPTURE,
64};68};
6569
66/**70/**
...@@ -151,4 +155,10 @@ enum counter_synapse_action {...@@ -151,4 +155,10 @@ enum counter_synapse_action {
151 COUNTER_SYNAPSE_ACTION_BOTH_EDGES,155 COUNTER_SYNAPSE_ACTION_BOTH_EDGES,
152};156};
153157
158/* Signal polarity values */
159enum counter_signal_polarity {
160 COUNTER_SIGNAL_POLARITY_POSITIVE,
161 COUNTER_SIGNAL_POLARITY_NEGATIVE,
162};
163
154#endif /* _COUNTER_H_ */164#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 @@...@@ -11,14 +11,19 @@
11/**11/**
12 * DOC: UAPI12 * DOC: UAPI
13 *13 *
14 * Not all of all commands that the driver supports are always available for use14 * Not all of the commands that the driver supports are available for use by
15 * by userspace. Userspace must check the results from the QUERY command in15 * userspace at all times. Userspace can check the result of the QUERY command
16 * order to determine the live set of commands.16 * to determine the live set of commands. Alternatively, it can issue the
17 * command and check for failure.
17 */18 */
1819
19#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)20#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
20#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)21#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 */
22#define CXL_CMDS \27#define CXL_CMDS \
23 ___C(INVALID, "Invalid Command"), \28 ___C(INVALID, "Invalid Command"), \
24 ___C(IDENTIFY, "Identify Command"), \29 ___C(IDENTIFY, "Identify Command"), \
...@@ -68,8 +73,21 @@ static const struct {...@@ -68,8 +73,21 @@ static const struct {
68 * struct cxl_command_info - Command information returned from a query.73 * struct cxl_command_info - Command information returned from a query.
69 * @id: ID number for the command.74 * @id: ID number for the command.
70 * @flags: Flags that specify command behavior.75 * @flags: Flags that specify command behavior.
71 * @size_in: Expected input size, or -1 if variable length.76 *
72 * @size_out: Expected output size, or -1 if variable length.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.
73 *91 *
74 * Represents a single command that is supported by both the driver and the92 * Represents a single command that is supported by both the driver and the
75 * hardware. This is returned as part of an array from the query ioctl. The93 * hardware. This is returned as part of an array from the query ioctl. The
...@@ -77,8 +95,8 @@ static const struct {...@@ -77,8 +95,8 @@ static const struct {
77 * bytes of output.95 * bytes of output.
78 *96 *
79 * - @id = 1097 * - @id = 10
80 * - @flags = 098 * - @flags = CXL_MEM_COMMAND_FLAG_ENABLED
81 * - @size_in = -199 * - @size_in = ~0
82 * - @size_out = 0100 * - @size_out = 0
83 *101 *
84 * See struct cxl_mem_query_commands.102 * See struct cxl_mem_query_commands.
...@@ -87,10 +105,12 @@ struct cxl_command_info {...@@ -87,10 +105,12 @@ struct cxl_command_info {
87 __u32 id;105 __u32 id;
88106
89 __u32 flags;107 __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;112 __u32 size_in;
93 __s32 size_out;113 __u32 size_out;
94};114};
95115
96/**116/**
...@@ -169,13 +189,13 @@ struct cxl_send_command {...@@ -169,13 +189,13 @@ struct cxl_send_command {
169 __u32 retval;189 __u32 retval;
170190
171 struct {191 struct {
172 __s32 size;192 __u32 size;
173 __u32 rsvd;193 __u32 rsvd;
174 __u64 payload;194 __u64 payload;
175 } in;195 } in;
176196
177 struct {197 struct {
178 __s32 size;198 __u32 size;
179 __u32 rsvd;199 __u32 rsvd;
180 __u64 payload;200 __u64 payload;
181 } out;201 } 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 {...@@ -91,7 +91,7 @@ struct cycx_firmware {
91 unsigned short reserved[6];91 unsigned short reserved[6];
92 char descr[CFM_DESCR_LEN];92 char descr[CFM_DESCR_LEN];
93 struct cycx_fw_info info;93 struct cycx_fw_info info;
94 unsigned char image[0];94 unsigned char image[];
95};95};
9696
97struct cycx_fw_header {97struct cycx_fw_header {
lib/libc/include/any-linux-any/linux/dcbnl.h+10
...@@ -218,6 +218,9 @@ struct cee_pfc {...@@ -218,6 +218,9 @@ struct cee_pfc {
218#define IEEE_8021QAZ_APP_SEL_ANY 4218#define IEEE_8021QAZ_APP_SEL_ANY 4
219#define IEEE_8021QAZ_APP_SEL_DSCP 5219#define IEEE_8021QAZ_APP_SEL_DSCP 5
220220
221/* Non-std selector values */
222#define DCB_APP_SEL_PCP 255
223
221/* This structure contains the IEEE 802.1Qaz APP managed object. This224/* This structure contains the IEEE 802.1Qaz APP managed object. This
222 * object is also used for the CEE std as well.225 * object is also used for the CEE std as well.
223 *226 *
...@@ -247,6 +250,8 @@ struct dcb_app {...@@ -247,6 +250,8 @@ struct dcb_app {
247 __u16 protocol;250 __u16 protocol;
248};251};
249252
253#define IEEE_8021QAZ_APP_SEL_MAX 255
254
250/**255/**
251 * struct dcb_peer_app_info - APP feature information sent by the peer256 * struct dcb_peer_app_info - APP feature information sent by the peer
252 *257 *
...@@ -405,6 +410,8 @@ enum dcbnl_attrs {...@@ -405,6 +410,8 @@ enum dcbnl_attrs {
405 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only410 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
406 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only411 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
407 * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only412 * @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
408 */415 */
409enum ieee_attrs {416enum ieee_attrs {
410 DCB_ATTR_IEEE_UNSPEC,417 DCB_ATTR_IEEE_UNSPEC,
...@@ -418,6 +425,8 @@ enum ieee_attrs {...@@ -418,6 +425,8 @@ enum ieee_attrs {
418 DCB_ATTR_IEEE_QCN,425 DCB_ATTR_IEEE_QCN,
419 DCB_ATTR_IEEE_QCN_STATS,426 DCB_ATTR_IEEE_QCN_STATS,
420 DCB_ATTR_DCB_BUFFER,427 DCB_ATTR_DCB_BUFFER,
428 DCB_ATTR_DCB_APP_TRUST_TABLE,
429 DCB_ATTR_DCB_REWR_TABLE,
421 __DCB_ATTR_IEEE_MAX430 __DCB_ATTR_IEEE_MAX
422};431};
423#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)432#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
...@@ -425,6 +434,7 @@ enum ieee_attrs {...@@ -425,6 +434,7 @@ enum ieee_attrs {
425enum ieee_attrs_app {434enum ieee_attrs_app {
426 DCB_ATTR_IEEE_APP_UNSPEC,435 DCB_ATTR_IEEE_APP_UNSPEC,
427 DCB_ATTR_IEEE_APP,436 DCB_ATTR_IEEE_APP,
437 DCB_ATTR_DCB_APP,
428 __DCB_ATTR_IEEE_APP_MAX438 __DCB_ATTR_IEEE_APP_MAX
429};439};
430#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)440#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 {...@@ -131,6 +131,14 @@ enum devlink_command {
131 DEVLINK_CMD_RATE_NEW,131 DEVLINK_CMD_RATE_NEW,
132 DEVLINK_CMD_RATE_DEL,132 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
134 /* add new commands above here */142 /* add new commands above here */
135 __DEVLINK_CMD_MAX,143 __DEVLINK_CMD_MAX,
136 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1144 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
...@@ -271,6 +279,30 @@ enum {...@@ -271,6 +279,30 @@ enum {
271#define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \279#define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \
272 (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1)280 (_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
274/**306/**
275 * enum devlink_trap_action - Packet trap action.307 * enum devlink_trap_action - Packet trap action.
276 * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not308 * @DEVLINK_TRAP_ACTION_DROP: Packet is dropped by the device and a copy is not
...@@ -338,6 +370,19 @@ enum devlink_reload_limit {...@@ -338,6 +370,19 @@ enum devlink_reload_limit {
338370
339#define DEVLINK_RELOAD_LIMITS_VALID_MASK (_BITUL(__DEVLINK_RELOAD_LIMIT_MAX) - 1)371#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
341enum devlink_attr {386enum devlink_attr {
342 /* don't change the order or add anything between, this is ABI! */387 /* don't change the order or add anything between, this is ABI! */
343 DEVLINK_ATTR_UNSPEC,388 DEVLINK_ATTR_UNSPEC,
...@@ -553,6 +598,20 @@ enum devlink_attr {...@@ -553,6 +598,20 @@ enum devlink_attr {
553598
554 DEVLINK_ATTR_REGION_MAX_SNAPSHOTS, /* u32 */599 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
556 /* add new attributes above here, update the policy in devlink.c */615 /* add new attributes above here, update the policy in devlink.c */
557616
558 __DEVLINK_ATTR_MAX,617 __DEVLINK_ATTR_MAX,
...@@ -599,11 +658,24 @@ enum devlink_resource_unit {...@@ -599,11 +658,24 @@ enum devlink_resource_unit {
599 DEVLINK_RESOURCE_UNIT_ENTRY,658 DEVLINK_RESOURCE_UNIT_ENTRY,
600};659};
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
602enum devlink_port_function_attr {673enum devlink_port_function_attr {
603 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,674 DEVLINK_PORT_FUNCTION_ATTR_UNSPEC,
604 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */675 DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, /* binary */
605 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */676 DEVLINK_PORT_FN_ATTR_STATE, /* u8 */
606 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */677 DEVLINK_PORT_FN_ATTR_OPSTATE, /* u8 */
678 DEVLINK_PORT_FN_ATTR_CAPS, /* bitfield32 */
607679
608 __DEVLINK_PORT_FUNCTION_ATTR_MAX,680 __DEVLINK_PORT_FUNCTION_ATTR_MAX,
609 DEVLINK_PORT_FUNCTION_ATTR_MAX = __DEVLINK_PORT_FUNCTION_ATTR_MAX - 1681 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 {...@@ -69,7 +69,6 @@ struct dlm_lksb {
69/* dlm_new_lockspace() flags */69/* dlm_new_lockspace() flags */
7070
71#define DLM_LSFL_TIMEWARN 0x0000000271#define DLM_LSFL_TIMEWARN 0x00000002
72#define DLM_LSFL_FS 0x00000004
73#define DLM_LSFL_NEWEXCL 0x0000000872#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 {...@@ -182,7 +182,7 @@ struct dm_target_spec {
182struct dm_target_deps {182struct dm_target_deps {
183 __u32 count; /* Array size */183 __u32 count; /* Array size */
184 __u32 padding; /* unused */184 __u32 padding; /* unused */
185 __u64 dev[0]; /* out */185 __u64 dev[]; /* out */
186};186};
187187
188/*188/*
...@@ -192,7 +192,7 @@ struct dm_name_list {...@@ -192,7 +192,7 @@ struct dm_name_list {
192 __u64 dev;192 __u64 dev;
193 __u32 next; /* offset to the next record from193 __u32 next; /* offset to the next record from
194 the _start_ of this */194 the _start_ of this */
195 char name[0];195 char name[];
196196
197 /*197 /*
198 * The following members can be accessed by taking a pointer that198 * The following members can be accessed by taking a pointer that
...@@ -216,7 +216,7 @@ struct dm_target_versions {...@@ -216,7 +216,7 @@ struct dm_target_versions {
216 __u32 next;216 __u32 next;
217 __u32 version[3];217 __u32 version[3];
218218
219 char name[0];219 char name[];
220};220};
221221
222/*222/*
...@@ -225,7 +225,7 @@ struct dm_target_versions {...@@ -225,7 +225,7 @@ struct dm_target_versions {
225struct dm_target_msg {225struct dm_target_msg {
226 __u64 sector; /* Device sector */226 __u64 sector; /* Device sector */
227227
228 char message[0];228 char message[];
229};229};
230230
231/*231/*
...@@ -286,9 +286,9 @@ enum {...@@ -286,9 +286,9 @@ enum {
286#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)286#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
287287
288#define DM_VERSION_MAJOR 4288#define DM_VERSION_MAJOR 4
289#define DM_VERSION_MINOR 45289#define DM_VERSION_MINOR 47
290#define DM_VERSION_PATCHLEVEL 0290#define DM_VERSION_PATCHLEVEL 0
291#define DM_VERSION_EXTRA "-ioctl (2021-03-22)"291#define DM_VERSION_EXTRA "-ioctl (2022-07-28)"
292292
293/* Status bits */293/* Status bits */
294#define DM_READONLY_FLAG (1 << 0) /* In/Out */294#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 {...@@ -426,7 +426,7 @@ struct dm_ulog_request {
426 __u32 request_type; /* DM_ULOG_* defined above */426 __u32 request_type; /* DM_ULOG_* defined above */
427 __u32 data_size; /* How much data (not including this struct) */427 __u32 data_size; /* How much data (not including this struct) */
428428
429 char data[0];429 char data[];
430};430};
431431
432#endif /* __DM_LOG_USERSPACE_H__ */432#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 {...@@ -85,6 +85,88 @@ struct dma_buf_sync {
8585
86#define DMA_BUF_NAME_LEN 3286#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
88#define DMA_BUF_BASE 'b'170#define DMA_BUF_BASE 'b'
89#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)171#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
90172
...@@ -92,7 +174,9 @@ struct dma_buf_sync {...@@ -92,7 +174,9 @@ struct dma_buf_sync {
92 * between them in actual uapi, they're just different numbers.174 * between them in actual uapi, they're just different numbers.
93 */175 */
94#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)176#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)177#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)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
98#endif182#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 @@...@@ -7,21 +7,6 @@
7 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>7 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
8 * & Marcus Metzler <marcus@convergence.de>8 * & Marcus Metzler <marcus@convergence.de>
9 * for convergence integrated media GmbH9 * 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 *
25 */10 */
2611
27#ifndef _DVBAUDIO_H_12#ifndef _DVBAUDIO_H_
lib/libc/include/any-linux-any/linux/dvb/ca.h-15
...@@ -5,21 +5,6 @@...@@ -5,21 +5,6 @@
5 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>5 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
6 * & Marcus Metzler <marcus@convergence.de>6 * & Marcus Metzler <marcus@convergence.de>
7 * for convergence integrated media GmbH7 * 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 *
23 */8 */
249
25#ifndef _DVBCA_H_10#ifndef _DVBCA_H_
lib/libc/include/any-linux-any/linux/dvb/dmx.h-15
...@@ -5,21 +5,6 @@...@@ -5,21 +5,6 @@
5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
6 * & Ralph Metzler <ralph@convergence.de>6 * & Ralph Metzler <ralph@convergence.de>
7 * for convergence integrated media GmbH7 * 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 *
23 */8 */
249
25#ifndef _DVBDMX_H_10#ifndef _DVBDMX_H_
lib/libc/include/any-linux-any/linux/dvb/frontend.h+59-18
...@@ -7,21 +7,6 @@...@@ -7,21 +7,6 @@
7 * Holger Waechtler <holger@convergence.de>7 * Holger Waechtler <holger@convergence.de>
8 * Andre Draszik <ad@convergence.de>8 * Andre Draszik <ad@convergence.de>
9 * for convergence integrated media GmbH9 * 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 *
25 */10 */
2611
27#ifndef _DVBFRONTEND_H_12#ifndef _DVBFRONTEND_H_
...@@ -282,7 +267,6 @@ enum fe_spectral_inversion {...@@ -282,7 +267,6 @@ enum fe_spectral_inversion {
282/**267/**
283 * enum fe_code_rate - Type of Forward Error Correction (FEC)268 * enum fe_code_rate - Type of Forward Error Correction (FEC)
284 *269 *
285 *
286 * @FEC_NONE: No Forward Error Correction Code270 * @FEC_NONE: No Forward Error Correction Code
287 * @FEC_1_2: Forward Error Correction Code 1/2271 * @FEC_1_2: Forward Error Correction Code 1/2
288 * @FEC_2_3: Forward Error Correction Code 2/3272 * @FEC_2_3: Forward Error Correction Code 2/3
...@@ -296,6 +280,22 @@ enum fe_spectral_inversion {...@@ -296,6 +280,22 @@ enum fe_spectral_inversion {
296 * @FEC_3_5: Forward Error Correction Code 3/5280 * @FEC_3_5: Forward Error Correction Code 3/5
297 * @FEC_9_10: Forward Error Correction Code 9/10281 * @FEC_9_10: Forward Error Correction Code 9/10
298 * @FEC_2_5: Forward Error Correction Code 2/5282 * @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
299 *299 *
300 * Please note that not all FEC types are supported by a given standard.300 * Please note that not all FEC types are supported by a given standard.
301 */301 */
...@@ -313,6 +313,22 @@ enum fe_code_rate {...@@ -313,6 +313,22 @@ enum fe_code_rate {
313 FEC_3_5,313 FEC_3_5,
314 FEC_9_10,314 FEC_9_10,
315 FEC_2_5,315 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,
316};332};
317333
318/**334/**
...@@ -331,6 +347,13 @@ enum fe_code_rate {...@@ -331,6 +347,13 @@ enum fe_code_rate {
331 * @APSK_32: 32-APSK modulation347 * @APSK_32: 32-APSK modulation
332 * @DQPSK: DQPSK modulation348 * @DQPSK: DQPSK modulation
333 * @QAM_4_NR: 4-QAM-NR modulation349 * @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
334 *357 *
335 * Please note that not all modulations are supported by a given standard.358 * Please note that not all modulations are supported by a given standard.
336 *359 *
...@@ -350,6 +373,13 @@ enum fe_modulation {...@@ -350,6 +373,13 @@ enum fe_modulation {
350 APSK_32,373 APSK_32,
351 DQPSK,374 DQPSK,
352 QAM_4_NR,375 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,
353};383};
354384
355/**385/**
...@@ -404,6 +434,7 @@ enum fe_transmit_mode {...@@ -404,6 +434,7 @@ enum fe_transmit_mode {
404 * @GUARD_INTERVAL_PN420: PN length 420 (1/4)434 * @GUARD_INTERVAL_PN420: PN length 420 (1/4)
405 * @GUARD_INTERVAL_PN595: PN length 595 (1/6)435 * @GUARD_INTERVAL_PN595: PN length 595 (1/6)
406 * @GUARD_INTERVAL_PN945: PN length 945 (1/9)436 * @GUARD_INTERVAL_PN945: PN length 945 (1/9)
437 * @GUARD_INTERVAL_1_64: Guard interval 1/64
407 *438 *
408 * Please note that not all guard intervals are supported by a given standard.439 * Please note that not all guard intervals are supported by a given standard.
409 */440 */
...@@ -419,6 +450,7 @@ enum fe_guard_interval {...@@ -419,6 +450,7 @@ enum fe_guard_interval {
419 GUARD_INTERVAL_PN420,450 GUARD_INTERVAL_PN420,
420 GUARD_INTERVAL_PN595,451 GUARD_INTERVAL_PN595,
421 GUARD_INTERVAL_PN945,452 GUARD_INTERVAL_PN945,
453 GUARD_INTERVAL_1_64,
422};454};
423455
424/**456/**
...@@ -571,6 +603,9 @@ enum fe_pilot {...@@ -571,6 +603,9 @@ enum fe_pilot {
571 * @ROLLOFF_20: Roloff factor: α=20%603 * @ROLLOFF_20: Roloff factor: α=20%
572 * @ROLLOFF_25: Roloff factor: α=25%604 * @ROLLOFF_25: Roloff factor: α=25%
573 * @ROLLOFF_AUTO: Auto-detect the roloff factor.605 * @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%
574 *609 *
575 * .. note:610 * .. note:
576 *611 *
...@@ -581,6 +616,9 @@ enum fe_rolloff {...@@ -581,6 +616,9 @@ enum fe_rolloff {
581 ROLLOFF_20,616 ROLLOFF_20,
582 ROLLOFF_25,617 ROLLOFF_25,
583 ROLLOFF_AUTO,618 ROLLOFF_AUTO,
619 ROLLOFF_15,
620 ROLLOFF_10,
621 ROLLOFF_5,
584};622};
585623
586/**624/**
...@@ -594,6 +632,8 @@ enum fe_rolloff {...@@ -594,6 +632,8 @@ enum fe_rolloff {
594 * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)632 * Cable TV: DVB-C following ITU-T J.83 Annex B spec (ClearQAM)
595 * @SYS_DVBC_ANNEX_C:633 * @SYS_DVBC_ANNEX_C:
596 * Cable TV: DVB-C following ITU-T J.83 Annex C spec634 * Cable TV: DVB-C following ITU-T J.83 Annex C spec
635 * @SYS_DVBC2:
636 * Cable TV: DVB-C2
597 * @SYS_ISDBC:637 * @SYS_ISDBC:
598 * Cable TV: ISDB-C (no drivers yet)638 * Cable TV: ISDB-C (no drivers yet)
599 * @SYS_DVBT:639 * @SYS_DVBT:
...@@ -611,7 +651,7 @@ enum fe_rolloff {...@@ -611,7 +651,7 @@ enum fe_rolloff {
611 * @SYS_DVBS:651 * @SYS_DVBS:
612 * Satellite TV: DVB-S652 * Satellite TV: DVB-S
613 * @SYS_DVBS2:653 * @SYS_DVBS2:
614 * Satellite TV: DVB-S2654 * Satellite TV: DVB-S2 and DVB-S2X
615 * @SYS_TURBO:655 * @SYS_TURBO:
616 * Satellite TV: DVB-S Turbo656 * Satellite TV: DVB-S Turbo
617 * @SYS_ISDBS:657 * @SYS_ISDBS:
...@@ -645,6 +685,7 @@ enum fe_delivery_system {...@@ -645,6 +685,7 @@ enum fe_delivery_system {
645 SYS_DVBT2,685 SYS_DVBT2,
646 SYS_TURBO,686 SYS_TURBO,
647 SYS_DVBC_ANNEX_C,687 SYS_DVBC_ANNEX_C,
688 SYS_DVBC2,
648};689};
649690
650/* backward compatibility definitions for delivery systems */691/* backward compatibility definitions for delivery systems */
...@@ -720,7 +761,7 @@ enum atscmh_rs_frame_mode {...@@ -720,7 +761,7 @@ enum atscmh_rs_frame_mode {
720};761};
721762
722/**763/**
723 * enum atscmh_rs_code_mode764 * enum atscmh_rs_code_mode - ATSC-M/H Reed Solomon modes
724 * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).765 * @ATSCMH_RSCODE_211_187: Reed Solomon code (211,187).
725 * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).766 * @ATSCMH_RSCODE_223_187: Reed Solomon code (223,187).
726 * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).767 * @ATSCMH_RSCODE_235_187: Reed Solomon code (235,187).
lib/libc/include/any-linux-any/linux/dvb/net.h-15
...@@ -5,21 +5,6 @@...@@ -5,21 +5,6 @@
5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>5 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
6 * & Ralph Metzler <ralph@convergence.de>6 * & Ralph Metzler <ralph@convergence.de>
7 * for convergence integrated media GmbH7 * 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 *
23 */8 */
249
25#ifndef _DVBNET_H_10#ifndef _DVBNET_H_
lib/libc/include/any-linux-any/linux/dvb/osd.h-15
...@@ -7,21 +7,6 @@...@@ -7,21 +7,6 @@
7 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>7 * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
8 * & Marcus Metzler <marcus@convergence.de>8 * & Marcus Metzler <marcus@convergence.de>
9 * for convergence integrated media GmbH9 * 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 *
25 */10 */
2611
27#ifndef _DVBOSD_H_12#ifndef _DVBOSD_H_
lib/libc/include/any-linux-any/linux/dvb/version.h-15
...@@ -4,21 +4,6 @@...@@ -4,21 +4,6 @@
4 *4 *
5 * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>5 * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
6 * for convergence integrated media GmbH6 * 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 *
22 */7 */
238
24#ifndef _DVBVERSION_H_9#ifndef _DVBVERSION_H_
lib/libc/include/any-linux-any/linux/dvb/video.h-15
...@@ -7,21 +7,6 @@...@@ -7,21 +7,6 @@
7 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>7 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
8 * & Ralph Metzler <ralph@convergence.de>8 * & Ralph Metzler <ralph@convergence.de>
9 * for convergence integrated media GmbH9 * 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 *
25 */10 */
2611
27#ifndef _DVBVIDEO_H_12#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 @@...@@ -51,6 +51,7 @@
51#define EM_RISCV 243 /* RISC-V */51#define EM_RISCV 243 /* RISC-V */
52#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */52#define EM_BPF 247 /* Linux BPF - in-kernel virtual machine */
53#define EM_CSKY 252 /* C-SKY */53#define EM_CSKY 252 /* C-SKY */
54#define EM_LOONGARCH 258 /* LoongArch */
54#define EM_FRV 0x5441 /* Fujitsu FR-V */55#define EM_FRV 0x5441 /* Fujitsu FR-V */
5556
56/*57/*
lib/libc/include/any-linux-any/linux/elf.h+26-11
...@@ -35,10 +35,14 @@ typedef __s64 Elf64_Sxword;...@@ -35,10 +35,14 @@ typedef __s64 Elf64_Sxword;
35#define PT_HIOS 0x6fffffff /* OS-specific */35#define PT_HIOS 0x6fffffff /* OS-specific */
36#define PT_LOPROC 0x7000000036#define PT_LOPROC 0x70000000
37#define PT_HIPROC 0x7fffffff37#define PT_HIPROC 0x7fffffff
38#define PT_GNU_EH_FRAME 0x6474e55038#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
39#define PT_GNU_PROPERTY 0x6474e553
40
41#define PT_GNU_STACK (PT_LOOS + 0x474e551)39#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
43/*47/*
44 * Extended Numbering48 * Extended Numbering
...@@ -87,7 +91,7 @@ typedef __s64 Elf64_Sxword;...@@ -87,7 +91,7 @@ typedef __s64 Elf64_Sxword;
87#define DT_INIT 1291#define DT_INIT 12
88#define DT_FINI 1392#define DT_FINI 13
89#define DT_SONAME 1493#define DT_SONAME 14
90#define DT_RPATH 1594#define DT_RPATH 15
91#define DT_SYMBOLIC 1695#define DT_SYMBOLIC 16
92#define DT_REL 1796#define DT_REL 17
93#define DT_RELSZ 1897#define DT_RELSZ 18
...@@ -130,15 +134,15 @@ typedef __s64 Elf64_Sxword;...@@ -130,15 +134,15 @@ typedef __s64 Elf64_Sxword;
130#define STT_TLS 6134#define STT_TLS 6
131135
132#define ELF_ST_BIND(x) ((x) >> 4)136#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)
134#define ELF32_ST_BIND(x) ELF_ST_BIND(x)138#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
135#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)139#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
136#define ELF64_ST_BIND(x) ELF_ST_BIND(x)140#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
137#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)141#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
138142
139typedef struct dynamic{143typedef struct dynamic {
140 Elf32_Sword d_tag;144 Elf32_Sword d_tag;
141 union{145 union {
142 Elf32_Sword d_val;146 Elf32_Sword d_val;
143 Elf32_Addr d_ptr;147 Elf32_Addr d_ptr;
144 } d_un;148 } d_un;
...@@ -169,7 +173,7 @@ typedef struct elf64_rel {...@@ -169,7 +173,7 @@ typedef struct elf64_rel {
169 Elf64_Xword r_info; /* index and type of relocation */173 Elf64_Xword r_info; /* index and type of relocation */
170} Elf64_Rel;174} Elf64_Rel;
171175
172typedef struct elf32_rela{176typedef struct elf32_rela {
173 Elf32_Addr r_offset;177 Elf32_Addr r_offset;
174 Elf32_Word r_info;178 Elf32_Word r_info;
175 Elf32_Sword r_addend;179 Elf32_Sword r_addend;
...@@ -181,7 +185,7 @@ typedef struct elf64_rela {...@@ -181,7 +185,7 @@ typedef struct elf64_rela {
181 Elf64_Sxword r_addend; /* Constant addend used to compute value */185 Elf64_Sxword r_addend; /* Constant addend used to compute value */
182} Elf64_Rela;186} Elf64_Rela;
183187
184typedef struct elf32_sym{188typedef struct elf32_sym {
185 Elf32_Word st_name;189 Elf32_Word st_name;
186 Elf32_Addr st_value;190 Elf32_Addr st_value;
187 Elf32_Word st_size;191 Elf32_Word st_size;
...@@ -202,7 +206,7 @@ typedef struct elf64_sym {...@@ -202,7 +206,7 @@ typedef struct elf64_sym {
202206
203#define EI_NIDENT 16207#define EI_NIDENT 16
204208
205typedef struct elf32_hdr{209typedef struct elf32_hdr {
206 unsigned char e_ident[EI_NIDENT];210 unsigned char e_ident[EI_NIDENT];
207 Elf32_Half e_type;211 Elf32_Half e_type;
208 Elf32_Half e_machine;212 Elf32_Half e_machine;
...@@ -242,7 +246,7 @@ typedef struct elf64_hdr {...@@ -242,7 +246,7 @@ typedef struct elf64_hdr {
242#define PF_W 0x2246#define PF_W 0x2
243#define PF_X 0x1247#define PF_X 0x1
244248
245typedef struct elf32_phdr{249typedef struct elf32_phdr {
246 Elf32_Word p_type;250 Elf32_Word p_type;
247 Elf32_Off p_offset;251 Elf32_Off p_offset;
248 Elf32_Addr p_vaddr;252 Elf32_Addr p_vaddr;
...@@ -416,6 +420,7 @@ typedef struct elf64_shdr {...@@ -416,6 +420,7 @@ typedef struct elf64_shdr {
416#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */420#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
417#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */421#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */
418#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */422#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */
423#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data */
419#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */424#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
420#define NT_ARM_TLS 0x401 /* ARM TLS register */425#define NT_ARM_TLS 0x401 /* ARM TLS register */
421#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */426#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
...@@ -427,11 +432,21 @@ typedef struct elf64_shdr {...@@ -427,11 +432,21 @@ typedef struct elf64_shdr {
427#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */432#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */
428#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */433#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */
429#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */434#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 */
430#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */438#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
431#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */439#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
432#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */440#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
433#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */441#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
434#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */442#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
436/* Note types with note name "GNU" */451/* Note types with note name "GNU" */
437#define NT_GNU_PROPERTY_TYPE_0 5452#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)...@@ -157,8 +157,10 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
157 * in its bus driver structure (e.g. pci_driver::name). Must157 * in its bus driver structure (e.g. pci_driver::name). Must
158 * not be an empty string.158 * not be an empty string.
159 * @version: Driver version string; may be an empty string159 * @version: Driver version string; may be an empty string
160 * @fw_version: Firmware version string; may be an empty string160 * @fw_version: Firmware version string; driver defined; may be an
161 * @erom_version: Expansion ROM version string; may be an empty string161 * empty string
162 * @erom_version: Expansion ROM version string; driver defined; may be
163 * an empty string
162 * @bus_info: Device bus address. This should match the dev_name()164 * @bus_info: Device bus address. This should match the dev_name()
163 * string for the underlying bus device, if there is one. May be165 * string for the underlying bus device, if there is one. May be
164 * an empty string.166 * an empty string.
...@@ -177,10 +179,6 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)...@@ -177,10 +179,6 @@ static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
177 *179 *
178 * Users can use the %ETHTOOL_GSSET_INFO command to get the number of180 * Users can use the %ETHTOOL_GSSET_INFO command to get the number of
179 * strings in any string set (from Linux 2.6.34).181 * 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.
184 */182 */
185struct ethtool_drvinfo {183struct ethtool_drvinfo {
186 __u32 cmd;184 __u32 cmd;
...@@ -229,6 +227,7 @@ enum tunable_id {...@@ -229,6 +227,7 @@ enum tunable_id {
229 ETHTOOL_RX_COPYBREAK,227 ETHTOOL_RX_COPYBREAK,
230 ETHTOOL_TX_COPYBREAK,228 ETHTOOL_TX_COPYBREAK,
231 ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */229 ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
230 ETHTOOL_TX_COPYBREAK_BUF_SIZE,
232 /*231 /*
233 * Add your fresh new tunable attribute above and remember to update232 * Add your fresh new tunable attribute above and remember to update
234 * tunable_strings[] in net/ethtool/common.c233 * tunable_strings[] in net/ethtool/common.c
...@@ -254,7 +253,7 @@ struct ethtool_tunable {...@@ -254,7 +253,7 @@ struct ethtool_tunable {
254 __u32 id;253 __u32 id;
255 __u32 type_id;254 __u32 type_id;
256 __u32 len;255 __u32 len;
257 void *data[0];256 void *data[];
258};257};
259258
260#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff259#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
...@@ -319,7 +318,7 @@ struct ethtool_regs {...@@ -319,7 +318,7 @@ struct ethtool_regs {
319 __u32 cmd;318 __u32 cmd;
320 __u32 version;319 __u32 version;
321 __u32 len;320 __u32 len;
322 __u8 data[0];321 __u8 data[];
323};322};
324323
325/**324/**
...@@ -345,7 +344,7 @@ struct ethtool_eeprom {...@@ -345,7 +344,7 @@ struct ethtool_eeprom {
345 __u32 magic;344 __u32 magic;
346 __u32 offset;345 __u32 offset;
347 __u32 len;346 __u32 len;
348 __u8 data[0];347 __u8 data[];
349};348};
350349
351/**350/**
...@@ -710,6 +709,24 @@ enum ethtool_stringset {...@@ -710,6 +709,24 @@ enum ethtool_stringset {
710 ETH_SS_COUNT709 ETH_SS_COUNT
711};710};
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
713/**730/**
714 * enum ethtool_module_power_mode_policy - plug-in module power mode policy731 * enum ethtool_module_power_mode_policy - plug-in module power mode policy
715 * @ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: Module is always in high power mode.732 * @ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: Module is always in high power mode.
...@@ -733,6 +750,76 @@ enum ethtool_module_power_mode {...@@ -733,6 +750,76 @@ enum ethtool_module_power_mode {
733 ETHTOOL_MODULE_POWER_MODE_HIGH,750 ETHTOOL_MODULE_POWER_MODE_HIGH,
734};751};
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
736/**823/**
737 * struct ethtool_gstrings - string set for data tagging824 * struct ethtool_gstrings - string set for data tagging
738 * @cmd: Command number = %ETHTOOL_GSTRINGS825 * @cmd: Command number = %ETHTOOL_GSTRINGS
...@@ -749,7 +836,7 @@ struct ethtool_gstrings {...@@ -749,7 +836,7 @@ struct ethtool_gstrings {
749 __u32 cmd;836 __u32 cmd;
750 __u32 string_set;837 __u32 string_set;
751 __u32 len;838 __u32 len;
752 __u8 data[0];839 __u8 data[];
753};840};
754841
755/**842/**
...@@ -774,7 +861,7 @@ struct ethtool_sset_info {...@@ -774,7 +861,7 @@ struct ethtool_sset_info {
774 __u32 cmd;861 __u32 cmd;
775 __u32 reserved;862 __u32 reserved;
776 __u64 sset_mask;863 __u64 sset_mask;
777 __u32 data[0];864 __u32 data[];
778};865};
779866
780/**867/**
...@@ -814,7 +901,7 @@ struct ethtool_test {...@@ -814,7 +901,7 @@ struct ethtool_test {
814 __u32 flags;901 __u32 flags;
815 __u32 reserved;902 __u32 reserved;
816 __u32 len;903 __u32 len;
817 __u64 data[0];904 __u64 data[];
818};905};
819906
820/**907/**
...@@ -831,7 +918,7 @@ struct ethtool_test {...@@ -831,7 +918,7 @@ struct ethtool_test {
831struct ethtool_stats {918struct ethtool_stats {
832 __u32 cmd;919 __u32 cmd;
833 __u32 n_stats;920 __u32 n_stats;
834 __u64 data[0];921 __u64 data[];
835};922};
836923
837/**924/**
...@@ -848,7 +935,7 @@ struct ethtool_stats {...@@ -848,7 +935,7 @@ struct ethtool_stats {
848struct ethtool_perm_addr {935struct ethtool_perm_addr {
849 __u32 cmd;936 __u32 cmd;
850 __u32 size;937 __u32 size;
851 __u8 data[0];938 __u8 data[];
852};939};
853940
854/* boolean flags controlling per-interface behavior characteristics.941/* boolean flags controlling per-interface behavior characteristics.
...@@ -1137,7 +1224,7 @@ struct ethtool_rxnfc {...@@ -1137,7 +1224,7 @@ struct ethtool_rxnfc {
1137 __u32 rule_cnt;1224 __u32 rule_cnt;
1138 __u32 rss_context;1225 __u32 rss_context;
1139 };1226 };
1140 __u32 rule_locs[0];1227 __u32 rule_locs[];
1141};1228};
11421229
11431230
...@@ -1157,7 +1244,7 @@ struct ethtool_rxnfc {...@@ -1157,7 +1244,7 @@ struct ethtool_rxnfc {
1157struct ethtool_rxfh_indir {1244struct ethtool_rxfh_indir {
1158 __u32 cmd;1245 __u32 cmd;
1159 __u32 size;1246 __u32 size;
1160 __u32 ring_index[0];1247 __u32 ring_index[];
1161};1248};
11621249
1163/**1250/**
...@@ -1198,7 +1285,7 @@ struct ethtool_rxfh {...@@ -1198,7 +1285,7 @@ struct ethtool_rxfh {
1198 __u8 hfunc;1285 __u8 hfunc;
1199 __u8 rsvd8[3];1286 __u8 rsvd8[3];
1200 __u32 rsvd32;1287 __u32 rsvd32;
1201 __u32 rss_config[0];1288 __u32 rss_config[];
1202};1289};
1203#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff1290#define ETH_RXFH_CONTEXT_ALLOC 0xffffffff
1204#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff1291#define ETH_RXFH_INDIR_NO_CHANGE 0xffffffff
...@@ -1283,7 +1370,7 @@ struct ethtool_dump {...@@ -1283,7 +1370,7 @@ struct ethtool_dump {
1283 __u32 version;1370 __u32 version;
1284 __u32 flag;1371 __u32 flag;
1285 __u32 len;1372 __u32 len;
1286 __u8 data[0];1373 __u8 data[];
1287};1374};
12881375
1289#define ETH_FW_DUMP_DISABLE 01376#define ETH_FW_DUMP_DISABLE 0
...@@ -1315,7 +1402,7 @@ struct ethtool_get_features_block {...@@ -1315,7 +1402,7 @@ struct ethtool_get_features_block {
1315struct ethtool_gfeatures {1402struct ethtool_gfeatures {
1316 __u32 cmd;1403 __u32 cmd;
1317 __u32 size;1404 __u32 size;
1318 struct ethtool_get_features_block features[0];1405 struct ethtool_get_features_block features[];
1319};1406};
13201407
1321/**1408/**
...@@ -1337,7 +1424,7 @@ struct ethtool_set_features_block {...@@ -1337,7 +1424,7 @@ struct ethtool_set_features_block {
1337struct ethtool_sfeatures {1424struct ethtool_sfeatures {
1338 __u32 cmd;1425 __u32 cmd;
1339 __u32 size;1426 __u32 size;
1340 struct ethtool_set_features_block features[0];1427 struct ethtool_set_features_block features[];
1341};1428};
13421429
1343/**1430/**
...@@ -1688,6 +1775,17 @@ enum ethtool_link_mode_bit_indices {...@@ -1688,6 +1775,17 @@ enum ethtool_link_mode_bit_indices {
1688 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,1775 ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 89,
1689 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,1776 ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90,
1690 ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91,1777 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
1691 /* must be last entry */1789 /* must be last entry */
1692 __ETHTOOL_LINK_MODE_MASK_NBITS1790 __ETHTOOL_LINK_MODE_MASK_NBITS
1693};1791};
...@@ -1799,6 +1897,7 @@ enum ethtool_link_mode_bit_indices {...@@ -1799,6 +1897,7 @@ enum ethtool_link_mode_bit_indices {
1799#define SPEED_100000 1000001897#define SPEED_100000 100000
1800#define SPEED_200000 2000001898#define SPEED_200000 200000
1801#define SPEED_400000 4000001899#define SPEED_400000 400000
1900#define SPEED_800000 800000
18021901
1803#define SPEED_UNKNOWN -11902#define SPEED_UNKNOWN -1
18041903
...@@ -1836,6 +1935,20 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)...@@ -1836,6 +1935,20 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
1836#define MASTER_SLAVE_STATE_SLAVE 31935#define MASTER_SLAVE_STATE_SLAVE 3
1837#define MASTER_SLAVE_STATE_ERR 41936#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
1839/* Which connector port. */1952/* Which connector port. */
1840#define PORT_TP 0x001953#define PORT_TP 0x00
1841#define PORT_AUI 0x011954#define PORT_AUI 0x01
...@@ -2029,8 +2142,8 @@ enum ethtool_reset_flags {...@@ -2029,8 +2142,8 @@ enum ethtool_reset_flags {
2029 * reported consistently by PHYLIB. Read-only.2142 * reported consistently by PHYLIB. Read-only.
2030 * @master_slave_cfg: Master/slave port mode.2143 * @master_slave_cfg: Master/slave port mode.
2031 * @master_slave_state: Master/slave port state.2144 * @master_slave_state: Master/slave port state.
2145 * @rate_matching: Rate adaptation performed by the PHY
2032 * @reserved: Reserved for future use; see the note on reserved space.2146 * @reserved: Reserved for future use; see the note on reserved space.
2033 * @reserved1: Reserved for future use; see the note on reserved space.
2034 * @link_mode_masks: Variable length bitmaps.2147 * @link_mode_masks: Variable length bitmaps.
2035 *2148 *
2036 * If autonegotiation is disabled, the speed and @duplex represent the2149 * If autonegotiation is disabled, the speed and @duplex represent the
...@@ -2081,9 +2194,9 @@ struct ethtool_link_settings {...@@ -2081,9 +2194,9 @@ struct ethtool_link_settings {
2081 __u8 transceiver;2194 __u8 transceiver;
2082 __u8 master_slave_cfg;2195 __u8 master_slave_cfg;
2083 __u8 master_slave_state;2196 __u8 master_slave_state;
2084 __u8 reserved1[1];2197 __u8 rate_matching;
2085 __u32 reserved[7];2198 __u32 reserved[7];
2086 __u32 link_mode_masks[0];2199 __u32 link_mode_masks[];
2087 /* layout of link_mode_masks fields:2200 /* layout of link_mode_masks fields:
2088 * __u32 map_supported[link_mode_masks_nwords];2201 * __u32 map_supported[link_mode_masks_nwords];
2089 * __u32 map_advertising[link_mode_masks_nwords];2202 * __u32 map_advertising[link_mode_masks_nwords];
lib/libc/include/any-linux-any/linux/ethtool_netlink.h+121
...@@ -49,6 +49,14 @@ enum {...@@ -49,6 +49,14 @@ enum {
49 ETHTOOL_MSG_PHC_VCLOCKS_GET,49 ETHTOOL_MSG_PHC_VCLOCKS_GET,
50 ETHTOOL_MSG_MODULE_GET,50 ETHTOOL_MSG_MODULE_GET,
51 ETHTOOL_MSG_MODULE_SET,51 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
53 /* add new constants above here */61 /* add new constants above here */
54 __ETHTOOL_MSG_USER_CNT,62 __ETHTOOL_MSG_USER_CNT,
...@@ -94,6 +102,13 @@ enum {...@@ -94,6 +102,13 @@ enum {
94 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,102 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
95 ETHTOOL_MSG_MODULE_GET_REPLY,103 ETHTOOL_MSG_MODULE_GET_REPLY,
96 ETHTOOL_MSG_MODULE_NTF,104 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
98 /* add new constants above here */113 /* add new constants above here */
99 __ETHTOOL_MSG_KERNEL_CNT,114 __ETHTOOL_MSG_KERNEL_CNT,
...@@ -242,6 +257,7 @@ enum {...@@ -242,6 +257,7 @@ enum {
242 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */257 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */
243 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */258 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */
244 ETHTOOL_A_LINKMODES_LANES, /* u32 */259 ETHTOOL_A_LINKMODES_LANES, /* u32 */
260 ETHTOOL_A_LINKMODES_RATE_MATCHING, /* u8 */
245261
246 /* add new constants above here */262 /* add new constants above here */
247 __ETHTOOL_A_LINKMODES_CNT,263 __ETHTOOL_A_LINKMODES_CNT,
...@@ -258,6 +274,7 @@ enum {...@@ -258,6 +274,7 @@ enum {
258 ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */274 ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */
259 ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */275 ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */
260 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */276 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */
277 ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT, /* u32 */
261278
262 /* add new constants above here */279 /* add new constants above here */
263 __ETHTOOL_A_LINKSTATE_CNT,280 __ETHTOOL_A_LINKSTATE_CNT,
...@@ -318,6 +335,12 @@ enum {...@@ -318,6 +335,12 @@ enum {
318335
319/* RINGS */336/* RINGS */
320337
338enum {
339 ETHTOOL_TCP_DATA_SPLIT_UNKNOWN = 0,
340 ETHTOOL_TCP_DATA_SPLIT_DISABLED,
341 ETHTOOL_TCP_DATA_SPLIT_ENABLED,
342};
343
321enum {344enum {
322 ETHTOOL_A_RINGS_UNSPEC,345 ETHTOOL_A_RINGS_UNSPEC,
323 ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */346 ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
...@@ -329,6 +352,11 @@ enum {...@@ -329,6 +352,11 @@ enum {
329 ETHTOOL_A_RINGS_RX_MINI, /* u32 */352 ETHTOOL_A_RINGS_RX_MINI, /* u32 */
330 ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */353 ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
331 ETHTOOL_A_RINGS_TX, /* u32 */354 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
333 /* add new constants above here */361 /* add new constants above here */
334 __ETHTOOL_A_RINGS_CNT,362 __ETHTOOL_A_RINGS_CNT,
...@@ -383,6 +411,9 @@ enum {...@@ -383,6 +411,9 @@ enum {
383 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */411 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
384 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */412 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */
385 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */413 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
387 /* add new constants above here */418 /* add new constants above here */
388 __ETHTOOL_A_COALESCE_CNT,419 __ETHTOOL_A_COALESCE_CNT,
...@@ -398,6 +429,7 @@ enum {...@@ -398,6 +429,7 @@ enum {
398 ETHTOOL_A_PAUSE_RX, /* u8 */429 ETHTOOL_A_PAUSE_RX, /* u8 */
399 ETHTOOL_A_PAUSE_TX, /* u8 */430 ETHTOOL_A_PAUSE_TX, /* u8 */
400 ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */431 ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */
432 ETHTOOL_A_PAUSE_STATS_SRC, /* u32 */
401433
402 /* add new constants above here */434 /* add new constants above here */
403 __ETHTOOL_A_PAUSE_CNT,435 __ETHTOOL_A_PAUSE_CNT,
...@@ -714,6 +746,8 @@ enum {...@@ -714,6 +746,8 @@ enum {
714746
715 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */747 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
716748
749 ETHTOOL_A_STATS_SRC, /* u32 */
750
717 /* add new constants above here */751 /* add new constants above here */
718 __ETHTOOL_A_STATS_CNT,752 __ETHTOOL_A_STATS_CNT,
719 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)753 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
...@@ -852,6 +886,93 @@ enum {...@@ -852,6 +886,93 @@ enum {
852 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)886 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
853};887};
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
855/* generic netlink info */976/* generic netlink info */
856#define ETHTOOL_GENL_NAME "ethtool"977#define ETHTOOL_GENL_NAME "ethtool"
857#define ETHTOOL_GENL_VERSION 1978#define ETHTOOL_GENL_VERSION 1
lib/libc/include/any-linux-any/linux/eventpoll.h+6
...@@ -41,6 +41,12 @@...@@ -41,6 +41,12 @@
41#define EPOLLMSG (__poll_t)0x0000040041#define EPOLLMSG (__poll_t)0x00000400
42#define EPOLLRDHUP (__poll_t)0x0000200042#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
44/* Set exclusive wakeup mode for the target file descriptor */50/* Set exclusive wakeup mode for the target file descriptor */
45#define EPOLLEXCLUSIVE ((__poll_t)(1U << 28))51#define EPOLLEXCLUSIVE ((__poll_t)(1U << 28))
4652
lib/libc/include/any-linux-any/linux/f2fs.h+2-1
...@@ -13,7 +13,7 @@...@@ -13,7 +13,7 @@
13#define F2FS_IOC_COMMIT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 2)13#define F2FS_IOC_COMMIT_ATOMIC_WRITE _IO(F2FS_IOCTL_MAGIC, 2)
14#define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)14#define F2FS_IOC_START_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 3)
15#define F2FS_IOC_RELEASE_VOLATILE_WRITE _IO(F2FS_IOCTL_MAGIC, 4)15#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)
17#define F2FS_IOC_GARBAGE_COLLECT _IOW(F2FS_IOCTL_MAGIC, 6, __u32)17#define F2FS_IOC_GARBAGE_COLLECT _IOW(F2FS_IOCTL_MAGIC, 6, __u32)
18#define F2FS_IOC_WRITE_CHECKPOINT _IO(F2FS_IOCTL_MAGIC, 7)18#define F2FS_IOC_WRITE_CHECKPOINT _IO(F2FS_IOCTL_MAGIC, 7)
19#define F2FS_IOC_DEFRAGMENT _IOWR(F2FS_IOCTL_MAGIC, 8, \19#define F2FS_IOC_DEFRAGMENT _IOWR(F2FS_IOCTL_MAGIC, 8, \
...@@ -42,6 +42,7 @@...@@ -42,6 +42,7 @@
42 struct f2fs_comp_option)42 struct f2fs_comp_option)
43#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)43#define F2FS_IOC_DECOMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 23)
44#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)44#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
45#define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25)
4546
46/*47/*
47 * should be same as XFS_IOC_GOINGDOWN.48 * should be same as XFS_IOC_GOINGDOWN.
lib/libc/include/any-linux-any/linux/fanotify.h+51-2
...@@ -28,6 +28,8 @@...@@ -28,6 +28,8 @@
2828
29#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */29#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
3030
31#define FAN_RENAME 0x10000000 /* File was renamed */
32
31#define FAN_ONDIR 0x40000000 /* Event occurred against dir */33#define FAN_ONDIR 0x40000000 /* Event occurred against dir */
3234
33/* helper events */35/* helper events */
...@@ -57,9 +59,13 @@...@@ -57,9 +59,13 @@
57#define FAN_REPORT_FID 0x00000200 /* Report unique file id */59#define FAN_REPORT_FID 0x00000200 /* Report unique file id */
58#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */60#define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */
59#define FAN_REPORT_NAME 0x00000800 /* Report events with name */61#define FAN_REPORT_NAME 0x00000800 /* Report events with name */
62#define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */
6063
61/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */64/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */
62#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)65#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
64/* Deprecated - do not use this in programs and do not add new flags here! */70/* Deprecated - do not use this in programs and do not add new flags here! */
65#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \71#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \
...@@ -76,12 +82,21 @@...@@ -76,12 +82,21 @@
76#define FAN_MARK_IGNORED_SURV_MODIFY 0x0000004082#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
77#define FAN_MARK_FLUSH 0x0000008083#define FAN_MARK_FLUSH 0x00000080
78/* FAN_MARK_FILESYSTEM is 0x00000100 */84/* 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
80/* These are NOT bitwise flags. Both bits can be used togther. */89/* These are NOT bitwise flags. Both bits can be used togther. */
81#define FAN_MARK_INODE 0x0000000090#define FAN_MARK_INODE 0x00000000
82#define FAN_MARK_MOUNT 0x0000001091#define FAN_MARK_MOUNT 0x00000010
83#define FAN_MARK_FILESYSTEM 0x0000010092#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
85/* Deprecated - do not use this in programs and do not add new flags here! */100/* Deprecated - do not use this in programs and do not add new flags here! */
86#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\101#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
87 FAN_MARK_REMOVE |\102 FAN_MARK_REMOVE |\
...@@ -128,6 +143,12 @@ struct fanotify_event_metadata {...@@ -128,6 +143,12 @@ struct fanotify_event_metadata {
128#define FAN_EVENT_INFO_TYPE_PIDFD 4143#define FAN_EVENT_INFO_TYPE_PIDFD 4
129#define FAN_EVENT_INFO_TYPE_ERROR 5144#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
131/* Variable length info record following event metadata */152/* Variable length info record following event metadata */
132struct fanotify_event_info_header {153struct fanotify_event_info_header {
133 __u8 info_type;154 __u8 info_type;
...@@ -149,7 +170,7 @@ struct fanotify_event_info_fid {...@@ -149,7 +170,7 @@ struct fanotify_event_info_fid {
149 * Following is an opaque struct file_handle that can be passed as170 * Following is an opaque struct file_handle that can be passed as
150 * an argument to open_by_handle_at(2).171 * an argument to open_by_handle_at(2).
151 */172 */
152 unsigned char handle[0];173 unsigned char handle[];
153};174};
154175
155/*176/*
...@@ -167,15 +188,43 @@ struct fanotify_event_info_error {...@@ -167,15 +188,43 @@ struct fanotify_event_info_error {
167 __u32 error_count;188 __u32 error_count;
168};189};
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
170struct fanotify_response {205struct fanotify_response {
171 __s32 fd;206 __s32 fd;
172 __u32 response;207 __u32 response;
173};208};
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
175/* Legit userspace responses to a _PERM event */223/* Legit userspace responses to a _PERM event */
176#define FAN_ALLOW 0x01224#define FAN_ALLOW 0x01
177#define FAN_DENY 0x02225#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
180/* No fd set in event */229/* No fd set in event */
181#define FAN_NOFD -1230#define FAN_NOFD -1
lib/libc/include/any-linux-any/linux/fb.h+1-1
...@@ -180,7 +180,7 @@ struct fb_fix_screeninfo {...@@ -180,7 +180,7 @@ struct fb_fix_screeninfo {
180 *180 *
181 * For pseudocolor: offset and length should be the same for all color181 * For pseudocolor: offset and length should be the same for all color
182 * components. Offset specifies the position of the least significant bit182 * components. Offset specifies the position of the least significant bit
183 * of the pallette index in a pixel value. Length indicates the number183 * of the palette index in a pixel value. Length indicates the number
184 * of available palette entries (i.e. # of entries = 1 << length).184 * of available palette entries (i.e. # of entries = 1 << length).
185 */185 */
186struct fb_bitfield {186struct fb_bitfield {
lib/libc/include/any-linux-any/linux/fcntl.h+1
...@@ -43,6 +43,7 @@...@@ -43,6 +43,7 @@
43#define F_SEAL_GROW 0x0004 /* prevent file from growing */43#define F_SEAL_GROW 0x0004 /* prevent file from growing */
44#define F_SEAL_WRITE 0x0008 /* prevent writes */44#define F_SEAL_WRITE 0x0008 /* prevent writes */
45#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */45#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
46#define F_SEAL_EXEC 0x0020 /* prevent chmod modifying exec bits */
46/* (1U << 31) is reserved for signed error codes */47/* (1U << 31) is reserved for signed error codes */
4748
48/*49/*
lib/libc/include/any-linux-any/linux/fiemap.h+1-1
...@@ -34,7 +34,7 @@ struct fiemap {...@@ -34,7 +34,7 @@ struct fiemap {
34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
35 __u32 fm_extent_count; /* size of fm_extents array (in) */35 __u32 fm_extent_count; /* size of fm_extents array (in) */
36 __u32 fm_reserved;36 __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) */
38};38};
3939
40#define FIEMAP_MAX_OFFSET (~0ULL)40#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 {...@@ -118,7 +118,7 @@ struct fw_cdev_event_response {
118 __u32 type;118 __u32 type;
119 __u32 rcode;119 __u32 rcode;
120 __u32 length;120 __u32 length;
121 __u32 data[0];121 __u32 data[];
122};122};
123123
124/**124/**
...@@ -142,7 +142,7 @@ struct fw_cdev_event_request {...@@ -142,7 +142,7 @@ struct fw_cdev_event_request {
142 __u64 offset;142 __u64 offset;
143 __u32 handle;143 __u32 handle;
144 __u32 length;144 __u32 length;
145 __u32 data[0];145 __u32 data[];
146};146};
147147
148/**148/**
...@@ -205,7 +205,7 @@ struct fw_cdev_event_request2 {...@@ -205,7 +205,7 @@ struct fw_cdev_event_request2 {
205 __u32 generation;205 __u32 generation;
206 __u32 handle;206 __u32 handle;
207 __u32 length;207 __u32 length;
208 __u32 data[0];208 __u32 data[];
209};209};
210210
211/**211/**
...@@ -265,7 +265,7 @@ struct fw_cdev_event_iso_interrupt {...@@ -265,7 +265,7 @@ struct fw_cdev_event_iso_interrupt {
265 __u32 type;265 __u32 type;
266 __u32 cycle;266 __u32 cycle;
267 __u32 header_length;267 __u32 header_length;
268 __u32 header[0];268 __u32 header[];
269};269};
270270
271/**271/**
...@@ -355,7 +355,7 @@ struct fw_cdev_event_phy_packet {...@@ -355,7 +355,7 @@ struct fw_cdev_event_phy_packet {
355 __u32 type;355 __u32 type;
356 __u32 rcode;356 __u32 rcode;
357 __u32 length;357 __u32 length;
358 __u32 data[0];358 __u32 data[];
359};359};
360360
361/**361/**
...@@ -803,7 +803,7 @@ struct fw_cdev_set_iso_channels {...@@ -803,7 +803,7 @@ struct fw_cdev_set_iso_channels {
803 */803 */
804struct fw_cdev_iso_packet {804struct fw_cdev_iso_packet {
805 __u32 control;805 __u32 control;
806 __u32 header[0];806 __u32 header[];
807};807};
808808
809/**809/**
lib/libc/include/any-linux-any/linux/fou.h+27-29
...@@ -1,32 +1,37 @@...@@ -1,32 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2/* fou.h - FOU Interface */2/* Do not edit directly, auto-generated from: */
3/* Documentation/netlink/specs/fou.yaml */
4/* YNL-GEN uapi header */
35
4#ifndef _LINUX_FOU_H6#ifndef _LINUX_FOU_H
5#define _LINUX_FOU_H7#define _LINUX_FOU_H
68
7/* NETLINK_GENERIC related info
8 */
9#define FOU_GENL_NAME "fou"9#define FOU_GENL_NAME "fou"
10#define FOU_GENL_VERSION 0x110#define FOU_GENL_VERSION 1
1111
12enum {12enum {
13 FOU_ATTR_UNSPEC,13 FOU_ENCAP_UNSPEC,
14 FOU_ATTR_PORT, /* u16 */14 FOU_ENCAP_DIRECT,
15 FOU_ATTR_AF, /* u8 */15 FOU_ENCAP_GUE,
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,
27};16};
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
31enum {36enum {
32 FOU_CMD_UNSPEC,37 FOU_CMD_UNSPEC,
...@@ -34,15 +39,8 @@ enum {...@@ -34,15 +39,8 @@ enum {
34 FOU_CMD_DEL,39 FOU_CMD_DEL,
35 FOU_CMD_GET,40 FOU_CMD_GET,
3641
37 __FOU_CMD_MAX,42 __FOU_CMD_MAX
38};43};
3944#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)
40enum {
41 FOU_ENCAP_UNSPEC,
42 FOU_ENCAP_DIRECT,
43 FOU_ENCAP_GUE,
44};
45
46#define FOU_CMD_MAX (__FOU_CMD_MAX - 1)
4745
48#endif /* _LINUX_FOU_H */46#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 {...@@ -86,7 +86,7 @@ struct file_dedupe_range {
86 __u16 dest_count; /* in - total elements in info array */86 __u16 dest_count; /* in - total elements in info array */
87 __u16 reserved1; /* must be zero */87 __u16 reserved1; /* must be zero */
88 __u32 reserved2; /* must be zero */88 __u32 reserved2; /* must be zero */
89 struct file_dedupe_range_info info[0];89 struct file_dedupe_range_info info[];
90};90};
9191
92/* And dynamically-tunable limits and defaults: */92/* And dynamically-tunable limits and defaults: */
lib/libc/include/any-linux-any/linux/fscrypt.h+4-3
...@@ -26,8 +26,11 @@...@@ -26,8 +26,11 @@
26#define FSCRYPT_MODE_AES_256_CTS 426#define FSCRYPT_MODE_AES_256_CTS 4
27#define FSCRYPT_MODE_AES_128_CBC 527#define FSCRYPT_MODE_AES_128_CBC 5
28#define FSCRYPT_MODE_AES_128_CTS 628#define FSCRYPT_MODE_AES_128_CTS 6
29#define FSCRYPT_MODE_SM4_XTS 7
30#define FSCRYPT_MODE_SM4_CTS 8
29#define FSCRYPT_MODE_ADIANTUM 931#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
32/*35/*
33 * Legacy policy version; ad-hoc KDF and no key verification.36 * Legacy policy version; ad-hoc KDF and no key verification.
...@@ -183,8 +186,6 @@ struct fscrypt_get_key_status_arg {...@@ -183,8 +186,6 @@ struct fscrypt_get_key_status_arg {
183#define FS_ENCRYPTION_MODE_AES_256_CTS FSCRYPT_MODE_AES_256_CTS186#define FS_ENCRYPTION_MODE_AES_256_CTS FSCRYPT_MODE_AES_256_CTS
184#define FS_ENCRYPTION_MODE_AES_128_CBC FSCRYPT_MODE_AES_128_CBC187#define FS_ENCRYPTION_MODE_AES_128_CBC FSCRYPT_MODE_AES_128_CBC
185#define FS_ENCRYPTION_MODE_AES_128_CTS FSCRYPT_MODE_AES_128_CTS188#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 */
188#define FS_ENCRYPTION_MODE_ADIANTUM FSCRYPT_MODE_ADIANTUM189#define FS_ENCRYPTION_MODE_ADIANTUM FSCRYPT_MODE_ADIANTUM
189#define FS_KEY_DESC_PREFIX FSCRYPT_KEY_DESC_PREFIX190#define FS_KEY_DESC_PREFIX FSCRYPT_KEY_DESC_PREFIX
190#define FS_KEY_DESC_PREFIX_SIZE FSCRYPT_KEY_DESC_PREFIX_SIZE191#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 {...@@ -55,4 +55,18 @@ struct scom_access {
55#define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)55#define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)
56#define FSI_SCOM_RESET _IOW('s', 0x03, __u32)56#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
58#endif /* _LINUX_FSI_H */72#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 {...@@ -69,7 +69,7 @@ struct fsmap_head {
69};69};
7070
71/* Size of an fsmap_head with room for nr records. */71/* Size of an fsmap_head with room for nr records. */
72static __inline__ size_t72static __inline__ __kernel_size_t
73fsmap_sizeof(73fsmap_sizeof(
74 unsigned int nr)74 unsigned int nr)
75{75{
lib/libc/include/any-linux-any/linux/fuse.h+112-6
...@@ -187,6 +187,25 @@...@@ -187,6 +187,25 @@
187 *187 *
188 * 7.35188 * 7.35
189 * - add FOPEN_NOFLUSH189 * - 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
190 */209 */
191210
192#ifndef _LINUX_FUSE_H211#ifndef _LINUX_FUSE_H
...@@ -218,7 +237,7 @@...@@ -218,7 +237,7 @@
218#define FUSE_KERNEL_VERSION 7237#define FUSE_KERNEL_VERSION 7
219238
220/** Minor version number of this interface */239/** Minor version number of this interface */
221#define FUSE_KERNEL_MINOR_VERSION 35240#define FUSE_KERNEL_MINOR_VERSION 38
222241
223/** The node ID of the root inode */242/** The node ID of the root inode */
224#define FUSE_ROOT_ID 1243#define FUSE_ROOT_ID 1
...@@ -290,6 +309,7 @@ struct fuse_file_lock {...@@ -290,6 +309,7 @@ struct fuse_file_lock {
290 * FOPEN_CACHE_DIR: allow caching this directory309 * FOPEN_CACHE_DIR: allow caching this directory
291 * FOPEN_STREAM: the file is stream-like (no file position at all)310 * FOPEN_STREAM: the file is stream-like (no file position at all)
292 * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE)311 * 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
293 */313 */
294#define FOPEN_DIRECT_IO (1 << 0)314#define FOPEN_DIRECT_IO (1 << 0)
295#define FOPEN_KEEP_CACHE (1 << 1)315#define FOPEN_KEEP_CACHE (1 << 1)
...@@ -297,6 +317,7 @@ struct fuse_file_lock {...@@ -297,6 +317,7 @@ struct fuse_file_lock {
297#define FOPEN_CACHE_DIR (1 << 3)317#define FOPEN_CACHE_DIR (1 << 3)
298#define FOPEN_STREAM (1 << 4)318#define FOPEN_STREAM (1 << 4)
299#define FOPEN_NOFLUSH (1 << 5)319#define FOPEN_NOFLUSH (1 << 5)
320#define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
300321
301/**322/**
302 * INIT request/reply flags323 * INIT request/reply flags
...@@ -337,6 +358,13 @@ struct fuse_file_lock {...@@ -337,6 +358,13 @@ struct fuse_file_lock {
337 * write/truncate sgid is killed only if file has group358 * write/truncate sgid is killed only if file has group
338 * execute permission. (Same as Linux VFS behavior).359 * execute permission. (Same as Linux VFS behavior).
339 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in360 * 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)
340 */368 */
341#define FUSE_ASYNC_READ (1 << 0)369#define FUSE_ASYNC_READ (1 << 0)
342#define FUSE_POSIX_LOCKS (1 << 1)370#define FUSE_POSIX_LOCKS (1 << 1)
...@@ -368,6 +396,12 @@ struct fuse_file_lock {...@@ -368,6 +396,12 @@ struct fuse_file_lock {
368#define FUSE_SUBMOUNTS (1 << 27)396#define FUSE_SUBMOUNTS (1 << 27)
369#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)397#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
370#define FUSE_SETXATTR_EXT (1 << 29)398#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
372/**406/**
373 * CUSE INIT request/reply flags407 * CUSE INIT request/reply flags
...@@ -450,8 +484,10 @@ struct fuse_file_lock {...@@ -450,8 +484,10 @@ struct fuse_file_lock {
450 * fuse_attr flags484 * fuse_attr flags
451 *485 *
452 * FUSE_ATTR_SUBMOUNT: Object is a submount root486 * FUSE_ATTR_SUBMOUNT: Object is a submount root
487 * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode
453 */488 */
454#define FUSE_ATTR_SUBMOUNT (1 << 0)489#define FUSE_ATTR_SUBMOUNT (1 << 0)
490#define FUSE_ATTR_DAX (1 << 1)
455491
456/**492/**
457 * Open flags493 * Open flags
...@@ -465,6 +501,23 @@ struct fuse_file_lock {...@@ -465,6 +501,23 @@ struct fuse_file_lock {
465 */501 */
466#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)502#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
468enum fuse_opcode {521enum fuse_opcode {
469 FUSE_LOOKUP = 1,522 FUSE_LOOKUP = 1,
470 FUSE_FORGET = 2, /* no reply */523 FUSE_FORGET = 2, /* no reply */
...@@ -514,6 +567,7 @@ enum fuse_opcode {...@@ -514,6 +567,7 @@ enum fuse_opcode {
514 FUSE_SETUPMAPPING = 48,567 FUSE_SETUPMAPPING = 48,
515 FUSE_REMOVEMAPPING = 49,568 FUSE_REMOVEMAPPING = 49,
516 FUSE_SYNCFS = 50,569 FUSE_SYNCFS = 50,
570 FUSE_TMPFILE = 51,
517571
518 /* CUSE specific operations */572 /* CUSE specific operations */
519 CUSE_INIT = 4096,573 CUSE_INIT = 4096,
...@@ -737,6 +791,8 @@ struct fuse_init_in {...@@ -737,6 +791,8 @@ struct fuse_init_in {
737 uint32_t minor;791 uint32_t minor;
738 uint32_t max_readahead;792 uint32_t max_readahead;
739 uint32_t flags;793 uint32_t flags;
794 uint32_t flags2;
795 uint32_t unused[11];
740};796};
741797
742#define FUSE_COMPAT_INIT_OUT_SIZE 8798#define FUSE_COMPAT_INIT_OUT_SIZE 8
...@@ -753,7 +809,8 @@ struct fuse_init_out {...@@ -753,7 +809,8 @@ struct fuse_init_out {
753 uint32_t time_gran;809 uint32_t time_gran;
754 uint16_t max_pages;810 uint16_t max_pages;
755 uint16_t map_alignment;811 uint16_t map_alignment;
756 uint32_t unused[8];812 uint32_t flags2;
813 uint32_t unused[7];
757};814};
758815
759#define CUSE_INIT_INFO_MAX 4096816#define CUSE_INIT_INFO_MAX 4096
...@@ -844,7 +901,8 @@ struct fuse_in_header {...@@ -844,7 +901,8 @@ struct fuse_in_header {
844 uint32_t uid;901 uint32_t uid;
845 uint32_t gid;902 uint32_t gid;
846 uint32_t pid;903 uint32_t pid;
847 uint32_t padding;904 uint16_t total_extlen; /* length of extensions in 8byte units */
905 uint16_t padding;
848};906};
849907
850struct fuse_out_header {908struct fuse_out_header {
...@@ -861,9 +919,12 @@ struct fuse_dirent {...@@ -861,9 +919,12 @@ struct fuse_dirent {
861 char name[];919 char name[];
862};920};
863921
864#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)922/* Align variable length records to 64bit boundary */
865#define FUSE_DIRENT_ALIGN(x) \923#define FUSE_REC_ALIGN(x) \
866 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))924 (((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)
867#define FUSE_DIRENT_SIZE(d) \928#define FUSE_DIRENT_SIZE(d) \
868 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)929 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
869930
...@@ -886,7 +947,7 @@ struct fuse_notify_inval_inode_out {...@@ -886,7 +947,7 @@ struct fuse_notify_inval_inode_out {
886struct fuse_notify_inval_entry_out {947struct fuse_notify_inval_entry_out {
887 uint64_t parent;948 uint64_t parent;
888 uint32_t namelen;949 uint32_t namelen;
889 uint32_t padding;950 uint32_t flags;
890};951};
891952
892struct fuse_notify_delete_out {953struct fuse_notify_delete_out {
...@@ -980,4 +1041,49 @@ struct fuse_syncfs_in {...@@ -980,4 +1041,49 @@ struct fuse_syncfs_in {
980 uint64_t padding;1041 uint64_t padding;
981};1042};
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
983#endif /* _LINUX_FUSE_H */1089#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 {...@@ -87,6 +87,8 @@ enum {
87 __CTRL_ATTR_MCAST_GRP_MAX,87 __CTRL_ATTR_MCAST_GRP_MAX,
88};88};
8989
90#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
91
90enum {92enum {
91 CTRL_ATTR_POLICY_UNSPEC,93 CTRL_ATTR_POLICY_UNSPEC,
92 CTRL_ATTR_POLICY_DO,94 CTRL_ATTR_POLICY_DO,
...@@ -96,7 +98,6 @@ enum {...@@ -96,7 +98,6 @@ enum {
96 CTRL_ATTR_POLICY_DUMP_MAX = __CTRL_ATTR_POLICY_DUMP_MAX - 198 CTRL_ATTR_POLICY_DUMP_MAX = __CTRL_ATTR_POLICY_DUMP_MAX - 1
97};99};
98100
99#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)101#define CTRL_ATTR_POLICY_MAX (__CTRL_ATTR_POLICY_DUMP_MAX - 1)
100
101102
102#endif /* __LINUX_GENERIC_NETLINK_H */103#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 {...@@ -66,6 +66,8 @@ struct gpiochip_info {
66 * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled66 * @GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN: line has pull-down bias enabled
67 * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled67 * @GPIO_V2_LINE_FLAG_BIAS_DISABLED: line has bias disabled
68 * @GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME: line events contain REALTIME timestamps68 * @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
69 */71 */
70enum gpio_v2_line_flag {72enum gpio_v2_line_flag {
71 GPIO_V2_LINE_FLAG_USED = _BITULL(0),73 GPIO_V2_LINE_FLAG_USED = _BITULL(0),
...@@ -80,6 +82,7 @@ enum gpio_v2_line_flag {...@@ -80,6 +82,7 @@ enum gpio_v2_line_flag {
80 GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN = _BITULL(9),82 GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN = _BITULL(9),
81 GPIO_V2_LINE_FLAG_BIAS_DISABLED = _BITULL(10),83 GPIO_V2_LINE_FLAG_BIAS_DISABLED = _BITULL(10),
82 GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME = _BITULL(11),84 GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME = _BITULL(11),
85 GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE = _BITULL(12),
83};86};
8487
85/**88/**
lib/libc/include/any-linux-any/linux/gsmmux.h+13-4
...@@ -19,8 +19,7 @@ struct gsm_config...@@ -19,8 +19,7 @@ struct gsm_config
19 unsigned int mtu;19 unsigned int mtu;
20 unsigned int k;20 unsigned int k;
21 unsigned int i;21 unsigned int i;
22 unsigned int unused[8]; /* Padding for expansion without22 unsigned int unused[8]; /* Can not be used */
23 breaking stuff */
24};23};
2524
26#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)25#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
...@@ -29,9 +28,9 @@ struct gsm_config...@@ -29,9 +28,9 @@ struct gsm_config
29struct gsm_netconfig {28struct gsm_netconfig {
30 unsigned int adaption; /* Adaption to use in network mode */29 unsigned int adaption; /* Adaption to use in network mode */
31 unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */30 unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */
32 unsigned short unused2;31 unsigned short unused2; /* Can not be used */
33 char if_name[IFNAMSIZ]; /* interface name format string */32 char if_name[IFNAMSIZ]; /* interface name format string */
34 __u8 unused[28]; /* For future use */33 __u8 unused[28]; /* Can not be used */
35};34};
3635
37#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)36#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
...@@ -40,4 +39,14 @@ struct gsm_netconfig {...@@ -40,4 +39,14 @@ struct gsm_netconfig {
40/* get the base tty number for a configured gsmmux tty */39/* get the base tty number for a configured gsmmux tty */
41#define GSMIOC_GETFIRST _IOR('G', 4, __u32)40#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
43#endif52#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 {...@@ -8,6 +8,7 @@ enum gtp_genl_cmds {
8 GTP_CMD_NEWPDP,8 GTP_CMD_NEWPDP,
9 GTP_CMD_DELPDP,9 GTP_CMD_DELPDP,
10 GTP_CMD_GETPDP,10 GTP_CMD_GETPDP,
11 GTP_CMD_ECHOREQ,
1112
12 GTP_CMD_MAX,13 GTP_CMD_MAX,
13};14};
lib/libc/include/any-linux-any/linux/hid.h+20-6
...@@ -42,16 +42,30 @@...@@ -42,16 +42,30 @@
42#define USB_INTERFACE_PROTOCOL_KEYBOARD 142#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
43#define USB_INTERFACE_PROTOCOL_MOUSE 243#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
45/*57/*
46 * HID class requests58 * HID class requests
47 */59 */
4860
49#define HID_REQ_GET_REPORT 0x0161enum hid_class_request {
50#define HID_REQ_GET_IDLE 0x0262 HID_REQ_GET_REPORT = 0x01,
51#define HID_REQ_GET_PROTOCOL 0x0363 HID_REQ_GET_IDLE = 0x02,
52#define HID_REQ_SET_REPORT 0x0964 HID_REQ_GET_PROTOCOL = 0x03,
53#define HID_REQ_SET_IDLE 0x0A65 HID_REQ_SET_REPORT = 0x09,
54#define HID_REQ_SET_PROTOCOL 0x0B66 HID_REQ_SET_IDLE = 0x0A,
67 HID_REQ_SET_PROTOCOL = 0x0B,
68};
5569
56/*70/*
57 * HID class descriptor types71 * HID class descriptor types
lib/libc/include/any-linux-any/linux/hsi/cs-protocol.h-14
...@@ -6,20 +6,6 @@...@@ -6,20 +6,6 @@
6 *6 *
7 * Contact: Kai Vehmanen <kai.vehmanen@nokia.com>7 * Contact: Kai Vehmanen <kai.vehmanen@nokia.com>
8 * Original author: Peter Ujfalusi <peter.ujfalusi@nokia.com>8 * 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
23 */9 */
2410
25#ifndef _CS_PROTOCOL_H11#ifndef _CS_PROTOCOL_H
lib/libc/include/any-linux-any/linux/hsi/hsi_char.h-14
...@@ -5,20 +5,6 @@...@@ -5,20 +5,6 @@
5 * Copyright (C) 2010 Nokia Corporation. All rights reserved.5 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
6 *6 *
7 * Contact: Andras Domokos <andras.domokos at nokia.com>7 * 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
22 */8 */
239
24#ifndef __HSI_CHAR_H10#ifndef __HSI_CHAR_H
lib/libc/include/any-linux-any/linux/hyperv.h+11
...@@ -90,6 +90,17 @@ struct hv_vss_check_dm_info {...@@ -90,6 +90,17 @@ struct hv_vss_check_dm_info {
90 __u32 flags;90 __u32 flags;
91} __attribute__((packed));91} __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 */
93struct hv_vss_msg {104struct hv_vss_msg {
94 union {105 union {
95 struct hv_vss_hdr vss_hdr;106 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 {...@@ -24,6 +24,8 @@ enum idxd_scmd_stat {
24 IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,24 IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,
25 IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,25 IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,
26 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,26 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
27 IDXD_SCMD_WQ_IRQ_ERR = 0x80100000,
28 IDXD_SCMD_WQ_USER_NO_IOMMU = 0x80110000,
27};29};
2830
29#define IDXD_SCMD_SOFTERR_MASK 0x8000000031#define IDXD_SCMD_SOFTERR_MASK 0x80000000
...@@ -48,6 +50,11 @@ enum idxd_scmd_stat {...@@ -48,6 +50,11 @@ enum idxd_scmd_stat {
4850
49/* IAX */51/* IAX */
50#define IDXD_OP_FLAG_RD_SRC2_AECS 0x01000052#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
52/* Opcode */59/* Opcode */
53enum dsa_opcode {60enum dsa_opcode {
...@@ -76,6 +83,18 @@ enum iax_opcode {...@@ -76,6 +83,18 @@ enum iax_opcode {
76 IAX_OPCODE_MEMMOVE,83 IAX_OPCODE_MEMMOVE,
77 IAX_OPCODE_DECOMPRESS = 0x42,84 IAX_OPCODE_DECOMPRESS = 0x42,
78 IAX_OPCODE_COMPRESS,85 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,
79};98};
8099
81/* Completion record status */100/* Completion record status */
...@@ -115,6 +134,7 @@ enum iax_completion_status {...@@ -115,6 +134,7 @@ enum iax_completion_status {
115 IAX_COMP_NONE = 0,134 IAX_COMP_NONE = 0,
116 IAX_COMP_SUCCESS,135 IAX_COMP_SUCCESS,
117 IAX_COMP_PAGE_FAULT_IR = 0x04,136 IAX_COMP_PAGE_FAULT_IR = 0x04,
137 IAX_COMP_ANALYTICS_ERROR = 0x0a,
118 IAX_COMP_OUTBUF_OVERFLOW,138 IAX_COMP_OUTBUF_OVERFLOW,
119 IAX_COMP_BAD_OPCODE = 0x10,139 IAX_COMP_BAD_OPCODE = 0x10,
120 IAX_COMP_INVALID_FLAGS,140 IAX_COMP_INVALID_FLAGS,
...@@ -135,7 +155,10 @@ enum iax_completion_status {...@@ -135,7 +155,10 @@ enum iax_completion_status {
135 IAX_COMP_WATCHDOG,155 IAX_COMP_WATCHDOG,
136 IAX_COMP_INVALID_COMP_FLAG = 0x30,156 IAX_COMP_INVALID_COMP_FLAG = 0x30,
137 IAX_COMP_INVALID_FILTER_FLAG,157 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,
139};162};
140163
141#define DSA_COMP_STATUS_MASK 0x7f164#define DSA_COMP_STATUS_MASK 0x7f
...@@ -268,7 +291,7 @@ struct dsa_completion_record {...@@ -268,7 +291,7 @@ struct dsa_completion_record {
268 };291 };
269292
270 uint32_t delta_rec_size;293 uint32_t delta_rec_size;
271 uint32_t crc_val;294 uint64_t crc_val;
272295
273 /* DIF check & strip */296 /* DIF check & strip */
274 struct {297 struct {
...@@ -314,8 +337,12 @@ struct iax_completion_record {...@@ -314,8 +337,12 @@ struct iax_completion_record {
314 uint32_t output_size;337 uint32_t output_size;
315 uint8_t output_bits;338 uint8_t output_bits;
316 uint8_t rsvd3;339 uint8_t rsvd3;
317 uint16_t rsvd4;340 uint16_t xor_csum;
318 uint64_t rsvd5[4];341 uint32_t crc;
342 uint32_t min;
343 uint32_t max;
344 uint32_t sum;
345 uint64_t rsvd4[2];
319} __attribute__((packed));346} __attribute__((packed));
320347
321struct iax_raw_completion_record {348struct iax_raw_completion_record {
lib/libc/include/any-linux-any/linux/if_addr.h+8-1
...@@ -33,8 +33,9 @@ enum {...@@ -33,8 +33,9 @@ enum {
33 IFA_CACHEINFO,33 IFA_CACHEINFO,
34 IFA_MULTICAST,34 IFA_MULTICAST,
35 IFA_FLAGS,35 IFA_FLAGS,
36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */36 IFA_RT_PRIORITY, /* u32, priority/metric for prefix route */
37 IFA_TARGET_NETNSID,37 IFA_TARGET_NETNSID,
38 IFA_PROTO, /* u8, address protocol */
38 __IFA_MAX,39 __IFA_MAX,
39};40};
4041
...@@ -67,4 +68,10 @@ struct ifa_cacheinfo {...@@ -67,4 +68,10 @@ struct ifa_cacheinfo {
67#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))68#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
68#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))69#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
70#endif77#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 {...@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
4242
43struct af_alg_iv {43struct af_alg_iv {
44 __u32 ivlen;44 __u32 ivlen;
45 __u8 iv[0];45 __u8 iv[];
46};46};
4747
48/* Socket options */48/* Socket options */
...@@ -52,6 +52,7 @@ struct af_alg_iv {...@@ -52,6 +52,7 @@ struct af_alg_iv {
52#define ALG_SET_AEAD_ASSOCLEN 452#define ALG_SET_AEAD_ASSOCLEN 4
53#define ALG_SET_AEAD_AUTHSIZE 553#define ALG_SET_AEAD_AUTHSIZE 5
54#define ALG_SET_DRBG_ENTROPY 654#define ALG_SET_DRBG_ENTROPY 6
55#define ALG_SET_KEY_BY_KEY_SERIAL 7
5556
56/* Operations */57/* Operations */
57#define ALG_OP_DECRYPT 058#define ALG_OP_DECRYPT 0
lib/libc/include/any-linux-any/linux/if_arcnet.h+3-3
...@@ -60,7 +60,7 @@ struct arc_rfc1201 {...@@ -60,7 +60,7 @@ struct arc_rfc1201 {
60 __u8 proto; /* protocol ID field - varies */60 __u8 proto; /* protocol ID field - varies */
61 __u8 split_flag; /* for use with split packets */61 __u8 split_flag; /* for use with split packets */
62 __be16 sequence; /* sequence number */62 __be16 sequence; /* sequence number */
63 __u8 payload[0]; /* space remaining in packet (504 bytes)*/63 __u8 payload[]; /* space remaining in packet (504 bytes)*/
64};64};
65#define RFC1201_HDR_SIZE 465#define RFC1201_HDR_SIZE 4
6666
...@@ -69,7 +69,7 @@ struct arc_rfc1201 {...@@ -69,7 +69,7 @@ struct arc_rfc1201 {
69 */69 */
70struct arc_rfc1051 {70struct arc_rfc1051 {
71 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */71 __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
72 __u8 payload[0]; /* 507 bytes */72 __u8 payload[]; /* 507 bytes */
73};73};
74#define RFC1051_HDR_SIZE 174#define RFC1051_HDR_SIZE 1
7575
...@@ -80,7 +80,7 @@ struct arc_rfc1051 {...@@ -80,7 +80,7 @@ struct arc_rfc1051 {
80struct arc_eth_encap {80struct arc_eth_encap {
81 __u8 proto; /* Always ARC_P_ETHER */81 __u8 proto; /* Always ARC_P_ETHER */
82 struct ethhdr eth; /* standard ethernet header (yuck!) */82 struct ethhdr eth; /* standard ethernet header (yuck!) */
83 __u8 payload[0]; /* 493 bytes */83 __u8 payload[]; /* 493 bytes */
84};84};
85#define ETH_ENCAP_HDR_SIZE 1485#define ETH_ENCAP_HDR_SIZE 14
8686
lib/libc/include/any-linux-any/linux/if_bridge.h+41
...@@ -122,6 +122,7 @@ enum {...@@ -122,6 +122,7 @@ enum {
122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,122 IFLA_BRIDGE_VLAN_TUNNEL_INFO,
123 IFLA_BRIDGE_MRP,123 IFLA_BRIDGE_MRP,
124 IFLA_BRIDGE_CFM,124 IFLA_BRIDGE_CFM,
125 IFLA_BRIDGE_MST,
125 __IFLA_BRIDGE_MAX,126 __IFLA_BRIDGE_MAX,
126};127};
127#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)128#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
...@@ -453,6 +454,21 @@ enum {...@@ -453,6 +454,21 @@ enum {
453454
454#define IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX (__IFLA_BRIDGE_CFM_CC_PEER_STATUS_MAX - 1)455#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
456struct bridge_stp_xstats {472struct bridge_stp_xstats {
457 __u64 transition_blk;473 __u64 transition_blk;
458 __u64 transition_fwd;474 __u64 transition_fwd;
...@@ -507,6 +523,8 @@ enum {...@@ -507,6 +523,8 @@ enum {
507 BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,523 BRIDGE_VLANDB_ENTRY_TUNNEL_INFO,
508 BRIDGE_VLANDB_ENTRY_STATS,524 BRIDGE_VLANDB_ENTRY_STATS,
509 BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,525 BRIDGE_VLANDB_ENTRY_MCAST_ROUTER,
526 BRIDGE_VLANDB_ENTRY_MCAST_N_GROUPS,
527 BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS,
510 __BRIDGE_VLANDB_ENTRY_MAX,528 __BRIDGE_VLANDB_ENTRY_MAX,
511};529};
512#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)530#define BRIDGE_VLANDB_ENTRY_MAX (__BRIDGE_VLANDB_ENTRY_MAX - 1)
...@@ -564,6 +582,7 @@ enum {...@@ -564,6 +582,7 @@ enum {
564 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,582 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER,
565 BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,583 BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS,
566 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,584 BRIDGE_VLANDB_GOPTS_MCAST_QUERIER_STATE,
585 BRIDGE_VLANDB_GOPTS_MSTI,
567 __BRIDGE_VLANDB_GOPTS_MAX586 __BRIDGE_VLANDB_GOPTS_MAX
568};587};
569#define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)588#define BRIDGE_VLANDB_GOPTS_MAX (__BRIDGE_VLANDB_GOPTS_MAX - 1)
...@@ -706,10 +725,31 @@ enum {...@@ -706,10 +725,31 @@ enum {
706enum {725enum {
707 MDBE_ATTR_UNSPEC,726 MDBE_ATTR_UNSPEC,
708 MDBE_ATTR_SOURCE,727 MDBE_ATTR_SOURCE,
728 MDBE_ATTR_SRC_LIST,
729 MDBE_ATTR_GROUP_MODE,
730 MDBE_ATTR_RTPROT,
709 __MDBE_ATTR_MAX,731 __MDBE_ATTR_MAX,
710};732};
711#define MDBE_ATTR_MAX (__MDBE_ATTR_MAX - 1)733#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
713/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */753/* Embedded inside LINK_XSTATS_TYPE_BRIDGE */
714enum {754enum {
715 BRIDGE_XSTATS_UNSPEC,755 BRIDGE_XSTATS_UNSPEC,
...@@ -759,6 +799,7 @@ struct br_mcast_stats {...@@ -759,6 +799,7 @@ struct br_mcast_stats {
759enum br_boolopt_id {799enum br_boolopt_id {
760 BR_BOOLOPT_NO_LL_LEARN,800 BR_BOOLOPT_NO_LL_LEARN,
761 BR_BOOLOPT_MCAST_VLAN_SNOOPING,801 BR_BOOLOPT_MCAST_VLAN_SNOOPING,
802 BR_BOOLOPT_MST_ENABLE,
762 BR_BOOLOPT_MAX803 BR_BOOLOPT_MAX
763};804};
764805
lib/libc/include/any-linux-any/linux/if_ether.h+4
...@@ -86,8 +86,10 @@...@@ -86,8 +86,10 @@
86 * over Ethernet86 * over Ethernet
87 */87 */
88#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */88#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
89#define ETH_P_PROFINET 0x8892 /* PROFINET */
89#define ETH_P_REALTEK 0x8899 /* Multiple proprietary protocols */90#define ETH_P_REALTEK 0x8899 /* Multiple proprietary protocols */
90#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */91#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
92#define ETH_P_ETHERCAT 0x88A4 /* EtherCAT */
91#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */93#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
92#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */94#define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
93#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */95#define ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */
...@@ -114,6 +116,7 @@...@@ -114,6 +116,7 @@
114#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */116#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
115#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */117#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
116#define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */118#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 ] */
117#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */120#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */
118#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */121#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
119122
...@@ -135,6 +138,7 @@...@@ -135,6 +138,7 @@
135#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */138#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
136#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */139#define ETH_P_CAN 0x000C /* CAN: Controller Area Network */
137#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/140#define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
141#define ETH_P_CANXL 0x000E /* CANXL: eXtended frame Length */
138#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/142#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
139#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */143#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
140#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */144#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 {...@@ -211,6 +211,9 @@ struct rtnl_link_stats {
211 * @rx_nohandler: Number of packets received on the interface211 * @rx_nohandler: Number of packets received on the interface
212 * but dropped by the networking stack because the device is212 * but dropped by the networking stack because the device is
213 * not designated to receive packets (e.g. backup link in a bond).213 * 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.
214 */217 */
215struct rtnl_link_stats64 {218struct rtnl_link_stats64 {
216 __u64 rx_packets;219 __u64 rx_packets;
...@@ -243,6 +246,23 @@ struct rtnl_link_stats64 {...@@ -243,6 +246,23 @@ struct rtnl_link_stats64 {
243 __u64 rx_compressed;246 __u64 rx_compressed;
244 __u64 tx_compressed;247 __u64 tx_compressed;
245 __u64 rx_nohandler;248 __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;
246};266};
247267
248/* The struct should be in sync with struct ifmap */268/* The struct should be in sync with struct ifmap */
...@@ -347,6 +367,15 @@ enum {...@@ -347,6 +367,15 @@ enum {
347 */367 */
348 IFLA_PARENT_DEV_NAME,368 IFLA_PARENT_DEV_NAME,
349 IFLA_PARENT_DEV_BUS_NAME,369 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
351 __IFLA_MAX380 __IFLA_MAX
352};381};
...@@ -534,6 +563,10 @@ enum {...@@ -534,6 +563,10 @@ enum {
534 IFLA_BRPORT_MRP_IN_OPEN,563 IFLA_BRPORT_MRP_IN_OPEN,
535 IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,564 IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
536 IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,565 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,
537 __IFLA_BRPORT_MAX570 __IFLA_BRPORT_MAX
538};571};
539#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)572#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
...@@ -668,6 +701,7 @@ enum {...@@ -668,6 +701,7 @@ enum {
668 IFLA_XFRM_UNSPEC,701 IFLA_XFRM_UNSPEC,
669 IFLA_XFRM_LINK,702 IFLA_XFRM_LINK,
670 IFLA_XFRM_IF_ID,703 IFLA_XFRM_IF_ID,
704 IFLA_XFRM_COLLECT_METADATA,
671 __IFLA_XFRM_MAX705 __IFLA_XFRM_MAX
672};706};
673707
...@@ -709,7 +743,55 @@ enum ipvlan_mode {...@@ -709,7 +743,55 @@ enum ipvlan_mode {
709#define IPVLAN_F_PRIVATE 0x01743#define IPVLAN_F_PRIVATE 0x01
710#define IPVLAN_F_VEPA 0x02744#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
712/* VXLAN section */754/* 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
713enum {795enum {
714 IFLA_VXLAN_UNSPEC,796 IFLA_VXLAN_UNSPEC,
715 IFLA_VXLAN_ID,797 IFLA_VXLAN_ID,
...@@ -741,6 +823,7 @@ enum {...@@ -741,6 +823,7 @@ enum {
741 IFLA_VXLAN_GPE,823 IFLA_VXLAN_GPE,
742 IFLA_VXLAN_TTL_INHERIT,824 IFLA_VXLAN_TTL_INHERIT,
743 IFLA_VXLAN_DF,825 IFLA_VXLAN_DF,
826 IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
744 __IFLA_VXLAN_MAX827 __IFLA_VXLAN_MAX
745};828};
746#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)829#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
...@@ -774,6 +857,7 @@ enum {...@@ -774,6 +857,7 @@ enum {
774 IFLA_GENEVE_LABEL,857 IFLA_GENEVE_LABEL,
775 IFLA_GENEVE_TTL_INHERIT,858 IFLA_GENEVE_TTL_INHERIT,
776 IFLA_GENEVE_DF,859 IFLA_GENEVE_DF,
860 IFLA_GENEVE_INNER_PROTO_INHERIT,
777 __IFLA_GENEVE_MAX861 __IFLA_GENEVE_MAX
778};862};
779#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)863#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
...@@ -819,6 +903,8 @@ enum {...@@ -819,6 +903,8 @@ enum {
819 IFLA_GTP_FD1,903 IFLA_GTP_FD1,
820 IFLA_GTP_PDP_HASHSIZE,904 IFLA_GTP_PDP_HASHSIZE,
821 IFLA_GTP_ROLE,905 IFLA_GTP_ROLE,
906 IFLA_GTP_CREATE_SOCKETS,
907 IFLA_GTP_RESTART_COUNT,
822 __IFLA_GTP_MAX,908 __IFLA_GTP_MAX,
823};909};
824#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)910#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
...@@ -856,6 +942,8 @@ enum {...@@ -856,6 +942,8 @@ enum {
856 IFLA_BOND_TLB_DYNAMIC_LB,942 IFLA_BOND_TLB_DYNAMIC_LB,
857 IFLA_BOND_PEER_NOTIF_DELAY,943 IFLA_BOND_PEER_NOTIF_DELAY,
858 IFLA_BOND_AD_LACP_ACTIVE,944 IFLA_BOND_AD_LACP_ACTIVE,
945 IFLA_BOND_MISSED_MAX,
946 IFLA_BOND_NS_IP6_TARGET,
859 __IFLA_BOND_MAX,947 __IFLA_BOND_MAX,
860};948};
861949
...@@ -883,6 +971,7 @@ enum {...@@ -883,6 +971,7 @@ enum {
883 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,971 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
884 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,972 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
885 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,973 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
974 IFLA_BOND_SLAVE_PRIO,
886 __IFLA_BOND_SLAVE_MAX,975 __IFLA_BOND_SLAVE_MAX,
887};976};
888977
...@@ -1152,6 +1241,17 @@ enum {...@@ -1152,6 +1241,17 @@ enum {
11521241
1153#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))1242#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
1155/* These are embedded into IFLA_STATS_LINK_XSTATS:1255/* These are embedded into IFLA_STATS_LINK_XSTATS:
1156 * [IFLA_STATS_LINK_XSTATS]1256 * [IFLA_STATS_LINK_XSTATS]
1157 * -> [LINK_XSTATS_TYPE_xxx]1257 * -> [LINK_XSTATS_TYPE_xxx]
...@@ -1169,10 +1269,21 @@ enum {...@@ -1169,10 +1269,21 @@ enum {
1169enum {1269enum {
1170 IFLA_OFFLOAD_XSTATS_UNSPEC,1270 IFLA_OFFLOAD_XSTATS_UNSPEC,
1171 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */1271 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 */
1172 __IFLA_OFFLOAD_XSTATS_MAX1274 __IFLA_OFFLOAD_XSTATS_MAX
1173};1275};
1174#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)1276#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
1176/* XDP section */1287/* XDP section */
11771288
1178#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)1289#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
...@@ -1271,4 +1382,14 @@ enum {...@@ -1271,4 +1382,14 @@ enum {
12711382
1272#define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)1383#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
1274#endif /* _LINUX_IF_LINK_H */1395#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 @@...@@ -22,6 +22,8 @@
2222
23#define MACSEC_KEYID_LEN 1623#define MACSEC_KEYID_LEN 16
2424
25#define MACSEC_SALT_LEN 12
26
25/* cipher IDs as per IEEE802.1AE-2018 (Table 14-1) */27/* cipher IDs as per IEEE802.1AE-2018 (Table 14-1) */
26#define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL28#define MACSEC_CIPHER_ID_GCM_AES_128 0x0080C20001000001ULL
27#define MACSEC_CIPHER_ID_GCM_AES_256 0x0080C20001000002ULL29#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 {...@@ -70,6 +70,7 @@ struct sockaddr_ll {
70#define PACKET_FANOUT_EBPF 770#define PACKET_FANOUT_EBPF 7
71#define PACKET_FANOUT_FLAG_ROLLOVER 0x100071#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
72#define PACKET_FANOUT_FLAG_UNIQUEID 0x200072#define PACKET_FANOUT_FLAG_UNIQUEID 0x2000
73#define PACKET_FANOUT_FLAG_IGNORE_OUTGOING 0x4000
73#define PACKET_FANOUT_FLAG_DEFRAG 0x800074#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
7475
75struct tpacket_stats {76struct tpacket_stats {
...@@ -114,6 +115,7 @@ struct tpacket_auxdata {...@@ -114,6 +115,7 @@ struct tpacket_auxdata {
114#define TP_STATUS_BLK_TMO (1 << 5)115#define TP_STATUS_BLK_TMO (1 << 5)
115#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */116#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
116#define TP_STATUS_CSUM_VALID (1 << 7)117#define TP_STATUS_CSUM_VALID (1 << 7)
118#define TP_STATUS_GSO_TCP (1 << 8)
117119
118/* Tx ring - header status */120/* Tx ring - header status */
119#define TP_STATUS_AVAILABLE 0121#define TP_STATUS_AVAILABLE 0
lib/libc/include/any-linux-any/linux/if_pppox.h+2-2
...@@ -122,7 +122,7 @@ struct sockaddr_pppol2tpv3in6 {...@@ -122,7 +122,7 @@ struct sockaddr_pppol2tpv3in6 {
122struct pppoe_tag {122struct pppoe_tag {
123 __be16 tag_type;123 __be16 tag_type;
124 __be16 tag_len;124 __be16 tag_len;
125 char tag_data[0];125 char tag_data[];
126} __attribute__ ((packed));126} __attribute__ ((packed));
127127
128/* Tag identifiers */128/* Tag identifiers */
...@@ -150,7 +150,7 @@ struct pppoe_hdr {...@@ -150,7 +150,7 @@ struct pppoe_hdr {
150 __u8 code;150 __u8 code;
151 __be16 sid;151 __be16 sid;
152 __be16 length;152 __be16 length;
153 struct pppoe_tag tag[0];153 struct pppoe_tag tag[];
154} __attribute__((packed));154} __attribute__((packed));
155155
156/* Length of entire PPPoE + PPP header */156/* Length of entire PPPoE + PPP header */
lib/libc/include/any-linux-any/linux/if_tun.h+5-1
...@@ -67,6 +67,8 @@...@@ -67,6 +67,8 @@
67#define IFF_TAP 0x000267#define IFF_TAP 0x0002
68#define IFF_NAPI 0x001068#define IFF_NAPI 0x0010
69#define IFF_NAPI_FRAGS 0x002069#define IFF_NAPI_FRAGS 0x0020
70/* Used in TUNSETIFF to bring up tun/tap without carrier */
71#define IFF_NO_CARRIER 0x0040
70#define IFF_NO_PI 0x100072#define IFF_NO_PI 0x1000
71/* This flag has no real effect */73/* This flag has no real effect */
72#define IFF_ONE_QUEUE 0x200074#define IFF_ONE_QUEUE 0x2000
...@@ -88,6 +90,8 @@...@@ -88,6 +90,8 @@
88#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */90#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
89#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */91#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
90#define TUN_F_UFO 0x10 /* I can handle UFO packets */92#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
92/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */96/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
93#define TUN_PKT_STRIP 0x000197#define TUN_PKT_STRIP 0x0001
...@@ -108,7 +112,7 @@ struct tun_pi {...@@ -108,7 +112,7 @@ struct tun_pi {
108struct tun_filter {112struct tun_filter {
109 __u16 flags; /* TUN_FLT_ flags see above */113 __u16 flags; /* TUN_FLT_ flags see above */
110 __u16 count; /* Number of addresses */114 __u16 count; /* Number of addresses */
111 __u8 addr[0][ETH_ALEN];115 __u8 addr[][ETH_ALEN];
112};116};
113117
114#endif /* __IF_TUN_H */118#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 {...@@ -176,8 +176,10 @@ enum {
176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)176#define TUNNEL_VXLAN_OPT __cpu_to_be16(0x1000)
177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)177#define TUNNEL_NOCACHE __cpu_to_be16(0x2000)
178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)178#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
179#define TUNNEL_GTP_OPT __cpu_to_be16(0x8000)
179180
180#define TUNNEL_OPTIONS_PRESENT \181#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
183#endif /* _IF_TUNNEL_H_ */185#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 {...@@ -48,7 +48,7 @@ struct igmpv3_grec {
48 __u8 grec_auxwords;48 __u8 grec_auxwords;
49 __be16 grec_nsrcs;49 __be16 grec_nsrcs;
50 __be32 grec_mca;50 __be32 grec_mca;
51 __be32 grec_src[0];51 __be32 grec_src[];
52};52};
5353
54struct igmpv3_report {54struct igmpv3_report {
...@@ -57,7 +57,7 @@ struct igmpv3_report {...@@ -57,7 +57,7 @@ struct igmpv3_report {
57 __sum16 csum;57 __sum16 csum;
58 __be16 resv2;58 __be16 resv2;
59 __be16 ngrec;59 __be16 ngrec;
60 struct igmpv3_grec grec[0];60 struct igmpv3_grec grec[];
61};61};
6262
63struct igmpv3_query {63struct igmpv3_query {
...@@ -78,7 +78,7 @@ struct igmpv3_query {...@@ -78,7 +78,7 @@ struct igmpv3_query {
78#endif78#endif
79 __u8 qqic;79 __u8 qqic;
80 __be16 nsrcs;80 __be16 nsrcs;
81 __be32 srcs[0];81 __be32 srcs[];
82};82};
8383
84#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */84#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 {...@@ -95,6 +95,12 @@ enum iio_modifier {
95 IIO_MOD_ETHANOL,95 IIO_MOD_ETHANOL,
96 IIO_MOD_H2,96 IIO_MOD_H2,
97 IIO_MOD_O2,97 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,
98};104};
99105
100enum iio_event_type {106enum iio_event_type {
...@@ -104,6 +110,8 @@ enum iio_event_type {...@@ -104,6 +110,8 @@ enum iio_event_type {
104 IIO_EV_TYPE_THRESH_ADAPTIVE,110 IIO_EV_TYPE_THRESH_ADAPTIVE,
105 IIO_EV_TYPE_MAG_ADAPTIVE,111 IIO_EV_TYPE_MAG_ADAPTIVE,
106 IIO_EV_TYPE_CHANGE,112 IIO_EV_TYPE_CHANGE,
113 IIO_EV_TYPE_MAG_REFERENCED,
114 IIO_EV_TYPE_GESTURE,
107};115};
108116
109enum iio_event_direction {117enum iio_event_direction {
...@@ -111,6 +119,8 @@ enum iio_event_direction {...@@ -111,6 +119,8 @@ enum iio_event_direction {
111 IIO_EV_DIR_RISING,119 IIO_EV_DIR_RISING,
112 IIO_EV_DIR_FALLING,120 IIO_EV_DIR_FALLING,
113 IIO_EV_DIR_NONE,121 IIO_EV_DIR_NONE,
122 IIO_EV_DIR_SINGLETAP,
123 IIO_EV_DIR_DOUBLETAP,
114};124};
115125
116#endif /* _IIO_TYPES_H_ */126#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 @@...@@ -20,6 +20,7 @@
20#define _LINUX_IN_H20#define _LINUX_IN_H
2121
22#include <linux/types.h>22#include <linux/types.h>
23#include <linux/stddef.h>
23#include <linux/libc-compat.h>24#include <linux/libc-compat.h>
24#include <linux/socket.h>25#include <linux/socket.h>
2526
...@@ -68,6 +69,8 @@ enum {...@@ -68,6 +69,8 @@ enum {
68#define IPPROTO_PIM IPPROTO_PIM69#define IPPROTO_PIM IPPROTO_PIM
69 IPPROTO_COMP = 108, /* Compression Header Protocol */70 IPPROTO_COMP = 108, /* Compression Header Protocol */
70#define IPPROTO_COMP IPPROTO_COMP71#define IPPROTO_COMP IPPROTO_COMP
72 IPPROTO_L2TP = 115, /* Layer 2 Tunnelling Protocol */
73#define IPPROTO_L2TP IPPROTO_L2TP
71 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */74 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
72#define IPPROTO_SCTP IPPROTO_SCTP75#define IPPROTO_SCTP IPPROTO_SCTP
73 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */76 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
...@@ -159,6 +162,8 @@ struct in_addr {...@@ -159,6 +162,8 @@ struct in_addr {
159#define MCAST_MSFILTER 48162#define MCAST_MSFILTER 48
160#define IP_MULTICAST_ALL 49163#define IP_MULTICAST_ALL 49
161#define IP_UNICAST_IF 50164#define IP_UNICAST_IF 50
165#define IP_LOCAL_PORT_RANGE 51
166#define IP_PROTOCOL 52
162167
163#define MCAST_EXCLUDE 0168#define MCAST_EXCLUDE 0
164#define MCAST_INCLUDE 1169#define MCAST_INCLUDE 1
...@@ -188,21 +193,13 @@ struct ip_mreq_source {...@@ -188,21 +193,13 @@ struct ip_mreq_source {
188};193};
189194
190struct ip_msfilter {195struct ip_msfilter {
196 __be32 imsf_multiaddr;
197 __be32 imsf_interface;
198 __u32 imsf_fmode;
199 __u32 imsf_numsrc;
191 union {200 union {
192 struct {201 __be32 imsf_slist[1];
193 __be32 imsf_multiaddr_aux;202 __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
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 };
206 };203 };
207};204};
208205
lib/libc/include/any-linux-any/linux/inet_diag.h+1-1
...@@ -104,7 +104,7 @@ struct inet_diag_hostcond {...@@ -104,7 +104,7 @@ struct inet_diag_hostcond {
104 __u8 family;104 __u8 family;
105 __u8 prefix_len;105 __u8 prefix_len;
106 int port;106 int port;
107 __be32 addr[0];107 __be32 addr[];
108};108};
109109
110struct inet_diag_markcond {110struct inet_diag_markcond {
lib/libc/include/any-linux-any/linux/inotify.h+1-1
...@@ -23,7 +23,7 @@ struct inotify_event {...@@ -23,7 +23,7 @@ struct inotify_event {
23 __u32 mask; /* watch mask */23 __u32 mask; /* watch mask */
24 __u32 cookie; /* cookie to synchronize two events */24 __u32 cookie; /* cookie to synchronize two events */
25 __u32 len; /* length (including nulls) of name */25 __u32 len; /* length (including nulls) of name */
26 char name[0]; /* stub for possible name */26 char name[]; /* stub for possible name */
27};27};
2828
29/* the following are legal, implemented events that user-space can watch for */29/* 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 @@...@@ -278,7 +278,8 @@
278#define KEY_PAUSECD 201278#define KEY_PAUSECD 201
279#define KEY_PROG3 202279#define KEY_PROG3 202
280#define KEY_PROG4 203280#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
282#define KEY_SUSPEND 205283#define KEY_SUSPEND 205
283#define KEY_CLOSE 206 /* AC Close */284#define KEY_CLOSE 206 /* AC Close */
284#define KEY_PLAY 207285#define KEY_PLAY 207
...@@ -612,6 +613,10 @@...@@ -612,6 +613,10 @@
612#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */613#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
613#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */614#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
614#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */615#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
616#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */621#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
617#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */622#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
...@@ -660,6 +665,27 @@...@@ -660,6 +665,27 @@
660/* Select an area of screen to be copied */665/* Select an area of screen to be copied */
661#define KEY_SELECTIVE_SCREENSHOT 0x27a666#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
663/*689/*
664 * Some keyboards have keys which do not have a defined meaning, these keys690 * Some keyboards have keys which do not have a defined meaning, these keys
665 * are intended to be programmed / bound to macros by the user. For most691 * are intended to be programmed / bound to macros by the user. For most
...@@ -839,6 +865,7 @@...@@ -839,6 +865,7 @@
839#define ABS_TOOL_WIDTH 0x1c865#define ABS_TOOL_WIDTH 0x1c
840866
841#define ABS_VOLUME 0x20867#define ABS_VOLUME 0x20
868#define ABS_PROFILE 0x21
842869
843#define ABS_MISC 0x28870#define ABS_MISC 0x28
844871
lib/libc/include/any-linux-any/linux/input.h+8-4
...@@ -76,10 +76,13 @@ struct input_id {...@@ -76,10 +76,13 @@ struct input_id {
76 * Note that input core does not clamp reported values to the76 * Note that input core does not clamp reported values to the
77 * [minimum, maximum] limits, such task is left to userspace.77 * [minimum, maximum] limits, such task is left to userspace.
78 *78 *
79 * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z)79 * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z,
80 * is reported in units per millimeter (units/mm), resolution80 * ABS_MT_POSITION_X, ABS_MT_POSITION_Y) is reported in units
81 * for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported81 * per millimeter (units/mm), resolution for rotational axes
82 * in units per radian.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).
83 * When INPUT_PROP_ACCELEROMETER is set the resolution changes.86 * When INPUT_PROP_ACCELEROMETER is set the resolution changes.
84 * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in87 * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in
85 * units per g (units/g) and in units per degree per second88 * units per g (units/g) and in units per degree per second
...@@ -269,6 +272,7 @@ struct input_mask {...@@ -269,6 +272,7 @@ struct input_mask {
269#define BUS_RMI 0x1D272#define BUS_RMI 0x1D
270#define BUS_CEC 0x1E273#define BUS_CEC 0x1E
271#define BUS_INTEL_ISHTP 0x1F274#define BUS_INTEL_ISHTP 0x1F
275#define BUS_AMD_SFH 0x20
272276
273/*277/*
274 * MT_TOOL types278 * MT_TOOL types
lib/libc/include/any-linux-any/linux/io_uring.h+293-9
...@@ -10,6 +10,19 @@...@@ -10,6 +10,19 @@
1010
11#include <linux/fs.h>11#include <linux/fs.h>
12#include <linux/types.h>12#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
14/*27/*
15 * IO submission data structure (Submission Queue Entry)28 * IO submission data structure (Submission Queue Entry)
...@@ -22,6 +35,10 @@ struct io_uring_sqe {...@@ -22,6 +35,10 @@ struct io_uring_sqe {
22 union {35 union {
23 __u64 off; /* offset into file */36 __u64 off; /* offset into file */
24 __u64 addr2;37 __u64 addr2;
38 struct {
39 __u32 cmd_op;
40 __u32 __pad1;
41 };
25 };42 };
26 union {43 union {
27 __u64 addr; /* pointer to buffer or iovecs */44 __u64 addr; /* pointer to buffer or iovecs */
...@@ -45,6 +62,9 @@ struct io_uring_sqe {...@@ -45,6 +62,9 @@ struct io_uring_sqe {
45 __u32 rename_flags;62 __u32 rename_flags;
46 __u32 unlink_flags;63 __u32 unlink_flags;
47 __u32 hardlink_flags;64 __u32 hardlink_flags;
65 __u32 xattr_flags;
66 __u32 msg_ring_flags;
67 __u32 uring_cmd_flags;
48 };68 };
49 __u64 user_data; /* data to be passed back at completion time */69 __u64 user_data; /* data to be passed back at completion time */
50 /* pack this to avoid bogus arm OABI complaints */70 /* pack this to avoid bogus arm OABI complaints */
...@@ -59,10 +79,33 @@ struct io_uring_sqe {...@@ -59,10 +79,33 @@ struct io_uring_sqe {
59 union {79 union {
60 __s32 splice_fd_in;80 __s32 splice_fd_in;
61 __u32 file_index;81 __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];
62 };97 };
63 __u64 __pad2[2];
64};98};
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
66enum {109enum {
67 IOSQE_FIXED_FILE_BIT,110 IOSQE_FIXED_FILE_BIT,
68 IOSQE_IO_DRAIN_BIT,111 IOSQE_IO_DRAIN_BIT,
...@@ -70,6 +113,7 @@ enum {...@@ -70,6 +113,7 @@ enum {
70 IOSQE_IO_HARDLINK_BIT,113 IOSQE_IO_HARDLINK_BIT,
71 IOSQE_ASYNC_BIT,114 IOSQE_ASYNC_BIT,
72 IOSQE_BUFFER_SELECT_BIT,115 IOSQE_BUFFER_SELECT_BIT,
116 IOSQE_CQE_SKIP_SUCCESS_BIT,
73};117};
74118
75/*119/*
...@@ -87,6 +131,8 @@ enum {...@@ -87,6 +131,8 @@ enum {
87#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)131#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
88/* select buffer from sqe->buf_group */132/* select buffer from sqe->buf_group */
89#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)133#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
91/*137/*
92 * io_uring_setup() flags138 * io_uring_setup() flags
...@@ -98,8 +144,36 @@ enum {...@@ -98,8 +144,36 @@ enum {
98#define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */144#define IORING_SETUP_CLAMP (1U << 4) /* clamp SQ/CQ ring sizes */
99#define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */145#define IORING_SETUP_ATTACH_WQ (1U << 5) /* attach to existing wq */
100#define IORING_SETUP_R_DISABLED (1U << 6) /* start with ring disabled */146#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 {
103 IORING_OP_NOP,177 IORING_OP_NOP,
104 IORING_OP_READV,178 IORING_OP_READV,
105 IORING_OP_WRITEV,179 IORING_OP_WRITEV,
...@@ -140,11 +214,28 @@ enum {...@@ -140,11 +214,28 @@ enum {
140 IORING_OP_MKDIRAT,214 IORING_OP_MKDIRAT,
141 IORING_OP_SYMLINKAT,215 IORING_OP_SYMLINKAT,
142 IORING_OP_LINKAT,216 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
144 /* this goes last, obviously */227 /* this goes last, obviously */
145 IORING_OP_LAST,228 IORING_OP_LAST,
146};229};
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
148/*239/*
149 * sqe->fsync_flags240 * sqe->fsync_flags
150 */241 */
...@@ -177,10 +268,87 @@ enum {...@@ -177,10 +268,87 @@ enum {
177 *268 *
178 * IORING_POLL_UPDATE Update existing poll request, matching269 * IORING_POLL_UPDATE Update existing poll request, matching
179 * sqe->addr as the old user_data field.270 * sqe->addr as the old user_data field.
271 *
272 * IORING_POLL_LEVEL Level triggered poll.
180 */273 */
181#define IORING_POLL_ADD_MULTI (1U << 0)274#define IORING_POLL_ADD_MULTI (1U << 0)
182#define IORING_POLL_UPDATE_EVENTS (1U << 1)275#define IORING_POLL_UPDATE_EVENTS (1U << 1)
183#define IORING_POLL_UPDATE_USER_DATA (1U << 2)276#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
185/*353/*
186 * IO completion data structure (Completion Queue Entry)354 * IO completion data structure (Completion Queue Entry)
...@@ -189,6 +357,12 @@ struct io_uring_cqe {...@@ -189,6 +357,12 @@ struct io_uring_cqe {
189 __u64 user_data; /* sqe->data submission passed back */357 __u64 user_data; /* sqe->data submission passed back */
190 __s32 res; /* result code for this event */358 __s32 res; /* result code for this event */
191 __u32 flags;359 __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[];
192};366};
193367
194/*368/*
...@@ -196,9 +370,14 @@ struct io_uring_cqe {...@@ -196,9 +370,14 @@ struct io_uring_cqe {
196 *370 *
197 * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID371 * IORING_CQE_F_BUFFER If set, the upper 16 bits are the buffer ID
198 * IORING_CQE_F_MORE If set, parent SQE will generate more CQE entries372 * 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.
199 */376 */
200#define IORING_CQE_F_BUFFER (1U << 0)377#define IORING_CQE_F_BUFFER (1U << 0)
201#define IORING_CQE_F_MORE (1U << 1)378#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
203enum {382enum {
204 IORING_CQE_BUFFER_SHIFT = 16,383 IORING_CQE_BUFFER_SHIFT = 16,
...@@ -231,6 +410,7 @@ struct io_sqring_offsets {...@@ -231,6 +410,7 @@ struct io_sqring_offsets {
231 */410 */
232#define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */411#define IORING_SQ_NEED_WAKEUP (1U << 0) /* needs io_uring_enter wakeup */
233#define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */412#define IORING_SQ_CQ_OVERFLOW (1U << 1) /* CQ ring is overflown */
413#define IORING_SQ_TASKRUN (1U << 2) /* task should enter the kernel */
234414
235struct io_cqring_offsets {415struct io_cqring_offsets {
236 __u32 head;416 __u32 head;
...@@ -254,10 +434,11 @@ struct io_cqring_offsets {...@@ -254,10 +434,11 @@ struct io_cqring_offsets {
254/*434/*
255 * io_uring_enter(2) flags435 * io_uring_enter(2) flags
256 */436 */
257#define IORING_ENTER_GETEVENTS (1U << 0)437#define IORING_ENTER_GETEVENTS (1U << 0)
258#define IORING_ENTER_SQ_WAKEUP (1U << 1)438#define IORING_ENTER_SQ_WAKEUP (1U << 1)
259#define IORING_ENTER_SQ_WAIT (1U << 2)439#define IORING_ENTER_SQ_WAIT (1U << 2)
260#define IORING_ENTER_EXT_ARG (1U << 3)440#define IORING_ENTER_EXT_ARG (1U << 3)
441#define IORING_ENTER_REGISTERED_RING (1U << 4)
261442
262/*443/*
263 * Passed in for io_uring_setup(2). Copied back with updated info on success444 * Passed in for io_uring_setup(2). Copied back with updated info on success
...@@ -289,6 +470,9 @@ struct io_uring_params {...@@ -289,6 +470,9 @@ struct io_uring_params {
289#define IORING_FEAT_EXT_ARG (1U << 8)470#define IORING_FEAT_EXT_ARG (1U << 8)
290#define IORING_FEAT_NATIVE_WORKERS (1U << 9)471#define IORING_FEAT_NATIVE_WORKERS (1U << 9)
291#define IORING_FEAT_RSRC_TAGS (1U << 10)472#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
293/*477/*
294 * io_uring_register(2) opcodes and arguments478 * io_uring_register(2) opcodes and arguments
...@@ -321,8 +505,25 @@ enum {...@@ -321,8 +505,25 @@ enum {
321 /* set/get max number of io-wq workers */505 /* set/get max number of io-wq workers */
322 IORING_REGISTER_IOWQ_MAX_WORKERS = 19,506 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
324 /* this goes last */522 /* this goes last */
325 IORING_REGISTER_LAST523 IORING_REGISTER_LAST,
524
525 /* flag added to the opcode to use a registered ring fd */
526 IORING_REGISTER_USE_REGISTERED_RING = 1U << 31
326};527};
327528
328/* io-wq worker categories */529/* io-wq worker categories */
...@@ -338,9 +539,15 @@ struct io_uring_files_update {...@@ -338,9 +539,15 @@ struct io_uring_files_update {
338 __aligned_u64 /* __s32 * */ fds;539 __aligned_u64 /* __s32 * */ fds;
339};540};
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
341struct io_uring_rsrc_register {548struct io_uring_rsrc_register {
342 __u32 nr;549 __u32 nr;
343 __u32 resv;550 __u32 flags;
344 __u64 resv2;551 __u64 resv2;
345 __aligned_u64 data;552 __aligned_u64 data;
346 __aligned_u64 tags;553 __aligned_u64 tags;
...@@ -361,6 +568,19 @@ struct io_uring_rsrc_update2 {...@@ -361,6 +568,19 @@ struct io_uring_rsrc_update2 {
361 __u32 resv2;568 __u32 resv2;
362};569};
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
364/* Skip updating fd indexes set to this value in the fd table */584/* Skip updating fd indexes set to this value in the fd table */
365#define IORING_REGISTER_FILES_SKIP (-2)585#define IORING_REGISTER_FILES_SKIP (-2)
366586
...@@ -378,7 +598,7 @@ struct io_uring_probe {...@@ -378,7 +598,7 @@ struct io_uring_probe {
378 __u8 ops_len; /* length of ops[] array below */598 __u8 ops_len; /* length of ops[] array below */
379 __u16 resv;599 __u16 resv;
380 __u32 resv2[3];600 __u32 resv2[3];
381 struct io_uring_probe_op ops[0];601 struct io_uring_probe_op ops[];
382};602};
383603
384struct io_uring_restriction {604struct io_uring_restriction {
...@@ -392,6 +612,38 @@ struct io_uring_restriction {...@@ -392,6 +612,38 @@ struct io_uring_restriction {
392 __u32 resv2[3];612 __u32 resv2[3];
393};613};
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
395/*647/*
396 * io_uring_restriction->opcode values648 * io_uring_restriction->opcode values
397 */649 */
...@@ -418,4 +670,36 @@ struct io_uring_getevents_arg {...@@ -418,4 +670,36 @@ struct io_uring_getevents_arg {
418 __u64 ts;670 __u64 ts;
419};671};
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
421#endif705#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 {...@@ -127,7 +127,7 @@ struct ioam6_trace_hdr {
127#endif127#endif
128128
129#define IOAM6_TRACE_DATA_SIZE_MAX 244129#define IOAM6_TRACE_DATA_SIZE_MAX 244
130 __u8 data[0];130 __u8 data[];
131} __attribute__((packed));131} __attribute__((packed));
132132
133#endif /* _LINUX_IOAM6_H */133#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 {...@@ -41,6 +41,15 @@ enum {
41 /* IOAM Trace Header */41 /* IOAM Trace Header */
42 IOAM6_IPTUNNEL_TRACE, /* struct ioam6_trace_hdr */42 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
44 __IOAM6_IPTUNNEL_MAX,53 __IOAM6_IPTUNNEL_MAX,
45};54};
4655
lib/libc/include/any-linux-any/linux/iommu.h-181
...@@ -158,185 +158,4 @@ struct iommu_page_response {...@@ -158,185 +158,4 @@ struct iommu_page_response {
158 __u32 code;158 __u32 code;
159};159};
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
342#endif /* _IOMMU_H */161#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 @@...@@ -18,6 +18,7 @@
18#ifndef _LINUX_IP_H18#ifndef _LINUX_IP_H
19#define _LINUX_IP_H19#define _LINUX_IP_H
20#include <linux/types.h>20#include <linux/types.h>
21#include <linux/stddef.h>
21#include <asm/byteorder.h>22#include <asm/byteorder.h>
2223
23#define IPTOS_TOS_MASK 0x1E24#define IPTOS_TOS_MASK 0x1E
...@@ -100,8 +101,10 @@ struct iphdr {...@@ -100,8 +101,10 @@ struct iphdr {
100 __u8 ttl;101 __u8 ttl;
101 __u8 protocol;102 __u8 protocol;
102 __sum16 check;103 __sum16 check;
103 __be32 saddr;104 __struct_group(/* no tag */, addrs, /* no attrs */,
104 __be32 daddr;105 __be32 saddr;
106 __be32 daddr;
107 );
105 /*The options start here. */108 /*The options start here. */
106};109};
107110
...@@ -112,13 +115,13 @@ struct ip_auth_hdr {...@@ -112,13 +115,13 @@ struct ip_auth_hdr {
112 __be16 reserved;115 __be16 reserved;
113 __be32 spi;116 __be32 spi;
114 __be32 seq_no; /* Sequence number */117 __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! */
116};119};
117120
118struct ip_esp_hdr {121struct ip_esp_hdr {
119 __be32 spi;122 __be32 spi;
120 __be32 seq_no; /* Sequence number */123 __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! */
122};125};
123126
124struct ip_comp_hdr {127struct ip_comp_hdr {
lib/libc/include/any-linux-any/linux/ip_vs.h+2-2
...@@ -254,7 +254,7 @@ struct ip_vs_get_dests {...@@ -254,7 +254,7 @@ struct ip_vs_get_dests {
254 unsigned int num_dests;254 unsigned int num_dests;
255255
256 /* the real servers */256 /* the real servers */
257 struct ip_vs_dest_entry entrytable[0];257 struct ip_vs_dest_entry entrytable[];
258};258};
259259
260260
...@@ -264,7 +264,7 @@ struct ip_vs_get_services {...@@ -264,7 +264,7 @@ struct ip_vs_get_services {
264 unsigned int num_services;264 unsigned int num_services;
265265
266 /* service table */266 /* service table */
267 struct ip_vs_service_entry entrytable[0];267 struct ip_vs_service_entry entrytable[];
268};268};
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 @@...@@ -4,6 +4,7 @@
44
5#include <linux/libc-compat.h>5#include <linux/libc-compat.h>
6#include <linux/types.h>6#include <linux/types.h>
7#include <linux/stddef.h>
7#include <linux/in6.h>8#include <linux/in6.h>
8#include <asm/byteorder.h>9#include <asm/byteorder.h>
910
...@@ -130,8 +131,10 @@ struct ipv6hdr {...@@ -130,8 +131,10 @@ struct ipv6hdr {
130 __u8 nexthdr;131 __u8 nexthdr;
131 __u8 hop_limit;132 __u8 hop_limit;
132133
133 struct in6_addr saddr;134 __struct_group(/* no tag */, addrs, /* no attrs */,
134 struct in6_addr daddr;135 struct in6_addr saddr;
136 struct in6_addr daddr;
137 );
135};138};
136139
137140
...@@ -194,6 +197,7 @@ enum {...@@ -194,6 +197,7 @@ enum {
194 DEVCONF_IOAM6_ID,197 DEVCONF_IOAM6_ID,
195 DEVCONF_IOAM6_ID_WIDE,198 DEVCONF_IOAM6_ID_WIDE,
196 DEVCONF_NDISC_EVICT_NOCARRIER,199 DEVCONF_NDISC_EVICT_NOCARRIER,
200 DEVCONF_ACCEPT_UNTRACKED_NA,
197 DEVCONF_MAX201 DEVCONF_MAX
198};202};
199203
lib/libc/include/any-linux-any/linux/iso_fs.h+2-2
...@@ -137,7 +137,7 @@ struct iso_path_table{...@@ -137,7 +137,7 @@ struct iso_path_table{
137 __u8 name_len[2]; /* 721 */137 __u8 name_len[2]; /* 721 */
138 __u8 extent[4]; /* 731 */138 __u8 extent[4]; /* 731 */
139 __u8 parent[2]; /* 721 */139 __u8 parent[2]; /* 721 */
140 char name[0];140 char name[];
141} __attribute__((packed));141} __attribute__((packed));
142142
143/* high sierra is identical to iso, except that the date is only 6 bytes, and143/* high sierra is identical to iso, except that the date is only 6 bytes, and
...@@ -154,7 +154,7 @@ struct iso_directory_record {...@@ -154,7 +154,7 @@ struct iso_directory_record {
154 __u8 interleave [ISODCL (28, 28)]; /* 711 */154 __u8 interleave [ISODCL (28, 28)]; /* 711 */
155 __u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */155 __u8 volume_sequence_number [ISODCL (29, 32)]; /* 723 */
156 __u8 name_len [ISODCL (33, 33)]; /* 711 */156 __u8 name_len [ISODCL (33, 33)]; /* 711 */
157 char name [0];157 char name [];
158} __attribute__((packed));158} __attribute__((packed));
159159
160#define ISOFS_BLOCK_BITS 11160#define ISOFS_BLOCK_BITS 11
lib/libc/include/any-linux-any/linux/jffs2.h+4-4
...@@ -123,7 +123,7 @@ struct jffs2_raw_dirent...@@ -123,7 +123,7 @@ struct jffs2_raw_dirent
123 __u8 unused[2];123 __u8 unused[2];
124 jint32_t node_crc;124 jint32_t node_crc;
125 jint32_t name_crc;125 jint32_t name_crc;
126 __u8 name[0];126 __u8 name[];
127};127};
128128
129/* The JFFS2 raw inode structure: Used for storage on physical media. */129/* The JFFS2 raw inode structure: Used for storage on physical media. */
...@@ -155,7 +155,7 @@ struct jffs2_raw_inode...@@ -155,7 +155,7 @@ struct jffs2_raw_inode
155 jint16_t flags; /* See JFFS2_INO_FLAG_* */155 jint16_t flags; /* See JFFS2_INO_FLAG_* */
156 jint32_t data_crc; /* CRC for the (compressed) data. */156 jint32_t data_crc; /* CRC for the (compressed) data. */
157 jint32_t node_crc; /* CRC for the raw inode (excluding data) */157 jint32_t node_crc; /* CRC for the raw inode (excluding data) */
158 __u8 data[0];158 __u8 data[];
159};159};
160160
161struct jffs2_raw_xattr {161struct jffs2_raw_xattr {
...@@ -170,7 +170,7 @@ struct jffs2_raw_xattr {...@@ -170,7 +170,7 @@ struct jffs2_raw_xattr {
170 jint16_t value_len;170 jint16_t value_len;
171 jint32_t data_crc;171 jint32_t data_crc;
172 jint32_t node_crc;172 jint32_t node_crc;
173 __u8 data[0];173 __u8 data[];
174} __attribute__((packed));174} __attribute__((packed));
175175
176struct jffs2_raw_xref176struct jffs2_raw_xref
...@@ -196,7 +196,7 @@ struct jffs2_raw_summary...@@ -196,7 +196,7 @@ struct jffs2_raw_summary
196 jint32_t padded; /* sum of the size of padding nodes */196 jint32_t padded; /* sum of the size of padding nodes */
197 jint32_t sum_crc; /* summary information crc */197 jint32_t sum_crc; /* summary information crc */
198 jint32_t node_crc; /* node crc */198 jint32_t node_crc; /* node crc */
199 jint32_t sum[0]; /* inode summary info */199 jint32_t sum[]; /* inode summary info */
200};200};
201201
202union jffs2_node_union202union jffs2_node_union
lib/libc/include/any-linux-any/linux/kcov.h+1-1
...@@ -13,7 +13,7 @@ struct kcov_remote_arg {...@@ -13,7 +13,7 @@ struct kcov_remote_arg {
13 __u32 area_size; /* Length of coverage buffer in words */13 __u32 area_size; /* Length of coverage buffer in words */
14 __u32 num_handles; /* Size of handles array */14 __u32 num_handles; /* Size of handles array */
15 __aligned_u64 common_handle;15 __aligned_u64 common_handle;
16 __aligned_u64 handles[0];16 __aligned_u64 handles[];
17};17};
1818
19#define KCOV_REMOTE_MAX_HANDLES 0x10019#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 {...@@ -161,19 +161,25 @@ struct console_font_op {
161 unsigned int flags; /* KD_FONT_FLAG_* */161 unsigned int flags; /* KD_FONT_FLAG_* */
162 unsigned int width, height; /* font size */162 unsigned int width, height; /* font size */
163 unsigned int charcount;163 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 */
165};167};
166168
167struct console_font {169struct console_font {
168 unsigned int width, height; /* font size */170 unsigned int width, height; /* font size */
169 unsigned int charcount;171 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 */
171};175};
172176
173#define KD_FONT_OP_SET 0 /* Set font */177#define KD_FONT_OP_SET 0 /* Set font */
174#define KD_FONT_OP_GET 1 /* Get font */178#define KD_FONT_OP_GET 1 /* Get font */
175#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */179#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
176#define KD_FONT_OP_COPY 3 /* Obsolete, do not use */180#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
178#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */184#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 @@...@@ -43,6 +43,7 @@
43#define KEXEC_ARCH_MIPS ( 8 << 16)43#define KEXEC_ARCH_MIPS ( 8 << 16)
44#define KEXEC_ARCH_AARCH64 (183 << 16)44#define KEXEC_ARCH_AARCH64 (183 << 16)
45#define KEXEC_ARCH_RISCV (243 << 16)45#define KEXEC_ARCH_RISCV (243 << 16)
46#define KEXEC_ARCH_LOONGARCH (258 << 16)
4647
47/* The artificial cap on the number of segments passed to kexec_load. */48/* The artificial cap on the number of segments passed to kexec_load. */
48#define KEXEC_SEGMENT_MAX 1649#define KEXEC_SEGMENT_MAX 16
...@@ -53,9 +54,9 @@...@@ -53,9 +54,9 @@
53 */54 */
54struct kexec_segment {55struct kexec_segment {
55 const void *buf;56 const void *buf;
56 size_t bufsz;57 __kernel_size_t bufsz;
57 const void *mem;58 const void *mem;
58 size_t memsz;59 __kernel_size_t memsz;
59};60};
6061
6162
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+142-7
...@@ -32,9 +32,14 @@...@@ -32,9 +32,14 @@
32 * - 1.4 - Indicate new SRAM EDC bit in device properties32 * - 1.4 - Indicate new SRAM EDC bit in device properties
33 * - 1.5 - Add SVM API33 * - 1.5 - Add SVM API
34 * - 1.6 - Query clear flags in SVM get_attr API34 * - 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
35 */40 */
36#define KFD_IOCTL_MAJOR_VERSION 141#define KFD_IOCTL_MAJOR_VERSION 1
37#define KFD_IOCTL_MINOR_VERSION 642#define KFD_IOCTL_MINOR_VERSION 11
3843
39struct kfd_ioctl_get_version_args {44struct kfd_ioctl_get_version_args {
40 __u32 major_version; /* from KFD */45 __u32 major_version; /* from KFD */
...@@ -98,6 +103,12 @@ struct kfd_ioctl_get_queue_wave_state_args {...@@ -98,6 +103,12 @@ struct kfd_ioctl_get_queue_wave_state_args {
98 __u32 pad;103 __u32 pad;
99};104};
100105
106struct kfd_ioctl_get_available_memory_args {
107 __u64 available; /* from KFD */
108 __u32 gpu_id; /* to KFD */
109 __u32 pad;
110};
111
101/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */112/* For kfd_ioctl_set_memory_policy_args.default_policy and alternate_policy */
102#define KFD_IOC_CACHE_POLICY_COHERENT 0113#define KFD_IOC_CACHE_POLICY_COHERENT 0
103#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1114#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
...@@ -194,6 +205,8 @@ struct kfd_ioctl_dbg_wave_control_args {...@@ -194,6 +205,8 @@ struct kfd_ioctl_dbg_wave_control_args {
194 __u32 buf_size_in_bytes; /*including gpu_id and buf_size */205 __u32 buf_size_in_bytes; /*including gpu_id and buf_size */
195};206};
196207
208#define KFD_INVALID_FD 0xffffffff
209
197/* Matching HSA_EVENTTYPE */210/* Matching HSA_EVENTTYPE */
198#define KFD_IOC_EVENT_SIGNAL 0211#define KFD_IOC_EVENT_SIGNAL 0
199#define KFD_IOC_EVENT_NODECHANGE 1212#define KFD_IOC_EVENT_NODECHANGE 1
...@@ -459,15 +472,129 @@ enum kfd_smi_event {...@@ -459,15 +472,129 @@ enum kfd_smi_event {
459 KFD_SMI_EVENT_THERMAL_THROTTLE = 2,472 KFD_SMI_EVENT_THERMAL_THROTTLE = 2,
460 KFD_SMI_EVENT_GPU_PRE_RESET = 3,473 KFD_SMI_EVENT_GPU_PRE_RESET = 3,
461 KFD_SMI_EVENT_GPU_POST_RESET = 4,474 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
462};512};
463513
464#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))514#define KFD_SMI_EVENT_MASK_FROM_INDEX(i) (1ULL << ((i) - 1))
515#define KFD_SMI_EVENT_MSG_SIZE 96
465516
466struct kfd_ioctl_smi_events_args {517struct kfd_ioctl_smi_events_args {
467 __u32 gpuid; /* to KFD */518 __u32 gpuid; /* to KFD */
468 __u32 anon_fd; /* from KFD */519 __u32 anon_fd; /* from KFD */
469};520};
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
471/* Register offset inside the remapped mmio page598/* Register offset inside the remapped mmio page
472 */599 */
473enum kfd_mmio_remap {600enum kfd_mmio_remap {
...@@ -487,6 +614,8 @@ enum kfd_mmio_remap {...@@ -487,6 +614,8 @@ enum kfd_mmio_remap {
487#define KFD_IOCTL_SVM_FLAG_GPU_EXEC 0x00000010614#define KFD_IOCTL_SVM_FLAG_GPU_EXEC 0x00000010
488/* GPUs mostly read, may allow similar optimizations as RO, but writes fault */615/* GPUs mostly read, may allow similar optimizations as RO, but writes fault */
489#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020616#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
491/**620/**
492 * kfd_ioctl_svm_op - SVM ioctl operations621 * kfd_ioctl_svm_op - SVM ioctl operations
...@@ -596,7 +725,7 @@ struct kfd_ioctl_svm_args {...@@ -596,7 +725,7 @@ struct kfd_ioctl_svm_args {
596 __u32 op;725 __u32 op;
597 __u32 nattr;726 __u32 nattr;
598 /* Variable length array of attributes */727 /* Variable length array of attributes */
599 struct kfd_ioctl_svm_attribute attrs[0];728 struct kfd_ioctl_svm_attribute attrs[];
600};729};
601730
602/**731/**
...@@ -679,16 +808,16 @@ struct kfd_ioctl_set_xnack_mode_args {...@@ -679,16 +808,16 @@ struct kfd_ioctl_set_xnack_mode_args {
679#define AMDKFD_IOC_WAIT_EVENTS \808#define AMDKFD_IOC_WAIT_EVENTS \
680 AMDKFD_IOWR(0x0C, struct kfd_ioctl_wait_events_args)809 AMDKFD_IOWR(0x0C, struct kfd_ioctl_wait_events_args)
681810
682#define AMDKFD_IOC_DBG_REGISTER \811#define AMDKFD_IOC_DBG_REGISTER_DEPRECATED \
683 AMDKFD_IOW(0x0D, struct kfd_ioctl_dbg_register_args)812 AMDKFD_IOW(0x0D, struct kfd_ioctl_dbg_register_args)
684813
685#define AMDKFD_IOC_DBG_UNREGISTER \814#define AMDKFD_IOC_DBG_UNREGISTER_DEPRECATED \
686 AMDKFD_IOW(0x0E, struct kfd_ioctl_dbg_unregister_args)815 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 \
689 AMDKFD_IOW(0x0F, struct kfd_ioctl_dbg_address_watch_args)818 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 \
692 AMDKFD_IOW(0x10, struct kfd_ioctl_dbg_wave_control_args)821 AMDKFD_IOW(0x10, struct kfd_ioctl_dbg_wave_control_args)
693822
694#define AMDKFD_IOC_SET_SCRATCH_BACKING_VA \823#define AMDKFD_IOC_SET_SCRATCH_BACKING_VA \
...@@ -742,7 +871,13 @@ struct kfd_ioctl_set_xnack_mode_args {...@@ -742,7 +871,13 @@ struct kfd_ioctl_set_xnack_mode_args {
742#define AMDKFD_IOC_SET_XNACK_MODE \871#define AMDKFD_IOC_SET_XNACK_MODE \
743 AMDKFD_IOWR(0x21, struct kfd_ioctl_set_xnack_mode_args)872 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
745#define AMDKFD_COMMAND_START 0x01880#define AMDKFD_COMMAND_START 0x01
746#define AMDKFD_COMMAND_END 0x22881#define AMDKFD_COMMAND_END 0x24
747882
748#endif883#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 {...@@ -86,14 +86,6 @@ struct kvm_debug_guest {
86/* *** End of deprecated interfaces *** */86/* *** 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
97/* for KVM_SET_USER_MEMORY_REGION */89/* for KVM_SET_USER_MEMORY_REGION */
98struct kvm_userspace_memory_region {90struct kvm_userspace_memory_region {
99 __u32 slot;91 __u32 slot;
...@@ -104,9 +96,9 @@ struct kvm_userspace_memory_region {...@@ -104,9 +96,9 @@ struct kvm_userspace_memory_region {
104};96};
10597
106/*98/*
107 * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,99 * The bit 0 ~ bit 15 of kvm_userspace_memory_region::flags are visible for
108 * other bits are reserved for kvm internal use which are defined in100 * userspace, other bits are reserved for kvm internal use which are defined
109 * include/linux/kvm_host.h.101 * in include/linux/kvm_host.h.
110 */102 */
111#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)103#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
112#define KVM_MEM_READONLY (1UL << 1)104#define KVM_MEM_READONLY (1UL << 1)
...@@ -270,6 +262,8 @@ struct kvm_xen_exit {...@@ -270,6 +262,8 @@ struct kvm_xen_exit {
270#define KVM_EXIT_X86_BUS_LOCK 33262#define KVM_EXIT_X86_BUS_LOCK 33
271#define KVM_EXIT_XEN 34263#define KVM_EXIT_XEN 34
272#define KVM_EXIT_RISCV_SBI 35264#define KVM_EXIT_RISCV_SBI 35
265#define KVM_EXIT_RISCV_CSR 36
266#define KVM_EXIT_NOTIFY 37
273267
274/* For KVM_EXIT_INTERNAL_ERROR */268/* For KVM_EXIT_INTERNAL_ERROR */
275/* Emulate instruction failed. */269/* Emulate instruction failed. */
...@@ -444,8 +438,15 @@ struct kvm_run {...@@ -444,8 +438,15 @@ struct kvm_run {
444#define KVM_SYSTEM_EVENT_SHUTDOWN 1438#define KVM_SYSTEM_EVENT_SHUTDOWN 1
445#define KVM_SYSTEM_EVENT_RESET 2439#define KVM_SYSTEM_EVENT_RESET 2
446#define KVM_SYSTEM_EVENT_CRASH 3440#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
447 __u32 type;444 __u32 type;
448 __u64 flags;445 __u32 ndata;
446 union {
447 __u64 flags;
448 __u64 data[16];
449 };
449 } system_event;450 } system_event;
450 /* KVM_EXIT_S390_STSI */451 /* KVM_EXIT_S390_STSI */
451 struct {452 struct {
...@@ -474,6 +475,9 @@ struct kvm_run {...@@ -474,6 +475,9 @@ struct kvm_run {
474#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)475#define KVM_MSR_EXIT_REASON_INVAL (1 << 0)
475#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)476#define KVM_MSR_EXIT_REASON_UNKNOWN (1 << 1)
476#define KVM_MSR_EXIT_REASON_FILTER (1 << 2)477#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)
477 __u32 reason; /* kernel -> user */481 __u32 reason; /* kernel -> user */
478 __u32 index; /* kernel -> user */482 __u32 index; /* kernel -> user */
479 __u64 data; /* kernel <-> user */483 __u64 data; /* kernel <-> user */
...@@ -487,6 +491,18 @@ struct kvm_run {...@@ -487,6 +491,18 @@ struct kvm_run {
487 unsigned long args[6];491 unsigned long args[6];
488 unsigned long ret[2];492 unsigned long ret[2];
489 } riscv_sbi;493 } 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;
490 /* Fix the size of the union. */506 /* Fix the size of the union. */
491 char padding[256];507 char padding[256];
492 };508 };
...@@ -533,7 +549,7 @@ struct kvm_coalesced_mmio {...@@ -533,7 +549,7 @@ struct kvm_coalesced_mmio {
533549
534struct kvm_coalesced_mmio_ring {550struct kvm_coalesced_mmio_ring {
535 __u32 first, last;551 __u32 first, last;
536 struct kvm_coalesced_mmio coalesced_mmio[0];552 struct kvm_coalesced_mmio coalesced_mmio[];
537};553};
538554
539#define KVM_COALESCED_MMIO_MAX \555#define KVM_COALESCED_MMIO_MAX \
...@@ -562,9 +578,14 @@ struct kvm_s390_mem_op {...@@ -562,9 +578,14 @@ struct kvm_s390_mem_op {
562 __u32 op; /* type of operation */578 __u32 op; /* type of operation */
563 __u64 buf; /* buffer in userspace */579 __u64 buf; /* buffer in userspace */
564 union {580 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 };
566 __u32 sida_offset; /* offset into the sida */587 __u32 sida_offset; /* offset into the sida */
567 __u8 reserved[32]; /* should be set to 0 */588 __u8 reserved[32]; /* ignored */
568 };589 };
569};590};
570/* types for kvm_s390_mem_op->op */591/* types for kvm_s390_mem_op->op */
...@@ -572,9 +593,18 @@ struct kvm_s390_mem_op {...@@ -572,9 +593,18 @@ struct kvm_s390_mem_op {
572#define KVM_S390_MEMOP_LOGICAL_WRITE 1593#define KVM_S390_MEMOP_LOGICAL_WRITE 1
573#define KVM_S390_MEMOP_SIDA_READ 2594#define KVM_S390_MEMOP_SIDA_READ 2
574#define KVM_S390_MEMOP_SIDA_WRITE 3595#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
575/* flags for kvm_s390_mem_op->flags */600/* flags for kvm_s390_mem_op->flags */
576#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)601#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
577#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)602#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
603#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2)
604
605/* flags specifying extension support via KVM_CAP_S390_MEM_OP_EXTENSION */
606#define KVM_S390_MEMOP_EXTENSION_CAP_BASE (1 << 0)
607#define KVM_S390_MEMOP_EXTENSION_CAP_CMPXCHG (1 << 1)
578608
579/* for KVM_INTERRUPT */609/* for KVM_INTERRUPT */
580struct kvm_interrupt {610struct kvm_interrupt {
...@@ -606,7 +636,7 @@ struct kvm_clear_dirty_log {...@@ -606,7 +636,7 @@ struct kvm_clear_dirty_log {
606/* for KVM_SET_SIGNAL_MASK */636/* for KVM_SET_SIGNAL_MASK */
607struct kvm_signal_mask {637struct kvm_signal_mask {
608 __u32 len;638 __u32 len;
609 __u8 sigset[0];639 __u8 sigset[];
610};640};
611641
612/* for KVM_TPR_ACCESS_REPORTING */642/* for KVM_TPR_ACCESS_REPORTING */
...@@ -634,6 +664,7 @@ struct kvm_vapic_addr {...@@ -634,6 +664,7 @@ struct kvm_vapic_addr {
634#define KVM_MP_STATE_OPERATING 7664#define KVM_MP_STATE_OPERATING 7
635#define KVM_MP_STATE_LOAD 8665#define KVM_MP_STATE_LOAD 8
636#define KVM_MP_STATE_AP_RESET_HOLD 9666#define KVM_MP_STATE_AP_RESET_HOLD 9
667#define KVM_MP_STATE_SUSPENDED 10
637668
638struct kvm_mp_state {669struct kvm_mp_state {
639 __u32 mp_state;670 __u32 mp_state;
...@@ -1131,6 +1162,26 @@ struct kvm_ppc_resize_hpt {...@@ -1131,6 +1162,26 @@ struct kvm_ppc_resize_hpt {
1131#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 2041162#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
1132#define KVM_CAP_ARM_MTE 2051163#define KVM_CAP_ARM_MTE 205
1133#define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 2061164#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
1135#ifdef KVM_CAP_IRQ_ROUTING1186#ifdef KVM_CAP_IRQ_ROUTING
11361187
...@@ -1162,11 +1213,20 @@ struct kvm_irq_routing_hv_sint {...@@ -1162,11 +1213,20 @@ struct kvm_irq_routing_hv_sint {
1162 __u32 sint;1213 __u32 sint;
1163};1214};
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
1165/* gsi routing entry types */1224/* gsi routing entry types */
1166#define KVM_IRQ_ROUTING_IRQCHIP 11225#define KVM_IRQ_ROUTING_IRQCHIP 1
1167#define KVM_IRQ_ROUTING_MSI 21226#define KVM_IRQ_ROUTING_MSI 2
1168#define KVM_IRQ_ROUTING_S390_ADAPTER 31227#define KVM_IRQ_ROUTING_S390_ADAPTER 3
1169#define KVM_IRQ_ROUTING_HV_SINT 41228#define KVM_IRQ_ROUTING_HV_SINT 4
1229#define KVM_IRQ_ROUTING_XEN_EVTCHN 5
11701230
1171struct kvm_irq_routing_entry {1231struct kvm_irq_routing_entry {
1172 __u32 gsi;1232 __u32 gsi;
...@@ -1178,6 +1238,7 @@ struct kvm_irq_routing_entry {...@@ -1178,6 +1238,7 @@ struct kvm_irq_routing_entry {
1178 struct kvm_irq_routing_msi msi;1238 struct kvm_irq_routing_msi msi;
1179 struct kvm_irq_routing_s390_adapter adapter;1239 struct kvm_irq_routing_s390_adapter adapter;
1180 struct kvm_irq_routing_hv_sint hv_sint;1240 struct kvm_irq_routing_hv_sint hv_sint;
1241 struct kvm_irq_routing_xen_evtchn xen_evtchn;
1181 __u32 pad[8];1242 __u32 pad[8];
1182 } u;1243 } u;
1183};1244};
...@@ -1185,7 +1246,7 @@ struct kvm_irq_routing_entry {...@@ -1185,7 +1246,7 @@ struct kvm_irq_routing_entry {
1185struct kvm_irq_routing {1246struct kvm_irq_routing {
1186 __u32 nr;1247 __u32 nr;
1187 __u32 flags;1248 __u32 flags;
1188 struct kvm_irq_routing_entry entries[0];1249 struct kvm_irq_routing_entry entries[];
1189};1250};
11901251
1191#endif1252#endif
...@@ -1208,6 +1269,9 @@ struct kvm_x86_mce {...@@ -1208,6 +1269,9 @@ struct kvm_x86_mce {
1208#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)1269#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1)
1209#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)1270#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2)
1210#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)1271#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3)
1272#define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL (1 << 4)
1273#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND (1 << 5)
1274#define KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG (1 << 6)
12111275
1212struct kvm_xen_hvm_config {1276struct kvm_xen_hvm_config {
1213 __u32 flags;1277 __u32 flags;
...@@ -1303,7 +1367,7 @@ struct kvm_dirty_tlb {...@@ -1303,7 +1367,7 @@ struct kvm_dirty_tlb {
13031367
1304struct kvm_reg_list {1368struct kvm_reg_list {
1305 __u64 n; /* number of regs */1369 __u64 n; /* number of regs */
1306 __u64 reg[0];1370 __u64 reg[];
1307};1371};
13081372
1309struct kvm_one_reg {1373struct kvm_one_reg {
...@@ -1378,18 +1442,12 @@ struct kvm_vfio_spapr_tce {...@@ -1378,18 +1442,12 @@ struct kvm_vfio_spapr_tce {
1378 __s32 tablefd;1442 __s32 tablefd;
1379};1443};
13801444
1381/*
1382 * ioctls for VM fds
1383 */
1384#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
1385/*1445/*
1386 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns1446 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
1387 * a vcpu fd.1447 * a vcpu fd.
1388 */1448 */
1389#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)1449#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
1390#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)1450#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)
1393#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)1451#define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44)
1394#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)1452#define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45)
1395#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \1453#define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \
...@@ -1446,7 +1504,8 @@ struct kvm_s390_ucas_mapping {...@@ -1446,7 +1504,8 @@ struct kvm_s390_ucas_mapping {
1446#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)1504#define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2)
1447/* Available with KVM_CAP_PPC_GET_PVINFO */1505/* Available with KVM_CAP_PPC_GET_PVINFO */
1448#define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)1506#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 */
1450#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)1509#define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
1451#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)1510#define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
1452/* Available with KVM_CAP_PCI_2_3 */1511/* Available with KVM_CAP_PCI_2_3 */
...@@ -1621,6 +1680,55 @@ struct kvm_s390_pv_unp {...@@ -1621,6 +1680,55 @@ struct kvm_s390_pv_unp {
1621 __u64 tweak;1680 __u64 tweak;
1622};1681};
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
1624enum pv_cmd_id {1732enum pv_cmd_id {
1625 KVM_PV_ENABLE,1733 KVM_PV_ENABLE,
1626 KVM_PV_DISABLE,1734 KVM_PV_DISABLE,
...@@ -1629,6 +1737,10 @@ enum pv_cmd_id {...@@ -1629,6 +1737,10 @@ enum pv_cmd_id {
1629 KVM_PV_VERIFY,1737 KVM_PV_VERIFY,
1630 KVM_PV_PREP_RESET,1738 KVM_PV_PREP_RESET,
1631 KVM_PV_UNSHARE_ALL,1739 KVM_PV_UNSHARE_ALL,
1740 KVM_PV_INFO,
1741 KVM_PV_DUMP,
1742 KVM_PV_ASYNC_CLEANUP_PREPARE,
1743 KVM_PV_ASYNC_CLEANUP_PERFORM,
1632};1744};
16331745
1634struct kvm_pv_cmd {1746struct kvm_pv_cmd {
...@@ -1659,22 +1771,59 @@ struct kvm_xen_hvm_attr {...@@ -1659,22 +1771,59 @@ struct kvm_xen_hvm_attr {
1659 union {1771 union {
1660 __u8 long_mode;1772 __u8 long_mode;
1661 __u8 vector;1773 __u8 vector;
1774 __u8 runstate_update_flag;
1662 struct {1775 struct {
1663 __u64 gfn;1776 __u64 gfn;
1777#define KVM_XEN_INVALID_GFN ((__u64)-1)
1664 } shared_info;1778 } shared_info;
1779 struct {
1780 __u32 send_port;
1781 __u32 type; /* EVTCHNSTAT_ipi / EVTCHNSTAT_interdomain */
1782 __u32 flags;
1783#define KVM_XEN_EVTCHN_DEASSIGN (1 << 0)
1784#define KVM_XEN_EVTCHN_UPDATE (1 << 1)
1785#define KVM_XEN_EVTCHN_RESET (1 << 2)
1786 /*
1787 * Events sent by the guest are either looped back to
1788 * the guest itself (potentially on a different port#)
1789 * or signalled via an eventfd.
1790 */
1791 union {
1792 struct {
1793 __u32 port;
1794 __u32 vcpu;
1795 __u32 priority;
1796 } port;
1797 struct {
1798 __u32 port; /* Zero for eventfd */
1799 __s32 fd;
1800 } eventfd;
1801 __u32 padding[4];
1802 } deliver;
1803 } evtchn;
1804 __u32 xen_version;
1665 __u64 pad[8];1805 __u64 pad[8];
1666 } u;1806 } u;
1667};1807};
16681808
1809
1669/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */1810/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */
1670#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x01811#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0
1671#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x11812#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1
1672#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x21813#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
1674/* Per-vCPU Xen attributes */1820/* Per-vCPU Xen attributes */
1675#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)1821#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
1676#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr)1822#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
1678#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)1827#define KVM_GET_SREGS2 _IOR(KVMIO, 0xcc, struct kvm_sregs2)
1679#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)1828#define KVM_SET_SREGS2 _IOW(KVMIO, 0xcd, struct kvm_sregs2)
16801829
...@@ -1683,6 +1832,7 @@ struct kvm_xen_vcpu_attr {...@@ -1683,6 +1832,7 @@ struct kvm_xen_vcpu_attr {
1683 __u16 pad[3];1832 __u16 pad[3];
1684 union {1833 union {
1685 __u64 gpa;1834 __u64 gpa;
1835#define KVM_XEN_INVALID_GPA ((__u64)-1)
1686 __u64 pad[8];1836 __u64 pad[8];
1687 struct {1837 struct {
1688 __u64 state;1838 __u64 state;
...@@ -1692,6 +1842,13 @@ struct kvm_xen_vcpu_attr {...@@ -1692,6 +1842,13 @@ struct kvm_xen_vcpu_attr {
1692 __u64 time_blocked;1842 __u64 time_blocked;
1693 __u64 time_offline;1843 __u64 time_offline;
1694 } runstate;1844 } runstate;
1845 __u32 vcpu_id;
1846 struct {
1847 __u32 port;
1848 __u32 priority;
1849 __u64 expires_ns;
1850 } timer;
1851 __u8 vector;
1695 } u;1852 } u;
1696};1853};
16971854
...@@ -1702,6 +1859,10 @@ struct kvm_xen_vcpu_attr {...@@ -1702,6 +1859,10 @@ struct kvm_xen_vcpu_attr {
1702#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x31859#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3
1703#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x41860#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4
1704#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x51861#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
1706/* Secure Encrypted Virtualization command */1867/* Secure Encrypted Virtualization command */
1707enum sev_cmd_id {1868enum sev_cmd_id {
...@@ -1956,6 +2117,8 @@ struct kvm_dirty_gfn {...@@ -1956,6 +2117,8 @@ struct kvm_dirty_gfn {
1956#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0)2117#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0)
1957#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1)2118#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1)
19582119
2120#define KVM_PMU_CAP_DISABLE (1 << 0)
2121
1959/**2122/**
1960 * struct kvm_stats_header - Header of per vm/vcpu binary statistics data.2123 * struct kvm_stats_header - Header of per vm/vcpu binary statistics data.
1961 * @flags: Some extra information for header, always 0 for now.2124 * @flags: Some extra information for header, always 0 for now.
...@@ -1999,7 +2162,8 @@ struct kvm_stats_header {...@@ -1999,7 +2162,8 @@ struct kvm_stats_header {
1999#define KVM_STATS_UNIT_BYTES (0x1 << KVM_STATS_UNIT_SHIFT)2162#define KVM_STATS_UNIT_BYTES (0x1 << KVM_STATS_UNIT_SHIFT)
2000#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)2163#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
2001#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)2164#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
2002#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES2165#define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT)
2166#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN
20032167
2004#define KVM_STATS_BASE_SHIFT 82168#define KVM_STATS_BASE_SHIFT 8
2005#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)2169#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)
...@@ -2031,4 +2195,44 @@ struct kvm_stats_desc {...@@ -2031,4 +2195,44 @@ struct kvm_stats_desc {
20312195
2032#define KVM_GET_STATS_FD _IO(KVMIO, 0xce)2196#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
2034#endif /* __LINUX_KVM_H */2238#endif /* __LINUX_KVM_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/l2tp.h-2
...@@ -13,8 +13,6 @@...@@ -13,8 +13,6 @@
13#include <linux/in.h>13#include <linux/in.h>
14#include <linux/in6.h>14#include <linux/in6.h>
1515
16#define IPPROTO_L2TP 115
17
18/**16/**
19 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets17 * struct sockaddr_l2tpip - the sockaddr structure for L2TP-over-IP sockets
20 * @l2tp_family: address family number AF_L2TPIP.18 * @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 {...@@ -21,8 +21,14 @@ struct landlock_ruleset_attr {
21 /**21 /**
22 * @handled_access_fs: Bitmask of actions (cf. `Filesystem flags`_)22 * @handled_access_fs: Bitmask of actions (cf. `Filesystem flags`_)
23 * that is handled by this ruleset and should then be forbidden if no23 * that is handled by this ruleset and should then be forbidden if no
24 * rule explicitly allow them. This is needed for backward24 * rule explicitly allow them: it is a deny-by-default list that should
25 * compatibility reasons.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.
26 */32 */
27 __u64 handled_access_fs;33 __u64 handled_access_fs;
28};34};
...@@ -33,7 +39,9 @@ struct landlock_ruleset_attr {...@@ -33,7 +39,9 @@ struct landlock_ruleset_attr {
33 * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI39 * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI
34 * version.40 * version.
35 */41 */
42/* clang-format off */
36#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)43#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
44/* clang-format on */
3745
38/**46/**
39 * enum landlock_rule_type - Landlock rule type47 * enum landlock_rule_type - Landlock rule type
...@@ -60,8 +68,9 @@ struct landlock_path_beneath_attr {...@@ -60,8 +68,9 @@ struct landlock_path_beneath_attr {
60 */68 */
61 __u64 allowed_access;69 __u64 allowed_access;
62 /**70 /**
63 * @parent_fd: File descriptor, open with ``O_PATH``, which identifies71 * @parent_fd: File descriptor, preferably opened with ``O_PATH``,
64 * the parent directory of a file hierarchy, or just a file.72 * which identifies the parent directory of a file hierarchy, or just a
73 * file.
65 */74 */
66 __s32 parent_fd;75 __s32 parent_fd;
67 /*76 /*
...@@ -86,8 +95,19 @@ struct landlock_path_beneath_attr {...@@ -86,8 +95,19 @@ struct landlock_path_beneath_attr {
86 * A file can only receive these access rights:95 * A file can only receive these access rights:
87 *96 *
88 * - %LANDLOCK_ACCESS_FS_EXECUTE: Execute a file.97 * - %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)`.
90 * - %LANDLOCK_ACCESS_FS_READ_FILE: Open a file with read access.102 * - %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.
91 *111 *
92 * A directory can receive access rights related to files or directories. The112 * A directory can receive access rights related to files or directories. The
93 * following access right is applied to the directory itself, and the113 * following access right is applied to the directory itself, and the
...@@ -109,17 +129,33 @@ struct landlock_path_beneath_attr {...@@ -109,17 +129,33 @@ struct landlock_path_beneath_attr {
109 * - %LANDLOCK_ACCESS_FS_MAKE_FIFO: Create (or rename or link) a named pipe.129 * - %LANDLOCK_ACCESS_FS_MAKE_FIFO: Create (or rename or link) a named pipe.
110 * - %LANDLOCK_ACCESS_FS_MAKE_BLOCK: Create (or rename or link) a block device.130 * - %LANDLOCK_ACCESS_FS_MAKE_BLOCK: Create (or rename or link) a block device.
111 * - %LANDLOCK_ACCESS_FS_MAKE_SYM: Create (or rename or link) a symbolic link.131 * - %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.
112 *148 *
113 * .. warning::149 * .. warning::
114 *150 *
115 * It is currently not possible to restrict some file-related actions151 * It is currently not possible to restrict some file-related actions
116 * accessible through these syscall families: :manpage:`chdir(2)`,152 * accessible through these syscall families: :manpage:`chdir(2)`,
117 * :manpage:`truncate(2)`, :manpage:`stat(2)`, :manpage:`flock(2)`,153 * :manpage:`stat(2)`, :manpage:`flock(2)`, :manpage:`chmod(2)`,
118 * :manpage:`chmod(2)`, :manpage:`chown(2)`, :manpage:`setxattr(2)`,154 * :manpage:`chown(2)`, :manpage:`setxattr(2)`, :manpage:`utime(2)`,
119 * :manpage:`utime(2)`, :manpage:`ioctl(2)`, :manpage:`fcntl(2)`,155 * :manpage:`ioctl(2)`, :manpage:`fcntl(2)`, :manpage:`access(2)`.
120 * :manpage:`access(2)`.
121 * Future Landlock evolutions will enable to restrict them.156 * Future Landlock evolutions will enable to restrict them.
122 */157 */
158/* clang-format off */
123#define LANDLOCK_ACCESS_FS_EXECUTE (1ULL << 0)159#define LANDLOCK_ACCESS_FS_EXECUTE (1ULL << 0)
124#define LANDLOCK_ACCESS_FS_WRITE_FILE (1ULL << 1)160#define LANDLOCK_ACCESS_FS_WRITE_FILE (1ULL << 1)
125#define LANDLOCK_ACCESS_FS_READ_FILE (1ULL << 2)161#define LANDLOCK_ACCESS_FS_READ_FILE (1ULL << 2)
...@@ -133,5 +169,8 @@ struct landlock_path_beneath_attr {...@@ -133,5 +169,8 @@ struct landlock_path_beneath_attr {
133#define LANDLOCK_ACCESS_FS_MAKE_FIFO (1ULL << 10)169#define LANDLOCK_ACCESS_FS_MAKE_FIFO (1ULL << 10)
134#define LANDLOCK_ACCESS_FS_MAKE_BLOCK (1ULL << 11)170#define LANDLOCK_ACCESS_FS_MAKE_BLOCK (1ULL << 11)
135#define LANDLOCK_ACCESS_FS_MAKE_SYM (1ULL << 12)171#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
137#endif /* _LINUX_LANDLOCK_H */176#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 @@...@@ -16,14 +16,16 @@
16#define LIRC_MODE2_PULSE 0x0100000016#define LIRC_MODE2_PULSE 0x01000000
17#define LIRC_MODE2_FREQUENCY 0x0200000017#define LIRC_MODE2_FREQUENCY 0x02000000
18#define LIRC_MODE2_TIMEOUT 0x0300000018#define LIRC_MODE2_TIMEOUT 0x03000000
19#define LIRC_MODE2_OVERFLOW 0x04000000
1920
20#define LIRC_VALUE_MASK 0x00FFFFFF21#define LIRC_VALUE_MASK 0x00FFFFFF
21#define LIRC_MODE2_MASK 0xFF00000022#define LIRC_MODE2_MASK 0xFF000000
2223
23#define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE)24#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_PULSE(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_PULSE)
25#define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)26#define LIRC_FREQUENCY(val) (((val) & LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY)
26#define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT)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
28#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)30#define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK)
29#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)31#define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK)
...@@ -32,6 +34,7 @@...@@ -32,6 +34,7 @@
32#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)34#define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE)
33#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)35#define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY)
34#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)36#define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT)
37#define LIRC_IS_OVERFLOW(val) (LIRC_MODE2(val) == LIRC_MODE2_OVERFLOW)
3538
36/* used heavily by lirc userspace */39/* used heavily by lirc userspace */
37#define lirc_t int40#define lirc_t int
...@@ -70,13 +73,10 @@...@@ -70,13 +73,10 @@
70#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)73#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
7174
72#define LIRC_CAN_SET_REC_CARRIER (LIRC_CAN_SET_SEND_CARRIER << 16)75#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
76#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x8000000077#define LIRC_CAN_SET_REC_CARRIER_RANGE 0x80000000
77#define LIRC_CAN_GET_REC_RESOLUTION 0x2000000078#define LIRC_CAN_GET_REC_RESOLUTION 0x20000000
78#define LIRC_CAN_SET_REC_TIMEOUT 0x1000000079#define LIRC_CAN_SET_REC_TIMEOUT 0x10000000
79#define LIRC_CAN_SET_REC_FILTER 0x08000000
8080
81#define LIRC_CAN_MEASURE_CARRIER 0x0200000081#define LIRC_CAN_MEASURE_CARRIER 0x02000000
82#define LIRC_CAN_USE_WIDEBAND_RECEIVER 0x0400000082#define LIRC_CAN_USE_WIDEBAND_RECEIVER 0x04000000
...@@ -84,7 +84,12 @@...@@ -84,7 +84,12 @@
84#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)84#define LIRC_CAN_SEND(x) ((x)&LIRC_CAN_SEND_MASK)
85#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)85#define LIRC_CAN_REC(x) ((x)&LIRC_CAN_REC_MASK)
8686
87#define LIRC_CAN_NOTIFY_DECODE 0x0100000087/*
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
89/*** IOCTL commands for lirc driver ***/94/*** 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 @@...@@ -1,11 +1,6 @@
1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2/*2/*
3 * include/linux/loop.h3 * Copyright 1993 by Theodore Ts'o.
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.
9 */4 */
10#ifndef _LINUX_LOOP_H5#ifndef _LINUX_LOOP_H
11#define _LINUX_LOOP_H6#define _LINUX_LOOP_H
...@@ -45,7 +40,7 @@ struct loop_info {...@@ -45,7 +40,7 @@ struct loop_info {
45 unsigned long lo_inode; /* ioctl r/o */40 unsigned long lo_inode; /* ioctl r/o */
46 __kernel_old_dev_t lo_rdevice; /* ioctl r/o */41 __kernel_old_dev_t lo_rdevice; /* ioctl r/o */
47 int lo_offset;42 int lo_offset;
48 int lo_encrypt_type;43 int lo_encrypt_type; /* obsolete, ignored */
49 int lo_encrypt_key_size; /* ioctl w/o */44 int lo_encrypt_key_size; /* ioctl w/o */
50 int lo_flags;45 int lo_flags;
51 char lo_name[LO_NAME_SIZE];46 char lo_name[LO_NAME_SIZE];
...@@ -61,7 +56,7 @@ struct loop_info64 {...@@ -61,7 +56,7 @@ struct loop_info64 {
61 __u64 lo_offset;56 __u64 lo_offset;
62 __u64 lo_sizelimit;/* bytes, 0 == max available */57 __u64 lo_sizelimit;/* bytes, 0 == max available */
63 __u32 lo_number; /* ioctl r/o */58 __u32 lo_number; /* ioctl r/o */
64 __u32 lo_encrypt_type;59 __u32 lo_encrypt_type; /* obsolete, ignored */
65 __u32 lo_encrypt_key_size; /* ioctl w/o */60 __u32 lo_encrypt_key_size; /* ioctl w/o */
66 __u32 lo_flags;61 __u32 lo_flags;
67 __u8 lo_file_name[LO_NAME_SIZE];62 __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 {...@@ -15,6 +15,7 @@ enum lwtunnel_encap_types {
15 LWTUNNEL_ENCAP_SEG6_LOCAL,15 LWTUNNEL_ENCAP_SEG6_LOCAL,
16 LWTUNNEL_ENCAP_RPL,16 LWTUNNEL_ENCAP_RPL,
17 LWTUNNEL_ENCAP_IOAM6,17 LWTUNNEL_ENCAP_IOAM6,
18 LWTUNNEL_ENCAP_XFRM,
18 __LWTUNNEL_ENCAP_MAX,19 __LWTUNNEL_ENCAP_MAX,
19};20};
2021
...@@ -111,4 +112,13 @@ enum {...@@ -111,4 +112,13 @@ enum {
111112
112#define LWT_BPF_MAX_HEADROOM 256113#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
114#endif /* _LWTUNNEL_H_ */124#endif /* _LWTUNNEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/magic.h+7-4
...@@ -6,6 +6,7 @@...@@ -6,6 +6,7 @@
6#define AFFS_SUPER_MAGIC 0xadff6#define AFFS_SUPER_MAGIC 0xadff
7#define AFS_SUPER_MAGIC 0x5346414F7#define AFS_SUPER_MAGIC 0x5346414F
8#define AUTOFS_SUPER_MAGIC 0x01878#define AUTOFS_SUPER_MAGIC 0x0187
9#define CEPH_SUPER_MAGIC 0x00c36400
9#define CODA_SUPER_MAGIC 0x7375724510#define CODA_SUPER_MAGIC 0x73757245
10#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */11#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
11#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */12#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
...@@ -35,6 +36,7 @@...@@ -35,6 +36,7 @@
35#define EFIVARFS_MAGIC 0xde5e81e436#define EFIVARFS_MAGIC 0xde5e81e4
36#define HOSTFS_SUPER_MAGIC 0x00c0ffee37#define HOSTFS_SUPER_MAGIC 0x00c0ffee
37#define OVERLAYFS_SUPER_MAGIC 0x794c763038#define OVERLAYFS_SUPER_MAGIC 0x794c7630
39#define FUSE_SUPER_MAGIC 0x65735546
3840
39#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */41#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
40#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */42#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
...@@ -43,6 +45,7 @@...@@ -43,6 +45,7 @@
43#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */45#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */
4446
45#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */47#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
48#define EXFAT_SUPER_MAGIC 0x2011BAB0
46#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */49#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
47#define NFS_SUPER_MAGIC 0x696950#define NFS_SUPER_MAGIC 0x6969
48#define OCFS2_SUPER_MAGIC 0x7461636f51#define OCFS2_SUPER_MAGIC 0x7461636f
...@@ -51,6 +54,7 @@...@@ -51,6 +54,7 @@
51#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */54#define QNX6_SUPER_MAGIC 0x68191122 /* qnx6 fs detection */
52#define AFS_FS_MAGIC 0x6B41465355#define AFS_FS_MAGIC 0x6B414653
5356
57
54#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */58#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
55 /* used by file system utilities that59 /* used by file system utilities that
56 look at the superblock, etc. */60 look at the superblock, etc. */
...@@ -59,6 +63,9 @@...@@ -59,6 +63,9 @@
59#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"63#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
6064
61#define SMB_SUPER_MAGIC 0x517B65#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
62#define CGROUP_SUPER_MAGIC 0x27e0eb69#define CGROUP_SUPER_MAGIC 0x27e0eb
63#define CGROUP2_SUPER_MAGIC 0x6367727070#define CGROUP2_SUPER_MAGIC 0x63677270
6471
...@@ -91,12 +98,8 @@...@@ -91,12 +98,8 @@
9198
92/* Since UDF 2.01 is ISO 13346 based... */99/* Since UDF 2.01 is ISO 13346 based... */
93#define UDF_SUPER_MAGIC 0x15013346100#define UDF_SUPER_MAGIC 0x15013346
94#define BALLOON_KVM_MAGIC 0x13661366
95#define ZSMALLOC_MAGIC 0x58295829
96#define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */101#define DMA_BUF_MAGIC 0x444d4142 /* "DMAB" */
97#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */102#define DEVMEM_MAGIC 0x454d444d /* "DMEM" */
98#define Z3FOLD_MAGIC 0x33
99#define PPC_CMM_MAGIC 0xc7571590
100#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */103#define SECRETMEM_MAGIC 0x5345434d /* "SECM" */
101104
102#endif /* __LINUX_MAGIC_H__ */105#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 {...@@ -44,7 +44,25 @@ struct sockaddr_mctp_ext {
4444
45#define MCTP_TAG_MASK 0x0745#define MCTP_TAG_MASK 0x07
46#define MCTP_TAG_OWNER 0x0846#define MCTP_TAG_OWNER 0x08
47#define MCTP_TAG_PREALLOC 0x10
4748
48#define MCTP_OPT_ADDR_EXT 149#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
50#endif /* __UAPI_MCTP_H */68#endif /* __UAPI_MCTP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mdio.h+83
...@@ -67,6 +67,21 @@...@@ -67,6 +67,21 @@
67#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */67#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
68#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */68#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
69#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */69#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
71/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */86/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
72#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */87#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
...@@ -159,6 +174,7 @@...@@ -159,6 +174,7 @@
159#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */174#define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */
160#define MDIO_PMA_CTRL2_2_5GBT 0x0030 /* 2.5GBaseT type */175#define MDIO_PMA_CTRL2_2_5GBT 0x0030 /* 2.5GBaseT type */
161#define MDIO_PMA_CTRL2_5GBT 0x0031 /* 5GBaseT type */176#define MDIO_PMA_CTRL2_5GBT 0x0031 /* 5GBaseT type */
177#define MDIO_PMA_CTRL2_BASET1 0x003D /* BASE-T1 type */
162#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */178#define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */
163#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */179#define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */
164#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */180#define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */
...@@ -212,6 +228,7 @@...@@ -212,6 +228,7 @@
212#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */228#define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */
213#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */229#define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */
214#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */230#define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */
231#define MDIO_PMA_EXTABLE_BT1 0x0800 /* BASE-T1 ability */
215#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */232#define MDIO_PMA_EXTABLE_NBT 0x4000 /* 2.5/5GBASE-T ability */
216233
217/* PHY XGXS lane state register. */234/* PHY XGXS lane state register. */
...@@ -268,6 +285,72 @@...@@ -268,6 +285,72 @@
268#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */285#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
269#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */286#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
271/* EEE Supported/Advertisement/LP Advertisement registers.354/* EEE Supported/Advertisement/LP Advertisement registers.
272 *355 *
273 * EEE capability Register (3.20), Advertisement (7.60) and356 * 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 @@...@@ -34,7 +34,7 @@
3434
35#define MEDIA_BUS_FMT_FIXED 0x000135#define MEDIA_BUS_FMT_FIXED 0x0001
3636
37/* RGB - next is 0x101e */37/* RGB - next is 0x1025 */
38#define MEDIA_BUS_FMT_RGB444_1X12 0x101638#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
39#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x100139#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
40#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x100240#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
...@@ -46,8 +46,11 @@...@@ -46,8 +46,11 @@
46#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x100746#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
47#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x100847#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
48#define MEDIA_BUS_FMT_RGB666_1X18 0x100948#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
49#define MEDIA_BUS_FMT_BGR666_1X18 0x1023
49#define MEDIA_BUS_FMT_RBG888_1X24 0x100e50#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
50#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x101551#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
51#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x101054#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
52#define MEDIA_BUS_FMT_BGR888_1X24 0x101355#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
53#define MEDIA_BUS_FMT_BGR888_3X8 0x101b56#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
...@@ -59,13 +62,17 @@...@@ -59,13 +62,17 @@
59#define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d62#define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d
60#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x101163#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011
61#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x101264#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
62#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d67#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
63#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f68#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f
64#define MEDIA_BUS_FMT_RGB101010_1X30 0x101869#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
65#define MEDIA_BUS_FMT_RGB121212_1X36 0x101972#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
66#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a73#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
6774
68/* YUV (including grey) - next is 0x202e */75/* YUV (including grey) - next is 0x202f */
69#define MEDIA_BUS_FMT_Y8_1X8 0x200176#define MEDIA_BUS_FMT_Y8_1X8 0x2001
70#define MEDIA_BUS_FMT_UV8_1X8 0x201577#define MEDIA_BUS_FMT_UV8_1X8 0x2015
71#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x200278#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
...@@ -88,6 +95,7 @@...@@ -88,6 +95,7 @@
88#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e95#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
89#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f96#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
90#define MEDIA_BUS_FMT_Y14_1X14 0x202d97#define MEDIA_BUS_FMT_Y14_1X14 0x202d
98#define MEDIA_BUS_FMT_Y16_1X16 0x202e
91#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f99#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
92#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010100#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
93#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011101#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
lib/libc/include/any-linux-any/linux/media.h+1-1
...@@ -20,7 +20,6 @@...@@ -20,7 +20,6 @@
20#ifndef __LINUX_MEDIA_H20#ifndef __LINUX_MEDIA_H
21#define __LINUX_MEDIA_H21#define __LINUX_MEDIA_H
2222
23#include <stdint.h>
24#include <linux/ioctl.h>23#include <linux/ioctl.h>
25#include <linux/types.h>24#include <linux/types.h>
2625
...@@ -222,6 +221,7 @@ struct media_pad_desc {...@@ -222,6 +221,7 @@ struct media_pad_desc {
222#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)221#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
223# define MEDIA_LNK_FL_DATA_LINK (0 << 28)222# define MEDIA_LNK_FL_DATA_LINK (0 << 28)
224# define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)223# define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28)
224# define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28)
225225
226struct media_link_desc {226struct media_link_desc {
227 struct media_pad_desc source;227 struct media_pad_desc source;
lib/libc/include/any-linux-any/linux/membarrier.h+4
...@@ -137,6 +137,9 @@...@@ -137,6 +137,9 @@
137 * @MEMBARRIER_CMD_SHARED:137 * @MEMBARRIER_CMD_SHARED:
138 * Alias to MEMBARRIER_CMD_GLOBAL. Provided for138 * Alias to MEMBARRIER_CMD_GLOBAL. Provided for
139 * header backward compatibility.139 * header backward compatibility.
140 * @MEMBARRIER_CMD_GET_REGISTRATIONS:
141 * Returns a bitmask of previously issued
142 * registration commands.
140 *143 *
141 * Command to be passed to the membarrier system call. The commands need to144 * Command to be passed to the membarrier system call. The commands need to
142 * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to145 * be a single bit each, except for MEMBARRIER_CMD_QUERY which is assigned to
...@@ -153,6 +156,7 @@ enum membarrier_cmd {...@@ -153,6 +156,7 @@ enum membarrier_cmd {
153 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),156 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = (1 << 6),
154 MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = (1 << 7),157 MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = (1 << 7),
155 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = (1 << 8),158 MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = (1 << 8),
159 MEMBARRIER_CMD_GET_REGISTRATIONS = (1 << 9),
156160
157 /* Alias for header backward compatibility. */161 /* Alias for header backward compatibility. */
158 MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,162 MEMBARRIER_CMD_SHARED = MEMBARRIER_CMD_GLOBAL,
lib/libc/include/any-linux-any/linux/memfd.h+4
...@@ -8,6 +8,10 @@...@@ -8,6 +8,10 @@
8#define MFD_CLOEXEC 0x0001U8#define MFD_CLOEXEC 0x0001U
9#define MFD_ALLOW_SEALING 0x0002U9#define MFD_ALLOW_SEALING 0x0002U
10#define MFD_HUGETLB 0x0004U10#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
12/*16/*
13 * Huge page size encoding when MFD_HUGETLB is specified, and a huge page17 * 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 {...@@ -97,11 +97,11 @@ struct minix3_super_block {
9797
98struct minix_dir_entry {98struct minix_dir_entry {
99 __u16 inode;99 __u16 inode;
100 char name[0];100 char name[];
101};101};
102102
103struct minix3_dir_entry {103struct minix3_dir_entry {
104 __u32 inode;104 __u32 inode;
105 char name[0];105 char name[];
106};106};
107#endif107#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 {...@@ -58,7 +58,7 @@ struct mmc_ioc_cmd {
58 */58 */
59struct mmc_ioc_multi_cmd {59struct mmc_ioc_multi_cmd {
60 __u64 num_of_cmds;60 __u64 num_of_cmds;
61 struct mmc_ioc_cmd cmds[0];61 struct mmc_ioc_cmd cmds[];
62};62};
6363
64#define MMC_IOC_CMD _IOWR(MMC_BLOCK_MAJOR, 0, struct mmc_ioc_cmd)64#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 @@...@@ -5,5 +5,6 @@
5/* Flags for sys_finit_module: */5/* Flags for sys_finit_module: */
6#define MODULE_INIT_IGNORE_MODVERSIONS 16#define MODULE_INIT_IGNORE_MODVERSIONS 1
7#define MODULE_INIT_IGNORE_VERMAGIC 27#define MODULE_INIT_IGNORE_VERMAGIC 2
8#define MODULE_INIT_COMPRESSED_FILE 4
89
9#endif /* _LINUX_MODULE_H */10#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 @@...@@ -2,14 +2,15 @@
2#ifndef _MPTCP_H2#ifndef _MPTCP_H
3#define _MPTCP_H3#define _MPTCP_H
44
5#include <netinet/in.h> /* for sockaddr_in and sockaddr_in6 */
6#include <sys/socket.h> /* for struct sockaddr */
7
5#include <linux/const.h>8#include <linux/const.h>
6#include <linux/types.h>9#include <linux/types.h>
7#include <linux/in.h> /* for sockaddr_in */10#include <linux/in.h> /* for sockaddr_in */
8#include <linux/in6.h> /* for sockaddr_in6 */11#include <linux/in6.h> /* for sockaddr_in6 */
9#include <linux/socket.h> /* for sockaddr_storage and sa_family */12#include <linux/socket.h> /* for sockaddr_storage and sa_family */
1013
11#include <sys/socket.h> /* for struct sockaddr */
12
13#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)14#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
14#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)15#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
15#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)16#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)
...@@ -53,6 +54,9 @@ enum {...@@ -53,6 +54,9 @@ enum {
53 MPTCP_PM_ATTR_ADDR, /* nested address */54 MPTCP_PM_ATTR_ADDR, /* nested address */
54 MPTCP_PM_ATTR_RCV_ADD_ADDRS, /* u32 */55 MPTCP_PM_ATTR_RCV_ADD_ADDRS, /* u32 */
55 MPTCP_PM_ATTR_SUBFLOWS, /* u32 */56 MPTCP_PM_ATTR_SUBFLOWS, /* u32 */
57 MPTCP_PM_ATTR_TOKEN, /* u32 */
58 MPTCP_PM_ATTR_LOC_ID, /* u8 */
59 MPTCP_PM_ATTR_ADDR_REMOTE, /* nested address */
5660
57 __MPTCP_PM_ATTR_MAX61 __MPTCP_PM_ATTR_MAX
58};62};
...@@ -79,6 +83,7 @@ enum {...@@ -79,6 +83,7 @@ enum {
79#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)83#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
80#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)84#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
81#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)85#define MPTCP_PM_ADDR_FLAG_FULLMESH (1 << 3)
86#define MPTCP_PM_ADDR_FLAG_IMPLICIT (1 << 4)
8287
83enum {88enum {
84 MPTCP_PM_CMD_UNSPEC,89 MPTCP_PM_CMD_UNSPEC,
...@@ -90,6 +95,10 @@ enum {...@@ -90,6 +95,10 @@ enum {
90 MPTCP_PM_CMD_SET_LIMITS,95 MPTCP_PM_CMD_SET_LIMITS,
91 MPTCP_PM_CMD_GET_LIMITS,96 MPTCP_PM_CMD_GET_LIMITS,
92 MPTCP_PM_CMD_SET_FLAGS,97 MPTCP_PM_CMD_SET_FLAGS,
98 MPTCP_PM_CMD_ANNOUNCE,
99 MPTCP_PM_CMD_REMOVE,
100 MPTCP_PM_CMD_SUBFLOW_CREATE,
101 MPTCP_PM_CMD_SUBFLOW_DESTROY,
93102
94 __MPTCP_PM_CMD_AFTER_LAST103 __MPTCP_PM_CMD_AFTER_LAST
95};104};
...@@ -149,6 +158,12 @@ struct mptcp_info {...@@ -149,6 +158,12 @@ struct mptcp_info {
149 * daddr4 | daddr6, sport, dport, backup, if_idx158 * daddr4 | daddr6, sport, dport, backup, if_idx
150 * [, error]159 * [, error]
151 * The priority of a subflow has changed. 'error' should not be set.160 * The priority of a subflow has changed. 'error' should not be set.
161 *
162 * MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6
163 * A new PM listener is created.
164 *
165 * MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6
166 * A PM listener is closed.
152 */167 */
153enum mptcp_event_type {168enum mptcp_event_type {
154 MPTCP_EVENT_UNSPEC = 0,169 MPTCP_EVENT_UNSPEC = 0,
...@@ -163,6 +178,9 @@ enum mptcp_event_type {...@@ -163,6 +178,9 @@ enum mptcp_event_type {
163 MPTCP_EVENT_SUB_CLOSED = 11,178 MPTCP_EVENT_SUB_CLOSED = 11,
164179
165 MPTCP_EVENT_SUB_PRIORITY = 13,180 MPTCP_EVENT_SUB_PRIORITY = 13,
181
182 MPTCP_EVENT_LISTENER_CREATED = 15,
183 MPTCP_EVENT_LISTENER_CLOSED = 16,
166};184};
167185
168enum mptcp_event_attr {186enum mptcp_event_attr {
...@@ -185,6 +203,7 @@ enum mptcp_event_attr {...@@ -185,6 +203,7 @@ enum mptcp_event_attr {
185 MPTCP_ATTR_IF_IDX, /* s32 */203 MPTCP_ATTR_IF_IDX, /* s32 */
186 MPTCP_ATTR_RESET_REASON,/* u32 */204 MPTCP_ATTR_RESET_REASON,/* u32 */
187 MPTCP_ATTR_RESET_FLAGS, /* u32 */205 MPTCP_ATTR_RESET_FLAGS, /* u32 */
206 MPTCP_ATTR_SERVER_SIDE, /* u8 */
188207
189 __MPTCP_ATTR_AFTER_LAST208 __MPTCP_ATTR_AFTER_LAST
190};209};
lib/libc/include/any-linux-any/linux/mroute6.h+1
...@@ -134,6 +134,7 @@ struct mrt6msg {...@@ -134,6 +134,7 @@ struct mrt6msg {
134#define MRT6MSG_NOCACHE 1134#define MRT6MSG_NOCACHE 1
135#define MRT6MSG_WRONGMIF 2135#define MRT6MSG_WRONGMIF 2
136#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */136#define MRT6MSG_WHOLEPKT 3 /* used for use level encap */
137#define MRT6MSG_WRMIFWHOLE 4 /* For PIM Register and assert processing */
137 __u8 im6_mbz; /* must be zero */138 __u8 im6_mbz; /* must be zero */
138 __u8 im6_msgtype; /* what type of message */139 __u8 im6_msgtype; /* what type of message */
139 __u16 im6_mif; /* mif rec'd on */140 __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 {...@@ -30,25 +30,25 @@ struct nd_cmd_get_config_data_hdr {
30 __u32 in_offset;30 __u32 in_offset;
31 __u32 in_length;31 __u32 in_length;
32 __u32 status;32 __u32 status;
33 __u8 out_buf[0];33 __u8 out_buf[];
34} __attribute__((packed));34} __attribute__((packed));
3535
36struct nd_cmd_set_config_hdr {36struct nd_cmd_set_config_hdr {
37 __u32 in_offset;37 __u32 in_offset;
38 __u32 in_length;38 __u32 in_length;
39 __u8 in_buf[0];39 __u8 in_buf[];
40} __attribute__((packed));40} __attribute__((packed));
4141
42struct nd_cmd_vendor_hdr {42struct nd_cmd_vendor_hdr {
43 __u32 opcode;43 __u32 opcode;
44 __u32 in_length;44 __u32 in_length;
45 __u8 in_buf[0];45 __u8 in_buf[];
46} __attribute__((packed));46} __attribute__((packed));
4747
48struct nd_cmd_vendor_tail {48struct nd_cmd_vendor_tail {
49 __u32 status;49 __u32 status;
50 __u32 out_length;50 __u32 out_length;
51 __u8 out_buf[0];51 __u8 out_buf[];
52} __attribute__((packed));52} __attribute__((packed));
5353
54struct nd_cmd_ars_cap {54struct nd_cmd_ars_cap {
...@@ -86,7 +86,7 @@ struct nd_cmd_ars_status {...@@ -86,7 +86,7 @@ struct nd_cmd_ars_status {
86 __u32 reserved;86 __u32 reserved;
87 __u64 err_address;87 __u64 err_address;
88 __u64 length;88 __u64 length;
89 } __attribute__((packed)) records[0];89 } __attribute__((packed)) records[];
90} __attribute__((packed));90} __attribute__((packed));
9191
92struct nd_cmd_clear_error {92struct nd_cmd_clear_error {
...@@ -189,7 +189,6 @@ static __inline__ const char *nvdimm_cmd_name(unsigned cmd)...@@ -189,7 +189,6 @@ static __inline__ const char *nvdimm_cmd_name(unsigned cmd)
189#define ND_DEVICE_REGION_BLK 3 /* nd_region: (parent of BLK namespaces) */189#define ND_DEVICE_REGION_BLK 3 /* nd_region: (parent of BLK namespaces) */
190#define ND_DEVICE_NAMESPACE_IO 4 /* legacy persistent memory */190#define ND_DEVICE_NAMESPACE_IO 4 /* legacy persistent memory */
191#define ND_DEVICE_NAMESPACE_PMEM 5 /* PMEM namespace (may alias with BLK) */191#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) */
193#define ND_DEVICE_DAX_PMEM 7 /* Device DAX interface to pmem */192#define ND_DEVICE_DAX_PMEM 7 /* Device DAX interface to pmem */
194193
195enum nd_driver_flags {194enum nd_driver_flags {
...@@ -198,7 +197,6 @@ enum nd_driver_flags {...@@ -198,7 +197,6 @@ enum nd_driver_flags {
198 ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,197 ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
199 ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,198 ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
200 ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,199 ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
201 ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
202 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,200 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
203};201};
204202
lib/libc/include/any-linux-any/linux/neighbour.h+10-1
...@@ -32,6 +32,8 @@ enum {...@@ -32,6 +32,8 @@ enum {
32 NDA_NH_ID,32 NDA_NH_ID,
33 NDA_FDB_EXT_ATTRS,33 NDA_FDB_EXT_ATTRS,
34 NDA_FLAGS_EXT,34 NDA_FLAGS_EXT,
35 NDA_NDM_STATE_MASK,
36 NDA_NDM_FLAGS_MASK,
35 __NDA_MAX37 __NDA_MAX
36};38};
3739
...@@ -50,7 +52,8 @@ enum {...@@ -50,7 +52,8 @@ enum {
50#define NTF_STICKY (1 << 6)52#define NTF_STICKY (1 << 6)
51#define NTF_ROUTER (1 << 7)53#define NTF_ROUTER (1 << 7)
52/* Extended flags under NDA_FLAGS_EXT: */54/* 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
55/*58/*
56 * Neighbor Cache Entry States.59 * Neighbor Cache Entry States.
...@@ -84,6 +87,11 @@ enum {...@@ -84,6 +87,11 @@ enum {
84 * NTF_EXT_MANAGED flagged neigbor entries are managed by the kernel on behalf87 * NTF_EXT_MANAGED flagged neigbor entries are managed by the kernel on behalf
85 * of a user space control plane, and automatically refreshed so that (if88 * of a user space control plane, and automatically refreshed so that (if
86 * possible) they remain in NUD_REACHABLE state.89 * 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.
87 */95 */
8896
89struct nda_cacheinfo {97struct nda_cacheinfo {
...@@ -152,6 +160,7 @@ enum {...@@ -152,6 +160,7 @@ enum {
152 NDTPA_QUEUE_LENBYTES, /* u32 */160 NDTPA_QUEUE_LENBYTES, /* u32 */
153 NDTPA_MCAST_REPROBES, /* u32 */161 NDTPA_MCAST_REPROBES, /* u32 */
154 NDTPA_PAD,162 NDTPA_PAD,
163 NDTPA_INTERVAL_PROBE_TIME_MS, /* u64, msecs */
155 __NDTPA_MAX164 __NDTPA_MAX
156};165};
157#define NDTPA_MAX (__NDTPA_MAX - 1)166#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 {...@@ -29,12 +29,12 @@ struct net_dm_config_entry {
2929
30struct net_dm_config_msg {30struct net_dm_config_msg {
31 __u32 entries;31 __u32 entries;
32 struct net_dm_config_entry options[0];32 struct net_dm_config_entry options[];
33};33};
3434
35struct net_dm_alert_msg {35struct net_dm_alert_msg {
36 __u32 entries;36 __u32 entries;
37 struct net_dm_drop_point points[0];37 struct net_dm_drop_point points[];
38};38};
3939
40struct net_dm_user_msg {40struct net_dm_user_msg {
...@@ -93,6 +93,7 @@ enum net_dm_attr {...@@ -93,6 +93,7 @@ enum net_dm_attr {
93 NET_DM_ATTR_SW_DROPS, /* flag */93 NET_DM_ATTR_SW_DROPS, /* flag */
94 NET_DM_ATTR_HW_DROPS, /* flag */94 NET_DM_ATTR_HW_DROPS, /* flag */
95 NET_DM_ATTR_FLOW_ACTION_COOKIE, /* binary */95 NET_DM_ATTR_FLOW_ACTION_COOKIE, /* binary */
96 NET_DM_ATTR_REASON, /* string */
9697
97 __NET_DM_ATTR_MAX,98 __NET_DM_ATTR_MAX,
98 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 199 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 {...@@ -31,8 +31,9 @@ enum {
31 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),31 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),
32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),32 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
33 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),33 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,
36 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |37 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
37 SOF_TIMESTAMPING_LAST38 SOF_TIMESTAMPING_LAST
38};39};
...@@ -62,7 +63,7 @@ struct so_timestamping {...@@ -62,7 +63,7 @@ struct so_timestamping {
62/**63/**
63 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter64 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
64 *65 *
65 * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP66 * @flags: one of HWTSTAMP_FLAG_*
66 * @tx_type: one of HWTSTAMP_TX_*67 * @tx_type: one of HWTSTAMP_TX_*
67 * @rx_filter: one of HWTSTAMP_FILTER_*68 * @rx_filter: one of HWTSTAMP_FILTER_*
68 *69 *
...@@ -78,6 +79,21 @@ struct hwtstamp_config {...@@ -78,6 +79,21 @@ struct hwtstamp_config {
78 int rx_filter;79 int rx_filter;
79};80};
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
81/* possible values for hwtstamp_config->tx_type */97/* possible values for hwtstamp_config->tx_type */
82enum hwtstamp_tx_types {98enum hwtstamp_tx_types {
83 /*99 /*
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 @@...@@ -3,10 +3,6 @@
3 * Patrick Schaaf <bof@bof.de>3 * Patrick Schaaf <bof@bof.de>
4 * Martin Josefsson <gandalf@wlug.westbo.se>4 * Martin Josefsson <gandalf@wlug.westbo.se>
5 * Copyright (C) 2003-2011 Jozsef Kadlecsik <kadlec@netfilter.org>5 * 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.
10 */6 */
11#ifndef _IP_SET_H7#ifndef _IP_SET_H
12#define _IP_SET_H8#define _IP_SET_H
...@@ -89,6 +85,7 @@ enum {...@@ -89,6 +85,7 @@ enum {
89 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */85 IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO, /* 9 */
90 IPSET_ATTR_MARK, /* 10 */86 IPSET_ATTR_MARK, /* 10 */
91 IPSET_ATTR_MARKMASK, /* 11 */87 IPSET_ATTR_MARKMASK, /* 11 */
88 IPSET_ATTR_BITMASK, /* 12 */
92 /* Reserve empty slots */89 /* Reserve empty slots */
93 IPSET_ATTR_CADT_MAX = 16,90 IPSET_ATTR_CADT_MAX = 16,
94 /* Create-only specific attributes */91 /* Create-only specific attributes */
...@@ -157,6 +154,7 @@ enum ipset_errno {...@@ -157,6 +154,7 @@ enum ipset_errno {
157 IPSET_ERR_COMMENT,154 IPSET_ERR_COMMENT,
158 IPSET_ERR_INVALID_MARKMASK,155 IPSET_ERR_INVALID_MARKMASK,
159 IPSET_ERR_SKBINFO,156 IPSET_ERR_SKBINFO,
157 IPSET_ERR_BITMASK_NETMASK_EXCL,
160158
161 /* Type specific error codes */159 /* Type specific error codes */
162 IPSET_ERR_TYPE_SPECIFIC = 4352,160 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 {...@@ -94,7 +94,7 @@ enum ip_conntrack_status {
94 IPS_UNTRACKED = (1 << IPS_UNTRACKED_BIT),94 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). */
98 IPS_HELPER_BIT = 13,98 IPS_HELPER_BIT = 13,
99 IPS_HELPER = (1 << IPS_HELPER_BIT),99 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 {...@@ -15,7 +15,7 @@ enum sctp_conntrack {
15 SCTP_CONNTRACK_SHUTDOWN_RECD,15 SCTP_CONNTRACK_SHUTDOWN_RECD,
16 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,16 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
17 SCTP_CONNTRACK_HEARTBEAT_SENT,17 SCTP_CONNTRACK_HEARTBEAT_SENT,
18 SCTP_CONNTRACK_HEARTBEAT_ACKED,18 SCTP_CONNTRACK_HEARTBEAT_ACKED, /* no longer used */
19 SCTP_CONNTRACK_MAX19 SCTP_CONNTRACK_MAX
20};20};
2121
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+43
...@@ -97,6 +97,14 @@ enum nft_verdicts {...@@ -97,6 +97,14 @@ enum nft_verdicts {
97 * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes)97 * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes)
98 * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes)98 * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes)
99 * @NFT_MSG_DELFLOWTABLE: delete flow table (enum nft_flowtable_attributes)99 * @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)
100 */108 */
101enum nf_tables_msg_types {109enum nf_tables_msg_types {
102 NFT_MSG_NEWTABLE,110 NFT_MSG_NEWTABLE,
...@@ -124,6 +132,14 @@ enum nf_tables_msg_types {...@@ -124,6 +132,14 @@ enum nf_tables_msg_types {
124 NFT_MSG_NEWFLOWTABLE,132 NFT_MSG_NEWFLOWTABLE,
125 NFT_MSG_GETFLOWTABLE,133 NFT_MSG_GETFLOWTABLE,
126 NFT_MSG_DELFLOWTABLE,134 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,
127 NFT_MSG_MAX,143 NFT_MSG_MAX,
128};144};
129145
...@@ -760,6 +776,7 @@ enum nft_payload_bases {...@@ -760,6 +776,7 @@ enum nft_payload_bases {
760 NFT_PAYLOAD_NETWORK_HEADER,776 NFT_PAYLOAD_NETWORK_HEADER,
761 NFT_PAYLOAD_TRANSPORT_HEADER,777 NFT_PAYLOAD_TRANSPORT_HEADER,
762 NFT_PAYLOAD_INNER_HEADER,778 NFT_PAYLOAD_INNER_HEADER,
779 NFT_PAYLOAD_TUN_HEADER,
763};780};
764781
765/**782/**
...@@ -779,6 +796,32 @@ enum nft_payload_csum_flags {...@@ -779,6 +796,32 @@ enum nft_payload_csum_flags {
779 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = (1 << 0),796 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = (1 << 0),
780};797};
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
782/**825/**
783 * enum nft_payload_attributes - nf_tables payload expression netlink attributes826 * enum nft_payload_attributes - nf_tables payload expression netlink attributes
784 *827 *
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_cttimeout.h+1-1
...@@ -94,7 +94,7 @@ enum ctattr_timeout_sctp {...@@ -94,7 +94,7 @@ enum ctattr_timeout_sctp {
94 CTA_TIMEOUT_SCTP_SHUTDOWN_RECD,94 CTA_TIMEOUT_SCTP_SHUTDOWN_RECD,
95 CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT,95 CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT,
96 CTA_TIMEOUT_SCTP_HEARTBEAT_SENT,96 CTA_TIMEOUT_SCTP_HEARTBEAT_SENT,
97 CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED,97 CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED, /* no longer used */
98 __CTA_TIMEOUT_SCTP_MAX98 __CTA_TIMEOUT_SCTP_MAX
99};99};
100#define CTA_TIMEOUT_SCTP_MAX (__CTA_TIMEOUT_SCTP_MAX - 1)100#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 {...@@ -61,6 +61,7 @@ enum nfqnl_attr_type {
61 NFQA_SECCTX, /* security context string */61 NFQA_SECCTX, /* security context string */
62 NFQA_VLAN, /* nested attribute: packet vlan info */62 NFQA_VLAN, /* nested attribute: packet vlan info */
63 NFQA_L2HDR, /* full L2 header */63 NFQA_L2HDR, /* full L2 header */
64 NFQA_PRIORITY, /* skb->priority */
6465
65 __NFQA_MAX66 __NFQA_MAX
66};67};
lib/libc/include/any-linux-any/linux/netfilter/x_tables.h+2-2
...@@ -28,7 +28,7 @@ struct xt_entry_match {...@@ -28,7 +28,7 @@ struct xt_entry_match {
28 __u16 match_size;28 __u16 match_size;
29 } u;29 } u;
3030
31 unsigned char data[0];31 unsigned char data[];
32};32};
3333
34struct xt_entry_target {34struct xt_entry_target {
...@@ -119,7 +119,7 @@ struct xt_counters_info {...@@ -119,7 +119,7 @@ struct xt_counters_info {
119 unsigned int num_counters;119 unsigned int num_counters;
120120
121 /* The counters (actually `number' of these). */121 /* The counters (actually `number' of these). */
122 struct xt_counters counters[0];122 struct xt_counters counters[];
123};123};
124124
125#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */125#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 @@...@@ -4,10 +4,6 @@
4 *4 *
5 * (C) 2010-2011 Thomas Graf <tgraf@redhat.com>5 * (C) 2010-2011 Thomas Graf <tgraf@redhat.com>
6 * (C) 2010-2011 Red Hat, Inc.6 * (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.
11 */7 */
128
13#ifndef _XT_AUDIT_TARGET_H9#ifndef _XT_AUDIT_TARGET_H
lib/libc/include/any-linux-any/linux/netfilter/xt_IDLETIMER.h+1-16
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
1/*2/*
2 * linux/include/linux/netfilter/xt_IDLETIMER.h
3 *
4 * Header file for Xtables timer target module.3 * Header file for Xtables timer target module.
5 *4 *
6 * Copyright (C) 2004, 2010 Nokia Corporation5 * Copyright (C) 2004, 2010 Nokia Corporation
...@@ -10,20 +9,6 @@...@@ -10,20 +9,6 @@
10 * by Luciano Coelho <luciano.coelho@nokia.com>9 * by Luciano Coelho <luciano.coelho@nokia.com>
11 *10 *
12 * Contact: Luciano Coelho <luciano.coelho@nokia.com>11 * 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
27 */12 */
2813
29#ifndef _XT_IDLETIMER_H14#ifndef _XT_IDLETIMER_H
lib/libc/include/any-linux-any/linux/netfilter/xt_connmark.h+4-9
...@@ -1,18 +1,13 @@...@@ -1,18 +1,13 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* 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
2#ifndef _XT_CONNMARK_H6#ifndef _XT_CONNMARK_H
3#define _XT_CONNMARK_H7#define _XT_CONNMARK_H
48
5#include <linux/types.h>9#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
16enum {11enum {
17 XT_CONNMARK_SET = 0,12 XT_CONNMARK_SET = 0,
18 XT_CONNMARK_SAVE,13 XT_CONNMARK_SAVE,
lib/libc/include/any-linux-any/linux/netfilter/xt_osf.h-14
...@@ -1,20 +1,6 @@...@@ -1,20 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru>3 * 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/>.
18 */4 */
195
20#ifndef _XT_OSF_H6#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...@@ -107,7 +107,7 @@ struct arpt_entry
107 struct xt_counters counters;107 struct xt_counters counters;
108108
109 /* The matches (if any), then the target. */109 /* The matches (if any), then the target. */
110 unsigned char elems[0];110 unsigned char elems[];
111};111};
112112
113/*113/*
...@@ -179,7 +179,7 @@ struct arpt_replace {...@@ -179,7 +179,7 @@ struct arpt_replace {
179 struct xt_counters *counters;179 struct xt_counters *counters;
180180
181 /* The entries (hang off end: not really an array). */181 /* The entries (hang off end: not really an array). */
182 struct arpt_entry entries[0];182 struct arpt_entry entries[];
183};183};
184184
185/* The argument to ARPT_SO_GET_ENTRIES. */185/* The argument to ARPT_SO_GET_ENTRIES. */
...@@ -191,7 +191,7 @@ struct arpt_get_entries {...@@ -191,7 +191,7 @@ struct arpt_get_entries {
191 unsigned int size;191 unsigned int size;
192192
193 /* The entries. */193 /* The entries. */
194 struct arpt_entry entrytable[0];194 struct arpt_entry entrytable[];
195};195};
196196
197/* Helper functions */197/* 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 {...@@ -40,7 +40,7 @@ struct ebt_mac_wormhash_tuple {
40struct ebt_mac_wormhash {40struct ebt_mac_wormhash {
41 int table[257];41 int table[257];
42 int poolsize;42 int poolsize;
43 struct ebt_mac_wormhash_tuple pool[0];43 struct ebt_mac_wormhash_tuple pool[];
44};44};
4545
46#define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \46#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 {...@@ -119,7 +119,7 @@ struct ipt_entry {
119 struct xt_counters counters;119 struct xt_counters counters;
120120
121 /* The matches (if any), then the target. */121 /* The matches (if any), then the target. */
122 unsigned char elems[0];122 unsigned char elems[];
123};123};
124124
125/*125/*
...@@ -201,7 +201,7 @@ struct ipt_replace {...@@ -201,7 +201,7 @@ struct ipt_replace {
201 struct xt_counters *counters;201 struct xt_counters *counters;
202202
203 /* The entries (hang off end: not really an array). */203 /* The entries (hang off end: not really an array). */
204 struct ipt_entry entries[0];204 struct ipt_entry entries[];
205};205};
206206
207/* The argument to IPT_SO_GET_ENTRIES. */207/* The argument to IPT_SO_GET_ENTRIES. */
...@@ -213,7 +213,7 @@ struct ipt_get_entries {...@@ -213,7 +213,7 @@ struct ipt_get_entries {
213 unsigned int size;213 unsigned int size;
214214
215 /* The entries. */215 /* The entries. */
216 struct ipt_entry entrytable[0];216 struct ipt_entry entrytable[];
217};217};
218218
219/* Helper functions */219/* Helper functions */
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6_tables.h+2-2
...@@ -241,7 +241,7 @@ struct ip6t_replace {...@@ -241,7 +241,7 @@ struct ip6t_replace {
241 struct xt_counters *counters;241 struct xt_counters *counters;
242242
243 /* The entries (hang off end: not really an array). */243 /* The entries (hang off end: not really an array). */
244 struct ip6t_entry entries[0];244 struct ip6t_entry entries[];
245};245};
246246
247/* The argument to IP6T_SO_GET_ENTRIES. */247/* The argument to IP6T_SO_GET_ENTRIES. */
...@@ -253,7 +253,7 @@ struct ip6t_get_entries {...@@ -253,7 +253,7 @@ struct ip6t_get_entries {
253 unsigned int size;253 unsigned int size;
254254
255 /* The entries. */255 /* The entries. */
256 struct ip6t_entry entrytable[0];256 struct ip6t_entry entrytable[];
257};257};
258258
259/* Helper functions */259/* Helper functions */
lib/libc/include/any-linux-any/linux/netfilter_ipv6/ip6t_LOG.h+1-1
...@@ -17,4 +17,4 @@ struct ip6t_log_info {...@@ -17,4 +17,4 @@ struct ip6t_log_info {
17 char prefix[30];17 char prefix[30];
18};18};
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 @@...@@ -20,7 +20,7 @@
20#define NETLINK_CONNECTOR 1120#define NETLINK_CONNECTOR 11
21#define NETLINK_NETFILTER 12 /* netfilter subsystem */21#define NETLINK_NETFILTER 12 /* netfilter subsystem */
22#define NETLINK_IP6_FW 1322#define NETLINK_IP6_FW 13
23#define NETLINK_DNRTMSG 14 /* DECnet routing messages */23#define NETLINK_DNRTMSG 14 /* DECnet routing messages (obsolete) */
24#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */24#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
25#define NETLINK_GENERIC 1625#define NETLINK_GENERIC 16
26/* leave room for NETLINK_DM (DM Events) */26/* leave room for NETLINK_DM (DM Events) */
...@@ -41,12 +41,20 @@ struct sockaddr_nl {...@@ -41,12 +41,20 @@ struct sockaddr_nl {
41 __u32 nl_groups; /* multicast groups mask */41 __u32 nl_groups; /* multicast groups mask */
42};42};
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 */
44struct nlmsghdr {52struct nlmsghdr {
45 __u32 nlmsg_len; /* Length of message including header */53 __u32 nlmsg_len;
46 __u16 nlmsg_type; /* Message content */54 __u16 nlmsg_type;
47 __u16 nlmsg_flags; /* Additional flags */55 __u16 nlmsg_flags;
48 __u32 nlmsg_seq; /* Sequence number */56 __u32 nlmsg_seq;
49 __u32 nlmsg_pid; /* Sending process port ID */57 __u32 nlmsg_pid;
50};58};
5159
52/* Flags values */60/* Flags values */
...@@ -54,7 +62,7 @@ struct nlmsghdr {...@@ -54,7 +62,7 @@ struct nlmsghdr {
54#define NLM_F_REQUEST 0x01 /* It is request message. */62#define NLM_F_REQUEST 0x01 /* It is request message. */
55#define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */63#define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */
56#define NLM_F_ACK 0x04 /* Reply with ack, with zero or error code */64#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 */
58#define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */66#define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */
59#define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */67#define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */
6068
...@@ -72,6 +80,7 @@ struct nlmsghdr {...@@ -72,6 +80,7 @@ struct nlmsghdr {
7280
73/* Modifiers to DELETE request */81/* Modifiers to DELETE request */
74#define NLM_F_NONREC 0x100 /* Do not delete recursively */82#define NLM_F_NONREC 0x100 /* Do not delete recursively */
83#define NLM_F_BULK 0x200 /* Delete multiple objects */
7584
76/* Flags for ACK message */85/* Flags for ACK message */
77#define NLM_F_CAPPED 0x100 /* request was capped */86#define NLM_F_CAPPED 0x100 /* request was capped */
...@@ -131,6 +140,10 @@ struct nlmsgerr {...@@ -131,6 +140,10 @@ struct nlmsgerr {
131 * be used - in the success case - to identify a created140 * be used - in the success case - to identify a created
132 * object or operation or similar (binary)141 * object or operation or similar (binary)
133 * @NLMSGERR_ATTR_POLICY: policy for a rejected attribute142 * @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
134 * @__NLMSGERR_ATTR_MAX: number of attributes147 * @__NLMSGERR_ATTR_MAX: number of attributes
135 * @NLMSGERR_ATTR_MAX: highest attribute number148 * @NLMSGERR_ATTR_MAX: highest attribute number
136 */149 */
...@@ -140,6 +153,8 @@ enum nlmsgerr_attrs {...@@ -140,6 +153,8 @@ enum nlmsgerr_attrs {
140 NLMSGERR_ATTR_OFFS,153 NLMSGERR_ATTR_OFFS,
141 NLMSGERR_ATTR_COOKIE,154 NLMSGERR_ATTR_COOKIE,
142 NLMSGERR_ATTR_POLICY,155 NLMSGERR_ATTR_POLICY,
156 NLMSGERR_ATTR_MISS_TYPE,
157 NLMSGERR_ATTR_MISS_NEST,
143158
144 __NLMSGERR_ATTR_MAX,159 __NLMSGERR_ATTR_MAX,
145 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1160 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
...@@ -332,6 +347,9 @@ enum netlink_attribute_type {...@@ -332,6 +347,9 @@ enum netlink_attribute_type {
332 * bitfield32 type (U32)347 * bitfield32 type (U32)
333 * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)348 * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64)
334 * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment349 * @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
335 */353 */
336enum netlink_policy_type_attr {354enum netlink_policy_type_attr {
337 NL_POLICY_TYPE_ATTR_UNSPEC,355 NL_POLICY_TYPE_ATTR_UNSPEC,
lib/libc/include/any-linux-any/linux/nfs4.h+1
...@@ -45,6 +45,7 @@...@@ -45,6 +45,7 @@
4545
46#define NFS4_OPEN_RESULT_CONFIRM 0x000246#define NFS4_OPEN_RESULT_CONFIRM 0x0002
47#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x000447#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
48#define NFS4_OPEN_RESULT_PRESERVE_UNLINKED 0x0008
48#define NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK 0x002049#define NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK 0x0020
4950
50#define NFS4_SHARE_ACCESS_MASK 0x000F51#define NFS4_SHARE_ACCESS_MASK 0x000F
lib/libc/include/any-linux-any/linux/nfs_fs.h+1-1
...@@ -52,7 +52,7 @@...@@ -52,7 +52,7 @@
52#define NFSDBG_CALLBACK 0x010052#define NFSDBG_CALLBACK 0x0100
53#define NFSDBG_CLIENT 0x020053#define NFSDBG_CLIENT 0x0200
54#define NFSDBG_MOUNT 0x040054#define NFSDBG_MOUNT 0x0400
55#define NFSDBG_FSCACHE 0x080055#define NFSDBG_FSCACHE 0x0800 /* unused */
56#define NFSDBG_PNFS 0x100056#define NFSDBG_PNFS 0x1000
57#define NFSDBG_PNFS_LD 0x200057#define NFSDBG_PNFS_LD 0x2000
58#define NFSDBG_STATE 0x400058#define NFSDBG_STATE 0x4000
lib/libc/include/any-linux-any/linux/nl80211.h+314-19
...@@ -11,7 +11,7 @@...@@ -11,7 +11,7 @@
11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
12 * Copyright 2008 Colin McCabe <colin@cozybit.com>12 * Copyright 2008 Colin McCabe <colin@cozybit.com>
13 * Copyright 2015-2017 Intel Deutschland GmbH13 * Copyright 2015-2017 Intel Deutschland GmbH
14 * Copyright (C) 2018-2021 Intel Corporation14 * Copyright (C) 2018-2022 Intel Corporation
15 *15 *
16 * Permission to use, copy, modify, and/or distribute this software for any16 * Permission to use, copy, modify, and/or distribute this software for any
17 * purpose with or without fee is hereby granted, provided that the above17 * purpose with or without fee is hereby granted, provided that the above
...@@ -323,6 +323,17 @@...@@ -323,6 +323,17 @@
323 * Once the association is done, the driver cleans the FILS AAD data.323 * Once the association is done, the driver cleans the FILS AAD data.
324 */324 */
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
326/**337/**
327 * enum nl80211_commands - supported nl80211 commands338 * enum nl80211_commands - supported nl80211 commands
328 *339 *
...@@ -366,14 +377,22 @@...@@ -366,14 +377,22 @@
366 * the non-transmitting interfaces are deleted as well.377 * the non-transmitting interfaces are deleted as well.
367 *378 *
368 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified379 * @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.
370 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,383 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
371 * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.384 * %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.
372 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,387 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
373 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,388 * %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.
375 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX392 * @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.
377 *396 *
378 * @NL80211_CMD_GET_BEACON: (not used)397 * @NL80211_CMD_GET_BEACON: (not used)
379 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface398 * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
...@@ -405,7 +424,8 @@...@@ -405,7 +424,8 @@
405 * interface identified by %NL80211_ATTR_IFINDEX.424 * interface identified by %NL80211_ATTR_IFINDEX.
406 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC425 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
407 * or, if no MAC address given, all stations, on the interface identified426 * or, if no MAC address given, all stations, on the interface identified
408 * by %NL80211_ATTR_IFINDEX. %NL80211_ATTR_MGMT_SUBTYPE and427 * by %NL80211_ATTR_IFINDEX. For MLD station, MLD address is used in
428 * %NL80211_ATTR_MAC. %NL80211_ATTR_MGMT_SUBTYPE and
409 * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type429 * %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
410 * of disconnection indication should be sent to the station430 * of disconnection indication should be sent to the station
411 * (Deauthentication or Disassociation frame and reason code for that431 * (Deauthentication or Disassociation frame and reason code for that
...@@ -753,6 +773,13 @@...@@ -753,6 +773,13 @@
753 * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA773 * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
754 * counters which will be updated to the current value. This attribute774 * counters which will be updated to the current value. This attribute
755 * is used during CSA period.775 * 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.
756 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this783 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
757 * command may be used with the corresponding cookie to cancel the wait784 * command may be used with the corresponding cookie to cancel the wait
758 * time if it is known that it is no longer necessary. This command is785 * time if it is known that it is no longer necessary. This command is
...@@ -763,7 +790,9 @@...@@ -763,7 +790,9 @@
763 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies790 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
764 * the TX command and %NL80211_ATTR_FRAME includes the contents of the791 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
765 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged792 * 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.
767 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for796 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
768 * backward compatibility.797 * backward compatibility.
769 *798 *
...@@ -1108,6 +1137,12 @@...@@ -1108,6 +1137,12 @@
1108 * has been received. %NL80211_ATTR_FRAME is used to specify the1137 * has been received. %NL80211_ATTR_FRAME is used to specify the
1109 * frame contents. The frame is the raw EAPoL data, without ethernet or1138 * frame contents. The frame is the raw EAPoL data, without ethernet or
1110 * 802.11 headers.1139 * 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.
1111 * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,1146 * When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
1112 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added1147 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added
1113 * indicating the protocol type of the received frame; whether the frame1148 * indicating the protocol type of the received frame; whether the frame
...@@ -1132,6 +1167,23 @@...@@ -1132,6 +1167,23 @@
1132 * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH1167 * %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH
1133 * command interface.1168 * command interface.
1134 *1169 *
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 *
1135 * Host driver reports this status on an authentication failure to the1187 * Host driver reports this status on an authentication failure to the
1136 * user space through the connect result as the user space would have1188 * user space through the connect result as the user space would have
1137 * initiated the connection through the connect request.1189 * initiated the connection through the connect request.
...@@ -1232,6 +1284,21 @@...@@ -1232,6 +1284,21 @@
1232 * &NL80211_ATTR_FILS_NONCES - for FILS Nonces1284 * &NL80211_ATTR_FILS_NONCES - for FILS Nonces
1233 * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)1285 * (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
1234 *1286 *
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 *
1235 * @NL80211_CMD_MAX: highest used command number1302 * @NL80211_CMD_MAX: highest used command number
1236 * @__NL80211_CMD_AFTER_LAST: internal use1303 * @__NL80211_CMD_AFTER_LAST: internal use
1237 */1304 */
...@@ -1474,6 +1541,15 @@ enum nl80211_commands {...@@ -1474,6 +1541,15 @@ enum nl80211_commands {
14741541
1475 NL80211_CMD_SET_FILS_AAD,1542 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
1477 /* add new commands above here */1553 /* add new commands above here */
14781554
1479 /* used to define NL80211_CMD_MAX below */1555 /* used to define NL80211_CMD_MAX below */
...@@ -2333,8 +2409,10 @@ enum nl80211_commands {...@@ -2333,8 +2409,10 @@ enum nl80211_commands {
2333 *2409 *
2334 * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:2410 * @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
2335 * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,2411 * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
2336 * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per2412 * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
2337 * interface type.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.
2338 *2416 *
2339 * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO2417 * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
2340 * groupID for monitor mode.2418 * groupID for monitor mode.
...@@ -2470,7 +2548,9 @@ enum nl80211_commands {...@@ -2470,7 +2548,9 @@ enum nl80211_commands {
2470 * space supports external authentication. This attribute shall be used2548 * space supports external authentication. This attribute shall be used
2471 * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver2549 * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
2472 * may offload authentication processing to user space if this capability2550 * 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)
2474 *2554 *
2475 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this2555 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
2476 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.2556 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
...@@ -2639,6 +2719,62 @@ enum nl80211_commands {...@@ -2639,6 +2719,62 @@ enum nl80211_commands {
2639 * Mandatory parameter for the transmitting interface to enable MBSSID.2719 * Mandatory parameter for the transmitting interface to enable MBSSID.
2640 * Optional for the non-transmitting interfaces.2720 * Optional for the non-transmitting interfaces.
2641 *2721 *
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 *
2642 * @NUM_NL80211_ATTR: total number of nl80211_attrs available2778 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
2643 * @NL80211_ATTR_MAX: highest attribute number currently defined2779 * @NL80211_ATTR_MAX: highest attribute number currently defined
2644 * @__NL80211_ATTR_AFTER_LAST: internal use2780 * @__NL80211_ATTR_AFTER_LAST: internal use
...@@ -3145,6 +3281,31 @@ enum nl80211_attrs {...@@ -3145,6 +3281,31 @@ enum nl80211_attrs {
3145 NL80211_ATTR_MBSSID_CONFIG,3281 NL80211_ATTR_MBSSID_CONFIG,
3146 NL80211_ATTR_MBSSID_ELEMS,3282 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
3148 /* add attributes here, update the policy in nl80211.c */3309 /* add attributes here, update the policy in nl80211.c */
31493310
3150 __NL80211_ATTR_AFTER_LAST,3311 __NL80211_ATTR_AFTER_LAST,
...@@ -3199,7 +3360,14 @@ enum nl80211_attrs {...@@ -3199,7 +3360,14 @@ enum nl80211_attrs {
3199#define NL80211_HE_MIN_CAPABILITY_LEN 163360#define NL80211_HE_MIN_CAPABILITY_LEN 16
3200#define NL80211_HE_MAX_CAPABILITY_LEN 543361#define NL80211_HE_MAX_CAPABILITY_LEN 54
3201#define NL80211_MAX_NR_CIPHER_SUITES 53362#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 */
3202#define NL80211_MAX_NR_AKM_SUITES 23368#define NL80211_MAX_NR_AKM_SUITES 2
3369#define NL80211_EHT_MIN_CAPABILITY_LEN 13
3370#define NL80211_EHT_MAX_CAPABILITY_LEN 51
32033371
3204#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 103372#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
32053373
...@@ -3227,7 +3395,7 @@ enum nl80211_attrs {...@@ -3227,7 +3395,7 @@ enum nl80211_attrs {
3227 * and therefore can't be created in the normal ways, use the3395 * and therefore can't be created in the normal ways, use the
3228 * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE3396 * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
3229 * commands to create and destroy one3397 * commands to create and destroy one
3230 * @NL80211_IF_TYPE_OCB: Outside Context of a BSS3398 * @NL80211_IFTYPE_OCB: Outside Context of a BSS
3231 * This mode corresponds to the MIB variable dot11OCBActivated=true3399 * This mode corresponds to the MIB variable dot11OCBActivated=true
3232 * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)3400 * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
3233 * @NL80211_IFTYPE_MAX: highest interface type number currently defined3401 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
...@@ -3368,6 +3536,56 @@ enum nl80211_he_ru_alloc {...@@ -3368,6 +3536,56 @@ enum nl80211_he_ru_alloc {
3368 NL80211_RATE_INFO_HE_RU_ALLOC_2x996,3536 NL80211_RATE_INFO_HE_RU_ALLOC_2x996,
3369};3537};
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
3371/**3589/**
3372 * enum nl80211_rate_info - bitrate information3590 * enum nl80211_rate_info - bitrate information
3373 *3591 *
...@@ -3407,6 +3625,13 @@ enum nl80211_he_ru_alloc {...@@ -3407,6 +3625,13 @@ enum nl80211_he_ru_alloc {
3407 * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)3625 * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
3408 * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then3626 * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
3409 * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)3627 * 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)
3410 * @__NL80211_RATE_INFO_AFTER_LAST: internal use3635 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
3411 */3636 */
3412enum nl80211_rate_info {3637enum nl80211_rate_info {
...@@ -3428,6 +3653,11 @@ enum nl80211_rate_info {...@@ -3428,6 +3653,11 @@ enum nl80211_rate_info {
3428 NL80211_RATE_INFO_HE_GI,3653 NL80211_RATE_INFO_HE_GI,
3429 NL80211_RATE_INFO_HE_DCM,3654 NL80211_RATE_INFO_HE_DCM,
3430 NL80211_RATE_INFO_HE_RU_ALLOC,3655 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
3432 /* keep last */3662 /* keep last */
3433 __NL80211_RATE_INFO_AFTER_LAST,3663 __NL80211_RATE_INFO_AFTER_LAST,
...@@ -3738,13 +3968,20 @@ enum nl80211_mpath_info {...@@ -3738,13 +3968,20 @@ enum nl80211_mpath_info {
3738 * capabilities IE3968 * capabilities IE
3739 * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as3969 * @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as
3740 * defined in HE capabilities IE3970 * defined in HE capabilities IE
3741 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band HE capability attribute currently
3742 * defined
3743 * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),3971 * @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
3744 * given for all 6 GHz band channels3972 * given for all 6 GHz band channels
3745 * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are3973 * @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
3746 * advertised on this band/for this iftype (binary)3974 * 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
3747 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use3983 * @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
3984 * @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
3748 */3985 */
3749enum nl80211_band_iftype_attr {3986enum nl80211_band_iftype_attr {
3750 __NL80211_BAND_IFTYPE_ATTR_INVALID,3987 __NL80211_BAND_IFTYPE_ATTR_INVALID,
...@@ -3756,6 +3993,10 @@ enum nl80211_band_iftype_attr {...@@ -3756,6 +3993,10 @@ enum nl80211_band_iftype_attr {
3756 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,3993 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
3757 NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,3994 NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
3758 NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,3995 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
3760 /* keep last */4001 /* keep last */
3761 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,4002 __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
...@@ -3900,6 +4141,10 @@ enum nl80211_wmm_rule {...@@ -3900,6 +4141,10 @@ enum nl80211_wmm_rule {
3900 * on this channel in current regulatory domain.4141 * on this channel in current regulatory domain.
3901 * @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed4142 * @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
3902 * on this channel in current regulatory domain.4143 * 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.
3903 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number4148 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
3904 * currently defined4149 * currently defined
3905 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use4150 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
...@@ -3936,6 +4181,8 @@ enum nl80211_frequency_attr {...@@ -3936,6 +4181,8 @@ enum nl80211_frequency_attr {
3936 NL80211_FREQUENCY_ATTR_4MHZ,4181 NL80211_FREQUENCY_ATTR_4MHZ,
3937 NL80211_FREQUENCY_ATTR_8MHZ,4182 NL80211_FREQUENCY_ATTR_8MHZ,
3938 NL80211_FREQUENCY_ATTR_16MHZ,4183 NL80211_FREQUENCY_ATTR_16MHZ,
4184 NL80211_FREQUENCY_ATTR_NO_320MHZ,
4185 NL80211_FREQUENCY_ATTR_NO_EHT,
39394186
3940 /* keep last */4187 /* keep last */
3941 __NL80211_FREQUENCY_ATTR_AFTER_LAST,4188 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
...@@ -4134,6 +4381,7 @@ enum nl80211_sched_scan_match_attr {...@@ -4134,6 +4381,7 @@ enum nl80211_sched_scan_match_attr {
4134 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed4381 * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
4135 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed4382 * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
4136 * @NL80211_RRF_NO_HE: HE operation not allowed4383 * @NL80211_RRF_NO_HE: HE operation not allowed
4384 * @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
4137 */4385 */
4138enum nl80211_reg_rule_flags {4386enum nl80211_reg_rule_flags {
4139 NL80211_RRF_NO_OFDM = 1<<0,4387 NL80211_RRF_NO_OFDM = 1<<0,
...@@ -4152,6 +4400,7 @@ enum nl80211_reg_rule_flags {...@@ -4152,6 +4400,7 @@ enum nl80211_reg_rule_flags {
4152 NL80211_RRF_NO_80MHZ = 1<<15,4400 NL80211_RRF_NO_80MHZ = 1<<15,
4153 NL80211_RRF_NO_160MHZ = 1<<16,4401 NL80211_RRF_NO_160MHZ = 1<<16,
4154 NL80211_RRF_NO_HE = 1<<17,4402 NL80211_RRF_NO_HE = 1<<17,
4403 NL80211_RRF_NO_320MHZ = 1<<18,
4155};4404};
41564405
4157#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR4406#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
...@@ -4649,6 +4898,8 @@ enum nl80211_key_mode {...@@ -4649,6 +4898,8 @@ enum nl80211_key_mode {
4649 * @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel4898 * @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel
4650 * @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel4899 * @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel
4651 * @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel4900 * @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
4652 */4903 */
4653enum nl80211_chan_width {4904enum nl80211_chan_width {
4654 NL80211_CHAN_WIDTH_20_NOHT,4905 NL80211_CHAN_WIDTH_20_NOHT,
...@@ -4664,6 +4915,7 @@ enum nl80211_chan_width {...@@ -4664,6 +4915,7 @@ enum nl80211_chan_width {
4664 NL80211_CHAN_WIDTH_4,4915 NL80211_CHAN_WIDTH_4,
4665 NL80211_CHAN_WIDTH_8,4916 NL80211_CHAN_WIDTH_8,
4666 NL80211_CHAN_WIDTH_16,4917 NL80211_CHAN_WIDTH_16,
4918 NL80211_CHAN_WIDTH_320,
4667};4919};
46684920
4669/**4921/**
...@@ -4735,6 +4987,8 @@ enum nl80211_bss_scan_width {...@@ -4735,6 +4987,8 @@ enum nl80211_bss_scan_width {
4735 * Contains a nested array of signal strength attributes (u8, dBm),4987 * Contains a nested array of signal strength attributes (u8, dBm),
4736 * using the nesting index as the antenna number.4988 * using the nesting index as the antenna number.
4737 * @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz4989 * @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.
4738 * @__NL80211_BSS_AFTER_LAST: internal4992 * @__NL80211_BSS_AFTER_LAST: internal
4739 * @NL80211_BSS_MAX: highest BSS attribute4993 * @NL80211_BSS_MAX: highest BSS attribute
4740 */4994 */
...@@ -4760,6 +5014,8 @@ enum nl80211_bss {...@@ -4760,6 +5014,8 @@ enum nl80211_bss {
4760 NL80211_BSS_PARENT_BSSID,5014 NL80211_BSS_PARENT_BSSID,
4761 NL80211_BSS_CHAIN_SIGNAL,5015 NL80211_BSS_CHAIN_SIGNAL,
4762 NL80211_BSS_FREQUENCY_OFFSET,5016 NL80211_BSS_FREQUENCY_OFFSET,
5017 NL80211_BSS_MLO_LINK_ID,
5018 NL80211_BSS_MLD_ADDR,
47635019
4764 /* keep last */5020 /* keep last */
4765 __NL80211_BSS_AFTER_LAST,5021 __NL80211_BSS_AFTER_LAST,
...@@ -5555,7 +5811,7 @@ enum nl80211_iface_limit_attrs {...@@ -5555,7 +5811,7 @@ enum nl80211_iface_limit_attrs {
5555 * => allows 8 of AP/GO that can have BI gcd >= min gcd5811 * => allows 8 of AP/GO that can have BI gcd >= min gcd
5556 *5812 *
5557 * numbers = [ #{STA} <= 2 ], channels = 2, max = 25813 * numbers = [ #{STA} <= 2 ], channels = 2, max = 2
5558 * => allows two STAs on different channels5814 * => allows two STAs on the same or on different channels
5559 *5815 *
5560 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 45816 * numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
5561 * => allows a STA plus three P2P interfaces5817 * => allows a STA plus three P2P interfaces
...@@ -5600,7 +5856,7 @@ enum nl80211_if_combination_attrs {...@@ -5600,7 +5856,7 @@ enum nl80211_if_combination_attrs {
5600 * @NL80211_PLINK_ESTAB: mesh peer link is established5856 * @NL80211_PLINK_ESTAB: mesh peer link is established
5601 * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled5857 * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
5602 * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh5858 * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
5603 * plink are discarded5859 * plink are discarded, except for authentication frames
5604 * @NUM_NL80211_PLINK_STATES: number of peer link states5860 * @NUM_NL80211_PLINK_STATES: number of peer link states
5605 * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states5861 * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
5606 */5862 */
...@@ -5639,6 +5895,7 @@ enum plink_actions {...@@ -5639,6 +5895,7 @@ enum plink_actions {
5639#define NL80211_KEK_LEN 165895#define NL80211_KEK_LEN 16
5640#define NL80211_KCK_EXT_LEN 245896#define NL80211_KCK_EXT_LEN 24
5641#define NL80211_KEK_EXT_LEN 325897#define NL80211_KEK_EXT_LEN 32
5898#define NL80211_KCK_EXT_LEN_32 32
5642#define NL80211_REPLAY_CTR_LEN 85899#define NL80211_REPLAY_CTR_LEN 8
56435900
5644/**5901/**
...@@ -5737,13 +5994,15 @@ enum nl80211_tdls_operation {...@@ -5737,13 +5994,15 @@ enum nl80211_tdls_operation {
5737 NL80211_TDLS_DISABLE_LINK,5994 NL80211_TDLS_DISABLE_LINK,
5738};5995};
57395996
5740/*5997/**
5741 * enum nl80211_ap_sme_features - device-integrated AP features5998 * enum nl80211_ap_sme_features - device-integrated AP features
5742 * Reserved for future use, no bits are defined in5999 * @NL80211_AP_SME_SA_QUERY_OFFLOAD: SA Query procedures offloaded to driver
5743 * NL80211_ATTR_DEVICE_AP_SME yet.6000 * when user space indicates support for SA Query procedures offload during
6001 * "start ap" with %NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT.
6002 */
5744enum nl80211_ap_sme_features {6003enum nl80211_ap_sme_features {
6004 NL80211_AP_SME_SA_QUERY_OFFLOAD = 1 << 0,
5745};6005};
5746 */
57476006
5748/**6007/**
5749 * enum nl80211_feature_flags - device/driver features6008 * enum nl80211_feature_flags - device/driver features
...@@ -5754,7 +6013,7 @@ enum nl80211_ap_sme_features {...@@ -5754,7 +6013,7 @@ enum nl80211_ap_sme_features {
5754 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up6013 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
5755 * the connected inactive stations in AP mode.6014 * the connected inactive stations in AP mode.
5756 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested6015 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
5757 * to work properly to suppport receiving regulatory hints from6016 * to work properly to support receiving regulatory hints from
5758 * cellular base stations.6017 * cellular base stations.
5759 * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only6018 * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
5760 * here to reserve the value for API/ABI compatibility)6019 * here to reserve the value for API/ABI compatibility)
...@@ -6051,6 +6310,22 @@ enum nl80211_feature_flags {...@@ -6051,6 +6310,22 @@ enum nl80211_feature_flags {
6051 * frames. Userspace has to share FILS AAD details to the driver by using6310 * frames. Userspace has to share FILS AAD details to the driver by using
6052 * @NL80211_CMD_SET_FILS_AAD.6311 * @NL80211_CMD_SET_FILS_AAD.
6053 *6312 *
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 *
6054 * @NUM_NL80211_EXT_FEATURES: number of extended features.6329 * @NUM_NL80211_EXT_FEATURES: number of extended features.
6055 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.6330 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
6056 */6331 */
...@@ -6117,6 +6392,10 @@ enum nl80211_ext_feature_index {...@@ -6117,6 +6392,10 @@ enum nl80211_ext_feature_index {
6117 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,6392 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
6118 NL80211_EXT_FEATURE_BSS_COLOR,6393 NL80211_EXT_FEATURE_BSS_COLOR,
6119 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,6394 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
6121 /* add new features before the definition below */6400 /* add new features before the definition below */
6122 NUM_NL80211_EXT_FEATURES,6401 NUM_NL80211_EXT_FEATURES,
...@@ -7462,4 +7741,20 @@ enum nl80211_mbssid_config_attributes {...@@ -7462,4 +7741,20 @@ enum nl80211_mbssid_config_attributes {
7462 NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,7741 NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
7463};7742};
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
7465#endif /* __LINUX_NL80211_H */7760#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 {...@@ -55,7 +55,10 @@ struct nvme_passthru_cmd64 {
55 __u64 metadata;55 __u64 metadata;
56 __u64 addr;56 __u64 addr;
57 __u32 metadata_len;57 __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 };
59 __u32 cdw10;62 __u32 cdw10;
60 __u32 cdw11;63 __u32 cdw11;
61 __u32 cdw12;64 __u32 cdw12;
...@@ -67,6 +70,28 @@ struct nvme_passthru_cmd64 {...@@ -67,6 +70,28 @@ struct nvme_passthru_cmd64 {
67 __u64 result;70 __u64 result;
68};71};
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
70#define nvme_admin_cmd nvme_passthru_cmd95#define nvme_admin_cmd nvme_passthru_cmd
7196
72#define NVME_IOCTL_ID _IO('N', 0x40)97#define NVME_IOCTL_ID _IO('N', 0x40)
...@@ -78,5 +103,12 @@ struct nvme_passthru_cmd64 {...@@ -78,5 +103,12 @@ struct nvme_passthru_cmd64 {
78#define NVME_IOCTL_RESCAN _IO('N', 0x46)103#define NVME_IOCTL_RESCAN _IO('N', 0x46)
79#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)104#define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
80#define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)105#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
82#endif /* _LINUX_NVME_IOCTL_H */114#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 {...@@ -162,6 +162,7 @@ struct omap3isp_h3a_aewb_config {
162 * struct omap3isp_stat_data - Statistic data sent to or received from user162 * struct omap3isp_stat_data - Statistic data sent to or received from user
163 * @ts: Timestamp of returned framestats.163 * @ts: Timestamp of returned framestats.
164 * @buf: Pointer to pass to user.164 * @buf: Pointer to pass to user.
165 * @buf_size: Size of buffer.
165 * @frame_number: Frame number of requested stats.166 * @frame_number: Frame number of requested stats.
166 * @cur_frame: Current frame number being processed.167 * @cur_frame: Current frame number being processed.
167 * @config_counter: Number of the configuration associated with the data.168 * @config_counter: Number of the configuration associated with the data.
...@@ -169,10 +170,12 @@ struct omap3isp_h3a_aewb_config {...@@ -169,10 +170,12 @@ struct omap3isp_h3a_aewb_config {
169struct omap3isp_stat_data {170struct omap3isp_stat_data {
170 struct timeval ts;171 struct timeval ts;
171 void *buf;172 void *buf;
172 __u32 buf_size;173 __struct_group(/* no tag */, frame, /* no attrs */,
173 __u16 frame_number;174 __u32 buf_size;
174 __u16 cur_frame;175 __u16 frame_number;
175 __u16 config_counter;176 __u16 cur_frame;
177 __u16 config_counter;
178 );
176};179};
177180
178181
lib/libc/include/any-linux-any/linux/openvswitch.h+36
...@@ -76,6 +76,8 @@ enum ovs_datapath_cmd {...@@ -76,6 +76,8 @@ enum ovs_datapath_cmd {
76 * datapath. Always present in notifications.76 * datapath. Always present in notifications.
77 * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the77 * @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the
78 * datapath. Always present in notifications.78 * 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.
79 *81 *
80 * These attributes follow the &struct ovs_header within the Generic Netlink82 * These attributes follow the &struct ovs_header within the Generic Netlink
81 * payload for %OVS_DP_* commands.83 * payload for %OVS_DP_* commands.
...@@ -92,6 +94,7 @@ enum ovs_datapath_attr {...@@ -92,6 +94,7 @@ enum ovs_datapath_attr {
92 OVS_DP_ATTR_PER_CPU_PIDS, /* Netlink PIDS to receive upcalls in94 OVS_DP_ATTR_PER_CPU_PIDS, /* Netlink PIDS to receive upcalls in
93 * per-cpu dispatch mode95 * per-cpu dispatch mode
94 */96 */
97 OVS_DP_ATTR_IFINDEX,
95 __OVS_DP_ATTR_MAX98 __OVS_DP_ATTR_MAX
96};99};
97100
...@@ -274,11 +277,25 @@ enum ovs_vport_attr {...@@ -274,11 +277,25 @@ enum ovs_vport_attr {
274 OVS_VPORT_ATTR_PAD,277 OVS_VPORT_ATTR_PAD,
275 OVS_VPORT_ATTR_IFINDEX,278 OVS_VPORT_ATTR_IFINDEX,
276 OVS_VPORT_ATTR_NETNSID,279 OVS_VPORT_ATTR_NETNSID,
280 OVS_VPORT_ATTR_UPCALL_STATS,
277 __OVS_VPORT_ATTR_MAX281 __OVS_VPORT_ATTR_MAX
278};282};
279283
280#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)284#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
282enum {299enum {
283 OVS_VXLAN_EXT_UNSPEC,300 OVS_VXLAN_EXT_UNSPEC,
284 OVS_VXLAN_EXT_GBP, /* Flag or __u32 */301 OVS_VXLAN_EXT_GBP, /* Flag or __u32 */
...@@ -352,6 +369,20 @@ enum ovs_key_attr {...@@ -352,6 +369,20 @@ enum ovs_key_attr {
352 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6, /* struct ovs_key_ct_tuple_ipv6 */369 OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6, /* struct ovs_key_ct_tuple_ipv6 */
353 OVS_KEY_ATTR_NSH, /* Nested set of ovs_nsh_key_* */370 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 */
355 __OVS_KEY_ATTR_MAX386 __OVS_KEY_ATTR_MAX
356};387};
357388
...@@ -427,6 +458,11 @@ struct ovs_key_ipv6 {...@@ -427,6 +458,11 @@ struct ovs_key_ipv6 {
427 __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */458 __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */
428};459};
429460
461/* separate structure to support backward compatibility with older user space */
462struct ovs_key_ipv6_exthdrs {
463 __u16 hdrs;
464};
465
430struct ovs_key_tcp {466struct ovs_key_tcp {
431 __be16 tcp_src;467 __be16 tcp_src;
432 __be16 tcp_dst;468 __be16 tcp_dst;
lib/libc/include/any-linux-any/linux/pci_regs.h+105-70
...@@ -301,23 +301,23 @@...@@ -301,23 +301,23 @@
301#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */301#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
302#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */302#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 */
307#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */307#define PCI_MSI_FLAGS_ENABLE 0x0001 /* MSI feature enabled */
308#define PCI_MSI_FLAGS_QMASK 0x000e /* Maximum queue size available */308#define PCI_MSI_FLAGS_QMASK 0x000e /* Maximum queue size available */
309#define PCI_MSI_FLAGS_QSIZE 0x0070 /* Message queue size configured */309#define PCI_MSI_FLAGS_QSIZE 0x0070 /* Message queue size configured */
310#define PCI_MSI_FLAGS_64BIT 0x0080 /* 64-bit addresses allowed */310#define PCI_MSI_FLAGS_64BIT 0x0080 /* 64-bit addresses allowed */
311#define PCI_MSI_FLAGS_MASKBIT 0x0100 /* Per-vector masking capable */311#define PCI_MSI_FLAGS_MASKBIT 0x0100 /* Per-vector masking capable */
312#define PCI_MSI_RFU 3 /* Rest of capability flags */312#define PCI_MSI_RFU 3 /* Rest of capability flags */
313#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */313#define PCI_MSI_ADDRESS_LO 0x04 /* Lower 32 bits */
314#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */314#define PCI_MSI_ADDRESS_HI 0x08 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
315#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */315#define PCI_MSI_DATA_32 0x08 /* 16 bits of data for 32-bit devices */
316#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */316#define PCI_MSI_MASK_32 0x0c /* Mask bits register for 32-bit devices */
317#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */317#define PCI_MSI_PENDING_32 0x10 /* Pending intrs for 32-bit devices */
318#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */318#define PCI_MSI_DATA_64 0x0c /* 16 bits of data for 64-bit devices */
319#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */319#define PCI_MSI_MASK_64 0x10 /* Mask bits register for 64-bit devices */
320#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */320#define PCI_MSI_PENDING_64 0x14 /* Pending intrs for 64-bit devices */
321321
322/* MSI-X registers (in MSI-X capability) */322/* MSI-X registers (in MSI-X capability) */
323#define PCI_MSIX_FLAGS 2 /* Message Control */323#define PCI_MSIX_FLAGS 2 /* Message Control */
...@@ -335,10 +335,10 @@...@@ -335,10 +335,10 @@
335335
336/* MSI-X Table entry format (in memory mapped by a BAR) */336/* MSI-X Table entry format (in memory mapped by a BAR) */
337#define PCI_MSIX_ENTRY_SIZE 16337#define PCI_MSIX_ENTRY_SIZE 16
338#define PCI_MSIX_ENTRY_LOWER_ADDR 0 /* Message Address */338#define PCI_MSIX_ENTRY_LOWER_ADDR 0x0 /* Message Address */
339#define PCI_MSIX_ENTRY_UPPER_ADDR 4 /* Message Upper Address */339#define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */
340#define PCI_MSIX_ENTRY_DATA 8 /* Message Data */340#define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */
341#define PCI_MSIX_ENTRY_VECTOR_CTRL 12 /* Vector Control */341#define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */
342#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001342#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001
343343
344/* CompactPCI Hotswap Register */344/* CompactPCI Hotswap Register */
...@@ -470,7 +470,7 @@...@@ -470,7 +470,7 @@
470470
471/* PCI Express capability registers */471/* PCI Express capability registers */
472472
473#define PCI_EXP_FLAGS 2 /* Capabilities register */473#define PCI_EXP_FLAGS 0x02 /* Capabilities register */
474#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */474#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
475#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */475#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
476#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */476#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
...@@ -484,7 +484,7 @@...@@ -484,7 +484,7 @@
484#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */484#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
485#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */485#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
486#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */486#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 */
488#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */488#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
489#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */489#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
490#define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */490#define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */
...@@ -497,7 +497,7 @@...@@ -497,7 +497,7 @@
497#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */497#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
498#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */498#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
499#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */499#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 */
501#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */501#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
502#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */502#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
503#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */503#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
...@@ -522,7 +522,7 @@...@@ -522,7 +522,7 @@
522#define PCI_EXP_DEVCTL_READRQ_2048B 0x4000 /* 2048 Bytes */522#define PCI_EXP_DEVCTL_READRQ_2048B 0x4000 /* 2048 Bytes */
523#define PCI_EXP_DEVCTL_READRQ_4096B 0x5000 /* 4096 Bytes */523#define PCI_EXP_DEVCTL_READRQ_4096B 0x5000 /* 4096 Bytes */
524#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */524#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 */
526#define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */526#define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */
527#define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */527#define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */
528#define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */528#define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */
...@@ -530,7 +530,7 @@...@@ -530,7 +530,7 @@
530#define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */530#define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */
531#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */531#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */
532#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V1 12 /* v1 endpoints without link end here */532#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 */
534#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */534#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
535#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */535#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
536#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */536#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
...@@ -549,7 +549,7 @@...@@ -549,7 +549,7 @@
549#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */549#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */
550#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */550#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */
551#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */551#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
552#define PCI_EXP_LNKCTL 16 /* Link Control */552#define PCI_EXP_LNKCTL 0x10 /* Link Control */
553#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */553#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
554#define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */554#define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */
555#define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */555#define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */
...@@ -562,7 +562,7 @@...@@ -562,7 +562,7 @@
562#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */562#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
563#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */563#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
564#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Link Autonomous Bandwidth Interrupt Enable */564#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 */
566#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */566#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
567#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */567#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
568#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */568#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
...@@ -582,7 +582,7 @@...@@ -582,7 +582,7 @@
582#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */582#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
583#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */583#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
584#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints with link end here */584#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 */
586#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */586#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
587#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */587#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
588#define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */588#define PCI_EXP_SLTCAP_MRLSP 0x00000004 /* MRL Sensor Present */
...@@ -595,7 +595,7 @@...@@ -595,7 +595,7 @@
595#define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */595#define PCI_EXP_SLTCAP_EIP 0x00020000 /* Electromechanical Interlock Present */
596#define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */596#define PCI_EXP_SLTCAP_NCCS 0x00040000 /* No Command Completed Support */
597#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */597#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 */
599#define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */599#define PCI_EXP_SLTCTL_ABPE 0x0001 /* Attention Button Pressed Enable */
600#define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */600#define PCI_EXP_SLTCTL_PFDE 0x0002 /* Power Fault Detected Enable */
601#define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */601#define PCI_EXP_SLTCTL_MRLSCE 0x0004 /* MRL Sensor Changed Enable */
...@@ -616,8 +616,9 @@...@@ -616,8 +616,9 @@
616#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */616#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
617#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */617#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
618#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */618#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 */
619#define PCI_EXP_SLTCTL_IBPD_DISABLE 0x4000 /* In-band PD disable */620#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 */
621#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */622#define PCI_EXP_SLTSTA_ABP 0x0001 /* Attention Button Pressed */
622#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */623#define PCI_EXP_SLTSTA_PFD 0x0002 /* Power Fault Detected */
623#define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */624#define PCI_EXP_SLTSTA_MRLSC 0x0004 /* MRL Sensor Changed */
...@@ -627,15 +628,15 @@...@@ -627,15 +628,15 @@
627#define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */628#define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */
628#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */629#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
629#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */630#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 */
631#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */632#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */
632#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */633#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
633#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */634#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
634#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */635#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
635#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */636#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 */
637#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */638#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 */
639#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */640#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
640#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */641#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
641/*642/*
...@@ -646,7 +647,7 @@...@@ -646,7 +647,7 @@
646 * Use pcie_capability_read_word() and similar interfaces to use them647 * Use pcie_capability_read_word() and similar interfaces to use them
647 * safely.648 * safely.
648 */649 */
649#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */650#define PCI_EXP_DEVCAP2 0x24 /* Device Capabilities 2 */
650#define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */651#define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */
651#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */652#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */
652#define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */653#define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */
...@@ -658,7 +659,7 @@...@@ -658,7 +659,7 @@
658#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */659#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
659#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */660#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
660#define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */661#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 */
662#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */663#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */
663#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */664#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */
664#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */665#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */
...@@ -670,9 +671,9 @@...@@ -670,9 +671,9 @@
670#define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */671#define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */
671#define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */672#define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */
672#define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */673#define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
673#define PCI_EXP_DEVSTA2 42 /* Device Status 2 */674#define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */
674#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints without link end here */675#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */
675#define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */676#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */
676#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */677#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
677#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */678#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
678#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */679#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */
...@@ -680,7 +681,7 @@...@@ -680,7 +681,7 @@
680#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */681#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */
681#define PCI_EXP_LNKCAP2_SLS_64_0GB 0x00000040 /* Supported Speed 64GT/s */682#define PCI_EXP_LNKCAP2_SLS_64_0GB 0x00000040 /* Supported Speed 64GT/s */
682#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */683#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 */
684#define PCI_EXP_LNKCTL2_TLS 0x000f685#define PCI_EXP_LNKCTL2_TLS 0x000f
685#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */686#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */
686#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */687#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */
...@@ -691,12 +692,13 @@...@@ -691,12 +692,13 @@
691#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */692#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */
692#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */693#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */
693#define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */694#define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */
694#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */695#define PCI_EXP_LNKSTA2 0x32 /* Link Status 2 */
695#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */696#define PCI_EXP_LNKSTA2_FLIT 0x0400 /* Flit Mode Status */
696#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */697#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32 /* end of v2 EPs w/ link */
698#define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities 2 */
697#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */699#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */
698#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */700#define PCI_EXP_SLTCTL2 0x38 /* Slot Control 2 */
699#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */701#define PCI_EXP_SLTSTA2 0x3a /* Slot Status 2 */
700702
701/* Extended Capabilities (PCI-X 2.0 and Express) */703/* Extended Capabilities (PCI-X 2.0 and Express) */
702#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)704#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
...@@ -736,13 +738,14 @@...@@ -736,13 +738,14 @@
736#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */738#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
737#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */739#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
738#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */740#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_16GT741#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
742#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
740743
741#define PCI_EXT_CAP_DSN_SIZEOF 12744#define PCI_EXT_CAP_DSN_SIZEOF 12
742#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40745#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
743746
744/* Advanced Error Reporting */747/* Advanced Error Reporting */
745#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */748#define PCI_ERR_UNCOR_STATUS 0x04 /* Uncorrectable Error Status */
746#define PCI_ERR_UNC_UND 0x00000001 /* Undefined */749#define PCI_ERR_UNC_UND 0x00000001 /* Undefined */
747#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */750#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
748#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */751#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
...@@ -760,11 +763,11 @@...@@ -760,11 +763,11 @@
760#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */763#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
761#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */764#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
762#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */765#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 */
764 /* Same bits as above */767 /* Same bits as above */
765#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */768#define PCI_ERR_UNCOR_SEVER 0x0c /* Uncorrectable Error Severity */
766 /* Same bits as above */769 /* Same bits as above */
767#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */770#define PCI_ERR_COR_STATUS 0x10 /* Correctable Error Status */
768#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */771#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
769#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */772#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
770#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */773#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
...@@ -773,20 +776,20 @@...@@ -773,20 +776,20 @@
773#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */776#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
774#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */777#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
775#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */778#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 */
777 /* Same bits as above */780 /* Same bits as above */
778#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */781#define PCI_ERR_CAP 0x18 /* Advanced Error Capabilities & Ctrl*/
779#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */782#define PCI_ERR_CAP_FEP(x) ((x) & 0x1f) /* First Error Pointer */
780#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */783#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
781#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */784#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
782#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */785#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
783#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */786#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
784#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */787#define PCI_ERR_HEADER_LOG 0x1c /* Header Log Register (16 bytes) */
785#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */788#define PCI_ERR_ROOT_COMMAND 0x2c /* Root Error Command */
786#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */789#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */
787#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */790#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002 /* Non-Fatal Err Reporting Enable */
788#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */791#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004 /* Fatal Err Reporting Enable */
789#define PCI_ERR_ROOT_STATUS 48792#define PCI_ERR_ROOT_STATUS 0x30
790#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */793#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
791#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */794#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002 /* Multiple ERR_COR */
792#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */795#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004 /* ERR_FATAL/NONFATAL */
...@@ -795,52 +798,52 @@...@@ -795,52 +798,52 @@
795#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */798#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
796#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */799#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
797#define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */800#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
800/* Virtual Channel */803/* Virtual Channel */
801#define PCI_VC_PORT_CAP1 4804#define PCI_VC_PORT_CAP1 0x04
802#define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */805#define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */
803#define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */806#define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */
804#define PCI_VC_CAP1_ARB_SIZE 0x00000c00807#define PCI_VC_CAP1_ARB_SIZE 0x00000c00
805#define PCI_VC_PORT_CAP2 8808#define PCI_VC_PORT_CAP2 0x08
806#define PCI_VC_CAP2_32_PHASE 0x00000002809#define PCI_VC_CAP2_32_PHASE 0x00000002
807#define PCI_VC_CAP2_64_PHASE 0x00000004810#define PCI_VC_CAP2_64_PHASE 0x00000004
808#define PCI_VC_CAP2_128_PHASE 0x00000008811#define PCI_VC_CAP2_128_PHASE 0x00000008
809#define PCI_VC_CAP2_ARB_OFF 0xff000000812#define PCI_VC_CAP2_ARB_OFF 0xff000000
810#define PCI_VC_PORT_CTRL 12813#define PCI_VC_PORT_CTRL 0x0c
811#define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001814#define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001
812#define PCI_VC_PORT_STATUS 14815#define PCI_VC_PORT_STATUS 0x0e
813#define PCI_VC_PORT_STATUS_TABLE 0x00000001816#define PCI_VC_PORT_STATUS_TABLE 0x00000001
814#define PCI_VC_RES_CAP 16817#define PCI_VC_RES_CAP 0x10
815#define PCI_VC_RES_CAP_32_PHASE 0x00000002818#define PCI_VC_RES_CAP_32_PHASE 0x00000002
816#define PCI_VC_RES_CAP_64_PHASE 0x00000004819#define PCI_VC_RES_CAP_64_PHASE 0x00000004
817#define PCI_VC_RES_CAP_128_PHASE 0x00000008820#define PCI_VC_RES_CAP_128_PHASE 0x00000008
818#define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010821#define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010
819#define PCI_VC_RES_CAP_256_PHASE 0x00000020822#define PCI_VC_RES_CAP_256_PHASE 0x00000020
820#define PCI_VC_RES_CAP_ARB_OFF 0xff000000823#define PCI_VC_RES_CAP_ARB_OFF 0xff000000
821#define PCI_VC_RES_CTRL 20824#define PCI_VC_RES_CTRL 0x14
822#define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000825#define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000
823#define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000826#define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000
824#define PCI_VC_RES_CTRL_ID 0x07000000827#define PCI_VC_RES_CTRL_ID 0x07000000
825#define PCI_VC_RES_CTRL_ENABLE 0x80000000828#define PCI_VC_RES_CTRL_ENABLE 0x80000000
826#define PCI_VC_RES_STATUS 26829#define PCI_VC_RES_STATUS 0x1a
827#define PCI_VC_RES_STATUS_TABLE 0x00000001830#define PCI_VC_RES_STATUS_TABLE 0x00000001
828#define PCI_VC_RES_STATUS_NEGO 0x00000002831#define PCI_VC_RES_STATUS_NEGO 0x00000002
829#define PCI_CAP_VC_BASE_SIZEOF 0x10832#define PCI_CAP_VC_BASE_SIZEOF 0x10
830#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C833#define PCI_CAP_VC_PER_VC_SIZEOF 0x0c
831834
832/* Power Budgeting */835/* Power Budgeting */
833#define PCI_PWR_DSR 4 /* Data Select Register */836#define PCI_PWR_DSR 0x04 /* Data Select Register */
834#define PCI_PWR_DATA 8 /* Data Register */837#define PCI_PWR_DATA 0x08 /* Data Register */
835#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */838#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
836#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */839#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
837#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */840#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
838#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */841#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
839#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */842#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
840#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */843#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 */
842#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */845#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
843#define PCI_EXT_CAP_PWR_SIZEOF 16846#define PCI_EXT_CAP_PWR_SIZEOF 0x10
844847
845/* Root Complex Event Collector Endpoint Association */848/* Root Complex Event Collector Endpoint Association */
846#define PCI_RCEC_RCIEP_BITMAP 4 /* Associated Bitmap for RCiEPs */849#define PCI_RCEC_RCIEP_BITMAP 4 /* Associated Bitmap for RCiEPs */
...@@ -964,7 +967,7 @@...@@ -964,7 +967,7 @@
964#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */967#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
965#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */968#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
966#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */969#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
967#define PCI_EXT_CAP_SRIOV_SIZEOF 64970#define PCI_EXT_CAP_SRIOV_SIZEOF 0x40
968971
969#define PCI_LTR_MAX_SNOOP_LAT 0x4972#define PCI_LTR_MAX_SNOOP_LAT 0x4
970#define PCI_LTR_MAX_NOSNOOP_LAT 0x6973#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
...@@ -1017,12 +1020,12 @@...@@ -1017,12 +1020,12 @@
1017#define PCI_TPH_LOC_NONE 0x000 /* no location */1020#define PCI_TPH_LOC_NONE 0x000 /* no location */
1018#define PCI_TPH_LOC_CAP 0x200 /* in capability */1021#define PCI_TPH_LOC_CAP 0x200 /* in capability */
1019#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */1022#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
1020#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */1023#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST table mask */
1021#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */1024#define PCI_TPH_CAP_ST_SHIFT 16 /* ST table shift */
1022#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */1025#define PCI_TPH_BASE_SIZEOF 0xc /* size with no ST table */
10231026
1024/* Downstream Port Containment */1027/* Downstream Port Containment */
1025#define PCI_EXP_DPC_CAP 4 /* DPC Capability */1028#define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */
1026#define PCI_EXP_DPC_IRQ 0x001F /* Interrupt Message Number */1029#define PCI_EXP_DPC_IRQ 0x001F /* Interrupt Message Number */
1027#define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */1030#define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */
1028#define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */1031#define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */
...@@ -1030,19 +1033,19 @@...@@ -1030,19 +1033,19 @@
1030#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */1033#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */
1031#define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */1034#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 */
1034#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */1037#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */
1035#define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */1038#define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */
1036#define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */1039#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 */
1039#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */1042#define PCI_EXP_DPC_STATUS_TRIGGER 0x0001 /* Trigger Status */
1040#define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */1043#define PCI_EXP_DPC_STATUS_TRIGGER_RSN 0x0006 /* Trigger Reason */
1041#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */1044#define PCI_EXP_DPC_STATUS_INTERRUPT 0x0008 /* Interrupt Status */
1042#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */1045#define PCI_EXP_DPC_RP_BUSY 0x0010 /* Root Port Busy */
1043#define PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT 0x0060 /* Trig Reason Extension */1046#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
1047#define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */1050#define PCI_EXP_DPC_RP_PIO_STATUS 0x0C /* RP PIO Status */
1048#define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO Mask */1051#define PCI_EXP_DPC_RP_PIO_MASK 0x10 /* RP PIO Mask */
...@@ -1056,6 +1059,7 @@...@@ -1056,6 +1059,7 @@
1056/* Precision Time Measurement */1059/* Precision Time Measurement */
1057#define PCI_PTM_CAP 0x04 /* PTM Capability */1060#define PCI_PTM_CAP 0x04 /* PTM Capability */
1058#define PCI_PTM_CAP_REQ 0x00000001 /* Requester capable */1061#define PCI_PTM_CAP_REQ 0x00000001 /* Requester capable */
1062#define PCI_PTM_CAP_RES 0x00000002 /* Responder capable */
1059#define PCI_PTM_CAP_ROOT 0x00000004 /* Root capable */1063#define PCI_PTM_CAP_ROOT 0x00000004 /* Root capable */
1060#define PCI_PTM_GRANULARITY_MASK 0x0000FF00 /* Clock granularity */1064#define PCI_PTM_GRANULARITY_MASK 0x0000FF00 /* Clock granularity */
1061#define PCI_PTM_CTRL 0x08 /* PTM Control */1065#define PCI_PTM_CTRL 0x08 /* PTM Control */
...@@ -1086,7 +1090,11 @@...@@ -1086,7 +1090,11 @@
10861090
1087/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */1091/* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */
1088#define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */1092#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)
1089#define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */1096#define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */
1097#define PCI_DVSEC_HEADER2_ID(x) ((x) & 0xffff)
10901098
1091/* Data Link Feature */1099/* Data Link Feature */
1092#define PCI_DLF_CAP 0x04 /* Capabilities Register */1100#define PCI_DLF_CAP 0x04 /* Capabilities Register */
...@@ -1098,4 +1106,31 @@...@@ -1098,4 +1106,31 @@
1098#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F01106#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
1099#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 41107#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
1101#endif /* LINUX_PCI_REGS_H */1136#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 {...@@ -164,8 +164,6 @@ enum perf_event_sample_format {
164 PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,164 PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,
165165
166 PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */166 PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */
167
168 __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
169};167};
170168
171#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)169#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
...@@ -204,6 +202,8 @@ enum perf_branch_sample_type_shift {...@@ -204,6 +202,8 @@ enum perf_branch_sample_type_shift {
204202
205 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */203 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
207 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */207 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208};208};
209209
...@@ -233,6 +233,8 @@ enum perf_branch_sample_type {...@@ -233,6 +233,8 @@ enum perf_branch_sample_type {
233233
234 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,234 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
236 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,238 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
237};239};
238240
...@@ -251,9 +253,50 @@ enum {...@@ -251,9 +253,50 @@ enum {
251 PERF_BR_SYSRET = 8, /* syscall return */253 PERF_BR_SYSRET = 8, /* syscall return */
252 PERF_BR_COND_CALL = 9, /* conditional function call */254 PERF_BR_COND_CALL = 9, /* conditional function call */
253 PERF_BR_COND_RET = 10, /* conditional function return */255 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 */
254 PERF_BR_MAX,261 PERF_BR_MAX,
255};262};
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
257#define PERF_SAMPLE_BRANCH_PLM_ALL \300#define PERF_SAMPLE_BRANCH_PLM_ALL \
258 (PERF_SAMPLE_BRANCH_USER|\301 (PERF_SAMPLE_BRANCH_USER|\
259 PERF_SAMPLE_BRANCH_KERNEL|\302 PERF_SAMPLE_BRANCH_KERNEL|\
...@@ -299,6 +342,7 @@ enum {...@@ -299,6 +342,7 @@ enum {
299 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED342 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
300 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING343 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
301 * { u64 id; } && PERF_FORMAT_ID344 * { u64 id; } && PERF_FORMAT_ID
345 * { u64 lost; } && PERF_FORMAT_LOST
302 * } && !PERF_FORMAT_GROUP346 * } && !PERF_FORMAT_GROUP
303 *347 *
304 * { u64 nr;348 * { u64 nr;
...@@ -306,6 +350,7 @@ enum {...@@ -306,6 +350,7 @@ enum {
306 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING350 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
307 * { u64 value;351 * { u64 value;
308 * { u64 id; } && PERF_FORMAT_ID352 * { u64 id; } && PERF_FORMAT_ID
353 * { u64 lost; } && PERF_FORMAT_LOST
309 * } cntr[nr];354 * } cntr[nr];
310 * } && PERF_FORMAT_GROUP355 * } && PERF_FORMAT_GROUP
311 * };356 * };
...@@ -315,8 +360,9 @@ enum perf_event_read_format {...@@ -315,8 +360,9 @@ enum perf_event_read_format {
315 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,360 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
316 PERF_FORMAT_ID = 1U << 2,361 PERF_FORMAT_ID = 1U << 2,
317 PERF_FORMAT_GROUP = 1U << 3,362 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 */
320};366};
321367
322#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */368#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
...@@ -328,6 +374,7 @@ enum perf_event_read_format {...@@ -328,6 +374,7 @@ enum perf_event_read_format {
328#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */374#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */
329#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */375#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */
330#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */376#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */
377#define PERF_ATTR_SIZE_VER8 136 /* add: config3 */
331378
332/*379/*
333 * Hardware event_id to monitor via a performance monitoring event:380 * Hardware event_id to monitor via a performance monitoring event:
...@@ -465,8 +512,12 @@ struct perf_event_attr {...@@ -465,8 +512,12 @@ struct perf_event_attr {
465 /*512 /*
466 * User provided data if sigtrap=1, passed back to user via513 * User provided data if sigtrap=1, passed back to user via
467 * siginfo_t::si_perf_data, e.g. to permit user to identify the event.514 * 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.
468 */517 */
469 __u64 sig_data;518 __u64 sig_data;
519
520 __u64 config3; /* extension of config2 */
470};521};
471522
472/*523/*
...@@ -487,7 +538,7 @@ struct perf_event_query_bpf {...@@ -487,7 +538,7 @@ struct perf_event_query_bpf {
487 /*538 /*
488 * User provided buffer to store program ids539 * User provided buffer to store program ids
489 */540 */
490 __u32 ids[0];541 __u32 ids[];
491};542};
492543
493/*544/*
...@@ -1288,7 +1339,9 @@ union perf_mem_data_src {...@@ -1288,7 +1339,9 @@ union perf_mem_data_src {
1288#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */1339#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
1289#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */1340#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
1290#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */1341#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 */
1292#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */1345#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
1293#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */1346#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */
1294#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */1347#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */
...@@ -1306,7 +1359,7 @@ union perf_mem_data_src {...@@ -1306,7 +1359,7 @@ union perf_mem_data_src {
1306#define PERF_MEM_SNOOP_SHIFT 191359#define PERF_MEM_SNOOP_SHIFT 19
13071360
1308#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */1361#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1309/* 1 free */1362#define PERF_MEM_SNOOPX_PEER 0x02 /* xfer from peer */
1310#define PERF_MEM_SNOOPX_SHIFT 381363#define PERF_MEM_SNOOPX_SHIFT 38
13111364
1312/* locked instruction */1365/* locked instruction */
...@@ -1332,7 +1385,10 @@ union perf_mem_data_src {...@@ -1332,7 +1385,10 @@ union perf_mem_data_src {
13321385
1333/* hop level */1386/* hop level */
1334#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */1387#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 */
1336#define PERF_MEM_HOPS_SHIFT 431392#define PERF_MEM_HOPS_SHIFT 43
13371393
1338#define PERF_MEM_S(a, s) \1394#define PERF_MEM_S(a, s) \
...@@ -1353,6 +1409,7 @@ union perf_mem_data_src {...@@ -1353,6 +1409,7 @@ union perf_mem_data_src {
1353 * abort: aborting a hardware transaction1409 * abort: aborting a hardware transaction
1354 * cycles: cycles from last branch (or 0 if not supported)1410 * cycles: cycles from last branch (or 0 if not supported)
1355 * type: branch type1411 * type: branch type
1412 * spec: branch speculation info (or 0 if not supported)
1356 */1413 */
1357struct perf_branch_entry {1414struct perf_branch_entry {
1358 __u64 from;1415 __u64 from;
...@@ -1363,7 +1420,10 @@ struct perf_branch_entry {...@@ -1363,7 +1420,10 @@ struct perf_branch_entry {
1363 abort:1, /* transaction abort */1420 abort:1, /* transaction abort */
1364 cycles:16, /* cycle count to last branch */1421 cycles:16, /* cycle count to last branch */
1365 type:4, /* branch type */1422 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;
1367};1427};
13681428
1369union perf_sample_weight {1429union perf_sample_weight {
lib/libc/include/any-linux-any/linux/pfkeyv2.h+2
...@@ -309,6 +309,7 @@ struct sadb_x_filter {...@@ -309,6 +309,7 @@ struct sadb_x_filter {
309#define SADB_X_AALG_SHA2_512HMAC 7309#define SADB_X_AALG_SHA2_512HMAC 7
310#define SADB_X_AALG_RIPEMD160HMAC 8310#define SADB_X_AALG_RIPEMD160HMAC 8
311#define SADB_X_AALG_AES_XCBC_MAC 9311#define SADB_X_AALG_AES_XCBC_MAC 9
312#define SADB_X_AALG_SM3_256HMAC 10
312#define SADB_X_AALG_NULL 251 /* kame */313#define SADB_X_AALG_NULL 251 /* kame */
313#define SADB_AALG_MAX 251314#define SADB_AALG_MAX 251
314315
...@@ -329,6 +330,7 @@ struct sadb_x_filter {...@@ -329,6 +330,7 @@ struct sadb_x_filter {
329#define SADB_X_EALG_AES_GCM_ICV16 20330#define SADB_X_EALG_AES_GCM_ICV16 20
330#define SADB_X_EALG_CAMELLIACBC 22331#define SADB_X_EALG_CAMELLIACBC 22
331#define SADB_X_EALG_NULL_AES_GMAC 23332#define SADB_X_EALG_NULL_AES_GMAC 23
333#define SADB_X_EALG_SM4CBC 24
332#define SADB_EALG_MAX 253 /* last EALG */334#define SADB_EALG_MAX 253 /* last EALG */
333/* private allocations should use 249-255 (RFC2407) */335/* private allocations should use 249-255 (RFC2407) */
334#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */336#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 {...@@ -19,13 +19,16 @@ enum {
19 TCA_ACT_FLAGS,19 TCA_ACT_FLAGS,
20 TCA_ACT_HW_STATS,20 TCA_ACT_HW_STATS,
21 TCA_ACT_USED_HW_STATS,21 TCA_ACT_USED_HW_STATS,
22 TCA_ACT_IN_HW_COUNT,
22 __TCA_ACT_MAX23 __TCA_ACT_MAX
23};24};
2425
25/* See other TCA_ACT_FLAGS_ * flags in include/net/act_api.h. */26/* 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 for27#define TCA_ACT_FLAGS_NO_PERCPU_STATS (1 << 0) /* Don't use percpu allocator for
27 * actions stats.28 * actions stats.
28 */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
30/* tca HW stats type33/* tca HW stats type
31 * When user does not pass the attribute, he does not care.34 * When user does not pass the attribute, he does not care.
...@@ -253,7 +256,7 @@ struct tc_u32_sel {...@@ -253,7 +256,7 @@ struct tc_u32_sel {
253256
254 short hoff;257 short hoff;
255 __be32 hmask;258 __be32 hmask;
256 struct tc_u32_key keys[0];259 struct tc_u32_key keys[];
257};260};
258261
259struct tc_u32_mark {262struct tc_u32_mark {
...@@ -265,7 +268,7 @@ struct tc_u32_mark {...@@ -265,7 +268,7 @@ struct tc_u32_mark {
265struct tc_u32_pcnt {268struct tc_u32_pcnt {
266 __u64 rcnt;269 __u64 rcnt;
267 __u64 rhit;270 __u64 rhit;
268 __u64 kcnts[0];271 __u64 kcnts[];
269};272};
270273
271/* Flags */274/* Flags */
...@@ -584,6 +587,13 @@ enum {...@@ -584,6 +587,13 @@ enum {
584 TCA_FLOWER_KEY_HASH, /* u32 */587 TCA_FLOWER_KEY_HASH, /* u32 */
585 TCA_FLOWER_KEY_HASH_MASK, /* u32 */588 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
587 __TCA_FLOWER_MAX,597 __TCA_FLOWER_MAX,
588};598};
589599
...@@ -613,6 +623,10 @@ enum {...@@ -613,6 +623,10 @@ enum {
613 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_623 * TCA_FLOWER_KEY_ENC_OPT_ERSPAN_
614 * attributes624 * attributes
615 */625 */
626 TCA_FLOWER_KEY_ENC_OPTS_GTP, /* Nested
627 * TCA_FLOWER_KEY_ENC_OPT_GTP_
628 * attributes
629 */
616 __TCA_FLOWER_KEY_ENC_OPTS_MAX,630 __TCA_FLOWER_KEY_ENC_OPTS_MAX,
617};631};
618632
...@@ -651,6 +665,17 @@ enum {...@@ -651,6 +665,17 @@ enum {
651#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \665#define TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX \
652 (__TCA_FLOWER_KEY_ENC_OPT_ERSPAN_MAX - 1)666 (__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
654enum {679enum {
655 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,680 TCA_FLOWER_KEY_MPLS_OPTS_UNSPEC,
656 TCA_FLOWER_KEY_MPLS_OPTS_LSE,681 TCA_FLOWER_KEY_MPLS_OPTS_LSE,
lib/libc/include/any-linux-any/linux/pkt_sched.h+11
...@@ -1232,6 +1232,16 @@ enum {...@@ -1232,6 +1232,16 @@ enum {
1232#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0)1232#define TCA_TAPRIO_ATTR_FLAG_TXTIME_ASSIST _BITUL(0)
1233#define TCA_TAPRIO_ATTR_FLAG_FULL_OFFLOAD _BITUL(1)1233#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
1235enum {1245enum {
1236 TCA_TAPRIO_ATTR_UNSPEC,1246 TCA_TAPRIO_ATTR_UNSPEC,
1237 TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */1247 TCA_TAPRIO_ATTR_PRIOMAP, /* struct tc_mqprio_qopt */
...@@ -1245,6 +1255,7 @@ enum {...@@ -1245,6 +1255,7 @@ enum {
1245 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */1255 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
1246 TCA_TAPRIO_ATTR_FLAGS, /* u32 */1256 TCA_TAPRIO_ATTR_FLAGS, /* u32 */
1247 TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */1257 TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */
1258 TCA_TAPRIO_ATTR_TC_ENTRY, /* nest */
1248 __TCA_TAPRIO_ATTR_MAX,1259 __TCA_TAPRIO_ATTR_MAX,
1249};1260};
12501261
lib/libc/include/any-linux-any/linux/pr.h+17
...@@ -4,6 +4,23 @@...@@ -4,6 +4,23 @@
44
5#include <linux/types.h>5#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
7enum pr_type {24enum pr_type {
8 PR_WRITE_EXCLUSIVE = 1,25 PR_WRITE_EXCLUSIVE = 1,
9 PR_EXCLUSIVE_ACCESS = 2,26 PR_EXCLUSIVE_ACCESS = 2,
lib/libc/include/any-linux-any/linux/prctl.h+18
...@@ -272,4 +272,22 @@ struct prctl_mm_map {...@@ -272,4 +272,22 @@ struct prctl_mm_map {
272# define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1272# define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1
273# define PR_SCHED_CORE_SCOPE_PROCESS_GROUP 2273# 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
275#endif /* _LINUX_PRCTL_H */293#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psci.h+18
...@@ -48,12 +48,26 @@...@@ -48,12 +48,26 @@
48#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)48#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)
4949
50#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)50#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)
51#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)54#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)
52#define PSCI_1_0_FN_SET_SUSPEND_MODE PSCI_0_2_FN(15)55#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
53#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)59#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)
55#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)65#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
56#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)69#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
58/* PSCI v0.2 power state encoding for CPU_SUSPEND function */72/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
59#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff73#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
...@@ -82,6 +96,10 @@...@@ -82,6 +96,10 @@
82#define PSCI_0_2_TOS_UP_NO_MIGRATE 196#define PSCI_0_2_TOS_UP_NO_MIGRATE 1
83#define PSCI_0_2_TOS_MP 297#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
85/* PSCI version decoding (independent of PSCI version) */103/* PSCI version decoding (independent of PSCI version) */
86#define PSCI_VERSION_MAJOR_SHIFT 16104#define PSCI_VERSION_MAJOR_SHIFT 16
87#define PSCI_VERSION_MINOR_MASK \105#define PSCI_VERSION_MINOR_MASK \
lib/libc/include/any-linux-any/linux/ptrace.h+1-1
...@@ -114,7 +114,7 @@ struct ptrace_rseq_configuration {...@@ -114,7 +114,7 @@ struct ptrace_rseq_configuration {
114114
115/*115/*
116 * These values are stored in task->ptrace_message116 * 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.
118 */118 */
119#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1119#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1
120#define PTRACE_EVENTMSG_SYSCALL_EXIT 2120#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 {...@@ -303,7 +303,7 @@ struct mdp_superblock_1 {
303 * into the 'roles' value. If a device is spare or faulty, then it doesn't303 * into the 'roles' value. If a device is spare or faulty, then it doesn't
304 * have a meaningful role.304 * have a meaningful role.
305 */305 */
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 */
307};307};
308308
309/* feature_map bits */309/* feature_map bits */
lib/libc/include/any-linux-any/linux/random.h+1-1
...@@ -41,7 +41,7 @@...@@ -41,7 +41,7 @@
41struct rand_pool_info {41struct rand_pool_info {
42 int entropy_count;42 int entropy_count;
43 int buf_size;43 int buf_size;
44 __u32 buf[0];44 __u32 buf[];
45};45};
4646
47/*47/*
lib/libc/include/any-linux-any/linux/reiserfs_xattr.h+1-1
...@@ -19,7 +19,7 @@ struct reiserfs_xattr_header {...@@ -19,7 +19,7 @@ struct reiserfs_xattr_header {
19struct reiserfs_security_handle {19struct reiserfs_security_handle {
20 const char *name;20 const char *name;
21 void *value;21 void *value;
22 size_t length;22 __kernel_size_t length;
23};23};
2424
25#endif /* _LINUX_REISERFS_XATTR_H */25#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 {...@@ -159,8 +159,16 @@ struct rfkill_event_ext {
159 * old behaviour for all userspace, unless it explicitly opts in to the159 * old behaviour for all userspace, unless it explicitly opts in to the
160 * rules outlined here by using the new &struct rfkill_event_ext.160 * rules outlined here by using the new &struct rfkill_event_ext.
161 *161 *
162 * Userspace using &struct rfkill_event_ext must adhere to the following162 * Additionally, some other userspace (bluez, g-s-d) was reading with a
163 * rules163 * 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:
164 *172 *
165 * 1. accept short writes, optionally using them to detect that it's173 * 1. accept short writes, optionally using them to detect that it's
166 * running on an older kernel;174 * running on an older kernel;
...@@ -175,6 +183,8 @@ struct rfkill_event_ext {...@@ -175,6 +183,8 @@ struct rfkill_event_ext {
175#define RFKILL_IOC_MAGIC 'R'183#define RFKILL_IOC_MAGIC 'R'
176#define RFKILL_IOC_NOINPUT 1184#define RFKILL_IOC_NOINPUT 1
177#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)185#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
179/* and that's all userspace gets */189/* and that's all userspace gets */
180190
lib/libc/include/any-linux-any/linux/rkisp1-config.h+61-16
...@@ -117,7 +117,46 @@...@@ -117,7 +117,46 @@
117/*117/*
118 * Defect Pixel Cluster Correction118 * Defect Pixel Cluster Correction
119 */119 */
120#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3120#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
122/*161/*
123 * Denoising pre filter162 * Denoising pre filter
...@@ -249,16 +288,20 @@ struct rkisp1_cif_isp_bls_config {...@@ -249,16 +288,20 @@ struct rkisp1_cif_isp_bls_config {
249};288};
250289
251/**290/**
252 * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC291 * struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
253 *292 *
254 * Methods Configuration used by Defect Pixel Cluster Correction293 * 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.
255 *298 *
256 * @method: Method enable bits299 * @method: Method enable bits (RKISP1_CIF_ISP_DPCC_METHODS_SET_*)
257 * @line_thresh: Line threshold300 * @line_thresh: Line threshold (RKISP1_CIF_ISP_DPCC_LINE_THRESH_*)
258 * @line_mad_fac: Line MAD factor301 * @line_mad_fac: Line Mean Absolute Difference factor (RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_*)
259 * @pg_fac: Peak gradient factor302 * @pg_fac: Peak gradient factor (RKISP1_CIF_ISP_DPCC_PG_FAC_*)
260 * @rnd_thresh: Rank Neighbor Difference threshold303 * @rnd_thresh: Rank Neighbor Difference threshold (RKISP1_CIF_ISP_DPCC_RND_THRESH_*)
261 * @rg_fac: Rank gradient factor304 * @rg_fac: Rank gradient factor (RKISP1_CIF_ISP_DPCC_RG_FAC_*)
262 */305 */
263struct rkisp1_cif_isp_dpcc_methods_config {306struct rkisp1_cif_isp_dpcc_methods_config {
264 __u32 method;307 __u32 method;
...@@ -272,14 +315,16 @@ struct rkisp1_cif_isp_dpcc_methods_config {...@@ -272,14 +315,16 @@ struct rkisp1_cif_isp_dpcc_methods_config {
272/**315/**
273 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC316 * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
274 *317 *
275 * Configuration used by Defect Pixel Cluster Correction318 * 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.
276 *321 *
277 * @mode: dpcc output mode322 * @mode: DPCC mode (RKISP1_CIF_ISP_DPCC_MODE_*)
278 * @output_mode: whether use hard coded methods323 * @output_mode: Interpolation output mode (RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_*)
279 * @set_use: stage1 methods set324 * @set_use: Methods sets selection (RKISP1_CIF_ISP_DPCC_SET_USE_*)
280 * @methods: methods config325 * @methods: Methods sets configuration
281 * @ro_limits: rank order limits326 * @ro_limits: Rank order limits (RKISP1_CIF_ISP_DPCC_RO_LIMITS_*)
282 * @rnd_offs: differential rank offsets for rank neighbor difference327 * @rnd_offs: Differential rank offsets for rank neighbor difference (RKISP1_CIF_ISP_DPCC_RND_OFFS_*)
283 */328 */
284struct rkisp1_cif_isp_dpcc_config {329struct rkisp1_cif_isp_dpcc_config {
285 __u32 mode;330 __u32 mode;
lib/libc/include/any-linux-any/linux/romfs_fs.h+2-2
...@@ -27,7 +27,7 @@ struct romfs_super_block {...@@ -27,7 +27,7 @@ struct romfs_super_block {
27 __be32 word1;27 __be32 word1;
28 __be32 size;28 __be32 size;
29 __be32 checksum;29 __be32 checksum;
30 char name[0]; /* volume name */30 char name[]; /* volume name */
31};31};
3232
33/* On disk inode */33/* On disk inode */
...@@ -37,7 +37,7 @@ struct romfs_inode {...@@ -37,7 +37,7 @@ struct romfs_inode {
37 __be32 spec;37 __be32 spec;
38 __be32 size;38 __be32 size;
39 __be32 checksum;39 __be32 checksum;
40 char name[0];40 char name[];
41};41};
4242
43#define ROMFH_TYPE 743#define ROMFH_TYPE 7
lib/libc/include/any-linux-any/linux/rpl.h+2-2
...@@ -37,8 +37,8 @@ struct ipv6_rpl_sr_hdr {...@@ -37,8 +37,8 @@ struct ipv6_rpl_sr_hdr {
37#endif37#endif
3838
39 union {39 union {
40 struct in6_addr addr[0];40 __DECLARE_FLEX_ARRAY(struct in6_addr, addr);
41 __u8 data[0];41 __DECLARE_FLEX_ARRAY(__u8, data);
42 } segments;42 } segments;
43} __attribute__((packed));43} __attribute__((packed));
4444
lib/libc/include/any-linux-any/linux/rpmsg.h+10
...@@ -33,4 +33,14 @@ struct rpmsg_endpoint_info {...@@ -33,4 +33,14 @@ struct rpmsg_endpoint_info {
33 */33 */
34#define RPMSG_DESTROY_EPT_IOCTL _IO(0xb5, 0x2)34#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
36#endif46#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/rseq.h+26-16
...@@ -105,23 +105,11 @@ struct rseq {...@@ -105,23 +105,11 @@ struct rseq {
105 * Read and set by the kernel. Set by user-space with single-copy105 * Read and set by the kernel. Set by user-space with single-copy
106 * atomicity semantics. This field should only be updated by the106 * atomicity semantics. This field should only be updated by the
107 * thread which registered this data structure. Aligned on 64-bit.107 * 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.
108 */111 */
109 union {112 __u64 rseq_cs;
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;
125113
126 /*114 /*
127 * Restartable sequences flags field.115 * Restartable sequences flags field.
...@@ -142,6 +130,28 @@ struct rseq {...@@ -142,6 +130,28 @@ struct rseq {
142 * this thread.130 * this thread.
143 */131 */
144 __u32 flags;132 __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[];
145} __attribute__((aligned(4 * sizeof(__u64))));155} __attribute__((aligned(4 * sizeof(__u64))));
146156
147#endif /* _LINUX_RSEQ_H */157#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 {...@@ -133,7 +133,8 @@ struct rtc_param {
133#define RTC_FEATURE_UPDATE_INTERRUPT 4133#define RTC_FEATURE_UPDATE_INTERRUPT 4
134#define RTC_FEATURE_CORRECTION 5134#define RTC_FEATURE_CORRECTION 5
135#define RTC_FEATURE_BACKUP_SWITCH_MODE 6135#define RTC_FEATURE_BACKUP_SWITCH_MODE 6
136#define RTC_FEATURE_CNT 7136#define RTC_FEATURE_ALARM_WAKEUP_ONLY 7
137#define RTC_FEATURE_CNT 8
137138
138/* parameter list */139/* parameter list */
139#define RTC_PARAM_FEATURES 0140#define RTC_PARAM_FEATURES 0
lib/libc/include/any-linux-any/linux/rtnetlink.h+19-1
...@@ -146,6 +146,8 @@ enum {...@@ -146,6 +146,8 @@ enum {
146#define RTM_NEWSTATS RTM_NEWSTATS146#define RTM_NEWSTATS RTM_NEWSTATS
147 RTM_GETSTATS = 94,147 RTM_GETSTATS = 94,
148#define RTM_GETSTATS RTM_GETSTATS148#define RTM_GETSTATS RTM_GETSTATS
149 RTM_SETSTATS,
150#define RTM_SETSTATS RTM_SETSTATS
149151
150 RTM_NEWCACHEREPORT = 96,152 RTM_NEWCACHEREPORT = 96,
151#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT153#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
...@@ -185,6 +187,13 @@ enum {...@@ -185,6 +187,13 @@ enum {
185 RTM_GETNEXTHOPBUCKET,187 RTM_GETNEXTHOPBUCKET,
186#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET188#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
188 __RTM_MAX,197 __RTM_MAX,
189#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)198#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
190};199};
...@@ -431,7 +440,7 @@ struct rtnexthop {...@@ -431,7 +440,7 @@ struct rtnexthop {
431/* RTA_VIA */440/* RTA_VIA */
432struct rtvia {441struct rtvia {
433 __kernel_sa_family_t rtvia_family;442 __kernel_sa_family_t rtvia_family;
434 __u8 rtvia_addr[0];443 __u8 rtvia_addr[];
435};444};
436445
437/* RTM_CACHEINFO */446/* RTM_CACHEINFO */
...@@ -626,6 +635,7 @@ enum {...@@ -626,6 +635,7 @@ enum {
626 TCA_INGRESS_BLOCK,635 TCA_INGRESS_BLOCK,
627 TCA_EGRESS_BLOCK,636 TCA_EGRESS_BLOCK,
628 TCA_DUMP_FLAGS,637 TCA_DUMP_FLAGS,
638 TCA_EXT_WARN_MSG,
629 __TCA_MAX639 __TCA_MAX
630};640};
631641
...@@ -752,6 +762,12 @@ enum rtnetlink_groups {...@@ -752,6 +762,12 @@ enum rtnetlink_groups {
752#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP762#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
753 RTNLGRP_BRVLAN,763 RTNLGRP_BRVLAN,
754#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN764#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
755 __RTNLGRP_MAX771 __RTNLGRP_MAX
756};772};
757#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)773#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
...@@ -771,6 +787,7 @@ enum {...@@ -771,6 +787,7 @@ enum {
771 TCA_ROOT_FLAGS,787 TCA_ROOT_FLAGS,
772 TCA_ROOT_COUNT,788 TCA_ROOT_COUNT,
773 TCA_ROOT_TIME_DELTA, /* in msecs */789 TCA_ROOT_TIME_DELTA, /* in msecs */
790 TCA_ROOT_EXT_WARN_MSG,
774 __TCA_ROOT_MAX,791 __TCA_ROOT_MAX,
775#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)792#define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
776};793};
...@@ -800,6 +817,7 @@ enum {...@@ -800,6 +817,7 @@ enum {
800#define RTEXT_FILTER_MRP (1 << 4)817#define RTEXT_FILTER_MRP (1 << 4)
801#define RTEXT_FILTER_CFM_CONFIG (1 << 5)818#define RTEXT_FILTER_CFM_CONFIG (1 << 5)
802#define RTEXT_FILTER_CFM_STATUS (1 << 6)819#define RTEXT_FILTER_CFM_STATUS (1 << 6)
820#define RTEXT_FILTER_MST (1 << 7)
803821
804/* End of information exported to user level */822/* 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 {...@@ -365,7 +365,7 @@ struct sctp_assoc_change {
365 __u16 sac_outbound_streams;365 __u16 sac_outbound_streams;
366 __u16 sac_inbound_streams;366 __u16 sac_inbound_streams;
367 sctp_assoc_t sac_assoc_id;367 sctp_assoc_t sac_assoc_id;
368 __u8 sac_info[0];368 __u8 sac_info[];
369};369};
370370
371/*371/*
...@@ -436,7 +436,7 @@ struct sctp_remote_error {...@@ -436,7 +436,7 @@ struct sctp_remote_error {
436 __u32 sre_length;436 __u32 sre_length;
437 __be16 sre_error;437 __be16 sre_error;
438 sctp_assoc_t sre_assoc_id;438 sctp_assoc_t sre_assoc_id;
439 __u8 sre_data[0];439 __u8 sre_data[];
440};440};
441441
442442
...@@ -453,7 +453,7 @@ struct sctp_send_failed {...@@ -453,7 +453,7 @@ struct sctp_send_failed {
453 __u32 ssf_error;453 __u32 ssf_error;
454 struct sctp_sndrcvinfo ssf_info;454 struct sctp_sndrcvinfo ssf_info;
455 sctp_assoc_t ssf_assoc_id;455 sctp_assoc_t ssf_assoc_id;
456 __u8 ssf_data[0];456 __u8 ssf_data[];
457};457};
458458
459struct sctp_send_failed_event {459struct sctp_send_failed_event {
...@@ -463,7 +463,7 @@ struct sctp_send_failed_event {...@@ -463,7 +463,7 @@ struct sctp_send_failed_event {
463 __u32 ssf_error;463 __u32 ssf_error;
464 struct sctp_sndinfo ssfe_info;464 struct sctp_sndinfo ssfe_info;
465 sctp_assoc_t ssf_assoc_id;465 sctp_assoc_t ssf_assoc_id;
466 __u8 ssf_data[0];466 __u8 ssf_data[];
467};467};
468468
469/*469/*
...@@ -1023,7 +1023,7 @@ struct sctp_getaddrs_old {...@@ -1023,7 +1023,7 @@ struct sctp_getaddrs_old {
1023struct sctp_getaddrs {1023struct sctp_getaddrs {
1024 sctp_assoc_t assoc_id; /*input*/1024 sctp_assoc_t assoc_id; /*input*/
1025 __u32 addr_num; /*output*/1025 __u32 addr_num; /*output*/
1026 __u8 addrs[0]; /*output, variable size*/1026 __u8 addrs[]; /*output, variable size*/
1027};1027};
10281028
1029/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves1029/* 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 @@...@@ -23,6 +23,8 @@
23#define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)23#define SECCOMP_FILTER_FLAG_SPEC_ALLOW (1UL << 2)
24#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)24#define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3)
25#define SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1UL << 4)25#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
27/*29/*
28 * All BPF programs must return a 32-bit value.30 * 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 {...@@ -44,6 +44,11 @@ enum opal_lock_state {
44 OPAL_LK = 0x04, /* 0100 */44 OPAL_LK = 0x04, /* 0100 */
45};45};
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
47struct opal_key {52struct opal_key {
48 __u8 lr;53 __u8 lr;
49 __u8 key_len;54 __u8 key_len;
...@@ -76,7 +81,8 @@ struct opal_user_lr_setup {...@@ -76,7 +81,8 @@ struct opal_user_lr_setup {
76struct opal_lock_unlock {81struct opal_lock_unlock {
77 struct opal_session_info session;82 struct opal_session_info session;
78 __u32 l_state;83 __u32 l_state;
79 __u8 __align[4];84 __u16 flags;
85 __u8 __align[2];
80};86};
8187
82struct opal_new_pw {88struct opal_new_pw {
...@@ -132,6 +138,19 @@ struct opal_read_write_table {...@@ -132,6 +138,19 @@ struct opal_read_write_table {
132 __u64 priv;138 __u64 priv;
133};139};
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
135#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)154#define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
136#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)155#define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
137#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)156#define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
...@@ -148,5 +167,6 @@ struct opal_read_write_table {...@@ -148,5 +167,6 @@ struct opal_read_write_table {
148#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)167#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
149#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)168#define IOC_OPAL_WRITE_SHADOW_MBR _IOW('p', 234, struct opal_shadow_mbr)
150#define IOC_OPAL_GENERIC_TABLE_RW _IOW('p', 235, struct opal_read_write_table)169#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
152#endif /* _SED_OPAL_H */172#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 {...@@ -30,7 +30,7 @@ struct ipv6_sr_hdr {
30 __u8 flags;30 __u8 flags;
31 __u16 tag;31 __u16 tag;
3232
33 struct in6_addr segments[0];33 struct in6_addr segments[];
34};34};
3535
36#define SR6_FLAG1_PROTECTED (1 << 6)36#define SR6_FLAG1_PROTECTED (1 << 6)
lib/libc/include/any-linux-any/linux/seg6_iptunnel.h+3-1
...@@ -26,7 +26,7 @@ enum {...@@ -26,7 +26,7 @@ enum {
2626
27struct seg6_iptunnel_encap {27struct seg6_iptunnel_encap {
28 int mode;28 int mode;
29 struct ipv6_sr_hdr srh[0];29 struct ipv6_sr_hdr srh[];
30};30};
3131
32#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))32#define SEG6_IPTUN_ENCAP_SIZE(x) ((sizeof(*x)) + (((x)->srh->hdrlen + 1) << 3))
...@@ -35,6 +35,8 @@ enum {...@@ -35,6 +35,8 @@ enum {
35 SEG6_IPTUN_MODE_INLINE,35 SEG6_IPTUN_MODE_INLINE,
36 SEG6_IPTUN_MODE_ENCAP,36 SEG6_IPTUN_MODE_ENCAP,
37 SEG6_IPTUN_MODE_L2ENCAP,37 SEG6_IPTUN_MODE_L2ENCAP,
38 SEG6_IPTUN_MODE_ENCAP_RED,
39 SEG6_IPTUN_MODE_L2ENCAP_RED,
38};40};
3941
40#endif42#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/seg6_local.h+24
...@@ -28,6 +28,7 @@ enum {...@@ -28,6 +28,7 @@ enum {
28 SEG6_LOCAL_BPF,28 SEG6_LOCAL_BPF,
29 SEG6_LOCAL_VRFTABLE,29 SEG6_LOCAL_VRFTABLE,
30 SEG6_LOCAL_COUNTERS,30 SEG6_LOCAL_COUNTERS,
31 SEG6_LOCAL_FLAVORS,
31 __SEG6_LOCAL_MAX,32 __SEG6_LOCAL_MAX,
32};33};
33#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)34#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
...@@ -110,4 +111,27 @@ enum {...@@ -110,4 +111,27 @@ enum {
110111
111#define SEG6_LOCAL_CNT_MAX (__SEG6_LOCAL_CNT_MAX - 1)112#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
113#endif137#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 {...@@ -107,29 +107,62 @@ struct serial_icounter_struct {
107 int reserved[9];107 int reserved[9];
108};108};
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 *
111 * Serial interface for controlling RS485 settings on chips with suitable125 * Serial interface for controlling RS485 settings on chips with suitable
112 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your126 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
113 * platform. The set function returns the new state, with any unsupported bits127 * platform. The set function returns the new state, with any unsupported bits
114 * reverted appropriately.128 * 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.
115 */140 */
116
117struct serial_rs485 {141struct serial_rs485 {
118 __u32 flags; /* RS485 feature flags */142 __u32 flags;
119#define SER_RS485_ENABLED (1 << 0) /* If enabled */143#define SER_RS485_ENABLED (1 << 0)
120#define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for144#define SER_RS485_RTS_ON_SEND (1 << 1)
121 RTS pin when145#define SER_RS485_RTS_AFTER_SEND (1 << 2)
122 sending */
123#define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for
124 RTS pin after sent*/
125#define SER_RS485_RX_DURING_TX (1 << 4)146#define SER_RS485_RX_DURING_TX (1 << 4)
126#define SER_RS485_TERMINATE_BUS (1 << 5) /* Enable bus147#define SER_RS485_TERMINATE_BUS (1 << 5)
127 termination148#define SER_RS485_ADDRB (1 << 6)
128 (if supported) */149#define SER_RS485_ADDR_RECV (1 << 7)
129 __u32 delay_rts_before_send; /* Delay before send (milliseconds) */150#define SER_RS485_ADDR_DEST (1 << 8)
130 __u32 delay_rts_after_send; /* Delay after send (milliseconds) */151
131 __u32 padding[5]; /* Memory is cheap, new structs152 __u32 delay_rts_before_send;
132 are a royal PITA .. */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 };
133};166};
134167
135/*168/*
lib/libc/include/any-linux-any/linux/serial_core.h+9-4
...@@ -68,6 +68,9 @@...@@ -68,6 +68,9 @@
68/* NVIDIA Tegra Combined UART */68/* NVIDIA Tegra Combined UART */
69#define PORT_TEGRA_TCU 4169#define PORT_TEGRA_TCU 41
7070
71/* ASPEED AST2x00 virtual UART */
72#define PORT_ASPEED_VUART 42
73
71/* Intel EG20 */74/* Intel EG20 */
72#define PORT_PCH_8LINE 4475#define PORT_PCH_8LINE 44
73#define PORT_PCH_2LINE 4576#define PORT_PCH_2LINE 45
...@@ -121,10 +124,6 @@...@@ -121,10 +124,6 @@
121/* TXX9 type number */124/* TXX9 type number */
122#define PORT_TXX9 64125#define PORT_TXX9 64
123126
124/* NEC VR4100 series SIU/DSIU */
125#define PORT_VR41XX_SIU 65
126#define PORT_VR41XX_DSIU 66
127
128/* Samsung S3C2400 SoC */127/* Samsung S3C2400 SoC */
129#define PORT_S3C2400 67128#define PORT_S3C2400 67
130129
...@@ -208,6 +207,9 @@...@@ -208,6 +207,9 @@
208/* Atheros AR933X SoC */207/* Atheros AR933X SoC */
209#define PORT_AR933X 99208#define PORT_AR933X 99
210209
210/* MCHP 16550A UART with 256 byte FIFOs */
211#define PORT_MCHP16550A 100
212
211/* ARC (Synopsys) on-chip UART */213/* ARC (Synopsys) on-chip UART */
212#define PORT_ARC 101214#define PORT_ARC 101
213215
...@@ -274,4 +276,7 @@...@@ -274,4 +276,7 @@
274/* Freescale LINFlexD UART */276/* Freescale LINFlexD UART */
275#define PORT_LINFLEXUART 122277#define PORT_LINFLEXUART 122
276278
279/* Sunplus UART */
280#define PORT_SUNPLUS 123
281
277#endif /* LINUX_SERIAL_CORE_H */282#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 @@...@@ -44,6 +44,11 @@
44#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */44#define UART_IIR_RX_TIMEOUT 0x0c /* OMAP RX Timeout interrupt */
45#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */45#define UART_IIR_XOFF 0x10 /* OMAP XOFF/Special Character */
46#define UART_IIR_CTS_RTS_DSR 0x20 /* OMAP CTS/RTS/DSR Change */46#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
48#define UART_FCR 2 /* Out: FIFO Control Register */53#define UART_FCR 2 /* Out: FIFO Control Register */
49#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */54#define UART_FCR_ENABLE_FIFO 0x01 /* Enable the FIFO */
...@@ -139,7 +144,7 @@...@@ -139,7 +144,7 @@
139#define UART_LSR_PE 0x04 /* Parity error indicator */144#define UART_LSR_PE 0x04 /* Parity error indicator */
140#define UART_LSR_OE 0x02 /* Overrun error indicator */145#define UART_LSR_OE 0x02 /* Overrun error indicator */
141#define UART_LSR_DR 0x01 /* Receiver data ready */146#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
144#define UART_MSR 6 /* In: Modem Status Register */149#define UART_MSR 6 /* In: Modem Status Register */
145#define UART_MSR_DCD 0x80 /* Data Carrier Detect */150#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
...@@ -150,7 +155,7 @@...@@ -150,7 +155,7 @@
150#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */155#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
151#define UART_MSR_DDSR 0x02 /* Delta DSR */156#define UART_MSR_DDSR 0x02 /* Delta DSR */
152#define UART_MSR_DCTS 0x01 /* Delta CTS */157#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
155#define UART_SCR 7 /* I/O: Scratch Register */160#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 {...@@ -59,6 +59,9 @@ enum {
59 SMC_NETLINK_DUMP_SEID,59 SMC_NETLINK_DUMP_SEID,
60 SMC_NETLINK_ENABLE_SEID,60 SMC_NETLINK_ENABLE_SEID,
61 SMC_NETLINK_DISABLE_SEID,61 SMC_NETLINK_DISABLE_SEID,
62 SMC_NETLINK_DUMP_HS_LIMITATION,
63 SMC_NETLINK_ENABLE_HS_LIMITATION,
64 SMC_NETLINK_DISABLE_HS_LIMITATION,
62};65};
6366
64/* SMC_GENL_FAMILY top level attributes */67/* SMC_GENL_FAMILY top level attributes */
...@@ -119,6 +122,9 @@ enum {...@@ -119,6 +122,9 @@ enum {
119 SMC_NLA_LGR_R_CONNS_NUM, /* u32 */122 SMC_NLA_LGR_R_CONNS_NUM, /* u32 */
120 SMC_NLA_LGR_R_V2_COMMON, /* nest */123 SMC_NLA_LGR_R_V2_COMMON, /* nest */
121 SMC_NLA_LGR_R_V2, /* nest */124 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 */
122 __SMC_NLA_LGR_R_MAX,128 __SMC_NLA_LGR_R_MAX,
123 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1129 SMC_NLA_LGR_R_MAX = __SMC_NLA_LGR_R_MAX - 1
124};130};
...@@ -282,4 +288,16 @@ enum {...@@ -282,4 +288,16 @@ enum {
282 __SMC_NLA_SEID_TABLE_MAX,288 __SMC_NLA_SEID_TABLE_MAX,
283 SMC_NLA_SEID_TABLE_MAX = __SMC_NLA_SEID_TABLE_MAX - 1289 SMC_NLA_SEID_TABLE_MAX = __SMC_NLA_SEID_TABLE_MAX - 1
284};290};
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
285#endif /* _LINUX_SMC_H */303#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...@@ -95,6 +95,8 @@ enum
95 ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */95 ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
96 ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */96 ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
97 ICMP_MIB_CSUMERRORS, /* InCsumErrors */97 ICMP_MIB_CSUMERRORS, /* InCsumErrors */
98 ICMP_MIB_RATELIMITGLOBAL, /* OutRateLimitGlobal */
99 ICMP_MIB_RATELIMITHOST, /* OutRateLimitHost */
98 __ICMP_MIB_MAX100 __ICMP_MIB_MAX
99};101};
100102
...@@ -112,6 +114,7 @@ enum...@@ -112,6 +114,7 @@ enum
112 ICMP6_MIB_OUTMSGS, /* OutMsgs */114 ICMP6_MIB_OUTMSGS, /* OutMsgs */
113 ICMP6_MIB_OUTERRORS, /* OutErrors */115 ICMP6_MIB_OUTERRORS, /* OutErrors */
114 ICMP6_MIB_CSUMERRORS, /* InCsumErrors */116 ICMP6_MIB_CSUMERRORS, /* InCsumErrors */
117 ICMP6_MIB_RATELIMITHOST, /* OutRateLimitHost */
115 __ICMP6_MIB_MAX118 __ICMP6_MIB_MAX
116};119};
117120
...@@ -292,6 +295,7 @@ enum...@@ -292,6 +295,7 @@ enum
292 LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */295 LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */
293 LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */296 LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */
294 LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */297 LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */
298 LINUX_MIB_TCPPLBREHASH, /* TCPPLBRehash */
295 __LINUX_MIB_MAX299 __LINUX_MIB_MAX
296};300};
297301
...@@ -344,6 +348,8 @@ enum...@@ -344,6 +348,8 @@ enum
344 LINUX_MIB_TLSRXDEVICE, /* TlsRxDevice */348 LINUX_MIB_TLSRXDEVICE, /* TlsRxDevice */
345 LINUX_MIB_TLSDECRYPTERROR, /* TlsDecryptError */349 LINUX_MIB_TLSDECRYPTERROR, /* TlsDecryptError */
346 LINUX_MIB_TLSRXDEVICERESYNC, /* TlsRxDeviceResync */350 LINUX_MIB_TLSRXDEVICERESYNC, /* TlsRxDeviceResync */
351 LINUX_MIB_TLSDECRYPTRETRY, /* TlsDecryptRetry */
352 LINUX_MIB_TLSRXNOPADVIOL, /* TlsRxNoPadViolation */
347 __LINUX_MIB_TLSMAX353 __LINUX_MIB_TLSMAX
348};354};
349355
lib/libc/include/any-linux-any/linux/socket.h+4
...@@ -31,4 +31,8 @@ struct __kernel_sockaddr_storage {...@@ -31,4 +31,8 @@ struct __kernel_sockaddr_storage {
3131
32#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK)32#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
34#endif /* _LINUX_SOCKET_H */38#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 {...@@ -1046,7 +1046,7 @@ typedef struct mixer_vol_table {
1046 * the GPL version of OSS-4.x and build against that version1046 * the GPL version of OSS-4.x and build against that version
1047 * of the header.1047 * of the header.
1048 *1048 *
1049 * We redefine the extern keyword so that make headers_check1049 * We redefine the extern keyword so that usr/include/headers_check.pl
1050 * does not complain about SEQ_USE_EXTBUF.1050 * does not complain about SEQ_USE_EXTBUF.
1051 */1051 */
1052#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()1052#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
lib/libc/include/any-linux-any/linux/spi/spi.h+2-1
...@@ -27,6 +27,7 @@...@@ -27,6 +27,7 @@
27#define SPI_TX_OCTAL _BITUL(13) /* transmit with 8 wires */27#define SPI_TX_OCTAL _BITUL(13) /* transmit with 8 wires */
28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */28#define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */
29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */29#define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */
30#define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */
3031
31/*32/*
32 * All the bits defined above should be covered by SPI_MODE_USER_MASK.33 * All the bits defined above should be covered by SPI_MODE_USER_MASK.
...@@ -36,6 +37,6 @@...@@ -36,6 +37,6 @@
36 * These bits must not overlap. A static assert check should make sure of that.37 * These bits must not overlap. A static assert check should make sure of that.
37 * If adding extra bits, make sure to increase the bit index below as well.38 * If adding extra bits, make sure to increase the bit index below as well.
38 */39 */
39#define SPI_MODE_USER_MASK (_BITUL(16) - 1)40#define SPI_MODE_USER_MASK (_BITUL(17) - 1)
4041
41#endif /* _SPI_H */42#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 {...@@ -124,7 +124,8 @@ struct statx {
124 __u32 stx_dev_minor;124 __u32 stx_dev_minor;
125 /* 0x90 */125 /* 0x90 */
126 __u64 stx_mnt_id;126 __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 */
128 /* 0xa0 */129 /* 0xa0 */
129 __u64 __spare3[12]; /* Spare space for future expansion */130 __u64 __spare3[12]; /* Spare space for future expansion */
130 /* 0x100 */131 /* 0x100 */
...@@ -152,6 +153,7 @@ struct statx {...@@ -152,6 +153,7 @@ struct statx {
152#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */153#define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */
153#define STATX_BTIME 0x00000800U /* Want/got stx_btime */154#define STATX_BTIME 0x00000800U /* Want/got stx_btime */
154#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */155#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
155157
156#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */158#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 @@...@@ -1,4 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_STDDEF_H
3#define _LINUX_STDDEF_H
4
25
36
4#ifndef __always_inline7#ifndef __always_inline
...@@ -40,4 +43,5 @@...@@ -40,4 +43,5 @@
40 struct { \43 struct { \
41 struct { } __empty_ ## NAME; \44 struct { } __empty_ ## NAME; \
42 TYPE NAME[]; \45 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 {...@@ -36,7 +36,7 @@ struct stp_policy_id {
36 /* padding */36 /* padding */
37 __u16 __reserved_0;37 __u16 __reserved_0;
38 __u32 __reserved_1;38 __u32 __reserved_1;
39 char id[0];39 char id[];
40};40};
4141
42#define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)42#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 @@...@@ -3,7 +3,7 @@
3#define _LINUX_SWAB_H3#define _LINUX_SWAB_H
44
5#include <linux/types.h>5#include <linux/types.h>
66#include <linux/stddef.h>
7#include <asm/bitsperlong.h>7#include <asm/bitsperlong.h>
8#include <asm/swab.h>8#include <asm/swab.h>
99
...@@ -102,7 +102,7 @@ static __inline__ __u32 __fswahb32(__u32 val)...@@ -102,7 +102,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
102#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))102#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
103#else103#else
104#define __swab16(x) \104#define __swab16(x) \
105 (__builtin_constant_p((__u16)(x)) ? \105 (__u16)(__builtin_constant_p(x) ? \
106 ___constant_swab16(x) : \106 ___constant_swab16(x) : \
107 __fswab16(x))107 __fswab16(x))
108#endif108#endif
...@@ -115,7 +115,7 @@ static __inline__ __u32 __fswahb32(__u32 val)...@@ -115,7 +115,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
115#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))115#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
116#else116#else
117#define __swab32(x) \117#define __swab32(x) \
118 (__builtin_constant_p((__u32)(x)) ? \118 (__u32)(__builtin_constant_p(x) ? \
119 ___constant_swab32(x) : \119 ___constant_swab32(x) : \
120 __fswab32(x))120 __fswab32(x))
121#endif121#endif
...@@ -128,7 +128,7 @@ static __inline__ __u32 __fswahb32(__u32 val)...@@ -128,7 +128,7 @@ static __inline__ __u32 __fswahb32(__u32 val)
128#define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))128#define __swab64(x) (__u64)__builtin_bswap64((__u64)(x))
129#else129#else
130#define __swab64(x) \130#define __swab64(x) \
131 (__builtin_constant_p((__u64)(x)) ? \131 (__u64)(__builtin_constant_p(x) ? \
132 ___constant_swab64(x) : \132 ___constant_swab64(x) : \
133 __fswab64(x))133 __fswab64(x))
134#endif134#endif
lib/libc/include/any-linux-any/linux/sysctl.h+19-18
...@@ -584,24 +584,25 @@ enum {...@@ -584,24 +584,25 @@ enum {
584584
585/* /proc/sys/net/<protocol>/neigh/<dev> */585/* /proc/sys/net/<protocol>/neigh/<dev> */
586enum {586enum {
587 NET_NEIGH_MCAST_SOLICIT=1,587 NET_NEIGH_MCAST_SOLICIT = 1,
588 NET_NEIGH_UCAST_SOLICIT=2,588 NET_NEIGH_UCAST_SOLICIT = 2,
589 NET_NEIGH_APP_SOLICIT=3,589 NET_NEIGH_APP_SOLICIT = 3,
590 NET_NEIGH_RETRANS_TIME=4,590 NET_NEIGH_RETRANS_TIME = 4,
591 NET_NEIGH_REACHABLE_TIME=5,591 NET_NEIGH_REACHABLE_TIME = 5,
592 NET_NEIGH_DELAY_PROBE_TIME=6,592 NET_NEIGH_DELAY_PROBE_TIME = 6,
593 NET_NEIGH_GC_STALE_TIME=7,593 NET_NEIGH_GC_STALE_TIME = 7,
594 NET_NEIGH_UNRES_QLEN=8,594 NET_NEIGH_UNRES_QLEN = 8,
595 NET_NEIGH_PROXY_QLEN=9,595 NET_NEIGH_PROXY_QLEN = 9,
596 NET_NEIGH_ANYCAST_DELAY=10,596 NET_NEIGH_ANYCAST_DELAY = 10,
597 NET_NEIGH_PROXY_DELAY=11,597 NET_NEIGH_PROXY_DELAY = 11,
598 NET_NEIGH_LOCKTIME=12,598 NET_NEIGH_LOCKTIME = 12,
599 NET_NEIGH_GC_INTERVAL=13,599 NET_NEIGH_GC_INTERVAL = 13,
600 NET_NEIGH_GC_THRESH1=14,600 NET_NEIGH_GC_THRESH1 = 14,
601 NET_NEIGH_GC_THRESH2=15,601 NET_NEIGH_GC_THRESH2 = 15,
602 NET_NEIGH_GC_THRESH3=16,602 NET_NEIGH_GC_THRESH3 = 16,
603 NET_NEIGH_RETRANS_TIME_MS=17,603 NET_NEIGH_RETRANS_TIME_MS = 17,
604 NET_NEIGH_REACHABLE_TIME_MS=18,604 NET_NEIGH_REACHABLE_TIME_MS = 18,
605 NET_NEIGH_INTERVAL_PROBE_TIME_MS = 19,
605};606};
606607
607/* /proc/sys/net/dccp */608/* /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 {...@@ -152,7 +152,7 @@ struct tcmu_tmr_entry {
152 __u32 cmd_cnt;152 __u32 cmd_cnt;
153 __u64 __pad3;153 __u64 __pad3;
154 __u64 __pad4;154 __u64 __pad4;
155 __u16 cmd_ids[0];155 __u16 cmd_ids[];
156} __attribute__((packed));156} __attribute__((packed));
157157
158#define TCMU_OP_ALIGN_SIZE sizeof(__u64)158#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
lib/libc/include/any-linux-any/linux/taskstats.h+28-2
...@@ -34,7 +34,7 @@...@@ -34,7 +34,7 @@
34 */34 */
3535
3636
37#define TASKSTATS_VERSION 1037#define TASKSTATS_VERSION 13
38#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN38#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
39 * in linux/sched.h */39 * in linux/sched.h */
4040
...@@ -48,7 +48,8 @@ struct taskstats {...@@ -48,7 +48,8 @@ struct taskstats {
48 __u32 ac_exitcode; /* Exit status */48 __u32 ac_exitcode; /* Exit status */
4949
50 /* The accounting flags of a task as defined in <linux/acct.h>50 /* 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).
52 */53 */
53 __u8 ac_flag; /* Record flags */54 __u8 ac_flag; /* Record flags */
54 __u8 ac_nice; /* task_nice */55 __u8 ac_nice; /* task_nice */
...@@ -172,6 +173,31 @@ struct taskstats {...@@ -172,6 +173,31 @@ struct taskstats {
172173
173 /* v10: 64-bit btime to avoid overflow */174 /* v10: 64-bit btime to avoid overflow */
174 __u64 ac_btime64; /* 64-bit begin time */175 __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;
175};201};
176202
177203
lib/libc/include/any-linux-any/linux/tc_act/tc_bpf.h-5
...@@ -1,11 +1,6 @@...@@ -1,11 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us>3 * 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.
9 */4 */
105
11#ifndef __LINUX_TC_BPF_H6#ifndef __LINUX_TC_BPF_H
lib/libc/include/any-linux-any/linux/tc_act/tc_ct.h+3
...@@ -22,6 +22,9 @@ enum {...@@ -22,6 +22,9 @@ enum {
22 TCA_CT_NAT_PORT_MIN, /* be16 */22 TCA_CT_NAT_PORT_MIN, /* be16 */
23 TCA_CT_NAT_PORT_MAX, /* be16 */23 TCA_CT_NAT_PORT_MAX, /* be16 */
24 TCA_CT_PAD,24 TCA_CT_PAD,
25 TCA_CT_HELPER_NAME, /* string */
26 TCA_CT_HELPER_FAMILY, /* u8 */
27 TCA_CT_HELPER_PROTO, /* u8 */
25 __TCA_CT_MAX28 __TCA_CT_MAX
26};29};
2730
lib/libc/include/any-linux-any/linux/tc_act/tc_skbedit.h+2-13
...@@ -2,19 +2,6 @@...@@ -2,19 +2,6 @@
2/*2/*
3 * Copyright (c) 2008, Intel Corporation.3 * Copyright (c) 2008, Intel Corporation.
4 *4 *
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 *
18 * Author: Alexander Duyck <alexander.h.duyck@intel.com>5 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
19 */6 */
207
...@@ -29,6 +16,7 @@...@@ -29,6 +16,7 @@
29#define SKBEDIT_F_PTYPE 0x816#define SKBEDIT_F_PTYPE 0x8
30#define SKBEDIT_F_MASK 0x1017#define SKBEDIT_F_MASK 0x10
31#define SKBEDIT_F_INHERITDSFIELD 0x2018#define SKBEDIT_F_INHERITDSFIELD 0x20
19#define SKBEDIT_F_TXQ_SKBHASH 0x40
3220
33struct tc_skbedit {21struct tc_skbedit {
34 tc_gen;22 tc_gen;
...@@ -45,6 +33,7 @@ enum {...@@ -45,6 +33,7 @@ enum {
45 TCA_SKBEDIT_PTYPE,33 TCA_SKBEDIT_PTYPE,
46 TCA_SKBEDIT_MASK,34 TCA_SKBEDIT_MASK,
47 TCA_SKBEDIT_FLAGS,35 TCA_SKBEDIT_FLAGS,
36 TCA_SKBEDIT_QUEUE_MAPPING_MAX,
48 __TCA_SKBEDIT_MAX37 __TCA_SKBEDIT_MAX
49};38};
50#define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)39#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 @@...@@ -1,12 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2016, Jamal Hadi Salim3 * Copyright (c) 2016, Jamal Hadi Salim
4 *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*/
105
11#ifndef __LINUX_TC_SKBMOD_H6#ifndef __LINUX_TC_SKBMOD_H
12#define __LINUX_TC_SKBMOD_H7#define __LINUX_TC_SKBMOD_H
lib/libc/include/any-linux-any/linux/tc_act/tc_tunnel_key.h-5
...@@ -2,11 +2,6 @@...@@ -2,11 +2,6 @@
2/*2/*
3 * Copyright (c) 2016, Amir Vadai <amir@vadai.me>3 * Copyright (c) 2016, Amir Vadai <amir@vadai.me>
4 * Copyright (c) 2016, Mellanox Technologies. All rights reserved.4 * 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.
10 */5 */
116
12#ifndef __LINUX_TC_TUNNEL_KEY_H7#ifndef __LINUX_TC_TUNNEL_KEY_H
lib/libc/include/any-linux-any/linux/tc_act/tc_vlan.h-5
...@@ -1,11 +1,6 @@...@@ -1,11 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>3 * 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.
9 */4 */
105
11#ifndef __LINUX_TC_VLAN_H6#ifndef __LINUX_TC_VLAN_H
lib/libc/include/any-linux-any/linux/tcp.h+6
...@@ -284,6 +284,11 @@ struct tcp_info {...@@ -284,6 +284,11 @@ struct tcp_info {
284 __u32 tcpi_snd_wnd; /* peer's advertised receive window after284 __u32 tcpi_snd_wnd; /* peer's advertised receive window after
285 * scaling (bytes)285 * scaling (bytes)
286 */286 */
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 */
287};292};
288293
289/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */294/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
...@@ -315,6 +320,7 @@ enum {...@@ -315,6 +320,7 @@ enum {
315 TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */320 TCP_NLA_BYTES_NOTSENT, /* Bytes in write queue not yet sent */
316 TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */321 TCP_NLA_EDT, /* Earliest departure time (CLOCK_MONOTONIC) */
317 TCP_NLA_TTL, /* TTL or hop limit of a packet received */322 TCP_NLA_TTL, /* TTL or hop limit of a packet received */
323 TCP_NLA_REHASH, /* PLB and timeout triggered rehash attempts */
318};324};
319325
320/* for TCP_MD5SIG socket option */326/* 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 @@...@@ -42,10 +42,6 @@
42#define TEE_IOC_MAGIC 0xa442#define TEE_IOC_MAGIC 0xa4
43#define TEE_IOC_BASE 043#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
49#define TEE_MAX_ARG_SIZE 102445#define TEE_MAX_ARG_SIZE 1024
5046
51#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */47#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 {...@@ -44,7 +44,10 @@ enum thermal_genl_attr {
44 THERMAL_GENL_ATTR_CDEV_MAX_STATE,44 THERMAL_GENL_ATTR_CDEV_MAX_STATE,
45 THERMAL_GENL_ATTR_CDEV_NAME,45 THERMAL_GENL_ATTR_CDEV_NAME,
46 THERMAL_GENL_ATTR_GOV_NAME,46 THERMAL_GENL_ATTR_GOV_NAME,
4747 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,
48 __THERMAL_GENL_ATTR_MAX,51 __THERMAL_GENL_ATTR_MAX,
49};52};
50#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)53#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
...@@ -71,6 +74,7 @@ enum thermal_genl_event {...@@ -71,6 +74,7 @@ enum thermal_genl_event {
71 THERMAL_GENL_EVENT_CDEV_DELETE, /* Cdev unbound */74 THERMAL_GENL_EVENT_CDEV_DELETE, /* Cdev unbound */
72 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */75 THERMAL_GENL_EVENT_CDEV_STATE_UPDATE, /* Cdev state updated */
73 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */76 THERMAL_GENL_EVENT_TZ_GOV_CHANGE, /* Governor policy changed */
77 THERMAL_GENL_EVENT_CPU_CAPABILITY_CHANGE, /* CPU capability changed */
74 __THERMAL_GENL_EVENT_MAX,78 __THERMAL_GENL_EVENT_MAX,
75};79};
76#define THERMAL_GENL_EVENT_MAX (__THERMAL_GENL_EVENT_MAX - 1)80#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 @@...@@ -43,8 +43,6 @@
43#include <linux/tipc.h>43#include <linux/tipc.h>
44#include <asm/byteorder.h>44#include <asm/byteorder.h>
4545
46#include <arpa/inet.h> /* for ntohs etc. */
47
48/*46/*
49 * Configuration47 * Configuration
50 *48 *
...@@ -267,33 +265,33 @@ static __inline__ int TLV_OK(const void *tlv, __u16 space)...@@ -267,33 +265,33 @@ static __inline__ int TLV_OK(const void *tlv, __u16 space)
267 */265 */
268266
269 return (space >= TLV_SPACE(0)) &&267 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);
271}269}
272270
273static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)271static __inline__ int TLV_CHECK(const void *tlv, __u16 space, __u16 exp_type)
274{272{
275 return TLV_OK(tlv, space) &&273 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);
277}275}
278276
279static __inline__ int TLV_GET_LEN(struct tlv_desc *tlv)277static __inline__ int TLV_GET_LEN(struct tlv_desc *tlv)
280{278{
281 return ntohs(tlv->tlv_len);279 return __be16_to_cpu(tlv->tlv_len);
282}280}
283281
284static __inline__ void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)282static __inline__ void TLV_SET_LEN(struct tlv_desc *tlv, __u16 len)
285{283{
286 tlv->tlv_len = htons(len);284 tlv->tlv_len = __cpu_to_be16(len);
287}285}
288286
289static __inline__ int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)287static __inline__ int TLV_CHECK_TYPE(struct tlv_desc *tlv, __u16 type)
290{288{
291 return (ntohs(tlv->tlv_type) == type);289 return (__be16_to_cpu(tlv->tlv_type) == type);
292}290}
293291
294static __inline__ void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)292static __inline__ void TLV_SET_TYPE(struct tlv_desc *tlv, __u16 type)
295{293{
296 tlv->tlv_type = htons(type);294 tlv->tlv_type = __cpu_to_be16(type);
297}295}
298296
299static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)297static __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)...@@ -303,8 +301,8 @@ static __inline__ int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
303301
304 tlv_len = TLV_LENGTH(len);302 tlv_len = TLV_LENGTH(len);
305 tlv_ptr = (struct tlv_desc *)tlv;303 tlv_ptr = (struct tlv_desc *)tlv;
306 tlv_ptr->tlv_type = htons(type);304 tlv_ptr->tlv_type = __cpu_to_be16(type);
307 tlv_ptr->tlv_len = htons(tlv_len);305 tlv_ptr->tlv_len = __cpu_to_be16(tlv_len);
308 if (len && data) {306 if (len && data) {
309 memcpy(TLV_DATA(tlv_ptr), data, len);307 memcpy(TLV_DATA(tlv_ptr), data, len);
310 memset((char *)TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);308 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)...@@ -346,7 +344,7 @@ static __inline__ void *TLV_LIST_DATA(struct tlv_list_desc *list)
346344
347static __inline__ void TLV_LIST_STEP(struct tlv_list_desc *list)345static __inline__ void TLV_LIST_STEP(struct tlv_list_desc *list)
348{346{
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
351 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);349 list->tlv_ptr = (struct tlv_desc *)((char *)list->tlv_ptr + tlv_space);
352 list->tlv_space -= tlv_space;350 list->tlv_space -= tlv_space;
...@@ -402,9 +400,9 @@ static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,...@@ -402,9 +400,9 @@ static __inline__ int TCM_SET(void *msg, __u16 cmd, __u16 flags,
402400
403 msg_len = TCM_LENGTH(data_len);401 msg_len = TCM_LENGTH(data_len);
404 tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;402 tcm_hdr = (struct tipc_cfg_msg_hdr *)msg;
405 tcm_hdr->tcm_len = htonl(msg_len);403 tcm_hdr->tcm_len = __cpu_to_be32(msg_len);
406 tcm_hdr->tcm_type = htons(cmd);404 tcm_hdr->tcm_type = __cpu_to_be16(cmd);
407 tcm_hdr->tcm_flags = htons(flags);405 tcm_hdr->tcm_flags = __cpu_to_be16(flags);
408 if (data_len && data) {406 if (data_len && data) {
409 memcpy(TCM_DATA(msg), data, data_len);407 memcpy(TCM_DATA(msg), data, data_len);
410 memset((char *)TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);408 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 @@...@@ -39,6 +39,8 @@
39/* TLS socket options */39/* TLS socket options */
40#define TLS_TX 1 /* Set transmit parameters */40#define TLS_TX 1 /* Set transmit parameters */
41#define TLS_RX 2 /* Set receive parameters */41#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
43/* Supported versions */45/* Supported versions */
44#define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)46#define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)
...@@ -98,6 +100,20 @@...@@ -98,6 +100,20 @@
98#define TLS_CIPHER_SM4_CCM_TAG_SIZE 16100#define TLS_CIPHER_SM4_CCM_TAG_SIZE 16
99#define TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE 8101#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
101#define TLS_SET_RECORD_TYPE 1117#define TLS_SET_RECORD_TYPE 1
102#define TLS_GET_RECORD_TYPE 2118#define TLS_GET_RECORD_TYPE 2
103119
...@@ -154,12 +170,30 @@ struct tls12_crypto_info_sm4_ccm {...@@ -154,12 +170,30 @@ struct tls12_crypto_info_sm4_ccm {
154 unsigned char rec_seq[TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE];170 unsigned char rec_seq[TLS_CIPHER_SM4_CCM_REC_SEQ_SIZE];
155};171};
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
157enum {189enum {
158 TLS_INFO_UNSPEC,190 TLS_INFO_UNSPEC,
159 TLS_INFO_VERSION,191 TLS_INFO_VERSION,
160 TLS_INFO_CIPHER,192 TLS_INFO_CIPHER,
161 TLS_INFO_TXCONF,193 TLS_INFO_TXCONF,
162 TLS_INFO_RXCONF,194 TLS_INFO_RXCONF,
195 TLS_INFO_ZC_RO_TX,
196 TLS_INFO_RX_NO_PAD,
163 __TLS_INFO_MAX,197 __TLS_INFO_MAX,
164};198};
165#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)199#define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
lib/libc/include/any-linux-any/linux/tty.h+6-2
...@@ -6,8 +6,6 @@...@@ -6,8 +6,6 @@
6 * 'tty.h' defines some structures used by tty_io.c and some defines.6 * 'tty.h' defines some structures used by tty_io.c and some defines.
7 */7 */
88
9#define NR_LDISCS 30
10
11/* line disciplines */9/* line disciplines */
12#define N_TTY 010#define N_TTY 0
13#define N_SLIP 111#define N_SLIP 1
...@@ -38,5 +36,11 @@...@@ -38,5 +36,11 @@
38#define N_NCI 25 /* NFC NCI UART */36#define N_NCI 25 /* NFC NCI UART */
39#define N_SPEAKUP 26 /* Speakup communication with synths */37#define N_SPEAKUP 26 /* Speakup communication with synths */
40#define N_NULL 27 /* Null ldisc used for error handling */38#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
42#endif /* _LINUX_TTY_H */46#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 @@...@@ -14,12 +14,15 @@
14 * any application/library that wants linux/types.h.14 * any application/library that wants linux/types.h.
15 */15 */
1616
17/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
17#ifdef __CHECKER__18#ifdef __CHECKER__
18#define __bitwise__ __attribute__((bitwise))19#define __bitwise __attribute__((bitwise))
19#else20#else
20#define __bitwise__21#define __bitwise
21#endif22#endif
22#define __bitwise __bitwise__23
24/* The kernel doesn't use this legacy form, but user space does */
25#define __bitwise__ __bitwise
2326
24typedef __u16 __bitwise __le16;27typedef __u16 __bitwise __le16;
25typedef __u16 __bitwise __be16;28typedef __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 {...@@ -341,7 +341,7 @@ struct uac_feature_unit_descriptor {
341 __u8 bUnitID;341 __u8 bUnitID;
342 __u8 bSourceID;342 __u8 bSourceID;
343 __u8 bControlSize;343 __u8 bControlSize;
344 __u8 bmaControls[0]; /* variable length */344 __u8 bmaControls[]; /* variable length */
345} __attribute__((packed));345} __attribute__((packed));
346346
347static __inline__ __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)347static __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 {...@@ -171,7 +171,7 @@ struct usb_cdc_mdlm_detail_desc {
171171
172 /* type is associated with mdlm_desc.bGUID */172 /* type is associated with mdlm_desc.bGUID */
173 __u8 bGuidDescriptorType;173 __u8 bGuidDescriptorType;
174 __u8 bDetailData[0];174 __u8 bDetailData[];
175} __attribute__ ((packed));175} __attribute__ ((packed));
176176
177/* "OBEX Control Model Functional Descriptor" */177/* "OBEX Control Model Functional Descriptor" */
...@@ -271,6 +271,10 @@ struct usb_cdc_line_coding {...@@ -271,6 +271,10 @@ struct usb_cdc_line_coding {
271 __u8 bDataBits;271 __u8 bDataBits;
272} __attribute__ ((packed));272} __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
274/* table 62; bits in multicast filter */278/* table 62; bits in multicast filter */
275#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)279#define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0)
276#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */280#define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) /* no filter */
...@@ -302,6 +306,15 @@ struct usb_cdc_notification {...@@ -302,6 +306,15 @@ struct usb_cdc_notification {
302 __le16 wLength;306 __le16 wLength;
303} __attribute__ ((packed));307} __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
305struct usb_cdc_speed_change {318struct usb_cdc_speed_change {
306 __le32 DLBitRRate; /* contains the downlink bit rate (IN pipe) */319 __le32 DLBitRRate; /* contains the downlink bit rate (IN pipe) */
307 __le32 ULBitRate; /* contains the uplink bit rate (OUT pipe) */320 __le32 ULBitRate; /* contains the uplink bit rate (OUT pipe) */
...@@ -379,7 +392,7 @@ struct usb_cdc_ncm_ndp16 {...@@ -379,7 +392,7 @@ struct usb_cdc_ncm_ndp16 {
379 __le32 dwSignature;392 __le32 dwSignature;
380 __le16 wLength;393 __le16 wLength;
381 __le16 wNextNdpIndex;394 __le16 wNextNdpIndex;
382 struct usb_cdc_ncm_dpe16 dpe16[0];395 struct usb_cdc_ncm_dpe16 dpe16[];
383} __attribute__ ((packed));396} __attribute__ ((packed));
384397
385/* 32-bit NCM Datagram Pointer Entry */398/* 32-bit NCM Datagram Pointer Entry */
...@@ -395,7 +408,7 @@ struct usb_cdc_ncm_ndp32 {...@@ -395,7 +408,7 @@ struct usb_cdc_ncm_ndp32 {
395 __le16 wReserved6;408 __le16 wReserved6;
396 __le32 dwNextNdpIndex;409 __le32 dwNextNdpIndex;
397 __le32 dwReserved12;410 __le32 dwReserved12;
398 struct usb_cdc_ncm_dpe32 dpe32[0];411 struct usb_cdc_ncm_dpe32 dpe32[];
399} __attribute__ ((packed));412} __attribute__ ((packed));
400413
401/* CDC NCM subclass 3.2.1 and 3.2.2 */414/* 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 {...@@ -818,7 +818,7 @@ struct usb_key_descriptor {
818818
819 __u8 tTKID[3];819 __u8 tTKID[3];
820 __u8 bReserved;820 __u8 bReserved;
821 __u8 bKeyData[0];821 __u8 bKeyData[];
822} __attribute__((packed));822} __attribute__((packed));
823823
824/*-------------------------------------------------------------------------*/824/*-------------------------------------------------------------------------*/
...@@ -947,6 +947,22 @@ struct usb_ss_container_id_descriptor {...@@ -947,6 +947,22 @@ struct usb_ss_container_id_descriptor {
947947
948#define USB_DT_USB_SS_CONTN_ID_SIZE 20948#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
950/*966/*
951 * SuperSpeed Plus USB Capability descriptor: Defines the set of967 * SuperSpeed Plus USB Capability descriptor: Defines the set of
952 * SuperSpeed Plus USB specific device level capabilities968 * SuperSpeed Plus USB specific device level capabilities
lib/libc/include/any-linux-any/linux/usb/g_uvc.h+3
...@@ -21,6 +21,9 @@...@@ -21,6 +21,9 @@
21#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5)21#define UVC_EVENT_DATA (V4L2_EVENT_PRIVATE_START + 5)
22#define UVC_EVENT_LAST (V4L2_EVENT_PRIVATE_START + 5)22#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
24struct uvc_request_data {27struct uvc_request_data {
25 __s32 length;28 __s32 length;
26 __u8 data[60];29 __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 {...@@ -60,7 +60,7 @@ enum usb_raw_event_type {
60struct usb_raw_event {60struct usb_raw_event {
61 __u32 type;61 __u32 type;
62 __u32 length;62 __u32 length;
63 __u8 data[0];63 __u8 data[];
64};64};
6565
66#define USB_RAW_IO_FLAGS_ZERO 0x000166#define USB_RAW_IO_FLAGS_ZERO 0x0001
...@@ -90,7 +90,7 @@ struct usb_raw_ep_io {...@@ -90,7 +90,7 @@ struct usb_raw_ep_io {
90 __u16 ep;90 __u16 ep;
91 __u16 flags;91 __u16 flags;
92 __u32 length;92 __u32 length;
93 __u8 data[0];93 __u8 data[];
94};94};
9595
96/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */96/* 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 @@...@@ -179,6 +179,36 @@
179#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)179#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
180#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)180#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
182/* ------------------------------------------------------------------------212/* ------------------------------------------------------------------------
183 * UVC structures213 * UVC structures
184 */214 */
...@@ -466,7 +496,7 @@ struct uvc_format_uncompressed {...@@ -466,7 +496,7 @@ struct uvc_format_uncompressed {
466 __u8 bDefaultFrameIndex;496 __u8 bDefaultFrameIndex;
467 __u8 bAspectRatioX;497 __u8 bAspectRatioX;
468 __u8 bAspectRatioY;498 __u8 bAspectRatioY;
469 __u8 bmInterfaceFlags;499 __u8 bmInterlaceFlags;
470 __u8 bCopyProtect;500 __u8 bCopyProtect;
471} __attribute__((__packed__));501} __attribute__((__packed__));
472502
...@@ -522,7 +552,7 @@ struct uvc_format_mjpeg {...@@ -522,7 +552,7 @@ struct uvc_format_mjpeg {
522 __u8 bDefaultFrameIndex;552 __u8 bDefaultFrameIndex;
523 __u8 bAspectRatioX;553 __u8 bAspectRatioX;
524 __u8 bAspectRatioY;554 __u8 bAspectRatioY;
525 __u8 bmInterfaceFlags;555 __u8 bmInterlaceFlags;
526 __u8 bCopyProtect;556 __u8 bCopyProtect;
527} __attribute__((__packed__));557} __attribute__((__packed__));
528558
lib/libc/include/any-linux-any/linux/usbdevice_fs.h+2-2
...@@ -131,7 +131,7 @@ struct usbdevfs_urb {...@@ -131,7 +131,7 @@ struct usbdevfs_urb {
131 unsigned int signr; /* signal to be sent on completion,131 unsigned int signr; /* signal to be sent on completion,
132 or 0 if none should be sent. */132 or 0 if none should be sent. */
133 void *usercontext;133 void *usercontext;
134 struct usbdevfs_iso_packet_desc iso_frame_desc[0];134 struct usbdevfs_iso_packet_desc iso_frame_desc[];
135};135};
136136
137/* ioctls for talking directly to drivers */137/* ioctls for talking directly to drivers */
...@@ -176,7 +176,7 @@ struct usbdevfs_disconnect_claim {...@@ -176,7 +176,7 @@ struct usbdevfs_disconnect_claim {
176struct usbdevfs_streams {176struct usbdevfs_streams {
177 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */177 unsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */
178 unsigned int num_eps;178 unsigned int num_eps;
179 unsigned char eps[0];179 unsigned char eps[];
180};180};
181181
182/*182/*
lib/libc/include/any-linux-any/linux/usbip.h+26
...@@ -24,4 +24,30 @@ enum usbip_device_status {...@@ -24,4 +24,30 @@ enum usbip_device_status {
24 VDEV_ST_USED,24 VDEV_ST_USED,
25 VDEV_ST_ERROR25 VDEV_ST_ERROR
26};26};
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
27#endif /* _LINUX_USBIP_H */53#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 @@...@@ -12,6 +12,10 @@
1212
13#include <linux/types.h>13#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
15/*19/*
16 * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and20 * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and
17 * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In21 * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR. In
...@@ -32,7 +36,9 @@...@@ -32,7 +36,9 @@
32 UFFD_FEATURE_SIGBUS | \36 UFFD_FEATURE_SIGBUS | \
33 UFFD_FEATURE_THREAD_ID | \37 UFFD_FEATURE_THREAD_ID | \
34 UFFD_FEATURE_MINOR_HUGETLBFS | \38 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)
36#define UFFD_API_IOCTLS \42#define UFFD_API_IOCTLS \
37 ((__u64)1 << _UFFDIO_REGISTER | \43 ((__u64)1 << _UFFDIO_REGISTER | \
38 (__u64)1 << _UFFDIO_UNREGISTER | \44 (__u64)1 << _UFFDIO_UNREGISTER | \
...@@ -46,7 +52,8 @@...@@ -46,7 +52,8 @@
46#define UFFD_API_RANGE_IOCTLS_BASIC \52#define UFFD_API_RANGE_IOCTLS_BASIC \
47 ((__u64)1 << _UFFDIO_WAKE | \53 ((__u64)1 << _UFFDIO_WAKE | \
48 (__u64)1 << _UFFDIO_COPY | \54 (__u64)1 << _UFFDIO_COPY | \
49 (__u64)1 << _UFFDIO_CONTINUE)55 (__u64)1 << _UFFDIO_CONTINUE | \
56 (__u64)1 << _UFFDIO_WRITEPROTECT)
5057
51/*58/*
52 * Valid ioctl command number range with this API is from 0x00 to59 * Valid ioctl command number range with this API is from 0x00 to
...@@ -189,6 +196,13 @@ struct uffdio_api {...@@ -189,6 +196,13 @@ struct uffdio_api {
189 *196 *
190 * UFFD_FEATURE_MINOR_SHMEM indicates the same support as197 * UFFD_FEATURE_MINOR_SHMEM indicates the same support as
191 * UFFD_FEATURE_MINOR_HUGETLBFS, but for shmem-backed pages instead.198 * 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.
192 */206 */
193#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)207#define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
194#define UFFD_FEATURE_EVENT_FORK (1<<1)208#define UFFD_FEATURE_EVENT_FORK (1<<1)
...@@ -201,6 +215,8 @@ struct uffdio_api {...@@ -201,6 +215,8 @@ struct uffdio_api {
201#define UFFD_FEATURE_THREAD_ID (1<<8)215#define UFFD_FEATURE_THREAD_ID (1<<8)
202#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9)216#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9)
203#define UFFD_FEATURE_MINOR_SHMEM (1<<10)217#define UFFD_FEATURE_MINOR_SHMEM (1<<10)
218#define UFFD_FEATURE_EXACT_ADDRESS (1<<11)
219#define UFFD_FEATURE_WP_HUGETLBFS_SHMEM (1<<12)
204 __u64 features;220 __u64 features;
205221
206 __u64 ioctls;222 __u64 ioctls;
lib/libc/include/any-linux-any/linux/uuid.h+5-17
...@@ -1,18 +1,10 @@...@@ -1,18 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* DO NOT USE in new code! This is solely for MEI due to legacy reasons */
2/*3/*
3 * UUID/GUID definition4 * MEI UUID definition
4 *5 *
5 * Copyright (C) 2010, Intel Corp.6 * Copyright (C) 2010, Intel Corp.
6 * Huang Ying <ying.huang@intel.com>7 * 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.
16 */8 */
179
18#ifndef _LINUX_UUID_H_10#ifndef _LINUX_UUID_H_
...@@ -22,19 +14,15 @@...@@ -22,19 +14,15 @@
2214
23typedef struct {15typedef struct {
24 __u8 b[16];16 __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) \19#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
28((guid_t) \20((uuid_le) \
29{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \21{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
30 (b) & 0xff, ((b) >> 8) & 0xff, \22 (b) & 0xff, ((b) >> 8) & 0xff, \
31 (c) & 0xff, ((c) >> 8) & 0xff, \23 (c) & 0xff, ((c) >> 8) & 0xff, \
32 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})24 (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)
38#define NULL_UUID_LE \26#define NULL_UUID_LE \
39 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \27 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
40 0x00, 0x00, 0x00, 0x00)28 0x00, 0x00, 0x00, 0x00)
lib/libc/include/any-linux-any/linux/uvcvideo.h+4-2
...@@ -36,9 +36,11 @@...@@ -36,9 +36,11 @@
36 UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \36 UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
37 UVC_CTRL_FLAG_GET_DEF)37 UVC_CTRL_FLAG_GET_DEF)
3838
39#define UVC_MENU_NAME_LEN 32
40
39struct uvc_menu_info {41struct uvc_menu_info {
40 __u32 value;42 __u32 value;
41 __u8 name[32];43 __u8 name[UVC_MENU_NAME_LEN];
42};44};
4345
44struct uvc_xu_control_mapping {46struct uvc_xu_control_mapping {
...@@ -86,7 +88,7 @@ struct uvc_xu_control_query {...@@ -86,7 +88,7 @@ struct uvc_xu_control_query {
86 * struct. The first two fields are added by the driver, they can be used for88 * struct. The first two fields are added by the driver, they can be used for
87 * clock synchronisation. The rest is an exact copy of a UVC payload header.89 * clock synchronisation. The rest is an exact copy of a UVC payload header.
88 * Only complete objects with complete buffers are included. Therefore it's90 * 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.
90 */92 */
91struct uvc_meta_buf {93struct uvc_meta_buf {
92 __u64 ns;94 __u64 ns;
lib/libc/include/any-linux-any/linux/v4l2-common.h-39
...@@ -10,45 +10,6 @@...@@ -10,45 +10,6 @@
10 *10 *
11 * Copyright (C) 2012 Nokia Corporation11 * Copyright (C) 2012 Nokia Corporation
12 * Contact: Sakari Ailus <sakari.ailus@iki.fi>12 * 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 *
52 */13 */
5314
54#ifndef __V4L2_COMMON__15#ifndef __V4L2_COMMON__
lib/libc/include/any-linux-any/linux/v4l2-controls.h+778-42
...@@ -4,44 +4,6 @@...@@ -4,44 +4,6 @@
4 *4 *
5 * Copyright (C) 1999-2012 the contributors5 * Copyright (C) 1999-2012 the contributors
6 *6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * 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 *
45 * The contents of this header was split off from videodev2.h. All control7 * The contents of this header was split off from videodev2.h. All control
46 * definitions should be added to this header, which is included by8 * definitions should be added to this header, which is included by
47 * videodev2.h.9 * videodev2.h.
...@@ -128,6 +90,7 @@ enum v4l2_colorfx {...@@ -128,6 +90,7 @@ enum v4l2_colorfx {
128 V4L2_COLORFX_SOLARIZATION = 13,90 V4L2_COLORFX_SOLARIZATION = 13,
129 V4L2_COLORFX_ANTIQUE = 14,91 V4L2_COLORFX_ANTIQUE = 14,
130 V4L2_COLORFX_SET_CBCR = 15,92 V4L2_COLORFX_SET_CBCR = 15,
93 V4L2_COLORFX_SET_RGB = 16,
131};94};
132#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)95#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
133#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)96#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
...@@ -145,14 +108,17 @@ enum v4l2_colorfx {...@@ -145,14 +108,17 @@ enum v4l2_colorfx {
145108
146#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)109#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
147#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)110#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
111#define V4L2_CID_COLORFX_RGB (V4L2_CID_BASE+43)
148112
149/* last CID + 1 */113/* last CID + 1 */
150#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43)114#define V4L2_CID_LASTP1 (V4L2_CID_BASE+44)
151115
152/* USER-class private control IDs */116/* USER-class private control IDs */
153117
154/* The base for the meye driver controls. See linux/meye.h for the list118/*
155 * of controls. We reserve 16 controls for this driver. */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 */
156#define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000)122#define V4L2_CID_USER_MEYE_BASE (V4L2_CID_USER_BASE + 0x1000)
157123
158/* The base for the bttv driver controls.124/* The base for the bttv driver controls.
...@@ -217,6 +183,24 @@ enum v4l2_colorfx {...@@ -217,6 +183,24 @@ enum v4l2_colorfx {
217 */183 */
218#define V4L2_CID_USER_ALLEGRO_BASE (V4L2_CID_USER_BASE + 0x1170)184#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
220/* MPEG-class control IDs */204/* MPEG-class control IDs */
221/* The MPEG controls are applicable to all codec controls205/* The MPEG controls are applicable to all codec controls
222 * and the 'MPEG' part of the define is historical */206 * and the 'MPEG' part of the define is historical */
...@@ -439,6 +423,11 @@ enum v4l2_mpeg_video_multi_slice_mode {...@@ -439,6 +423,11 @@ enum v4l2_mpeg_video_multi_slice_mode {
439#define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234)423#define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234)
440#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235)424#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235)
441#define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+236)425#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
443/* CIDs for the MPEG-2 Part 2 (H.262) codec */432/* CIDs for the MPEG-2 Part 2 (H.262) codec */
444#define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)433#define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)
...@@ -998,6 +987,8 @@ enum v4l2_auto_focus_range {...@@ -998,6 +987,8 @@ enum v4l2_auto_focus_range {
998987
999#define V4L2_CID_CAMERA_SENSOR_ROTATION (V4L2_CID_CAMERA_CLASS_BASE+35)988#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
1001/* FM Modulator class control IDs */992/* FM Modulator class control IDs */
1002993
1003#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)994#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
...@@ -1559,6 +1550,8 @@ struct v4l2_h264_dpb_entry {...@@ -1559,6 +1550,8 @@ struct v4l2_h264_dpb_entry {
1559#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x011550#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC 0x01
1560#define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC 0x021551#define V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC 0x02
1561#define V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD 0x041552#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
1563#define V4L2_CID_STATELESS_H264_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 7)1556#define V4L2_CID_STATELESS_H264_DECODE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 7)
1564/**1557/**
...@@ -1713,7 +1706,7 @@ struct v4l2_vp8_segment {...@@ -1713,7 +1706,7 @@ struct v4l2_vp8_segment {
1713 * @sharpness_level: matches sharpness_level syntax element.1706 * @sharpness_level: matches sharpness_level syntax element.
1714 * @level: matches loop_filter_level syntax element.1707 * @level: matches loop_filter_level syntax element.
1715 * @padding: padding field. Should be zeroed by applications.1708 * @padding: padding field. Should be zeroed by applications.
1716 * @flags: see V4L2_VP8_LF_FLAG_{}.1709 * @flags: see V4L2_VP8_LF_{}.
1717 *1710 *
1718 * This structure contains loop filter related parameters.1711 * This structure contains loop filter related parameters.
1719 * See the 'mb_lf_adjustments()' part of the frame header syntax,1712 * See the 'mb_lf_adjustments()' part of the frame header syntax,
...@@ -1980,6 +1973,465 @@ struct v4l2_ctrl_mpeg2_quantisation {...@@ -1980,6 +1973,465 @@ struct v4l2_ctrl_mpeg2_quantisation {
1980 __u8 chroma_non_intra_quantiser_matrix[64];1973 __u8 chroma_non_intra_quantiser_matrix[64];
1981};1974};
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
1983#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)2435#define V4L2_CID_COLORIMETRY_CLASS_BASE (V4L2_CTRL_CLASS_COLORIMETRY | 0x900)
1984#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)2436#define V4L2_CID_COLORIMETRY_CLASS (V4L2_CTRL_CLASS_COLORIMETRY | 1)
19852437
...@@ -2014,6 +2466,290 @@ struct v4l2_ctrl_hdr10_mastering_display {...@@ -2014,6 +2466,290 @@ struct v4l2_ctrl_hdr10_mastering_display {
2014 __u32 min_display_mastering_luminance;2466 __u32 min_display_mastering_luminance;
2015};2467};
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
2017/* MPEG-compression definitions kept for backwards compatibility */2753/* MPEG-compression definitions kept for backwards compatibility */
2018#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC2754#define V4L2_CTRL_CLASS_MPEG V4L2_CTRL_CLASS_CODEC
2019#define V4L2_CID_MPEG_CLASS V4L2_CID_CODEC_CLASS2755#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 @@...@@ -3,15 +3,6 @@
3 * V4L2 DV timings header.3 * V4L2 DV timings header.
4 *4 *
5 * Copyright (C) 2012-2016 Hans Verkuil <hans.verkuil@cisco.com>5 * 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.
15 */6 */
167
17#ifndef _V4L2_DV_TIMINGS_H8#ifndef _V4L2_DV_TIMINGS_H
lib/libc/include/any-linux-any/linux/v4l2-mediabus.h-4
...@@ -3,10 +3,6 @@...@@ -3,10 +3,6 @@
3 * Media Bus API header3 * Media Bus API header
4 *4 *
5 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>5 * 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.
10 */6 */
117
12#ifndef __LINUX_V4L2_MEDIABUS_H8#ifndef __LINUX_V4L2_MEDIABUS_H
lib/libc/include/any-linux-any/linux/v4l2-subdev.h+67-20
...@@ -6,24 +6,12 @@...@@ -6,24 +6,12 @@
6 *6 *
7 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>7 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
8 * Sakari Ailus <sakari.ailus@iki.fi>8 * 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
22 */9 */
2310
24#ifndef __LINUX_V4L2_SUBDEV_H11#ifndef __LINUX_V4L2_SUBDEV_H
25#define __LINUX_V4L2_SUBDEV_H12#define __LINUX_V4L2_SUBDEV_H
2613
14#include <linux/const.h>
27#include <linux/ioctl.h>15#include <linux/ioctl.h>
28#include <linux/types.h>16#include <linux/types.h>
29#include <linux/v4l2-common.h>17#include <linux/v4l2-common.h>
...@@ -44,13 +32,15 @@ enum v4l2_subdev_format_whence {...@@ -44,13 +32,15 @@ enum v4l2_subdev_format_whence {
44 * @which: format type (from enum v4l2_subdev_format_whence)32 * @which: format type (from enum v4l2_subdev_format_whence)
45 * @pad: pad number, as reported by the media API33 * @pad: pad number, as reported by the media API
46 * @format: media bus format (format code and frame size)34 * @format: media bus format (format code and frame size)
35 * @stream: stream number, defined in subdev routing
47 * @reserved: drivers and applications must zero this array36 * @reserved: drivers and applications must zero this array
48 */37 */
49struct v4l2_subdev_format {38struct v4l2_subdev_format {
50 __u32 which;39 __u32 which;
51 __u32 pad;40 __u32 pad;
52 struct v4l2_mbus_framefmt format;41 struct v4l2_mbus_framefmt format;
53 __u32 reserved[8];42 __u32 stream;
43 __u32 reserved[7];
54};44};
5545
56/**46/**
...@@ -58,13 +48,15 @@ struct v4l2_subdev_format {...@@ -58,13 +48,15 @@ struct v4l2_subdev_format {
58 * @which: format type (from enum v4l2_subdev_format_whence)48 * @which: format type (from enum v4l2_subdev_format_whence)
59 * @pad: pad number, as reported by the media API49 * @pad: pad number, as reported by the media API
60 * @rect: pad crop rectangle boundaries50 * @rect: pad crop rectangle boundaries
51 * @stream: stream number, defined in subdev routing
61 * @reserved: drivers and applications must zero this array52 * @reserved: drivers and applications must zero this array
62 */53 */
63struct v4l2_subdev_crop {54struct v4l2_subdev_crop {
64 __u32 which;55 __u32 which;
65 __u32 pad;56 __u32 pad;
66 struct v4l2_rect rect;57 struct v4l2_rect rect;
67 __u32 reserved[8];58 __u32 stream;
59 __u32 reserved[7];
68};60};
6961
70#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x0000000162#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
...@@ -80,6 +72,7 @@ struct v4l2_subdev_crop {...@@ -80,6 +72,7 @@ struct v4l2_subdev_crop {
80 * @code: format code (MEDIA_BUS_FMT_ definitions)72 * @code: format code (MEDIA_BUS_FMT_ definitions)
81 * @which: format type (from enum v4l2_subdev_format_whence)73 * @which: format type (from enum v4l2_subdev_format_whence)
82 * @flags: flags set by the driver, (V4L2_SUBDEV_MBUS_CODE_*)74 * @flags: flags set by the driver, (V4L2_SUBDEV_MBUS_CODE_*)
75 * @stream: stream number, defined in subdev routing
83 * @reserved: drivers and applications must zero this array76 * @reserved: drivers and applications must zero this array
84 */77 */
85struct v4l2_subdev_mbus_code_enum {78struct v4l2_subdev_mbus_code_enum {
...@@ -88,7 +81,8 @@ struct v4l2_subdev_mbus_code_enum {...@@ -88,7 +81,8 @@ struct v4l2_subdev_mbus_code_enum {
88 __u32 code;81 __u32 code;
89 __u32 which;82 __u32 which;
90 __u32 flags;83 __u32 flags;
91 __u32 reserved[7];84 __u32 stream;
85 __u32 reserved[6];
92};86};
9387
94/**88/**
...@@ -101,6 +95,7 @@ struct v4l2_subdev_mbus_code_enum {...@@ -101,6 +95,7 @@ struct v4l2_subdev_mbus_code_enum {
101 * @min_height: minimum frame height, in pixels95 * @min_height: minimum frame height, in pixels
102 * @max_height: maximum frame height, in pixels96 * @max_height: maximum frame height, in pixels
103 * @which: format type (from enum v4l2_subdev_format_whence)97 * @which: format type (from enum v4l2_subdev_format_whence)
98 * @stream: stream number, defined in subdev routing
104 * @reserved: drivers and applications must zero this array99 * @reserved: drivers and applications must zero this array
105 */100 */
106struct v4l2_subdev_frame_size_enum {101struct v4l2_subdev_frame_size_enum {
...@@ -112,19 +107,22 @@ struct v4l2_subdev_frame_size_enum {...@@ -112,19 +107,22 @@ struct v4l2_subdev_frame_size_enum {
112 __u32 min_height;107 __u32 min_height;
113 __u32 max_height;108 __u32 max_height;
114 __u32 which;109 __u32 which;
115 __u32 reserved[8];110 __u32 stream;
111 __u32 reserved[7];
116};112};
117113
118/**114/**
119 * struct v4l2_subdev_frame_interval - Pad-level frame rate115 * struct v4l2_subdev_frame_interval - Pad-level frame rate
120 * @pad: pad number, as reported by the media API116 * @pad: pad number, as reported by the media API
121 * @interval: frame interval in seconds117 * @interval: frame interval in seconds
118 * @stream: stream number, defined in subdev routing
122 * @reserved: drivers and applications must zero this array119 * @reserved: drivers and applications must zero this array
123 */120 */
124struct v4l2_subdev_frame_interval {121struct v4l2_subdev_frame_interval {
125 __u32 pad;122 __u32 pad;
126 struct v4l2_fract interval;123 struct v4l2_fract interval;
127 __u32 reserved[9];124 __u32 stream;
125 __u32 reserved[8];
128};126};
129127
130/**128/**
...@@ -136,6 +134,7 @@ struct v4l2_subdev_frame_interval {...@@ -136,6 +134,7 @@ struct v4l2_subdev_frame_interval {
136 * @height: frame height in pixels134 * @height: frame height in pixels
137 * @interval: frame interval in seconds135 * @interval: frame interval in seconds
138 * @which: format type (from enum v4l2_subdev_format_whence)136 * @which: format type (from enum v4l2_subdev_format_whence)
137 * @stream: stream number, defined in subdev routing
139 * @reserved: drivers and applications must zero this array138 * @reserved: drivers and applications must zero this array
140 */139 */
141struct v4l2_subdev_frame_interval_enum {140struct v4l2_subdev_frame_interval_enum {
...@@ -146,7 +145,8 @@ struct v4l2_subdev_frame_interval_enum {...@@ -146,7 +145,8 @@ struct v4l2_subdev_frame_interval_enum {
146 __u32 height;145 __u32 height;
147 struct v4l2_fract interval;146 struct v4l2_fract interval;
148 __u32 which;147 __u32 which;
149 __u32 reserved[8];148 __u32 stream;
149 __u32 reserved[7];
150};150};
151151
152/**152/**
...@@ -158,6 +158,7 @@ struct v4l2_subdev_frame_interval_enum {...@@ -158,6 +158,7 @@ struct v4l2_subdev_frame_interval_enum {
158 * defined in v4l2-common.h; V4L2_SEL_TGT_* .158 * defined in v4l2-common.h; V4L2_SEL_TGT_* .
159 * @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.159 * @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
160 * @r: coordinates of the selection window160 * @r: coordinates of the selection window
161 * @stream: stream number, defined in subdev routing
161 * @reserved: for future use, set to zero for now162 * @reserved: for future use, set to zero for now
162 *163 *
163 * Hardware may use multiple helper windows to process a video stream.164 * Hardware may use multiple helper windows to process a video stream.
...@@ -170,7 +171,8 @@ struct v4l2_subdev_selection {...@@ -170,7 +171,8 @@ struct v4l2_subdev_selection {
170 __u32 target;171 __u32 target;
171 __u32 flags;172 __u32 flags;
172 struct v4l2_rect r;173 struct v4l2_rect r;
173 __u32 reserved[8];174 __u32 stream;
175 __u32 reserved[7];
174};176};
175177
176/**178/**
...@@ -188,6 +190,49 @@ struct v4l2_subdev_capability {...@@ -188,6 +190,49 @@ struct v4l2_subdev_capability {
188/* The v4l2 sub-device video device node is registered in read-only mode. */190/* The v4l2 sub-device video device node is registered in read-only mode. */
189#define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001191#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
191/* Backwards compatibility define --- to be removed */236/* Backwards compatibility define --- to be removed */
192#define v4l2_subdev_edid v4l2_edid237#define v4l2_subdev_edid v4l2_edid
193238
...@@ -203,6 +248,8 @@ struct v4l2_subdev_capability {...@@ -203,6 +248,8 @@ struct v4l2_subdev_capability {
203#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)248#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
204#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)249#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
205#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)250#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)
206/* The following ioctls are identical to the ioctls in videodev2.h */253/* The following ioctls are identical to the ioctls in videodev2.h */
207#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)254#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
208#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)255#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 {...@@ -18,11 +18,15 @@ enum vdpa_command {
18 VDPA_CMD_DEV_DEL,18 VDPA_CMD_DEV_DEL,
19 VDPA_CMD_DEV_GET, /* can dump */19 VDPA_CMD_DEV_GET, /* can dump */
20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */
21 VDPA_CMD_DEV_VSTATS_GET,
21};22};
2223
23enum vdpa_attr {24enum vdpa_attr {
24 VDPA_ATTR_UNSPEC,25 VDPA_ATTR_UNSPEC,
2526
27 /* Pad attribute for 64b alignment */
28 VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
29
26 /* bus name (optional) + dev name together make the parent device handle */30 /* bus name (optional) + dev name together make the parent device handle */
27 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */31 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
28 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */32 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
...@@ -40,6 +44,18 @@ enum vdpa_attr {...@@ -40,6 +44,18 @@ enum vdpa_attr {
40 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */44 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
41 VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */45 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
43 /* new attributes must be added above here */59 /* new attributes must be added above here */
44 VDPA_ATTR_MAX,60 VDPA_ATTR_MAX,
45};61};
lib/libc/include/any-linux-any/linux/vduse.h+47
...@@ -210,6 +210,53 @@ struct vduse_vq_eventfd {...@@ -210,6 +210,53 @@ struct vduse_vq_eventfd {
210 */210 */
211#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)211#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
213/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */260/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
214261
215/**262/**
lib/libc/include/any-linux-any/linux/version.h+4-4
...@@ -1,5 +1,5 @@...@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 3317781#define LINUX_VERSION_CODE 393992
2#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))2#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 @@...@@ -49,7 +49,11 @@
49/* Supports VFIO_DMA_UNMAP_FLAG_ALL */49/* Supports VFIO_DMA_UNMAP_FLAG_ALL */
50#define VFIO_UNMAP_ALL 950#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 */
53#define VFIO_UPDATE_VADDR 1057#define VFIO_UPDATE_VADDR 10
5458
55/*59/*
...@@ -323,7 +327,7 @@ struct vfio_region_info_cap_type {...@@ -323,7 +327,7 @@ struct vfio_region_info_cap_type {
323#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)327#define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
324#define VFIO_REGION_TYPE_GFX (1)328#define VFIO_REGION_TYPE_GFX (1)
325#define VFIO_REGION_TYPE_CCW (2)329#define VFIO_REGION_TYPE_CCW (2)
326#define VFIO_REGION_TYPE_MIGRATION (3)330#define VFIO_REGION_TYPE_MIGRATION_DEPRECATED (3)
327331
328/* sub-types for VFIO_REGION_TYPE_PCI_* */332/* sub-types for VFIO_REGION_TYPE_PCI_* */
329333
...@@ -405,225 +409,29 @@ struct vfio_region_gfx_edid {...@@ -405,225 +409,29 @@ struct vfio_region_gfx_edid {
405#define VFIO_REGION_SUBTYPE_CCW_CRW (3)409#define VFIO_REGION_SUBTYPE_CCW_CRW (3)
406410
407/* sub-types for VFIO_REGION_TYPE_MIGRATION */411/* sub-types for VFIO_REGION_TYPE_MIGRATION */
408#define VFIO_REGION_SUBTYPE_MIGRATION (1)412#define VFIO_REGION_SUBTYPE_MIGRATION_DEPRECATED (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 */
605413
606struct vfio_device_migration_info {414struct vfio_device_migration_info {
607 __u32 device_state; /* VFIO device state */415 __u32 device_state; /* VFIO device state */
608#define VFIO_DEVICE_STATE_STOP (0)416#define VFIO_DEVICE_STATE_V1_STOP (0)
609#define VFIO_DEVICE_STATE_RUNNING (1 << 0)417#define VFIO_DEVICE_STATE_V1_RUNNING (1 << 0)
610#define VFIO_DEVICE_STATE_SAVING (1 << 1)418#define VFIO_DEVICE_STATE_V1_SAVING (1 << 1)
611#define VFIO_DEVICE_STATE_RESUMING (1 << 2)419#define VFIO_DEVICE_STATE_V1_RESUMING (1 << 2)
612#define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_RUNNING | \420#define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_V1_RUNNING | \
613 VFIO_DEVICE_STATE_SAVING | \421 VFIO_DEVICE_STATE_V1_SAVING | \
614 VFIO_DEVICE_STATE_RESUMING)422 VFIO_DEVICE_STATE_V1_RESUMING)
615423
616#define VFIO_DEVICE_STATE_VALID(state) \424#define VFIO_DEVICE_STATE_VALID(state) \
617 (state & VFIO_DEVICE_STATE_RESUMING ? \425 (state & VFIO_DEVICE_STATE_V1_RESUMING ? \
618 (state & VFIO_DEVICE_STATE_MASK) == VFIO_DEVICE_STATE_RESUMING : 1)426 (state & VFIO_DEVICE_STATE_MASK) == VFIO_DEVICE_STATE_V1_RESUMING : 1)
619427
620#define VFIO_DEVICE_STATE_IS_ERROR(state) \428#define VFIO_DEVICE_STATE_IS_ERROR(state) \
621 ((state & VFIO_DEVICE_STATE_MASK) == (VFIO_DEVICE_STATE_SAVING | \429 ((state & VFIO_DEVICE_STATE_MASK) == (VFIO_DEVICE_STATE_V1_SAVING | \
622 VFIO_DEVICE_STATE_RESUMING))430 VFIO_DEVICE_STATE_V1_RESUMING))
623431
624#define VFIO_DEVICE_STATE_SET_ERROR(state) \432#define VFIO_DEVICE_STATE_SET_ERROR(state) \
625 ((state & ~VFIO_DEVICE_STATE_MASK) | VFIO_DEVICE_SATE_SAVING | \433 ((state & ~VFIO_DEVICE_STATE_MASK) | VFIO_DEVICE_STATE_V1_SAVING | \
626 VFIO_DEVICE_STATE_RESUMING)434 VFIO_DEVICE_STATE_V1_RESUMING)
627435
628 __u32 reserved;436 __u32 reserved;
629 __u64 pending_bytes;437 __u64 pending_bytes;
...@@ -839,7 +647,7 @@ enum {...@@ -839,7 +647,7 @@ enum {
839};647};
840648
841/**649/**
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,
843 * struct vfio_pci_hot_reset_info)651 * struct vfio_pci_hot_reset_info)
844 *652 *
845 * Return: 0 on success, -errno on failure:653 * Return: 0 on success, -errno on failure:
...@@ -966,7 +774,7 @@ struct vfio_device_ioeventfd {...@@ -966,7 +774,7 @@ struct vfio_device_ioeventfd {
966#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)774#define VFIO_DEVICE_IOEVENTFD _IO(VFIO_TYPE, VFIO_BASE + 16)
967775
968/**776/**
969 * VFIO_DEVICE_FEATURE - _IORW(VFIO_TYPE, VFIO_BASE + 17,777 * VFIO_DEVICE_FEATURE - _IOWR(VFIO_TYPE, VFIO_BASE + 17,
970 * struct vfio_device_feature)778 * struct vfio_device_feature)
971 *779 *
972 * Get, set, or probe feature data of the device. The feature is selected780 * Get, set, or probe feature data of the device. The feature is selected
...@@ -1002,6 +810,456 @@ struct vfio_device_feature {...@@ -1002,6 +810,456 @@ struct vfio_device_feature {
1002 */810 */
1003#define VFIO_DEVICE_FEATURE_PCI_VF_TOKEN (0)811#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
1005/* -------- API for Type1 VFIO IOMMU -------- */1263/* -------- API for Type1 VFIO IOMMU -------- */
10061264
1007/**1265/**
...@@ -1089,8 +1347,7 @@ struct vfio_iommu_type1_info_dma_avail {...@@ -1089,8 +1347,7 @@ struct vfio_iommu_type1_info_dma_avail {
1089 * Map process virtual addresses to IO virtual addresses using the1347 * Map process virtual addresses to IO virtual addresses using the
1090 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.1348 * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
1091 *1349 *
1092 * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova, and1350 * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova. The vaddr
1093 * unblock translation of host virtual addresses in the iova range. The vaddr
1094 * must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To1351 * must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To
1095 * maintain memory consistency within the user application, the updated vaddr1352 * maintain memory consistency within the user application, the updated vaddr
1096 * must address the same memory object as originally mapped. Failure to do so1353 * must address the same memory object as originally mapped. Failure to do so
...@@ -1141,9 +1398,9 @@ struct vfio_bitmap {...@@ -1141,9 +1398,9 @@ struct vfio_bitmap {
1141 * must be 0. This cannot be combined with the get-dirty-bitmap flag.1398 * must be 0. This cannot be combined with the get-dirty-bitmap flag.
1142 *1399 *
1143 * If flags & VFIO_DMA_UNMAP_FLAG_VADDR, do not unmap, but invalidate host1400 * 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 an1401 * virtual addresses in the iova range. DMA to already-mapped pages continues.
1145 * iova's vaddr will block. DMA to already-mapped pages continues. This1402 * Groups may not be added to the container while any addresses are invalid.
1146 * cannot be combined with the get-dirty-bitmap flag.1403 * This cannot be combined with the get-dirty-bitmap flag.
1147 */1404 */
1148struct vfio_iommu_type1_dma_unmap {1405struct vfio_iommu_type1_dma_unmap {
1149 __u32 argsz;1406 __u32 argsz;
lib/libc/include/any-linux-any/linux/vfio_zdev.h+7
...@@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base {...@@ -29,6 +29,9 @@ struct vfio_device_info_cap_zpci_base {
29 __u16 fmb_length; /* Measurement Block Length (in bytes) */29 __u16 fmb_length; /* Measurement Block Length (in bytes) */
30 __u8 pft; /* PCI Function Type */30 __u8 pft; /* PCI Function Type */
31 __u8 gid; /* PCI function group ID */31 __u8 gid; /* PCI function group ID */
32 /* End of version 1 */
33 __u32 fh; /* PCI function handle */
34 /* End of version 2 */
32};35};
3336
34/**37/**
...@@ -47,6 +50,10 @@ struct vfio_device_info_cap_zpci_group {...@@ -47,6 +50,10 @@ struct vfio_device_info_cap_zpci_group {
47 __u16 noi; /* Maximum number of MSIs */50 __u16 noi; /* Maximum number of MSIs */
48 __u16 maxstbl; /* Maximum Store Block Length */51 __u16 maxstbl; /* Maximum Store Block Length */
49 __u8 version; /* Supported PCI Version */52 __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 */
50};57};
5158
52/**59/**
lib/libc/include/any-linux-any/linux/vhost.h+43-5
...@@ -89,11 +89,6 @@...@@ -89,11 +89,6 @@
8989
90/* Set or get vhost backend capability */90/* 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
97#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)92#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
98#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)93#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
9994
...@@ -150,4 +145,47 @@...@@ -150,4 +145,47 @@
150/* Get the valid iova range */145/* Get the valid iova range */
151#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \146#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \
152 struct vhost_vdpa_iova_range)147 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
153#endif191#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 {...@@ -87,7 +87,7 @@ struct vhost_msg {
8787
88struct vhost_msg_v2 {88struct vhost_msg_v2 {
89 __u32 type;89 __u32 type;
90 __u32 reserved;90 __u32 asid;
91 union {91 union {
92 struct vhost_iotlb_msg iotlb;92 struct vhost_iotlb_msg iotlb;
93 __u8 padding[64];93 __u8 padding[64];
...@@ -107,7 +107,7 @@ struct vhost_memory_region {...@@ -107,7 +107,7 @@ struct vhost_memory_region {
107struct vhost_memory {107struct vhost_memory {
108 __u32 nregions;108 __u32 nregions;
109 __u32 padding;109 __u32 padding;
110 struct vhost_memory_region regions[0];110 struct vhost_memory_region regions[];
111};111};
112112
113/* VHOST_SCSI specific definitions */113/* VHOST_SCSI specific definitions */
...@@ -135,7 +135,7 @@ struct vhost_scsi_target {...@@ -135,7 +135,7 @@ struct vhost_scsi_target {
135struct vhost_vdpa_config {135struct vhost_vdpa_config {
136 __u32 off;136 __u32 off;
137 __u32 len;137 __u32 len;
138 __u8 buf[0];138 __u8 buf[];
139};139};
140140
141/* vhost vdpa IOVA range141/* vhost vdpa IOVA range
...@@ -153,4 +153,17 @@ struct vhost_vdpa_iova_range {...@@ -153,4 +153,17 @@ struct vhost_vdpa_iova_range {
153/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */153/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
154#define VHOST_NET_F_VIRTIO_NET_HDR 27154#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
156#endif169#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 {...@@ -243,6 +243,7 @@ enum v4l2_colorspace {
243243
244 /* DCI-P3 colorspace, used by cinema projectors */244 /* DCI-P3 colorspace, used by cinema projectors */
245 V4L2_COLORSPACE_DCI_P3 = 12,245 V4L2_COLORSPACE_DCI_P3 = 12,
246
246};247};
247248
248/*249/*
...@@ -474,7 +475,6 @@ struct v4l2_capability {...@@ -474,7 +475,6 @@ struct v4l2_capability {
474#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */475#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */
475476
476#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */477#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
477#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
478#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */478#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
479#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */479#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */
480480
...@@ -549,6 +549,9 @@ struct v4l2_pix_format {...@@ -549,6 +549,9 @@ struct v4l2_pix_format {
549#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */549#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */
550#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */550#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
551#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */551#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
553/* Grey formats */556/* Grey formats */
554#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */557#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
...@@ -563,6 +566,7 @@ struct v4l2_pix_format {...@@ -563,6 +566,7 @@ struct v4l2_pix_format {
563/* Grey bit-packed formats */566/* Grey bit-packed formats */
564#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */567#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
565#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */568#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
567/* Palette formats */571/* Palette formats */
568#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */572#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
...@@ -586,8 +590,18 @@ struct v4l2_pix_format {...@@ -586,8 +590,18 @@ struct v4l2_pix_format {
586#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */590#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */
587#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */591#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */
588#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */592#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 */
589#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */595#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
591/* two planes -- one Y, one Cr + Cb interleaved */605/* two planes -- one Y, one Cr + Cb interleaved */
592#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */606#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
593#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */607#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 {...@@ -595,6 +609,7 @@ struct v4l2_pix_format {
595#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */609#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
596#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */610#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
597#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */611#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
599/* two non contiguous planes - one Y, one Cr + Cb interleaved */614/* two non contiguous planes - one Y, one Cr + Cb interleaved */
600#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */615#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 {...@@ -622,10 +637,15 @@ struct v4l2_pix_format {
622#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */637#define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */
623#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */638#define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */
624#define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 32x32 tiles */639#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
626/* Tiled YUV formats, non contiguous planes */644/* Tiled YUV formats, non contiguous planes */
627#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */645#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */
628#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */646#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
630/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */650/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
631#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */651#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
...@@ -697,10 +717,12 @@ struct v4l2_pix_format {...@@ -697,10 +717,12 @@ struct v4l2_pix_format {
697#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */717#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
698#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */718#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frame */
699#define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */719#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 */
700#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */721#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
701#define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */722#define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */
702#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */723#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
703#define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */724#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
705/* Vendor-specific formats */727/* Vendor-specific formats */
706#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */728#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
...@@ -737,8 +759,11 @@ struct v4l2_pix_format {...@@ -737,8 +759,11 @@ struct v4l2_pix_format {
737#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */759#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
738#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */760#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
739#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */761#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 */
742#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */767#define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
743#define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */768#define V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */
744#define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */769#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 {...@@ -1540,7 +1565,8 @@ struct v4l2_bt_timings {
1540 ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))1565 ((bt)->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
1541#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \1566#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
1542 ((bt)->vfrontporch + (bt)->vsync + (bt)->vbackporch + \1567 ((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))
1544#define V4L2_DV_BT_FRAME_HEIGHT(bt) \1570#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
1545 ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))1571 ((bt)->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
15461572
...@@ -1718,6 +1744,8 @@ struct v4l2_ext_control {...@@ -1718,6 +1744,8 @@ struct v4l2_ext_control {
1718 __u8 *p_u8;1744 __u8 *p_u8;
1719 __u16 *p_u16;1745 __u16 *p_u16;
1720 __u32 *p_u32;1746 __u32 *p_u32;
1747 __u32 *p_s32;
1748 __u32 *p_s64;
1721 struct v4l2_area *p_area;1749 struct v4l2_area *p_area;
1722 struct v4l2_ctrl_h264_sps *p_h264_sps;1750 struct v4l2_ctrl_h264_sps *p_h264_sps;
1723 struct v4l2_ctrl_h264_pps *p_h264_pps;1751 struct v4l2_ctrl_h264_pps *p_h264_pps;
...@@ -1730,6 +1758,13 @@ struct v4l2_ext_control {...@@ -1730,6 +1758,13 @@ struct v4l2_ext_control {
1730 struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;1758 struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;
1731 struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;1759 struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;
1732 struct v4l2_ctrl_mpeg2_quantisation *p_mpeg2_quantisation;1760 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;
1733 void *ptr;1768 void *ptr;
1734 };1769 };
1735} __attribute__ ((packed));1770} __attribute__ ((packed));
...@@ -1790,6 +1825,15 @@ enum v4l2_ctrl_type {...@@ -1790,6 +1825,15 @@ enum v4l2_ctrl_type {
1790 V4L2_CTRL_TYPE_MPEG2_QUANTISATION = 0x0250,1825 V4L2_CTRL_TYPE_MPEG2_QUANTISATION = 0x0250,
1791 V4L2_CTRL_TYPE_MPEG2_SEQUENCE = 0x0251,1826 V4L2_CTRL_TYPE_MPEG2_SEQUENCE = 0x0251,
1792 V4L2_CTRL_TYPE_MPEG2_PICTURE = 0x0252,1827 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,
1793};1837};
17941838
1795/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */1839/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
...@@ -1845,6 +1889,7 @@ struct v4l2_querymenu {...@@ -1845,6 +1889,7 @@ struct v4l2_querymenu {
1845#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x01001889#define V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100
1846#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x02001890#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
1847#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x04001891#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400
1892#define V4L2_CTRL_FLAG_DYNAMIC_ARRAY 0x0800
18481893
1849/* Query flags, to be ORed with the control ID */1894/* Query flags, to be ORed with the control ID */
1850#define V4L2_CTRL_FLAG_NEXT_CTRL 0x800000001895#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
...@@ -2352,6 +2397,7 @@ struct v4l2_event_vsync {...@@ -2352,6 +2397,7 @@ struct v4l2_event_vsync {
2352#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)2397#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
2353#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)2398#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
2354#define V4L2_EVENT_CTRL_CH_RANGE (1 << 2)2399#define V4L2_EVENT_CTRL_CH_RANGE (1 << 2)
2400#define V4L2_EVENT_CTRL_CH_DIMENSIONS (1 << 3)
23552401
2356struct v4l2_event_ctrl {2402struct v4l2_event_ctrl {
2357 __u32 changes;2403 __u32 changes;
...@@ -2594,5 +2640,10 @@ struct v4l2_create_buffers {...@@ -2594,5 +2640,10 @@ struct v4l2_create_buffers {
2594/* Deprecated definitions kept for backwards compatibility */2640/* Deprecated definitions kept for backwards compatibility */
2595#define V4L2_PIX_FMT_HM12 V4L2_PIX_FMT_NV12_16L162641#define V4L2_PIX_FMT_HM12 V4L2_PIX_FMT_NV12_16L16
2596#define V4L2_PIX_FMT_SUNXI_TILED_NV12 V4L2_PIX_FMT_NV12_32L322642#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
2598#endif /* __LINUX_VIDEODEV2_H */2649#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 {...@@ -38,7 +38,7 @@ struct virtio_9p_config {
38 /* length of the tag name */38 /* length of the tag name */
39 __virtio16 tag_len;39 __virtio16 tag_len;
40 /* non-NULL terminated tag name */40 /* non-NULL terminated tag name */
41 __u8 tag[0];41 __u8 tag[];
42} __attribute__((packed));42} __attribute__((packed));
4343
44#endif /* _LINUX_VIRTIO_9P_H */44#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 @@...@@ -40,6 +40,8 @@
40#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */40#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */
41#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */41#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */
42#define VIRTIO_BLK_F_WRITE_ZEROES 14 /* WRITE ZEROES is supported */42#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
44/* Legacy feature bits */46/* Legacy feature bits */
45#ifndef VIRTIO_BLK_NO_LEGACY47#ifndef VIRTIO_BLK_NO_LEGACY
...@@ -119,6 +121,31 @@ struct virtio_blk_config {...@@ -119,6 +121,31 @@ struct virtio_blk_config {
119 __u8 write_zeroes_may_unmap;121 __u8 write_zeroes_may_unmap;
120122
121 __u8 unused1[3];123 __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;
122} __attribute__((packed));149} __attribute__((packed));
123150
124/*151/*
...@@ -153,6 +180,30 @@ struct virtio_blk_config {...@@ -153,6 +180,30 @@ struct virtio_blk_config {
153/* Write zeroes command */180/* Write zeroes command */
154#define VIRTIO_BLK_T_WRITE_ZEROES 13181#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
156#ifndef VIRTIO_BLK_NO_LEGACY207#ifndef VIRTIO_BLK_NO_LEGACY
157/* Barrier before this op. */208/* Barrier before this op. */
158#define VIRTIO_BLK_T_BARRIER 0x80000000209#define VIRTIO_BLK_T_BARRIER 0x80000000
...@@ -172,6 +223,72 @@ struct virtio_blk_outhdr {...@@ -172,6 +223,72 @@ struct virtio_blk_outhdr {
172 __virtio64 sector;223 __virtio64 sector;
173};224};
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
175/* Unmap this range (only valid for write zeroes command) */292/* Unmap this range (only valid for write zeroes command) */
176#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001293#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
177294
...@@ -198,4 +315,11 @@ struct virtio_scsi_inhdr {...@@ -198,4 +315,11 @@ struct virtio_scsi_inhdr {
198#define VIRTIO_BLK_S_OK 0315#define VIRTIO_BLK_S_OK 0
199#define VIRTIO_BLK_S_IOERR 1316#define VIRTIO_BLK_S_IOERR 1
200#define VIRTIO_BLK_S_UNSUPP 2317#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
201#endif /* _LINUX_VIRTIO_BLK_H */325#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 @@...@@ -9,6 +9,7 @@
9#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */9#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */
10#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */10#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */
11#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */11#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */
12#define VIRTIO_BT_F_CONFIG_V2 3 /* Use second version configuration */
1213
13enum virtio_bt_config_type {14enum virtio_bt_config_type {
14 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,15 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
...@@ -28,4 +29,11 @@ struct virtio_bt_config {...@@ -28,4 +29,11 @@ struct virtio_bt_config {
28 __u16 msft_opcode;29 __u16 msft_opcode;
29} __attribute__((packed));30} __attribute__((packed));
3031
32struct virtio_bt_config_v2 {
33 __u8 type;
34 __u8 alignment;
35 __u16 vendor;
36 __u16 msft_opcode;
37};
38
31#endif /* _LINUX_VIRTIO_BT_H */39#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 @@...@@ -52,7 +52,7 @@
52 * rest are per-device feature bits.52 * rest are per-device feature bits.
53 */53 */
54#define VIRTIO_TRANSPORT_F_START 2854#define VIRTIO_TRANSPORT_F_START 28
55#define VIRTIO_TRANSPORT_F_END 3855#define VIRTIO_TRANSPORT_F_END 41
5656
57#ifndef VIRTIO_CONFIG_NO_LEGACY57#ifndef VIRTIO_CONFIG_NO_LEGACY
58/* Do we get callbacks when the ring is completely used, even if we've58/* Do we get callbacks when the ring is completely used, even if we've
...@@ -80,6 +80,12 @@...@@ -80,6 +80,12 @@
80/* This feature indicates support for the packed virtqueue layout. */80/* This feature indicates support for the packed virtqueue layout. */
81#define VIRTIO_F_RING_PACKED 3481#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
83/*89/*
84 * This feature indicates that memory accesses by the driver and the90 * This feature indicates that memory accesses by the driver and the
85 * device are ordered in a way described by the platform.91 * device are ordered in a way described by the platform.
...@@ -90,4 +96,9 @@...@@ -90,4 +96,9 @@
90 * Does the device support Single Root I/O Virtualization?96 * Does the device support Single Root I/O Virtualization?
91 */97 */
92#define VIRTIO_F_SR_IOV 3798#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
93#endif /* _LINUX_VIRTIO_CONFIG_H */104#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 @@...@@ -37,6 +37,7 @@
37#define VIRTIO_CRYPTO_SERVICE_HASH 137#define VIRTIO_CRYPTO_SERVICE_HASH 1
38#define VIRTIO_CRYPTO_SERVICE_MAC 238#define VIRTIO_CRYPTO_SERVICE_MAC 2
39#define VIRTIO_CRYPTO_SERVICE_AEAD 339#define VIRTIO_CRYPTO_SERVICE_AEAD 3
40#define VIRTIO_CRYPTO_SERVICE_AKCIPHER 4
4041
41#define VIRTIO_CRYPTO_OPCODE(service, op) (((service) << 8) | (op))42#define VIRTIO_CRYPTO_OPCODE(service, op) (((service) << 8) | (op))
4243
...@@ -57,6 +58,10 @@ struct virtio_crypto_ctrl_header {...@@ -57,6 +58,10 @@ struct virtio_crypto_ctrl_header {
57 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x02)58 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x02)
58#define VIRTIO_CRYPTO_AEAD_DESTROY_SESSION \59#define VIRTIO_CRYPTO_AEAD_DESTROY_SESSION \
59 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x03)60 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)
60 __le32 opcode;65 __le32 opcode;
61 __le32 algo;66 __le32 algo;
62 __le32 flag;67 __le32 flag;
...@@ -180,6 +185,58 @@ struct virtio_crypto_aead_create_session_req {...@@ -180,6 +185,58 @@ struct virtio_crypto_aead_create_session_req {
180 __u8 padding[32];185 __u8 padding[32];
181};186};
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
183struct virtio_crypto_alg_chain_session_para {240struct virtio_crypto_alg_chain_session_para {
184#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER 1241#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER 1
185#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH 2242#define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH 2
...@@ -247,6 +304,8 @@ struct virtio_crypto_op_ctrl_req {...@@ -247,6 +304,8 @@ struct virtio_crypto_op_ctrl_req {
247 mac_create_session;304 mac_create_session;
248 struct virtio_crypto_aead_create_session_req305 struct virtio_crypto_aead_create_session_req
249 aead_create_session;306 aead_create_session;
307 struct virtio_crypto_akcipher_create_session_req
308 akcipher_create_session;
250 struct virtio_crypto_destroy_session_req309 struct virtio_crypto_destroy_session_req
251 destroy_session;310 destroy_session;
252 __u8 padding[56];311 __u8 padding[56];
...@@ -266,6 +325,14 @@ struct virtio_crypto_op_header {...@@ -266,6 +325,14 @@ struct virtio_crypto_op_header {
266 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x00)325 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x00)
267#define VIRTIO_CRYPTO_AEAD_DECRYPT \326#define VIRTIO_CRYPTO_AEAD_DECRYPT \
268 VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x01)327 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)
269 __le32 opcode;336 __le32 opcode;
270 /* algo should be service-specific algorithms */337 /* algo should be service-specific algorithms */
271 __le32 algo;338 __le32 algo;
...@@ -390,6 +457,16 @@ struct virtio_crypto_aead_data_req {...@@ -390,6 +457,16 @@ struct virtio_crypto_aead_data_req {
390 __u8 padding[32];457 __u8 padding[32];
391};458};
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
393/* The request of the data virtqueue's packet */470/* The request of the data virtqueue's packet */
394struct virtio_crypto_op_data_req {471struct virtio_crypto_op_data_req {
395 struct virtio_crypto_op_header header;472 struct virtio_crypto_op_header header;
...@@ -399,6 +476,7 @@ struct virtio_crypto_op_data_req {...@@ -399,6 +476,7 @@ struct virtio_crypto_op_data_req {
399 struct virtio_crypto_hash_data_req hash_req;476 struct virtio_crypto_hash_data_req hash_req;
400 struct virtio_crypto_mac_data_req mac_req;477 struct virtio_crypto_mac_data_req mac_req;
401 struct virtio_crypto_aead_data_req aead_req;478 struct virtio_crypto_aead_data_req aead_req;
479 struct virtio_crypto_akcipher_data_req akcipher_req;
402 __u8 padding[48];480 __u8 padding[48];
403 } u;481 } u;
404};482};
...@@ -408,6 +486,8 @@ struct virtio_crypto_op_data_req {...@@ -408,6 +486,8 @@ struct virtio_crypto_op_data_req {
408#define VIRTIO_CRYPTO_BADMSG 2486#define VIRTIO_CRYPTO_BADMSG 2
409#define VIRTIO_CRYPTO_NOTSUPP 3487#define VIRTIO_CRYPTO_NOTSUPP 3
410#define VIRTIO_CRYPTO_INVSESS 4 /* Invalid session id */488#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
412/* The accelerator hardware is ready */492/* The accelerator hardware is ready */
413#define VIRTIO_CRYPTO_S_HW_READY (1 << 0)493#define VIRTIO_CRYPTO_S_HW_READY (1 << 0)
...@@ -438,7 +518,7 @@ struct virtio_crypto_config {...@@ -438,7 +518,7 @@ struct virtio_crypto_config {
438 __le32 max_cipher_key_len;518 __le32 max_cipher_key_len;
439 /* Maximum length of authenticated key */519 /* Maximum length of authenticated key */
440 __le32 max_auth_key_len;520 __le32 max_auth_key_len;
441 __le32 reserve;521 __le32 akcipher_algo;
442 /* Maximum size of each crypto request's content */522 /* Maximum size of each crypto request's content */
443 __le64 max_size;523 __le64 max_size;
444};524};
lib/libc/include/any-linux-any/linux/virtio_ids.h+7-7
...@@ -73,12 +73,12 @@...@@ -73,12 +73,12 @@
73 * Virtio Transitional IDs73 * Virtio Transitional IDs
74 */74 */
7575
76#define VIRTIO_TRANS_ID_NET 1000 /* transitional virtio net */76#define VIRTIO_TRANS_ID_NET 0x1000 /* transitional virtio net */
77#define VIRTIO_TRANS_ID_BLOCK 1001 /* transitional virtio block */77#define VIRTIO_TRANS_ID_BLOCK 0x1001 /* transitional virtio block */
78#define VIRTIO_TRANS_ID_BALLOON 1002 /* transitional virtio balloon */78#define VIRTIO_TRANS_ID_BALLOON 0x1002 /* transitional virtio balloon */
79#define VIRTIO_TRANS_ID_CONSOLE 1003 /* transitional virtio console */79#define VIRTIO_TRANS_ID_CONSOLE 0x1003 /* transitional virtio console */
80#define VIRTIO_TRANS_ID_SCSI 1004 /* transitional virtio SCSI */80#define VIRTIO_TRANS_ID_SCSI 0x1004 /* transitional virtio SCSI */
81#define VIRTIO_TRANS_ID_RNG 1005 /* transitional virtio rng */81#define VIRTIO_TRANS_ID_RNG 0x1005 /* transitional virtio rng */
82#define VIRTIO_TRANS_ID_9P 1009 /* transitional virtio 9p console */82#define VIRTIO_TRANS_ID_9P 0x1009 /* transitional virtio 9p console */
8383
84#endif /* _LINUX_VIRTIO_IDS_H */84#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 @@...@@ -16,6 +16,7 @@
16#define VIRTIO_IOMMU_F_BYPASS 316#define VIRTIO_IOMMU_F_BYPASS 3
17#define VIRTIO_IOMMU_F_PROBE 417#define VIRTIO_IOMMU_F_PROBE 4
18#define VIRTIO_IOMMU_F_MMIO 518#define VIRTIO_IOMMU_F_MMIO 5
19#define VIRTIO_IOMMU_F_BYPASS_CONFIG 6
1920
20struct virtio_iommu_range_64 {21struct virtio_iommu_range_64 {
21 __le64 start;22 __le64 start;
...@@ -36,6 +37,8 @@ struct virtio_iommu_config {...@@ -36,6 +37,8 @@ struct virtio_iommu_config {
36 struct virtio_iommu_range_32 domain_range;37 struct virtio_iommu_range_32 domain_range;
37 /* Probe buffer size */38 /* Probe buffer size */
38 __le32 probe_size;39 __le32 probe_size;
40 __u8 bypass;
41 __u8 reserved[3];
39};42};
4043
41/* Request types */44/* Request types */
...@@ -66,11 +69,14 @@ struct virtio_iommu_req_tail {...@@ -66,11 +69,14 @@ struct virtio_iommu_req_tail {
66 __u8 reserved[3];69 __u8 reserved[3];
67};70};
6871
72#define VIRTIO_IOMMU_ATTACH_F_BYPASS (1 << 0)
73
69struct virtio_iommu_req_attach {74struct virtio_iommu_req_attach {
70 struct virtio_iommu_req_head head;75 struct virtio_iommu_req_head head;
71 __le32 domain;76 __le32 domain;
72 __le32 endpoint;77 __le32 endpoint;
73 __u8 reserved[8];78 __le32 flags;
79 __u8 reserved[4];
74 struct virtio_iommu_req_tail tail;80 struct virtio_iommu_req_tail tail;
75};81};
7682
lib/libc/include/any-linux-any/linux/virtio_net.h+37-1
...@@ -56,7 +56,10 @@...@@ -56,7 +56,10 @@
56#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow56#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
57 * Steering */57 * Steering */
58#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */58#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
5959#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. */
60#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */63#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
61#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */64#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
62#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */65#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
...@@ -130,6 +133,7 @@ struct virtio_net_hdr_v1 {...@@ -130,6 +133,7 @@ struct virtio_net_hdr_v1 {
130#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */133#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */
131#define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */134#define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */
132#define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */135#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) */
133#define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */137#define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */
134 __u8 gso_type;138 __u8 gso_type;
135 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */139 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
...@@ -355,4 +359,36 @@ struct virtio_net_hash_config {...@@ -355,4 +359,36 @@ struct virtio_net_hash_config {
355#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5359#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
356#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0360#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
358#endif /* _LINUX_VIRTIO_NET_H */394#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 {...@@ -202,6 +202,8 @@ struct virtio_pci_cfg_cap {
202#define VIRTIO_PCI_COMMON_Q_AVAILHI 44202#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
203#define VIRTIO_PCI_COMMON_Q_USEDLO 48203#define VIRTIO_PCI_COMMON_Q_USEDLO 48
204#define VIRTIO_PCI_COMMON_Q_USEDHI 52204#define VIRTIO_PCI_COMMON_Q_USEDHI 52
205#define VIRTIO_PCI_COMMON_Q_NDATA 56
206#define VIRTIO_PCI_COMMON_Q_RESET 58
205207
206#endif /* VIRTIO_PCI_NO_MODERN */208#endif /* VIRTIO_PCI_NO_MODERN */
207209
lib/libc/include/any-linux-any/linux/virtio_ring.h+11-5
...@@ -91,15 +91,21 @@...@@ -91,15 +91,21 @@
91#define VRING_USED_ALIGN_SIZE 491#define VRING_USED_ALIGN_SIZE 4
92#define VRING_DESC_ALIGN_SIZE 1692#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 */
95struct vring_desc {105struct vring_desc {
96 /* Address (guest-physical). */
97 __virtio64 addr;106 __virtio64 addr;
98 /* Length. */
99 __virtio32 len;107 __virtio32 len;
100 /* The flags as indicated above. */
101 __virtio16 flags;108 __virtio16 flags;
102 /* We chain unused descriptors via this, too */
103 __virtio16 next;109 __virtio16 next;
104};110};
105111
lib/libc/include/any-linux-any/linux/xfrm.h+19-6
...@@ -33,7 +33,7 @@ struct xfrm_sec_ctx {...@@ -33,7 +33,7 @@ struct xfrm_sec_ctx {
33 __u8 ctx_alg;33 __u8 ctx_alg;
34 __u16 ctx_len;34 __u16 ctx_len;
35 __u32 ctx_sid;35 __u32 ctx_sid;
36 char ctx_str[0];36 char ctx_str[];
37};37};
3838
39/* Security Context Domains of Interpretation */39/* Security Context Domains of Interpretation */
...@@ -96,27 +96,27 @@ struct xfrm_replay_state_esn {...@@ -96,27 +96,27 @@ struct xfrm_replay_state_esn {
96 __u32 oseq_hi;96 __u32 oseq_hi;
97 __u32 seq_hi;97 __u32 seq_hi;
98 __u32 replay_window;98 __u32 replay_window;
99 __u32 bmp[0];99 __u32 bmp[];
100};100};
101101
102struct xfrm_algo {102struct xfrm_algo {
103 char alg_name[64];103 char alg_name[64];
104 unsigned int alg_key_len; /* in bits */104 unsigned int alg_key_len; /* in bits */
105 char alg_key[0];105 char alg_key[];
106};106};
107107
108struct xfrm_algo_auth {108struct xfrm_algo_auth {
109 char alg_name[64];109 char alg_name[64];
110 unsigned int alg_key_len; /* in bits */110 unsigned int alg_key_len; /* in bits */
111 unsigned int alg_trunc_len; /* in bits */111 unsigned int alg_trunc_len; /* in bits */
112 char alg_key[0];112 char alg_key[];
113};113};
114114
115struct xfrm_algo_aead {115struct xfrm_algo_aead {
116 char alg_name[64];116 char alg_name[64];
117 unsigned int alg_key_len; /* in bits */117 unsigned int alg_key_len; /* in bits */
118 unsigned int alg_icv_len; /* in bits */118 unsigned int alg_icv_len; /* in bits */
119 char alg_key[0];119 char alg_key[];
120};120};
121121
122struct xfrm_stats {122struct xfrm_stats {
...@@ -296,7 +296,7 @@ enum xfrm_attr_type_t {...@@ -296,7 +296,7 @@ enum xfrm_attr_type_t {
296 XFRMA_ETIMER_THRESH,296 XFRMA_ETIMER_THRESH,
297 XFRMA_SRCADDR, /* xfrm_address_t */297 XFRMA_SRCADDR, /* xfrm_address_t */
298 XFRMA_COADDR, /* xfrm_address_t */298 XFRMA_COADDR, /* xfrm_address_t */
299 XFRMA_LASTUSED, /* unsigned long */299 XFRMA_LASTUSED, /* __u64 */
300 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */300 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
301 XFRMA_MIGRATE,301 XFRMA_MIGRATE,
302 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */302 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
...@@ -313,6 +313,7 @@ enum xfrm_attr_type_t {...@@ -313,6 +313,7 @@ enum xfrm_attr_type_t {
313 XFRMA_SET_MARK, /* __u32 */313 XFRMA_SET_MARK, /* __u32 */
314 XFRMA_SET_MARK_MASK, /* __u32 */314 XFRMA_SET_MARK_MASK, /* __u32 */
315 XFRMA_IF_ID, /* __u32 */315 XFRMA_IF_ID, /* __u32 */
316 XFRMA_MTIMER_THRESH, /* __u32 in seconds for input SA */
316 __XFRMA_MAX317 __XFRMA_MAX
317318
318#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */319#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */
...@@ -510,8 +511,20 @@ struct xfrm_user_offload {...@@ -510,8 +511,20 @@ struct xfrm_user_offload {
510 int ifindex;511 int ifindex;
511 __u8 flags;512 __u8 flags;
512};513};
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 */
513#define XFRM_OFFLOAD_IPV6 1520#define XFRM_OFFLOAD_IPV6 1
514#define XFRM_OFFLOAD_INBOUND 2521#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
516struct xfrm_userpolicy_default {529struct xfrm_userpolicy_default {
517#define XFRM_USERPOLICY_UNSPEC 0530#define XFRM_USERPOLICY_UNSPEC 0
lib/libc/include/any-linux-any/misc/fastrpc.h+87-1
...@@ -13,12 +13,65 @@...@@ -13,12 +13,65 @@
13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
15#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)15#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
17struct fastrpc_invoke_args {70struct fastrpc_invoke_args {
18 __u64 ptr;71 __u64 ptr;
19 __u64 length;72 __u64 length;
20 __s32 fd;73 __s32 fd;
21 __u32 reserved;74 __u32 attr;
22};75};
2376
24struct fastrpc_invoke {77struct fastrpc_invoke {
...@@ -35,6 +88,12 @@ struct fastrpc_init_create {...@@ -35,6 +88,12 @@ struct fastrpc_init_create {
35 __u64 file; /* pointer to elf file */88 __u64 file; /* pointer to elf file */
36};89};
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
38struct fastrpc_alloc_dma_buf {97struct fastrpc_alloc_dma_buf {
39 __s32 fd; /* fd */98 __s32 fd; /* fd */
40 __u32 flags; /* flags to map with */99 __u32 flags; /* flags to map with */
...@@ -49,9 +108,36 @@ struct fastrpc_req_mmap {...@@ -49,9 +108,36 @@ struct fastrpc_req_mmap {
49 __u64 vaddrout; /* dsp virtual address */108 __u64 vaddrout; /* dsp virtual address */
50};109};
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
52struct fastrpc_req_munmap {123struct fastrpc_req_munmap {
53 __u64 vaddrout; /* address to unmap */124 __u64 vaddrout; /* address to unmap */
54 __u64 size; /* size */125 __u64 size; /* size */
55};126};
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
57#endif /* __QCOM_FASTRPC_H__ */143#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 {...@@ -14,11 +14,26 @@ struct hisi_qp_ctx {
14 __u16 qc_type;14 __u16 qc_type;
15};15};
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
17#define HISI_QM_API_VER_BASE "hisi_qm_v1"31#define HISI_QM_API_VER_BASE "hisi_qm_v1"
18#define HISI_QM_API_VER2_BASE "hisi_qm_v2"32#define HISI_QM_API_VER2_BASE "hisi_qm_v2"
19#define HISI_QM_API_VER3_BASE "hisi_qm_v3"33#define HISI_QM_API_VER3_BASE "hisi_qm_v3"
2034
21/* UACCE_CMD_QM_SET_QP_CTX: Set qp algorithm type */35/* UACCE_CMD_QM_SET_QP_CTX: Set qp algorithm type */
22#define UACCE_CMD_QM_SET_QP_CTX _IOWR('H', 10, struct hisi_qp_ctx)36#define UACCE_CMD_QM_SET_QP_CTX _IOWR('H', 10, struct hisi_qp_ctx)
2337/* 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)
24#endif39#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 {...@@ -55,9 +55,9 @@ struct mtd_oob_buf64 {
55 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;55 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
56 * this mode implies %MTD_OPS_PLACE_OOB56 * this mode implies %MTD_OPS_PLACE_OOB
57 *57 *
58 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.58 * These modes can be passed to ioctl(MEMWRITE) and ioctl(MEMREAD); they are
59 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.59 * also used internally. See notes on "MTD file modes" for discussion on
60 * %MTD_FILE_MODE_RAW.60 * %MTD_OPS_RAW vs. %MTD_FILE_MODE_RAW.
61 */61 */
62enum {62enum {
63 MTD_OPS_PLACE_OOB = 0,63 MTD_OPS_PLACE_OOB = 0,
...@@ -69,8 +69,8 @@ enum {...@@ -69,8 +69,8 @@ enum {
69 * struct mtd_write_req - data structure for requesting a write operation69 * struct mtd_write_req - data structure for requesting a write operation
70 *70 *
71 * @start: start address71 * @start: start address
72 * @len: length of data buffer72 * @len: length of data buffer (only lower 32 bits are used)
73 * @ooblen: length of OOB buffer73 * @ooblen: length of OOB buffer (only lower 32 bits are used)
74 * @usr_data: user-provided data buffer74 * @usr_data: user-provided data buffer
75 * @usr_oob: user-provided OOB buffer75 * @usr_oob: user-provided OOB buffer
76 * @mode: MTD mode (see "MTD operation modes")76 * @mode: MTD mode (see "MTD operation modes")
...@@ -91,6 +91,53 @@ struct mtd_write_req {...@@ -91,6 +91,53 @@ struct mtd_write_req {
91 __u8 padding[7];91 __u8 padding[7];
92};92};
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
94#define MTD_ABSENT 0141#define MTD_ABSENT 0
95#define MTD_RAM 1142#define MTD_RAM 1
96#define MTD_ROM 2143#define MTD_ROM 2
...@@ -207,6 +254,12 @@ struct otp_info {...@@ -207,6 +254,12 @@ struct otp_info {
207#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)254#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
208/* Erase a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */255/* Erase a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
209#define OTPERASE _IOW('M', 25, struct otp_info)256#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
211/*264/*
212 * Obsolete legacy interface. Keep it in order not to break userspace265 * Obsolete legacy interface. Keep it in order not to break userspace
...@@ -270,8 +323,9 @@ struct mtd_ecc_stats {...@@ -270,8 +323,9 @@ struct mtd_ecc_stats {
270 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -323 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
271 * raw access to the flash, without error correction or autoplacement schemes.324 * raw access to the flash, without error correction or autoplacement schemes.
272 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode325 * 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 is326 * (e.g., when using ioctl(MEMWRITE) or ioctl(MEMREAD)), but in some cases, the
274 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).327 * MTD_FILE_MODE is used out of necessity (e.g., `write()',
328 * ioctl(MEMWRITEOOB64)).
275 */329 */
276enum mtd_file_modes {330enum mtd_file_modes {
277 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,331 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
lib/libc/include/any-linux-any/mtd/ubi-user.h+7-1
...@@ -247,6 +247,7 @@ enum {...@@ -247,6 +247,7 @@ enum {
247 * @vid_hdr_offset: VID header offset (use defaults if %0)247 * @vid_hdr_offset: VID header offset (use defaults if %0)
248 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs248 * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
249 * @padding: reserved for future, not used, has to be zeroed249 * @padding: reserved for future, not used, has to be zeroed
250 * @disable_fm: whether disable fastmap
250 *251 *
251 * This data structure is used to specify MTD device UBI has to attach and the252 * This data structure is used to specify MTD device UBI has to attach and the
252 * parameters it has to use. The number which should be assigned to the new UBI253 * parameters it has to use. The number which should be assigned to the new UBI
...@@ -281,13 +282,18 @@ enum {...@@ -281,13 +282,18 @@ enum {
281 * eraseblocks for new bad eraseblocks, but attempts to use available282 * eraseblocks for new bad eraseblocks, but attempts to use available
282 * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the283 * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the
283 * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used.284 * 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.
284 */289 */
285struct ubi_attach_req {290struct ubi_attach_req {
286 __s32 ubi_num;291 __s32 ubi_num;
287 __s32 mtd_num;292 __s32 mtd_num;
288 __s32 vid_hdr_offset;293 __s32 vid_hdr_offset;
289 __s16 max_beb_per1024;294 __s16 max_beb_per1024;
290 __s8 padding[10];295 __s8 disable_fm;
296 __s8 padding[9];
291};297};
292298
293/*299/*
lib/libc/include/any-linux-any/rdma/efa-abi.h+3-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*2/*
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.
4 */4 */
55
6#ifndef EFA_ABI_USER_H6#ifndef EFA_ABI_USER_H
...@@ -54,6 +54,7 @@ struct efa_ibv_alloc_pd_resp {...@@ -54,6 +54,7 @@ struct efa_ibv_alloc_pd_resp {
5454
55enum {55enum {
56 EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,56 EFA_CREATE_CQ_WITH_COMPLETION_CHANNEL = 1 << 0,
57 EFA_CREATE_CQ_WITH_SGID = 1 << 1,
57};58};
5859
59struct efa_ibv_create_cq {60struct efa_ibv_create_cq {
...@@ -118,6 +119,7 @@ enum {...@@ -118,6 +119,7 @@ enum {
118 EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,119 EFA_QUERY_DEVICE_CAPS_RDMA_READ = 1 << 0,
119 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,120 EFA_QUERY_DEVICE_CAPS_RNR_RETRY = 1 << 1,
120 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,121 EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
122 EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
121};123};
122124
123struct efa_ibv_ex_query_device_resp {125struct 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 {...@@ -180,7 +180,7 @@ struct hfi1_sdma_comp_entry {
180struct hfi1_status {180struct hfi1_status {
181 __aligned_u64 dev; /* device/hw status bits */181 __aligned_u64 dev; /* device/hw status bits */
182 __aligned_u64 port; /* port state and status bits */182 __aligned_u64 port; /* port state and status bits */
183 char freezemsg[0];183 char freezemsg[];
184};184};
185185
186enum sdma_req_opcode {186enum sdma_req_opcode {
lib/libc/include/any-linux-any/rdma/hns-abi.h+21
...@@ -77,10 +77,24 @@ enum hns_roce_qp_cap_flags {...@@ -77,10 +77,24 @@ enum hns_roce_qp_cap_flags {
77 HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,77 HNS_ROCE_QP_CAP_RQ_RECORD_DB = 1 << 0,
78 HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,78 HNS_ROCE_QP_CAP_SQ_RECORD_DB = 1 << 1,
79 HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,79 HNS_ROCE_QP_CAP_OWNER_DB = 1 << 2,
80 HNS_ROCE_QP_CAP_DIRECT_WQE = 1 << 5,
80};81};
8182
82struct hns_roce_ib_create_qp_resp {83struct hns_roce_ib_create_qp_resp {
83 __aligned_u64 cap_flags;84 __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,
84};98};
8599
86struct hns_roce_ib_alloc_ucontext_resp {100struct hns_roce_ib_alloc_ucontext_resp {
...@@ -88,6 +102,13 @@ struct hns_roce_ib_alloc_ucontext_resp {...@@ -88,6 +102,13 @@ struct hns_roce_ib_alloc_ucontext_resp {
88 __u32 cqe_size;102 __u32 cqe_size;
89 __u32 srq_tab_size;103 __u32 srq_tab_size;
90 __u32 reserved;104 __u32 reserved;
105 __u32 config;
106 __u32 max_inline_data;
107};
108
109struct hns_roce_ib_alloc_ucontext {
110 __u32 config;
111 __u32 reserved;
91};112};
92113
93struct hns_roce_ib_alloc_pd_resp {114struct 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 {...@@ -57,6 +57,8 @@ enum ib_uverbs_access_flags {
57 IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,57 IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
58 IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,58 IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
59 IB_UVERBS_ACCESS_HUGETLB = 1 << 7,59 IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
60 IB_UVERBS_ACCESS_FLUSH_GLOBAL = 1 << 8,
61 IB_UVERBS_ACCESS_FLUSH_PERSISTENT = 1 << 9,
6062
61 IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,63 IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST,
62 IB_UVERBS_ACCESS_OPTIONAL_RANGE =64 IB_UVERBS_ACCESS_OPTIONAL_RANGE =
...@@ -250,6 +252,8 @@ enum rdma_driver_id {...@@ -250,6 +252,8 @@ enum rdma_driver_id {
250 RDMA_DRIVER_QIB,252 RDMA_DRIVER_QIB,
251 RDMA_DRIVER_EFA,253 RDMA_DRIVER_EFA,
252 RDMA_DRIVER_SIW,254 RDMA_DRIVER_SIW,
255 RDMA_DRIVER_ERDMA,
256 RDMA_DRIVER_MANA,
253};257};
254258
255enum ib_uverbs_gid_type {259enum ib_uverbs_gid_type {
lib/libc/include/any-linux-any/rdma/ib_user_verbs.h+99-36
...@@ -105,6 +105,18 @@ enum {...@@ -105,6 +105,18 @@ enum {
105 IB_USER_VERBS_EX_CMD_MODIFY_CQ105 IB_USER_VERBS_EX_CMD_MODIFY_CQ
106};106};
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
108/*120/*
109 * Make sure that all structs defined in this file remain laid out so121 * Make sure that all structs defined in this file remain laid out so
110 * that they pack the same way on 32-bit and 64-bit architectures (to122 * that they pack the same way on 32-bit and 64-bit architectures (to
...@@ -158,18 +170,18 @@ struct ib_uverbs_ex_cmd_hdr {...@@ -158,18 +170,18 @@ struct ib_uverbs_ex_cmd_hdr {
158170
159struct ib_uverbs_get_context {171struct ib_uverbs_get_context {
160 __aligned_u64 response;172 __aligned_u64 response;
161 __aligned_u64 driver_data[0];173 __aligned_u64 driver_data[];
162};174};
163175
164struct ib_uverbs_get_context_resp {176struct ib_uverbs_get_context_resp {
165 __u32 async_fd;177 __u32 async_fd;
166 __u32 num_comp_vectors;178 __u32 num_comp_vectors;
167 __aligned_u64 driver_data[0];179 __aligned_u64 driver_data[];
168};180};
169181
170struct ib_uverbs_query_device {182struct ib_uverbs_query_device {
171 __aligned_u64 response;183 __aligned_u64 response;
172 __aligned_u64 driver_data[0];184 __aligned_u64 driver_data[];
173};185};
174186
175struct ib_uverbs_query_device_resp {187struct ib_uverbs_query_device_resp {
...@@ -278,7 +290,7 @@ struct ib_uverbs_query_port {...@@ -278,7 +290,7 @@ struct ib_uverbs_query_port {
278 __aligned_u64 response;290 __aligned_u64 response;
279 __u8 port_num;291 __u8 port_num;
280 __u8 reserved[7];292 __u8 reserved[7];
281 __aligned_u64 driver_data[0];293 __aligned_u64 driver_data[];
282};294};
283295
284struct ib_uverbs_query_port_resp {296struct ib_uverbs_query_port_resp {
...@@ -308,12 +320,12 @@ struct ib_uverbs_query_port_resp {...@@ -308,12 +320,12 @@ struct ib_uverbs_query_port_resp {
308320
309struct ib_uverbs_alloc_pd {321struct ib_uverbs_alloc_pd {
310 __aligned_u64 response;322 __aligned_u64 response;
311 __aligned_u64 driver_data[0];323 __aligned_u64 driver_data[];
312};324};
313325
314struct ib_uverbs_alloc_pd_resp {326struct ib_uverbs_alloc_pd_resp {
315 __u32 pd_handle;327 __u32 pd_handle;
316 __u32 driver_data[0];328 __u32 driver_data[];
317};329};
318330
319struct ib_uverbs_dealloc_pd {331struct ib_uverbs_dealloc_pd {
...@@ -324,12 +336,12 @@ struct ib_uverbs_open_xrcd {...@@ -324,12 +336,12 @@ struct ib_uverbs_open_xrcd {
324 __aligned_u64 response;336 __aligned_u64 response;
325 __u32 fd;337 __u32 fd;
326 __u32 oflags;338 __u32 oflags;
327 __aligned_u64 driver_data[0];339 __aligned_u64 driver_data[];
328};340};
329341
330struct ib_uverbs_open_xrcd_resp {342struct ib_uverbs_open_xrcd_resp {
331 __u32 xrcd_handle;343 __u32 xrcd_handle;
332 __u32 driver_data[0];344 __u32 driver_data[];
333};345};
334346
335struct ib_uverbs_close_xrcd {347struct ib_uverbs_close_xrcd {
...@@ -343,14 +355,14 @@ struct ib_uverbs_reg_mr {...@@ -343,14 +355,14 @@ struct ib_uverbs_reg_mr {
343 __aligned_u64 hca_va;355 __aligned_u64 hca_va;
344 __u32 pd_handle;356 __u32 pd_handle;
345 __u32 access_flags;357 __u32 access_flags;
346 __aligned_u64 driver_data[0];358 __aligned_u64 driver_data[];
347};359};
348360
349struct ib_uverbs_reg_mr_resp {361struct ib_uverbs_reg_mr_resp {
350 __u32 mr_handle;362 __u32 mr_handle;
351 __u32 lkey;363 __u32 lkey;
352 __u32 rkey;364 __u32 rkey;
353 __u32 driver_data[0];365 __u32 driver_data[];
354};366};
355367
356struct ib_uverbs_rereg_mr {368struct ib_uverbs_rereg_mr {
...@@ -362,13 +374,13 @@ struct ib_uverbs_rereg_mr {...@@ -362,13 +374,13 @@ struct ib_uverbs_rereg_mr {
362 __aligned_u64 hca_va;374 __aligned_u64 hca_va;
363 __u32 pd_handle;375 __u32 pd_handle;
364 __u32 access_flags;376 __u32 access_flags;
365 __aligned_u64 driver_data[0];377 __aligned_u64 driver_data[];
366};378};
367379
368struct ib_uverbs_rereg_mr_resp {380struct ib_uverbs_rereg_mr_resp {
369 __u32 lkey;381 __u32 lkey;
370 __u32 rkey;382 __u32 rkey;
371 __aligned_u64 driver_data[0];383 __aligned_u64 driver_data[];
372};384};
373385
374struct ib_uverbs_dereg_mr {386struct ib_uverbs_dereg_mr {
...@@ -380,13 +392,13 @@ struct ib_uverbs_alloc_mw {...@@ -380,13 +392,13 @@ struct ib_uverbs_alloc_mw {
380 __u32 pd_handle;392 __u32 pd_handle;
381 __u8 mw_type;393 __u8 mw_type;
382 __u8 reserved[3];394 __u8 reserved[3];
383 __aligned_u64 driver_data[0];395 __aligned_u64 driver_data[];
384};396};
385397
386struct ib_uverbs_alloc_mw_resp {398struct ib_uverbs_alloc_mw_resp {
387 __u32 mw_handle;399 __u32 mw_handle;
388 __u32 rkey;400 __u32 rkey;
389 __aligned_u64 driver_data[0];401 __aligned_u64 driver_data[];
390};402};
391403
392struct ib_uverbs_dealloc_mw {404struct ib_uverbs_dealloc_mw {
...@@ -408,7 +420,7 @@ struct ib_uverbs_create_cq {...@@ -408,7 +420,7 @@ struct ib_uverbs_create_cq {
408 __u32 comp_vector;420 __u32 comp_vector;
409 __s32 comp_channel;421 __s32 comp_channel;
410 __u32 reserved;422 __u32 reserved;
411 __aligned_u64 driver_data[0];423 __aligned_u64 driver_data[];
412};424};
413425
414enum ib_uverbs_ex_create_cq_flags {426enum ib_uverbs_ex_create_cq_flags {
...@@ -442,13 +454,13 @@ struct ib_uverbs_resize_cq {...@@ -442,13 +454,13 @@ struct ib_uverbs_resize_cq {
442 __aligned_u64 response;454 __aligned_u64 response;
443 __u32 cq_handle;455 __u32 cq_handle;
444 __u32 cqe;456 __u32 cqe;
445 __aligned_u64 driver_data[0];457 __aligned_u64 driver_data[];
446};458};
447459
448struct ib_uverbs_resize_cq_resp {460struct ib_uverbs_resize_cq_resp {
449 __u32 cqe;461 __u32 cqe;
450 __u32 reserved;462 __u32 reserved;
451 __aligned_u64 driver_data[0];463 __aligned_u64 driver_data[];
452};464};
453465
454struct ib_uverbs_poll_cq {466struct ib_uverbs_poll_cq {
...@@ -466,6 +478,8 @@ enum ib_uverbs_wc_opcode {...@@ -466,6 +478,8 @@ enum ib_uverbs_wc_opcode {
466 IB_UVERBS_WC_BIND_MW = 5,478 IB_UVERBS_WC_BIND_MW = 5,
467 IB_UVERBS_WC_LOCAL_INV = 6,479 IB_UVERBS_WC_LOCAL_INV = 6,
468 IB_UVERBS_WC_TSO = 7,480 IB_UVERBS_WC_TSO = 7,
481 IB_UVERBS_WC_FLUSH = 8,
482 IB_UVERBS_WC_ATOMIC_WRITE = 9,
469};483};
470484
471struct ib_uverbs_wc {485struct ib_uverbs_wc {
...@@ -492,7 +506,7 @@ struct ib_uverbs_wc {...@@ -492,7 +506,7 @@ struct ib_uverbs_wc {
492struct ib_uverbs_poll_cq_resp {506struct ib_uverbs_poll_cq_resp {
493 __u32 count;507 __u32 count;
494 __u32 reserved;508 __u32 reserved;
495 struct ib_uverbs_wc wc[0];509 struct ib_uverbs_wc wc[];
496};510};
497511
498struct ib_uverbs_req_notify_cq {512struct ib_uverbs_req_notify_cq {
...@@ -585,7 +599,7 @@ struct ib_uverbs_create_qp {...@@ -585,7 +599,7 @@ struct ib_uverbs_create_qp {
585 __u8 qp_type;599 __u8 qp_type;
586 __u8 is_srq;600 __u8 is_srq;
587 __u8 reserved;601 __u8 reserved;
588 __aligned_u64 driver_data[0];602 __aligned_u64 driver_data[];
589};603};
590604
591enum ib_uverbs_create_qp_mask {605enum ib_uverbs_create_qp_mask {
...@@ -624,7 +638,7 @@ struct ib_uverbs_open_qp {...@@ -624,7 +638,7 @@ struct ib_uverbs_open_qp {
624 __u32 qpn;638 __u32 qpn;
625 __u8 qp_type;639 __u8 qp_type;
626 __u8 reserved[7];640 __u8 reserved[7];
627 __aligned_u64 driver_data[0];641 __aligned_u64 driver_data[];
628};642};
629643
630/* also used for open response */644/* also used for open response */
...@@ -669,7 +683,7 @@ struct ib_uverbs_query_qp {...@@ -669,7 +683,7 @@ struct ib_uverbs_query_qp {
669 __aligned_u64 response;683 __aligned_u64 response;
670 __u32 qp_handle;684 __u32 qp_handle;
671 __u32 attr_mask;685 __u32 attr_mask;
672 __aligned_u64 driver_data[0];686 __aligned_u64 driver_data[];
673};687};
674688
675struct ib_uverbs_query_qp_resp {689struct ib_uverbs_query_qp_resp {
...@@ -703,7 +717,7 @@ struct ib_uverbs_query_qp_resp {...@@ -703,7 +717,7 @@ struct ib_uverbs_query_qp_resp {
703 __u8 alt_timeout;717 __u8 alt_timeout;
704 __u8 sq_sig_all;718 __u8 sq_sig_all;
705 __u8 reserved[5];719 __u8 reserved[5];
706 __aligned_u64 driver_data[0];720 __aligned_u64 driver_data[];
707};721};
708722
709struct ib_uverbs_modify_qp {723struct ib_uverbs_modify_qp {
...@@ -784,6 +798,8 @@ enum ib_uverbs_wr_opcode {...@@ -784,6 +798,8 @@ enum ib_uverbs_wr_opcode {
784 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,798 IB_UVERBS_WR_RDMA_READ_WITH_INV = 11,
785 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,799 IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12,
786 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,800 IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13,
801 IB_UVERBS_WR_FLUSH = 14,
802 IB_UVERBS_WR_ATOMIC_WRITE = 15,
787 /* Review enum ib_wr_opcode before modifying this */803 /* Review enum ib_wr_opcode before modifying this */
788};804};
789805
...@@ -824,7 +840,7 @@ struct ib_uverbs_post_send {...@@ -824,7 +840,7 @@ struct ib_uverbs_post_send {
824 __u32 wr_count;840 __u32 wr_count;
825 __u32 sge_count;841 __u32 sge_count;
826 __u32 wqe_size;842 __u32 wqe_size;
827 struct ib_uverbs_send_wr send_wr[0];843 struct ib_uverbs_send_wr send_wr[];
828};844};
829845
830struct ib_uverbs_post_send_resp {846struct ib_uverbs_post_send_resp {
...@@ -843,7 +859,7 @@ struct ib_uverbs_post_recv {...@@ -843,7 +859,7 @@ struct ib_uverbs_post_recv {
843 __u32 wr_count;859 __u32 wr_count;
844 __u32 sge_count;860 __u32 sge_count;
845 __u32 wqe_size;861 __u32 wqe_size;
846 struct ib_uverbs_recv_wr recv_wr[0];862 struct ib_uverbs_recv_wr recv_wr[];
847};863};
848864
849struct ib_uverbs_post_recv_resp {865struct ib_uverbs_post_recv_resp {
...@@ -856,7 +872,7 @@ struct ib_uverbs_post_srq_recv {...@@ -856,7 +872,7 @@ struct ib_uverbs_post_srq_recv {
856 __u32 wr_count;872 __u32 wr_count;
857 __u32 sge_count;873 __u32 sge_count;
858 __u32 wqe_size;874 __u32 wqe_size;
859 struct ib_uverbs_recv_wr recv[0];875 struct ib_uverbs_recv_wr recv[];
860};876};
861877
862struct ib_uverbs_post_srq_recv_resp {878struct ib_uverbs_post_srq_recv_resp {
...@@ -869,12 +885,12 @@ struct ib_uverbs_create_ah {...@@ -869,12 +885,12 @@ struct ib_uverbs_create_ah {
869 __u32 pd_handle;885 __u32 pd_handle;
870 __u32 reserved;886 __u32 reserved;
871 struct ib_uverbs_ah_attr attr;887 struct ib_uverbs_ah_attr attr;
872 __aligned_u64 driver_data[0];888 __aligned_u64 driver_data[];
873};889};
874890
875struct ib_uverbs_create_ah_resp {891struct ib_uverbs_create_ah_resp {
876 __u32 ah_handle;892 __u32 ah_handle;
877 __u32 driver_data[0];893 __u32 driver_data[];
878};894};
879895
880struct ib_uverbs_destroy_ah {896struct ib_uverbs_destroy_ah {
...@@ -886,7 +902,7 @@ struct ib_uverbs_attach_mcast {...@@ -886,7 +902,7 @@ struct ib_uverbs_attach_mcast {
886 __u32 qp_handle;902 __u32 qp_handle;
887 __u16 mlid;903 __u16 mlid;
888 __u16 reserved;904 __u16 reserved;
889 __aligned_u64 driver_data[0];905 __aligned_u64 driver_data[];
890};906};
891907
892struct ib_uverbs_detach_mcast {908struct ib_uverbs_detach_mcast {
...@@ -894,7 +910,7 @@ struct ib_uverbs_detach_mcast {...@@ -894,7 +910,7 @@ struct ib_uverbs_detach_mcast {
894 __u32 qp_handle;910 __u32 qp_handle;
895 __u16 mlid;911 __u16 mlid;
896 __u16 reserved;912 __u16 reserved;
897 __aligned_u64 driver_data[0];913 __aligned_u64 driver_data[];
898};914};
899915
900struct ib_uverbs_flow_spec_hdr {916struct ib_uverbs_flow_spec_hdr {
...@@ -1135,7 +1151,7 @@ struct ib_uverbs_flow_attr {...@@ -1135,7 +1151,7 @@ struct ib_uverbs_flow_attr {
1135 * struct ib_flow_spec_xxx1151 * struct ib_flow_spec_xxx
1136 * struct ib_flow_spec_yyy1152 * struct ib_flow_spec_yyy
1137 */1153 */
1138 struct ib_uverbs_flow_spec_hdr flow_specs[0];1154 struct ib_uverbs_flow_spec_hdr flow_specs[];
1139};1155};
11401156
1141struct ib_uverbs_create_flow {1157struct ib_uverbs_create_flow {
...@@ -1161,7 +1177,7 @@ struct ib_uverbs_create_srq {...@@ -1161,7 +1177,7 @@ struct ib_uverbs_create_srq {
1161 __u32 max_wr;1177 __u32 max_wr;
1162 __u32 max_sge;1178 __u32 max_sge;
1163 __u32 srq_limit;1179 __u32 srq_limit;
1164 __aligned_u64 driver_data[0];1180 __aligned_u64 driver_data[];
1165};1181};
11661182
1167struct ib_uverbs_create_xsrq {1183struct ib_uverbs_create_xsrq {
...@@ -1175,7 +1191,7 @@ struct ib_uverbs_create_xsrq {...@@ -1175,7 +1191,7 @@ struct ib_uverbs_create_xsrq {
1175 __u32 max_num_tags;1191 __u32 max_num_tags;
1176 __u32 xrcd_handle;1192 __u32 xrcd_handle;
1177 __u32 cq_handle;1193 __u32 cq_handle;
1178 __aligned_u64 driver_data[0];1194 __aligned_u64 driver_data[];
1179};1195};
11801196
1181struct ib_uverbs_create_srq_resp {1197struct ib_uverbs_create_srq_resp {
...@@ -1183,7 +1199,7 @@ struct ib_uverbs_create_srq_resp {...@@ -1183,7 +1199,7 @@ struct ib_uverbs_create_srq_resp {
1183 __u32 max_wr;1199 __u32 max_wr;
1184 __u32 max_sge;1200 __u32 max_sge;
1185 __u32 srqn;1201 __u32 srqn;
1186 __u32 driver_data[0];1202 __u32 driver_data[];
1187};1203};
11881204
1189struct ib_uverbs_modify_srq {1205struct ib_uverbs_modify_srq {
...@@ -1191,14 +1207,14 @@ struct ib_uverbs_modify_srq {...@@ -1191,14 +1207,14 @@ struct ib_uverbs_modify_srq {
1191 __u32 attr_mask;1207 __u32 attr_mask;
1192 __u32 max_wr;1208 __u32 max_wr;
1193 __u32 srq_limit;1209 __u32 srq_limit;
1194 __aligned_u64 driver_data[0];1210 __aligned_u64 driver_data[];
1195};1211};
11961212
1197struct ib_uverbs_query_srq {1213struct ib_uverbs_query_srq {
1198 __aligned_u64 response;1214 __aligned_u64 response;
1199 __u32 srq_handle;1215 __u32 srq_handle;
1200 __u32 reserved;1216 __u32 reserved;
1201 __aligned_u64 driver_data[0];1217 __aligned_u64 driver_data[];
1202};1218};
12031219
1204struct ib_uverbs_query_srq_resp {1220struct ib_uverbs_query_srq_resp {
...@@ -1269,7 +1285,7 @@ struct ib_uverbs_ex_create_rwq_ind_table {...@@ -1269,7 +1285,7 @@ struct ib_uverbs_ex_create_rwq_ind_table {
1269 * wq_handle11285 * wq_handle1
1270 * wq_handle21286 * wq_handle2
1271 */1287 */
1272 __u32 wq_handles[0];1288 __u32 wq_handles[];
1273};1289};
12741290
1275struct ib_uverbs_ex_create_rwq_ind_table_resp {1291struct ib_uverbs_ex_create_rwq_ind_table_resp {
...@@ -1298,4 +1314,51 @@ struct ib_uverbs_ex_modify_cq {...@@ -1298,4 +1314,51 @@ struct ib_uverbs_ex_modify_cq {
12981314
1299#define IB_DEVICE_NAME_MAX 641315#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
1301#endif /* IB_USER_VERBS_H */1364#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 {...@@ -104,6 +104,7 @@ enum mlx5_ib_alloc_ucontext_resp_mask {
104 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2,104 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_ECE = 1UL << 2,
105 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS = 1UL << 3,105 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_SQD2RTS = 1UL << 3,
106 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS = 1UL << 4,106 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_REAL_TIME_TS = 1UL << 4,
107 MLX5_IB_ALLOC_UCONTEXT_RESP_MASK_MKEY_UPDATE_TAG = 1UL << 5,
107};108};
108109
109enum mlx5_user_cmds_supp_uhw {110enum 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 {...@@ -174,6 +174,7 @@ enum mlx5_ib_devx_umem_reg_attrs {
174 MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,174 MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
175 MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,175 MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
176 MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP,176 MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP,
177 MLX5_IB_ATTR_DEVX_UMEM_REG_DMABUF_FD,
177};178};
178179
179enum mlx5_ib_devx_umem_dereg_attrs {180enum mlx5_ib_devx_umem_dereg_attrs {
...@@ -228,6 +229,7 @@ enum mlx5_ib_objects {...@@ -228,6 +229,7 @@ enum mlx5_ib_objects {
228 MLX5_IB_OBJECT_VAR,229 MLX5_IB_OBJECT_VAR,
229 MLX5_IB_OBJECT_PP,230 MLX5_IB_OBJECT_PP,
230 MLX5_IB_OBJECT_UAR,231 MLX5_IB_OBJECT_UAR,
232 MLX5_IB_OBJECT_STEERING_ANCHOR,
231};233};
232234
233enum mlx5_ib_flow_matcher_create_attrs {235enum mlx5_ib_flow_matcher_create_attrs {
...@@ -248,11 +250,27 @@ enum mlx5_ib_flow_matcher_methods {...@@ -248,11 +250,27 @@ enum mlx5_ib_flow_matcher_methods {
248 MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,250 MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
249};251};
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
251enum mlx5_ib_device_query_context_attrs {269enum mlx5_ib_device_query_context_attrs {
252 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),270 MLX5_IB_ATTR_QUERY_CONTEXT_RESP_UCTX = (1U << UVERBS_ID_NS_SHIFT),
253};271};
254272
255#define MLX5_IB_DW_MATCH_PARAM 0x90273#define MLX5_IB_DW_MATCH_PARAM 0xA0
256274
257struct mlx5_ib_match_params {275struct mlx5_ib_match_params {
258 __u32 match_params[MLX5_IB_DW_MATCH_PARAM];276 __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 {...@@ -63,6 +63,7 @@ enum mlx5_ib_uapi_dm_type {
63 MLX5_IB_UAPI_DM_TYPE_MEMIC,63 MLX5_IB_UAPI_DM_TYPE_MEMIC,
64 MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM,64 MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM,
65 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM,65 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM,
66 MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM,
66};67};
6768
68enum mlx5_ib_uapi_devx_create_event_channel_flags {69enum 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 {...@@ -184,7 +184,7 @@ struct rdma_ucm_query_addr_resp {
184struct rdma_ucm_query_path_resp {184struct rdma_ucm_query_path_resp {
185 __u32 num_paths;185 __u32 num_paths;
186 __u32 reserved;186 __u32 reserved;
187 struct ib_path_rec_data path_data[0];187 struct ib_path_rec_data path_data[];
188};188};
189189
190struct rdma_ucm_conn_param {190struct 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 {...@@ -81,7 +81,7 @@ struct ib_uverbs_ioctl_hdr {
81 __aligned_u64 reserved1;81 __aligned_u64 reserved1;
82 __u32 driver_id;82 __u32 driver_id;
83 __u32 reserved2;83 __u32 reserved2;
84 struct ib_uverbs_attr attrs[0];84 struct ib_uverbs_attr attrs[];
85};85};
8686
87#endif87#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 {...@@ -74,7 +74,7 @@ struct rxe_av {
7474
75struct rxe_send_wr {75struct rxe_send_wr {
76 __aligned_u64 wr_id;76 __aligned_u64 wr_id;
77 __u32 num_sge;77 __u32 reserved;
78 __u32 opcode;78 __u32 opcode;
79 __u32 send_flags;79 __u32 send_flags;
80 union {80 union {
...@@ -82,6 +82,13 @@ struct rxe_send_wr {...@@ -82,6 +82,13 @@ struct rxe_send_wr {
82 __u32 invalidate_rkey;82 __u32 invalidate_rkey;
83 } ex;83 } ex;
84 union {84 union {
85 struct {
86 __aligned_u64 remote_addr;
87 __u32 length;
88 __u32 rkey;
89 __u8 type;
90 __u8 level;
91 } flush;
85 struct {92 struct {
86 __aligned_u64 remote_addr;93 __aligned_u64 remote_addr;
87 __u32 rkey;94 __u32 rkey;
...@@ -136,6 +143,7 @@ struct rxe_dma_info {...@@ -136,6 +143,7 @@ struct rxe_dma_info {
136 __u32 reserved;143 __u32 reserved;
137 union {144 union {
138 __DECLARE_FLEX_ARRAY(__u8, inline_data);145 __DECLARE_FLEX_ARRAY(__u8, inline_data);
146 __DECLARE_FLEX_ARRAY(__u8, atomic_wr);
139 __DECLARE_FLEX_ARRAY(struct rxe_sge, sge);147 __DECLARE_FLEX_ARRAY(struct rxe_sge, sge);
140 };148 };
141};149};
...@@ -156,7 +164,7 @@ struct rxe_send_wqe {...@@ -156,7 +164,7 @@ struct rxe_send_wqe {
156164
157struct rxe_recv_wqe {165struct rxe_recv_wqe {
158 __aligned_u64 wr_id;166 __aligned_u64 wr_id;
159 __u32 num_sge;167 __u32 reserved;
160 __u32 padding;168 __u32 padding;
161 struct rxe_dma_info dma;169 struct rxe_dma_info dma;
162};170};
lib/libc/include/any-linux-any/scsi/fc/fc_els.h+9-9
...@@ -264,7 +264,7 @@ struct fc_tlv_desc {...@@ -264,7 +264,7 @@ struct fc_tlv_desc {
264 * Size of descriptor excluding264 * Size of descriptor excluding
265 * desc_tag and desc_len fields.265 * desc_tag and desc_len fields.
266 */266 */
267 __u8 desc_value[0]; /* Descriptor Value */267 __u8 desc_value[]; /* Descriptor Value */
268};268};
269269
270/* Descriptor tag and len fields are considered the mandatory header270/* Descriptor tag and len fields are considered the mandatory header
...@@ -1027,7 +1027,7 @@ struct fc_fn_li_desc {...@@ -1027,7 +1027,7 @@ struct fc_fn_li_desc {
1027 * threshold to caause the LI event1027 * threshold to caause the LI event
1028 */1028 */
1029 __be32 pname_count; /* number of portname_list elements */1029 __be32 pname_count; /* number of portname_list elements */
1030 __be64 pname_list[0]; /* list of N_Port_Names accessible1030 __be64 pname_list[]; /* list of N_Port_Names accessible
1031 * through the attached port1031 * through the attached port
1032 */1032 */
1033};1033};
...@@ -1069,7 +1069,7 @@ struct fc_fn_peer_congn_desc {...@@ -1069,7 +1069,7 @@ struct fc_fn_peer_congn_desc {
1069 * congestion event1069 * congestion event
1070 */1070 */
1071 __be32 pname_count; /* number of portname_list elements */1071 __be32 pname_count; /* number of portname_list elements */
1072 __be64 pname_list[0]; /* list of N_Port_Names accessible1072 __be64 pname_list[]; /* list of N_Port_Names accessible
1073 * through the attached port1073 * through the attached port
1074 */1074 */
1075};1075};
...@@ -1104,7 +1104,7 @@ struct fc_els_fpin {...@@ -1104,7 +1104,7 @@ struct fc_els_fpin {
1104 * Size of ELS excluding fpin_cmd,1104 * Size of ELS excluding fpin_cmd,
1105 * fpin_zero and desc_len fields.1105 * fpin_zero and desc_len fields.
1106 */1106 */
1107 struct fc_tlv_desc fpin_desc[0]; /* Descriptor list */1107 struct fc_tlv_desc fpin_desc[]; /* Descriptor list */
1108};1108};
11091109
1110/* Diagnostic Function Descriptor - FPIN Registration */1110/* Diagnostic Function Descriptor - FPIN Registration */
...@@ -1115,7 +1115,7 @@ struct fc_df_desc_fpin_reg {...@@ -1115,7 +1115,7 @@ struct fc_df_desc_fpin_reg {
1115 * desc_tag and desc_len fields.1115 * desc_tag and desc_len fields.
1116 */1116 */
1117 __be32 count; /* Number of desc_tags elements */1117 __be32 count; /* Number of desc_tags elements */
1118 __be32 desc_tags[0]; /* Array of Descriptor Tags.1118 __be32 desc_tags[]; /* Array of Descriptor Tags.
1119 * Each tag indicates a function1119 * Each tag indicates a function
1120 * supported by the N_Port (request)1120 * supported by the N_Port (request)
1121 * or by the N_Port and Fabric1121 * or by the N_Port and Fabric
...@@ -1135,7 +1135,7 @@ struct fc_els_rdf {...@@ -1135,7 +1135,7 @@ struct fc_els_rdf {
1135 * Size of ELS excluding fpin_cmd,1135 * Size of ELS excluding fpin_cmd,
1136 * fpin_zero and desc_len fields.1136 * fpin_zero and desc_len fields.
1137 */1137 */
1138 struct fc_tlv_desc desc[0]; /* Descriptor list */1138 struct fc_tlv_desc desc[]; /* Descriptor list */
1139};1139};
11401140
1141/*1141/*
...@@ -1148,7 +1148,7 @@ struct fc_els_rdf_resp {...@@ -1148,7 +1148,7 @@ struct fc_els_rdf_resp {
1148 * and desc_list_len fields.1148 * and desc_list_len fields.
1149 */1149 */
1150 struct fc_els_lsri_desc lsri;1150 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 */
1152};1152};
11531153
11541154
...@@ -1231,7 +1231,7 @@ struct fc_els_edc {...@@ -1231,7 +1231,7 @@ struct fc_els_edc {
1231 * Size of ELS excluding edc_cmd,1231 * Size of ELS excluding edc_cmd,
1232 * edc_zero and desc_len fields.1232 * edc_zero and desc_len fields.
1233 */1233 */
1234 struct fc_tlv_desc desc[0];1234 struct fc_tlv_desc desc[];
1235 /* Diagnostic Descriptor list */1235 /* Diagnostic Descriptor list */
1236};1236};
12371237
...@@ -1245,7 +1245,7 @@ struct fc_els_edc_resp {...@@ -1245,7 +1245,7 @@ struct fc_els_edc_resp {
1245 * and desc_list_len fields.1245 * and desc_list_len fields.
1246 */1246 */
1247 struct fc_els_lsri_desc lsri;1247 struct fc_els_lsri_desc lsri;
1248 struct fc_tlv_desc desc[0];1248 struct fc_tlv_desc desc[];
1249 /* Supported Diagnostic Descriptor list */1249 /* Supported Diagnostic Descriptor list */
1250};1250};
12511251
lib/libc/include/any-linux-any/scsi/scsi_bsg_fc.h+2-2
...@@ -209,14 +209,14 @@ struct fc_bsg_host_vendor {...@@ -209,14 +209,14 @@ struct fc_bsg_host_vendor {
209 __u64 vendor_id;209 __u64 vendor_id;
210210
211 /* start of vendor command area */211 /* start of vendor command area */
212 __u32 vendor_cmd[0];212 __u32 vendor_cmd[];
213};213};
214214
215/* Response:215/* Response:
216 */216 */
217struct fc_bsg_host_vendor_reply {217struct fc_bsg_host_vendor_reply {
218 /* start of vendor response area */218 /* start of vendor response area */
219 __u32 vendor_rsp[0];219 __DECLARE_FLEX_ARRAY(__u32, vendor_rsp);
220};220};
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 @@...@@ -14,10 +14,27 @@
14 */14 */
1515
16#define UFS_CDB_SIZE 1616#define UFS_CDB_SIZE 16
17#define UPIU_TRANSACTION_UIC_CMD 0x1F
18/* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */17/* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */
19#define UIC_CMD_SIZE (sizeof(__u32) * 4)18#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
21/**38/**
22 * struct utp_upiu_header - UPIU header structure39 * struct utp_upiu_header - UPIU header structure
23 * @dword_0: UPIU header DW-040 * @dword_0: UPIU header DW-0
...@@ -79,6 +96,23 @@ struct utp_upiu_req {...@@ -79,6 +96,23 @@ struct utp_upiu_req {
79 };96 };
80};97};
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
82/* request (CDB) structure of the sg_io_v4 */116/* request (CDB) structure of the sg_io_v4 */
83struct ufs_bsg_request {117struct ufs_bsg_request {
84 __u32 msgcode;118 __u32 msgcode;
...@@ -95,11 +129,21 @@ struct ufs_bsg_reply {...@@ -95,11 +129,21 @@ struct ufs_bsg_reply {
95 * msg and status fields. The per-msgcode reply structure129 * msg and status fields. The per-msgcode reply structure
96 * will contain valid data.130 * will contain valid data.
97 */131 */
98 __u32 result;132 int result;
99133
100 /* If there was reply_payload, how much was received? */134 /* If there was reply_payload, how much was received? */
101 __u32 reply_payload_rcv_len;135 __u32 reply_payload_rcv_len;
102136
103 struct utp_upiu_req upiu_rsp;137 struct utp_upiu_req upiu_rsp;
104};138};
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};
105#endif /* UFS_BSG_H */149#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 @@...@@ -35,7 +35,7 @@
35 * FC Transport Broadcast Event Message :35 * FC Transport Broadcast Event Message :
36 * FC_NL_ASYNC_EVENT36 * FC_NL_ASYNC_EVENT
37 *37 *
38 * Note: if Vendor Unique message, &event_data will be start of38 * Note: if Vendor Unique message, event_data_flex will be start of
39 * vendor unique payload, and the length of the payload is39 * vendor unique payload, and the length of the payload is
40 * per event_datalen40 * per event_datalen
41 *41 *
...@@ -50,7 +50,10 @@ struct fc_nl_event {...@@ -50,7 +50,10 @@ struct fc_nl_event {
50 __u16 event_datalen;50 __u16 event_datalen;
51 __u32 event_num;51 __u32 event_num;
52 __u32 event_code;52 __u32 event_code;
53 __u32 event_data;53 union {
54 __u32 event_data;
55 __DECLARE_FLEX_ARRAY(__u8, event_data_flex);
56 };
54} __attribute__((aligned(sizeof(__u64))));57} __attribute__((aligned(sizeof(__u64))));
5558
5659
lib/libc/include/any-linux-any/sound/asequencer.h+4-20
...@@ -3,22 +3,6 @@...@@ -3,22 +3,6 @@
3 * Main header file for the ALSA sequencer3 * Main header file for the ALSA sequencer
4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>4 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
5 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>5 * (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 *
22 */6 */
23#ifndef __SOUND_ASEQUENCER_H7#ifndef __SOUND_ASEQUENCER_H
24#define __SOUND_ASEQUENCER_H8#define __SOUND_ASEQUENCER_H
...@@ -344,10 +328,10 @@ typedef int __bitwise snd_seq_client_type_t;...@@ -344,10 +328,10 @@ typedef int __bitwise snd_seq_client_type_t;
344#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)328#define KERNEL_CLIENT ((snd_seq_client_type_t) 2)
345 329
346 /* event filter flags */330 /* event filter flags */
347#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */331#define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */
348#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */332#define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */
349#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */333#define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */
350#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */334#define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */
351335
352struct snd_seq_client_info {336struct snd_seq_client_info {
353 int client; /* client number to inquire */337 int client; /* client number to inquire */
lib/libc/include/any-linux-any/sound/asoc.h-4
...@@ -5,10 +5,6 @@...@@ -5,10 +5,6 @@
5 * Copyright (C) 2012 Texas Instruments Inc.5 * Copyright (C) 2012 Texas Instruments Inc.
6 * Copyright (C) 2015 Intel Corporation.6 * Copyright (C) 2015 Intel Corporation.
7 *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.
11 *
12 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,8 * Simple file API to load FW that includes mixers, coefficients, DAPM graphs,
13 * algorithms, equalisers, DAIs, widgets etc.9 * algorithms, equalisers, DAIs, widgets etc.
14*/10*/
lib/libc/include/any-linux-any/sound/asound.h+10-19
...@@ -3,22 +3,6 @@...@@ -3,22 +3,6 @@
3 * Advanced Linux Sound Architecture - ALSA - Driver3 * Advanced Linux Sound Architecture - ALSA - Driver
4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,4 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
5 * Abramo Bagnara <abramo@alsa-project.org>5 * 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 *
22 */6 */
237
24#ifndef __SOUND_ASOUND_H8#ifndef __SOUND_ASOUND_H
...@@ -54,8 +38,10 @@...@@ -54,8 +38,10 @@
54 * *38 * *
55 ****************************************************************************/39 ****************************************************************************/
5640
41#define AES_IEC958_STATUS_SIZE 24
42
57struct snd_aes_iec958 {43struct 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 */
59 unsigned char subcode[147]; /* AES/IEC958 subcode bits */45 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
60 unsigned char pad; /* nothing */46 unsigned char pad; /* nothing */
61 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */47 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
...@@ -200,6 +186,11 @@ typedef int __bitwise snd_pcm_format_t;...@@ -200,6 +186,11 @@ typedef int __bitwise snd_pcm_format_t;
200#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */186#define SNDRV_PCM_FORMAT_S24_BE ((snd_pcm_format_t) 7) /* low three bytes */
201#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */187#define SNDRV_PCM_FORMAT_U24_LE ((snd_pcm_format_t) 8) /* low three bytes */
202#define SNDRV_PCM_FORMAT_U24_BE ((snd_pcm_format_t) 9) /* low three bytes */188#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 */
203#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)194#define SNDRV_PCM_FORMAT_S32_LE ((snd_pcm_format_t) 10)
204#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)195#define SNDRV_PCM_FORMAT_S32_BE ((snd_pcm_format_t) 11)
205#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)196#define SNDRV_PCM_FORMAT_U32_LE ((snd_pcm_format_t) 12)
...@@ -298,7 +289,7 @@ typedef int __bitwise snd_pcm_subformat_t;...@@ -298,7 +289,7 @@ typedef int __bitwise snd_pcm_subformat_t;
298#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */289#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
299#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */290#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
300#define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */291#define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
301292#define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */
302#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */293#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
303#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */294#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 {...@@ -1085,7 +1076,7 @@ struct snd_ctl_elem_value {
1085struct snd_ctl_tlv {1076struct snd_ctl_tlv {
1086 unsigned int numid; /* control element numeric identification */1077 unsigned int numid; /* control element numeric identification */
1087 unsigned int length; /* in bytes aligned to 4 */1078 unsigned int length; /* in bytes aligned to 4 */
1088 unsigned int tlv[0]; /* first TLV */1079 unsigned int tlv[]; /* first TLV */
1089};1080};
10901081
1091#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)1082#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
lib/libc/include/any-linux-any/sound/asound_fm.h-15
...@@ -10,21 +10,6 @@...@@ -10,21 +10,6 @@
10 * 4Front Technologies10 * 4Front Technologies
11 *11 *
12 * Direct FM control12 * 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 *
28 */13 */
2914
30#define SNDRV_DM_FM_MODE_OPL2 0x0015#define SNDRV_DM_FM_MODE_OPL2 0x00
lib/libc/include/any-linux-any/sound/compress_offload.h+1-18
...@@ -5,23 +5,6 @@...@@ -5,23 +5,6 @@
5 * Copyright (C) 2011 Intel Corporation5 * Copyright (C) 2011 Intel Corporation
6 * Authors: Vinod Koul <vinod.koul@linux.intel.com>6 * Authors: Vinod Koul <vinod.koul@linux.intel.com>
7 * Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>7 * 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 *
25 */8 */
26#ifndef __COMPRESS_OFFLOAD_H9#ifndef __COMPRESS_OFFLOAD_H
27#define __COMPRESS_OFFLOAD_H10#define __COMPRESS_OFFLOAD_H
...@@ -123,7 +106,7 @@ struct snd_compr_codec_caps {...@@ -123,7 +106,7 @@ struct snd_compr_codec_caps {
123} __attribute__((packed, aligned(4)));106} __attribute__((packed, aligned(4)));
124107
125/**108/**
126 * enum sndrv_compress_encoder109 * enum sndrv_compress_encoder - encoder metadata key
127 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the110 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
128 * end of the track111 * end of the track
129 * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the112 * @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 @@...@@ -7,47 +7,13 @@
7 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>7 * Authors: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
8 * Vinod Koul <vinod.koul@linux.intel.com>8 * Vinod Koul <vinod.koul@linux.intel.com>
9 *9 *
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 *
25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 *11 *
27 * The definitions in this file are derived from the OpenMAX AL version 1.112 * 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.
29 *15 *
30 * Copyright (c) 2007-2010 The Khronos Group Inc.16 * 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 *
51 */17 */
52#ifndef __SND_COMPRESS_PARAMS_H18#ifndef __SND_COMPRESS_PARAMS_H
53#define __SND_COMPRESS_PARAMS_H19#define __SND_COMPRESS_PARAMS_H
...@@ -250,7 +216,7 @@ struct snd_enc_wma {...@@ -250,7 +216,7 @@ struct snd_enc_wma {
250216
251217
252/**218/**
253 * struct snd_enc_vorbis219 * struct snd_enc_vorbis - Vorbis encoder parameters
254 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).220 * @quality: Sets encoding quality to n, between -1 (low) and 10 (high).
255 * In the default mode of operation, the quality level is 3.221 * In the default mode of operation, the quality level is 3.
256 * Normal quality range is 0 - 10.222 * Normal quality range is 0 - 10.
...@@ -279,7 +245,7 @@ struct snd_enc_vorbis {...@@ -279,7 +245,7 @@ struct snd_enc_vorbis {
279245
280246
281/**247/**
282 * struct snd_enc_real248 * struct snd_enc_real - RealAudio encoder parameters
283 * @quant_bits: number of coupling quantization bits in the stream249 * @quant_bits: number of coupling quantization bits in the stream
284 * @start_region: coupling start region in the stream250 * @start_region: coupling start region in the stream
285 * @num_regions: number of regions value251 * @num_regions: number of regions value
...@@ -294,7 +260,7 @@ struct snd_enc_real {...@@ -294,7 +260,7 @@ struct snd_enc_real {
294} __attribute__((packed, aligned(4)));260} __attribute__((packed, aligned(4)));
295261
296/**262/**
297 * struct snd_enc_flac263 * struct snd_enc_flac - FLAC encoder parameters
298 * @num: serial number, valid only for OGG formats264 * @num: serial number, valid only for OGG formats
299 * needs to be set by application265 * needs to be set by application
300 * @gain: Add replay gain tags266 * @gain: Add replay gain tags
lib/libc/include/any-linux-any/sound/emu10k1.h-16
...@@ -3,22 +3,6 @@...@@ -3,22 +3,6 @@
3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
4 * Creative Labs, Inc.4 * Creative Labs, Inc.
5 * Definitions for EMU10K1 (SB Live!) chips5 * 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 *
22 */6 */
23#ifndef __SOUND_EMU10K1_H7#ifndef __SOUND_EMU10K1_H
24#define __SOUND_EMU10K1_H8#define __SOUND_EMU10K1_H
lib/libc/include/any-linux-any/sound/firewire.h+29-3
...@@ -14,6 +14,7 @@...@@ -14,6 +14,7 @@
14#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x6477647914#define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
15#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d15#define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
16#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d54524416#define SNDRV_FIREWIRE_EVENT_MOTU_REGISTER_DSP_CHANGE 0x4d545244
17#define SNDRV_FIREWIRE_EVENT_FF400_MESSAGE 0x4f6c6761
1718
18struct snd_firewire_event_common {19struct snd_firewire_event_common {
19 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */20 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
...@@ -38,11 +39,11 @@ struct snd_efw_transaction {...@@ -38,11 +39,11 @@ struct snd_efw_transaction {
38 __be32 category;39 __be32 category;
39 __be32 command;40 __be32 command;
40 __be32 status;41 __be32 status;
41 __be32 params[0];42 __be32 params[];
42};43};
43struct snd_firewire_event_efw_response {44struct snd_firewire_event_efw_response {
44 unsigned int type;45 unsigned int type;
45 __be32 response[0]; /* some responses */46 __be32 response[]; /* some responses */
46};47};
4748
48struct snd_firewire_event_digi00x_message {49struct snd_firewire_event_digi00x_message {
...@@ -63,7 +64,7 @@ struct snd_firewire_tascam_change {...@@ -63,7 +64,7 @@ struct snd_firewire_tascam_change {
6364
64struct snd_firewire_event_tascam_control {65struct snd_firewire_event_tascam_control {
65 unsigned int type;66 unsigned int type;
66 struct snd_firewire_tascam_change changes[0];67 struct snd_firewire_tascam_change changes[];
67};68};
6869
69struct snd_firewire_event_motu_register_dsp_change {70struct snd_firewire_event_motu_register_dsp_change {
...@@ -72,6 +73,30 @@ struct snd_firewire_event_motu_register_dsp_change {...@@ -72,6 +73,30 @@ struct snd_firewire_event_motu_register_dsp_change {
72 __u32 changes[]; /* Encoded event for change of register DSP. */73 __u32 changes[]; /* Encoded event for change of register DSP. */
73};74};
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
75union snd_firewire_event {100union snd_firewire_event {
76 struct snd_firewire_event_common common;101 struct snd_firewire_event_common common;
77 struct snd_firewire_event_lock_status lock_status;102 struct snd_firewire_event_lock_status lock_status;
...@@ -81,6 +106,7 @@ union snd_firewire_event {...@@ -81,6 +106,7 @@ union snd_firewire_event {
81 struct snd_firewire_event_tascam_control tascam_control;106 struct snd_firewire_event_tascam_control tascam_control;
82 struct snd_firewire_event_motu_notification motu_notification;107 struct snd_firewire_event_motu_notification motu_notification;
83 struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;108 struct snd_firewire_event_motu_register_dsp_change motu_register_dsp_change;
109 struct snd_firewire_event_ff400_message ff400_message;
84};110};
85111
86112
lib/libc/include/any-linux-any/sound/hdsp.h-14
...@@ -4,20 +4,6 @@...@@ -4,20 +4,6 @@
44
5/*5/*
6 * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)6 * 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.
21 */7 */
228
23#ifdef __linux__9#ifdef __linux__
lib/libc/include/any-linux-any/sound/hdspm.h-15
...@@ -4,21 +4,6 @@...@@ -4,21 +4,6 @@
4/*4/*
5 * Copyright (C) 2003 Winfried Ritsch (IEM)5 * Copyright (C) 2003 Winfried Ritsch (IEM)
6 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)6 * 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.
22 */7 */
238
24#ifdef __linux__9#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 @@...@@ -4,21 +4,6 @@
4 * Takashi Iwai <tiwai@suse.de>4 * Takashi Iwai <tiwai@suse.de>
5 *5 *
6 * SB16ASP/AWE32 CSP control6 * 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 *
22 */7 */
23#ifndef __SOUND_SB16_CSP_H8#ifndef __SOUND_SB16_CSP_H
24#define __SOUND_SB16_CSP_H9#define __SOUND_SB16_CSP_H
lib/libc/include/any-linux-any/sound/sfnt_info.h-15
...@@ -6,21 +6,6 @@...@@ -6,21 +6,6 @@
6 * Patch record compatible with AWE driver on OSS6 * Patch record compatible with AWE driver on OSS
7 *7 *
8 * Copyright (C) 1999-2000 Takashi Iwai8 * 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 *
24 */9 */
2510
26#include <sound/asound.h>11#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 {...@@ -66,7 +66,8 @@ enum skl_ch_cfg {
66 SKL_CH_CFG_DUAL_MONO = 9,66 SKL_CH_CFG_DUAL_MONO = 9,
67 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,67 SKL_CH_CFG_I2S_DUAL_STEREO_0 = 10,
68 SKL_CH_CFG_I2S_DUAL_STEREO_1 = 11,68 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,
70 SKL_CH_CFG_INVALID71 SKL_CH_CFG_INVALID
71};72};
7273
...@@ -151,7 +152,7 @@ struct skl_dfw_algo_data {...@@ -151,7 +152,7 @@ struct skl_dfw_algo_data {
151 __u32 rsvd:30;152 __u32 rsvd:30;
152 __u32 param_id;153 __u32 param_id;
153 __u32 max;154 __u32 max;
154 char params[0];155 char params[];
155} __attribute__((packed));156} __attribute__((packed));
156157
157enum skl_tkn_dir {158enum skl_tkn_dir {
lib/libc/include/any-linux-any/sound/snd_ar_tokens.h+27
...@@ -191,6 +191,33 @@ enum ar_event_types {...@@ -191,6 +191,33 @@ enum ar_event_types {
191#define AR_TKN_U32_MODULE_SRC_INSTANCE_ID 208191#define AR_TKN_U32_MODULE_SRC_INSTANCE_ID 208
192#define AR_TKN_U32_MODULE_DST_INSTANCE_ID 209192#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
195#define AR_TKN_U32_MODULE_HW_IF_IDX 250222#define AR_TKN_U32_MODULE_HW_IF_IDX 250
196#define AR_TKN_U32_MODULE_HW_IF_TYPE 251223#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 @@...@@ -4,16 +4,6 @@
4 *4 *
5 * Copyright (C) 2016 Intel Corp5 * Copyright (C) 2016 Intel Corp
6 * Author: Shreyas NC <shreyas.nc@intel.com>6 * 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.
17 */7 */
18#ifndef __SND_SST_TOKENS_H__8#ifndef __SND_SST_TOKENS_H__
19#define __SND_SST_TOKENS_H__9#define __SND_SST_TOKENS_H__
lib/libc/include/any-linux-any/sound/sof/abi.h+3-1
...@@ -24,9 +24,11 @@...@@ -24,9 +24,11 @@
24#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__24#ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
25#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__25#define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
2626
27#include <linux/types.h>
28
27/* SOF ABI version major, minor and patch numbers */29/* SOF ABI version major, minor and patch numbers */
28#define SOF_ABI_MAJOR 330#define SOF_ABI_MAJOR 3
29#define SOF_ABI_MINOR 1831#define SOF_ABI_MINOR 23
30#define SOF_ABI_PATCH 032#define SOF_ABI_PATCH 0
3133
32/* SOF ABI version number. Format within 32bit word is MMmmmppp */34/* 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 {...@@ -23,7 +23,37 @@ struct sof_abi_hdr {
23 __u32 size; /**< size in bytes of data excl. this struct */23 __u32 size; /**< size in bytes of data excl. this struct */
24 __u32 abi; /**< SOF ABI version */24 __u32 abi; /**< SOF ABI version */
25 __u32 reserved[4]; /**< reserved for future use */25 __u32 reserved[4]; /**< reserved for future use */
26 __u32 data[0]; /**< Component data - opaque to core */26 __u32 data[]; /**< Component data - opaque to core */
27} __attribute__((packed));27} __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
29#endif59#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/sof/tokens.h+63
...@@ -52,11 +52,17 @@...@@ -52,11 +52,17 @@
52#define SOF_TKN_SCHED_FRAMES 20452#define SOF_TKN_SCHED_FRAMES 204
53#define SOF_TKN_SCHED_TIME_DOMAIN 20553#define SOF_TKN_SCHED_TIME_DOMAIN 205
54#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 20654#define SOF_TKN_SCHED_DYNAMIC_PIPELINE 206
55#define SOF_TKN_SCHED_LP_MODE 207
56#define SOF_TKN_SCHED_MEM_USAGE 208
5557
56/* volume */58/* volume */
57#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 25059#define SOF_TKN_VOLUME_RAMP_STEP_TYPE 250
58#define SOF_TKN_VOLUME_RAMP_STEP_MS 25160#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
60/* SRC */66/* SRC */
61#define SOF_TKN_SRC_RATE_IN 30067#define SOF_TKN_SRC_RATE_IN 300
62#define SOF_TKN_SRC_RATE_OUT 30168#define SOF_TKN_SRC_RATE_OUT 301
...@@ -79,6 +85,18 @@...@@ -79,6 +85,18 @@
79 */85 */
80#define SOF_TKN_COMP_CORE_ID 40486#define SOF_TKN_COMP_CORE_ID 404
81#define SOF_TKN_COMP_UUID 40587#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
83/* SSP */101/* SSP */
84#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500102#define SOF_TKN_INTEL_SSP_CLKS_CONTROL 500
...@@ -140,4 +158,49 @@...@@ -140,4 +158,49 @@
140#define SOF_TKN_INTEL_HDA_RATE 1500158#define SOF_TKN_INTEL_HDA_RATE 1500
141#define SOF_TKN_INTEL_HDA_CH 1501159#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
143#endif206#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/tlv.h-11
...@@ -1,15 +1,4 @@...@@ -1,15 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* 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
14#ifndef __UAPI_SOUND_TLV_H3#ifndef __UAPI_SOUND_TLV_H
15#define __UAPI_SOUND_TLV_H4#define __UAPI_SOUND_TLV_H
lib/libc/include/any-linux-any/sound/usb_stream.h+1-15
...@@ -1,20 +1,6 @@...@@ -1,20 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*2/*
3 * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>3 * 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.
18 */4 */
195
20#ifndef __SOUND_USB_STREAM_H6#ifndef __SOUND_USB_STREAM_H
...@@ -61,7 +47,7 @@ struct usb_stream {...@@ -61,7 +47,7 @@ struct usb_stream {
61 unsigned inpacket_split_at;47 unsigned inpacket_split_at;
62 unsigned next_inpacket_split;48 unsigned next_inpacket_split;
63 unsigned next_inpacket_split_at;49 unsigned next_inpacket_split_at;
64 struct usb_stream_packet inpacket[0];50 struct usb_stream_packet inpacket[];
65};51};
6652
67enum usb_stream_state {53enum usb_stream_state {
lib/libc/include/any-linux-any/xen/gntdev.h+7-1
...@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {...@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {
47/*47/*
48 * Inserts the grant references into the mapping table of an instance48 * Inserts the grant references into the mapping table of an instance
49 * of gntdev. N.B. This does not perform the mapping, which is deferred49 * 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.
51 */57 */
52#define IOCTL_GNTDEV_MAP_GRANT_REF \58#define IOCTL_GNTDEV_MAP_GRANT_REF \
53_IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))59_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 @@...@@ -28,6 +28,12 @@
28#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)28#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
29#define HWCAP_LPAE (1 << 20)29#define HWCAP_LPAE (1 << 20)
30#define HWCAP_EVTSTRM (1 << 21)30#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
32/*38/*
33 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP239 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
...@@ -37,5 +43,7 @@...@@ -37,5 +43,7 @@
37#define HWCAP2_SHA1 (1 << 2)43#define HWCAP2_SHA1 (1 << 2)
38#define HWCAP2_SHA2 (1 << 3)44#define HWCAP2_SHA2 (1 << 3)
39#define HWCAP2_CRC32 (1 << 4)45#define HWCAP2_CRC32 (1 << 4)
46#define HWCAP2_SB (1 << 5)
47#define HWCAP2_SSBS (1 << 6)
4048
41#endif /* __ASMARM_HWCAP_H */49#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 {...@@ -89,7 +89,7 @@ struct sigaction {
89typedef struct sigaltstack {89typedef struct sigaltstack {
90 void *ss_sp;90 void *ss_sp;
91 int ss_flags;91 int ss_flags;
92 size_t ss_size;92 __kernel_size_t ss_size;
93} stack_t;93} stack_t;
9494
9595
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+1
...@@ -403,5 +403,6 @@...@@ -403,5 +403,6 @@
403#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)403#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
404#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)404#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
405#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)405#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
406#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
406407
407#endif /* _ASM_UNISTD_EABI_H */408#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 @@...@@ -415,5 +415,6 @@
415#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)415#define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
416#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)416#define __NR_process_mrelease (__NR_SYSCALL_BASE + 448)
417#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)417#define __NR_futex_waitv (__NR_SYSCALL_BASE + 449)
418#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE + 450)
418419
419#endif /* _ASM_UNISTD_OABI_H */420#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 @@...@@ -34,7 +34,7 @@
34struct bi_record {34struct bi_record {
35 __be16 tag; /* tag ID */35 __be16 tag; /* tag ID */
36 __be16 size; /* size of record (in bytes) */36 __be16 size; /* size of record (in bytes) */
37 __be32 data[0]; /* data */37 __be32 data[]; /* data */
38};38};
3939
4040
...@@ -64,6 +64,13 @@ struct mem_info {...@@ -64,6 +64,13 @@ struct mem_info {
64 /* (struct mem_info) */64 /* (struct mem_info) */
65#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */65#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
66 /* (string) */66 /* (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
69 /*76 /*
...@@ -83,6 +90,7 @@ struct mem_info {...@@ -83,6 +90,7 @@ struct mem_info {
83#define MACH_SUN3X 1190#define MACH_SUN3X 11
84#define MACH_M54XX 1291#define MACH_M54XX 12
85#define MACH_M5441X 1392#define MACH_M5441X 13
93#define MACH_VIRT 14
8694
8795
88 /*96 /*
...@@ -167,7 +175,7 @@ struct bootversion {...@@ -167,7 +175,7 @@ struct bootversion {
167 struct {175 struct {
168 __be32 machtype;176 __be32 machtype;
169 __be32 version;177 __be32 version;
170 } machversions[0];178 } machversions[];
171} __attribute__((packed));179} __attribute__((packed));
172180
173#endif /* __ASSEMBLY__ */181#endif /* __ASSEMBLY__ */
lib/libc/include/m68k-linux-any/asm/ptrace.h+5
...@@ -74,7 +74,12 @@ struct switch_stack {...@@ -74,7 +74,12 @@ struct switch_stack {
7474
75#define PTRACE_GET_THREAD_AREA 2575#define PTRACE_GET_THREAD_AREA 25
7676
77#define PTRACE_GETFDPIC 31
78
77#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */79#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
7880
81#define PTRACE_GETFDPIC_EXEC 0
82#define PTRACE_GETFDPIC_INTERP 1
83
79#endif /* __ASSEMBLY__ */84#endif /* __ASSEMBLY__ */
80#endif /* _M68K_PTRACE_H */85#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 {...@@ -79,7 +79,7 @@ struct sigaction {
79typedef struct sigaltstack {79typedef struct sigaltstack {
80 void *ss_sp;80 void *ss_sp;
81 int ss_flags;81 int ss_flags;
82 size_t ss_size;82 __kernel_size_t ss_size;
83} stack_t;83} stack_t;
8484
85#endif /* _M68K_SIGNAL_H */85#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 @@...@@ -422,6 +422,7 @@
422#define __NR_landlock_restrict_self 446422#define __NR_landlock_restrict_self 446
423#define __NR_process_mrelease 448423#define __NR_process_mrelease 448
424#define __NR_futex_waitv 449424#define __NR_futex_waitv 449
425#define __NR_set_mempolicy_home_node 450
425426
426427
427#endif /* _ASM_UNISTD_32_H */428#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 @@...@@ -44,36 +44,16 @@
44#define F_SETOWN 24 /* for sockets. */44#define F_SETOWN 24 /* for sockets. */
45#define F_GETOWN 23 /* for sockets. */45#define F_GETOWN 23 /* for sockets. */
4646
47#ifndef __mips6447#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
48#define F_GETLK64 33 /* using 'struct flock64' */48#define F_GETLK64 33 /* using 'struct flock64' */
49#define F_SETLK64 3449#define F_SETLK64 34
50#define F_SETLKW64 3550#define F_SETLKW64 35
51#endif51#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
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 */
5952
60#if _MIPS_SIM != _MIPS_SIM_ABI6453#if _MIPS_SIM != _MIPS_SIM_ABI64
6154#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid;
62#include <linux/types.h>55#define __ARCH_FLOCK_PAD long pad[4];
6356#endif
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 */
7757
78#include <asm-generic/fcntl.h>58#include <asm-generic/fcntl.h>
7959
lib/libc/include/mips-linux-any/asm/mman.h+4
...@@ -101,6 +101,10 @@...@@ -101,6 +101,10 @@
101#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */101#define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */
102#define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */102#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
104/* compatibility flags */108/* compatibility flags */
105#define MAP_FILE 0109#define MAP_FILE 0
106110
lib/libc/include/mips-linux-any/asm/shmbuf.h+5-2
...@@ -2,6 +2,9 @@...@@ -2,6 +2,9 @@
2#ifndef _ASM_SHMBUF_H2#ifndef _ASM_SHMBUF_H
3#define _ASM_SHMBUF_H3#define _ASM_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
5/*8/*
6 * The shmid64_ds structure for the MIPS architecture.9 * The shmid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth10 * Note extra padding because this structure is passed back and forth
...@@ -16,7 +19,7 @@...@@ -16,7 +19,7 @@
16#ifdef __mips6419#ifdef __mips64
17struct shmid64_ds {20struct shmid64_ds {
18 struct ipc64_perm shm_perm; /* operation perms */21 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) */
20 long shm_atime; /* last attach time */23 long shm_atime; /* last attach time */
21 long shm_dtime; /* last detach time */24 long shm_dtime; /* last detach time */
22 long shm_ctime; /* last change time */25 long shm_ctime; /* last change time */
...@@ -29,7 +32,7 @@ struct shmid64_ds {...@@ -29,7 +32,7 @@ struct shmid64_ds {
29#else32#else
30struct shmid64_ds {33struct shmid64_ds {
31 struct ipc64_perm shm_perm; /* operation perms */34 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) */
33 unsigned long shm_atime; /* last attach time */36 unsigned long shm_atime; /* last attach time */
34 unsigned long shm_dtime; /* last detach time */37 unsigned long shm_dtime; /* last detach time */
35 unsigned long shm_ctime; /* last change time */38 unsigned long shm_ctime; /* last change time */
lib/libc/include/mips-linux-any/asm/signal.h+1-1
...@@ -98,7 +98,7 @@ struct sigaction {...@@ -98,7 +98,7 @@ struct sigaction {
98/* IRIX compatible stack_t */98/* IRIX compatible stack_t */
99typedef struct sigaltstack {99typedef struct sigaltstack {
100 void *ss_sp;100 void *ss_sp;
101 size_t ss_size;101 __kernel_size_t ss_size;
102 int ss_flags;102 int ss_flags;
103} stack_t;103} stack_t;
104104
lib/libc/include/mips-linux-any/asm/socket.h+4
...@@ -144,6 +144,10 @@...@@ -144,6 +144,10 @@
144144
145#define SO_RESERVE_MEM 73145#define SO_RESERVE_MEM 73
146146
147#define SO_TXREHASH 74
148
149#define SO_RCVMARK 75
150
147151
148#if __BITS_PER_LONG == 64152#if __BITS_PER_LONG == 64
149#define SO_TIMESTAMP SO_TIMESTAMP_OLD153#define SO_TIMESTAMP SO_TIMESTAMP_OLD
lib/libc/include/mips-linux-any/asm/stat.h+10-10
...@@ -19,11 +19,11 @@...@@ -19,11 +19,11 @@
19struct stat {19struct stat {
20 unsigned st_dev;20 unsigned st_dev;
21 long st_pad1[3]; /* Reserved for network id */21 long st_pad1[3]; /* Reserved for network id */
22 ino_t st_ino;22 __kernel_ino_t st_ino;
23 mode_t st_mode;23 __kernel_mode_t st_mode;
24 __u32 st_nlink;24 __u32 st_nlink;
25 uid_t st_uid;25 __kernel_uid32_t st_uid;
26 gid_t st_gid;26 __kernel_gid32_t st_gid;
27 unsigned st_rdev;27 unsigned st_rdev;
28 long st_pad2[2];28 long st_pad2[2];
29 long st_size;29 long st_size;
...@@ -55,11 +55,11 @@ struct stat64 {...@@ -55,11 +55,11 @@ struct stat64 {
5555
56 unsigned long long st_ino;56 unsigned long long st_ino;
5757
58 mode_t st_mode;58 __kernel_mode_t st_mode;
59 __u32 st_nlink;59 __u32 st_nlink;
6060
61 uid_t st_uid;61 __kernel_uid32_t st_uid;
62 gid_t st_gid;62 __kernel_gid32_t st_gid;
6363
64 unsigned long st_rdev;64 unsigned long st_rdev;
65 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */65 unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
...@@ -96,11 +96,11 @@ struct stat {...@@ -96,11 +96,11 @@ struct stat {
9696
97 unsigned long st_ino;97 unsigned long st_ino;
9898
99 mode_t st_mode;99 __kernel_mode_t st_mode;
100 __u32 st_nlink;100 __u32 st_nlink;
101101
102 uid_t st_uid;102 __kernel_uid32_t st_uid;
103 gid_t st_gid;103 __kernel_gid32_t st_gid;
104104
105 unsigned int st_rdev;105 unsigned int st_rdev;
106 unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */106 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 @@...@@ -11,11 +11,9 @@
11#ifndef _ASM_TERMBITS_H11#ifndef _ASM_TERMBITS_H
12#define _ASM_TERMBITS_H12#define _ASM_TERMBITS_H
1313
14#include <linux/posix_types.h>14#include <asm-generic/termbits-common.h>
1515
16typedef unsigned char cc_t;16typedef unsigned int tcflag_t;
17typedef unsigned int speed_t;
18typedef unsigned int tcflag_t;
1917
20/*18/*
21 * The ABI says nothing about NCC but seems to use NCCS as19 * The ABI says nothing about NCC but seems to use NCCS as
...@@ -54,175 +52,126 @@ struct ktermios {...@@ -54,175 +52,126 @@ struct ktermios {
54};52};
5553
56/* c_cc characters */54/* c_cc characters */
57#define VINTR 0 /* Interrupt character [ISIG]. */55#define VINTR 0 /* Interrupt character [ISIG] */
58#define VQUIT 1 /* Quit character [ISIG]. */56#define VQUIT 1 /* Quit character [ISIG] */
59#define VERASE 2 /* Erase character [ICANON]. */57#define VERASE 2 /* Erase character [ICANON] */
60#define VKILL 3 /* Kill-line character [ICANON]. */58#define VKILL 3 /* Kill-line character [ICANON] */
61#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */59#define VMIN 4 /* Minimum number of bytes read at once [!ICANON] */
62#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */60#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON] */
63#define VEOL2 6 /* Second EOL character [ICANON]. */61#define VEOL2 6 /* Second EOL character [ICANON] */
64#define VSWTC 7 /* ??? */62#define VSWTC 7 /* ??? */
65#define VSWTCH VSWTC63#define VSWTCH VSWTC
66#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */64#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF] */
67#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */65#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF] */
68#define VSUSP 10 /* Suspend character [ISIG]. */66#define VSUSP 10 /* Suspend character [ISIG] */
69#if 067#if 0
70/*68/*
71 * VDSUSP is not supported69 * VDSUSP is not supported
72 */70 */
73#define VDSUSP 11 /* Delayed suspend character [ISIG]. */71#define VDSUSP 11 /* Delayed suspend character [ISIG] */
74#endif72#endif
75#define VREPRINT 12 /* Reprint-line character [ICANON]. */73#define VREPRINT 12 /* Reprint-line character [ICANON] */
76#define VDISCARD 13 /* Discard character [IEXTEN]. */74#define VDISCARD 13 /* Discard character [IEXTEN] */
77#define VWERASE 14 /* Word-erase character [ICANON]. */75#define VWERASE 14 /* Word-erase character [ICANON] */
78#define VLNEXT 15 /* Literal-next character [IEXTEN]. */76#define VLNEXT 15 /* Literal-next character [IEXTEN] */
79#define VEOF 16 /* End-of-file character [ICANON]. */77#define VEOF 16 /* End-of-file character [ICANON] */
80#define VEOL 17 /* End-of-line character [ICANON]. */78#define VEOL 17 /* End-of-line character [ICANON] */
8179
82/* c_iflag bits */80/* c_iflag bits */
83#define IGNBRK 0000001 /* Ignore break condition. */81#define IUCLC 0x0200 /* Map upper case to lower case on input */
84#define BRKINT 0000002 /* Signal interrupt on break. */82#define IXON 0x0400 /* Enable start/stop output control */
85#define IGNPAR 0000004 /* Ignore characters with parity errors. */83#define IXOFF 0x1000 /* Enable start/stop input control */
86#define PARMRK 0000010 /* Mark parity and framing errors. */84#define IMAXBEL 0x2000 /* Ring bell when input queue is full */
87#define INPCK 0000020 /* Enable input parity check. */85#define IUTF8 0x4000 /* Input is UTF-8 */
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 */
9886
99/* c_oflag bits */87/* c_oflag bits */
100#define OPOST 0000001 /* Perform output processing. */88#define OLCUC 0x00002 /* Map lower case to upper case on output */
101#define OLCUC 0000002 /* Map lower case to upper case on output. */89#define ONLCR 0x00004 /* Map NL to CR-NL on output */
102#define ONLCR 0000004 /* Map NL to CR-NL on output. */90#define NLDLY 0x00100
103#define OCRNL 000001091#define NL0 0x00000
104#define ONOCR 000002092#define NL1 0x00100
105#define ONLRET 000004093#define CRDLY 0x00600
106#define OFILL 000010094#define CR0 0x00000
107#define OFDEL 000020095#define CR1 0x00200
108#define NLDLY 000040096#define CR2 0x00400
109#define NL0 000000097#define CR3 0x00600
110#define NL1 000040098#define TABDLY 0x01800
111#define CRDLY 000300099#define TAB0 0x00000
112#define CR0 0000000100#define TAB1 0x00800
113#define CR1 0001000101#define TAB2 0x01000
114#define CR2 0002000102#define TAB3 0x01800
115#define CR3 0003000103#define XTABS 0x01800
116#define TABDLY 0014000104#define BSDLY 0x02000
117#define TAB0 0000000105#define BS0 0x00000
118#define TAB1 0004000106#define BS1 0x02000
119#define TAB2 0010000107#define VTDLY 0x04000
120#define TAB3 0014000108#define VT0 0x00000
121#define XTABS 0014000109#define VT1 0x04000
122#define BSDLY 0020000110#define FFDLY 0x08000
123#define BS0 0000000111#define FF0 0x00000
124#define BS1 0020000112#define FF1 0x08000
125#define VTDLY 0040000
126#define VT0 0000000
127#define VT1 0040000
128#define FFDLY 0100000
129#define FF0 0000000
130#define FF1 0100000
131/*113/*
132#define PAGEOUT ???114#define PAGEOUT ???
133#define WRAP ???115#define WRAP ???
134 */116 */
135117
136/* c_cflag bit meaning */118/* c_cflag bit meaning */
137#define CBAUD 0010017119#define CBAUD 0x0000100f
138#define B0 0000000 /* hang up */120#define CSIZE 0x00000030 /* Number of bits per byte (mask) */
139#define B50 0000001121#define CS5 0x00000000 /* 5 bits per byte */
140#define B75 0000002122#define CS6 0x00000010 /* 6 bits per byte */
141#define B110 0000003123#define CS7 0x00000020 /* 7 bits per byte */
142#define B134 0000004124#define CS8 0x00000030 /* 8 bits per byte */
143#define B150 0000005125#define CSTOPB 0x00000040 /* Two stop bits instead of one */
144#define B200 0000006126#define CREAD 0x00000080 /* Enable receiver */
145#define B300 0000007127#define PARENB 0x00000100 /* Parity enable */
146#define B600 0000010128#define PARODD 0x00000200 /* Odd parity instead of even */
147#define B1200 0000011129#define HUPCL 0x00000400 /* Hang up on last close */
148#define B1800 0000012130#define CLOCAL 0x00000800 /* Ignore modem status lines */
149#define B2400 0000013131#define CBAUDEX 0x00001000
150#define B4800 0000014132#define BOTHER 0x00001000
151#define B9600 0000015133#define B57600 0x00001001
152#define B19200 0000016134#define B115200 0x00001002
153#define B38400 0000017135#define B230400 0x00001003
154#define EXTA B19200136#define B460800 0x00001004
155#define EXTB B38400137#define B500000 0x00001005
156#define CSIZE 0000060 /* Number of bits per byte (mask). */138#define B576000 0x00001006
157#define CS5 0000000 /* 5 bits per byte. */139#define B921600 0x00001007
158#define CS6 0000020 /* 6 bits per byte. */140#define B1000000 0x00001008
159#define CS7 0000040 /* 7 bits per byte. */141#define B1152000 0x00001009
160#define CS8 0000060 /* 8 bits per byte. */142#define B1500000 0x0000100a
161#define CSTOPB 0000100 /* Two stop bits instead of one. */143#define B2000000 0x0000100b
162#define CREAD 0000200 /* Enable receiver. */144#define B2500000 0x0000100c
163#define PARENB 0000400 /* Parity enable. */145#define B3000000 0x0000100d
164#define PARODD 0001000 /* Odd parity instead of even. */146#define B3500000 0x0000100e
165#define HUPCL 0002000 /* Hang up on last close. */147#define B4000000 0x0000100f
166#define CLOCAL 0004000 /* Ignore modem status lines. */148#define CIBAUD 0x100f0000 /* input baud rate */
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 */
189149
190/* c_lflag bits */150/* c_lflag bits */
191#define ISIG 0000001 /* Enable signals. */151#define ISIG 0x00001 /* Enable signals */
192#define ICANON 0000002 /* Do erase and kill processing. */152#define ICANON 0x00002 /* Do erase and kill processing */
193#define XCASE 0000004153#define XCASE 0x00004
194#define ECHO 0000010 /* Enable echo. */154#define ECHO 0x00008 /* Enable echo */
195#define ECHOE 0000020 /* Visual erase for ERASE. */155#define ECHOE 0x00010 /* Visual erase for ERASE */
196#define ECHOK 0000040 /* Echo NL after KILL. */156#define ECHOK 0x00020 /* Echo NL after KILL */
197#define ECHONL 0000100 /* Echo NL even if ECHO is off. */157#define ECHONL 0x00040 /* Echo NL even if ECHO is off */
198#define NOFLSH 0000200 /* Disable flush after interrupt. */158#define NOFLSH 0x00080 /* Disable flush after interrupt */
199#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */159#define IEXTEN 0x00100 /* Enable DISCARD and LNEXT */
200#define ECHOCTL 0001000 /* Echo control characters as ^X. */160#define ECHOCTL 0x00200 /* Echo control characters as ^X */
201#define ECHOPRT 0002000 /* Hardcopy visual erase. */161#define ECHOPRT 0x00400 /* Hardcopy visual erase */
202#define ECHOKE 0004000 /* Visual erase for KILL. */162#define ECHOKE 0x00800 /* Visual erase for KILL */
203#define FLUSHO 0020000163#define FLUSHO 0x02000
204#define PENDIN 0040000 /* Retype pending input (state). */164#define PENDIN 0x04000 /* Retype pending input (state) */
205#define TOSTOP 0100000 /* Send SIGTTOU for background output. */165#define TOSTOP 0x08000 /* Send SIGTTOU for background output */
206#define ITOSTOP TOSTOP166#define ITOSTOP TOSTOP
207#define EXTPROC 0200000 /* External processing on pty */167#define EXTPROC 0x10000 /* External processing on pty */
208168
209/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */169/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
210#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */170#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
223/* tcsetattr uses these */172/* tcsetattr uses these */
224#define TCSANOW TCSETS /* Change immediately. */173#define TCSANOW TCSETS /* Change immediately */
225#define TCSADRAIN TCSETSW /* Change when pending output is written. */174#define TCSADRAIN TCSETSW /* Change when pending output is written */
226#define TCSAFLUSH TCSETSF /* Flush pending input before changing. */175#define TCSAFLUSH TCSETSF /* Flush pending input before changing */
227176
228#endif /* _ASM_TERMBITS_H */177#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 {...@@ -60,7 +60,7 @@ struct ucontext {
60 sigset_t uc_sigmask;60 sigset_t uc_sigmask;
6161
62 /* Extended context structures may follow ucontext */62 /* Extended context structures may follow ucontext */
63 unsigned long long uc_extcontext[0];63 unsigned long long uc_extcontext[];
64};64};
6565
66#endif /* __MIPS_UAPI_ASM_UCONTEXT_H */66#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 @@...@@ -378,5 +378,6 @@
378#define __NR_landlock_restrict_self (__NR_Linux + 446)378#define __NR_landlock_restrict_self (__NR_Linux + 446)
379#define __NR_process_mrelease (__NR_Linux + 448)379#define __NR_process_mrelease (__NR_Linux + 448)
380#define __NR_futex_waitv (__NR_Linux + 449)380#define __NR_futex_waitv (__NR_Linux + 449)
381#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
381382
382#endif /* _ASM_UNISTD_N32_H */383#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 @@...@@ -354,5 +354,6 @@
354#define __NR_landlock_restrict_self (__NR_Linux + 446)354#define __NR_landlock_restrict_self (__NR_Linux + 446)
355#define __NR_process_mrelease (__NR_Linux + 448)355#define __NR_process_mrelease (__NR_Linux + 448)
356#define __NR_futex_waitv (__NR_Linux + 449)356#define __NR_futex_waitv (__NR_Linux + 449)
357#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
357358
358#endif /* _ASM_UNISTD_N64_H */359#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 @@...@@ -424,5 +424,6 @@
424#define __NR_landlock_restrict_self (__NR_Linux + 446)424#define __NR_landlock_restrict_self (__NR_Linux + 446)
425#define __NR_process_mrelease (__NR_Linux + 448)425#define __NR_process_mrelease (__NR_Linux + 448)
426#define __NR_futex_waitv (__NR_Linux + 449)426#define __NR_futex_waitv (__NR_Linux + 449)
427#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
427428
428#endif /* _ASM_UNISTD_O32_H */429#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 @@...@@ -48,6 +48,8 @@
48#define AT_L3_CACHESIZE 4648#define AT_L3_CACHESIZE 46
49#define AT_L3_CACHEGEOMETRY 4749#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
53#endif55#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];...@@ -289,12 +289,4 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[ELF_NVSRHALFREG];
289/* Keep this the last entry. */289/* Keep this the last entry. */
290#define R_PPC64_NUM 253290#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
300#endif /* _ASM_POWERPC_ELF_H */292#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 {...@@ -116,6 +116,22 @@ struct nd_papr_pdsm_health {
116 };116 };
117};117};
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
119/*135/*
120 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel136 * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
121 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct137 * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
...@@ -123,12 +139,14 @@ struct nd_papr_pdsm_health {...@@ -123,12 +139,14 @@ struct nd_papr_pdsm_health {
123enum papr_pdsm {139enum papr_pdsm {
124 PAPR_PDSM_MIN = 0x0,140 PAPR_PDSM_MIN = 0x0,
125 PAPR_PDSM_HEALTH,141 PAPR_PDSM_HEALTH,
142 PAPR_PDSM_SMART_INJECT,
126 PAPR_PDSM_MAX,143 PAPR_PDSM_MAX,
127};144};
128145
129/* Maximal union that can hold all possible payload types */146/* Maximal union that can hold all possible payload types */
130union nd_pdsm_payload {147union nd_pdsm_payload {
131 struct nd_papr_pdsm_health health;148 struct nd_papr_pdsm_health health;
149 struct nd_papr_pdsm_smart_inject smart_inject;
132 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];150 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
133} __attribute__((packed));151} __attribute__((packed));
134152
lib/libc/include/powerpc-linux-any/asm/shmbuf.h+4-1
...@@ -2,6 +2,9 @@...@@ -2,6 +2,9 @@
2#ifndef _ASM_POWERPC_SHMBUF_H2#ifndef _ASM_POWERPC_SHMBUF_H
3#define _ASM_POWERPC_SHMBUF_H3#define _ASM_POWERPC_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
5/*8/*
6 * This program is free software; you can redistribute it and/or9 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License10 * modify it under the terms of the GNU General Public License
...@@ -34,7 +37,7 @@ struct shmid64_ds {...@@ -34,7 +37,7 @@ struct shmid64_ds {
34 unsigned long shm_ctime; /* last change time */37 unsigned long shm_ctime; /* last change time */
35 unsigned long __unused4;38 unsigned long __unused4;
36#endif39#endif
37 size_t shm_segsz; /* size of segment (bytes) */40 __kernel_size_t shm_segsz; /* size of segment (bytes) */
38 __kernel_pid_t shm_cpid; /* pid of creator */41 __kernel_pid_t shm_cpid; /* pid of creator */
39 __kernel_pid_t shm_lpid; /* pid of last operator */42 __kernel_pid_t shm_lpid; /* pid of last operator */
40 unsigned long shm_nattch; /* no. of current attaches */43 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 {...@@ -62,8 +62,13 @@ typedef struct {
6262
63#define SA_RESTORER 0x04000000U63#define SA_RESTORER 0x04000000U
6464
65#ifdef __powerpc64__
66#define MINSIGSTKSZ 8192
67#define SIGSTKSZ 32768
68#else
65#define MINSIGSTKSZ 204869#define MINSIGSTKSZ 2048
66#define SIGSTKSZ 819270#define SIGSTKSZ 8192
71#endif
6772
68#include <asm-generic/signal-defs.h>73#include <asm-generic/signal-defs.h>
6974
...@@ -84,7 +89,7 @@ struct sigaction {...@@ -84,7 +89,7 @@ struct sigaction {
84typedef struct sigaltstack {89typedef struct sigaltstack {
85 void *ss_sp;90 void *ss_sp;
86 int ss_flags;91 int ss_flags;
87 size_t ss_size;92 __kernel_size_t ss_size;
88} stack_t;93} stack_t;
8994
9095
lib/libc/include/powerpc-linux-any/asm/stat.h+5-5
...@@ -29,16 +29,16 @@ struct __old_kernel_stat {...@@ -29,16 +29,16 @@ struct __old_kernel_stat {
2929
30struct stat {30struct stat {
31 unsigned long st_dev;31 unsigned long st_dev;
32 ino_t st_ino;32 __kernel_ino_t st_ino;
33#ifdef __powerpc64__33#ifdef __powerpc64__
34 unsigned long st_nlink;34 unsigned long st_nlink;
35 mode_t st_mode;35 __kernel_mode_t st_mode;
36#else36#else
37 mode_t st_mode;37 __kernel_mode_t st_mode;
38 unsigned short st_nlink;38 unsigned short st_nlink;
39#endif39#endif
40 uid_t st_uid;40 __kernel_uid32_t st_uid;
41 gid_t st_gid;41 __kernel_gid32_t st_gid;
42 unsigned long st_rdev;42 unsigned long st_rdev;
43 long st_size;43 long st_size;
44 unsigned long st_blksize;44 unsigned long st_blksize;
lib/libc/include/powerpc-linux-any/asm/termbits.h+64-118
...@@ -9,8 +9,8 @@...@@ -9,8 +9,8 @@
9 * 2 of the License, or (at your option) any later version.9 * 2 of the License, or (at your option) any later version.
10 */10 */
1111
12typedef unsigned char cc_t;12#include <asm-generic/termbits-common.h>
13typedef unsigned int speed_t;13
14typedef unsigned int tcflag_t;14typedef unsigned int tcflag_t;
1515
16/*16/*
...@@ -64,115 +64,72 @@ struct ktermios {...@@ -64,115 +64,72 @@ struct ktermios {
64#define VDISCARD 1664#define VDISCARD 16
6565
66/* c_iflag bits */66/* c_iflag bits */
67#define IGNBRK 000000167#define IXON 0x0200
68#define BRKINT 000000268#define IXOFF 0x0400
69#define IGNPAR 000000469#define IUCLC 0x1000
70#define PARMRK 000001070#define IMAXBEL 0x2000
71#define INPCK 000002071#define IUTF8 0x4000
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
8272
83/* c_oflag bits */73/* c_oflag bits */
84#define OPOST 000000174#define ONLCR 0x00002
85#define ONLCR 000000275#define OLCUC 0x00004
86#define OLCUC 000000476#define NLDLY 0x00300
8777#define NL0 0x00000
88#define OCRNL 000001078#define NL1 0x00100
89#define ONOCR 000002079#define NL2 0x00200
90#define ONLRET 000004080#define NL3 0x00300
9181#define TABDLY 0x00c00
92#define OFILL 0000010082#define TAB0 0x00000
93#define OFDEL 0000020083#define TAB1 0x00400
94#define NLDLY 0000140084#define TAB2 0x00800
95#define NL0 0000000085#define TAB3 0x00c00
96#define NL1 0000040086#define XTABS 0x00c00 /* required by POSIX to == TAB3 */
97#define NL2 0000100087#define CRDLY 0x03000
98#define NL3 0000140088#define CR0 0x00000
99#define TABDLY 0000600089#define CR1 0x01000
100#define TAB0 0000000090#define CR2 0x02000
101#define TAB1 0000200091#define CR3 0x03000
102#define TAB2 0000400092#define FFDLY 0x04000
103#define TAB3 0000600093#define FF0 0x00000
104#define XTABS 00006000 /* required by POSIX to == TAB3 */94#define FF1 0x04000
105#define CRDLY 0003000095#define BSDLY 0x08000
106#define CR0 0000000096#define BS0 0x00000
107#define CR1 0001000097#define BS1 0x08000
108#define CR2 0002000098#define VTDLY 0x10000
109#define CR3 0003000099#define VT0 0x00000
110#define FFDLY 00040000100#define VT1 0x10000
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
119101
120/* c_cflag bit meaning */102/* c_cflag bit meaning */
121#define CBAUD 0000377103#define CBAUD 0x000000ff
122#define B0 0000000 /* hang up */104#define CBAUDEX 0x00000000
123#define B50 0000001105#define BOTHER 0x0000001f
124#define B75 0000002106#define B57600 0x00000010
125#define B110 0000003107#define B115200 0x00000011
126#define B134 0000004108#define B230400 0x00000012
127#define B150 0000005109#define B460800 0x00000013
128#define B200 0000006110#define B500000 0x00000014
129#define B300 0000007111#define B576000 0x00000015
130#define B600 0000010112#define B921600 0x00000016
131#define B1200 0000011113#define B1000000 0x00000017
132#define B1800 0000012114#define B1152000 0x00000018
133#define B2400 0000013115#define B1500000 0x00000019
134#define B4800 0000014116#define B2000000 0x0000001a
135#define B9600 0000015117#define B2500000 0x0000001b
136#define B19200 0000016118#define B3000000 0x0000001c
137#define B38400 0000017119#define B3500000 0x0000001d
138#define EXTA B19200120#define B4000000 0x0000001e
139#define EXTB B38400121#define CSIZE 0x00000300
140#define CBAUDEX 0000000122#define CS5 0x00000000
141#define B57600 00020123#define CS6 0x00000100
142#define B115200 00021124#define CS7 0x00000200
143#define B230400 00022125#define CS8 0x00000300
144#define B460800 00023126#define CSTOPB 0x00000400
145#define B500000 00024127#define CREAD 0x00000800
146#define B576000 00025128#define PARENB 0x00001000
147#define B921600 00026129#define PARODD 0x00002000
148#define B1000000 00027130#define HUPCL 0x00004000
149#define B1152000 00030131#define CLOCAL 0x00008000
150#define B1500000 00031132#define CIBAUD 0x00ff0000
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 */
176133
177/* c_lflag bits */134/* c_lflag bits */
178#define ISIG 0x00000080135#define ISIG 0x00000080
...@@ -192,17 +149,6 @@ struct ktermios {...@@ -192,17 +149,6 @@ struct ktermios {
192#define IEXTEN 0x00000400149#define IEXTEN 0x00000400
193#define EXTPROC 0x10000000150#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
206/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */152/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
207#define TCSANOW 0153#define TCSANOW 0
208#define TCSADRAIN 1154#define TCSADRAIN 1
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+1
...@@ -431,6 +431,7 @@...@@ -431,6 +431,7 @@
431#define __NR_landlock_restrict_self 446431#define __NR_landlock_restrict_self 446
432#define __NR_process_mrelease 448432#define __NR_process_mrelease 448
433#define __NR_futex_waitv 449433#define __NR_futex_waitv 449
434#define __NR_set_mempolicy_home_node 450
434435
435436
436#endif /* _ASM_UNISTD_32_H */437#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 @@...@@ -403,6 +403,7 @@
403#define __NR_landlock_restrict_self 446403#define __NR_landlock_restrict_self 446
404#define __NR_process_mrelease 448404#define __NR_process_mrelease 448
405#define __NR_futex_waitv 449405#define __NR_futex_waitv 449
406#define __NR_set_mempolicy_home_node 450
406407
407408
408#endif /* _ASM_UNISTD_64_H */409#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 @@...@@ -30,8 +30,10 @@
30#define AT_L1D_CACHEGEOMETRY 4330#define AT_L1D_CACHEGEOMETRY 43
31#define AT_L2_CACHESIZE 4431#define AT_L2_CACHESIZE 44
32#define AT_L2_CACHEGEOMETRY 4532#define AT_L2_CACHEGEOMETRY 45
33#define AT_L3_CACHESIZE 46
34#define AT_L3_CACHEGEOMETRY 47
3335
34/* entries in ARCH_DLINFO */36/* entries in ARCH_DLINFO */
35#define AT_VECTOR_SIZE_ARCH 737#define AT_VECTOR_SIZE_ARCH 9
3638
37#endif /* _ASM_RISCV_AUXVEC_H */39#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 {...@@ -48,6 +48,10 @@ struct kvm_sregs {
48/* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */48/* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
49struct kvm_riscv_config {49struct kvm_riscv_config {
50 unsigned long isa;50 unsigned long isa;
51 unsigned long zicbom_block_size;
52 unsigned long mvendorid;
53 unsigned long marchid;
54 unsigned long mimpid;
51};55};
5256
53/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */57/* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
...@@ -82,6 +86,28 @@ struct kvm_riscv_timer {...@@ -82,6 +86,28 @@ struct kvm_riscv_timer {
82 __u64 state;86 __u64 state;
83};87};
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
85/* Possible states for kvm_riscv_timer */111/* Possible states for kvm_riscv_timer */
86#define KVM_RISCV_TIMER_STATE_OFF 0112#define KVM_RISCV_TIMER_STATE_OFF 0
87#define KVM_RISCV_TIMER_STATE_ON 1113#define KVM_RISCV_TIMER_STATE_ON 1
...@@ -123,6 +149,9 @@ struct kvm_riscv_timer {...@@ -123,6 +149,9 @@ struct kvm_riscv_timer {
123#define KVM_REG_RISCV_FP_D_REG(name) \149#define KVM_REG_RISCV_FP_D_REG(name) \
124 (offsetof(struct __riscv_d_ext_state, name) / sizeof(__u64))150 (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
126#endif155#endif
127156
128#endif /* __LINUX_KVM_RISCV_H */157#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 {...@@ -15,19 +15,23 @@ struct ucontext {
15 struct ucontext *uc_link;15 struct ucontext *uc_link;
16 stack_t uc_stack;16 stack_t uc_stack;
17 sigset_t uc_sigmask;17 sigset_t uc_sigmask;
18 /* There's some padding here to allow sigset_t to be expanded in the18 /*
19 * There's some padding here to allow sigset_t to be expanded in the
19 * future. Though this is unlikely, other architectures put uc_sigmask20 * future. Though this is unlikely, other architectures put uc_sigmask
20 * at the end of this structure and explicitly state it can be21 * 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 */
22 __u8 __unused[1024 / 8 - sizeof(sigset_t)];24 __u8 __unused[1024 / 8 - sizeof(sigset_t)];
23 /* We can't put uc_sigmask at the end of this structure because we need25 /*
26 * We can't put uc_sigmask at the end of this structure because we need
24 * to be able to expand sigcontext in the future. For example, the27 * to be able to expand sigcontext in the future. For example, the
25 * vector ISA extension will almost certainly add ISA state. We want28 * vector ISA extension will almost certainly add ISA state. We want
26 * to ensure all user-visible ISA state can be saved and restored via a29 * to ensure all user-visible ISA state can be saved and restored via a
27 * ucontext, so we're putting this at the end in order to allow for30 * ucontext, so we're putting this at the end in order to allow for
28 * infinite extensibility. Since we know this will be extended and we31 * infinite extensibility. Since we know this will be extended and we
29 * assume sigset_t won't be extended an extreme amount, we're32 * assume sigset_t won't be extended an extreme amount, we're
30 * prioritizing this. */33 * prioritizing this.
34 */
31 struct sigcontext uc_mcontext;35 struct sigcontext uc_mcontext;
32};36};
3337
lib/libc/include/riscv-linux-any/asm/unistd.h+2-1
...@@ -15,12 +15,13 @@...@@ -15,12 +15,13 @@
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */16 */
1717
18#ifdef __LP64__18#if defined(__LP64__) && !defined(__SYSCALL_COMPAT)
19#define __ARCH_WANT_NEW_STAT19#define __ARCH_WANT_NEW_STAT
20#define __ARCH_WANT_SET_GET_RLIMIT20#define __ARCH_WANT_SET_GET_RLIMIT
21#endif /* __LP64__ */21#endif /* __LP64__ */
2222
23#define __ARCH_WANT_SYS_CLONE323#define __ARCH_WANT_SYS_CLONE3
24#define __ARCH_WANT_MEMFD_SECRET
2425
25#include <asm-generic/unistd.h>26#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 {...@@ -182,6 +182,18 @@ typedef struct format_data_t {
182 unsigned int intensity;182 unsigned int intensity;
183} format_data_t;183} 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
185/*197/*
186 * values to be used for format_data_t.intensity198 * values to be used for format_data_t.intensity
187 * 0/8: normal format199 * 0/8: normal format
...@@ -326,6 +338,8 @@ struct dasd_snid_ioctl_data {...@@ -326,6 +338,8 @@ struct dasd_snid_ioctl_data {
326#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)338#define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t)
327/* Release Allocated Space */339/* Release Allocated Space */
328#define BIODASDRAS _IOW(DASD_IOCTL_LETTER, 3, format_data_t)340#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
330/* Get Sense Path Group ID (SNID) data */344/* Get Sense Path Group ID (SNID) data */
331#define BIODASDSNID _IOWR(DASD_IOCTL_LETTER, 1, struct dasd_snid_ioctl_data)345#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 */...@@ -30,18 +30,18 @@ struct s390_ctrset_start { /* Set CPUs to operate on */
30struct s390_ctrset_setdata { /* Counter set data */30struct s390_ctrset_setdata { /* Counter set data */
31 __u32 set; /* Counter set number */31 __u32 set; /* Counter set number */
32 __u32 no_cnts; /* # of counters stored in cv[] */32 __u32 no_cnts; /* # of counters stored in cv[] */
33 __u64 cv[0]; /* Counter values (variable length) */33 __u64 cv[]; /* Counter values (variable length) */
34};34};
3535
36struct s390_ctrset_cpudata { /* Counter set data per CPU */36struct s390_ctrset_cpudata { /* Counter set data per CPU */
37 __u32 cpu_nr; /* CPU number */37 __u32 cpu_nr; /* CPU number */
38 __u32 no_sets; /* # of counters sets in data[] */38 __u32 no_sets; /* # of counters sets in data[] */
39 struct s390_ctrset_setdata data[0];39 struct s390_ctrset_setdata data[];
40};40};
4141
42struct s390_ctrset_read { /* Structure to get all ctr sets */42struct s390_ctrset_read { /* Structure to get all ctr sets */
43 __u64 no_cpus; /* Total # of CPUs data taken from */43 __u64 no_cpus; /* Total # of CPUs data taken from */
44 struct s390_ctrset_cpudata data[0];44 struct s390_ctrset_cpudata data[];
45};45};
4646
47#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */47#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 {...@@ -27,6 +27,7 @@ enum ipl_pbt {
27 IPL_PBT_FCP = 0,27 IPL_PBT_FCP = 0,
28 IPL_PBT_SCP_DATA = 1,28 IPL_PBT_SCP_DATA = 1,
29 IPL_PBT_CCW = 2,29 IPL_PBT_CCW = 2,
30 IPL_PBT_ECKD = 3,
30 IPL_PBT_NVME = 4,31 IPL_PBT_NVME = 4,
31};32};
3233
...@@ -111,6 +112,34 @@ struct ipl_pb0_ccw {...@@ -111,6 +112,34 @@ struct ipl_pb0_ccw {
111 __u8 reserved5[8];112 __u8 reserved5[8];
112} __attribute__((packed));113} __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
114#define IPL_PB0_CCW_VM_FLAG_NSS 0x80143#define IPL_PB0_CCW_VM_FLAG_NSS 0x80
115#define IPL_PB0_CCW_VM_FLAG_VP 0x40144#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 {...@@ -74,6 +74,7 @@ struct kvm_s390_io_adapter_req {
74#define KVM_S390_VM_CRYPTO 274#define KVM_S390_VM_CRYPTO 2
75#define KVM_S390_VM_CPU_MODEL 375#define KVM_S390_VM_CPU_MODEL 3
76#define KVM_S390_VM_MIGRATION 476#define KVM_S390_VM_MIGRATION 4
77#define KVM_S390_VM_CPU_TOPOLOGY 5
7778
78/* kvm attributes for mem_ctrl */79/* kvm attributes for mem_ctrl */
79#define KVM_S390_VM_MEM_ENABLE_CMMA 080#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 {...@@ -171,7 +171,7 @@ struct pkey_skey2pkey {
171#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)171#define PKEY_SKEY2PKEY _IOWR(PKEY_IOCTL_MAGIC, 0x06, struct pkey_skey2pkey)
172172
173/*173/*
174 * Verify the given CCA AES secure key for being able to be useable with174 * Verify the given CCA AES secure key for being able to be usable with
175 * the pkey module. Check for correct key type and check for having at175 * the pkey module. Check for correct key type and check for having at
176 * least one crypto card being able to handle this key (master key176 * least one crypto card being able to handle this key (master key
177 * or old master key verification pattern matches).177 * 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 {...@@ -104,7 +104,7 @@ struct sigaction {
104typedef struct sigaltstack {104typedef struct sigaltstack {
105 void *ss_sp;105 void *ss_sp;
106 int ss_flags;106 int ss_flags;
107 size_t ss_size;107 __kernel_size_t ss_size;
108} stack_t;108} 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 @@...@@ -12,15 +12,18 @@
1212
13#ifndef __ASSEMBLY__13#ifndef __ASSEMBLY__
1414
15/* A address type so that arithmetic can be done on it & it can be upgraded to15typedef unsigned long addr_t;
16 64 bit when necessary
17*/
18typedef unsigned long addr_t;
19typedef __signed__ long saddr_t;16typedef __signed__ long saddr_t;
2017
21typedef struct {18typedef struct {
22 __u32 u[4];19 union {
23} __vector128;20 struct {
21 __u64 high;
22 __u64 low;
23 };
24 __u32 u[4];
25 };
26} __attribute__((packed, aligned(4))) __vector128;
2427
25#endif /* __ASSEMBLY__ */28#endif /* __ASSEMBLY__ */
2629
lib/libc/include/s390x-linux-any/asm/unistd_32.h+1
...@@ -421,5 +421,6 @@...@@ -421,5 +421,6 @@
421#define __NR_landlock_restrict_self 446421#define __NR_landlock_restrict_self 446
422#define __NR_process_mrelease 448422#define __NR_process_mrelease 448
423#define __NR_futex_waitv 449423#define __NR_futex_waitv 449
424#define __NR_set_mempolicy_home_node 450
424425
425#endif /* _ASM_S390_UNISTD_32_H */426#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 @@...@@ -369,5 +369,6 @@
369#define __NR_landlock_restrict_self 446369#define __NR_landlock_restrict_self 446
370#define __NR_process_mrelease 448370#define __NR_process_mrelease 448
371#define __NR_futex_waitv 449371#define __NR_futex_waitv 449
372#define __NR_set_mempolicy_home_node 450
372373
373#endif /* _ASM_S390_UNISTD_64_H */374#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 @@...@@ -4,7 +4,7 @@
4 *4 *
5 * zcrypt 2.2.1 (user-visible header)5 * zcrypt 2.2.1 (user-visible header)
6 *6 *
7 * Copyright IBM Corp. 2001, 20197 * Copyright IBM Corp. 2001, 2022
8 * Author(s): Robert Burroughs8 * Author(s): Robert Burroughs
9 * Eric Rossman (edrossma@us.ibm.com)9 * Eric Rossman (edrossma@us.ibm.com)
10 *10 *
...@@ -85,7 +85,8 @@ struct ica_rsa_modexpo_crt {...@@ -85,7 +85,8 @@ struct ica_rsa_modexpo_crt {
85struct CPRBX {85struct CPRBX {
86 __u16 cprb_len; /* CPRB length 220 */86 __u16 cprb_len; /* CPRB length 220 */
87 __u8 cprb_ver_id; /* CPRB version id. 0x02 */87 __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 */
89 __u8 func_id[2]; /* function id 0x5432 */90 __u8 func_id[2]; /* function id 0x5432 */
90 __u8 cprb_flags[4]; /* Flags */91 __u8 cprb_flags[4]; /* Flags */
91 __u32 req_parml; /* request parameter buffer len */92 __u32 req_parml; /* request parameter buffer len */
...@@ -95,19 +96,19 @@ struct CPRBX {...@@ -95,19 +96,19 @@ struct CPRBX {
95 __u32 rpl_datal; /* reply data block len */96 __u32 rpl_datal; /* reply data block len */
96 __u32 rpld_datal; /* replied data block len */97 __u32 rpld_datal; /* replied data block len */
97 __u32 req_extbl; /* request extension block len */98 __u32 req_extbl; /* request extension block len */
98 __u8 pad_001[4]; /* reserved */99 __u8 _pad_001[4]; /* reserved */
99 __u32 rpld_extbl; /* replied extension block len */100 __u32 rpld_extbl; /* replied extension block len */
100 __u8 padx000[16 - sizeof(__u8 *)];101 __u8 _pad_002[16 - sizeof(__u8 *)];
101 __u8 *req_parmb; /* request parm block 'address' */102 __u8 *req_parmb; /* request parm block 'address' */
102 __u8 padx001[16 - sizeof(__u8 *)];103 __u8 _pad_003[16 - sizeof(__u8 *)];
103 __u8 *req_datab; /* request data block 'address' */104 __u8 *req_datab; /* request data block 'address' */
104 __u8 padx002[16 - sizeof(__u8 *)];105 __u8 _pad_004[16 - sizeof(__u8 *)];
105 __u8 *rpl_parmb; /* reply parm block 'address' */106 __u8 *rpl_parmb; /* reply parm block 'address' */
106 __u8 padx003[16 - sizeof(__u8 *)];107 __u8 _pad_005[16 - sizeof(__u8 *)];
107 __u8 *rpl_datab; /* reply data block 'address' */108 __u8 *rpl_datab; /* reply data block 'address' */
108 __u8 padx004[16 - sizeof(__u8 *)];109 __u8 _pad_006[16 - sizeof(__u8 *)];
109 __u8 *req_extb; /* request extension block 'addr'*/110 __u8 *req_extb; /* request extension block 'addr'*/
110 __u8 padx005[16 - sizeof(__u8 *)];111 __u8 _pad_007[16 - sizeof(__u8 *)];
111 __u8 *rpl_extb; /* reply extension block 'address'*/112 __u8 *rpl_extb; /* reply extension block 'address'*/
112 __u16 ccp_rtcode; /* server return code */113 __u16 ccp_rtcode; /* server return code */
113 __u16 ccp_rscode; /* server reason code */114 __u16 ccp_rscode; /* server reason code */
...@@ -115,12 +116,10 @@ struct CPRBX {...@@ -115,12 +116,10 @@ struct CPRBX {
115 __u8 logon_id[8]; /* Logon Identifier */116 __u8 logon_id[8]; /* Logon Identifier */
116 __u8 mac_value[8]; /* Mac Value */117 __u8 mac_value[8]; /* Mac Value */
117 __u8 mac_content_flgs; /* Mac content flag byte */118 __u8 mac_content_flgs; /* Mac content flag byte */
118 __u8 pad_002; /* Alignment */119 __u8 _pad_008; /* Alignment */
119 __u16 domain; /* Domain */120 __u16 domain; /* Domain */
120 __u8 usage_domain[4]; /* Usage domain */121 __u8 _pad_009[12]; /* reserved, checked for zeros */
121 __u8 cntrl_domain[4]; /* Control domain */122 __u8 _pad_010[36]; /* reserved */
122 __u8 S390enf_mask[4]; /* S/390 enforcement mask */
123 __u8 pad_004[36]; /* reserved */
124} __attribute__((packed));123} __attribute__((packed));
125124
126/**125/**
...@@ -238,8 +237,8 @@ struct zcrypt_device_matrix_ext {...@@ -238,8 +237,8 @@ struct zcrypt_device_matrix_ext {
238};237};
239238
240#define AUTOSELECT 0xFFFFFFFF239#define AUTOSELECT 0xFFFFFFFF
241#define AUTOSEL_AP ((__u16) 0xFFFF)240#define AUTOSEL_AP ((__u16)0xFFFF)
242#define AUTOSEL_DOM ((__u16) 0xFFFF)241#define AUTOSEL_DOM ((__u16)0xFFFF)
243242
244#define ZCRYPT_IOCTL_MAGIC 'z'243#define ZCRYPT_IOCTL_MAGIC 'z'
245244
...@@ -288,7 +287,7 @@ struct zcrypt_device_matrix_ext {...@@ -288,7 +287,7 @@ struct zcrypt_device_matrix_ext {
288 * 0x08: CEX3A287 * 0x08: CEX3A
289 * 0x0a: CEX4288 * 0x0a: CEX4
290 * 0x0b: CEX5289 * 0x0b: CEX5
291 * 0x0c: CEX6 and CEX7290 * 0x0c: CEX6, CEX7 or CEX8
292 * 0x0d: device is disabled291 * 0x0d: device is disabled
293 *292 *
294 * ZCRYPT_QDEPTH_MASK293 * ZCRYPT_QDEPTH_MASK
...@@ -305,12 +304,12 @@ struct zcrypt_device_matrix_ext {...@@ -305,12 +304,12 @@ struct zcrypt_device_matrix_ext {
305/**304/**
306 * Supported ioctl calls305 * Supported ioctl calls
307 */306 */
308#define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, ZCRYPT_IOCTL_MAGIC, 0x05, 0)307#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)308#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)309#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)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)
314#define ZCRYPT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x58, char[MAX_ZDEV_CARDIDS_EXT])313#define ZCRYPT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x58, char[MAX_ZDEV_CARDIDS_EXT])
315#define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])314#define ZCRYPT_QDEPTH_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x59, char[MAX_ZDEV_CARDIDS_EXT])
316#define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])315#define ZCRYPT_PERDEV_REQCNT _IOR(ZCRYPT_IOCTL_MAGIC, 0x5a, int[MAX_ZDEV_CARDIDS_EXT])
...@@ -352,7 +351,7 @@ struct zcrypt_device_matrix {...@@ -352,7 +351,7 @@ struct zcrypt_device_matrix {
352};351};
353352
354/* Deprecated: use ZCRYPT_DEVICE_STATUS */353/* 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)
356/* Deprecated: use ZCRYPT_STATUS_MASK */355/* Deprecated: use ZCRYPT_STATUS_MASK */
357#define Z90STAT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x48, char[64])356#define Z90STAT_STATUS_MASK _IOR(ZCRYPT_IOCTL_MAGIC, 0x48, char[64])
358/* Deprecated: use ZCRYPT_QDEPTH_MASK */357/* Deprecated: use ZCRYPT_QDEPTH_MASK */
lib/libc/include/sparc-linux-any/asm/shmbuf.h+4-1
...@@ -2,6 +2,9 @@...@@ -2,6 +2,9 @@
2#ifndef _SPARC_SHMBUF_H2#ifndef _SPARC_SHMBUF_H
3#define _SPARC_SHMBUF_H3#define _SPARC_SHMBUF_H
44
5#include <asm/ipcbuf.h>
6#include <asm/posix_types.h>
7
5/* 8/*
6 * The shmid64_ds structure for sparc architecture.9 * The shmid64_ds structure for sparc architecture.
7 * Note extra padding because this structure is passed back and forth10 * Note extra padding because this structure is passed back and forth
...@@ -25,7 +28,7 @@ struct shmid64_ds {...@@ -25,7 +28,7 @@ struct shmid64_ds {
25 unsigned long shm_ctime_high;28 unsigned long shm_ctime_high;
26 unsigned long shm_ctime; /* last change time */29 unsigned long shm_ctime; /* last change time */
27#endif30#endif
28 size_t shm_segsz; /* size of segment (bytes) */31 __kernel_size_t shm_segsz; /* size of segment (bytes) */
29 __kernel_pid_t shm_cpid; /* pid of creator */32 __kernel_pid_t shm_cpid; /* pid of creator */
30 __kernel_pid_t shm_lpid; /* pid of last operator */33 __kernel_pid_t shm_lpid; /* pid of last operator */
31 unsigned long shm_nattch; /* no. of current attaches */34 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 {...@@ -151,6 +151,7 @@ struct sigstack {
151151
152152
153#include <asm-generic/signal-defs.h>153#include <asm-generic/signal-defs.h>
154#include <asm/posix_types.h>
154155
155struct __new_sigaction {156struct __new_sigaction {
156 __sighandler_t sa_handler;157 __sighandler_t sa_handler;
...@@ -169,7 +170,7 @@ struct __old_sigaction {...@@ -169,7 +170,7 @@ struct __old_sigaction {
169typedef struct sigaltstack {170typedef struct sigaltstack {
170 void *ss_sp;171 void *ss_sp;
171 int ss_flags;172 int ss_flags;
172 size_t ss_size;173 __kernel_size_t ss_size;
173} stack_t;174} stack_t;
174175
175176
lib/libc/include/sparc-linux-any/asm/socket.h+3
...@@ -126,6 +126,9 @@...@@ -126,6 +126,9 @@
126126
127#define SO_RESERVE_MEM 0x0052127#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 @@...@@ -8,11 +8,11 @@
8/* 64 bit sparc */8/* 64 bit sparc */
9struct stat {9struct stat {
10 unsigned int st_dev;10 unsigned int st_dev;
11 ino_t st_ino;11 __kernel_ino_t st_ino;
12 mode_t st_mode;12 __kernel_mode_t st_mode;
13 short st_nlink;13 short st_nlink;
14 uid_t st_uid;14 __kernel_uid32_t st_uid;
15 gid_t st_gid;15 __kernel_gid32_t st_gid;
16 unsigned int st_rdev;16 unsigned int st_rdev;
17 long st_size;17 long st_size;
18 long st_atime;18 long st_atime;
...@@ -51,8 +51,8 @@ struct stat64 {...@@ -51,8 +51,8 @@ struct stat64 {
51/* 32 bit sparc */51/* 32 bit sparc */
52struct stat {52struct stat {
53 unsigned short st_dev;53 unsigned short st_dev;
54 ino_t st_ino;54 __kernel_ino_t st_ino;
55 mode_t st_mode;55 __kernel_mode_t st_mode;
56 short st_nlink;56 short st_nlink;
57 unsigned short st_uid;57 unsigned short st_uid;
58 unsigned short st_gid;58 unsigned short st_gid;
lib/libc/include/sparc-linux-any/asm/termbits.h+84-139
...@@ -2,15 +2,12 @@...@@ -2,15 +2,12 @@
2#ifndef _SPARC_TERMBITS_H2#ifndef _SPARC_TERMBITS_H
3#define _SPARC_TERMBITS_H3#define _SPARC_TERMBITS_H
44
5#include <linux/posix_types.h>5#include <asm-generic/termbits-common.h>
6
7typedef unsigned char cc_t;
8typedef unsigned int speed_t;
96
10#if defined(__sparc__) && defined(__arch64__)7#if defined(__sparc__) && defined(__arch64__)
11typedef unsigned int tcflag_t;8typedef unsigned int tcflag_t;
12#else9#else
13typedef unsigned long tcflag_t;10typedef unsigned long tcflag_t;
14#endif11#endif
1512
16#define NCC 813#define NCC 8
...@@ -56,21 +53,19 @@ struct ktermios {...@@ -56,21 +53,19 @@ struct ktermios {
56};53};
5754
58/* c_cc characters */55/* c_cc characters */
59#define VINTR 056#define VINTR 0
60#define VQUIT 157#define VQUIT 1
61#define VERASE 258#define VERASE 2
62#define VKILL 359#define VKILL 3
63#define VEOF 460#define VEOF 4
64#define VEOL 561#define VEOL 5
65#define VEOL2 662#define VEOL2 6
66#define VSWTC 763#define VSWTC 7
67#define VSTART 864#define VSTART 8
68#define VSTOP 965#define VSTOP 9
69
70
7166
72#define VSUSP 1067#define VSUSP 10
73#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */68#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */
74#define VREPRINT 1269#define VREPRINT 12
75#define VDISCARD 1370#define VDISCARD 13
76#define VWERASE 1471#define VWERASE 14
...@@ -83,121 +78,83 @@ struct ktermios {...@@ -83,121 +78,83 @@ struct ktermios {
83#define VTIME VEOL78#define VTIME VEOL
8479
85/* c_iflag bits */80/* c_iflag bits */
86#define IGNBRK 0x0000000181#define IUCLC 0x0200
87#define BRKINT 0x0000000282#define IXON 0x0400
88#define IGNPAR 0x0000000483#define IXOFF 0x1000
89#define PARMRK 0x0000000884#define IMAXBEL 0x2000
90#define INPCK 0x0000001085#define IUTF8 0x4000
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
10186
102/* c_oflag bits */87/* c_oflag bits */
103#define OPOST 0x0000000188#define OLCUC 0x00002
104#define OLCUC 0x0000000289#define ONLCR 0x00004
105#define ONLCR 0x0000000490#define NLDLY 0x00100
106#define OCRNL 0x0000000891#define NL0 0x00000
107#define ONOCR 0x0000001092#define NL1 0x00100
108#define ONLRET 0x0000002093#define CRDLY 0x00600
109#define OFILL 0x0000004094#define CR0 0x00000
110#define OFDEL 0x0000008095#define CR1 0x00200
111#define NLDLY 0x0000010096#define CR2 0x00400
112#define NL0 0x0000000097#define CR3 0x00600
113#define NL1 0x0000010098#define TABDLY 0x01800
114#define CRDLY 0x0000060099#define TAB0 0x00000
115#define CR0 0x00000000100#define TAB1 0x00800
116#define CR1 0x00000200101#define TAB2 0x01000
117#define CR2 0x00000400102#define TAB3 0x01800
118#define CR3 0x00000600103#define XTABS 0x01800
119#define TABDLY 0x00001800104#define BSDLY 0x02000
120#define TAB0 0x00000000105#define BS0 0x00000
121#define TAB1 0x00000800106#define BS1 0x02000
122#define TAB2 0x00001000107#define VTDLY 0x04000
123#define TAB3 0x00001800108#define VT0 0x00000
124#define XTABS 0x00001800109#define VT1 0x04000
125#define BSDLY 0x00002000110#define FFDLY 0x08000
126#define BS0 0x00000000111#define FF0 0x00000
127#define BS1 0x00002000112#define FF1 0x08000
128#define VTDLY 0x00004000113#define PAGEOUT 0x10000 /* SUNOS specific */
129#define VT0 0x00000000114#define WRAP 0x20000 /* SUNOS specific */
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 */
136115
137/* c_cflag bit meaning */116/* c_cflag bit meaning */
138#define CBAUD 0x0000100f117#define CBAUD 0x0000100f
139#define B0 0x00000000 /* hang up */118#define CSIZE 0x00000030
140#define B50 0x00000001119#define CS5 0x00000000
141#define B75 0x00000002120#define CS6 0x00000010
142#define B110 0x00000003121#define CS7 0x00000020
143#define B134 0x00000004122#define CS8 0x00000030
144#define B150 0x00000005123#define CSTOPB 0x00000040
145#define B200 0x00000006124#define CREAD 0x00000080
146#define B300 0x00000007125#define PARENB 0x00000100
147#define B600 0x00000008126#define PARODD 0x00000200
148#define B1200 0x00000009127#define HUPCL 0x00000400
149#define B1800 0x0000000a128#define CLOCAL 0x00000800
150#define B2400 0x0000000b129#define CBAUDEX 0x00001000
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
169/* We'll never see these speeds with the Zilogs, but for completeness... */130/* We'll never see these speeds with the Zilogs, but for completeness... */
170#define BOTHER 0x00001000131#define BOTHER 0x00001000
171#define B57600 0x00001001132#define B57600 0x00001001
172#define B115200 0x00001002133#define B115200 0x00001002
173#define B230400 0x00001003134#define B230400 0x00001003
174#define B460800 0x00001004135#define B460800 0x00001004
175/* This is what we can do with the Zilogs. */136/* This is what we can do with the Zilogs. */
176#define B76800 0x00001005137#define B76800 0x00001005
177/* This is what we can do with the SAB82532. */138/* This is what we can do with the SAB82532. */
178#define B153600 0x00001006139#define B153600 0x00001006
179#define B307200 0x00001007140#define B307200 0x00001007
180#define B614400 0x00001008141#define B614400 0x00001008
181#define B921600 0x00001009142#define B921600 0x00001009
182/* And these are the rest... */143/* And these are the rest... */
183#define B500000 0x0000100a144#define B500000 0x0000100a
184#define B576000 0x0000100b145#define B576000 0x0000100b
185#define B1000000 0x0000100c146#define B1000000 0x0000100c
186#define B1152000 0x0000100d147#define B1152000 0x0000100d
187#define B1500000 0x0000100e148#define B1500000 0x0000100e
188#define B2000000 0x0000100f149#define B2000000 0x0000100f
189/* These have totally bogus values and nobody uses them150/* These have totally bogus values and nobody uses them
190 so far. Later on we'd have to use say 0x10000x and151 so far. Later on we'd have to use say 0x10000x and
191 adjust CBAUD constant and drivers accordingly.152 adjust CBAUD constant and drivers accordingly.
192#define B2500000 0x00001010153#define B2500000 0x00001010
193#define B3000000 0x00001011154#define B3000000 0x00001011
194#define B3500000 0x00001012155#define B3500000 0x00001012
195#define B4000000 0x00001013 */156#define B4000000 0x00001013 */
196#define CIBAUD 0x100f0000 /* input baud rate (not used) */157#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 */
201158
202/* c_lflag bits */159/* c_lflag bits */
203#define ISIG 0x00000001160#define ISIG 0x00000001
...@@ -212,7 +169,7 @@ struct ktermios {...@@ -212,7 +169,7 @@ struct ktermios {
212#define ECHOCTL 0x00000200169#define ECHOCTL 0x00000200
213#define ECHOPRT 0x00000400170#define ECHOPRT 0x00000400
214#define ECHOKE 0x00000800171#define ECHOKE 0x00000800
215#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */172#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */
216#define FLUSHO 0x00002000173#define FLUSHO 0x00002000
217#define PENDIN 0x00004000174#define PENDIN 0x00004000
218#define IEXTEN 0x00008000175#define IEXTEN 0x00008000
...@@ -237,21 +194,9 @@ struct ktermios {...@@ -237,21 +194,9 @@ struct ktermios {
237/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */194/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
238#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */195#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
252/* tcsetattr uses these */197/* tcsetattr uses these */
253#define TCSANOW 0198#define TCSANOW 0
254#define TCSADRAIN 1199#define TCSADRAIN 1
255#define TCSAFLUSH 2200#define TCSAFLUSH 2
256201
257#endif /* _SPARC_TERMBITS_H */202#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 @@...@@ -419,6 +419,7 @@
419#define __NR_landlock_restrict_self 446419#define __NR_landlock_restrict_self 446
420#define __NR_process_mrelease 448420#define __NR_process_mrelease 448
421#define __NR_futex_waitv 449421#define __NR_futex_waitv 449
422#define __NR_set_mempolicy_home_node 450
422423
423424
424#endif /* _ASM_UNISTD_32_H */425#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 @@...@@ -382,6 +382,7 @@
382#define __NR_landlock_restrict_self 446382#define __NR_landlock_restrict_self 446
383#define __NR_process_mrelease 448383#define __NR_process_mrelease 448
384#define __NR_futex_waitv 449384#define __NR_futex_waitv 449
385#define __NR_set_mempolicy_home_node 450
385386
386387
387#endif /* _ASM_UNISTD_64_H */388#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 @@...@@ -10,11 +10,13 @@
10#define SETUP_EFI 410#define SETUP_EFI 4
11#define SETUP_APPLE_PROPERTIES 511#define SETUP_APPLE_PROPERTIES 5
12#define SETUP_JAILHOUSE 612#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
14#define SETUP_INDIRECT (1<<31)18#define SETUP_INDIRECT (1<<31)
1519#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
16/* SETUP_INDIRECT | max(SETUP_*) */
17#define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE)
1820
19/* ram_size flags */21/* ram_size flags */
20#define RAMDISK_IMAGE_START_MASK 0x07FF22#define RAMDISK_IMAGE_START_MASK 0x07FF
...@@ -51,7 +53,7 @@ struct setup_data {...@@ -51,7 +53,7 @@ struct setup_data {
51 __u64 next;53 __u64 next;
52 __u32 type;54 __u32 type;
53 __u32 len;55 __u32 len;
54 __u8 data[0];56 __u8 data[];
55};57};
5658
57/* extensible setup indirect data node */59/* extensible setup indirect data node */
...@@ -171,6 +173,14 @@ struct jailhouse_setup_data {...@@ -171,6 +173,14 @@ struct jailhouse_setup_data {
171 } __attribute__((packed)) v2;173 } __attribute__((packed)) v2;
172} __attribute__((packed));174} __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
174/* The so-called "zeropage" */184/* The so-called "zeropage" */
175struct boot_params {185struct boot_params {
176 struct screen_info screen_info; /* 0x000 */186 struct screen_info screen_info; /* 0x000 */
...@@ -187,7 +197,8 @@ struct boot_params {...@@ -187,7 +197,8 @@ struct boot_params {
187 __u32 ext_ramdisk_image; /* 0x0c0 */197 __u32 ext_ramdisk_image; /* 0x0c0 */
188 __u32 ext_ramdisk_size; /* 0x0c4 */198 __u32 ext_ramdisk_size; /* 0x0c4 */
189 __u32 ext_cmd_line_ptr; /* 0x0c8 */199 __u32 ext_cmd_line_ptr; /* 0x0c8 */
190 __u8 _pad4[116]; /* 0x0cc */200 __u8 _pad4[112]; /* 0x0cc */
201 __u32 cc_blob_address; /* 0x13c */
191 struct edid_info edid_info; /* 0x140 */202 struct edid_info edid_info; /* 0x140 */
192 struct efi_info efi_info; /* 0x1c0 */203 struct efi_info efi_info; /* 0x1c0 */
193 __u32 alt_mem_k; /* 0x1e0 */204 __u32 alt_mem_k; /* 0x1e0 */
lib/libc/include/x86-linux-any/asm/kvm.h+72-23
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
99
10#include <linux/types.h>10#include <linux/types.h>
11#include <linux/ioctl.h>11#include <linux/ioctl.h>
12#include <linux/stddef.h>
1213
13#define KVM_PIO_PAGE_OFFSET 114#define KVM_PIO_PAGE_OFFSET 1
14#define KVM_COALESCED_MMIO_PAGE_OFFSET 215#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
...@@ -53,14 +54,6 @@...@@ -53,14 +54,6 @@
53/* Architectural interrupt line count. */54/* Architectural interrupt line count. */
54#define KVM_NR_INTERRUPTS 25655#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
64/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */57/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
65struct kvm_pic_state {58struct kvm_pic_state {
66 __u8 last_irr; /* edge detection */59 __u8 last_irr; /* edge detection */
...@@ -198,13 +191,13 @@ struct kvm_msrs {...@@ -198,13 +191,13 @@ struct kvm_msrs {
198 __u32 nmsrs; /* number of msrs in entries */191 __u32 nmsrs; /* number of msrs in entries */
199 __u32 pad;192 __u32 pad;
200193
201 struct kvm_msr_entry entries[0];194 struct kvm_msr_entry entries[];
202};195};
203196
204/* for KVM_GET_MSR_INDEX_LIST */197/* for KVM_GET_MSR_INDEX_LIST */
205struct kvm_msr_list {198struct kvm_msr_list {
206 __u32 nmsrs; /* number of msrs in entries */199 __u32 nmsrs; /* number of msrs in entries */
207 __u32 indices[0];200 __u32 indices[];
208};201};
209202
210/* Maximum size of any access bitmap in bytes */203/* Maximum size of any access bitmap in bytes */
...@@ -214,6 +207,8 @@ struct kvm_msr_list {...@@ -214,6 +207,8 @@ struct kvm_msr_list {
214struct kvm_msr_filter_range {207struct kvm_msr_filter_range {
215#define KVM_MSR_FILTER_READ (1 << 0)208#define KVM_MSR_FILTER_READ (1 << 0)
216#define KVM_MSR_FILTER_WRITE (1 << 1)209#define KVM_MSR_FILTER_WRITE (1 << 1)
210#define KVM_MSR_FILTER_RANGE_VALID_MASK (KVM_MSR_FILTER_READ | \
211 KVM_MSR_FILTER_WRITE)
217 __u32 flags;212 __u32 flags;
218 __u32 nmsrs; /* number of msrs in bitmap */213 __u32 nmsrs; /* number of msrs in bitmap */
219 __u32 base; /* MSR index the bitmap starts at */214 __u32 base; /* MSR index the bitmap starts at */
...@@ -224,6 +219,7 @@ struct kvm_msr_filter_range {...@@ -224,6 +219,7 @@ struct kvm_msr_filter_range {
224struct kvm_msr_filter {219struct kvm_msr_filter {
225#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)220#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)
226#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)221#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)
222#define KVM_MSR_FILTER_VALID_MASK (KVM_MSR_FILTER_DEFAULT_DENY)
227 __u32 flags;223 __u32 flags;
228 struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];224 struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];
229};225};
...@@ -241,7 +237,7 @@ struct kvm_cpuid_entry {...@@ -241,7 +237,7 @@ struct kvm_cpuid_entry {
241struct kvm_cpuid {237struct kvm_cpuid {
242 __u32 nent;238 __u32 nent;
243 __u32 padding;239 __u32 padding;
244 struct kvm_cpuid_entry entries[0];240 struct kvm_cpuid_entry entries[];
245};241};
246242
247struct kvm_cpuid_entry2 {243struct kvm_cpuid_entry2 {
...@@ -263,7 +259,7 @@ struct kvm_cpuid_entry2 {...@@ -263,7 +259,7 @@ struct kvm_cpuid_entry2 {
263struct kvm_cpuid2 {259struct kvm_cpuid2 {
264 __u32 nent;260 __u32 nent;
265 __u32 padding;261 __u32 padding;
266 struct kvm_cpuid_entry2 entries[0];262 struct kvm_cpuid_entry2 entries[];
267};263};
268264
269/* for KVM_GET_PIT and KVM_SET_PIT */265/* for KVM_GET_PIT and KVM_SET_PIT */
...@@ -306,7 +302,8 @@ struct kvm_pit_state {...@@ -306,7 +302,8 @@ struct kvm_pit_state {
306 struct kvm_pit_channel_state channels[3];302 struct kvm_pit_channel_state channels[3];
307};303};
308304
309#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001305#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
306#define KVM_PIT_FLAGS_SPEAKER_DATA_ON 0x00000002
310307
311struct kvm_pit_state2 {308struct kvm_pit_state2 {
312 struct kvm_pit_channel_state channels[3];309 struct kvm_pit_channel_state channels[3];
...@@ -325,6 +322,7 @@ struct kvm_reinject_control {...@@ -325,6 +322,7 @@ struct kvm_reinject_control {
325#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004322#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
326#define KVM_VCPUEVENT_VALID_SMM 0x00000008323#define KVM_VCPUEVENT_VALID_SMM 0x00000008
327#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010324#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
325#define KVM_VCPUEVENT_VALID_TRIPLE_FAULT 0x00000020
328326
329/* Interrupt shadow states */327/* Interrupt shadow states */
330#define KVM_X86_SHADOW_INT_MOV_SS 0x01328#define KVM_X86_SHADOW_INT_MOV_SS 0x01
...@@ -359,7 +357,10 @@ struct kvm_vcpu_events {...@@ -359,7 +357,10 @@ struct kvm_vcpu_events {
359 __u8 smm_inside_nmi;357 __u8 smm_inside_nmi;
360 __u8 latched_init;358 __u8 latched_init;
361 } smi;359 } smi;
362 __u8 reserved[27];360 struct {
361 __u8 pending;
362 } triple_fault;
363 __u8 reserved[26];
363 __u8 exception_has_payload;364 __u8 exception_has_payload;
364 __u64 exception_payload;365 __u64 exception_payload;
365};366};
...@@ -373,9 +374,23 @@ struct kvm_debugregs {...@@ -373,9 +374,23 @@ struct kvm_debugregs {
373 __u64 reserved[9];374 __u64 reserved[9];
374};375};
375376
376/* for KVM_CAP_XSAVE */377/* for KVM_CAP_XSAVE and KVM_CAP_XSAVE2 */
377struct kvm_xsave {378struct 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 */
378 __u32 region[1024];392 __u32 region[1024];
393 __u32 extra[];
379};394};
380395
381#define KVM_MAX_XCRS 16396#define KVM_MAX_XCRS 16
...@@ -414,11 +429,13 @@ struct kvm_sync_regs {...@@ -414,11 +429,13 @@ struct kvm_sync_regs {
414 struct kvm_vcpu_events events;429 struct kvm_vcpu_events events;
415};430};
416431
417#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)432#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)
418#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)433#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1)
419#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)434#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE (1 << 2)
420#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)435#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
421#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)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
423#define KVM_STATE_NESTED_FORMAT_VMX 0440#define KVM_STATE_NESTED_FORMAT_VMX 0
424#define KVM_STATE_NESTED_FORMAT_SVM 1441#define KVM_STATE_NESTED_FORMAT_SVM 1
...@@ -438,6 +455,9 @@ struct kvm_sync_regs {...@@ -438,6 +455,9 @@ struct kvm_sync_regs {
438455
439#define KVM_STATE_VMX_PREEMPTION_TIMER_DEADLINE 0x00000001456#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
441struct kvm_vmx_nested_state_data {461struct kvm_vmx_nested_state_data {
442 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];462 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
443 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];463 __u8 shadow_vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
...@@ -486,8 +506,8 @@ struct kvm_nested_state {...@@ -486,8 +506,8 @@ struct kvm_nested_state {
486 * KVM_{GET,PUT}_NESTED_STATE ioctl values.506 * KVM_{GET,PUT}_NESTED_STATE ioctl values.
487 */507 */
488 union {508 union {
489 struct kvm_vmx_nested_state_data vmx[0];509 __DECLARE_FLEX_ARRAY(struct kvm_vmx_nested_state_data, vmx);
490 struct kvm_svm_nested_state_data svm[0];510 __DECLARE_FLEX_ARRAY(struct kvm_svm_nested_state_data, svm);
491 } data;511 } data;
492};512};
493513
...@@ -498,12 +518,41 @@ struct kvm_pmu_event_filter {...@@ -498,12 +518,41 @@ struct kvm_pmu_event_filter {
498 __u32 fixed_counter_bitmap;518 __u32 fixed_counter_bitmap;
499 __u32 flags;519 __u32 flags;
500 __u32 pad[4];520 __u32 pad[4];
501 __u64 events[0];521 __u64 events[];
502};522};
503523
504#define KVM_PMU_EVENT_ALLOW 0524#define KVM_PMU_EVENT_ALLOW 0
505#define KVM_PMU_EVENT_DENY 1525#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
507/* for KVM_{GET,SET,HAS}_DEVICE_ATTR */556/* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
508#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */557#define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
509#define KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */558#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 @@...@@ -5,20 +5,6 @@
5#define MAP_32BIT 0x40 /* only give out 32bit addresses */5#define MAP_32BIT 0x40 /* only give out 32bit addresses */
66
7#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS7#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
22#define arch_calc_vm_prot_bits(prot, key) ( \8#define arch_calc_vm_prot_bits(prot, key) ( \
23 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \9 ((key) & 0x1 ? VM_PKEY_BIT0 : 0) | \
24 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \10 ((key) & 0x2 ? VM_PKEY_BIT1 : 0) | \
lib/libc/include/x86-linux-any/asm/prctl.h+14-12
...@@ -2,20 +2,22 @@...@@ -2,20 +2,22 @@
2#ifndef _ASM_X86_PRCTL_H2#ifndef _ASM_X86_PRCTL_H
3#define _ASM_X86_PRCTL_H3#define _ASM_X86_PRCTL_H
44
5#define ARCH_SET_GS 0x10015#define ARCH_SET_GS 0x1001
6#define ARCH_SET_FS 0x10026#define ARCH_SET_FS 0x1002
7#define ARCH_GET_FS 0x10037#define ARCH_GET_FS 0x1003
8#define ARCH_GET_GS 0x10048#define ARCH_GET_GS 0x1004
99
10#define ARCH_GET_CPUID 0x101110#define ARCH_GET_CPUID 0x1011
11#define ARCH_SET_CPUID 0x101211#define ARCH_SET_CPUID 0x1012
1212
13#define ARCH_GET_XCOMP_SUPP 0x102113#define ARCH_GET_XCOMP_SUPP 0x1021
14#define ARCH_GET_XCOMP_PERM 0x102214#define ARCH_GET_XCOMP_PERM 0x1022
15#define ARCH_REQ_XCOMP_PERM 0x102315#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 0x200119#define ARCH_MAP_VDSO_X32 0x2001
18#define ARCH_MAP_VDSO_32 0x200220#define ARCH_MAP_VDSO_32 0x2002
19#define ARCH_MAP_VDSO_64 0x200321#define ARCH_MAP_VDSO_64 0x2003
2022
21#endif /* _ASM_X86_PRCTL_H */23#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 @@...@@ -130,6 +130,8 @@
130#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT)130#define X86_CR4_SMAP _BITUL(X86_CR4_SMAP_BIT)
131#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */131#define X86_CR4_PKE_BIT 22 /* enable Protection Keys support */
132#define X86_CR4_PKE _BITUL(X86_CR4_PKE_BIT)132#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
134/*136/*
135 * x86-64 Task Priority Register, CR8137 * x86-64 Task Priority Register, CR8
lib/libc/include/x86-linux-any/asm/sgx.h+62
...@@ -29,6 +29,12 @@ enum sgx_page_flags {...@@ -29,6 +29,12 @@ enum sgx_page_flags {
29 _IOW(SGX_MAGIC, 0x03, struct sgx_enclave_provision)29 _IOW(SGX_MAGIC, 0x03, struct sgx_enclave_provision)
30#define SGX_IOC_VEPC_REMOVE_ALL \30#define SGX_IOC_VEPC_REMOVE_ALL \
31 _IO(SGX_MAGIC, 0x04)31 _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
33/**39/**
34 * struct sgx_enclave_create - parameter structure for the40 * struct sgx_enclave_create - parameter structure for the
...@@ -76,6 +82,62 @@ struct sgx_enclave_provision {...@@ -76,6 +82,62 @@ struct sgx_enclave_provision {
76 __u64 fd;82 __u64 fd;
77};83};
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
79struct sgx_enclave_run;141struct sgx_enclave_run;
80142
81/**143/**
lib/libc/include/x86-linux-any/asm/shmbuf.h+5-1
...@@ -5,6 +5,10 @@...@@ -5,6 +5,10 @@
5#if !defined(__x86_64__) || !defined(__ILP32__)5#if !defined(__x86_64__) || !defined(__ILP32__)
6#include <asm-generic/shmbuf.h>6#include <asm-generic/shmbuf.h>
7#else7#else
8
9#include <asm/ipcbuf.h>
10#include <asm/posix_types.h>
11
8/*12/*
9 * The shmid64_ds structure for x86 architecture with x32 ABI.13 * The shmid64_ds structure for x86 architecture with x32 ABI.
10 *14 *
...@@ -15,7 +19,7 @@...@@ -15,7 +19,7 @@
1519
16struct shmid64_ds {20struct shmid64_ds {
17 struct ipc64_perm shm_perm; /* operation perms */21 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) */
19 __kernel_long_t shm_atime; /* last attach time */23 __kernel_long_t shm_atime; /* last attach time */
20 __kernel_long_t shm_dtime; /* last detach time */24 __kernel_long_t shm_dtime; /* last detach time */
21 __kernel_long_t shm_ctime; /* last change time */25 __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 {...@@ -100,7 +100,7 @@ struct sigaction {
100typedef struct sigaltstack {100typedef struct sigaltstack {
101 void *ss_sp;101 void *ss_sp;
102 int ss_flags;102 int ss_flags;
103 size_t ss_size;103 __kernel_size_t ss_size;
104} stack_t;104} stack_t;
105105
106#endif /* __ASSEMBLY__ */106#endif /* __ASSEMBLY__ */
lib/libc/include/x86-linux-any/asm/svm.h+19
...@@ -108,6 +108,20 @@...@@ -108,6 +108,20 @@
108#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005108#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005
109#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0109#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0
110#define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1110#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))
111#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff125#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
112126
113/* Exit code reserved for hypervisor/software use */127/* Exit code reserved for hypervisor/software use */
...@@ -218,6 +232,11 @@...@@ -218,6 +232,11 @@
218 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \232 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \
219 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \233 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \
220 { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \234 { 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" }, \
221 { SVM_EXIT_ERR, "invalid_guest_state" }240 { SVM_EXIT_ERR, "invalid_guest_state" }
222241
223242
lib/libc/include/x86-linux-any/asm/unistd_32.h+1
...@@ -440,6 +440,7 @@...@@ -440,6 +440,7 @@
440#define __NR_memfd_secret 447440#define __NR_memfd_secret 447
441#define __NR_process_mrelease 448441#define __NR_process_mrelease 448
442#define __NR_futex_waitv 449442#define __NR_futex_waitv 449
443#define __NR_set_mempolicy_home_node 450
443444
444445
445#endif /* _ASM_UNISTD_32_H */446#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 @@...@@ -362,6 +362,7 @@
362#define __NR_memfd_secret 447362#define __NR_memfd_secret 447
363#define __NR_process_mrelease 448363#define __NR_process_mrelease 448
364#define __NR_futex_waitv 449364#define __NR_futex_waitv 449
365#define __NR_set_mempolicy_home_node 450
365366
366367
367#endif /* _ASM_UNISTD_64_H */368#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 @@...@@ -315,6 +315,7 @@
315#define __NR_memfd_secret (__X32_SYSCALL_BIT + 447)315#define __NR_memfd_secret (__X32_SYSCALL_BIT + 447)
316#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)316#define __NR_process_mrelease (__X32_SYSCALL_BIT + 448)
317#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)317#define __NR_futex_waitv (__X32_SYSCALL_BIT + 449)
318#define __NR_set_mempolicy_home_node (__X32_SYSCALL_BIT + 450)
318#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)319#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
319#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)320#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
320#define __NR_ioctl (__X32_SYSCALL_BIT + 514)321#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/x86-linux-any/asm/vmx.h+3-1
...@@ -91,6 +91,7 @@...@@ -91,6 +91,7 @@
91#define EXIT_REASON_UMWAIT 6791#define EXIT_REASON_UMWAIT 67
92#define EXIT_REASON_TPAUSE 6892#define EXIT_REASON_TPAUSE 68
93#define EXIT_REASON_BUS_LOCK 7493#define EXIT_REASON_BUS_LOCK 74
94#define EXIT_REASON_NOTIFY 75
9495
95#define VMX_EXIT_REASONS \96#define VMX_EXIT_REASONS \
96 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \97 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
...@@ -153,7 +154,8 @@...@@ -153,7 +154,8 @@
153 { EXIT_REASON_XRSTORS, "XRSTORS" }, \154 { EXIT_REASON_XRSTORS, "XRSTORS" }, \
154 { EXIT_REASON_UMWAIT, "UMWAIT" }, \155 { EXIT_REASON_UMWAIT, "UMWAIT" }, \
155 { EXIT_REASON_TPAUSE, "TPAUSE" }, \156 { EXIT_REASON_TPAUSE, "TPAUSE" }, \
156 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }157 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
158 { EXIT_REASON_NOTIFY, "NOTIFY" }
157159
158#define VMX_EXIT_REASON_FLAGS \160#define VMX_EXIT_REASON_FLAGS \
159 { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }161 { 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