authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-29 10:11:01+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-29 22:53:06+02:00
logdf1909900c60a55cf93281ed7c476646c6d4c10c
tree502720be3f34e94d7aa43cf5972630cf1d84e32b
parentf624191f9a759c0d310f3615c10dbfbbc6ae511e

libc: update Linux headers to 6.17


241 files changed, 9871 insertions(+), 2259 deletions(-)

lib/libc/include/aarch64-linux-any/asm/hwcap.h+17
......@@ -56,6 +56,21 @@
5656#define HWCAP_PACA (1 << 30)
5757#define HWCAP_PACG (1UL << 31)
5858#define HWCAP_GCS (1UL << 32)
59#define HWCAP_CMPBR (1UL << 33)
60#define HWCAP_FPRCVT (1UL << 34)
61#define HWCAP_F8MM8 (1UL << 35)
62#define HWCAP_F8MM4 (1UL << 36)
63#define HWCAP_SVE_F16MM (1UL << 37)
64#define HWCAP_SVE_ELTPERM (1UL << 38)
65#define HWCAP_SVE_AES2 (1UL << 39)
66#define HWCAP_SVE_BFSCALE (1UL << 40)
67#define HWCAP_SVE2P2 (1UL << 41)
68#define HWCAP_SME2P2 (1UL << 42)
69#define HWCAP_SME_SBITPERM (1UL << 43)
70#define HWCAP_SME_AES (1UL << 44)
71#define HWCAP_SME_SFEXPA (1UL << 45)
72#define HWCAP_SME_STMOP (1UL << 46)
73#define HWCAP_SME_SMOP4 (1UL << 47)
5974
6075/*
6176 * HWCAP2 flags - for AT_HWCAP2
......@@ -128,5 +143,7 @@
128143/*
129144 * HWCAP3 flags - for AT_HWCAP3
130145 */
146#define HWCAP3_MTE_FAR (1UL << 0)
147#define HWCAP3_MTE_STORE_ONLY (1UL << 1)
131148
132149#endif /* __ASM_HWCAP_H */
\ No newline at end of file
lib/libc/include/aarch64-linux-any/asm/kvm.h+16-7
......@@ -43,9 +43,6 @@
4343#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
4444#define KVM_DIRTY_LOG_PAGE_OFFSET 64
4545
46#define KVM_REG_SIZE(id) \
47 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
48
4946struct kvm_regs {
5047 struct user_pt_regs regs; /* sp = sp_el0 */
5148
......@@ -108,6 +105,7 @@ struct kvm_regs {
108105#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */
109106#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */
110107#define KVM_ARM_VCPU_HAS_EL2 7 /* Support nested virtualization */
108#define KVM_ARM_VCPU_HAS_EL2_E2H0 8 /* Limit NV support to E2H RES0 */
111109
112110struct kvm_vcpu_init {
113111 __u32 target;
......@@ -368,6 +366,7 @@ enum {
368366 KVM_REG_ARM_STD_HYP_BIT_PV_TIME = 0,
369367};
370368
369/* Vendor hyper call function numbers 0-63 */
371370#define KVM_REG_ARM_VENDOR_HYP_BMAP KVM_REG_ARM_FW_FEAT_BMAP_REG(2)
372371
373372enum {
......@@ -375,6 +374,14 @@ enum {
375374 KVM_REG_ARM_VENDOR_HYP_BIT_PTP = 1,
376375};
377376
377/* Vendor hyper call function numbers 64-127 */
378#define KVM_REG_ARM_VENDOR_HYP_BMAP_2 KVM_REG_ARM_FW_FEAT_BMAP_REG(3)
379
380enum {
381 KVM_REG_ARM_VENDOR_HYP_BIT_DISCOVER_IMPL_VER = 0,
382 KVM_REG_ARM_VENDOR_HYP_BIT_DISCOVER_IMPL_CPUS = 1,
383};
384
378385/* Device Control API on vm fd */
379386#define KVM_ARM_VM_SMCCC_CTRL 0
380387#define KVM_ARM_VM_SMCCC_FILTER 0
......@@ -397,6 +404,7 @@ enum {
397404#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
398405#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
399406#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
407#define KVM_DEV_ARM_VGIC_GRP_MAINT_IRQ 9
400408#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
401409#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
402410 (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
......@@ -411,10 +419,11 @@ enum {
411419
412420/* Device Control API on vcpu fd */
413421#define KVM_ARM_VCPU_PMU_V3_CTRL 0
414#define KVM_ARM_VCPU_PMU_V3_IRQ 0
415#define KVM_ARM_VCPU_PMU_V3_INIT 1
416#define KVM_ARM_VCPU_PMU_V3_FILTER 2
417#define KVM_ARM_VCPU_PMU_V3_SET_PMU 3
422#define KVM_ARM_VCPU_PMU_V3_IRQ 0
423#define KVM_ARM_VCPU_PMU_V3_INIT 1
424#define KVM_ARM_VCPU_PMU_V3_FILTER 2
425#define KVM_ARM_VCPU_PMU_V3_SET_PMU 3
426#define KVM_ARM_VCPU_PMU_V3_SET_NR_COUNTERS 4
418427#define KVM_ARM_VCPU_TIMER_CTRL 1
419428#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
420429#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1
lib/libc/include/aarch64-linux-any/asm/unistd_64.h+3
......@@ -323,6 +323,9 @@
323323#define __NR_getxattrat 464
324324#define __NR_listxattrat 465
325325#define __NR_removexattrat 466
326#define __NR_open_tree_attr 467
327#define __NR_file_getattr 468
328#define __NR_file_setattr 469
326329
327330
328331#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/any-linux-any/asm-generic/fcntl.h-1
......@@ -6,7 +6,6 @@
66
77/*
88 * FMODE_EXEC is 0x20
9 * FMODE_NONOTIFY is 0x4000000
109 * These cannot be used by userspace O_* until internal and external open
1110 * flags are split.
1211 * -Eric Paris
lib/libc/include/any-linux-any/asm-generic/mman-common.h+1
......@@ -85,6 +85,7 @@
8585/* compatibility flags */
8686#define MAP_FILE 0
8787
88#define PKEY_UNRESTRICTED 0x0
8889#define PKEY_DISABLE_ACCESS 0x1
8990#define PKEY_DISABLE_WRITE 0x2
9091#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\
lib/libc/include/any-linux-any/asm-generic/param.h+5-1
......@@ -2,8 +2,12 @@
22#ifndef __ASM_GENERIC_PARAM_H
33#define __ASM_GENERIC_PARAM_H
44
5#ifndef __USER_HZ
6#define __USER_HZ 100
7#endif
8
59#ifndef HZ
6#define HZ 100
10#define HZ __USER_HZ
711#endif
812
913#ifndef EXEC_PAGESIZE
lib/libc/include/any-linux-any/asm-generic/socket.h+7
......@@ -143,6 +143,13 @@
143143
144144#define SCM_TS_OPT_ID 81
145145
146#define SO_RCVPRIORITY 82
147
148#define SO_PASSRIGHTS 83
149
150#define SO_INQ 84
151#define SCM_INQ SO_INQ
152
146153
147154#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
148155/* on 64-bit and x32, avoid the ?: operator */
lib/libc/include/any-linux-any/asm-generic/unistd.h+9-1
......@@ -849,9 +849,17 @@ __SYSCALL(__NR_getxattrat, sys_getxattrat)
849849__SYSCALL(__NR_listxattrat, sys_listxattrat)
850850#define __NR_removexattrat 466
851851__SYSCALL(__NR_removexattrat, sys_removexattrat)
852#define __NR_open_tree_attr 467
853__SYSCALL(__NR_open_tree_attr, sys_open_tree_attr)
854
855/* fs/inode.c */
856#define __NR_file_getattr 468
857__SYSCALL(__NR_file_getattr, sys_file_getattr)
858#define __NR_file_setattr 469
859__SYSCALL(__NR_file_setattr, sys_file_setattr)
852860
853861#undef __NR_syscalls
854#define __NR_syscalls 467
862#define __NR_syscalls 470
855863
856864/*
857865 * 32 bit systems traditionally used different
lib/libc/include/any-linux-any/asm/setup.h deleted-1
......@@ -1 +0,0 @@
1#include <asm-generic/setup.h>
\ No newline at end of file
lib/libc/include/any-linux-any/cxl/features.h created+168
......@@ -0,0 +1,168 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2024,2025, Intel Corporation
4 *
5 * These are definitions for the mailbox command interface of CXL subsystem.
6 */
7#ifndef _CXL_FEATURES_H_
8#define _CXL_FEATURES_H_
9
10#include <linux/types.h>
11
12typedef unsigned char __uapi_uuid_t[16];
13
14
15/*
16 * struct cxl_mbox_get_sup_feats_in - Get Supported Features input
17 *
18 * @count: bytes of Feature data to return in output
19 * @start_idx: index of first requested Supported Feature Entry, 0 based.
20 * @reserved: reserved field, must be 0s.
21 *
22 * Get Supported Features (0x500h) CXL r3.2 8.2.9.6.1 command.
23 * Input block for Get support Feature
24 */
25struct cxl_mbox_get_sup_feats_in {
26 __le32 count;
27 __le16 start_idx;
28 __u8 reserved[2];
29} __attribute__ ((__packed__));
30
31/* CXL spec r3.2 Table 8-87 command effects */
32#define CXL_CMD_CONFIG_CHANGE_COLD_RESET BIT(0)
33#define CXL_CMD_CONFIG_CHANGE_IMMEDIATE BIT(1)
34#define CXL_CMD_DATA_CHANGE_IMMEDIATE BIT(2)
35#define CXL_CMD_POLICY_CHANGE_IMMEDIATE BIT(3)
36#define CXL_CMD_LOG_CHANGE_IMMEDIATE BIT(4)
37#define CXL_CMD_SECURITY_STATE_CHANGE BIT(5)
38#define CXL_CMD_BACKGROUND BIT(6)
39#define CXL_CMD_BGCMD_ABORT_SUPPORTED BIT(7)
40#define CXL_CMD_EFFECTS_VALID BIT(9)
41#define CXL_CMD_CONFIG_CHANGE_CONV_RESET BIT(10)
42#define CXL_CMD_CONFIG_CHANGE_CXL_RESET BIT(11)
43#define CXL_CMD_EFFECTS_RESERVED GENMASK(15, 12)
44
45/*
46 * struct cxl_feat_entry - Supported Feature Entry
47 * @uuid: UUID of the Feature
48 * @id: id to identify the feature. 0 based
49 * @get_feat_size: max bytes required for Get Feature command for this Feature
50 * @set_feat_size: max bytes required for Set Feature command for this Feature
51 * @flags: attribute flags
52 * @get_feat_ver: Get Feature version
53 * @set_feat_ver: Set Feature version
54 * @effects: Set Feature command effects
55 * @reserved: reserved, must be 0
56 *
57 * CXL spec r3.2 Table 8-109
58 * Get Supported Features Supported Feature Entry
59 */
60struct cxl_feat_entry {
61 __uapi_uuid_t uuid;
62 __le16 id;
63 __le16 get_feat_size;
64 __le16 set_feat_size;
65 __le32 flags;
66 __u8 get_feat_ver;
67 __u8 set_feat_ver;
68 __le16 effects;
69 __u8 reserved[18];
70} __attribute__ ((__packed__));
71
72/* @flags field for 'struct cxl_feat_entry' */
73#define CXL_FEATURE_F_CHANGEABLE BIT(0)
74#define CXL_FEATURE_F_PERSIST_FW_UPDATE BIT(4)
75#define CXL_FEATURE_F_DEFAULT_SEL BIT(5)
76#define CXL_FEATURE_F_SAVED_SEL BIT(6)
77
78/*
79 * struct cxl_mbox_get_sup_feats_out - Get Supported Features output
80 * @num_entries: number of Supported Feature Entries returned
81 * @supported_feats: number of supported Features
82 * @reserved: reserved, must be 0s.
83 * @ents: Supported Feature Entries array
84 *
85 * CXL spec r3.2 Table 8-108
86 * Get supported Features Output Payload
87 */
88struct cxl_mbox_get_sup_feats_out {
89 __struct_group(cxl_mbox_get_sup_feats_out_hdr, hdr, /* no attrs */,
90 __le16 num_entries;
91 __le16 supported_feats;
92 __u8 reserved[4];
93 );
94 struct cxl_feat_entry ents[] __counted_by_le(num_entries);
95} __attribute__ ((__packed__));
96
97/*
98 * Get Feature CXL spec r3.2 Spec 8.2.9.6.2
99 */
100
101/*
102 * struct cxl_mbox_get_feat_in - Get Feature input
103 * @uuid: UUID for Feature
104 * @offset: offset of the first byte in Feature data for output payload
105 * @count: count in bytes of Feature data returned
106 * @selection: 0 current value, 1 default value, 2 saved value
107 *
108 * CXL spec r3.2 section 8.2.9.6.2 Table 8-99
109 */
110struct cxl_mbox_get_feat_in {
111 __uapi_uuid_t uuid;
112 __le16 offset;
113 __le16 count;
114 __u8 selection;
115} __attribute__ ((__packed__));
116
117/*
118 * enum cxl_get_feat_selection - selection field of Get Feature input
119 */
120enum cxl_get_feat_selection {
121 CXL_GET_FEAT_SEL_CURRENT_VALUE,
122 CXL_GET_FEAT_SEL_DEFAULT_VALUE,
123 CXL_GET_FEAT_SEL_SAVED_VALUE,
124 CXL_GET_FEAT_SEL_MAX
125};
126
127/*
128 * Set Feature CXL spec r3.2 8.2.9.6.3
129 */
130
131/*
132 * struct cxl_mbox_set_feat_in - Set Features input
133 * @uuid: UUID for Feature
134 * @flags: set feature flags
135 * @offset: byte offset of Feature data to update
136 * @version: Feature version of the data in Feature Data
137 * @rsvd: reserved, must be 0s.
138 * @feat_data: raw byte stream of Features data to update
139 *
140 * CXL spec r3.2 section 8.2.9.6.3 Table 8-101
141 */
142struct cxl_mbox_set_feat_in {
143 __struct_group(cxl_mbox_set_feat_hdr, hdr, /* no attrs */,
144 __uapi_uuid_t uuid;
145 __le32 flags;
146 __le16 offset;
147 __u8 version;
148 __u8 rsvd[9];
149 );
150 __u8 feat_data[];
151} __attribute__((packed));
152
153/*
154 * enum cxl_set_feat_flag_data_transfer - Set Feature flags field
155 */
156enum cxl_set_feat_flag_data_transfer {
157 CXL_SET_FEAT_FLAG_FULL_DATA_TRANSFER = 0,
158 CXL_SET_FEAT_FLAG_INITIATE_DATA_TRANSFER,
159 CXL_SET_FEAT_FLAG_CONTINUE_DATA_TRANSFER,
160 CXL_SET_FEAT_FLAG_FINISH_DATA_TRANSFER,
161 CXL_SET_FEAT_FLAG_ABORT_DATA_TRANSFER,
162 CXL_SET_FEAT_FLAG_DATA_TRANSFER_MAX
163};
164
165#define CXL_SET_FEAT_FLAG_DATA_TRANSFER_MASK GENMASK(2, 0)
166#define CXL_SET_FEAT_FLAG_DATA_SAVED_ACROSS_RESET BIT(3)
167
168#endif
\ No newline at end of file
lib/libc/include/any-linux-any/drm/amdgpu_drm.h+329
......@@ -54,6 +54,9 @@ extern "C" {
5454#define DRM_AMDGPU_VM 0x13
5555#define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
5656#define DRM_AMDGPU_SCHED 0x15
57#define DRM_AMDGPU_USERQ 0x16
58#define DRM_AMDGPU_USERQ_SIGNAL 0x17
59#define DRM_AMDGPU_USERQ_WAIT 0x18
5760
5861#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
5962#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
......@@ -71,6 +74,9 @@ extern "C" {
7174#define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
7275#define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
7376#define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
77#define DRM_IOCTL_AMDGPU_USERQ DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ, union drm_amdgpu_userq)
78#define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)
79#define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)
7480
7581/**
7682 * DOC: memory domains
......@@ -319,6 +325,260 @@ union drm_amdgpu_ctx {
319325 union drm_amdgpu_ctx_out out;
320326};
321327
328/* user queue IOCTL operations */
329#define AMDGPU_USERQ_OP_CREATE 1
330#define AMDGPU_USERQ_OP_FREE 2
331
332/* queue priority levels */
333/* low < normal low < normal high < high */
334#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK 0x3
335#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_SHIFT 0
336#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_LOW 0
337#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_LOW 1
338#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_HIGH 2
339#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_HIGH 3 /* admin only */
340/* for queues that need access to protected content */
341#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE (1 << 2)
342
343/*
344 * This structure is a container to pass input configuration
345 * info for all supported userqueue related operations.
346 * For operation AMDGPU_USERQ_OP_CREATE: user is expected
347 * to set all fields, excep the parameter 'queue_id'.
348 * For operation AMDGPU_USERQ_OP_FREE: the only input parameter expected
349 * to be set is 'queue_id', eveything else is ignored.
350 */
351struct drm_amdgpu_userq_in {
352 /** AMDGPU_USERQ_OP_* */
353 __u32 op;
354 /** Queue id passed for operation USERQ_OP_FREE */
355 __u32 queue_id;
356 /** the target GPU engine to execute workload (AMDGPU_HW_IP_*) */
357 __u32 ip_type;
358 /**
359 * @doorbell_handle: the handle of doorbell GEM object
360 * associated with this userqueue client.
361 */
362 __u32 doorbell_handle;
363 /**
364 * @doorbell_offset: 32-bit offset of the doorbell in the doorbell bo.
365 * Kernel will generate absolute doorbell offset using doorbell_handle
366 * and doorbell_offset in the doorbell bo.
367 */
368 __u32 doorbell_offset;
369 /**
370 * @flags: flags used for queue parameters
371 */
372 __u32 flags;
373 /**
374 * @queue_va: Virtual address of the GPU memory which holds the queue
375 * object. The queue holds the workload packets.
376 */
377 __u64 queue_va;
378 /**
379 * @queue_size: Size of the queue in bytes, this needs to be 256-byte
380 * aligned.
381 */
382 __u64 queue_size;
383 /**
384 * @rptr_va : Virtual address of the GPU memory which holds the ring RPTR.
385 * This object must be at least 8 byte in size and aligned to 8-byte offset.
386 */
387 __u64 rptr_va;
388 /**
389 * @wptr_va : Virtual address of the GPU memory which holds the ring WPTR.
390 * This object must be at least 8 byte in size and aligned to 8-byte offset.
391 *
392 * Queue, RPTR and WPTR can come from the same object, as long as the size
393 * and alignment related requirements are met.
394 */
395 __u64 wptr_va;
396 /**
397 * @mqd: MQD (memory queue descriptor) is a set of parameters which allow
398 * the GPU to uniquely define and identify a usermode queue.
399 *
400 * MQD data can be of different size for different GPU IP/engine and
401 * their respective versions/revisions, so this points to a __u64 *
402 * which holds IP specific MQD of this usermode queue.
403 */
404 __u64 mqd;
405 /**
406 * @size: size of MQD data in bytes, it must match the MQD structure
407 * size of the respective engine/revision defined in UAPI for ex, for
408 * gfx11 workloads, size = sizeof(drm_amdgpu_userq_mqd_gfx11).
409 */
410 __u64 mqd_size;
411};
412
413/* The structure to carry output of userqueue ops */
414struct drm_amdgpu_userq_out {
415 /**
416 * For operation AMDGPU_USERQ_OP_CREATE: This field contains a unique
417 * queue ID to represent the newly created userqueue in the system, otherwise
418 * it should be ignored.
419 */
420 __u32 queue_id;
421 __u32 _pad;
422};
423
424union drm_amdgpu_userq {
425 struct drm_amdgpu_userq_in in;
426 struct drm_amdgpu_userq_out out;
427};
428
429/* GFX V11 IP specific MQD parameters */
430struct drm_amdgpu_userq_mqd_gfx11 {
431 /**
432 * @shadow_va: Virtual address of the GPU memory to hold the shadow buffer.
433 * Use AMDGPU_INFO_IOCTL to find the exact size of the object.
434 */
435 __u64 shadow_va;
436 /**
437 * @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
438 * Use AMDGPU_INFO_IOCTL to find the exact size of the object.
439 */
440 __u64 csa_va;
441};
442
443/* GFX V11 SDMA IP specific MQD parameters */
444struct drm_amdgpu_userq_mqd_sdma_gfx11 {
445 /**
446 * @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
447 * This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
448 * to get the size.
449 */
450 __u64 csa_va;
451};
452
453/* GFX V11 Compute IP specific MQD parameters */
454struct drm_amdgpu_userq_mqd_compute_gfx11 {
455 /**
456 * @eop_va: Virtual address of the GPU memory to hold the EOP buffer.
457 * This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
458 * to get the size.
459 */
460 __u64 eop_va;
461};
462
463/* userq signal/wait ioctl */
464struct drm_amdgpu_userq_signal {
465 /**
466 * @queue_id: Queue handle used by the userq fence creation function
467 * to retrieve the WPTR.
468 */
469 __u32 queue_id;
470 __u32 pad;
471 /**
472 * @syncobj_handles: The list of syncobj handles submitted by the user queue
473 * job to be signaled.
474 */
475 __u64 syncobj_handles;
476 /**
477 * @num_syncobj_handles: A count that represents the number of syncobj handles in
478 * @syncobj_handles.
479 */
480 __u64 num_syncobj_handles;
481 /**
482 * @bo_read_handles: The list of BO handles that the submitted user queue job
483 * is using for read only. This will update BO fences in the kernel.
484 */
485 __u64 bo_read_handles;
486 /**
487 * @bo_write_handles: The list of BO handles that the submitted user queue job
488 * is using for write only. This will update BO fences in the kernel.
489 */
490 __u64 bo_write_handles;
491 /**
492 * @num_bo_read_handles: A count that represents the number of read BO handles in
493 * @bo_read_handles.
494 */
495 __u32 num_bo_read_handles;
496 /**
497 * @num_bo_write_handles: A count that represents the number of write BO handles in
498 * @bo_write_handles.
499 */
500 __u32 num_bo_write_handles;
501};
502
503struct drm_amdgpu_userq_fence_info {
504 /**
505 * @va: A gpu address allocated for each queue which stores the
506 * read pointer (RPTR) value.
507 */
508 __u64 va;
509 /**
510 * @value: A 64 bit value represents the write pointer (WPTR) of the
511 * queue commands which compared with the RPTR value to signal the
512 * fences.
513 */
514 __u64 value;
515};
516
517struct drm_amdgpu_userq_wait {
518 /**
519 * @waitq_id: Queue handle used by the userq wait IOCTL to retrieve the
520 * wait queue and maintain the fence driver references in it.
521 */
522 __u32 waitq_id;
523 __u32 pad;
524 /**
525 * @syncobj_handles: The list of syncobj handles submitted by the user queue
526 * job to get the va/value pairs.
527 */
528 __u64 syncobj_handles;
529 /**
530 * @syncobj_timeline_handles: The list of timeline syncobj handles submitted by
531 * the user queue job to get the va/value pairs at given @syncobj_timeline_points.
532 */
533 __u64 syncobj_timeline_handles;
534 /**
535 * @syncobj_timeline_points: The list of timeline syncobj points submitted by the
536 * user queue job for the corresponding @syncobj_timeline_handles.
537 */
538 __u64 syncobj_timeline_points;
539 /**
540 * @bo_read_handles: The list of read BO handles submitted by the user queue
541 * job to get the va/value pairs.
542 */
543 __u64 bo_read_handles;
544 /**
545 * @bo_write_handles: The list of write BO handles submitted by the user queue
546 * job to get the va/value pairs.
547 */
548 __u64 bo_write_handles;
549 /**
550 * @num_syncobj_timeline_handles: A count that represents the number of timeline
551 * syncobj handles in @syncobj_timeline_handles.
552 */
553 __u16 num_syncobj_timeline_handles;
554 /**
555 * @num_fences: This field can be used both as input and output. As input it defines
556 * the maximum number of fences that can be returned and as output it will specify
557 * how many fences were actually returned from the ioctl.
558 */
559 __u16 num_fences;
560 /**
561 * @num_syncobj_handles: A count that represents the number of syncobj handles in
562 * @syncobj_handles.
563 */
564 __u32 num_syncobj_handles;
565 /**
566 * @num_bo_read_handles: A count that represents the number of read BO handles in
567 * @bo_read_handles.
568 */
569 __u32 num_bo_read_handles;
570 /**
571 * @num_bo_write_handles: A count that represents the number of write BO handles in
572 * @bo_write_handles.
573 */
574 __u32 num_bo_write_handles;
575 /**
576 * @out_fences: The field is a return value from the ioctl containing the list of
577 * address/value pairs to wait for.
578 */
579 __u64 out_fences;
580};
581
322582/* vm ioctl */
323583#define AMDGPU_VM_OP_RESERVE_VMID 1
324584#define AMDGPU_VM_OP_UNRESERVE_VMID 2
......@@ -599,6 +859,19 @@ struct drm_amdgpu_gem_va {
599859 __u64 offset_in_bo;
600860 /** Specify mapping size. Must be correctly aligned. */
601861 __u64 map_size;
862 /**
863 * vm_timeline_point is a sequence number used to add new timeline point.
864 */
865 __u64 vm_timeline_point;
866 /**
867 * The vm page table update fence is installed in given vm_timeline_syncobj_out
868 * at vm_timeline_point.
869 */
870 __u32 vm_timeline_syncobj_out;
871 /** the number of syncobj handles in @input_fence_syncobj_handles */
872 __u32 num_syncobj_handles;
873 /** Array of sync object handle to wait for given input fences */
874 __u64 input_fence_syncobj_handles;
602875};
603876
604877#define AMDGPU_HW_IP_GFX 0
......@@ -763,6 +1036,16 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
7631036#define AMDGPU_IDS_FLAGS_TMZ 0x4
7641037#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
7651038
1039/*
1040 * Query h/w info: Flag identifying VF/PF/PT mode
1041 *
1042 */
1043#define AMDGPU_IDS_FLAGS_MODE_MASK 0x300
1044#define AMDGPU_IDS_FLAGS_MODE_SHIFT 0x8
1045#define AMDGPU_IDS_FLAGS_MODE_PF 0x0
1046#define AMDGPU_IDS_FLAGS_MODE_VF 0x1
1047#define AMDGPU_IDS_FLAGS_MODE_PT 0x2
1048
7661049/* indicate if acceleration can be working */
7671050#define AMDGPU_INFO_ACCEL_WORKING 0x00
7681051/* get the crtc_id from the mode object id? */
......@@ -930,6 +1213,8 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
9301213#define AMDGPU_INFO_MAX_IBS 0x22
9311214/* query last page fault info */
9321215#define AMDGPU_INFO_GPUVM_FAULT 0x23
1216/* query FW object size and alignment */
1217#define AMDGPU_INFO_UQ_FW_AREAS 0x24
9331218
9341219#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
9351220#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
......@@ -1083,6 +1368,7 @@ struct drm_amdgpu_info_vbios {
10831368#define AMDGPU_VRAM_TYPE_DDR5 10
10841369#define AMDGPU_VRAM_TYPE_LPDDR4 11
10851370#define AMDGPU_VRAM_TYPE_LPDDR5 12
1371#define AMDGPU_VRAM_TYPE_HBM3E 13
10861372
10871373struct drm_amdgpu_info_device {
10881374 /** PCI Device ID */
......@@ -1188,6 +1474,9 @@ struct drm_amdgpu_info_device {
11881474 __u32 csa_size;
11891475 /* context save area base virtual alignment for gfx11 */
11901476 __u32 csa_alignment;
1477 /* Userq IP mask (1 << AMDGPU_HW_IP_*) */
1478 __u32 userq_ip_mask;
1479 __u32 pad;
11911480};
11921481
11931482struct drm_amdgpu_info_hw_ip {
......@@ -1204,6 +1493,29 @@ struct drm_amdgpu_info_hw_ip {
12041493 __u32 available_rings;
12051494 /** version info: bits 23:16 major, 15:8 minor, 7:0 revision */
12061495 __u32 ip_discovery_version;
1496 /* Userq available slots */
1497 __u32 userq_num_slots;
1498};
1499
1500/* GFX metadata BO sizes and alignment info (in bytes) */
1501struct drm_amdgpu_info_uq_fw_areas_gfx {
1502 /* shadow area size */
1503 __u32 shadow_size;
1504 /* shadow area base virtual mem alignment */
1505 __u32 shadow_alignment;
1506 /* context save area size */
1507 __u32 csa_size;
1508 /* context save area base virtual mem alignment */
1509 __u32 csa_alignment;
1510};
1511
1512/* IP specific fw related information used in the
1513 * subquery AMDGPU_INFO_UQ_FW_AREAS
1514 */
1515struct drm_amdgpu_info_uq_fw_areas {
1516 union {
1517 struct drm_amdgpu_info_uq_fw_areas_gfx gfx;
1518 };
12071519};
12081520
12091521struct drm_amdgpu_info_num_handles {
......@@ -1269,6 +1581,23 @@ struct drm_amdgpu_info_gpuvm_fault {
12691581 __u32 vmhub;
12701582};
12711583
1584struct drm_amdgpu_info_uq_metadata_gfx {
1585 /* shadow area size for gfx11 */
1586 __u32 shadow_size;
1587 /* shadow area base virtual alignment for gfx11 */
1588 __u32 shadow_alignment;
1589 /* context save area size for gfx11 */
1590 __u32 csa_size;
1591 /* context save area base virtual alignment for gfx11 */
1592 __u32 csa_alignment;
1593};
1594
1595struct drm_amdgpu_info_uq_metadata {
1596 union {
1597 struct drm_amdgpu_info_uq_metadata_gfx gfx;
1598 };
1599};
1600
12721601/*
12731602 * Supported GPU families
12741603 */
lib/libc/include/any-linux-any/drm/amdxdna_accel.h created+501
......@@ -0,0 +1,501 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2022-2024, Advanced Micro Devices, Inc.
4 */
5
6#ifndef _AMDXDNA_ACCEL_H_
7#define _AMDXDNA_ACCEL_H_
8
9#include <linux/stddef.h>
10#include "drm.h"
11
12#if defined(__cplusplus)
13extern "C" {
14#endif
15
16#define AMDXDNA_INVALID_CMD_HANDLE (~0UL)
17#define AMDXDNA_INVALID_ADDR (~0UL)
18#define AMDXDNA_INVALID_CTX_HANDLE 0
19#define AMDXDNA_INVALID_BO_HANDLE 0
20#define AMDXDNA_INVALID_FENCE_HANDLE 0
21
22enum amdxdna_device_type {
23 AMDXDNA_DEV_TYPE_UNKNOWN = -1,
24 AMDXDNA_DEV_TYPE_KMQ,
25};
26
27enum amdxdna_drm_ioctl_id {
28 DRM_AMDXDNA_CREATE_HWCTX,
29 DRM_AMDXDNA_DESTROY_HWCTX,
30 DRM_AMDXDNA_CONFIG_HWCTX,
31 DRM_AMDXDNA_CREATE_BO,
32 DRM_AMDXDNA_GET_BO_INFO,
33 DRM_AMDXDNA_SYNC_BO,
34 DRM_AMDXDNA_EXEC_CMD,
35 DRM_AMDXDNA_GET_INFO,
36 DRM_AMDXDNA_SET_STATE,
37};
38
39/**
40 * struct qos_info - QoS information for driver.
41 * @gops: Giga operations per second.
42 * @fps: Frames per second.
43 * @dma_bandwidth: DMA bandwidtha.
44 * @latency: Frame response latency.
45 * @frame_exec_time: Frame execution time.
46 * @priority: Request priority.
47 *
48 * User program can provide QoS hints to driver.
49 */
50struct amdxdna_qos_info {
51 __u32 gops;
52 __u32 fps;
53 __u32 dma_bandwidth;
54 __u32 latency;
55 __u32 frame_exec_time;
56 __u32 priority;
57};
58
59/**
60 * struct amdxdna_drm_create_hwctx - Create hardware context.
61 * @ext: MBZ.
62 * @ext_flags: MBZ.
63 * @qos_p: Address of QoS info.
64 * @umq_bo: BO handle for user mode queue(UMQ).
65 * @log_buf_bo: BO handle for log buffer.
66 * @max_opc: Maximum operations per cycle.
67 * @num_tiles: Number of AIE tiles.
68 * @mem_size: Size of AIE tile memory.
69 * @umq_doorbell: Returned offset of doorbell associated with UMQ.
70 * @handle: Returned hardware context handle.
71 * @syncobj_handle: Returned syncobj handle for command completion.
72 */
73struct amdxdna_drm_create_hwctx {
74 __u64 ext;
75 __u64 ext_flags;
76 __u64 qos_p;
77 __u32 umq_bo;
78 __u32 log_buf_bo;
79 __u32 max_opc;
80 __u32 num_tiles;
81 __u32 mem_size;
82 __u32 umq_doorbell;
83 __u32 handle;
84 __u32 syncobj_handle;
85};
86
87/**
88 * struct amdxdna_drm_destroy_hwctx - Destroy hardware context.
89 * @handle: Hardware context handle.
90 * @pad: MBZ.
91 */
92struct amdxdna_drm_destroy_hwctx {
93 __u32 handle;
94 __u32 pad;
95};
96
97/**
98 * struct amdxdna_cu_config - configuration for one CU
99 * @cu_bo: CU configuration buffer bo handle.
100 * @cu_func: Function of a CU.
101 * @pad: MBZ.
102 */
103struct amdxdna_cu_config {
104 __u32 cu_bo;
105 __u8 cu_func;
106 __u8 pad[3];
107};
108
109/**
110 * struct amdxdna_hwctx_param_config_cu - configuration for CUs in hardware context
111 * @num_cus: Number of CUs to configure.
112 * @pad: MBZ.
113 * @cu_configs: Array of CU configurations of struct amdxdna_cu_config.
114 */
115struct amdxdna_hwctx_param_config_cu {
116 __u16 num_cus;
117 __u16 pad[3];
118 struct amdxdna_cu_config cu_configs[] __counted_by(num_cus);
119};
120
121enum amdxdna_drm_config_hwctx_param {
122 DRM_AMDXDNA_HWCTX_CONFIG_CU,
123 DRM_AMDXDNA_HWCTX_ASSIGN_DBG_BUF,
124 DRM_AMDXDNA_HWCTX_REMOVE_DBG_BUF,
125};
126
127/**
128 * struct amdxdna_drm_config_hwctx - Configure hardware context.
129 * @handle: hardware context handle.
130 * @param_type: Value in enum amdxdna_drm_config_hwctx_param. Specifies the
131 * structure passed in via param_val.
132 * @param_val: A structure specified by the param_type struct member.
133 * @param_val_size: Size of the parameter buffer pointed to by the param_val.
134 * If param_val is not a pointer, driver can ignore this.
135 * @pad: MBZ.
136 *
137 * Note: if the param_val is a pointer pointing to a buffer, the maximum size
138 * of the buffer is 4KiB(PAGE_SIZE).
139 */
140struct amdxdna_drm_config_hwctx {
141 __u32 handle;
142 __u32 param_type;
143 __u64 param_val;
144 __u32 param_val_size;
145 __u32 pad;
146};
147
148enum amdxdna_bo_type {
149 AMDXDNA_BO_INVALID = 0,
150 AMDXDNA_BO_SHMEM,
151 AMDXDNA_BO_DEV_HEAP,
152 AMDXDNA_BO_DEV,
153 AMDXDNA_BO_CMD,
154};
155
156/**
157 * struct amdxdna_drm_create_bo - Create a buffer object.
158 * @flags: Buffer flags. MBZ.
159 * @vaddr: User VA of buffer if applied. MBZ.
160 * @size: Size in bytes.
161 * @type: Buffer type.
162 * @handle: Returned DRM buffer object handle.
163 */
164struct amdxdna_drm_create_bo {
165 __u64 flags;
166 __u64 vaddr;
167 __u64 size;
168 __u32 type;
169 __u32 handle;
170};
171
172/**
173 * struct amdxdna_drm_get_bo_info - Get buffer object information.
174 * @ext: MBZ.
175 * @ext_flags: MBZ.
176 * @handle: DRM buffer object handle.
177 * @pad: MBZ.
178 * @map_offset: Returned DRM fake offset for mmap().
179 * @vaddr: Returned user VA of buffer. 0 in case user needs mmap().
180 * @xdna_addr: Returned XDNA device virtual address.
181 */
182struct amdxdna_drm_get_bo_info {
183 __u64 ext;
184 __u64 ext_flags;
185 __u32 handle;
186 __u32 pad;
187 __u64 map_offset;
188 __u64 vaddr;
189 __u64 xdna_addr;
190};
191
192/**
193 * struct amdxdna_drm_sync_bo - Sync buffer object.
194 * @handle: Buffer object handle.
195 * @direction: Direction of sync, can be from device or to device.
196 * @offset: Offset in the buffer to sync.
197 * @size: Size in bytes.
198 */
199struct amdxdna_drm_sync_bo {
200 __u32 handle;
201#define SYNC_DIRECT_TO_DEVICE 0U
202#define SYNC_DIRECT_FROM_DEVICE 1U
203 __u32 direction;
204 __u64 offset;
205 __u64 size;
206};
207
208enum amdxdna_cmd_type {
209 AMDXDNA_CMD_SUBMIT_EXEC_BUF = 0,
210 AMDXDNA_CMD_SUBMIT_DEPENDENCY,
211 AMDXDNA_CMD_SUBMIT_SIGNAL,
212};
213
214/**
215 * struct amdxdna_drm_exec_cmd - Execute command.
216 * @ext: MBZ.
217 * @ext_flags: MBZ.
218 * @hwctx: Hardware context handle.
219 * @type: One of command type in enum amdxdna_cmd_type.
220 * @cmd_handles: Array of command handles or the command handle itself
221 * in case of just one.
222 * @args: Array of arguments for all command handles.
223 * @cmd_count: Number of command handles in the cmd_handles array.
224 * @arg_count: Number of arguments in the args array.
225 * @seq: Returned sequence number for this command.
226 */
227struct amdxdna_drm_exec_cmd {
228 __u64 ext;
229 __u64 ext_flags;
230 __u32 hwctx;
231 __u32 type;
232 __u64 cmd_handles;
233 __u64 args;
234 __u32 cmd_count;
235 __u32 arg_count;
236 __u64 seq;
237};
238
239/**
240 * struct amdxdna_drm_query_aie_status - Query the status of the AIE hardware
241 * @buffer: The user space buffer that will return the AIE status.
242 * @buffer_size: The size of the user space buffer.
243 * @cols_filled: A bitmap of AIE columns whose data has been returned in the buffer.
244 */
245struct amdxdna_drm_query_aie_status {
246 __u64 buffer; /* out */
247 __u32 buffer_size; /* in */
248 __u32 cols_filled; /* out */
249};
250
251/**
252 * struct amdxdna_drm_query_aie_version - Query the version of the AIE hardware
253 * @major: The major version number.
254 * @minor: The minor version number.
255 */
256struct amdxdna_drm_query_aie_version {
257 __u32 major; /* out */
258 __u32 minor; /* out */
259};
260
261/**
262 * struct amdxdna_drm_query_aie_tile_metadata - Query the metadata of AIE tile (core, mem, shim)
263 * @row_count: The number of rows.
264 * @row_start: The starting row number.
265 * @dma_channel_count: The number of dma channels.
266 * @lock_count: The number of locks.
267 * @event_reg_count: The number of events.
268 * @pad: Structure padding.
269 */
270struct amdxdna_drm_query_aie_tile_metadata {
271 __u16 row_count;
272 __u16 row_start;
273 __u16 dma_channel_count;
274 __u16 lock_count;
275 __u16 event_reg_count;
276 __u16 pad[3];
277};
278
279/**
280 * struct amdxdna_drm_query_aie_metadata - Query the metadata of the AIE hardware
281 * @col_size: The size of a column in bytes.
282 * @cols: The total number of columns.
283 * @rows: The total number of rows.
284 * @version: The version of the AIE hardware.
285 * @core: The metadata for all core tiles.
286 * @mem: The metadata for all mem tiles.
287 * @shim: The metadata for all shim tiles.
288 */
289struct amdxdna_drm_query_aie_metadata {
290 __u32 col_size;
291 __u16 cols;
292 __u16 rows;
293 struct amdxdna_drm_query_aie_version version;
294 struct amdxdna_drm_query_aie_tile_metadata core;
295 struct amdxdna_drm_query_aie_tile_metadata mem;
296 struct amdxdna_drm_query_aie_tile_metadata shim;
297};
298
299/**
300 * struct amdxdna_drm_query_clock - Metadata for a clock
301 * @name: The clock name.
302 * @freq_mhz: The clock frequency.
303 * @pad: Structure padding.
304 */
305struct amdxdna_drm_query_clock {
306 __u8 name[16];
307 __u32 freq_mhz;
308 __u32 pad;
309};
310
311/**
312 * struct amdxdna_drm_query_clock_metadata - Query metadata for clocks
313 * @mp_npu_clock: The metadata for MP-NPU clock.
314 * @h_clock: The metadata for H clock.
315 */
316struct amdxdna_drm_query_clock_metadata {
317 struct amdxdna_drm_query_clock mp_npu_clock;
318 struct amdxdna_drm_query_clock h_clock;
319};
320
321enum amdxdna_sensor_type {
322 AMDXDNA_SENSOR_TYPE_POWER
323};
324
325/**
326 * struct amdxdna_drm_query_sensor - The data for single sensor.
327 * @label: The name for a sensor.
328 * @input: The current value of the sensor.
329 * @max: The maximum value possible for the sensor.
330 * @average: The average value of the sensor.
331 * @highest: The highest recorded sensor value for this driver load for the sensor.
332 * @status: The sensor status.
333 * @units: The sensor units.
334 * @unitm: Translates value member variables into the correct unit via (pow(10, unitm) * value).
335 * @type: The sensor type from enum amdxdna_sensor_type.
336 * @pad: Structure padding.
337 */
338struct amdxdna_drm_query_sensor {
339 __u8 label[64];
340 __u32 input;
341 __u32 max;
342 __u32 average;
343 __u32 highest;
344 __u8 status[64];
345 __u8 units[16];
346 __s8 unitm;
347 __u8 type;
348 __u8 pad[6];
349};
350
351/**
352 * struct amdxdna_drm_query_hwctx - The data for single context.
353 * @context_id: The ID for this context.
354 * @start_col: The starting column for the partition assigned to this context.
355 * @num_col: The number of columns in the partition assigned to this context.
356 * @pad: Structure padding.
357 * @pid: The Process ID of the process that created this context.
358 * @command_submissions: The number of commands submitted to this context.
359 * @command_completions: The number of commands completed by this context.
360 * @migrations: The number of times this context has been moved to a different partition.
361 * @preemptions: The number of times this context has been preempted by another context in the
362 * same partition.
363 * @errors: The errors for this context.
364 */
365struct amdxdna_drm_query_hwctx {
366 __u32 context_id;
367 __u32 start_col;
368 __u32 num_col;
369 __u32 pad;
370 __s64 pid;
371 __u64 command_submissions;
372 __u64 command_completions;
373 __u64 migrations;
374 __u64 preemptions;
375 __u64 errors;
376};
377
378enum amdxdna_power_mode_type {
379 POWER_MODE_DEFAULT, /* Fallback to calculated DPM */
380 POWER_MODE_LOW, /* Set frequency to lowest DPM */
381 POWER_MODE_MEDIUM, /* Set frequency to medium DPM */
382 POWER_MODE_HIGH, /* Set frequency to highest DPM */
383 POWER_MODE_TURBO, /* Maximum power */
384};
385
386/**
387 * struct amdxdna_drm_get_power_mode - Get the configured power mode
388 * @power_mode: The mode type from enum amdxdna_power_mode_type
389 * @pad: Structure padding.
390 */
391struct amdxdna_drm_get_power_mode {
392 __u8 power_mode;
393 __u8 pad[7];
394};
395
396/**
397 * struct amdxdna_drm_query_firmware_version - Query the firmware version
398 * @major: The major version number
399 * @minor: The minor version number
400 * @patch: The patch level version number
401 * @build: The build ID
402 */
403struct amdxdna_drm_query_firmware_version {
404 __u32 major; /* out */
405 __u32 minor; /* out */
406 __u32 patch; /* out */
407 __u32 build; /* out */
408};
409
410enum amdxdna_drm_get_param {
411 DRM_AMDXDNA_QUERY_AIE_STATUS,
412 DRM_AMDXDNA_QUERY_AIE_METADATA,
413 DRM_AMDXDNA_QUERY_AIE_VERSION,
414 DRM_AMDXDNA_QUERY_CLOCK_METADATA,
415 DRM_AMDXDNA_QUERY_SENSORS,
416 DRM_AMDXDNA_QUERY_HW_CONTEXTS,
417 DRM_AMDXDNA_QUERY_FIRMWARE_VERSION = 8,
418 DRM_AMDXDNA_GET_POWER_MODE,
419};
420
421/**
422 * struct amdxdna_drm_get_info - Get some information from the AIE hardware.
423 * @param: Value in enum amdxdna_drm_get_param. Specifies the structure passed in the buffer.
424 * @buffer_size: Size of the input buffer. Size needed/written by the kernel.
425 * @buffer: A structure specified by the param struct member.
426 */
427struct amdxdna_drm_get_info {
428 __u32 param; /* in */
429 __u32 buffer_size; /* in/out */
430 __u64 buffer; /* in/out */
431};
432
433enum amdxdna_drm_set_param {
434 DRM_AMDXDNA_SET_POWER_MODE,
435 DRM_AMDXDNA_WRITE_AIE_MEM,
436 DRM_AMDXDNA_WRITE_AIE_REG,
437};
438
439/**
440 * struct amdxdna_drm_set_state - Set the state of the AIE hardware.
441 * @param: Value in enum amdxdna_drm_set_param.
442 * @buffer_size: Size of the input param.
443 * @buffer: Pointer to the input param.
444 */
445struct amdxdna_drm_set_state {
446 __u32 param; /* in */
447 __u32 buffer_size; /* in */
448 __u64 buffer; /* in */
449};
450
451/**
452 * struct amdxdna_drm_set_power_mode - Set the power mode of the AIE hardware
453 * @power_mode: The sensor type from enum amdxdna_power_mode_type
454 * @pad: MBZ.
455 */
456struct amdxdna_drm_set_power_mode {
457 __u8 power_mode;
458 __u8 pad[7];
459};
460
461#define DRM_IOCTL_AMDXDNA_CREATE_HWCTX \
462 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CREATE_HWCTX, \
463 struct amdxdna_drm_create_hwctx)
464
465#define DRM_IOCTL_AMDXDNA_DESTROY_HWCTX \
466 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_DESTROY_HWCTX, \
467 struct amdxdna_drm_destroy_hwctx)
468
469#define DRM_IOCTL_AMDXDNA_CONFIG_HWCTX \
470 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CONFIG_HWCTX, \
471 struct amdxdna_drm_config_hwctx)
472
473#define DRM_IOCTL_AMDXDNA_CREATE_BO \
474 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_CREATE_BO, \
475 struct amdxdna_drm_create_bo)
476
477#define DRM_IOCTL_AMDXDNA_GET_BO_INFO \
478 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_BO_INFO, \
479 struct amdxdna_drm_get_bo_info)
480
481#define DRM_IOCTL_AMDXDNA_SYNC_BO \
482 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_SYNC_BO, \
483 struct amdxdna_drm_sync_bo)
484
485#define DRM_IOCTL_AMDXDNA_EXEC_CMD \
486 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_EXEC_CMD, \
487 struct amdxdna_drm_exec_cmd)
488
489#define DRM_IOCTL_AMDXDNA_GET_INFO \
490 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_GET_INFO, \
491 struct amdxdna_drm_get_info)
492
493#define DRM_IOCTL_AMDXDNA_SET_STATE \
494 DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDXDNA_SET_STATE, \
495 struct amdxdna_drm_set_state)
496
497#if defined(__cplusplus)
498} /* extern c end */
499#endif
500
501#endif /* _AMDXDNA_ACCEL_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/asahi_drm.h created+1194
......@@ -0,0 +1,1194 @@
1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright (C) The Asahi Linux Contributors
4 * Copyright (C) 2018-2023 Collabora Ltd.
5 * Copyright (C) 2014-2018 Broadcom
6 */
7#ifndef _ASAHI_DRM_H_
8#define _ASAHI_DRM_H_
9
10#include "drm.h"
11
12#if defined(__cplusplus)
13extern "C" {
14#endif
15
16/**
17 * DOC: Introduction to the Asahi UAPI
18 *
19 * This documentation describes the Asahi IOCTLs.
20 *
21 * Just a few generic rules about the data passed to the Asahi IOCTLs (cribbed
22 * from Panthor):
23 *
24 * - Structures must be aligned on 64-bit/8-byte. If the object is not
25 * naturally aligned, a padding field must be added.
26 * - Fields must be explicitly aligned to their natural type alignment with
27 * pad[0..N] fields.
28 * - All padding fields will be checked by the driver to make sure they are
29 * zeroed.
30 * - Flags can be added, but not removed/replaced.
31 * - New fields can be added to the main structures (the structures
32 * directly passed to the ioctl). Those fields can be added at the end of
33 * the structure, or replace existing padding fields. Any new field being
34 * added must preserve the behavior that existed before those fields were
35 * added when a value of zero is passed.
36 * - New fields can be added to indirect objects (objects pointed by the
37 * main structure), iff those objects are passed a size to reflect the
38 * size known by the userspace driver (see
39 * drm_asahi_cmd_header::size).
40 * - If the kernel driver is too old to know some fields, those will be
41 * ignored if zero, and otherwise rejected (and so will be zero on output).
42 * - If userspace is too old to know some fields, those will be zeroed
43 * (input) before the structure is parsed by the kernel driver.
44 * - Each new flag/field addition must come with a driver version update so
45 * the userspace driver doesn't have to guess which flags are supported.
46 * - Structures should not contain unions, as this would defeat the
47 * extensibility of such structures.
48 * - IOCTLs can't be removed or replaced. New IOCTL IDs should be placed
49 * at the end of the drm_asahi_ioctl_id enum.
50 */
51
52/**
53 * enum drm_asahi_ioctl_id - IOCTL IDs
54 *
55 * Place new ioctls at the end, don't re-order, don't replace or remove entries.
56 *
57 * These IDs are not meant to be used directly. Use the DRM_IOCTL_ASAHI_xxx
58 * definitions instead.
59 */
60enum drm_asahi_ioctl_id {
61 /** @DRM_ASAHI_GET_PARAMS: Query device properties. */
62 DRM_ASAHI_GET_PARAMS = 0,
63
64 /** @DRM_ASAHI_GET_TIME: Query device time. */
65 DRM_ASAHI_GET_TIME,
66
67 /** @DRM_ASAHI_VM_CREATE: Create a GPU VM address space. */
68 DRM_ASAHI_VM_CREATE,
69
70 /** @DRM_ASAHI_VM_DESTROY: Destroy a VM. */
71 DRM_ASAHI_VM_DESTROY,
72
73 /** @DRM_ASAHI_VM_BIND: Bind/unbind memory to a VM. */
74 DRM_ASAHI_VM_BIND,
75
76 /** @DRM_ASAHI_GEM_CREATE: Create a buffer object. */
77 DRM_ASAHI_GEM_CREATE,
78
79 /**
80 * @DRM_ASAHI_GEM_MMAP_OFFSET: Get offset to pass to mmap() to map a
81 * given GEM handle.
82 */
83 DRM_ASAHI_GEM_MMAP_OFFSET,
84
85 /** @DRM_ASAHI_GEM_BIND_OBJECT: Bind memory as a special object */
86 DRM_ASAHI_GEM_BIND_OBJECT,
87
88 /** @DRM_ASAHI_QUEUE_CREATE: Create a scheduling queue. */
89 DRM_ASAHI_QUEUE_CREATE,
90
91 /** @DRM_ASAHI_QUEUE_DESTROY: Destroy a scheduling queue. */
92 DRM_ASAHI_QUEUE_DESTROY,
93
94 /** @DRM_ASAHI_SUBMIT: Submit commands to a queue. */
95 DRM_ASAHI_SUBMIT,
96};
97
98#define DRM_ASAHI_MAX_CLUSTERS 64
99
100/**
101 * struct drm_asahi_params_global - Global parameters.
102 *
103 * This struct may be queried by drm_asahi_get_params.
104 */
105struct drm_asahi_params_global {
106 /** @features: Feature bits from drm_asahi_feature */
107 __u64 features;
108
109 /** @gpu_generation: GPU generation, e.g. 13 for G13G */
110 __u32 gpu_generation;
111
112 /** @gpu_variant: GPU variant as a character, e.g. 'C' for G13C */
113 __u32 gpu_variant;
114
115 /**
116 * @gpu_revision: GPU revision in BCD, e.g. 0x00 for 'A0' or
117 * 0x21 for 'C1'
118 */
119 __u32 gpu_revision;
120
121 /** @chip_id: Chip ID in BCD, e.g. 0x8103 for T8103 */
122 __u32 chip_id;
123
124 /** @num_dies: Number of dies in the SoC */
125 __u32 num_dies;
126
127 /** @num_clusters_total: Number of GPU clusters (across all dies) */
128 __u32 num_clusters_total;
129
130 /**
131 * @num_cores_per_cluster: Number of logical cores per cluster
132 * (including inactive/nonexistent)
133 */
134 __u32 num_cores_per_cluster;
135
136 /** @max_frequency_khz: Maximum GPU core clock frequency */
137 __u32 max_frequency_khz;
138
139 /** @core_masks: Bitmask of present/enabled cores per cluster */
140 __u64 core_masks[DRM_ASAHI_MAX_CLUSTERS];
141
142 /**
143 * @vm_start: VM range start VMA. Together with @vm_end, this defines
144 * the window of valid GPU VAs. Userspace is expected to subdivide VAs
145 * out of this window.
146 *
147 * This window contains all virtual addresses that userspace needs to
148 * know about. There may be kernel-internal GPU VAs outside this range,
149 * but that detail is not relevant here.
150 */
151 __u64 vm_start;
152
153 /** @vm_end: VM range end VMA */
154 __u64 vm_end;
155
156 /**
157 * @vm_kernel_min_size: Minimum kernel VMA window size.
158 *
159 * When creating a VM, userspace is required to carve out a section of
160 * virtual addresses (within the range given by @vm_start and
161 * @vm_end). The kernel will allocate various internal structures
162 * within the specified VA range.
163 *
164 * Allowing userspace to choose the VA range for the kernel, rather than
165 * the kernel reserving VAs and requiring userspace to cope, can assist
166 * in implementing SVM.
167 */
168 __u64 vm_kernel_min_size;
169
170 /**
171 * @max_commands_per_submission: Maximum number of supported commands
172 * per submission. This mirrors firmware limits. Userspace must split up
173 * larger command buffers, which may require inserting additional
174 * synchronization.
175 */
176 __u32 max_commands_per_submission;
177
178 /**
179 * @max_attachments: Maximum number of drm_asahi_attachment's per
180 * command
181 */
182 __u32 max_attachments;
183
184 /**
185 * @command_timestamp_frequency_hz: Timebase frequency for timestamps
186 * written during command execution, specified via drm_asahi_timestamp
187 * structures. As this rate is controlled by the firmware, it is a
188 * queryable parameter.
189 *
190 * Userspace must divide by this frequency to convert timestamps to
191 * seconds, rather than hardcoding a particular firmware's rate.
192 */
193 __u64 command_timestamp_frequency_hz;
194};
195
196/**
197 * enum drm_asahi_feature - Feature bits
198 *
199 * This covers only features that userspace cannot infer from the architecture
200 * version. Most features don't need to be here.
201 */
202enum drm_asahi_feature {
203 /**
204 * @DRM_ASAHI_FEATURE_SOFT_FAULTS: GPU has "soft fault" enabled. Shader
205 * loads of unmapped memory will return zero. Shader stores to unmapped
206 * memory will be silently discarded. Note that only shader load/store
207 * is affected. Other hardware units are not affected, notably including
208 * texture sampling.
209 *
210 * Soft fault is set when initializing the GPU and cannot be runtime
211 * toggled. Therefore, it is exposed as a feature bit and not a
212 * userspace-settable flag on the VM. When soft fault is enabled,
213 * userspace can speculate memory accesses more aggressively.
214 */
215 DRM_ASAHI_FEATURE_SOFT_FAULTS = (1UL) << 0,
216};
217
218/**
219 * struct drm_asahi_get_params - Arguments passed to DRM_IOCTL_ASAHI_GET_PARAMS
220 */
221struct drm_asahi_get_params {
222 /** @param_group: Parameter group to fetch (MBZ) */
223 __u32 param_group;
224
225 /** @pad: MBZ */
226 __u32 pad;
227
228 /** @pointer: User pointer to write parameter struct */
229 __u64 pointer;
230
231 /**
232 * @size: Size of the user buffer. In case of older userspace, this may
233 * be less than sizeof(struct drm_asahi_params_global). The kernel will
234 * not write past the length specified here, allowing extensibility.
235 */
236 __u64 size;
237};
238
239/**
240 * struct drm_asahi_vm_create - Arguments passed to DRM_IOCTL_ASAHI_VM_CREATE
241 */
242struct drm_asahi_vm_create {
243 /**
244 * @kernel_start: Start of the kernel-reserved address range. See
245 * drm_asahi_params_global::vm_kernel_min_size.
246 *
247 * Both @kernel_start and @kernel_end must be within the range of
248 * valid VAs given by drm_asahi_params_global::vm_start and
249 * drm_asahi_params_global::vm_end. The size of the kernel range
250 * (@kernel_end - @kernel_start) must be at least
251 * drm_asahi_params_global::vm_kernel_min_size.
252 *
253 * Userspace must not bind any memory on this VM into this reserved
254 * range, it is for kernel use only.
255 */
256 __u64 kernel_start;
257
258 /**
259 * @kernel_end: End of the kernel-reserved address range. See
260 * @kernel_start.
261 */
262 __u64 kernel_end;
263
264 /** @vm_id: Returned VM ID */
265 __u32 vm_id;
266
267 /** @pad: MBZ */
268 __u32 pad;
269};
270
271/**
272 * struct drm_asahi_vm_destroy - Arguments passed to DRM_IOCTL_ASAHI_VM_DESTROY
273 */
274struct drm_asahi_vm_destroy {
275 /** @vm_id: VM ID to be destroyed */
276 __u32 vm_id;
277
278 /** @pad: MBZ */
279 __u32 pad;
280};
281
282/**
283 * enum drm_asahi_gem_flags - Flags for GEM creation
284 */
285enum drm_asahi_gem_flags {
286 /**
287 * @DRM_ASAHI_GEM_WRITEBACK: BO should be CPU-mapped as writeback.
288 *
289 * Map as writeback instead of write-combine. This optimizes for CPU
290 * reads.
291 */
292 DRM_ASAHI_GEM_WRITEBACK = (1L << 0),
293
294 /**
295 * @DRM_ASAHI_GEM_VM_PRIVATE: BO is private to this GPU VM (no exports).
296 */
297 DRM_ASAHI_GEM_VM_PRIVATE = (1L << 1),
298};
299
300/**
301 * struct drm_asahi_gem_create - Arguments passed to DRM_IOCTL_ASAHI_GEM_CREATE
302 */
303struct drm_asahi_gem_create {
304 /** @size: Size of the BO */
305 __u64 size;
306
307 /** @flags: Combination of drm_asahi_gem_flags flags. */
308 __u32 flags;
309
310 /**
311 * @vm_id: VM ID to assign to the BO, if DRM_ASAHI_GEM_VM_PRIVATE is set
312 */
313 __u32 vm_id;
314
315 /** @handle: Returned GEM handle for the BO */
316 __u32 handle;
317
318 /** @pad: MBZ */
319 __u32 pad;
320};
321
322/**
323 * struct drm_asahi_gem_mmap_offset - Arguments passed to
324 * DRM_IOCTL_ASAHI_GEM_MMAP_OFFSET
325 */
326struct drm_asahi_gem_mmap_offset {
327 /** @handle: Handle for the object being mapped. */
328 __u32 handle;
329
330 /** @flags: Must be zero */
331 __u32 flags;
332
333 /** @offset: The fake offset to use for subsequent mmap call */
334 __u64 offset;
335};
336
337/**
338 * enum drm_asahi_bind_flags - Flags for GEM binding
339 */
340enum drm_asahi_bind_flags {
341 /**
342 * @DRM_ASAHI_BIND_UNBIND: Instead of binding a GEM object to the range,
343 * simply unbind the GPU VMA range.
344 */
345 DRM_ASAHI_BIND_UNBIND = (1L << 0),
346
347 /** @DRM_ASAHI_BIND_READ: Map BO with GPU read permission */
348 DRM_ASAHI_BIND_READ = (1L << 1),
349
350 /** @DRM_ASAHI_BIND_WRITE: Map BO with GPU write permission */
351 DRM_ASAHI_BIND_WRITE = (1L << 2),
352
353 /**
354 * @DRM_ASAHI_BIND_SINGLE_PAGE: Map a single page of the BO repeatedly
355 * across the VA range.
356 *
357 * This is useful to fill a VA range with scratch pages or zero pages.
358 * It is intended as a mechanism to accelerate sparse.
359 */
360 DRM_ASAHI_BIND_SINGLE_PAGE = (1L << 3),
361};
362
363/**
364 * struct drm_asahi_gem_bind_op - Description of a single GEM bind operation.
365 */
366struct drm_asahi_gem_bind_op {
367 /** @flags: Combination of drm_asahi_bind_flags flags. */
368 __u32 flags;
369
370 /** @handle: GEM object to bind (except for UNBIND) */
371 __u32 handle;
372
373 /**
374 * @offset: Offset into the object (except for UNBIND).
375 *
376 * For a regular bind, this is the beginning of the region of the GEM
377 * object to bind.
378 *
379 * For a single-page bind, this is the offset to the single page that
380 * will be repeatedly bound.
381 *
382 * Must be page-size aligned.
383 */
384 __u64 offset;
385
386 /**
387 * @range: Number of bytes to bind/unbind to @addr.
388 *
389 * Must be page-size aligned.
390 */
391 __u64 range;
392
393 /**
394 * @addr: Address to bind to.
395 *
396 * Must be page-size aligned.
397 */
398 __u64 addr;
399};
400
401/**
402 * struct drm_asahi_vm_bind - Arguments passed to
403 * DRM_IOCTL_ASAHI_VM_BIND
404 */
405struct drm_asahi_vm_bind {
406 /** @vm_id: The ID of the VM to bind to */
407 __u32 vm_id;
408
409 /** @num_binds: number of binds in this IOCTL. */
410 __u32 num_binds;
411
412 /**
413 * @stride: Stride in bytes between consecutive binds. This allows
414 * extensibility of drm_asahi_gem_bind_op.
415 */
416 __u32 stride;
417
418 /** @pad: MBZ */
419 __u32 pad;
420
421 /**
422 * @userptr: User pointer to an array of @num_binds structures of type
423 * @drm_asahi_gem_bind_op and size @stride bytes.
424 */
425 __u64 userptr;
426};
427
428/**
429 * enum drm_asahi_bind_object_op - Special object bind operation
430 */
431enum drm_asahi_bind_object_op {
432 /** @DRM_ASAHI_BIND_OBJECT_OP_BIND: Bind a BO as a special GPU object */
433 DRM_ASAHI_BIND_OBJECT_OP_BIND = 0,
434
435 /** @DRM_ASAHI_BIND_OBJECT_OP_UNBIND: Unbind a special GPU object */
436 DRM_ASAHI_BIND_OBJECT_OP_UNBIND = 1,
437};
438
439/**
440 * enum drm_asahi_bind_object_flags - Special object bind flags
441 */
442enum drm_asahi_bind_object_flags {
443 /**
444 * @DRM_ASAHI_BIND_OBJECT_USAGE_TIMESTAMPS: Map a BO as a timestamp
445 * buffer.
446 */
447 DRM_ASAHI_BIND_OBJECT_USAGE_TIMESTAMPS = (1L << 0),
448};
449
450/**
451 * struct drm_asahi_gem_bind_object - Arguments passed to
452 * DRM_IOCTL_ASAHI_GEM_BIND_OBJECT
453 */
454struct drm_asahi_gem_bind_object {
455 /** @op: Bind operation (enum drm_asahi_bind_object_op) */
456 __u32 op;
457
458 /** @flags: Combination of drm_asahi_bind_object_flags flags. */
459 __u32 flags;
460
461 /** @handle: GEM object to bind/unbind (BIND) */
462 __u32 handle;
463
464 /** @vm_id: The ID of the VM to operate on (MBZ currently) */
465 __u32 vm_id;
466
467 /** @offset: Offset into the object (BIND only) */
468 __u64 offset;
469
470 /** @range: Number of bytes to bind/unbind (BIND only) */
471 __u64 range;
472
473 /** @object_handle: Object handle (out for BIND, in for UNBIND) */
474 __u32 object_handle;
475
476 /** @pad: MBZ */
477 __u32 pad;
478};
479
480/**
481 * enum drm_asahi_cmd_type - Command type
482 */
483enum drm_asahi_cmd_type {
484 /**
485 * @DRM_ASAHI_CMD_RENDER: Render command, executing on the render
486 * subqueue. Combined vertex and fragment operation.
487 *
488 * Followed by a @drm_asahi_cmd_render payload.
489 */
490 DRM_ASAHI_CMD_RENDER = 0,
491
492 /**
493 * @DRM_ASAHI_CMD_COMPUTE: Compute command on the compute subqueue.
494 *
495 * Followed by a @drm_asahi_cmd_compute payload.
496 */
497 DRM_ASAHI_CMD_COMPUTE = 1,
498
499 /**
500 * @DRM_ASAHI_SET_VERTEX_ATTACHMENTS: Software command to set
501 * attachments for subsequent vertex shaders in the same submit.
502 *
503 * Followed by (possibly multiple) @drm_asahi_attachment payloads.
504 */
505 DRM_ASAHI_SET_VERTEX_ATTACHMENTS = 2,
506
507 /**
508 * @DRM_ASAHI_SET_FRAGMENT_ATTACHMENTS: Software command to set
509 * attachments for subsequent fragment shaders in the same submit.
510 *
511 * Followed by (possibly multiple) @drm_asahi_attachment payloads.
512 */
513 DRM_ASAHI_SET_FRAGMENT_ATTACHMENTS = 3,
514
515 /**
516 * @DRM_ASAHI_SET_COMPUTE_ATTACHMENTS: Software command to set
517 * attachments for subsequent compute shaders in the same submit.
518 *
519 * Followed by (possibly multiple) @drm_asahi_attachment payloads.
520 */
521 DRM_ASAHI_SET_COMPUTE_ATTACHMENTS = 4,
522};
523
524/**
525 * enum drm_asahi_priority - Scheduling queue priority.
526 *
527 * These priorities are forwarded to the firmware to influence firmware
528 * scheduling. The exact policy is ultimately decided by firmware, but
529 * these enums allow userspace to communicate the intentions.
530 */
531enum drm_asahi_priority {
532 /** @DRM_ASAHI_PRIORITY_LOW: Low priority queue. */
533 DRM_ASAHI_PRIORITY_LOW = 0,
534
535 /** @DRM_ASAHI_PRIORITY_MEDIUM: Medium priority queue. */
536 DRM_ASAHI_PRIORITY_MEDIUM = 1,
537
538 /**
539 * @DRM_ASAHI_PRIORITY_HIGH: High priority queue.
540 *
541 * Reserved for future extension.
542 */
543 DRM_ASAHI_PRIORITY_HIGH = 2,
544
545 /**
546 * @DRM_ASAHI_PRIORITY_REALTIME: Real-time priority queue.
547 *
548 * Reserved for future extension.
549 */
550 DRM_ASAHI_PRIORITY_REALTIME = 3,
551};
552
553/**
554 * struct drm_asahi_queue_create - Arguments passed to
555 * DRM_IOCTL_ASAHI_QUEUE_CREATE
556 */
557struct drm_asahi_queue_create {
558 /** @flags: MBZ */
559 __u32 flags;
560
561 /** @vm_id: The ID of the VM this queue is bound to */
562 __u32 vm_id;
563
564 /** @priority: One of drm_asahi_priority */
565 __u32 priority;
566
567 /** @queue_id: The returned queue ID */
568 __u32 queue_id;
569
570 /**
571 * @usc_exec_base: GPU base address for all USC binaries (shaders) on
572 * this queue. USC addresses are 32-bit relative to this 64-bit base.
573 *
574 * This sets the following registers on all queue commands:
575 *
576 * USC_EXEC_BASE_TA (vertex)
577 * USC_EXEC_BASE_ISP (fragment)
578 * USC_EXEC_BASE_CP (compute)
579 *
580 * While the hardware lets us configure these independently per command,
581 * we do not have a use case for this. Instead, we expect userspace to
582 * fix a 4GiB VA carveout for USC memory and pass its base address here.
583 */
584 __u64 usc_exec_base;
585};
586
587/**
588 * struct drm_asahi_queue_destroy - Arguments passed to
589 * DRM_IOCTL_ASAHI_QUEUE_DESTROY
590 */
591struct drm_asahi_queue_destroy {
592 /** @queue_id: The queue ID to be destroyed */
593 __u32 queue_id;
594
595 /** @pad: MBZ */
596 __u32 pad;
597};
598
599/**
600 * enum drm_asahi_sync_type - Sync item type
601 */
602enum drm_asahi_sync_type {
603 /** @DRM_ASAHI_SYNC_SYNCOBJ: Binary sync object */
604 DRM_ASAHI_SYNC_SYNCOBJ = 0,
605
606 /** @DRM_ASAHI_SYNC_TIMELINE_SYNCOBJ: Timeline sync object */
607 DRM_ASAHI_SYNC_TIMELINE_SYNCOBJ = 1,
608};
609
610/**
611 * struct drm_asahi_sync - Sync item
612 */
613struct drm_asahi_sync {
614 /** @sync_type: One of drm_asahi_sync_type */
615 __u32 sync_type;
616
617 /** @handle: The sync object handle */
618 __u32 handle;
619
620 /** @timeline_value: Timeline value for timeline sync objects */
621 __u64 timeline_value;
622};
623
624/**
625 * define DRM_ASAHI_BARRIER_NONE - Command index for no barrier
626 *
627 * This special value may be passed in to drm_asahi_command::vdm_barrier or
628 * drm_asahi_command::cdm_barrier to indicate that the respective subqueue
629 * should not wait on any previous work.
630 */
631#define DRM_ASAHI_BARRIER_NONE (0xFFFFu)
632
633/**
634 * struct drm_asahi_cmd_header - Top level command structure
635 *
636 * This struct is core to the command buffer definition and therefore is not
637 * extensible.
638 */
639struct drm_asahi_cmd_header {
640 /** @cmd_type: One of drm_asahi_cmd_type */
641 __u16 cmd_type;
642
643 /**
644 * @size: Size of this command, not including this header.
645 *
646 * For hardware commands, this enables extensibility of commands without
647 * requiring extra command types. Passing a command that is shorter
648 * than expected is explicitly allowed for backwards-compatibility.
649 * Truncated fields will be zeroed.
650 *
651 * For the synthetic attachment setting commands, this implicitly
652 * encodes the number of attachments. These commands take multiple
653 * fixed-size @drm_asahi_attachment structures as their payload, so size
654 * equals number of attachments * sizeof(struct drm_asahi_attachment).
655 */
656 __u16 size;
657
658 /**
659 * @vdm_barrier: VDM (render) command index to wait on.
660 *
661 * Barriers are indices relative to the beginning of a given submit. A
662 * barrier of 0 waits on commands submitted to the respective subqueue
663 * in previous submit ioctls. A barrier of N waits on N previous
664 * commands on the subqueue within the current submit ioctl. As a
665 * special case, passing @DRM_ASAHI_BARRIER_NONE avoids waiting on any
666 * commands in the subqueue.
667 *
668 * Examples:
669 *
670 * 0: This waits on all previous work.
671 *
672 * NONE: This does not wait for anything on this subqueue.
673 *
674 * 1: This waits on the first render command in the submit.
675 * This is valid only if there are multiple render commands in the
676 * same submit.
677 *
678 * Barriers are valid only for hardware commands. Synthetic software
679 * commands to set attachments must pass NONE here.
680 */
681 __u16 vdm_barrier;
682
683 /**
684 * @cdm_barrier: CDM (compute) command index to wait on.
685 *
686 * See @vdm_barrier, and replace VDM/render with CDM/compute.
687 */
688 __u16 cdm_barrier;
689};
690
691/**
692 * struct drm_asahi_submit - Arguments passed to DRM_IOCTL_ASAHI_SUBMIT
693 */
694struct drm_asahi_submit {
695 /**
696 * @syncs: An optional pointer to an array of drm_asahi_sync. The first
697 * @in_sync_count elements are in-syncs, then the remaining
698 * @out_sync_count elements are out-syncs. Using a single array with
699 * explicit partitioning simplifies handling.
700 */
701 __u64 syncs;
702
703 /**
704 * @cmdbuf: Pointer to the command buffer to submit.
705 *
706 * This is a flat command buffer. By design, it contains no CPU
707 * pointers, which makes it suitable for a virtgpu wire protocol without
708 * requiring any serializing/deserializing step.
709 *
710 * It consists of a series of commands. Each command begins with a
711 * fixed-size @drm_asahi_cmd_header header and is followed by a
712 * variable-length payload according to the type and size in the header.
713 *
714 * The combined count of "real" hardware commands must be nonzero and at
715 * most drm_asahi_params_global::max_commands_per_submission.
716 */
717 __u64 cmdbuf;
718
719 /** @flags: Flags for command submission (MBZ) */
720 __u32 flags;
721
722 /** @queue_id: The queue ID to be submitted to */
723 __u32 queue_id;
724
725 /**
726 * @in_sync_count: Number of sync objects to wait on before starting
727 * this job.
728 */
729 __u32 in_sync_count;
730
731 /**
732 * @out_sync_count: Number of sync objects to signal upon completion of
733 * this job.
734 */
735 __u32 out_sync_count;
736
737 /** @cmdbuf_size: Command buffer size in bytes */
738 __u32 cmdbuf_size;
739
740 /** @pad: MBZ */
741 __u32 pad;
742};
743
744/**
745 * struct drm_asahi_attachment - Describe an "attachment".
746 *
747 * Attachments are any memory written by shaders, notably including render
748 * target attachments written by the end-of-tile program. This is purely a hint
749 * about the accessed memory regions. It is optional to specify, which is
750 * fortunate as it cannot be specified precisely with bindless access anyway.
751 * But where possible, it's probably a good idea for userspace to include these
752 * hints, forwarded to the firmware.
753 *
754 * This struct is implicitly sized and therefore is not extensible.
755 */
756struct drm_asahi_attachment {
757 /** @pointer: Base address of the attachment */
758 __u64 pointer;
759
760 /** @size: Size of the attachment in bytes */
761 __u64 size;
762
763 /** @pad: MBZ */
764 __u32 pad;
765
766 /** @flags: MBZ */
767 __u32 flags;
768};
769
770enum drm_asahi_render_flags {
771 /**
772 * @DRM_ASAHI_RENDER_VERTEX_SCRATCH: A vertex stage shader uses scratch
773 * memory.
774 */
775 DRM_ASAHI_RENDER_VERTEX_SCRATCH = (1U << 0),
776
777 /**
778 * @DRM_ASAHI_RENDER_PROCESS_EMPTY_TILES: Process even empty tiles.
779 * This must be set when clearing render targets.
780 */
781 DRM_ASAHI_RENDER_PROCESS_EMPTY_TILES = (1U << 1),
782
783 /**
784 * @DRM_ASAHI_RENDER_NO_VERTEX_CLUSTERING: Run vertex stage on a single
785 * cluster (on multi-cluster GPUs)
786 *
787 * This harms performance but can workaround certain sync/coherency
788 * bugs, and therefore is useful for debugging.
789 */
790 DRM_ASAHI_RENDER_NO_VERTEX_CLUSTERING = (1U << 2),
791
792 /**
793 * @DRM_ASAHI_RENDER_DBIAS_IS_INT: Use integer depth bias formula.
794 *
795 * Graphics specifications contain two alternate formulas for depth
796 * bias, a float formula used with floating-point depth buffers and an
797 * integer formula using with unorm depth buffers. This flag specifies
798 * that the integer formula should be used. If omitted, the float
799 * formula is used instead.
800 *
801 * This corresponds to bit 18 of the relevant hardware control register,
802 * so we match that here for efficiency.
803 */
804 DRM_ASAHI_RENDER_DBIAS_IS_INT = (1U << 18),
805};
806
807/**
808 * struct drm_asahi_zls_buffer - Describe a depth or stencil buffer.
809 *
810 * These fields correspond to hardware registers in the ZLS (Z Load/Store) unit.
811 * There are three hardware registers for each field respectively for loads,
812 * stores, and partial renders. In practice, it makes sense to set all to the
813 * same values, except in exceptional cases not yet implemented in userspace, so
814 * we do not duplicate here for simplicity/efficiency.
815 *
816 * This struct is embedded in other structs and therefore is not extensible.
817 */
818struct drm_asahi_zls_buffer {
819 /** @base: Base address of the buffer */
820 __u64 base;
821
822 /**
823 * @comp_base: If the load buffer is compressed, address of the
824 * compression metadata section.
825 */
826 __u64 comp_base;
827
828 /**
829 * @stride: If layered rendering is enabled, the number of bytes
830 * between each layer of the buffer.
831 */
832 __u32 stride;
833
834 /**
835 * @comp_stride: If layered rendering is enabled, the number of bytes
836 * between each layer of the compression metadata.
837 */
838 __u32 comp_stride;
839};
840
841/**
842 * struct drm_asahi_timestamp - Describe a timestamp write.
843 *
844 * The firmware can optionally write the GPU timestamp at render pass
845 * granularities, but it needs to be mapped specially via
846 * DRM_IOCTL_ASAHI_GEM_BIND_OBJECT. This structure therefore describes where to
847 * write as a handle-offset pair, rather than a GPU address like normal.
848 *
849 * This struct is embedded in other structs and therefore is not extensible.
850 */
851struct drm_asahi_timestamp {
852 /**
853 * @handle: Handle of the timestamp buffer, or 0 to skip this
854 * timestamp. If nonzero, this must equal the value returned in
855 * drm_asahi_gem_bind_object::object_handle.
856 */
857 __u32 handle;
858
859 /** @offset: Offset to write into the timestamp buffer */
860 __u32 offset;
861};
862
863/**
864 * struct drm_asahi_timestamps - Describe timestamp writes.
865 *
866 * Each operation that can be timestamped, can be timestamped at the start and
867 * end. Therefore, drm_asahi_timestamp structs always come in pairs, bundled
868 * together into drm_asahi_timestamps.
869 *
870 * This struct is embedded in other structs and therefore is not extensible.
871 */
872struct drm_asahi_timestamps {
873 /** @start: Timestamp recorded at the start of the operation */
874 struct drm_asahi_timestamp start;
875
876 /** @end: Timestamp recorded at the end of the operation */
877 struct drm_asahi_timestamp end;
878};
879
880/**
881 * struct drm_asahi_helper_program - Describe helper program configuration.
882 *
883 * The helper program is a compute-like kernel required for various hardware
884 * functionality. Its most important role is dynamically allocating
885 * scratch/stack memory for individual subgroups, by partitioning a static
886 * allocation shared for the whole device. It is supplied by userspace via
887 * drm_asahi_helper_program and internally dispatched by the hardware as needed.
888 *
889 * This struct is embedded in other structs and therefore is not extensible.
890 */
891struct drm_asahi_helper_program {
892 /**
893 * @binary: USC address to the helper program binary. This is a tagged
894 * pointer with configuration in the bottom bits.
895 */
896 __u32 binary;
897
898 /** @cfg: Additional configuration bits for the helper program. */
899 __u32 cfg;
900
901 /**
902 * @data: Data passed to the helper program. This value is not
903 * interpreted by the kernel, firmware, or hardware in any way. It is
904 * simply a sideband for userspace, set with the submit ioctl and read
905 * via special registers inside the helper program.
906 *
907 * In practice, userspace will pass a 64-bit GPU VA here pointing to the
908 * actual arguments, which presumably don't fit in 64-bits.
909 */
910 __u64 data;
911};
912
913/**
914 * struct drm_asahi_bg_eot - Describe a background or end-of-tile program.
915 *
916 * The background and end-of-tile programs are dispatched by the hardware at the
917 * beginning and end of rendering. As the hardware "tilebuffer" is simply local
918 * memory, these programs are necessary to implement API-level render targets.
919 * The fragment-like background program is responsible for loading either the
920 * clear colour or the existing render target contents, while the compute-like
921 * end-of-tile program stores the tilebuffer contents to memory.
922 *
923 * This struct is embedded in other structs and therefore is not extensible.
924 */
925struct drm_asahi_bg_eot {
926 /**
927 * @usc: USC address of the hardware USC words binding resources
928 * (including images and uniforms) and the program itself. Note this is
929 * an additional layer of indirection compared to the helper program,
930 * avoiding the need for a sideband for data. This is a tagged pointer
931 * with additional configuration in the bottom bits.
932 */
933 __u32 usc;
934
935 /**
936 * @rsrc_spec: Resource specifier for the program. This is a packed
937 * hardware data structure describing the required number of registers,
938 * uniforms, bound textures, and bound samplers.
939 */
940 __u32 rsrc_spec;
941};
942
943/**
944 * struct drm_asahi_cmd_render - Command to submit 3D
945 *
946 * This command submits a single render pass. The hardware control stream may
947 * include many draws and subpasses, but within the command, the framebuffer
948 * dimensions and attachments are fixed.
949 *
950 * The hardware requires the firmware to set a large number of Control Registers
951 * setting up state at render pass granularity before each command rendering 3D.
952 * The firmware bundles this state into data structures. Unfortunately, we
953 * cannot expose either any of that directly to userspace, because the
954 * kernel-firmware ABI is not stable. Although we can guarantee the firmware
955 * updates in tandem with the kernel, we cannot break old userspace when
956 * upgrading the firmware and kernel. Therefore, we need to abstract well the
957 * data structures to avoid tying our hands with future firmwares.
958 *
959 * The bulk of drm_asahi_cmd_render therefore consists of values of hardware
960 * control registers, marshalled via the firmware interface.
961 *
962 * The framebuffer/tilebuffer dimensions are also specified here. In addition to
963 * being passed to the firmware/hardware, the kernel requires these dimensions
964 * to calculate various essential tiling-related data structures. It is
965 * unfortunate that our submits are heavier than on vendors with saner
966 * hardware-software interfaces. The upshot is all of this information is
967 * readily available to userspace with all current APIs.
968 *
969 * It looks odd - but it's not overly burdensome and it ensures we can remain
970 * compatible with old userspace.
971 */
972struct drm_asahi_cmd_render {
973 /** @flags: Combination of drm_asahi_render_flags flags. */
974 __u32 flags;
975
976 /**
977 * @isp_zls_pixels: ISP_ZLS_PIXELS register value. This contains the
978 * depth/stencil width/height, which may differ from the framebuffer
979 * width/height.
980 */
981 __u32 isp_zls_pixels;
982
983 /**
984 * @vdm_ctrl_stream_base: VDM_CTRL_STREAM_BASE register value. GPU
985 * address to the beginning of the VDM control stream.
986 */
987 __u64 vdm_ctrl_stream_base;
988
989 /** @vertex_helper: Helper program used for the vertex shader */
990 struct drm_asahi_helper_program vertex_helper;
991
992 /** @fragment_helper: Helper program used for the fragment shader */
993 struct drm_asahi_helper_program fragment_helper;
994
995 /**
996 * @isp_scissor_base: ISP_SCISSOR_BASE register value. GPU address of an
997 * array of scissor descriptors indexed in the render pass.
998 */
999 __u64 isp_scissor_base;
1000
1001 /**
1002 * @isp_dbias_base: ISP_DBIAS_BASE register value. GPU address of an
1003 * array of depth bias values indexed in the render pass.
1004 */
1005 __u64 isp_dbias_base;
1006
1007 /**
1008 * @isp_oclqry_base: ISP_OCLQRY_BASE register value. GPU address of an
1009 * array of occlusion query results written by the render pass.
1010 */
1011 __u64 isp_oclqry_base;
1012
1013 /** @depth: Depth buffer */
1014 struct drm_asahi_zls_buffer depth;
1015
1016 /** @stencil: Stencil buffer */
1017 struct drm_asahi_zls_buffer stencil;
1018
1019 /** @zls_ctrl: ZLS_CTRL register value */
1020 __u64 zls_ctrl;
1021
1022 /** @ppp_multisamplectl: PPP_MULTISAMPLECTL register value */
1023 __u64 ppp_multisamplectl;
1024
1025 /**
1026 * @sampler_heap: Base address of the sampler heap. This heap is used
1027 * for both vertex shaders and fragment shaders. The registers are
1028 * per-stage, but there is no known use case for separate heaps.
1029 */
1030 __u64 sampler_heap;
1031
1032 /** @ppp_ctrl: PPP_CTRL register value */
1033 __u32 ppp_ctrl;
1034
1035 /** @width_px: Framebuffer width in pixels */
1036 __u16 width_px;
1037
1038 /** @height_px: Framebuffer height in pixels */
1039 __u16 height_px;
1040
1041 /** @layers: Number of layers in the framebuffer */
1042 __u16 layers;
1043
1044 /** @sampler_count: Number of samplers in the sampler heap. */
1045 __u16 sampler_count;
1046
1047 /** @utile_width_px: Width of a logical tilebuffer tile in pixels */
1048 __u8 utile_width_px;
1049
1050 /** @utile_height_px: Height of a logical tilebuffer tile in pixels */
1051 __u8 utile_height_px;
1052
1053 /** @samples: # of samples in the framebuffer. Must be 1, 2, or 4. */
1054 __u8 samples;
1055
1056 /** @sample_size_B: # of bytes in the tilebuffer required per sample. */
1057 __u8 sample_size_B;
1058
1059 /**
1060 * @isp_merge_upper_x: 32-bit float used in the hardware triangle
1061 * merging. Calculate as: tan(60 deg) * width.
1062 *
1063 * Making these values UAPI avoids requiring floating-point calculations
1064 * in the kernel in the hot path.
1065 */
1066 __u32 isp_merge_upper_x;
1067
1068 /**
1069 * @isp_merge_upper_y: 32-bit float. Calculate as: tan(60 deg) * height.
1070 * See @isp_merge_upper_x.
1071 */
1072 __u32 isp_merge_upper_y;
1073
1074 /** @bg: Background program run for each tile at the start */
1075 struct drm_asahi_bg_eot bg;
1076
1077 /** @eot: End-of-tile program ran for each tile at the end */
1078 struct drm_asahi_bg_eot eot;
1079
1080 /**
1081 * @partial_bg: Background program ran at the start of each tile when
1082 * resuming the render pass during a partial render.
1083 */
1084 struct drm_asahi_bg_eot partial_bg;
1085
1086 /**
1087 * @partial_eot: End-of-tile program ran at the end of each tile when
1088 * pausing the render pass during a partial render.
1089 */
1090 struct drm_asahi_bg_eot partial_eot;
1091
1092 /**
1093 * @isp_bgobjdepth: ISP_BGOBJDEPTH register value. This is the depth
1094 * buffer clear value, encoded in the depth buffer's format: either a
1095 * 32-bit float or a 16-bit unorm (with upper bits zeroed).
1096 */
1097 __u32 isp_bgobjdepth;
1098
1099 /**
1100 * @isp_bgobjvals: ISP_BGOBJVALS register value. The bottom 8-bits
1101 * contain the stencil buffer clear value.
1102 */
1103 __u32 isp_bgobjvals;
1104
1105 /** @ts_vtx: Timestamps for the vertex portion of the render */
1106 struct drm_asahi_timestamps ts_vtx;
1107
1108 /** @ts_frag: Timestamps for the fragment portion of the render */
1109 struct drm_asahi_timestamps ts_frag;
1110};
1111
1112/**
1113 * struct drm_asahi_cmd_compute - Command to submit compute
1114 *
1115 * This command submits a control stream consisting of compute dispatches. There
1116 * is essentially no limit on how many compute dispatches may be included in a
1117 * single compute command, although timestamps are at command granularity.
1118 */
1119struct drm_asahi_cmd_compute {
1120 /** @flags: MBZ */
1121 __u32 flags;
1122
1123 /** @sampler_count: Number of samplers in the sampler heap. */
1124 __u32 sampler_count;
1125
1126 /**
1127 * @cdm_ctrl_stream_base: CDM_CTRL_STREAM_BASE register value. GPU
1128 * address to the beginning of the CDM control stream.
1129 */
1130 __u64 cdm_ctrl_stream_base;
1131
1132 /**
1133 * @cdm_ctrl_stream_end: GPU base address to the end of the hardware
1134 * control stream. Note this only considers the first contiguous segment
1135 * of the control stream, as the stream might jump elsewhere.
1136 */
1137 __u64 cdm_ctrl_stream_end;
1138
1139 /** @sampler_heap: Base address of the sampler heap. */
1140 __u64 sampler_heap;
1141
1142 /** @helper: Helper program used for this compute command */
1143 struct drm_asahi_helper_program helper;
1144
1145 /** @ts: Timestamps for the compute command */
1146 struct drm_asahi_timestamps ts;
1147};
1148
1149/**
1150 * struct drm_asahi_get_time - Arguments passed to DRM_IOCTL_ASAHI_GET_TIME
1151 */
1152struct drm_asahi_get_time {
1153 /** @flags: MBZ. */
1154 __u64 flags;
1155
1156 /** @gpu_timestamp: On return, the GPU timestamp in nanoseconds. */
1157 __u64 gpu_timestamp;
1158};
1159
1160/**
1161 * DRM_IOCTL_ASAHI() - Build an Asahi IOCTL number
1162 * @__access: Access type. Must be R, W or RW.
1163 * @__id: One of the DRM_ASAHI_xxx id.
1164 * @__type: Suffix of the type being passed to the IOCTL.
1165 *
1166 * Don't use this macro directly, use the DRM_IOCTL_ASAHI_xxx
1167 * values instead.
1168 *
1169 * Return: An IOCTL number to be passed to ioctl() from userspace.
1170 */
1171#define DRM_IOCTL_ASAHI(__access, __id, __type) \
1172 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_ASAHI_ ## __id, \
1173 struct drm_asahi_ ## __type)
1174
1175/* Note: this is an enum so that it can be resolved by Rust bindgen. */
1176enum {
1177 DRM_IOCTL_ASAHI_GET_PARAMS = DRM_IOCTL_ASAHI(W, GET_PARAMS, get_params),
1178 DRM_IOCTL_ASAHI_GET_TIME = DRM_IOCTL_ASAHI(WR, GET_TIME, get_time),
1179 DRM_IOCTL_ASAHI_VM_CREATE = DRM_IOCTL_ASAHI(WR, VM_CREATE, vm_create),
1180 DRM_IOCTL_ASAHI_VM_DESTROY = DRM_IOCTL_ASAHI(W, VM_DESTROY, vm_destroy),
1181 DRM_IOCTL_ASAHI_VM_BIND = DRM_IOCTL_ASAHI(W, VM_BIND, vm_bind),
1182 DRM_IOCTL_ASAHI_GEM_CREATE = DRM_IOCTL_ASAHI(WR, GEM_CREATE, gem_create),
1183 DRM_IOCTL_ASAHI_GEM_MMAP_OFFSET = DRM_IOCTL_ASAHI(WR, GEM_MMAP_OFFSET, gem_mmap_offset),
1184 DRM_IOCTL_ASAHI_GEM_BIND_OBJECT = DRM_IOCTL_ASAHI(WR, GEM_BIND_OBJECT, gem_bind_object),
1185 DRM_IOCTL_ASAHI_QUEUE_CREATE = DRM_IOCTL_ASAHI(WR, QUEUE_CREATE, queue_create),
1186 DRM_IOCTL_ASAHI_QUEUE_DESTROY = DRM_IOCTL_ASAHI(W, QUEUE_DESTROY, queue_destroy),
1187 DRM_IOCTL_ASAHI_SUBMIT = DRM_IOCTL_ASAHI(W, SUBMIT, submit),
1188};
1189
1190#if defined(__cplusplus)
1191}
1192#endif
1193
1194#endif /* _ASAHI_DRM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/drm.h+4
......@@ -899,13 +899,17 @@ struct drm_syncobj_destroy {
899899};
900900
901901#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
902#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_TIMELINE (1 << 1)
902903#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
904#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_TIMELINE (1 << 1)
903905struct drm_syncobj_handle {
904906 __u32 handle;
905907 __u32 flags;
906908
907909 __s32 fd;
908910 __u32 pad;
911
912 __u64 point;
909913};
910914
911915struct drm_syncobj_transfer {
lib/libc/include/any-linux-any/drm/drm_fourcc.h+141-1
......@@ -210,6 +210,10 @@ extern "C" {
210210#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
211211#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
212212
213/* 48 bpp RGB */
214#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */
215#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */
216
213217/* 64 bpp RGB */
214218#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
215219#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
......@@ -218,7 +222,7 @@ extern "C" {
218222#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */
219223
220224/*
221 * Floating point 64bpp RGB
225 * Half-Floating point - 16b/component
222226 * IEEE 754-2008 binary16 half-precision float
223227 * [15:0] sign:exponent:mantissa 1:5:10
224228 */
......@@ -228,6 +232,20 @@ extern "C" {
228232#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */
229233#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */
230234
235#define DRM_FORMAT_R16F fourcc_code('R', ' ', ' ', 'H') /* [15:0] R 16 little endian */
236#define DRM_FORMAT_GR1616F fourcc_code('G', 'R', ' ', 'H') /* [31:0] G:R 16:16 little endian */
237#define DRM_FORMAT_BGR161616F fourcc_code('B', 'G', 'R', 'H') /* [47:0] B:G:R 16:16:16 little endian */
238
239/*
240 * Floating point - 32b/component
241 * IEEE 754-2008 binary32 float
242 * [31:0] sign:exponent:mantissa 1:8:23
243 */
244#define DRM_FORMAT_R32F fourcc_code('R', ' ', ' ', 'F') /* [31:0] R 32 little endian */
245#define DRM_FORMAT_GR3232F fourcc_code('G', 'R', ' ', 'F') /* [63:0] R:G 32:32 little endian */
246#define DRM_FORMAT_BGR323232F fourcc_code('B', 'G', 'R', 'F') /* [95:0] R:G:B 32:32:32 little endian */
247#define DRM_FORMAT_ABGR32323232F fourcc_code('A', 'B', '8', 'F') /* [127:0] R:G:B:A 32:32:32:32 little endian */
248
231249/*
232250 * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits
233251 * of unused padding per component:
......@@ -377,6 +395,42 @@ extern "C" {
377395 */
378396#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1')
379397
398/*
399 * 3 plane YCbCr LSB aligned
400 * In order to use these formats in a similar fashion to MSB aligned ones
401 * implementation can multiply the values by 2^6=64. For that reason the padding
402 * must only contain zeros.
403 * index 0 = Y plane, [15:0] z:Y [6:10] little endian
404 * index 1 = Cr plane, [15:0] z:Cr [6:10] little endian
405 * index 2 = Cb plane, [15:0] z:Cb [6:10] little endian
406 */
407#define DRM_FORMAT_S010 fourcc_code('S', '0', '1', '0') /* 2x2 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
408#define DRM_FORMAT_S210 fourcc_code('S', '2', '1', '0') /* 2x1 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
409#define DRM_FORMAT_S410 fourcc_code('S', '4', '1', '0') /* non-subsampled Cb (1) and Cr (2) planes 10 bits per channel */
410
411/*
412 * 3 plane YCbCr LSB aligned
413 * In order to use these formats in a similar fashion to MSB aligned ones
414 * implementation can multiply the values by 2^4=16. For that reason the padding
415 * must only contain zeros.
416 * index 0 = Y plane, [15:0] z:Y [4:12] little endian
417 * index 1 = Cr plane, [15:0] z:Cr [4:12] little endian
418 * index 2 = Cb plane, [15:0] z:Cb [4:12] little endian
419 */
420#define DRM_FORMAT_S012 fourcc_code('S', '0', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
421#define DRM_FORMAT_S212 fourcc_code('S', '2', '1', '2') /* 2x1 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
422#define DRM_FORMAT_S412 fourcc_code('S', '4', '1', '2') /* non-subsampled Cb (1) and Cr (2) planes 12 bits per channel */
423
424/*
425 * 3 plane YCbCr
426 * index 0 = Y plane, [15:0] Y little endian
427 * index 1 = Cr plane, [15:0] Cr little endian
428 * index 2 = Cb plane, [15:0] Cb little endian
429 */
430#define DRM_FORMAT_S016 fourcc_code('S', '0', '1', '6') /* 2x2 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
431#define DRM_FORMAT_S216 fourcc_code('S', '2', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
432#define DRM_FORMAT_S416 fourcc_code('S', '4', '1', '6') /* non-subsampled Cb (1) and Cr (2) planes 16 bits per channel */
433
380434/*
381435 * 3 plane YCbCr
382436 * index 0: Y plane, [7:0] Y
......@@ -421,6 +475,8 @@ extern "C" {
421475#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
422476#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
423477#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a
478#define DRM_FORMAT_MOD_VENDOR_MTK 0x0b
479#define DRM_FORMAT_MOD_VENDOR_APPLE 0x0c
424480
425481/* add more to the end as needed */
426482
......@@ -1453,6 +1509,90 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
14531509 */
14541510#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0)
14551511
1512/* MediaTek modifiers
1513 * Bits Parameter Notes
1514 * ----- ------------------------ ---------------------------------------------
1515 * 7: 0 TILE LAYOUT Values are MTK_FMT_MOD_TILE_*
1516 * 15: 8 COMPRESSION Values are MTK_FMT_MOD_COMPRESS_*
1517 * 23:16 10 BIT LAYOUT Values are MTK_FMT_MOD_10BIT_LAYOUT_*
1518 *
1519 */
1520
1521#define DRM_FORMAT_MOD_MTK(__flags) fourcc_mod_code(MTK, __flags)
1522
1523/*
1524 * MediaTek Tiled Modifier
1525 * The lowest 8 bits of the modifier is used to specify the tiling
1526 * layout. Only the 16L_32S tiling is used for now, but we define an
1527 * "untiled" version and leave room for future expansion.
1528 */
1529#define MTK_FMT_MOD_TILE_MASK 0xf
1530#define MTK_FMT_MOD_TILE_NONE 0x0
1531#define MTK_FMT_MOD_TILE_16L32S 0x1
1532
1533/*
1534 * Bits 8-15 specify compression options
1535 */
1536#define MTK_FMT_MOD_COMPRESS_MASK (0xf << 8)
1537#define MTK_FMT_MOD_COMPRESS_NONE (0x0 << 8)
1538#define MTK_FMT_MOD_COMPRESS_V1 (0x1 << 8)
1539
1540/*
1541 * Bits 16-23 specify how the bits of 10 bit formats are
1542 * stored out in memory
1543 */
1544#define MTK_FMT_MOD_10BIT_LAYOUT_MASK (0xf << 16)
1545#define MTK_FMT_MOD_10BIT_LAYOUT_PACKED (0x0 << 16)
1546#define MTK_FMT_MOD_10BIT_LAYOUT_LSBTILED (0x1 << 16)
1547#define MTK_FMT_MOD_10BIT_LAYOUT_LSBRASTER (0x2 << 16)
1548
1549/* alias for the most common tiling format */
1550#define DRM_FORMAT_MOD_MTK_16L_32S_TILE DRM_FORMAT_MOD_MTK(MTK_FMT_MOD_TILE_16L32S)
1551
1552/*
1553 * Apple GPU-tiled layouts.
1554 *
1555 * Apple GPUs support nonlinear tilings with optional lossless compression.
1556 *
1557 * GPU-tiled images are divided into 16KiB tiles:
1558 *
1559 * Bytes per pixel Tile size
1560 * --------------- ---------
1561 * 1 128x128
1562 * 2 128x64
1563 * 4 64x64
1564 * 8 64x32
1565 * 16 32x32
1566 *
1567 * Tiles are raster-order. Pixels within a tile are interleaved (Morton order).
1568 *
1569 * Compressed images pad the body to 128-bytes and are immediately followed by a
1570 * metadata section. The metadata section rounds the image dimensions to
1571 * powers-of-two and contains 8 bytes for each 16x16 compression subtile.
1572 * Subtiles are interleaved (Morton order).
1573 *
1574 * All images are 128-byte aligned.
1575 *
1576 * These layouts fundamentally do not have meaningful strides. No matter how we
1577 * specify strides for these layouts, userspace unaware of Apple image layouts
1578 * will be unable to use correctly the specified stride for any purpose.
1579 * Userspace aware of the image layouts do not use strides. The most "correct"
1580 * convention would be setting the image stride to 0. Unfortunately, some
1581 * software assumes the stride is at least (width * bytes per pixel). We
1582 * therefore require that stride equals (width * bytes per pixel). Since the
1583 * stride is arbitrary here, we pick the simplest convention.
1584 *
1585 * Although containing two sections, compressed image layouts are treated in
1586 * software as a single plane. This is modelled after AFBC, a similar
1587 * scheme. Attempting to separate the sections to be "explicit" in DRM would
1588 * only generate more confusion, as software does not treat the image this way.
1589 *
1590 * For detailed information on the hardware image layouts, see
1591 * https://docs.mesa3d.org/drivers/asahi.html#image-layouts
1592 */
1593#define DRM_FORMAT_MOD_APPLE_GPU_TILED fourcc_mod_code(APPLE, 1)
1594#define DRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSED fourcc_mod_code(APPLE, 2)
1595
14561596/*
14571597 * AMD modifiers
14581598 *
lib/libc/include/any-linux-any/drm/ivpu_accel.h+100-2
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
22/*
3 * Copyright (C) 2020-2024 Intel Corporation
3 * Copyright (C) 2020-2025 Intel Corporation
44 */
55
66#ifndef __UAPI_IVPU_DRM_H__
......@@ -22,6 +22,9 @@ extern "C" {
2222#define DRM_IVPU_METRIC_STREAMER_STOP 0x08
2323#define DRM_IVPU_METRIC_STREAMER_GET_DATA 0x09
2424#define DRM_IVPU_METRIC_STREAMER_GET_INFO 0x0a
25#define DRM_IVPU_CMDQ_CREATE 0x0b
26#define DRM_IVPU_CMDQ_DESTROY 0x0c
27#define DRM_IVPU_CMDQ_SUBMIT 0x0d
2528
2629#define DRM_IOCTL_IVPU_GET_PARAM \
2730 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_GET_PARAM, struct drm_ivpu_param)
......@@ -57,6 +60,15 @@ extern "C" {
5760 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_METRIC_STREAMER_GET_INFO, \
5861 struct drm_ivpu_metric_streamer_get_data)
5962
63#define DRM_IOCTL_IVPU_CMDQ_CREATE \
64 DRM_IOWR(DRM_COMMAND_BASE + DRM_IVPU_CMDQ_CREATE, struct drm_ivpu_cmdq_create)
65
66#define DRM_IOCTL_IVPU_CMDQ_DESTROY \
67 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_CMDQ_DESTROY, struct drm_ivpu_cmdq_destroy)
68
69#define DRM_IOCTL_IVPU_CMDQ_SUBMIT \
70 DRM_IOW(DRM_COMMAND_BASE + DRM_IVPU_CMDQ_SUBMIT, struct drm_ivpu_cmdq_submit)
71
6072/**
6173 * DOC: contexts
6274 *
......@@ -107,6 +119,13 @@ extern "C" {
107119 * accessible by hardware DMA.
108120 */
109121#define DRM_IVPU_CAP_DMA_MEMORY_RANGE 2
122/**
123 * DRM_IVPU_CAP_MANAGE_CMDQ
124 *
125 * Driver supports explicit command queue operations like command queue create,
126 * command queue destroy and submit job on specific command queue.
127 */
128#define DRM_IVPU_CAP_MANAGE_CMDQ 3
110129
111130/**
112131 * struct drm_ivpu_param - Get/Set VPU parameters
......@@ -128,7 +147,7 @@ struct drm_ivpu_param {
128147 * platform type when executing on a simulator or emulator (read-only)
129148 *
130149 * %DRM_IVPU_PARAM_CORE_CLOCK_RATE:
131 * Current PLL frequency (read-only)
150 * Maximum frequency of the NPU data processing unit clock (read-only)
132151 *
133152 * %DRM_IVPU_PARAM_NUM_CONTEXTS:
134153 * Maximum number of simultaneously existing contexts (read-only)
......@@ -316,6 +335,44 @@ struct drm_ivpu_submit {
316335 __u32 priority;
317336};
318337
338/**
339 * struct drm_ivpu_cmdq_submit - Submit commands to the VPU using explicit command queue
340 *
341 * Execute a single command buffer on a given command queue.
342 * Handles to all referenced buffer objects have to be provided in @buffers_ptr.
343 *
344 * User space may wait on job completion using %DRM_IVPU_BO_WAIT ioctl.
345 */
346struct drm_ivpu_cmdq_submit {
347 /**
348 * @buffers_ptr:
349 *
350 * A pointer to an u32 array of GEM handles of the BOs required for this job.
351 * The number of elements in the array must be equal to the value given by @buffer_count.
352 *
353 * The first BO is the command buffer. The rest of array has to contain all
354 * BOs referenced from the command buffer.
355 */
356 __u64 buffers_ptr;
357
358 /** @buffer_count: Number of elements in the @buffers_ptr */
359 __u32 buffer_count;
360
361 /** @cmdq_id: ID for the command queue where job will be submitted */
362 __u32 cmdq_id;
363
364 /** @flags: Reserved for future use - must be zero */
365 __u32 flags;
366
367 /**
368 * @commands_offset:
369 *
370 * Offset inside the first buffer in @buffers_ptr containing commands
371 * to be executed. The offset has to be 8-byte aligned.
372 */
373 __u32 commands_offset;
374};
375
319376/* drm_ivpu_bo_wait job status codes */
320377#define DRM_IVPU_JOB_STATUS_SUCCESS 0
321378#define DRM_IVPU_JOB_STATUS_ABORTED 256
......@@ -388,6 +445,47 @@ struct drm_ivpu_metric_streamer_get_data {
388445 __u64 data_size;
389446};
390447
448/* Command queue flags */
449#define DRM_IVPU_CMDQ_FLAG_TURBO 0x00000001
450
451/**
452 * struct drm_ivpu_cmdq_create - Create command queue for job submission
453 */
454struct drm_ivpu_cmdq_create {
455 /** @cmdq_id: Returned ID of created command queue */
456 __u32 cmdq_id;
457 /**
458 * @priority:
459 *
460 * Priority to be set for related job command queue, can be one of the following:
461 * %DRM_IVPU_JOB_PRIORITY_DEFAULT
462 * %DRM_IVPU_JOB_PRIORITY_IDLE
463 * %DRM_IVPU_JOB_PRIORITY_NORMAL
464 * %DRM_IVPU_JOB_PRIORITY_FOCUS
465 * %DRM_IVPU_JOB_PRIORITY_REALTIME
466 */
467 __u32 priority;
468 /**
469 * @flags:
470 *
471 * Supported flags:
472 *
473 * %DRM_IVPU_CMDQ_FLAG_TURBO
474 *
475 * Enable low-latency mode for the command queue. The NPU will maximize performance
476 * when executing jobs from such queue at the cost of increased power usage.
477 */
478 __u32 flags;
479};
480
481/**
482 * struct drm_ivpu_cmdq_destroy - Destroy a command queue
483 */
484struct drm_ivpu_cmdq_destroy {
485 /** @cmdq_id: ID of command queue to destroy */
486 __u32 cmdq_id;
487};
488
391489/**
392490 * struct drm_ivpu_metric_streamer_stop - Stop collecting metric data
393491 */
lib/libc/include/any-linux-any/drm/msm_drm.h+135-15
......@@ -90,6 +90,33 @@ struct drm_msm_timespec {
9090#define MSM_PARAM_RAYTRACING 0x11 /* RO */
9191#define MSM_PARAM_UBWC_SWIZZLE 0x12 /* RO */
9292#define MSM_PARAM_MACROTILE_MODE 0x13 /* RO */
93#define MSM_PARAM_UCHE_TRAP_BASE 0x14 /* RO */
94/* PRR (Partially Resident Region) is required for sparse residency: */
95#define MSM_PARAM_HAS_PRR 0x15 /* RO */
96/* MSM_PARAM_EN_VM_BIND is set to 1 to enable VM_BIND ops.
97 *
98 * With VM_BIND enabled, userspace is required to allocate iova and use the
99 * VM_BIND ops for map/unmap ioctls. MSM_INFO_SET_IOVA and MSM_INFO_GET_IOVA
100 * will be rejected. (The latter does not have a sensible meaning when a BO
101 * can have multiple and/or partial mappings.)
102 *
103 * With VM_BIND enabled, userspace does not include a submit_bo table in the
104 * SUBMIT ioctl (this will be rejected), the resident set is determined by
105 * the the VM_BIND ops.
106 *
107 * Enabling VM_BIND will fail on devices which do not have per-process pgtables.
108 * And it is not allowed to disable VM_BIND once it has been enabled.
109 *
110 * Enabling VM_BIND should be done (attempted) prior to allocating any BOs or
111 * submitqueues of type MSM_SUBMITQUEUE_VM_BIND.
112 *
113 * Relatedly, when VM_BIND mode is enabled, the kernel will not try to recover
114 * from GPU faults or failed async VM_BIND ops, in particular because it is
115 * difficult to communicate to userspace which op failed so that userspace
116 * could rewind and try again. When the VM is marked unusable, the SUBMIT
117 * ioctl will throw -EPIPE.
118 */
119#define MSM_PARAM_EN_VM_BIND 0x16 /* WO, once */
93120
94121/* For backwards compat. The original support for preemption was based on
95122 * a single ring per priority level so # of priority levels equals the #
......@@ -113,6 +140,19 @@ struct drm_msm_param {
113140
114141#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
115142#define MSM_BO_GPU_READONLY 0x00000002
143/* Private buffers do not need to be explicitly listed in the SUBMIT
144 * ioctl, unless referenced by a drm_msm_gem_submit_cmd. Private
145 * buffers may NOT be imported/exported or used for scanout (or any
146 * other situation where buffers can be indefinitely pinned, but
147 * cases other than scanout are all kernel owned BOs which are not
148 * visible to userspace).
149 *
150 * In exchange for those constraints, all private BOs associated with
151 * a single context (drm_file) share a single dma_resv, and if there
152 * has been no eviction since the last submit, there are no per-BO
153 * bookeeping to do, significantly cutting the SUBMIT overhead.
154 */
155#define MSM_BO_NO_SHARE 0x00000004
116156#define MSM_BO_CACHE_MASK 0x000f0000
117157/* cache modes */
118158#define MSM_BO_CACHED 0x00010000
......@@ -122,6 +162,7 @@ struct drm_msm_param {
122162
123163#define MSM_BO_FLAGS (MSM_BO_SCANOUT | \
124164 MSM_BO_GPU_READONLY | \
165 MSM_BO_NO_SHARE | \
125166 MSM_BO_CACHE_MASK)
126167
127168struct drm_msm_gem_new {
......@@ -179,6 +220,17 @@ struct drm_msm_gem_cpu_fini {
179220 * Cmdstream Submission:
180221 */
181222
223#define MSM_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
224#define MSM_SYNCOBJ_FLAGS ( \
225 MSM_SYNCOBJ_RESET | \
226 0)
227
228struct drm_msm_syncobj {
229 __u32 handle; /* in, syncobj handle. */
230 __u32 flags; /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */
231 __u64 point; /* in, timepoint for timeline syncobjs. */
232};
233
182234/* The value written into the cmdstream is logically:
183235 *
184236 * ((relocbuf->gpuaddr + reloc_offset) << shift) | or
......@@ -220,7 +272,10 @@ struct drm_msm_gem_submit_cmd {
220272 __u32 size; /* in, cmdstream size */
221273 __u32 pad;
222274 __u32 nr_relocs; /* in, number of submit_reloc's */
223 __u64 relocs; /* in, ptr to array of submit_reloc's */
275 union {
276 __u64 relocs; /* in, ptr to array of submit_reloc's */
277 __u64 iova; /* cmdstream address (for VM_BIND contexts) */
278 };
224279};
225280
226281/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
......@@ -268,17 +323,6 @@ struct drm_msm_gem_submit_bo {
268323 MSM_SUBMIT_FENCE_SN_IN | \
269324 0)
270325
271#define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 /* Reset syncobj after wait. */
272#define MSM_SUBMIT_SYNCOBJ_FLAGS ( \
273 MSM_SUBMIT_SYNCOBJ_RESET | \
274 0)
275
276struct drm_msm_gem_submit_syncobj {
277 __u32 handle; /* in, syncobj handle. */
278 __u32 flags; /* in, from MSM_SUBMIT_SYNCOBJ_FLAGS */
279 __u64 point; /* in, timepoint for timeline syncobjs. */
280};
281
282326/* Each cmdstream submit consists of a table of buffers involved, and
283327 * one or more cmdstream buffers. This allows for conditional execution
284328 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
......@@ -292,13 +336,80 @@ struct drm_msm_gem_submit {
292336 __u64 cmds; /* in, ptr to array of submit_cmd's */
293337 __s32 fence_fd; /* in/out fence fd (see MSM_SUBMIT_FENCE_FD_IN/OUT) */
294338 __u32 queueid; /* in, submitqueue id */
295 __u64 in_syncobjs; /* in, ptr to array of drm_msm_gem_submit_syncobj */
296 __u64 out_syncobjs; /* in, ptr to array of drm_msm_gem_submit_syncobj */
339 __u64 in_syncobjs; /* in, ptr to array of drm_msm_syncobj */
340 __u64 out_syncobjs; /* in, ptr to array of drm_msm_syncobj */
297341 __u32 nr_in_syncobjs; /* in, number of entries in in_syncobj */
298342 __u32 nr_out_syncobjs; /* in, number of entries in out_syncobj. */
299343 __u32 syncobj_stride; /* in, stride of syncobj arrays. */
300344 __u32 pad; /*in, reserved for future use, always 0. */
345};
301346
347#define MSM_VM_BIND_OP_UNMAP 0
348#define MSM_VM_BIND_OP_MAP 1
349#define MSM_VM_BIND_OP_MAP_NULL 2
350
351#define MSM_VM_BIND_OP_DUMP 1
352#define MSM_VM_BIND_OP_FLAGS ( \
353 MSM_VM_BIND_OP_DUMP | \
354 0)
355
356/**
357 * struct drm_msm_vm_bind_op - bind/unbind op to run
358 */
359struct drm_msm_vm_bind_op {
360 /** @op: one of MSM_VM_BIND_OP_x */
361 __u32 op;
362 /** @handle: GEM object handle, MBZ for UNMAP or MAP_NULL */
363 __u32 handle;
364 /** @obj_offset: Offset into GEM object, MBZ for UNMAP or MAP_NULL */
365 __u64 obj_offset;
366 /** @iova: Address to operate on */
367 __u64 iova;
368 /** @range: Number of bites to to map/unmap */
369 __u64 range;
370 /** @flags: Bitmask of MSM_VM_BIND_OP_FLAG_x */
371 __u32 flags;
372 /** @pad: MBZ */
373 __u32 pad;
374};
375
376#define MSM_VM_BIND_FENCE_FD_IN 0x00000001
377#define MSM_VM_BIND_FENCE_FD_OUT 0x00000002
378#define MSM_VM_BIND_FLAGS ( \
379 MSM_VM_BIND_FENCE_FD_IN | \
380 MSM_VM_BIND_FENCE_FD_OUT | \
381 0)
382
383/**
384 * struct drm_msm_vm_bind - Input of &DRM_IOCTL_MSM_VM_BIND
385 */
386struct drm_msm_vm_bind {
387 /** @flags: in, bitmask of MSM_VM_BIND_x */
388 __u32 flags;
389 /** @nr_ops: the number of bind ops in this ioctl */
390 __u32 nr_ops;
391 /** @fence_fd: in/out fence fd (see MSM_VM_BIND_FENCE_FD_IN/OUT) */
392 __s32 fence_fd;
393 /** @queue_id: in, submitqueue id */
394 __u32 queue_id;
395 /** @in_syncobjs: in, ptr to array of drm_msm_gem_syncobj */
396 __u64 in_syncobjs;
397 /** @out_syncobjs: in, ptr to array of drm_msm_gem_syncobj */
398 __u64 out_syncobjs;
399 /** @nr_in_syncobjs: in, number of entries in in_syncobj */
400 __u32 nr_in_syncobjs;
401 /** @nr_out_syncobjs: in, number of entries in out_syncobj */
402 __u32 nr_out_syncobjs;
403 /** @syncobj_stride: in, stride of syncobj arrays */
404 __u32 syncobj_stride;
405 /** @op_stride: sizeof each struct drm_msm_vm_bind_op in @ops */
406 __u32 op_stride;
407 union {
408 /** @op: used if num_ops == 1 */
409 struct drm_msm_vm_bind_op op;
410 /** @ops: userptr to array of drm_msm_vm_bind_op if num_ops > 1 */
411 __u64 ops;
412 };
302413};
303414
304415#define MSM_WAIT_FENCE_BOOST 0x00000001
......@@ -344,12 +455,19 @@ struct drm_msm_gem_madvise {
344455/*
345456 * Draw queues allow the user to set specific submission parameter. Command
346457 * submissions specify a specific submitqueue to use. ID 0 is reserved for
347 * backwards compatibility as a "default" submitqueue
458 * backwards compatibility as a "default" submitqueue.
459 *
460 * Because VM_BIND async updates happen on the CPU, they must run on a
461 * virtual queue created with the flag MSM_SUBMITQUEUE_VM_BIND. If we had
462 * a way to do pgtable updates on the GPU, we could drop this restriction.
348463 */
349464
350465#define MSM_SUBMITQUEUE_ALLOW_PREEMPT 0x00000001
466#define MSM_SUBMITQUEUE_VM_BIND 0x00000002 /* virtual queue for VM_BIND ops */
467
351468#define MSM_SUBMITQUEUE_FLAGS ( \
352469 MSM_SUBMITQUEUE_ALLOW_PREEMPT | \
470 MSM_SUBMITQUEUE_VM_BIND | \
353471 0)
354472
355473/*
......@@ -387,6 +505,7 @@ struct drm_msm_submitqueue_query {
387505#define DRM_MSM_SUBMITQUEUE_NEW 0x0A
388506#define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B
389507#define DRM_MSM_SUBMITQUEUE_QUERY 0x0C
508#define DRM_MSM_VM_BIND 0x0D
390509
391510#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
392511#define DRM_IOCTL_MSM_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param)
......@@ -400,6 +519,7 @@ struct drm_msm_submitqueue_query {
400519#define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue)
401520#define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32)
402521#define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query)
522#define DRM_IOCTL_MSM_VM_BIND DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_VM_BIND, struct drm_msm_vm_bind)
403523
404524#if defined(__cplusplus)
405525}
lib/libc/include/any-linux-any/drm/nova_drm.h created+101
......@@ -0,0 +1,101 @@
1/* SPDX-License-Identifier: MIT */
2
3#ifndef __NOVA_DRM_H__
4#define __NOVA_DRM_H__
5
6#include "drm.h"
7
8/* DISCLAIMER: Do not use, this is not a stable uAPI.
9 *
10 * This uAPI serves only testing purposes as long as this driver is still in
11 * development. It is required to implement and test infrastructure which is
12 * upstreamed in the context of this driver. See also [1].
13 *
14 * [1] https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u
15 */
16
17#if defined(__cplusplus)
18extern "C" {
19#endif
20
21/*
22 * NOVA_GETPARAM_VRAM_BAR_SIZE
23 *
24 * Query the VRAM BAR size in bytes.
25 */
26#define NOVA_GETPARAM_VRAM_BAR_SIZE 0x1
27
28/**
29 * struct drm_nova_getparam - query GPU and driver metadata
30 */
31struct drm_nova_getparam {
32 /**
33 * @param: The identifier of the parameter to query.
34 */
35 __u64 param;
36
37 /**
38 * @value: The value for the specified parameter.
39 */
40 __u64 value;
41};
42
43/**
44 * struct drm_nova_gem_create - create a new DRM GEM object
45 */
46struct drm_nova_gem_create {
47 /**
48 * @handle: The handle of the new DRM GEM object.
49 */
50 __u32 handle;
51
52 /**
53 * @pad: 32 bit padding, should be 0.
54 */
55 __u32 pad;
56
57 /**
58 * @size: The size of the new DRM GEM object.
59 */
60 __u64 size;
61};
62
63/**
64 * struct drm_nova_gem_info - query DRM GEM object metadata
65 */
66struct drm_nova_gem_info {
67 /**
68 * @handle: The handle of the DRM GEM object to query.
69 */
70 __u32 handle;
71
72 /**
73 * @pad: 32 bit padding, should be 0.
74 */
75 __u32 pad;
76
77 /**
78 * @size: The size of the DRM GEM obejct.
79 */
80 __u64 size;
81};
82
83#define DRM_NOVA_GETPARAM 0x00
84#define DRM_NOVA_GEM_CREATE 0x01
85#define DRM_NOVA_GEM_INFO 0x02
86
87/* Note: this is an enum so that it can be resolved by Rust bindgen. */
88enum {
89 DRM_IOCTL_NOVA_GETPARAM = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GETPARAM,
90 struct drm_nova_getparam),
91 DRM_IOCTL_NOVA_GEM_CREATE = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GEM_CREATE,
92 struct drm_nova_gem_create),
93 DRM_IOCTL_NOVA_GEM_INFO = DRM_IOWR(DRM_COMMAND_BASE + DRM_NOVA_GEM_INFO,
94 struct drm_nova_gem_info),
95};
96
97#if defined(__cplusplus)
98}
99#endif
100
101#endif /* __NOVA_DRM_H__ */
\ No newline at end of file
lib/libc/include/any-linux-any/drm/panfrost_drm.h+21
......@@ -21,6 +21,7 @@ extern "C" {
2121#define DRM_PANFROST_PERFCNT_ENABLE 0x06
2222#define DRM_PANFROST_PERFCNT_DUMP 0x07
2323#define DRM_PANFROST_MADVISE 0x08
24#define DRM_PANFROST_SET_LABEL_BO 0x09
2425
2526#define DRM_IOCTL_PANFROST_SUBMIT DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_SUBMIT, struct drm_panfrost_submit)
2627#define DRM_IOCTL_PANFROST_WAIT_BO DRM_IOW(DRM_COMMAND_BASE + DRM_PANFROST_WAIT_BO, struct drm_panfrost_wait_bo)
......@@ -29,6 +30,7 @@ extern "C" {
2930#define DRM_IOCTL_PANFROST_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_PARAM, struct drm_panfrost_get_param)
3031#define DRM_IOCTL_PANFROST_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_GET_BO_OFFSET, struct drm_panfrost_get_bo_offset)
3132#define DRM_IOCTL_PANFROST_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_MADVISE, struct drm_panfrost_madvise)
33#define DRM_IOCTL_PANFROST_SET_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_PANFROST_SET_LABEL_BO, struct drm_panfrost_set_label_bo)
3234
3335/*
3436 * Unstable ioctl(s): only exposed when the unsafe unstable_ioctls module
......@@ -227,6 +229,25 @@ struct drm_panfrost_madvise {
227229 __u32 retained; /* out, whether backing store still exists */
228230};
229231
232/**
233 * struct drm_panfrost_set_label_bo - ioctl argument for labelling Panfrost BOs.
234 */
235struct drm_panfrost_set_label_bo {
236 /** @handle: Handle of the buffer object to label. */
237 __u32 handle;
238
239 /** @pad: MBZ. */
240 __u32 pad;
241
242 /**
243 * @label: User pointer to a NUL-terminated string
244 *
245 * Length cannot be greater than 4096.
246 * NULL is permitted and means clear the label.
247 */
248 __u64 label;
249};
250
230251/* Definitions for coredump decoding in user space */
231252#define PANFROSTDUMP_MAJOR 1
232253#define PANFROSTDUMP_MINOR 0
lib/libc/include/any-linux-any/drm/panthor_drm.h+116-41
......@@ -127,49 +127,24 @@ enum drm_panthor_ioctl_id {
127127
128128 /** @DRM_PANTHOR_TILER_HEAP_DESTROY: Destroy a tiler heap. */
129129 DRM_PANTHOR_TILER_HEAP_DESTROY,
130};
131130
132/**
133 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
134 * @__access: Access type. Must be R, W or RW.
135 * @__id: One of the DRM_PANTHOR_xxx id.
136 * @__type: Suffix of the type being passed to the IOCTL.
137 *
138 * Don't use this macro directly, use the DRM_IOCTL_PANTHOR_xxx
139 * values instead.
140 *
141 * Return: An IOCTL number to be passed to ioctl() from userspace.
142 */
143#define DRM_IOCTL_PANTHOR(__access, __id, __type) \
144 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_PANTHOR_ ## __id, \
145 struct drm_panthor_ ## __type)
131 /** @DRM_PANTHOR_BO_SET_LABEL: Label a BO. */
132 DRM_PANTHOR_BO_SET_LABEL,
146133
147#define DRM_IOCTL_PANTHOR_DEV_QUERY \
148 DRM_IOCTL_PANTHOR(WR, DEV_QUERY, dev_query)
149#define DRM_IOCTL_PANTHOR_VM_CREATE \
150 DRM_IOCTL_PANTHOR(WR, VM_CREATE, vm_create)
151#define DRM_IOCTL_PANTHOR_VM_DESTROY \
152 DRM_IOCTL_PANTHOR(WR, VM_DESTROY, vm_destroy)
153#define DRM_IOCTL_PANTHOR_VM_BIND \
154 DRM_IOCTL_PANTHOR(WR, VM_BIND, vm_bind)
155#define DRM_IOCTL_PANTHOR_VM_GET_STATE \
156 DRM_IOCTL_PANTHOR(WR, VM_GET_STATE, vm_get_state)
157#define DRM_IOCTL_PANTHOR_BO_CREATE \
158 DRM_IOCTL_PANTHOR(WR, BO_CREATE, bo_create)
159#define DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET \
160 DRM_IOCTL_PANTHOR(WR, BO_MMAP_OFFSET, bo_mmap_offset)
161#define DRM_IOCTL_PANTHOR_GROUP_CREATE \
162 DRM_IOCTL_PANTHOR(WR, GROUP_CREATE, group_create)
163#define DRM_IOCTL_PANTHOR_GROUP_DESTROY \
164 DRM_IOCTL_PANTHOR(WR, GROUP_DESTROY, group_destroy)
165#define DRM_IOCTL_PANTHOR_GROUP_SUBMIT \
166 DRM_IOCTL_PANTHOR(WR, GROUP_SUBMIT, group_submit)
167#define DRM_IOCTL_PANTHOR_GROUP_GET_STATE \
168 DRM_IOCTL_PANTHOR(WR, GROUP_GET_STATE, group_get_state)
169#define DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE \
170 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create)
171#define DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY \
172 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy)
134 /**
135 * @DRM_PANTHOR_SET_USER_MMIO_OFFSET: Set the offset to use as the user MMIO offset.
136 *
137 * The default behavior is to pick the MMIO offset based on the size of the pgoff_t
138 * type seen by the process that manipulates the FD, such that a 32-bit process can
139 * always map the user MMIO ranges. But this approach doesn't work well for emulators
140 * like FEX, where the emulator is an 64-bit binary which might be executing 32-bit
141 * code. In that case, the kernel thinks it's the 64-bit process and assumes
142 * DRM_PANTHOR_USER_MMIO_OFFSET_64BIT is in use, but the UMD library expects
143 * DRM_PANTHOR_USER_MMIO_OFFSET_32BIT, because it can't mmap() anything above the
144 * pgoff_t size.
145 */
146 DRM_PANTHOR_SET_USER_MMIO_OFFSET,
147};
173148
174149/**
175150 * DOC: IOCTL arguments
......@@ -335,6 +310,9 @@ struct drm_panthor_gpu_info {
335310 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */
336311 __u32 as_present;
337312
313 /** @pad0: MBZ. */
314 __u32 pad0;
315
338316 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */
339317 __u64 shader_present;
340318
......@@ -923,6 +901,15 @@ enum drm_panthor_group_state_flags {
923901 * When a group ends up with this flag set, no jobs can be submitted to its queues.
924902 */
925903 DRM_PANTHOR_GROUP_STATE_FATAL_FAULT = 1 << 1,
904
905 /**
906 * @DRM_PANTHOR_GROUP_STATE_INNOCENT: Group was killed during a reset caused by other
907 * groups.
908 *
909 * This flag can only be set if DRM_PANTHOR_GROUP_STATE_TIMEDOUT is set and
910 * DRM_PANTHOR_GROUP_STATE_FATAL_FAULT is not.
911 */
912 DRM_PANTHOR_GROUP_STATE_INNOCENT = 1 << 2,
926913};
927914
928915/**
......@@ -1010,6 +997,94 @@ struct drm_panthor_tiler_heap_destroy {
1010997 __u32 pad;
1011998};
1012999
1000/**
1001 * struct drm_panthor_bo_set_label - Arguments passed to DRM_IOCTL_PANTHOR_BO_SET_LABEL
1002 */
1003struct drm_panthor_bo_set_label {
1004 /** @handle: Handle of the buffer object to label. */
1005 __u32 handle;
1006
1007 /** @pad: MBZ. */
1008 __u32 pad;
1009
1010 /**
1011 * @label: User pointer to a NUL-terminated string
1012 *
1013 * Length cannot be greater than 4096
1014 */
1015 __u64 label;
1016};
1017
1018/**
1019 * struct drm_panthor_set_user_mmio_offset - Arguments passed to
1020 * DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET
1021 *
1022 * This ioctl is only really useful if you want to support userspace
1023 * CPU emulation environments where the size of an unsigned long differs
1024 * between the host and the guest architectures.
1025 */
1026struct drm_panthor_set_user_mmio_offset {
1027 /**
1028 * @offset: User MMIO offset to use.
1029 *
1030 * Must be either DRM_PANTHOR_USER_MMIO_OFFSET_32BIT or
1031 * DRM_PANTHOR_USER_MMIO_OFFSET_64BIT.
1032 *
1033 * Use DRM_PANTHOR_USER_MMIO_OFFSET (which selects OFFSET_32BIT or
1034 * OFFSET_64BIT based on the size of an unsigned long) unless you
1035 * have a very good reason to overrule this decision.
1036 */
1037 __u64 offset;
1038};
1039
1040/**
1041 * DRM_IOCTL_PANTHOR() - Build a Panthor IOCTL number
1042 * @__access: Access type. Must be R, W or RW.
1043 * @__id: One of the DRM_PANTHOR_xxx id.
1044 * @__type: Suffix of the type being passed to the IOCTL.
1045 *
1046 * Don't use this macro directly, use the DRM_IOCTL_PANTHOR_xxx
1047 * values instead.
1048 *
1049 * Return: An IOCTL number to be passed to ioctl() from userspace.
1050 */
1051#define DRM_IOCTL_PANTHOR(__access, __id, __type) \
1052 DRM_IO ## __access(DRM_COMMAND_BASE + DRM_PANTHOR_ ## __id, \
1053 struct drm_panthor_ ## __type)
1054
1055enum {
1056 DRM_IOCTL_PANTHOR_DEV_QUERY =
1057 DRM_IOCTL_PANTHOR(WR, DEV_QUERY, dev_query),
1058 DRM_IOCTL_PANTHOR_VM_CREATE =
1059 DRM_IOCTL_PANTHOR(WR, VM_CREATE, vm_create),
1060 DRM_IOCTL_PANTHOR_VM_DESTROY =
1061 DRM_IOCTL_PANTHOR(WR, VM_DESTROY, vm_destroy),
1062 DRM_IOCTL_PANTHOR_VM_BIND =
1063 DRM_IOCTL_PANTHOR(WR, VM_BIND, vm_bind),
1064 DRM_IOCTL_PANTHOR_VM_GET_STATE =
1065 DRM_IOCTL_PANTHOR(WR, VM_GET_STATE, vm_get_state),
1066 DRM_IOCTL_PANTHOR_BO_CREATE =
1067 DRM_IOCTL_PANTHOR(WR, BO_CREATE, bo_create),
1068 DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET =
1069 DRM_IOCTL_PANTHOR(WR, BO_MMAP_OFFSET, bo_mmap_offset),
1070 DRM_IOCTL_PANTHOR_GROUP_CREATE =
1071 DRM_IOCTL_PANTHOR(WR, GROUP_CREATE, group_create),
1072 DRM_IOCTL_PANTHOR_GROUP_DESTROY =
1073 DRM_IOCTL_PANTHOR(WR, GROUP_DESTROY, group_destroy),
1074 DRM_IOCTL_PANTHOR_GROUP_SUBMIT =
1075 DRM_IOCTL_PANTHOR(WR, GROUP_SUBMIT, group_submit),
1076 DRM_IOCTL_PANTHOR_GROUP_GET_STATE =
1077 DRM_IOCTL_PANTHOR(WR, GROUP_GET_STATE, group_get_state),
1078 DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE =
1079 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_CREATE, tiler_heap_create),
1080 DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY =
1081 DRM_IOCTL_PANTHOR(WR, TILER_HEAP_DESTROY, tiler_heap_destroy),
1082 DRM_IOCTL_PANTHOR_BO_SET_LABEL =
1083 DRM_IOCTL_PANTHOR(WR, BO_SET_LABEL, bo_set_label),
1084 DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET =
1085 DRM_IOCTL_PANTHOR(WR, SET_USER_MMIO_OFFSET, set_user_mmio_offset),
1086};
1087
10131088#if defined(__cplusplus)
10141089}
10151090#endif
lib/libc/include/any-linux-any/drm/qaic_accel.h+1-1
......@@ -64,7 +64,7 @@ struct qaic_manage_trans_hdr {
6464/**
6565 * struct qaic_manage_trans_passthrough - Defines a passthrough transaction.
6666 * @hdr: In. Header to identify this transaction.
67 * @data: In. Payload of this ransaction. Opaque to the driver. Userspace must
67 * @data: In. Payload of this transaction. Opaque to the driver. Userspace must
6868 * encode in little endian and align/pad to 64-bit.
6969 */
7070struct qaic_manage_trans_passthrough {
lib/libc/include/any-linux-any/drm/v3d_drm.h+18
......@@ -43,6 +43,7 @@ extern "C" {
4343#define DRM_V3D_PERFMON_GET_VALUES 0x0a
4444#define DRM_V3D_SUBMIT_CPU 0x0b
4545#define DRM_V3D_PERFMON_GET_COUNTER 0x0c
46#define DRM_V3D_PERFMON_SET_GLOBAL 0x0d
4647
4748#define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl)
4849#define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo)
......@@ -61,6 +62,8 @@ extern "C" {
6162#define DRM_IOCTL_V3D_SUBMIT_CPU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CPU, struct drm_v3d_submit_cpu)
6263#define DRM_IOCTL_V3D_PERFMON_GET_COUNTER DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_COUNTER, \
6364 struct drm_v3d_perfmon_get_counter)
65#define DRM_IOCTL_V3D_PERFMON_SET_GLOBAL DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_PERFMON_SET_GLOBAL, \
66 struct drm_v3d_perfmon_set_global)
6467
6568#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01
6669#define DRM_V3D_SUBMIT_EXTENSION 0x02
......@@ -766,6 +769,21 @@ struct drm_v3d_perfmon_get_counter {
766769 __u8 reserved[7];
767770};
768771
772#define DRM_V3D_PERFMON_CLEAR_GLOBAL 0x0001
773
774/**
775 * struct drm_v3d_perfmon_set_global - ioctl to define a global performance
776 * monitor
777 *
778 * The global performance monitor will be used for all jobs. If a global
779 * performance monitor is defined, jobs with a self-defined performance
780 * monitor won't be allowed.
781 */
782struct drm_v3d_perfmon_set_global {
783 __u32 flags;
784 __u32 id;
785};
786
769787#if defined(__cplusplus)
770788}
771789#endif
lib/libc/include/any-linux-any/drm/virtgpu_drm.h+6
......@@ -163,6 +163,12 @@ struct drm_virtgpu_3d_wait {
163163 __u32 flags;
164164};
165165
166#define VIRTGPU_DRM_CAPSET_VIRGL 1
167#define VIRTGPU_DRM_CAPSET_VIRGL2 2
168#define VIRTGPU_DRM_CAPSET_GFXSTREAM_VULKAN 3
169#define VIRTGPU_DRM_CAPSET_VENUS 4
170#define VIRTGPU_DRM_CAPSET_CROSS_DOMAIN 5
171#define VIRTGPU_DRM_CAPSET_DRM 6
166172struct drm_virtgpu_get_caps {
167173 __u32 cap_set_id;
168174 __u32 cap_set_ver;
lib/libc/include/any-linux-any/drm/xe_drm.h+254-9
......@@ -393,6 +393,10 @@ struct drm_xe_query_mem_regions {
393393 *
394394 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM - Flag is set if the device
395395 * has usable VRAM
396 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_LOW_LATENCY - Flag is set if the device
397 * has low latency hint support
398 * - %DRM_XE_QUERY_CONFIG_FLAG_HAS_CPU_ADDR_MIRROR - Flag is set if the
399 * device has CPU address mirroring support
396400 * - %DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT - Minimal memory alignment
397401 * required by this device, typically SZ_4K or SZ_64K
398402 * - %DRM_XE_QUERY_CONFIG_VA_BITS - Maximum bits of a virtual address
......@@ -409,6 +413,8 @@ struct drm_xe_query_config {
409413#define DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID 0
410414#define DRM_XE_QUERY_CONFIG_FLAGS 1
411415 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM (1 << 0)
416 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_LOW_LATENCY (1 << 1)
417 #define DRM_XE_QUERY_CONFIG_FLAG_HAS_CPU_ADDR_MIRROR (1 << 2)
412418#define DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT 2
413419#define DRM_XE_QUERY_CONFIG_VA_BITS 3
414420#define DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY 4
......@@ -629,6 +635,39 @@ struct drm_xe_query_uc_fw_version {
629635 __u64 reserved;
630636};
631637
638/**
639 * struct drm_xe_query_pxp_status - query if PXP is ready
640 *
641 * If PXP is enabled and no fatal error has occurred, the status will be set to
642 * one of the following values:
643 * 0: PXP init still in progress
644 * 1: PXP init complete
645 *
646 * If PXP is not enabled or something has gone wrong, the query will be failed
647 * with one of the following error codes:
648 * -ENODEV: PXP not supported or disabled;
649 * -EIO: fatal error occurred during init, so PXP will never be enabled;
650 * -EINVAL: incorrect value provided as part of the query;
651 * -EFAULT: error copying the memory between kernel and userspace.
652 *
653 * The status can only be 0 in the first few seconds after driver load. If
654 * everything works as expected, the status will transition to init complete in
655 * less than 1 second, while in case of errors the driver might take longer to
656 * start returning an error code, but it should still take less than 10 seconds.
657 *
658 * The supported session type bitmask is based on the values in
659 * enum drm_xe_pxp_session_type. TYPE_NONE is always supported and therefore
660 * is not reported in the bitmask.
661 *
662 */
663struct drm_xe_query_pxp_status {
664 /** @status: current PXP status */
665 __u32 status;
666
667 /** @supported_session_types: bitmask of supported PXP session types */
668 __u32 supported_session_types;
669};
670
632671/**
633672 * struct drm_xe_device_query - Input of &DRM_IOCTL_XE_DEVICE_QUERY - main
634673 * structure to query device information
......@@ -648,6 +687,7 @@ struct drm_xe_query_uc_fw_version {
648687 * attributes.
649688 * - %DRM_XE_DEVICE_QUERY_GT_TOPOLOGY
650689 * - %DRM_XE_DEVICE_QUERY_ENGINE_CYCLES
690 * - %DRM_XE_DEVICE_QUERY_PXP_STATUS
651691 *
652692 * If size is set to 0, the driver fills it with the required size for
653693 * the requested type of data to query. If size is equal to the required
......@@ -700,6 +740,8 @@ struct drm_xe_device_query {
700740#define DRM_XE_DEVICE_QUERY_ENGINE_CYCLES 6
701741#define DRM_XE_DEVICE_QUERY_UC_FW_VERSION 7
702742#define DRM_XE_DEVICE_QUERY_OA_UNITS 8
743#define DRM_XE_DEVICE_QUERY_PXP_STATUS 9
744#define DRM_XE_DEVICE_QUERY_EU_STALL 10
703745 /** @query: The type of data to query */
704746 __u32 query;
705747
......@@ -743,8 +785,23 @@ struct drm_xe_device_query {
743785 * - %DRM_XE_GEM_CPU_CACHING_WC - Allocate the pages as write-combined. This
744786 * is uncached. Scanout surfaces should likely use this. All objects
745787 * that can be placed in VRAM must use this.
788 *
789 * This ioctl supports setting the following properties via the
790 * %DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY extension, which uses the
791 * generic @drm_xe_ext_set_property struct:
792 *
793 * - %DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE - set the type of PXP session
794 * this object will be used with. Valid values are listed in enum
795 * drm_xe_pxp_session_type. %DRM_XE_PXP_TYPE_NONE is the default behavior, so
796 * there is no need to explicitly set that. Objects used with session of type
797 * %DRM_XE_PXP_TYPE_HWDRM will be marked as invalid if a PXP invalidation
798 * event occurs after their creation. Attempting to flip an invalid object
799 * will cause a black frame to be displayed instead. Submissions with invalid
800 * objects mapped in the VM will be rejected.
746801 */
747802struct drm_xe_gem_create {
803#define DRM_XE_GEM_CREATE_EXTENSION_SET_PROPERTY 0
804#define DRM_XE_GEM_CREATE_SET_PROPERTY_PXP_TYPE 0
748805 /** @extensions: Pointer to the first extension struct, if any */
749806 __u64 extensions;
750807
......@@ -811,6 +868,32 @@ struct drm_xe_gem_create {
811868
812869/**
813870 * struct drm_xe_gem_mmap_offset - Input of &DRM_IOCTL_XE_GEM_MMAP_OFFSET
871 *
872 * The @flags can be:
873 * - %DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER - For user to query special offset
874 * for use in mmap ioctl. Writing to the returned mmap address will generate a
875 * PCI memory barrier with low overhead (avoiding IOCTL call as well as writing
876 * to VRAM which would also add overhead), acting like an MI_MEM_FENCE
877 * instruction.
878 *
879 * Note: The mmap size can be at most 4K, due to HW limitations. As a result
880 * this interface is only supported on CPU architectures that support 4K page
881 * size. The mmap_offset ioctl will detect this and gracefully return an
882 * error, where userspace is expected to have a different fallback method for
883 * triggering a barrier.
884 *
885 * Roughly the usage would be as follows:
886 *
887 * .. code-block:: C
888 *
889 * struct drm_xe_gem_mmap_offset mmo = {
890 * .handle = 0, // must be set to 0
891 * .flags = DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER,
892 * };
893 *
894 * err = ioctl(fd, DRM_IOCTL_XE_GEM_MMAP_OFFSET, &mmo);
895 * map = mmap(NULL, size, PROT_WRITE, MAP_SHARED, fd, mmo.offset);
896 * map[i] = 0xdeadbeaf; // issue barrier
814897 */
815898struct drm_xe_gem_mmap_offset {
816899 /** @extensions: Pointer to the first extension struct, if any */
......@@ -819,7 +902,8 @@ struct drm_xe_gem_mmap_offset {
819902 /** @handle: Handle for the object being mapped. */
820903 __u32 handle;
821904
822 /** @flags: Must be zero */
905#define DRM_XE_MMAP_OFFSET_FLAG_PCI_BARRIER (1 << 0)
906 /** @flags: Flags */
823907 __u32 flags;
824908
825909 /** @offset: The fake offset to use for subsequent mmap call */
......@@ -833,13 +917,17 @@ struct drm_xe_gem_mmap_offset {
833917 * struct drm_xe_vm_create - Input of &DRM_IOCTL_XE_VM_CREATE
834918 *
835919 * The @flags can be:
836 * - %DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE
920 * - %DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE - Map the whole virtual address
921 * space of the VM to scratch page. A vm_bind would overwrite the scratch
922 * page mapping. This flag is mutually exclusive with the
923 * %DRM_XE_VM_CREATE_FLAG_FAULT_MODE flag, with an exception of on x2 and
924 * xe3 platform.
837925 * - %DRM_XE_VM_CREATE_FLAG_LR_MODE - An LR, or Long Running VM accepts
838926 * exec submissions to its exec_queues that don't have an upper time
839927 * limit on the job execution time. But exec submissions to these
840 * don't allow any of the flags DRM_XE_SYNC_FLAG_SYNCOBJ,
841 * DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ, DRM_XE_SYNC_FLAG_DMA_BUF,
842 * used as out-syncobjs, that is, together with DRM_XE_SYNC_FLAG_SIGNAL.
928 * don't allow any of the sync types DRM_XE_SYNC_TYPE_SYNCOBJ,
929 * DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ, used as out-syncobjs, that is,
930 * together with sync flag DRM_XE_SYNC_FLAG_SIGNAL.
843931 * LR VMs can be created in recoverable page-fault mode using
844932 * DRM_XE_VM_CREATE_FLAG_FAULT_MODE, if the device supports it.
845933 * If that flag is omitted, the UMD can not rely on the slightly
......@@ -906,6 +994,15 @@ struct drm_xe_vm_destroy {
906994 * will only be valid for DRM_XE_VM_BIND_OP_MAP operations, the BO
907995 * handle MBZ, and the BO offset MBZ. This flag is intended to
908996 * implement VK sparse bindings.
997 * - %DRM_XE_VM_BIND_FLAG_CHECK_PXP - If the object is encrypted via PXP,
998 * reject the binding if the encryption key is no longer valid. This
999 * flag has no effect on BOs that are not marked as using PXP.
1000 * - %DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR - When the CPU address mirror flag is
1001 * set, no mappings are created rather the range is reserved for CPU address
1002 * mirroring which will be populated on GPU page faults or prefetches. Only
1003 * valid on VMs with DRM_XE_VM_CREATE_FLAG_FAULT_MODE set. The CPU address
1004 * mirror flag are only valid for DRM_XE_VM_BIND_OP_MAP operations, the BO
1005 * handle MBZ, and the BO offset MBZ.
9091006 */
9101007struct drm_xe_vm_bind_op {
9111008 /** @extensions: Pointer to the first extension struct, if any */
......@@ -958,7 +1055,9 @@ struct drm_xe_vm_bind_op {
9581055 * on the @pat_index. For such mappings there is no actual memory being
9591056 * mapped (the address in the PTE is invalid), so the various PAT memory
9601057 * attributes likely do not apply. Simply leaving as zero is one
961 * option (still a valid pat_index).
1058 * option (still a valid pat_index). Same applies to
1059 * DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR bindings as for such mapping
1060 * there is no actual memory being mapped.
9621061 */
9631062 __u16 pat_index;
9641063
......@@ -974,6 +1073,14 @@ struct drm_xe_vm_bind_op {
9741073
9751074 /** @userptr: user pointer to bind on */
9761075 __u64 userptr;
1076
1077 /**
1078 * @cpu_addr_mirror_offset: Offset from GPU @addr to create
1079 * CPU address mirror mappings. MBZ with current level of
1080 * support (e.g. 1 to 1 mapping between GPU and CPU mappings
1081 * only supported).
1082 */
1083 __s64 cpu_addr_mirror_offset;
9771084 };
9781085
9791086 /**
......@@ -996,6 +1103,8 @@ struct drm_xe_vm_bind_op {
9961103#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)
9971104#define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)
9981105#define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3)
1106#define DRM_XE_VM_BIND_FLAG_CHECK_PXP (1 << 4)
1107#define DRM_XE_VM_BIND_FLAG_CPU_ADDR_MIRROR (1 << 5)
9991108 /** @flags: Bind flags */
10001109 __u32 flags;
10011110
......@@ -1087,6 +1196,29 @@ struct drm_xe_vm_bind {
10871196/**
10881197 * struct drm_xe_exec_queue_create - Input of &DRM_IOCTL_XE_EXEC_QUEUE_CREATE
10891198 *
1199 * This ioctl supports setting the following properties via the
1200 * %DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY extension, which uses the
1201 * generic @drm_xe_ext_set_property struct:
1202 *
1203 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY - set the queue priority.
1204 * CAP_SYS_NICE is required to set a value above normal.
1205 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE - set the queue timeslice
1206 * duration in microseconds.
1207 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_PXP_TYPE - set the type of PXP session
1208 * this queue will be used with. Valid values are listed in enum
1209 * drm_xe_pxp_session_type. %DRM_XE_PXP_TYPE_NONE is the default behavior, so
1210 * there is no need to explicitly set that. When a queue of type
1211 * %DRM_XE_PXP_TYPE_HWDRM is created, the PXP default HWDRM session
1212 * (%XE_PXP_HWDRM_DEFAULT_SESSION) will be started, if isn't already running.
1213 * The user is expected to query the PXP status via the query ioctl (see
1214 * %DRM_XE_DEVICE_QUERY_PXP_STATUS) and to wait for PXP to be ready before
1215 * attempting to create a queue with this property. When a queue is created
1216 * before PXP is ready, the ioctl will return -EBUSY if init is still in
1217 * progress or -EIO if init failed.
1218 * Given that going into a power-saving state kills PXP HWDRM sessions,
1219 * runtime PM will be blocked while queues of this type are alive.
1220 * All PXP queues will be killed if a PXP invalidation event occurs.
1221 *
10901222 * The example below shows how to use @drm_xe_exec_queue_create to create
10911223 * a simple exec_queue (no parallel submission) of class
10921224 * &DRM_XE_ENGINE_CLASS_RENDER.
......@@ -1105,12 +1237,27 @@ struct drm_xe_vm_bind {
11051237 * };
11061238 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);
11071239 *
1240 * Allow users to provide a hint to kernel for cases demanding low latency
1241 * profile. Please note it will have impact on power consumption. User can
1242 * indicate low latency hint with flag while creating exec queue as
1243 * mentioned below,
1244 *
1245 * struct drm_xe_exec_queue_create exec_queue_create = {
1246 * .flags = DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT,
1247 * .extensions = 0,
1248 * .vm_id = vm,
1249 * .num_bb_per_exec = 1,
1250 * .num_eng_per_bb = 1,
1251 * .instances = to_user_pointer(&instance),
1252 * };
1253 * ioctl(fd, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &exec_queue_create);
1254 *
11081255 */
11091256struct drm_xe_exec_queue_create {
11101257#define DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY 0
11111258#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY 0
11121259#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE 1
1113
1260#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_PXP_TYPE 2
11141261 /** @extensions: Pointer to the first extension struct, if any */
11151262 __u64 extensions;
11161263
......@@ -1123,7 +1270,8 @@ struct drm_xe_exec_queue_create {
11231270 /** @vm_id: VM to use for this exec queue */
11241271 __u32 vm_id;
11251272
1126 /** @flags: MBZ */
1273#define DRM_XE_EXEC_QUEUE_LOW_LATENCY_HINT (1 << 0)
1274 /** @flags: flags to use for this exec queue */
11271275 __u32 flags;
11281276
11291277 /** @exec_queue_id: Returned exec queue ID */
......@@ -1246,7 +1394,7 @@ struct drm_xe_sync {
12461394
12471395 /**
12481396 * @timeline_value: Input for the timeline sync object. Needs to be
1249 * different than 0 when used with %DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ.
1397 * different than 0 when used with %DRM_XE_SYNC_TYPE_TIMELINE_SYNCOBJ.
12501398 */
12511399 __u64 timeline_value;
12521400
......@@ -1397,6 +1545,8 @@ struct drm_xe_wait_user_fence {
13971545enum drm_xe_observation_type {
13981546 /** @DRM_XE_OBSERVATION_TYPE_OA: OA observation stream type */
13991547 DRM_XE_OBSERVATION_TYPE_OA,
1548 /** @DRM_XE_OBSERVATION_TYPE_EU_STALL: EU stall sampling observation stream type */
1549 DRM_XE_OBSERVATION_TYPE_EU_STALL,
14001550};
14011551
14021552/**
......@@ -1467,6 +1617,9 @@ enum drm_xe_oa_unit_type {
14671617
14681618 /** @DRM_XE_OA_UNIT_TYPE_OAM: OAM OA unit */
14691619 DRM_XE_OA_UNIT_TYPE_OAM,
1620
1621 /** @DRM_XE_OA_UNIT_TYPE_OAM_SAG: OAM_SAG OA unit */
1622 DRM_XE_OA_UNIT_TYPE_OAM_SAG,
14701623};
14711624
14721625/**
......@@ -1488,6 +1641,7 @@ struct drm_xe_oa_unit {
14881641#define DRM_XE_OA_CAPS_SYNCS (1 << 1)
14891642#define DRM_XE_OA_CAPS_OA_BUFFER_SIZE (1 << 2)
14901643#define DRM_XE_OA_CAPS_WAIT_NUM_REPORTS (1 << 3)
1644#define DRM_XE_OA_CAPS_OAM (1 << 4)
14911645
14921646 /** @oa_timestamp_freq: OA timestamp freq */
14931647 __u64 oa_timestamp_freq;
......@@ -1729,6 +1883,97 @@ struct drm_xe_oa_stream_info {
17291883 __u64 reserved[3];
17301884};
17311885
1886/**
1887 * enum drm_xe_pxp_session_type - Supported PXP session types.
1888 *
1889 * We currently only support HWDRM sessions, which are used for protected
1890 * content that ends up being displayed, but the HW supports multiple types, so
1891 * we might extend support in the future.
1892 */
1893enum drm_xe_pxp_session_type {
1894 /** @DRM_XE_PXP_TYPE_NONE: PXP not used */
1895 DRM_XE_PXP_TYPE_NONE = 0,
1896 /**
1897 * @DRM_XE_PXP_TYPE_HWDRM: HWDRM sessions are used for content that ends
1898 * up on the display.
1899 */
1900 DRM_XE_PXP_TYPE_HWDRM = 1,
1901};
1902
1903/* ID of the protected content session managed by Xe when PXP is active */
1904#define DRM_XE_PXP_HWDRM_DEFAULT_SESSION 0xf
1905
1906/**
1907 * enum drm_xe_eu_stall_property_id - EU stall sampling input property ids.
1908 *
1909 * These properties are passed to the driver at open as a chain of
1910 * @drm_xe_ext_set_property structures with @property set to these
1911 * properties' enums and @value set to the corresponding values of these
1912 * properties. @drm_xe_user_extension base.name should be set to
1913 * @DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY.
1914 *
1915 * With the file descriptor obtained from open, user space must enable
1916 * the EU stall stream fd with @DRM_XE_OBSERVATION_IOCTL_ENABLE before
1917 * calling read(). EIO errno from read() indicates HW dropped data
1918 * due to full buffer.
1919 */
1920enum drm_xe_eu_stall_property_id {
1921#define DRM_XE_EU_STALL_EXTENSION_SET_PROPERTY 0
1922 /**
1923 * @DRM_XE_EU_STALL_PROP_GT_ID: @gt_id of the GT on which
1924 * EU stall data will be captured.
1925 */
1926 DRM_XE_EU_STALL_PROP_GT_ID = 1,
1927
1928 /**
1929 * @DRM_XE_EU_STALL_PROP_SAMPLE_RATE: Sampling rate in
1930 * GPU cycles from @sampling_rates in struct @drm_xe_query_eu_stall
1931 */
1932 DRM_XE_EU_STALL_PROP_SAMPLE_RATE,
1933
1934 /**
1935 * @DRM_XE_EU_STALL_PROP_WAIT_NUM_REPORTS: Minimum number of
1936 * EU stall data reports to be present in the kernel buffer
1937 * before unblocking a blocked poll or read.
1938 */
1939 DRM_XE_EU_STALL_PROP_WAIT_NUM_REPORTS,
1940};
1941
1942/**
1943 * struct drm_xe_query_eu_stall - Information about EU stall sampling.
1944 *
1945 * If a query is made with a struct @drm_xe_device_query where .query
1946 * is equal to @DRM_XE_DEVICE_QUERY_EU_STALL, then the reply uses
1947 * struct @drm_xe_query_eu_stall in .data.
1948 */
1949struct drm_xe_query_eu_stall {
1950 /** @extensions: Pointer to the first extension struct, if any */
1951 __u64 extensions;
1952
1953 /** @capabilities: EU stall capabilities bit-mask */
1954 __u64 capabilities;
1955#define DRM_XE_EU_STALL_CAPS_BASE (1 << 0)
1956
1957 /** @record_size: size of each EU stall data record */
1958 __u64 record_size;
1959
1960 /** @per_xecore_buf_size: internal per XeCore buffer size */
1961 __u64 per_xecore_buf_size;
1962
1963 /** @reserved: Reserved */
1964 __u64 reserved[5];
1965
1966 /** @num_sampling_rates: Number of sampling rates in @sampling_rates array */
1967 __u64 num_sampling_rates;
1968
1969 /**
1970 * @sampling_rates: Flexible array of sampling rates
1971 * sorted in the fastest to slowest order.
1972 * Sampling rates are specified in GPU clock cycles.
1973 */
1974 __u64 sampling_rates[];
1975};
1976
17321977#if defined(__cplusplus)
17331978}
17341979#endif
lib/libc/include/any-linux-any/fwctl/cxl.h created+56
......@@ -0,0 +1,56 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2024-2025 Intel Corporation
4 *
5 * These are definitions for the mailbox command interface of CXL subsystem.
6 */
7#ifndef _FWCTL_CXL_H_
8#define _FWCTL_CXL_H_
9
10#include <linux/types.h>
11#include <linux/stddef.h>
12#include <cxl/features.h>
13
14/**
15 * struct fwctl_rpc_cxl - ioctl(FWCTL_RPC) input for CXL
16 * @opcode: CXL mailbox command opcode
17 * @flags: Flags for the command (input).
18 * @op_size: Size of input payload.
19 * @reserved1: Reserved. Must be 0s.
20 * @get_sup_feats_in: Get Supported Features input
21 * @get_feat_in: Get Feature input
22 * @set_feat_in: Set Feature input
23 */
24struct fwctl_rpc_cxl {
25 __struct_group(fwctl_rpc_cxl_hdr, hdr, /* no attrs */,
26 __u32 opcode;
27 __u32 flags;
28 __u32 op_size;
29 __u32 reserved1;
30 );
31 union {
32 struct cxl_mbox_get_sup_feats_in get_sup_feats_in;
33 struct cxl_mbox_get_feat_in get_feat_in;
34 struct cxl_mbox_set_feat_in set_feat_in;
35 };
36};
37
38/**
39 * struct fwctl_rpc_cxl_out - ioctl(FWCTL_RPC) output for CXL
40 * @size: Size of the output payload
41 * @retval: Return value from device
42 * @get_sup_feats_out: Get Supported Features output
43 * @payload: raw byte stream of payload
44 */
45struct fwctl_rpc_cxl_out {
46 __struct_group(fwctl_rpc_cxl_out_hdr, hdr, /* no attrs */,
47 __u32 size;
48 __u32 retval;
49 );
50 union {
51 struct cxl_mbox_get_sup_feats_out get_sup_feats_out;
52 __DECLARE_FLEX_ARRAY(__u8, payload);
53 };
54};
55
56#endif
\ No newline at end of file
lib/libc/include/any-linux-any/fwctl/fwctl.h created+141
......@@ -0,0 +1,141 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES.
3 */
4#ifndef _FWCTL_H
5#define _FWCTL_H
6
7#include <linux/types.h>
8#include <linux/ioctl.h>
9
10#define FWCTL_TYPE 0x9A
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 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 * - ENOMEM: Out of memory.
32 * - ENODEV: The underlying device has been hot-unplugged and the FD is
33 * orphaned.
34 *
35 * As well as additional errnos, within specific ioctls.
36 */
37enum {
38 FWCTL_CMD_BASE = 0,
39 FWCTL_CMD_INFO = 0,
40 FWCTL_CMD_RPC = 1,
41};
42
43enum fwctl_device_type {
44 FWCTL_DEVICE_TYPE_ERROR = 0,
45 FWCTL_DEVICE_TYPE_MLX5 = 1,
46 FWCTL_DEVICE_TYPE_CXL = 2,
47 FWCTL_DEVICE_TYPE_PDS = 4,
48};
49
50/**
51 * struct fwctl_info - ioctl(FWCTL_INFO)
52 * @size: sizeof(struct fwctl_info)
53 * @flags: Must be 0
54 * @out_device_type: Returns the type of the device from enum fwctl_device_type
55 * @device_data_len: On input the length of the out_device_data memory. On
56 * output the size of the kernel's device_data which may be larger or
57 * smaller than the input. Maybe 0 on input.
58 * @out_device_data: Pointer to a memory of device_data_len bytes. Kernel will
59 * fill the entire memory, zeroing as required.
60 *
61 * Returns basic information about this fwctl instance, particularly what driver
62 * is being used to define the device_data format.
63 */
64struct fwctl_info {
65 __u32 size;
66 __u32 flags;
67 __u32 out_device_type;
68 __u32 device_data_len;
69 __aligned_u64 out_device_data;
70};
71#define FWCTL_INFO _IO(FWCTL_TYPE, FWCTL_CMD_INFO)
72
73/**
74 * enum fwctl_rpc_scope - Scope of access for the RPC
75 *
76 * Refer to fwctl.rst for a more detailed discussion of these scopes.
77 */
78enum fwctl_rpc_scope {
79 /**
80 * @FWCTL_RPC_CONFIGURATION: Device configuration access scope
81 *
82 * Read/write access to device configuration. When configuration
83 * is written to the device it remains in a fully supported state.
84 */
85 FWCTL_RPC_CONFIGURATION = 0,
86 /**
87 * @FWCTL_RPC_DEBUG_READ_ONLY: Read only access to debug information
88 *
89 * Readable debug information. Debug information is compatible with
90 * kernel lockdown, and does not disclose any sensitive information. For
91 * instance exposing any encryption secrets from this information is
92 * forbidden.
93 */
94 FWCTL_RPC_DEBUG_READ_ONLY = 1,
95 /**
96 * @FWCTL_RPC_DEBUG_WRITE: Writable access to lockdown compatible debug information
97 *
98 * Allows write access to data in the device which may leave a fully
99 * supported state. This is intended to permit intensive and possibly
100 * invasive debugging. This scope will taint the kernel.
101 */
102 FWCTL_RPC_DEBUG_WRITE = 2,
103 /**
104 * @FWCTL_RPC_DEBUG_WRITE_FULL: Write access to all debug information
105 *
106 * Allows read/write access to everything. Requires CAP_SYS_RAW_IO, so
107 * it is not required to follow lockdown principals. If in doubt
108 * debugging should be placed in this scope. This scope will taint the
109 * kernel.
110 */
111 FWCTL_RPC_DEBUG_WRITE_FULL = 3,
112};
113
114/**
115 * struct fwctl_rpc - ioctl(FWCTL_RPC)
116 * @size: sizeof(struct fwctl_rpc)
117 * @scope: One of enum fwctl_rpc_scope, required scope for the RPC
118 * @in_len: Length of the in memory
119 * @out_len: Length of the out memory
120 * @in: Request message in device specific format
121 * @out: Response message in device specific format
122 *
123 * Deliver a Remote Procedure Call to the device FW and return the response. The
124 * call's parameters and return are marshaled into linear buffers of memory. Any
125 * errno indicates that delivery of the RPC to the device failed. Return status
126 * originating in the device during a successful delivery must be encoded into
127 * out.
128 *
129 * The format of the buffers matches the out_device_type from FWCTL_INFO.
130 */
131struct fwctl_rpc {
132 __u32 size;
133 __u32 scope;
134 __u32 in_len;
135 __u32 out_len;
136 __aligned_u64 in;
137 __aligned_u64 out;
138};
139#define FWCTL_RPC _IO(FWCTL_TYPE, FWCTL_CMD_RPC)
140
141#endif
\ No newline at end of file
lib/libc/include/any-linux-any/fwctl/mlx5.h created+36
......@@ -0,0 +1,36 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES
4 *
5 * These are definitions for the command interface for mlx5 HW. mlx5 FW has a
6 * User Context mechanism which allows the FW to understand a security scope.
7 * FWCTL binds each FD to a FW user context and then places the User Context ID
8 * (UID) in each command header. The created User Context has a capability set
9 * that is appropriate for FWCTL's security model.
10 *
11 * Command formation should use a copy of the structs in mlx5_ifc.h following
12 * the Programmers Reference Manual. A open release is available here:
13 *
14 * https://network.nvidia.com/files/doc-2020/ethernet-adapters-programming-manual.pdf
15 *
16 * The device_type for this file is FWCTL_DEVICE_TYPE_MLX5.
17 */
18#ifndef _FWCTL_MLX5_H
19#define _FWCTL_MLX5_H
20
21#include <linux/types.h>
22
23/**
24 * struct fwctl_info_mlx5 - ioctl(FWCTL_INFO) out_device_data
25 * @uid: The FW UID this FD is bound to. Each command header will force
26 * this value.
27 * @uctx_caps: The FW capabilities that are enabled for the uid.
28 *
29 * Return basic information about the FW interface available.
30 */
31struct fwctl_info_mlx5 {
32 __u32 uid;
33 __u32 uctx_caps;
34};
35
36#endif
\ No newline at end of file
lib/libc/include/any-linux-any/fwctl/pds.h created+62
......@@ -0,0 +1,62 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/* Copyright(c) Advanced Micro Devices, Inc */
3
4/*
5 * fwctl interface info for pds_fwctl
6 */
7
8#ifndef _FWCTL_PDS_H_
9#define _FWCTL_PDS_H_
10
11#include <linux/types.h>
12
13/**
14 * struct fwctl_info_pds
15 * @uctx_caps: bitmap of firmware capabilities
16 *
17 * Return basic information about the FW interface available.
18 */
19struct fwctl_info_pds {
20 __u32 uctx_caps;
21};
22
23/**
24 * enum pds_fwctl_capabilities
25 * @PDS_FWCTL_QUERY_CAP: firmware can be queried for information
26 * @PDS_FWCTL_SEND_CAP: firmware can be sent commands
27 */
28enum pds_fwctl_capabilities {
29 PDS_FWCTL_QUERY_CAP = 0,
30 PDS_FWCTL_SEND_CAP,
31};
32
33/**
34 * struct fwctl_rpc_pds
35 * @in.op: requested operation code
36 * @in.ep: firmware endpoint to operate on
37 * @in.rsvd: reserved
38 * @in.len: length of payload data
39 * @in.payload: address of payload buffer
40 * @in: rpc in parameters
41 * @out.retval: operation result value
42 * @out.rsvd: reserved
43 * @out.len: length of result data buffer
44 * @out.payload: address of payload data buffer
45 * @out: rpc out parameters
46 */
47struct fwctl_rpc_pds {
48 struct {
49 __u32 op;
50 __u32 ep;
51 __u32 rsvd;
52 __u32 len;
53 __aligned_u64 payload;
54 } in;
55 struct {
56 __u32 retval;
57 __u32 rsvd[2];
58 __u32 len;
59 __aligned_u64 payload;
60 } out;
61};
62#endif /* _FWCTL_PDS_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/audit.h+4-1
......@@ -33,7 +33,7 @@
3333 * 1100 - 1199 user space trusted application messages
3434 * 1200 - 1299 messages internal to the audit daemon
3535 * 1300 - 1399 audit event messages
36 * 1400 - 1499 SE Linux use
36 * 1400 - 1499 access control messages
3737 * 1500 - 1599 kernel LSPP events
3838 * 1600 - 1699 kernel crypto events
3939 * 1700 - 1799 kernel anomaly records
......@@ -146,6 +146,8 @@
146146#define AUDIT_IPE_ACCESS 1420 /* IPE denial or grant */
147147#define AUDIT_IPE_CONFIG_CHANGE 1421 /* IPE config change */
148148#define AUDIT_IPE_POLICY_LOAD 1422 /* IPE policy load */
149#define AUDIT_LANDLOCK_ACCESS 1423 /* Landlock denial */
150#define AUDIT_LANDLOCK_DOMAIN 1424 /* Landlock domain status */
149151
150152#define AUDIT_FIRST_KERN_ANOM_MSG 1700
151153#define AUDIT_LAST_KERN_ANOM_MSG 1799
......@@ -161,6 +163,7 @@
161163#define AUDIT_INTEGRITY_RULE 1805 /* policy rule */
162164#define AUDIT_INTEGRITY_EVM_XATTR 1806 /* New EVM-covered xattr */
163165#define AUDIT_INTEGRITY_POLICY_RULE 1807 /* IMA policy rules */
166#define AUDIT_INTEGRITY_USERSPACE 1808 /* Userspace enforced data integrity */
164167
165168#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
166169
lib/libc/include/any-linux-any/linux/batman_adv.h+9-9
......@@ -342,7 +342,7 @@ enum batadv_nl_attrs {
342342 BATADV_ATTR_MCAST_FLAGS_PRIV,
343343
344344 /**
345 * @BATADV_ATTR_VLANID: VLAN id on top of soft interface
345 * @BATADV_ATTR_VLANID: VLAN id on top of mesh interface
346346 */
347347 BATADV_ATTR_VLANID,
348348
......@@ -380,7 +380,7 @@ enum batadv_nl_attrs {
380380 /**
381381 * @BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED: whether the bridge loop
382382 * avoidance feature is enabled. This feature detects and avoids loops
383 * between the mesh and devices bridged with the soft interface
383 * between the mesh and devices bridged with the mesh interface
384384 */
385385 BATADV_ATTR_BRIDGE_LOOP_AVOIDANCE_ENABLED,
386386
......@@ -509,7 +509,7 @@ enum batadv_nl_commands {
509509 BATADV_CMD_UNSPEC,
510510
511511 /**
512 * @BATADV_CMD_GET_MESH: Get attributes from softif/mesh
512 * @BATADV_CMD_GET_MESH: Get attributes from mesh(if)
513513 */
514514 BATADV_CMD_GET_MESH,
515515
......@@ -535,7 +535,7 @@ enum batadv_nl_commands {
535535
536536 /**
537537 * @BATADV_CMD_GET_HARDIF: Get attributes from a hardif of the
538 * current softif
538 * current mesh(if)
539539 */
540540 BATADV_CMD_GET_HARDIF,
541541
......@@ -591,25 +591,25 @@ enum batadv_nl_commands {
591591 BATADV_CMD_GET_MCAST_FLAGS,
592592
593593 /**
594 * @BATADV_CMD_SET_MESH: Set attributes for softif/mesh
594 * @BATADV_CMD_SET_MESH: Set attributes for mesh(if)
595595 */
596596 BATADV_CMD_SET_MESH,
597597
598598 /**
599599 * @BATADV_CMD_SET_HARDIF: Set attributes for hardif of the
600 * current softif
600 * current mesh(if)
601601 */
602602 BATADV_CMD_SET_HARDIF,
603603
604604 /**
605605 * @BATADV_CMD_GET_VLAN: Get attributes from a VLAN of the
606 * current softif
606 * current mesh(if)
607607 */
608608 BATADV_CMD_GET_VLAN,
609609
610610 /**
611611 * @BATADV_CMD_SET_VLAN: Set attributes for VLAN of the
612 * current softif
612 * current mesh(if)
613613 */
614614 BATADV_CMD_SET_VLAN,
615615
......@@ -691,7 +691,7 @@ enum batadv_ifla_attrs {
691691 */
692692 IFLA_BATADV_ALGO_NAME,
693693
694 /* add attributes above here, update the policy in soft-interface.c */
694 /* add attributes above here, update the policy in mesh-interface.c */
695695
696696 /**
697697 * @__IFLA_BATADV_MAX: internal use
lib/libc/include/any-linux-any/linux/bits.h+2-6
......@@ -4,13 +4,9 @@
44#ifndef _LINUX_BITS_H
55#define _LINUX_BITS_H
66
7#define __GENMASK(h, l) \
8 (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
9 (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
7#define __GENMASK(h, l) (((~_UL(0)) << (l)) & (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
108
11#define __GENMASK_ULL(h, l) \
12 (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
13 (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
9#define __GENMASK_ULL(h, l) (((~_ULL(0)) << (l)) & (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
1410
1511#define __GENMASK_U128(h, l) \
1612 ((_BIT128((h)) << 1) - (_BIT128(l)))
lib/libc/include/any-linux-any/linux/blk-crypto.h created+44
......@@ -0,0 +1,44 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _LINUX_BLK_CRYPTO_H
3#define _LINUX_BLK_CRYPTO_H
4
5#include <linux/ioctl.h>
6#include <linux/types.h>
7
8struct blk_crypto_import_key_arg {
9 /* Raw key (input) */
10 __u64 raw_key_ptr;
11 __u64 raw_key_size;
12 /* Long-term wrapped key blob (output) */
13 __u64 lt_key_ptr;
14 __u64 lt_key_size;
15 __u64 reserved[4];
16};
17
18struct blk_crypto_generate_key_arg {
19 /* Long-term wrapped key blob (output) */
20 __u64 lt_key_ptr;
21 __u64 lt_key_size;
22 __u64 reserved[4];
23};
24
25struct blk_crypto_prepare_key_arg {
26 /* Long-term wrapped key blob (input) */
27 __u64 lt_key_ptr;
28 __u64 lt_key_size;
29 /* Ephemerally-wrapped key blob (output) */
30 __u64 eph_key_ptr;
31 __u64 eph_key_size;
32 __u64 reserved[4];
33};
34
35/*
36 * These ioctls share the block device ioctl space; see uapi/linux/fs.h.
37 * 140-141 are reserved for future blk-crypto ioctls; any more than that would
38 * require an additional allocation from the block device ioctl space.
39 */
40#define BLKCRYPTOIMPORTKEY _IOWR(0x12, 137, struct blk_crypto_import_key_arg)
41#define BLKCRYPTOGENERATEKEY _IOWR(0x12, 138, struct blk_crypto_generate_key_arg)
42#define BLKCRYPTOPREPAREKEY _IOWR(0x12, 139, struct blk_crypto_prepare_key_arg)
43
44#endif /* _LINUX_BLK_CRYPTO_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/blktrace_api.h+1-1
......@@ -49,7 +49,7 @@ enum blktrace_act {
4949 __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */
5050 __BLK_TA_INSERT, /* insert request */
5151 __BLK_TA_SPLIT, /* bio was split */
52 __BLK_TA_BOUNCE, /* bio was bounced */
52 __BLK_TA_BOUNCE, /* unused, was: bio was bounced */
5353 __BLK_TA_REMAP, /* bio was remapped */
5454 __BLK_TA_ABORT, /* request aborted */
5555 __BLK_TA_DRV_DATA, /* driver-specific binary data */
lib/libc/include/any-linux-any/linux/bpf.h+110-9
......@@ -51,6 +51,9 @@
5151#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
5252#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
5353
54#define BPF_LOAD_ACQ 0x100 /* load-acquire */
55#define BPF_STORE_REL 0x110 /* store-release */
56
5457enum bpf_cond_pseudo_jmp {
5558 BPF_MAY_GOTO = 0,
5659};
......@@ -447,6 +450,7 @@ union bpf_iter_link_info {
447450 * * **struct bpf_map_info**
448451 * * **struct bpf_btf_info**
449452 * * **struct bpf_link_info**
453 * * **struct bpf_token_info**
450454 *
451455 * Return
452456 * Returns zero on success. On error, -1 is returned and *errno*
......@@ -903,6 +907,17 @@ union bpf_iter_link_info {
903907 * A new file descriptor (a nonnegative integer), or -1 if an
904908 * error occurred (in which case, *errno* is set appropriately).
905909 *
910 * BPF_PROG_STREAM_READ_BY_FD
911 * Description
912 * Read data of a program's BPF stream. The program is identified
913 * by *prog_fd*, and the stream is identified by the *stream_id*.
914 * The data is copied to a buffer pointed to by *stream_buf*, and
915 * filled less than or equal to *stream_buf_len* bytes.
916 *
917 * Return
918 * Number of bytes read from the stream on success, or -1 if an
919 * error occurred (in which case, *errno* is set appropriately).
920 *
906921 * NOTES
907922 * eBPF objects (maps and programs) can be shared between processes.
908923 *
......@@ -958,6 +973,7 @@ enum bpf_cmd {
958973 BPF_LINK_DETACH,
959974 BPF_PROG_BIND_MAP,
960975 BPF_TOKEN_CREATE,
976 BPF_PROG_STREAM_READ_BY_FD,
961977 __MAX_BPF_CMD,
962978};
963979
......@@ -1207,6 +1223,7 @@ enum bpf_perf_event_type {
12071223#define BPF_F_BEFORE (1U << 3)
12081224#define BPF_F_AFTER (1U << 4)
12091225#define BPF_F_ID (1U << 5)
1226#define BPF_F_PREORDER (1U << 6)
12101227#define BPF_F_LINK BPF_F_LINK /* 1 << 13 */
12111228
12121229/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
......@@ -1459,6 +1476,11 @@ struct bpf_stack_build_id {
14591476
14601477#define BPF_OBJ_NAME_LEN 16U
14611478
1479enum {
1480 BPF_STREAM_STDOUT = 1,
1481 BPF_STREAM_STDERR = 2,
1482};
1483
14621484union bpf_attr {
14631485 struct { /* anonymous struct used by BPF_MAP_CREATE command */
14641486 __u32 map_type; /* one of enum bpf_map_type */
......@@ -1502,7 +1524,7 @@ union bpf_attr {
15021524 __s32 map_token_fd;
15031525 };
15041526
1505 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
1527 struct { /* anonymous struct used by BPF_MAP_*_ELEM and BPF_MAP_FREEZE commands */
15061528 __u32 map_fd;
15071529 __aligned_u64 key;
15081530 union {
......@@ -1573,6 +1595,16 @@ union bpf_attr {
15731595 * If provided, prog_flags should have BPF_F_TOKEN_FD flag set.
15741596 */
15751597 __s32 prog_token_fd;
1598 /* The fd_array_cnt can be used to pass the length of the
1599 * fd_array array. In this case all the [map] file descriptors
1600 * passed in this array will be bound to the program, even if
1601 * the maps are not referenced directly. The functionality is
1602 * similar to the BPF_PROG_BIND_MAP syscall, but maps can be
1603 * used by the verifier during the program load. If provided,
1604 * then the fd_array[0,...,fd_array_cnt-1] is expected to be
1605 * continuous.
1606 */
1607 __u32 fd_array_cnt;
15761608 };
15771609
15781610 struct { /* anonymous struct used by BPF_OBJ_* commands */
......@@ -1638,6 +1670,7 @@ union bpf_attr {
16381670 };
16391671 __u32 next_id;
16401672 __u32 open_flags;
1673 __s32 fd_by_id_token_fd;
16411674 };
16421675
16431676 struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
......@@ -1779,6 +1812,13 @@ union bpf_attr {
17791812 };
17801813 __u64 expected_revision;
17811814 } netkit;
1815 struct {
1816 union {
1817 __u32 relative_fd;
1818 __u32 relative_id;
1819 };
1820 __u64 expected_revision;
1821 } cgroup;
17821822 };
17831823 } link_create;
17841824
......@@ -1827,6 +1867,13 @@ union bpf_attr {
18271867 __u32 bpffs_fd;
18281868 } token_create;
18291869
1870 struct {
1871 __aligned_u64 stream_buf;
1872 __u32 stream_buf_len;
1873 __u32 stream_id;
1874 __u32 prog_fd;
1875 } prog_stream_read;
1876
18301877} __attribute__((aligned(8)));
18311878
18321879/* The description below is an attempt at providing documentation to eBPF
......@@ -1980,11 +2027,15 @@ union bpf_attr {
19802027 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
19812028 * Description
19822029 * Store *len* bytes from address *from* into the packet
1983 * associated to *skb*, at *offset*. *flags* are a combination of
1984 * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the
1985 * checksum for the packet after storing the bytes) and
1986 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
1987 * **->swhash** and *skb*\ **->l4hash** to 0).
2030 * associated to *skb*, at *offset*. The *flags* are a combination
2031 * of the following values:
2032 *
2033 * **BPF_F_RECOMPUTE_CSUM**
2034 * Automatically update *skb*\ **->csum** after storing the
2035 * bytes.
2036 * **BPF_F_INVALIDATE_HASH**
2037 * Set *skb*\ **->hash**, *skb*\ **->swhash** and *skb*\
2038 * **->l4hash** to 0.
19882039 *
19892040 * A call to this helper is susceptible to change the underlying
19902041 * packet buffer. Therefore, at load time, all checks on pointers
......@@ -2036,7 +2087,8 @@ union bpf_attr {
20362087 * untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and
20372088 * for updates resulting in a null checksum the value is set to
20382089 * **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates
2039 * the checksum is to be computed against a pseudo-header.
2090 * that the modified header field is part of the pseudo-header.
2091 * Flag **BPF_F_IPV6** should be set for IPv6 packets.
20402092 *
20412093 * This helper works in combination with **bpf_csum_diff**\ (),
20422094 * which does not update the checksum in-place, but offers more
......@@ -2383,7 +2435,7 @@ union bpf_attr {
23832435 * into it. An example is available in file
23842436 * *samples/bpf/trace_output_user.c* in the Linux kernel source
23852437 * tree (the eBPF program counterpart is in
2386 * *samples/bpf/trace_output_kern.c*).
2438 * *samples/bpf/trace_output.bpf.c*).
23872439 *
23882440 * **bpf_perf_event_output**\ () achieves better performance
23892441 * than **bpf_trace_printk**\ () for sharing data with user
......@@ -4953,6 +5005,9 @@ union bpf_attr {
49535005 * the netns switch takes place from ingress to ingress without
49545006 * going through the CPU's backlog queue.
49555007 *
5008 * *skb*\ **->mark** and *skb*\ **->tstamp** are not cleared during
5009 * the netns switch.
5010 *
49565011 * The *flags* argument is reserved and must be 0. The helper is
49575012 * currently only supported for tc BPF program types at the
49585013 * ingress hook and for veth and netkit target device types. The
......@@ -6009,7 +6064,10 @@ union bpf_attr {
60096064 FN(user_ringbuf_drain, 209, ##ctx) \
60106065 FN(cgrp_storage_get, 210, ##ctx) \
60116066 FN(cgrp_storage_delete, 211, ##ctx) \
6012 /* */
6067 /* This helper list is effectively frozen. If you are trying to \
6068 * add a new helper, you should add a kfunc instead which has \
6069 * less stability guarantees. See Documentation/bpf/kfuncs.rst \
6070 */
60136071
60146072/* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
60156073 * know or care about integer value that is now passed as second argument
......@@ -6047,6 +6105,7 @@ enum {
60476105 BPF_F_PSEUDO_HDR = (1ULL << 4),
60486106 BPF_F_MARK_MANGLED_0 = (1ULL << 5),
60496107 BPF_F_MARK_ENFORCE = (1ULL << 6),
6108 BPF_F_IPV6 = (1ULL << 7),
60506109};
60516110
60526111/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
......@@ -6626,11 +6685,15 @@ struct bpf_link_info {
66266685 struct {
66276686 __aligned_u64 tp_name; /* in/out: tp_name buffer ptr */
66286687 __u32 tp_name_len; /* in/out: tp_name buffer len */
6688 __u32 :32;
6689 __u64 cookie;
66296690 } raw_tracepoint;
66306691 struct {
66316692 __u32 attach_type;
66326693 __u32 target_obj_id; /* prog_id for PROG_EXT, otherwise btf object id */
66336694 __u32 target_btf_id; /* BTF type id inside the object */
6695 __u32 :32;
6696 __u64 cookie;
66346697 } tracing;
66356698 struct {
66366699 __u64 cgroup_id;
......@@ -6702,6 +6765,7 @@ struct bpf_link_info {
67026765 __u32 name_len;
67036766 __u32 offset; /* offset from file_name */
67046767 __u64 cookie;
6768 __u64 ref_ctr_offset;
67056769 } uprobe; /* BPF_PERF_EVENT_UPROBE, BPF_PERF_EVENT_URETPROBE */
67066770 struct {
67076771 __aligned_u64 func_name; /* in/out */
......@@ -6740,6 +6804,13 @@ struct bpf_link_info {
67406804 };
67416805} __attribute__((aligned(8)));
67426806
6807struct bpf_token_info {
6808 __u64 allowed_cmds;
6809 __u64 allowed_maps;
6810 __u64 allowed_progs;
6811 __u64 allowed_attachs;
6812} __attribute__((aligned(8)));
6813
67436814/* User bpf_sock_addr struct to access socket fields and sockaddr struct passed
67446815 * by user and intended to be used by socket (e.g. to bind to, depends on
67456816 * attach type).
......@@ -6903,6 +6974,12 @@ enum {
69036974 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
69046975};
69056976
6977enum {
6978 SK_BPF_CB_TX_TIMESTAMPING = 1<<0,
6979 SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
6980 SK_BPF_CB_TX_TIMESTAMPING
6981};
6982
69066983/* List of known BPF sock_ops operators.
69076984 * New entries can only be added at the end
69086985 */
......@@ -7015,6 +7092,29 @@ enum {
70157092 * by the kernel or the
70167093 * earlier bpf-progs.
70177094 */
7095 BPF_SOCK_OPS_TSTAMP_SCHED_CB, /* Called when skb is passing
7096 * through dev layer when
7097 * SK_BPF_CB_TX_TIMESTAMPING
7098 * feature is on.
7099 */
7100 BPF_SOCK_OPS_TSTAMP_SND_SW_CB, /* Called when skb is about to send
7101 * to the nic when SK_BPF_CB_TX_TIMESTAMPING
7102 * feature is on.
7103 */
7104 BPF_SOCK_OPS_TSTAMP_SND_HW_CB, /* Called in hardware phase when
7105 * SK_BPF_CB_TX_TIMESTAMPING feature
7106 * is on.
7107 */
7108 BPF_SOCK_OPS_TSTAMP_ACK_CB, /* Called when all the skbs in the
7109 * same sendmsg call are acked
7110 * when SK_BPF_CB_TX_TIMESTAMPING
7111 * feature is on.
7112 */
7113 BPF_SOCK_OPS_TSTAMP_SENDMSG_CB, /* Called when every sendmsg syscall
7114 * is triggered. It's used to correlate
7115 * sendmsg timestamp with corresponding
7116 * tskey.
7117 */
70187118};
70197119
70207120/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
......@@ -7081,6 +7181,7 @@ enum {
70817181 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70827182 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
70837183 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7184 SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
70847185};
70857186
70867187enum {
lib/libc/include/any-linux-any/linux/btf.h+2-1
......@@ -36,7 +36,8 @@ struct btf_type {
3636 * bits 24-28: kind (e.g. int, ptr, array...etc)
3737 * bits 29-30: unused
3838 * bit 31: kind_flag, currently used by
39 * struct, union, enum, fwd and enum64
39 * struct, union, enum, fwd, enum64,
40 * decl_tag and type_tag
4041 */
4142 __u32 info;
4243 /* "size" is used by INT, ENUM, STRUCT, UNION, DATASEC and ENUM64.
lib/libc/include/any-linux-any/linux/btrfs.h+16-3
......@@ -613,7 +613,12 @@ struct btrfs_ioctl_clone_range_args {
613613 */
614614#define BTRFS_DEFRAG_RANGE_COMPRESS 1
615615#define BTRFS_DEFRAG_RANGE_START_IO 2
616#define BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL 4
617/* Request no compression on the range (uncompress if necessary). */
618#define BTRFS_DEFRAG_RANGE_NOCOMPRESS 8
616619#define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS | \
620 BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL | \
621 BTRFS_DEFRAG_RANGE_NOCOMPRESS | \
617622 BTRFS_DEFRAG_RANGE_START_IO)
618623
619624struct btrfs_ioctl_defrag_range_args {
......@@ -638,10 +643,18 @@ struct btrfs_ioctl_defrag_range_args {
638643
639644 /*
640645 * which compression method to use if turning on compression
641 * for this defrag operation. If unspecified, zlib will
642 * be used
646 * for this defrag operation. If unspecified, zlib will be
647 * used. If compression level is also being specified, set the
648 * BTRFS_DEFRAG_RANGE_COMPRESS_LEVEL flag and fill the compress
649 * member structure instead of the compress_type field.
643650 */
644 __u32 compress_type;
651 union {
652 __u32 compress_type;
653 struct {
654 __u8 type;
655 __s8 level;
656 } compress;
657 };
645658
646659 /* spare for later */
647660 __u32 unused[4];
lib/libc/include/any-linux-any/linux/can.h+2-1
......@@ -182,7 +182,7 @@ struct canfd_frame {
182182/*
183183 * defined bits for canxl_frame.flags
184184 *
185 * The canxl_frame.flags element contains two bits CANXL_XLF and CANXL_SEC
185 * The canxl_frame.flags element contains three bits CANXL_[XLF|SEC|RRS]
186186 * and shares the relative position of the struct can[fd]_frame.len element.
187187 * The CANXL_XLF bit ALWAYS needs to be set to indicate a valid CAN XL frame.
188188 * As a side effect setting this bit intentionally breaks the length checks
......@@ -192,6 +192,7 @@ struct canfd_frame {
192192 */
193193#define CANXL_XLF 0x80 /* mandatory CAN XL frame flag (must always be set!) */
194194#define CANXL_SEC 0x01 /* Simple Extended Content (security/segmentation) */
195#define CANXL_RRS 0x02 /* Remote Request Substitution */
195196
196197/* the 8-bit VCID is optionally placed in the canxl_frame.prio element */
197198#define CANXL_VCID_OFFSET 16 /* bit offset of VCID in prio element */
lib/libc/include/any-linux-any/linux/capability.h+4-2
......@@ -6,9 +6,10 @@
66 * Alexander Kjeldaas <astor@guardian.no>
77 * with help from Aleph1, Roland Buresund and Andrew Main.
88 *
9 * See here for the libcap library ("POSIX draft" compliance):
9 * See here for the libcap2 library (compliant with Section 25 of
10 * the withdrawn POSIX 1003.1e Draft 17):
1011 *
11 * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
12 * https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
1213 */
1314
1415#ifndef _LINUX_CAPABILITY_H
......@@ -273,6 +274,7 @@ struct vfs_ns_cap_data {
273274/* Allow setting encryption key on loopback filesystem */
274275/* Allow setting zone reclaim policy */
275276/* Allow everything under CAP_BPF and CAP_PERFMON for backward compatibility */
277/* Allow setting hardware protection emergency action */
276278
277279#define CAP_SYS_ADMIN 21
278280
lib/libc/include/any-linux-any/linux/cec-funcs.h+20-20
......@@ -14,7 +14,7 @@
1414static __inline__ void cec_msg_active_source(struct cec_msg *msg, __u16 phys_addr)
1515{
1616 msg->len = 4;
17 msg->msg[0] |= 0xf; /* broadcast */
17 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
1818 msg->msg[1] = CEC_MSG_ACTIVE_SOURCE;
1919 msg->msg[2] = phys_addr >> 8;
2020 msg->msg[3] = phys_addr & 0xff;
......@@ -59,7 +59,7 @@ static __inline__ void cec_msg_request_active_source(struct cec_msg *msg,
5959 int reply)
6060{
6161 msg->len = 2;
62 msg->msg[0] |= 0xf; /* broadcast */
62 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
6363 msg->msg[1] = CEC_MSG_REQUEST_ACTIVE_SOURCE;
6464 msg->reply = reply ? CEC_MSG_ACTIVE_SOURCE : 0;
6565}
......@@ -68,7 +68,7 @@ static __inline__ void cec_msg_routing_information(struct cec_msg *msg,
6868 __u16 phys_addr)
6969{
7070 msg->len = 4;
71 msg->msg[0] |= 0xf; /* broadcast */
71 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
7272 msg->msg[1] = CEC_MSG_ROUTING_INFORMATION;
7373 msg->msg[2] = phys_addr >> 8;
7474 msg->msg[3] = phys_addr & 0xff;
......@@ -86,7 +86,7 @@ static __inline__ void cec_msg_routing_change(struct cec_msg *msg,
8686 __u16 new_phys_addr)
8787{
8888 msg->len = 6;
89 msg->msg[0] |= 0xf; /* broadcast */
89 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
9090 msg->msg[1] = CEC_MSG_ROUTING_CHANGE;
9191 msg->msg[2] = orig_phys_addr >> 8;
9292 msg->msg[3] = orig_phys_addr & 0xff;
......@@ -106,7 +106,7 @@ static __inline__ void cec_ops_routing_change(const struct cec_msg *msg,
106106static __inline__ void cec_msg_set_stream_path(struct cec_msg *msg, __u16 phys_addr)
107107{
108108 msg->len = 4;
109 msg->msg[0] |= 0xf; /* broadcast */
109 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
110110 msg->msg[1] = CEC_MSG_SET_STREAM_PATH;
111111 msg->msg[2] = phys_addr >> 8;
112112 msg->msg[3] = phys_addr & 0xff;
......@@ -791,7 +791,7 @@ static __inline__ void cec_msg_report_physical_addr(struct cec_msg *msg,
791791 __u16 phys_addr, __u8 prim_devtype)
792792{
793793 msg->len = 5;
794 msg->msg[0] |= 0xf; /* broadcast */
794 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
795795 msg->msg[1] = CEC_MSG_REPORT_PHYSICAL_ADDR;
796796 msg->msg[2] = phys_addr >> 8;
797797 msg->msg[3] = phys_addr & 0xff;
......@@ -817,7 +817,7 @@ static __inline__ void cec_msg_set_menu_language(struct cec_msg *msg,
817817 const char *language)
818818{
819819 msg->len = 5;
820 msg->msg[0] |= 0xf; /* broadcast */
820 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
821821 msg->msg[1] = CEC_MSG_SET_MENU_LANGUAGE;
822822 memcpy(msg->msg + 2, language, 3);
823823}
......@@ -850,7 +850,7 @@ static __inline__ void cec_msg_report_features(struct cec_msg *msg,
850850 __u8 rc_profile, __u8 dev_features)
851851{
852852 msg->len = 6;
853 msg->msg[0] |= 0xf; /* broadcast */
853 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
854854 msg->msg[1] = CEC_MSG_REPORT_FEATURES;
855855 msg->msg[2] = cec_version;
856856 msg->msg[3] = all_device_types;
......@@ -1092,7 +1092,7 @@ static __inline__ void cec_msg_tuner_step_increment(struct cec_msg *msg)
10921092static __inline__ void cec_msg_device_vendor_id(struct cec_msg *msg, __u32 vendor_id)
10931093{
10941094 msg->len = 5;
1095 msg->msg[0] |= 0xf; /* broadcast */
1095 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
10961096 msg->msg[1] = CEC_MSG_DEVICE_VENDOR_ID;
10971097 msg->msg[2] = vendor_id >> 16;
10981098 msg->msg[3] = (vendor_id >> 8) & 0xff;
......@@ -1655,7 +1655,7 @@ static __inline__ void cec_msg_report_current_latency(struct cec_msg *msg,
16551655 __u8 audio_out_delay)
16561656{
16571657 msg->len = 6;
1658 msg->msg[0] |= 0xf; /* broadcast */
1658 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
16591659 msg->msg[1] = CEC_MSG_REPORT_CURRENT_LATENCY;
16601660 msg->msg[2] = phys_addr >> 8;
16611661 msg->msg[3] = phys_addr & 0xff;
......@@ -1687,7 +1687,7 @@ static __inline__ void cec_msg_request_current_latency(struct cec_msg *msg,
16871687 __u16 phys_addr)
16881688{
16891689 msg->len = 4;
1690 msg->msg[0] |= 0xf; /* broadcast */
1690 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
16911691 msg->msg[1] = CEC_MSG_REQUEST_CURRENT_LATENCY;
16921692 msg->msg[2] = phys_addr >> 8;
16931693 msg->msg[3] = phys_addr & 0xff;
......@@ -1707,7 +1707,7 @@ static __inline__ void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg,
17071707 __u16 phys_addr2)
17081708{
17091709 msg->len = 9;
1710 msg->msg[0] |= 0xf; /* broadcast */
1710 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
17111711 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
17121712 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
17131713 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE;
......@@ -1737,7 +1737,7 @@ static __inline__ void cec_msg_cdc_hec_report_state(struct cec_msg *msg,
17371737 __u16 hec_field)
17381738{
17391739 msg->len = has_field ? 10 : 8;
1740 msg->msg[0] |= 0xf; /* broadcast */
1740 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
17411741 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
17421742 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
17431743 msg->msg[4] = CEC_MSG_CDC_HEC_REPORT_STATE;
......@@ -1782,7 +1782,7 @@ static __inline__ void cec_msg_cdc_hec_set_state(struct cec_msg *msg,
17821782 __u16 phys_addr5)
17831783{
17841784 msg->len = 10;
1785 msg->msg[0] |= 0xf; /* broadcast */
1785 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
17861786 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
17871787 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
17881788 msg->msg[4] = CEC_MSG_CDC_HEC_INQUIRE_STATE;
......@@ -1832,7 +1832,7 @@ static __inline__ void cec_msg_cdc_hec_set_state_adjacent(struct cec_msg *msg,
18321832 __u8 hec_set_state)
18331833{
18341834 msg->len = 8;
1835 msg->msg[0] |= 0xf; /* broadcast */
1835 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
18361836 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
18371837 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
18381838 msg->msg[4] = CEC_MSG_CDC_HEC_SET_STATE_ADJACENT;
......@@ -1857,7 +1857,7 @@ static __inline__ void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg,
18571857 __u16 phys_addr3)
18581858{
18591859 msg->len = 11;
1860 msg->msg[0] |= 0xf; /* broadcast */
1860 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
18611861 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
18621862 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
18631863 msg->msg[4] = CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION;
......@@ -1884,7 +1884,7 @@ static __inline__ void cec_ops_cdc_hec_request_deactivation(const struct cec_msg
18841884static __inline__ void cec_msg_cdc_hec_notify_alive(struct cec_msg *msg)
18851885{
18861886 msg->len = 5;
1887 msg->msg[0] |= 0xf; /* broadcast */
1887 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
18881888 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
18891889 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
18901890 msg->msg[4] = CEC_MSG_CDC_HEC_NOTIFY_ALIVE;
......@@ -1899,7 +1899,7 @@ static __inline__ void cec_ops_cdc_hec_notify_alive(const struct cec_msg *msg,
18991899static __inline__ void cec_msg_cdc_hec_discover(struct cec_msg *msg)
19001900{
19011901 msg->len = 5;
1902 msg->msg[0] |= 0xf; /* broadcast */
1902 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
19031903 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
19041904 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
19051905 msg->msg[4] = CEC_MSG_CDC_HEC_DISCOVER;
......@@ -1916,7 +1916,7 @@ static __inline__ void cec_msg_cdc_hpd_set_state(struct cec_msg *msg,
19161916 __u8 hpd_state)
19171917{
19181918 msg->len = 6;
1919 msg->msg[0] |= 0xf; /* broadcast */
1919 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
19201920 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
19211921 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
19221922 msg->msg[4] = CEC_MSG_CDC_HPD_SET_STATE;
......@@ -1938,7 +1938,7 @@ static __inline__ void cec_msg_cdc_hpd_report_state(struct cec_msg *msg,
19381938 __u8 hpd_error)
19391939{
19401940 msg->len = 6;
1941 msg->msg[0] |= 0xf; /* broadcast */
1941 msg->msg[0] |= CEC_LOG_ADDR_BROADCAST;
19421942 msg->msg[1] = CEC_MSG_CDC_MESSAGE;
19431943 /* msg[2] and msg[3] (phys_addr) are filled in by the CEC framework */
19441944 msg->msg[4] = CEC_MSG_CDC_HPD_REPORT_STATE;
lib/libc/include/any-linux-any/linux/const.h+1-1
......@@ -33,7 +33,7 @@
3333 * Missing __asm__ support
3434 *
3535 * __BIT128() would not work in the __asm__ code, as it shifts an
36 * 'unsigned __init128' data type as direct representation of
36 * 'unsigned __int128' data type as direct representation of
3737 * 128 bit constants is not supported in the gcc compiler, as
3838 * they get silently truncated.
3939 *
lib/libc/include/any-linux-any/linux/coredump.h created+104
......@@ -0,0 +1,104 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _LINUX_COREDUMP_H
4#define _LINUX_COREDUMP_H
5
6#include <linux/types.h>
7
8/**
9 * coredump_{req,ack} flags
10 * @COREDUMP_KERNEL: kernel writes coredump
11 * @COREDUMP_USERSPACE: userspace writes coredump
12 * @COREDUMP_REJECT: don't generate coredump
13 * @COREDUMP_WAIT: wait for coredump server
14 */
15enum {
16 COREDUMP_KERNEL = (1ULL << 0),
17 COREDUMP_USERSPACE = (1ULL << 1),
18 COREDUMP_REJECT = (1ULL << 2),
19 COREDUMP_WAIT = (1ULL << 3),
20};
21
22/**
23 * struct coredump_req - message kernel sends to userspace
24 * @size: size of struct coredump_req
25 * @size_ack: known size of struct coredump_ack on this kernel
26 * @mask: supported features
27 *
28 * When a coredump happens the kernel will connect to the coredump
29 * socket and send a coredump request to the coredump server. The @size
30 * member is set to the size of struct coredump_req and provides a hint
31 * to userspace how much data can be read. Userspace may use MSG_PEEK to
32 * peek the size of struct coredump_req and then choose to consume it in
33 * one go. Userspace may also simply read a COREDUMP_ACK_SIZE_VER0
34 * request. If the size the kernel sends is larger userspace simply
35 * discards any remaining data.
36 *
37 * The coredump_req->mask member is set to the currently know features.
38 * Userspace may only set coredump_ack->mask to the bits raised by the
39 * kernel in coredump_req->mask.
40 *
41 * The coredump_req->size_ack member is set by the kernel to the size of
42 * struct coredump_ack the kernel knows. Userspace may only send up to
43 * coredump_req->size_ack bytes to the kernel and must set
44 * coredump_ack->size accordingly.
45 */
46struct coredump_req {
47 __u32 size;
48 __u32 size_ack;
49 __u64 mask;
50};
51
52enum {
53 COREDUMP_REQ_SIZE_VER0 = 16U, /* size of first published struct */
54};
55
56/**
57 * struct coredump_ack - message userspace sends to kernel
58 * @size: size of the struct
59 * @spare: unused
60 * @mask: features kernel is supposed to use
61 *
62 * The @size member must be set to the size of struct coredump_ack. It
63 * may never exceed what the kernel returned in coredump_req->size_ack
64 * but it may of course be smaller (>= COREDUMP_ACK_SIZE_VER0 and <=
65 * coredump_req->size_ack).
66 *
67 * The @mask member must be set to the features the coredump server
68 * wants the kernel to use. Only bits the kernel returned in
69 * coredump_req->mask may be set.
70 */
71struct coredump_ack {
72 __u32 size;
73 __u32 spare;
74 __u64 mask;
75};
76
77enum {
78 COREDUMP_ACK_SIZE_VER0 = 16U, /* size of first published struct */
79};
80
81/**
82 * enum coredump_mark - Markers for the coredump socket
83 *
84 * The kernel will place a single byte on the coredump socket. The
85 * markers notify userspace whether the coredump ack succeeded or
86 * failed.
87 *
88 * @COREDUMP_MARK_MINSIZE: the provided coredump_ack size was too small
89 * @COREDUMP_MARK_MAXSIZE: the provided coredump_ack size was too big
90 * @COREDUMP_MARK_UNSUPPORTED: the provided coredump_ack mask was invalid
91 * @COREDUMP_MARK_CONFLICTING: the provided coredump_ack mask has conflicting options
92 * @COREDUMP_MARK_REQACK: the coredump request and ack was successful
93 * @__COREDUMP_MARK_MAX: the maximum coredump mark value
94 */
95enum coredump_mark {
96 COREDUMP_MARK_REQACK = 0U,
97 COREDUMP_MARK_MINSIZE = 1U,
98 COREDUMP_MARK_MAXSIZE = 2U,
99 COREDUMP_MARK_UNSUPPORTED = 3U,
100 COREDUMP_MARK_CONFLICTING = 4U,
101 __COREDUMP_MARK_MAX = (1U << 31),
102};
103
104#endif /* _LINUX_COREDUMP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/counter.h+2
......@@ -65,6 +65,8 @@ enum counter_event_type {
6565 COUNTER_EVENT_CHANGE_OF_STATE,
6666 /* Count value captured */
6767 COUNTER_EVENT_CAPTURE,
68 /* Direction change detected */
69 COUNTER_EVENT_DIRECTION_CHANGE,
6870};
6971
7072/**
lib/libc/include/any-linux-any/linux/counter/microchip-tcb-capture.h created+40
......@@ -0,0 +1,40 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Channel numbers used by the microchip-tcb-capture driver
4 * Copyright (C) 2025 Bence Csókás
5 */
6#ifndef _COUNTER_MCHP_TCB_H_
7#define _COUNTER_MCHP_TCB_H_
8
9/*
10 * The driver defines the following components:
11 *
12 * Count 0
13 * \__ Synapse 0 -- Signal 0 (Channel A, i.e. TIOA)
14 * \__ Synapse 1 -- Signal 1 (Channel B, i.e. TIOB)
15 * \__ Extension capture0 (RA register)
16 * \__ Extension capture1 (RB register)
17 *
18 * It also supports the following events:
19 *
20 * Channel 0:
21 * - CV register changed
22 * - CV overflowed
23 * - RA captured
24 * Channel 1:
25 * - RB captured
26 * Channel 2:
27 * - RC compare triggered
28 */
29
30/* Capture extensions */
31#define COUNTER_MCHP_EXCAP_RA 0
32#define COUNTER_MCHP_EXCAP_RB 1
33
34/* Event channels */
35#define COUNTER_MCHP_EVCHN_CV 0
36#define COUNTER_MCHP_EVCHN_RA 0
37#define COUNTER_MCHP_EVCHN_RB 1
38#define COUNTER_MCHP_EVCHN_RC 2
39
40#endif /* _COUNTER_MCHP_TCB_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/devlink.h+31
......@@ -221,6 +221,11 @@ enum devlink_port_flavour {
221221 */
222222};
223223
224/* IEEE 802.1Qaz standard supported values. */
225
226#define DEVLINK_RATE_TCS_MAX 8
227#define DEVLINK_RATE_TC_INDEX_MAX (DEVLINK_RATE_TCS_MAX - 1)
228
224229enum devlink_rate_type {
225230 DEVLINK_RATE_TYPE_LEAF,
226231 DEVLINK_RATE_TYPE_NODE,
......@@ -385,6 +390,21 @@ enum devlink_linecard_state {
385390 DEVLINK_LINECARD_STATE_MAX = __DEVLINK_LINECARD_STATE_MAX - 1
386391};
387392
393/* Variable attribute type. */
394enum devlink_var_attr_type {
395 /* Following values relate to the internal NLA_* values */
396 DEVLINK_VAR_ATTR_TYPE_U8 = 1,
397 DEVLINK_VAR_ATTR_TYPE_U16,
398 DEVLINK_VAR_ATTR_TYPE_U32,
399 DEVLINK_VAR_ATTR_TYPE_U64,
400 DEVLINK_VAR_ATTR_TYPE_STRING,
401 DEVLINK_VAR_ATTR_TYPE_FLAG,
402 DEVLINK_VAR_ATTR_TYPE_NUL_STRING = 10,
403 DEVLINK_VAR_ATTR_TYPE_BINARY,
404 __DEVLINK_VAR_ATTR_TYPE_CUSTOM_BASE = 0x80,
405 /* Any possible custom types, unrelated to NLA_* values go below */
406};
407
388408enum devlink_attr {
389409 /* don't change the order or add anything between, this is ABI! */
390410 DEVLINK_ATTR_UNSPEC,
......@@ -614,6 +634,8 @@ enum devlink_attr {
614634
615635 DEVLINK_ATTR_REGION_DIRECT, /* flag */
616636
637 DEVLINK_ATTR_RATE_TC_BWS, /* nested */
638
617639 /* Add new attributes above here, update the spec in
618640 * Documentation/netlink/specs/devlink.yaml and re-generate
619641 * net/devlink/netlink_gen.c.
......@@ -623,6 +645,15 @@ enum devlink_attr {
623645 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
624646};
625647
648enum devlink_rate_tc_attr {
649 DEVLINK_RATE_TC_ATTR_UNSPEC,
650 DEVLINK_RATE_TC_ATTR_INDEX, /* u8 */
651 DEVLINK_RATE_TC_ATTR_BW, /* u32 */
652
653 __DEVLINK_RATE_TC_ATTR_MAX,
654 DEVLINK_RATE_TC_ATTR_MAX = __DEVLINK_RATE_TC_ATTR_MAX - 1
655};
656
626657/* Mapping between internal resource described by the field and system
627658 * structure
628659 */
lib/libc/include/any-linux-any/linux/dm-ioctl.h+7-2
......@@ -258,10 +258,12 @@ enum {
258258 DM_DEV_SET_GEOMETRY_CMD,
259259 DM_DEV_ARM_POLL_CMD,
260260 DM_GET_TARGET_VERSION_CMD,
261 DM_MPATH_PROBE_PATHS_CMD,
261262};
262263
263264#define DM_IOCTL 0xfd
264265
266/* Control device ioctls */
265267#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
266268#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
267269#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
......@@ -285,10 +287,13 @@ enum {
285287#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
286288#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
287289
290/* Block device ioctls */
291#define DM_MPATH_PROBE_PATHS _IO(DM_IOCTL, DM_MPATH_PROBE_PATHS_CMD)
292
288293#define DM_VERSION_MAJOR 4
289#define DM_VERSION_MINOR 48
294#define DM_VERSION_MINOR 50
290295#define DM_VERSION_PATCHLEVEL 0
291#define DM_VERSION_EXTRA "-ioctl (2023-03-01)"
296#define DM_VERSION_EXTRA "-ioctl (2025-04-28)"
292297
293298/* Status bits */
294299#define DM_READONLY_FLAG (1 << 0) /* In/Out */
lib/libc/include/any-linux-any/linux/dpll.h+13
......@@ -192,6 +192,17 @@ enum dpll_pin_capabilities {
192192
193193#define DPLL_PHASE_OFFSET_DIVIDER 1000
194194
195/**
196 * enum dpll_feature_state - Allow control (enable/disable) and status checking
197 * over features.
198 * @DPLL_FEATURE_STATE_DISABLE: feature shall be disabled
199 * @DPLL_FEATURE_STATE_ENABLE: feature shall be enabled
200 */
201enum dpll_feature_state {
202 DPLL_FEATURE_STATE_DISABLE,
203 DPLL_FEATURE_STATE_ENABLE,
204};
205
195206enum dpll_a {
196207 DPLL_A_ID = 1,
197208 DPLL_A_MODULE_NAME,
......@@ -204,6 +215,7 @@ enum dpll_a {
204215 DPLL_A_TYPE,
205216 DPLL_A_LOCK_STATUS_ERROR,
206217 DPLL_A_CLOCK_QUALITY_LEVEL,
218 DPLL_A_PHASE_OFFSET_MONITOR,
207219
208220 __DPLL_A_MAX,
209221 DPLL_A_MAX = (__DPLL_A_MAX - 1)
......@@ -237,6 +249,7 @@ enum dpll_a_pin {
237249 DPLL_A_PIN_ESYNC_FREQUENCY,
238250 DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED,
239251 DPLL_A_PIN_ESYNC_PULSE,
252 DPLL_A_PIN_REFERENCE_SYNC,
240253
241254 __DPLL_A_PIN_MAX,
242255 DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
lib/libc/include/any-linux-any/linux/elf.h+132-5
......@@ -11,6 +11,7 @@ typedef __u16 Elf32_Half;
1111typedef __u32 Elf32_Off;
1212typedef __s32 Elf32_Sword;
1313typedef __u32 Elf32_Word;
14typedef __u16 Elf32_Versym;
1415
1516/* 64-bit ELF base types. */
1617typedef __u64 Elf64_Addr;
......@@ -21,6 +22,7 @@ typedef __s32 Elf64_Sword;
2122typedef __u32 Elf64_Word;
2223typedef __u64 Elf64_Xword;
2324typedef __s64 Elf64_Sxword;
25typedef __u16 Elf64_Versym;
2426
2527/* These constants are for the segment types stored in the image headers */
2628#define PT_NULL 0
......@@ -107,6 +109,7 @@ typedef __s64 Elf64_Sxword;
107109#define DT_VALRNGLO 0x6ffffd00
108110#define DT_VALRNGHI 0x6ffffdff
109111#define DT_ADDRRNGLO 0x6ffffe00
112#define DT_GNU_HASH 0x6ffffef5
110113#define DT_ADDRRNGHI 0x6ffffeff
111114#define DT_VERSYM 0x6ffffff0
112115#define DT_RELACOUNT 0x6ffffff9
......@@ -125,6 +128,8 @@ typedef __s64 Elf64_Sxword;
125128#define STB_GLOBAL 1
126129#define STB_WEAK 2
127130
131#define STN_UNDEF 0
132
128133#define STT_NOTYPE 0
129134#define STT_OBJECT 1
130135#define STT_FUNC 2
......@@ -133,6 +138,9 @@ typedef __s64 Elf64_Sxword;
133138#define STT_COMMON 5
134139#define STT_TLS 6
135140
141#define VER_FLG_BASE 0x1
142#define VER_FLG_WEAK 0x2
143
136144#define ELF_ST_BIND(x) ((x) >> 4)
137145#define ELF_ST_TYPE(x) ((x) & 0xf)
138146#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
......@@ -291,8 +299,18 @@ typedef struct elf64_phdr {
291299#define SHF_WRITE 0x1
292300#define SHF_ALLOC 0x2
293301#define SHF_EXECINSTR 0x4
302#define SHF_MERGE 0x10
303#define SHF_STRINGS 0x20
304#define SHF_INFO_LINK 0x40
305#define SHF_LINK_ORDER 0x80
306#define SHF_OS_NONCONFORMING 0x100
307#define SHF_GROUP 0x200
308#define SHF_TLS 0x400
294309#define SHF_RELA_LIVEPATCH 0x00100000
295310#define SHF_RO_AFTER_INIT 0x00200000
311#define SHF_ORDERED 0x04000000
312#define SHF_EXCLUDE 0x08000000
313#define SHF_MASKOS 0x0ff00000
296314#define SHF_MASKPROC 0xf0000000
297315
298316/* special section indexes */
......@@ -368,101 +386,180 @@ typedef struct elf64_shdr {
368386#define ELF_OSABI ELFOSABI_NONE
369387#endif
370388
389/* Note definitions: NN_ defines names. NT_ defines types. */
390
391#define NN_GNU_PROPERTY_TYPE_0 "GNU"
392#define NT_GNU_PROPERTY_TYPE_0 5
393
371394/*
372395 * Notes used in ET_CORE. Architectures export some of the arch register sets
373396 * using the corresponding note types via the PTRACE_GETREGSET and
374397 * PTRACE_SETREGSET requests.
375 * The note name for these types is "LINUX", except NT_PRFPREG that is named
376 * "CORE".
377398 */
399#define NN_PRSTATUS "CORE"
378400#define NT_PRSTATUS 1
401#define NN_PRFPREG "CORE"
379402#define NT_PRFPREG 2
403#define NN_PRPSINFO "CORE"
380404#define NT_PRPSINFO 3
405#define NN_TASKSTRUCT "CORE"
381406#define NT_TASKSTRUCT 4
407#define NN_AUXV "CORE"
382408#define NT_AUXV 6
383409/*
384410 * Note to userspace developers: size of NT_SIGINFO note may increase
385411 * in the future to accomodate more fields, don't assume it is fixed!
386412 */
413#define NN_SIGINFO "CORE"
387414#define NT_SIGINFO 0x53494749
415#define NN_FILE "CORE"
388416#define NT_FILE 0x46494c45
417#define NN_PRXFPREG "LINUX"
389418#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
419#define NN_PPC_VMX "LINUX"
390420#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
421#define NN_PPC_SPE "LINUX"
391422#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
423#define NN_PPC_VSX "LINUX"
392424#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
425#define NN_PPC_TAR "LINUX"
393426#define NT_PPC_TAR 0x103 /* Target Address Register */
427#define NN_PPC_PPR "LINUX"
394428#define NT_PPC_PPR 0x104 /* Program Priority Register */
429#define NN_PPC_DSCR "LINUX"
395430#define NT_PPC_DSCR 0x105 /* Data Stream Control Register */
431#define NN_PPC_EBB "LINUX"
396432#define NT_PPC_EBB 0x106 /* Event Based Branch Registers */
433#define NN_PPC_PMU "LINUX"
397434#define NT_PPC_PMU 0x107 /* Performance Monitor Registers */
435#define NN_PPC_TM_CGPR "LINUX"
398436#define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */
437#define NN_PPC_TM_CFPR "LINUX"
399438#define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */
439#define NN_PPC_TM_CVMX "LINUX"
400440#define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
441#define NN_PPC_TM_CVSX "LINUX"
401442#define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
443#define NN_PPC_TM_SPR "LINUX"
402444#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
445#define NN_PPC_TM_CTAR "LINUX"
403446#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */
447#define NN_PPC_TM_CPPR "LINUX"
404448#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */
449#define NN_PPC_TM_CDSCR "LINUX"
405450#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */
451#define NN_PPC_PKEY "LINUX"
406452#define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */
453#define NN_PPC_DEXCR "LINUX"
407454#define NT_PPC_DEXCR 0x111 /* PowerPC DEXCR registers */
455#define NN_PPC_HASHKEYR "LINUX"
408456#define NT_PPC_HASHKEYR 0x112 /* PowerPC HASHKEYR register */
457#define NN_386_TLS "LINUX"
409458#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
459#define NN_386_IOPERM "LINUX"
410460#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
461#define NN_X86_XSTATE "LINUX"
411462#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
412463/* Old binutils treats 0x203 as a CET state */
464#define NN_X86_SHSTK "LINUX"
413465#define NT_X86_SHSTK 0x204 /* x86 SHSTK state */
466#define NN_X86_XSAVE_LAYOUT "LINUX"
414467#define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description */
468#define NN_S390_HIGH_GPRS "LINUX"
415469#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
470#define NN_S390_TIMER "LINUX"
416471#define NT_S390_TIMER 0x301 /* s390 timer register */
472#define NN_S390_TODCMP "LINUX"
417473#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
474#define NN_S390_TODPREG "LINUX"
418475#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
476#define NN_S390_CTRS "LINUX"
419477#define NT_S390_CTRS 0x304 /* s390 control registers */
478#define NN_S390_PREFIX "LINUX"
420479#define NT_S390_PREFIX 0x305 /* s390 prefix register */
480#define NN_S390_LAST_BREAK "LINUX"
421481#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
482#define NN_S390_SYSTEM_CALL "LINUX"
422483#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
484#define NN_S390_TDB "LINUX"
423485#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
486#define NN_S390_VXRS_LOW "LINUX"
424487#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half */
488#define NN_S390_VXRS_HIGH "LINUX"
425489#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */
490#define NN_S390_GS_CB "LINUX"
426491#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
492#define NN_S390_GS_BC "LINUX"
427493#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */
494#define NN_S390_RI_CB "LINUX"
428495#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */
496#define NN_S390_PV_CPU_DATA "LINUX"
429497#define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data */
498#define NN_ARM_VFP "LINUX"
430499#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
500#define NN_ARM_TLS "LINUX"
431501#define NT_ARM_TLS 0x401 /* ARM TLS register */
502#define NN_ARM_HW_BREAK "LINUX"
432503#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
504#define NN_ARM_HW_WATCH "LINUX"
433505#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
506#define NN_ARM_SYSTEM_CALL "LINUX"
434507#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
508#define NN_ARM_SVE "LINUX"
435509#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
510#define NN_ARM_PAC_MASK "LINUX"
436511#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */
512#define NN_ARM_PACA_KEYS "LINUX"
437513#define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication address keys */
514#define NN_ARM_PACG_KEYS "LINUX"
438515#define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */
516#define NN_ARM_TAGGED_ADDR_CTRL "LINUX"
439517#define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */
518#define NN_ARM_PAC_ENABLED_KEYS "LINUX"
440519#define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */
520#define NN_ARM_SSVE "LINUX"
441521#define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers */
522#define NN_ARM_ZA "LINUX"
442523#define NT_ARM_ZA 0x40c /* ARM SME ZA registers */
524#define NN_ARM_ZT "LINUX"
443525#define NT_ARM_ZT 0x40d /* ARM SME ZT registers */
526#define NN_ARM_FPMR "LINUX"
444527#define NT_ARM_FPMR 0x40e /* ARM floating point mode register */
528#define NN_ARM_POE "LINUX"
445529#define NT_ARM_POE 0x40f /* ARM POE registers */
530#define NN_ARM_GCS "LINUX"
446531#define NT_ARM_GCS 0x410 /* ARM GCS state */
532#define NN_ARC_V2 "LINUX"
447533#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
534#define NN_VMCOREDD "LINUX"
448535#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
536#define NN_MIPS_DSP "LINUX"
449537#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
538#define NN_MIPS_FP_MODE "LINUX"
450539#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
540#define NN_MIPS_MSA "LINUX"
451541#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
542#define NN_RISCV_CSR "LINUX"
452543#define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */
544#define NN_RISCV_VECTOR "LINUX"
453545#define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */
546#define NN_RISCV_TAGGED_ADDR_CTRL "LINUX"
454547#define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control (prctl()) */
548#define NN_LOONGARCH_CPUCFG "LINUX"
455549#define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */
550#define NN_LOONGARCH_CSR "LINUX"
456551#define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */
552#define NN_LOONGARCH_LSX "LINUX"
457553#define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */
554#define NN_LOONGARCH_LASX "LINUX"
458555#define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced SIMD Extension registers */
556#define NN_LOONGARCH_LBT "LINUX"
459557#define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary Translation registers */
558#define NN_LOONGARCH_HW_BREAK "LINUX"
460559#define NT_LOONGARCH_HW_BREAK 0xa05 /* LoongArch hardware breakpoint registers */
560#define NN_LOONGARCH_HW_WATCH "LINUX"
461561#define NT_LOONGARCH_HW_WATCH 0xa06 /* LoongArch hardware watchpoint registers */
462562
463/* Note types with note name "GNU" */
464#define NT_GNU_PROPERTY_TYPE_0 5
465
466563/* Note header in a PT_NOTE section */
467564typedef struct elf32_note {
468565 Elf32_Word n_namesz; /* Name size */
......@@ -483,4 +580,34 @@ typedef struct elf64_note {
483580/* Bits for GNU_PROPERTY_AARCH64_FEATURE_1_BTI */
484581#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
485582
583typedef struct {
584 Elf32_Half vd_version;
585 Elf32_Half vd_flags;
586 Elf32_Half vd_ndx;
587 Elf32_Half vd_cnt;
588 Elf32_Word vd_hash;
589 Elf32_Word vd_aux;
590 Elf32_Word vd_next;
591} Elf32_Verdef;
592
593typedef struct {
594 Elf64_Half vd_version;
595 Elf64_Half vd_flags;
596 Elf64_Half vd_ndx;
597 Elf64_Half vd_cnt;
598 Elf64_Word vd_hash;
599 Elf64_Word vd_aux;
600 Elf64_Word vd_next;
601} Elf64_Verdef;
602
603typedef struct {
604 Elf32_Word vda_name;
605 Elf32_Word vda_next;
606} Elf32_Verdaux;
607
608typedef struct {
609 Elf64_Word vda_name;
610 Elf64_Word vda_next;
611} Elf64_Verdaux;
612
486613#endif /* _LINUX_ELF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/errqueue.h+1
......@@ -69,6 +69,7 @@ enum {
6969 SCM_TSTAMP_SND, /* driver passed skb to NIC, or HW */
7070 SCM_TSTAMP_SCHED, /* data entered the packet scheduler */
7171 SCM_TSTAMP_ACK, /* data acknowledged by peer */
72 SCM_TSTAMP_COMPLETION, /* packet tx completion */
7273};
7374
7475#endif /* _LINUX_ERRQUEUE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ethtool.h+96-66
......@@ -679,6 +679,8 @@ enum ethtool_link_ext_substate_module {
679679 * @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics
680680 * @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics
681681 * @ETH_SS_STATS_RMON: names of RMON statistics
682 * @ETH_SS_STATS_PHY: names of PHY(dev) statistics
683 * @ETH_SS_TS_FLAGS: hardware timestamping flags
682684 *
683685 * @ETH_SS_COUNT: number of defined string sets
684686 */
......@@ -704,6 +706,8 @@ enum ethtool_stringset {
704706 ETH_SS_STATS_ETH_MAC,
705707 ETH_SS_STATS_ETH_CTRL,
706708 ETH_SS_STATS_RMON,
709 ETH_SS_STATS_PHY,
710 ETH_SS_TS_FLAGS,
707711
708712 /* add new constants above here */
709713 ETH_SS_COUNT
......@@ -2053,6 +2057,24 @@ enum ethtool_link_mode_bit_indices {
20532057 ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100,
20542058 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101,
20552059 ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102,
2060 ETHTOOL_LINK_MODE_200000baseCR_Full_BIT = 103,
2061 ETHTOOL_LINK_MODE_200000baseKR_Full_BIT = 104,
2062 ETHTOOL_LINK_MODE_200000baseDR_Full_BIT = 105,
2063 ETHTOOL_LINK_MODE_200000baseDR_2_Full_BIT = 106,
2064 ETHTOOL_LINK_MODE_200000baseSR_Full_BIT = 107,
2065 ETHTOOL_LINK_MODE_200000baseVR_Full_BIT = 108,
2066 ETHTOOL_LINK_MODE_400000baseCR2_Full_BIT = 109,
2067 ETHTOOL_LINK_MODE_400000baseKR2_Full_BIT = 110,
2068 ETHTOOL_LINK_MODE_400000baseDR2_Full_BIT = 111,
2069 ETHTOOL_LINK_MODE_400000baseDR2_2_Full_BIT = 112,
2070 ETHTOOL_LINK_MODE_400000baseSR2_Full_BIT = 113,
2071 ETHTOOL_LINK_MODE_400000baseVR2_Full_BIT = 114,
2072 ETHTOOL_LINK_MODE_800000baseCR4_Full_BIT = 115,
2073 ETHTOOL_LINK_MODE_800000baseKR4_Full_BIT = 116,
2074 ETHTOOL_LINK_MODE_800000baseDR4_Full_BIT = 117,
2075 ETHTOOL_LINK_MODE_800000baseDR4_2_Full_BIT = 118,
2076 ETHTOOL_LINK_MODE_800000baseSR4_Full_BIT = 119,
2077 ETHTOOL_LINK_MODE_800000baseVR4_Full_BIT = 120,
20562078
20572079 /* must be last entry */
20582080 __ETHTOOL_LINK_MODE_MASK_NBITS
......@@ -2265,73 +2287,81 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
22652287 * be exploited to reduce the RSS queue spread.
22662288 */
22672289#define RXH_XFRM_SYM_XOR (1 << 0)
2290/* Similar to SYM_XOR, except that one copy of the XOR'ed fields is replaced by
2291 * an OR of the same fields
2292 */
2293#define RXH_XFRM_SYM_OR_XOR (1 << 1)
22682294#define RXH_XFRM_NO_CHANGE 0xff
22692295
2270/* L2-L4 network traffic flow types */
2271#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
2272#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
2273#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
2274#define AH_ESP_V4_FLOW 0x04 /* hash only */
2275#define TCP_V6_FLOW 0x05 /* hash or spec (tcp_ip6_spec; nfc only) */
2276#define UDP_V6_FLOW 0x06 /* hash or spec (udp_ip6_spec; nfc only) */
2277#define SCTP_V6_FLOW 0x07 /* hash or spec (sctp_ip6_spec; nfc only) */
2278#define AH_ESP_V6_FLOW 0x08 /* hash only */
2279#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
2280#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
2281#define AH_V6_FLOW 0x0b /* hash or spec (ah_ip6_spec; nfc only) */
2282#define ESP_V6_FLOW 0x0c /* hash or spec (esp_ip6_spec; nfc only) */
2283#define IPV4_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
2284#define IP_USER_FLOW IPV4_USER_FLOW
2285#define IPV6_USER_FLOW 0x0e /* spec only (usr_ip6_spec; nfc only) */
2286#define IPV4_FLOW 0x10 /* hash only */
2287#define IPV6_FLOW 0x11 /* hash only */
2288#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
2289
2290/* Used for GTP-U IPv4 and IPv6.
2291 * The format of GTP packets only includes
2292 * elements such as TEID and GTP version.
2293 * It is primarily intended for data communication of the UE.
2294 */
2295#define GTPU_V4_FLOW 0x13 /* hash only */
2296#define GTPU_V6_FLOW 0x14 /* hash only */
2297
2298/* Use for GTP-C IPv4 and v6.
2299 * The format of these GTP packets does not include TEID.
2300 * Primarily expected to be used for communication
2301 * to create sessions for UE data communication,
2302 * commonly referred to as CSR (Create Session Request).
2303 */
2304#define GTPC_V4_FLOW 0x15 /* hash only */
2305#define GTPC_V6_FLOW 0x16 /* hash only */
2306
2307/* Use for GTP-C IPv4 and v6.
2308 * Unlike GTPC_V4_FLOW, the format of these GTP packets includes TEID.
2309 * After session creation, it becomes this packet.
2310 * This is mainly used for requests to realize UE handover.
2311 */
2312#define GTPC_TEID_V4_FLOW 0x17 /* hash only */
2313#define GTPC_TEID_V6_FLOW 0x18 /* hash only */
2314
2315/* Use for GTP-U and extended headers for the PSC (PDU Session Container).
2316 * The format of these GTP packets includes TEID and QFI.
2317 * In 5G communication using UPF (User Plane Function),
2318 * data communication with this extended header is performed.
2319 */
2320#define GTPU_EH_V4_FLOW 0x19 /* hash only */
2321#define GTPU_EH_V6_FLOW 0x1a /* hash only */
2322
2323/* Use for GTP-U IPv4 and v6 PSC (PDU Session Container) extended headers.
2324 * This differs from GTPU_EH_V(4|6)_FLOW in that it is distinguished by
2325 * UL/DL included in the PSC.
2326 * There are differences in the data included based on Downlink/Uplink,
2327 * and can be used to distinguish packets.
2328 * The functions described so far are useful when you want to
2329 * handle communication from the mobile network in UPF, PGW, etc.
2330 */
2331#define GTPU_UL_V4_FLOW 0x1b /* hash only */
2332#define GTPU_UL_V6_FLOW 0x1c /* hash only */
2333#define GTPU_DL_V4_FLOW 0x1d /* hash only */
2334#define GTPU_DL_V6_FLOW 0x1e /* hash only */
2296enum {
2297 /* L2-L4 network traffic flow types */
2298 TCP_V4_FLOW = 0x01, /* hash or spec (tcp_ip4_spec) */
2299 UDP_V4_FLOW = 0x02, /* hash or spec (udp_ip4_spec) */
2300 SCTP_V4_FLOW = 0x03, /* hash or spec (sctp_ip4_spec) */
2301 AH_ESP_V4_FLOW = 0x04, /* hash only */
2302 TCP_V6_FLOW = 0x05, /* hash or spec (tcp_ip6_spec; nfc only) */
2303 UDP_V6_FLOW = 0x06, /* hash or spec (udp_ip6_spec; nfc only) */
2304 SCTP_V6_FLOW = 0x07, /* hash or spec (sctp_ip6_spec; nfc only) */
2305 AH_ESP_V6_FLOW = 0x08, /* hash only */
2306 AH_V4_FLOW = 0x09, /* hash or spec (ah_ip4_spec) */
2307 ESP_V4_FLOW = 0x0a, /* hash or spec (esp_ip4_spec) */
2308 AH_V6_FLOW = 0x0b, /* hash or spec (ah_ip6_spec; nfc only) */
2309 ESP_V6_FLOW = 0x0c, /* hash or spec (esp_ip6_spec; nfc only) */
2310 IPV4_USER_FLOW = 0x0d, /* spec only (usr_ip4_spec) */
2311 IP_USER_FLOW = IPV4_USER_FLOW,
2312 IPV6_USER_FLOW = 0x0e, /* spec only (usr_ip6_spec; nfc only) */
2313 IPV4_FLOW = 0x10, /* hash only */
2314 IPV6_FLOW = 0x11, /* hash only */
2315 ETHER_FLOW = 0x12, /* hash or spec (ether_spec) */
2316
2317 /* Used for GTP-U IPv4 and IPv6.
2318 * The format of GTP packets only includes
2319 * elements such as TEID and GTP version.
2320 * It is primarily intended for data communication of the UE.
2321 */
2322 GTPU_V4_FLOW = 0x13, /* hash only */
2323 GTPU_V6_FLOW = 0x14, /* hash only */
2324
2325 /* Use for GTP-C IPv4 and v6.
2326 * The format of these GTP packets does not include TEID.
2327 * Primarily expected to be used for communication
2328 * to create sessions for UE data communication,
2329 * commonly referred to as CSR (Create Session Request).
2330 */
2331 GTPC_V4_FLOW = 0x15, /* hash only */
2332 GTPC_V6_FLOW = 0x16, /* hash only */
2333
2334 /* Use for GTP-C IPv4 and v6.
2335 * Unlike GTPC_V4_FLOW, the format of these GTP packets includes TEID.
2336 * After session creation, it becomes this packet.
2337 * This is mainly used for requests to realize UE handover.
2338 */
2339 GTPC_TEID_V4_FLOW = 0x17, /* hash only */
2340 GTPC_TEID_V6_FLOW = 0x18, /* hash only */
2341
2342 /* Use for GTP-U and extended headers for the PSC (PDU Session Container).
2343 * The format of these GTP packets includes TEID and QFI.
2344 * In 5G communication using UPF (User Plane Function),
2345 * data communication with this extended header is performed.
2346 */
2347 GTPU_EH_V4_FLOW = 0x19, /* hash only */
2348 GTPU_EH_V6_FLOW = 0x1a, /* hash only */
2349
2350 /* Use for GTP-U IPv4 and v6 PSC (PDU Session Container) extended headers.
2351 * This differs from GTPU_EH_V(4|6)_FLOW in that it is distinguished by
2352 * UL/DL included in the PSC.
2353 * There are differences in the data included based on Downlink/Uplink,
2354 * and can be used to distinguish packets.
2355 * The functions described so far are useful when you want to
2356 * handle communication from the mobile network in UPF, PGW, etc.
2357 */
2358 GTPU_UL_V4_FLOW = 0x1b, /* hash only */
2359 GTPU_UL_V6_FLOW = 0x1c, /* hash only */
2360 GTPU_DL_V4_FLOW = 0x1d, /* hash only */
2361 GTPU_DL_V6_FLOW = 0x1e, /* hash only */
2362
2363 __FLOW_TYPE_COUNT,
2364};
23352365
23362366/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
23372367#define FLOW_EXT 0x80000000
......@@ -2339,7 +2369,7 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
23392369/* Flag to enable RSS spreading of traffic matching rule (nfc only) */
23402370#define FLOW_RSS 0x20000000
23412371
2342/* L3-L4 network traffic flow hash options */
2372/* L2-L4 network traffic flow hash options */
23432373#define RXH_L2DA (1 << 1)
23442374#define RXH_VLAN (1 << 2)
23452375#define RXH_L3_PROTO (1 << 3)
lib/libc/include/any-linux-any/linux/ethtool_netlink.h+11-894
......@@ -10,545 +10,12 @@
1010#define _LINUX_ETHTOOL_NETLINK_H_
1111
1212#include <linux/ethtool.h>
13
14/* message types - userspace to kernel */
15enum {
16 ETHTOOL_MSG_USER_NONE,
17 ETHTOOL_MSG_STRSET_GET,
18 ETHTOOL_MSG_LINKINFO_GET,
19 ETHTOOL_MSG_LINKINFO_SET,
20 ETHTOOL_MSG_LINKMODES_GET,
21 ETHTOOL_MSG_LINKMODES_SET,
22 ETHTOOL_MSG_LINKSTATE_GET,
23 ETHTOOL_MSG_DEBUG_GET,
24 ETHTOOL_MSG_DEBUG_SET,
25 ETHTOOL_MSG_WOL_GET,
26 ETHTOOL_MSG_WOL_SET,
27 ETHTOOL_MSG_FEATURES_GET,
28 ETHTOOL_MSG_FEATURES_SET,
29 ETHTOOL_MSG_PRIVFLAGS_GET,
30 ETHTOOL_MSG_PRIVFLAGS_SET,
31 ETHTOOL_MSG_RINGS_GET,
32 ETHTOOL_MSG_RINGS_SET,
33 ETHTOOL_MSG_CHANNELS_GET,
34 ETHTOOL_MSG_CHANNELS_SET,
35 ETHTOOL_MSG_COALESCE_GET,
36 ETHTOOL_MSG_COALESCE_SET,
37 ETHTOOL_MSG_PAUSE_GET,
38 ETHTOOL_MSG_PAUSE_SET,
39 ETHTOOL_MSG_EEE_GET,
40 ETHTOOL_MSG_EEE_SET,
41 ETHTOOL_MSG_TSINFO_GET,
42 ETHTOOL_MSG_CABLE_TEST_ACT,
43 ETHTOOL_MSG_CABLE_TEST_TDR_ACT,
44 ETHTOOL_MSG_TUNNEL_INFO_GET,
45 ETHTOOL_MSG_FEC_GET,
46 ETHTOOL_MSG_FEC_SET,
47 ETHTOOL_MSG_MODULE_EEPROM_GET,
48 ETHTOOL_MSG_STATS_GET,
49 ETHTOOL_MSG_PHC_VCLOCKS_GET,
50 ETHTOOL_MSG_MODULE_GET,
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,
60 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,
61 ETHTOOL_MSG_PHY_GET,
62
63 /* add new constants above here */
64 __ETHTOOL_MSG_USER_CNT,
65 ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1
66};
67
68/* message types - kernel to userspace */
69enum {
70 ETHTOOL_MSG_KERNEL_NONE,
71 ETHTOOL_MSG_STRSET_GET_REPLY,
72 ETHTOOL_MSG_LINKINFO_GET_REPLY,
73 ETHTOOL_MSG_LINKINFO_NTF,
74 ETHTOOL_MSG_LINKMODES_GET_REPLY,
75 ETHTOOL_MSG_LINKMODES_NTF,
76 ETHTOOL_MSG_LINKSTATE_GET_REPLY,
77 ETHTOOL_MSG_DEBUG_GET_REPLY,
78 ETHTOOL_MSG_DEBUG_NTF,
79 ETHTOOL_MSG_WOL_GET_REPLY,
80 ETHTOOL_MSG_WOL_NTF,
81 ETHTOOL_MSG_FEATURES_GET_REPLY,
82 ETHTOOL_MSG_FEATURES_SET_REPLY,
83 ETHTOOL_MSG_FEATURES_NTF,
84 ETHTOOL_MSG_PRIVFLAGS_GET_REPLY,
85 ETHTOOL_MSG_PRIVFLAGS_NTF,
86 ETHTOOL_MSG_RINGS_GET_REPLY,
87 ETHTOOL_MSG_RINGS_NTF,
88 ETHTOOL_MSG_CHANNELS_GET_REPLY,
89 ETHTOOL_MSG_CHANNELS_NTF,
90 ETHTOOL_MSG_COALESCE_GET_REPLY,
91 ETHTOOL_MSG_COALESCE_NTF,
92 ETHTOOL_MSG_PAUSE_GET_REPLY,
93 ETHTOOL_MSG_PAUSE_NTF,
94 ETHTOOL_MSG_EEE_GET_REPLY,
95 ETHTOOL_MSG_EEE_NTF,
96 ETHTOOL_MSG_TSINFO_GET_REPLY,
97 ETHTOOL_MSG_CABLE_TEST_NTF,
98 ETHTOOL_MSG_CABLE_TEST_TDR_NTF,
99 ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY,
100 ETHTOOL_MSG_FEC_GET_REPLY,
101 ETHTOOL_MSG_FEC_NTF,
102 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
103 ETHTOOL_MSG_STATS_GET_REPLY,
104 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
105 ETHTOOL_MSG_MODULE_GET_REPLY,
106 ETHTOOL_MSG_MODULE_NTF,
107 ETHTOOL_MSG_PSE_GET_REPLY,
108 ETHTOOL_MSG_RSS_GET_REPLY,
109 ETHTOOL_MSG_PLCA_GET_CFG_REPLY,
110 ETHTOOL_MSG_PLCA_GET_STATUS_REPLY,
111 ETHTOOL_MSG_PLCA_NTF,
112 ETHTOOL_MSG_MM_GET_REPLY,
113 ETHTOOL_MSG_MM_NTF,
114 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,
115 ETHTOOL_MSG_PHY_GET_REPLY,
116 ETHTOOL_MSG_PHY_NTF,
117
118 /* add new constants above here */
119 __ETHTOOL_MSG_KERNEL_CNT,
120 ETHTOOL_MSG_KERNEL_MAX = __ETHTOOL_MSG_KERNEL_CNT - 1
121};
122
123/* request header */
124
125enum ethtool_header_flags {
126 ETHTOOL_FLAG_COMPACT_BITSETS = 1 << 0, /* use compact bitsets in reply */
127 ETHTOOL_FLAG_OMIT_REPLY = 1 << 1, /* provide optional reply for SET or ACT requests */
128 ETHTOOL_FLAG_STATS = 1 << 2, /* request statistics, if supported by the driver */
129};
13#include <linux/ethtool_netlink_generated.h>
13014
13115#define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
13216 ETHTOOL_FLAG_OMIT_REPLY | \
13317 ETHTOOL_FLAG_STATS)
13418
135enum {
136 ETHTOOL_A_HEADER_UNSPEC,
137 ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */
138 ETHTOOL_A_HEADER_DEV_NAME, /* string */
139 ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */
140 ETHTOOL_A_HEADER_PHY_INDEX, /* u32 */
141
142 /* add new constants above here */
143 __ETHTOOL_A_HEADER_CNT,
144 ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1
145};
146
147/* bit sets */
148
149enum {
150 ETHTOOL_A_BITSET_BIT_UNSPEC,
151 ETHTOOL_A_BITSET_BIT_INDEX, /* u32 */
152 ETHTOOL_A_BITSET_BIT_NAME, /* string */
153 ETHTOOL_A_BITSET_BIT_VALUE, /* flag */
154
155 /* add new constants above here */
156 __ETHTOOL_A_BITSET_BIT_CNT,
157 ETHTOOL_A_BITSET_BIT_MAX = __ETHTOOL_A_BITSET_BIT_CNT - 1
158};
159
160enum {
161 ETHTOOL_A_BITSET_BITS_UNSPEC,
162 ETHTOOL_A_BITSET_BITS_BIT, /* nest - _A_BITSET_BIT_* */
163
164 /* add new constants above here */
165 __ETHTOOL_A_BITSET_BITS_CNT,
166 ETHTOOL_A_BITSET_BITS_MAX = __ETHTOOL_A_BITSET_BITS_CNT - 1
167};
168
169enum {
170 ETHTOOL_A_BITSET_UNSPEC,
171 ETHTOOL_A_BITSET_NOMASK, /* flag */
172 ETHTOOL_A_BITSET_SIZE, /* u32 */
173 ETHTOOL_A_BITSET_BITS, /* nest - _A_BITSET_BITS_* */
174 ETHTOOL_A_BITSET_VALUE, /* binary */
175 ETHTOOL_A_BITSET_MASK, /* binary */
176
177 /* add new constants above here */
178 __ETHTOOL_A_BITSET_CNT,
179 ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
180};
181
182/* string sets */
183
184enum {
185 ETHTOOL_A_STRING_UNSPEC,
186 ETHTOOL_A_STRING_INDEX, /* u32 */
187 ETHTOOL_A_STRING_VALUE, /* string */
188
189 /* add new constants above here */
190 __ETHTOOL_A_STRING_CNT,
191 ETHTOOL_A_STRING_MAX = __ETHTOOL_A_STRING_CNT - 1
192};
193
194enum {
195 ETHTOOL_A_STRINGS_UNSPEC,
196 ETHTOOL_A_STRINGS_STRING, /* nest - _A_STRINGS_* */
197
198 /* add new constants above here */
199 __ETHTOOL_A_STRINGS_CNT,
200 ETHTOOL_A_STRINGS_MAX = __ETHTOOL_A_STRINGS_CNT - 1
201};
202
203enum {
204 ETHTOOL_A_STRINGSET_UNSPEC,
205 ETHTOOL_A_STRINGSET_ID, /* u32 */
206 ETHTOOL_A_STRINGSET_COUNT, /* u32 */
207 ETHTOOL_A_STRINGSET_STRINGS, /* nest - _A_STRINGS_* */
208
209 /* add new constants above here */
210 __ETHTOOL_A_STRINGSET_CNT,
211 ETHTOOL_A_STRINGSET_MAX = __ETHTOOL_A_STRINGSET_CNT - 1
212};
213
214enum {
215 ETHTOOL_A_STRINGSETS_UNSPEC,
216 ETHTOOL_A_STRINGSETS_STRINGSET, /* nest - _A_STRINGSET_* */
217
218 /* add new constants above here */
219 __ETHTOOL_A_STRINGSETS_CNT,
220 ETHTOOL_A_STRINGSETS_MAX = __ETHTOOL_A_STRINGSETS_CNT - 1
221};
222
223/* STRSET */
224
225enum {
226 ETHTOOL_A_STRSET_UNSPEC,
227 ETHTOOL_A_STRSET_HEADER, /* nest - _A_HEADER_* */
228 ETHTOOL_A_STRSET_STRINGSETS, /* nest - _A_STRINGSETS_* */
229 ETHTOOL_A_STRSET_COUNTS_ONLY, /* flag */
230
231 /* add new constants above here */
232 __ETHTOOL_A_STRSET_CNT,
233 ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
234};
235
236/* LINKINFO */
237
238enum {
239 ETHTOOL_A_LINKINFO_UNSPEC,
240 ETHTOOL_A_LINKINFO_HEADER, /* nest - _A_HEADER_* */
241 ETHTOOL_A_LINKINFO_PORT, /* u8 */
242 ETHTOOL_A_LINKINFO_PHYADDR, /* u8 */
243 ETHTOOL_A_LINKINFO_TP_MDIX, /* u8 */
244 ETHTOOL_A_LINKINFO_TP_MDIX_CTRL, /* u8 */
245 ETHTOOL_A_LINKINFO_TRANSCEIVER, /* u8 */
246
247 /* add new constants above here */
248 __ETHTOOL_A_LINKINFO_CNT,
249 ETHTOOL_A_LINKINFO_MAX = __ETHTOOL_A_LINKINFO_CNT - 1
250};
251
252/* LINKMODES */
253
254enum {
255 ETHTOOL_A_LINKMODES_UNSPEC,
256 ETHTOOL_A_LINKMODES_HEADER, /* nest - _A_HEADER_* */
257 ETHTOOL_A_LINKMODES_AUTONEG, /* u8 */
258 ETHTOOL_A_LINKMODES_OURS, /* bitset */
259 ETHTOOL_A_LINKMODES_PEER, /* bitset */
260 ETHTOOL_A_LINKMODES_SPEED, /* u32 */
261 ETHTOOL_A_LINKMODES_DUPLEX, /* u8 */
262 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG, /* u8 */
263 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE, /* u8 */
264 ETHTOOL_A_LINKMODES_LANES, /* u32 */
265 ETHTOOL_A_LINKMODES_RATE_MATCHING, /* u8 */
266
267 /* add new constants above here */
268 __ETHTOOL_A_LINKMODES_CNT,
269 ETHTOOL_A_LINKMODES_MAX = __ETHTOOL_A_LINKMODES_CNT - 1
270};
271
272/* LINKSTATE */
273
274enum {
275 ETHTOOL_A_LINKSTATE_UNSPEC,
276 ETHTOOL_A_LINKSTATE_HEADER, /* nest - _A_HEADER_* */
277 ETHTOOL_A_LINKSTATE_LINK, /* u8 */
278 ETHTOOL_A_LINKSTATE_SQI, /* u32 */
279 ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */
280 ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */
281 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */
282 ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT, /* u32 */
283
284 /* add new constants above here */
285 __ETHTOOL_A_LINKSTATE_CNT,
286 ETHTOOL_A_LINKSTATE_MAX = __ETHTOOL_A_LINKSTATE_CNT - 1
287};
288
289/* DEBUG */
290
291enum {
292 ETHTOOL_A_DEBUG_UNSPEC,
293 ETHTOOL_A_DEBUG_HEADER, /* nest - _A_HEADER_* */
294 ETHTOOL_A_DEBUG_MSGMASK, /* bitset */
295
296 /* add new constants above here */
297 __ETHTOOL_A_DEBUG_CNT,
298 ETHTOOL_A_DEBUG_MAX = __ETHTOOL_A_DEBUG_CNT - 1
299};
300
301/* WOL */
302
303enum {
304 ETHTOOL_A_WOL_UNSPEC,
305 ETHTOOL_A_WOL_HEADER, /* nest - _A_HEADER_* */
306 ETHTOOL_A_WOL_MODES, /* bitset */
307 ETHTOOL_A_WOL_SOPASS, /* binary */
308
309 /* add new constants above here */
310 __ETHTOOL_A_WOL_CNT,
311 ETHTOOL_A_WOL_MAX = __ETHTOOL_A_WOL_CNT - 1
312};
313
314/* FEATURES */
315
316enum {
317 ETHTOOL_A_FEATURES_UNSPEC,
318 ETHTOOL_A_FEATURES_HEADER, /* nest - _A_HEADER_* */
319 ETHTOOL_A_FEATURES_HW, /* bitset */
320 ETHTOOL_A_FEATURES_WANTED, /* bitset */
321 ETHTOOL_A_FEATURES_ACTIVE, /* bitset */
322 ETHTOOL_A_FEATURES_NOCHANGE, /* bitset */
323
324 /* add new constants above here */
325 __ETHTOOL_A_FEATURES_CNT,
326 ETHTOOL_A_FEATURES_MAX = __ETHTOOL_A_FEATURES_CNT - 1
327};
328
329/* PRIVFLAGS */
330
331enum {
332 ETHTOOL_A_PRIVFLAGS_UNSPEC,
333 ETHTOOL_A_PRIVFLAGS_HEADER, /* nest - _A_HEADER_* */
334 ETHTOOL_A_PRIVFLAGS_FLAGS, /* bitset */
335
336 /* add new constants above here */
337 __ETHTOOL_A_PRIVFLAGS_CNT,
338 ETHTOOL_A_PRIVFLAGS_MAX = __ETHTOOL_A_PRIVFLAGS_CNT - 1
339};
340
341/* RINGS */
342
343enum {
344 ETHTOOL_TCP_DATA_SPLIT_UNKNOWN = 0,
345 ETHTOOL_TCP_DATA_SPLIT_DISABLED,
346 ETHTOOL_TCP_DATA_SPLIT_ENABLED,
347};
348
349enum {
350 ETHTOOL_A_RINGS_UNSPEC,
351 ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
352 ETHTOOL_A_RINGS_RX_MAX, /* u32 */
353 ETHTOOL_A_RINGS_RX_MINI_MAX, /* u32 */
354 ETHTOOL_A_RINGS_RX_JUMBO_MAX, /* u32 */
355 ETHTOOL_A_RINGS_TX_MAX, /* u32 */
356 ETHTOOL_A_RINGS_RX, /* u32 */
357 ETHTOOL_A_RINGS_RX_MINI, /* u32 */
358 ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
359 ETHTOOL_A_RINGS_TX, /* u32 */
360 ETHTOOL_A_RINGS_RX_BUF_LEN, /* u32 */
361 ETHTOOL_A_RINGS_TCP_DATA_SPLIT, /* u8 */
362 ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */
363 ETHTOOL_A_RINGS_TX_PUSH, /* u8 */
364 ETHTOOL_A_RINGS_RX_PUSH, /* u8 */
365 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN, /* u32 */
366 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX, /* u32 */
367
368 /* add new constants above here */
369 __ETHTOOL_A_RINGS_CNT,
370 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
371};
372
373/* CHANNELS */
374
375enum {
376 ETHTOOL_A_CHANNELS_UNSPEC,
377 ETHTOOL_A_CHANNELS_HEADER, /* nest - _A_HEADER_* */
378 ETHTOOL_A_CHANNELS_RX_MAX, /* u32 */
379 ETHTOOL_A_CHANNELS_TX_MAX, /* u32 */
380 ETHTOOL_A_CHANNELS_OTHER_MAX, /* u32 */
381 ETHTOOL_A_CHANNELS_COMBINED_MAX, /* u32 */
382 ETHTOOL_A_CHANNELS_RX_COUNT, /* u32 */
383 ETHTOOL_A_CHANNELS_TX_COUNT, /* u32 */
384 ETHTOOL_A_CHANNELS_OTHER_COUNT, /* u32 */
385 ETHTOOL_A_CHANNELS_COMBINED_COUNT, /* u32 */
386
387 /* add new constants above here */
388 __ETHTOOL_A_CHANNELS_CNT,
389 ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
390};
391
392/* COALESCE */
393
394enum {
395 ETHTOOL_A_COALESCE_UNSPEC,
396 ETHTOOL_A_COALESCE_HEADER, /* nest - _A_HEADER_* */
397 ETHTOOL_A_COALESCE_RX_USECS, /* u32 */
398 ETHTOOL_A_COALESCE_RX_MAX_FRAMES, /* u32 */
399 ETHTOOL_A_COALESCE_RX_USECS_IRQ, /* u32 */
400 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ, /* u32 */
401 ETHTOOL_A_COALESCE_TX_USECS, /* u32 */
402 ETHTOOL_A_COALESCE_TX_MAX_FRAMES, /* u32 */
403 ETHTOOL_A_COALESCE_TX_USECS_IRQ, /* u32 */
404 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ, /* u32 */
405 ETHTOOL_A_COALESCE_STATS_BLOCK_USECS, /* u32 */
406 ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX, /* u8 */
407 ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX, /* u8 */
408 ETHTOOL_A_COALESCE_PKT_RATE_LOW, /* u32 */
409 ETHTOOL_A_COALESCE_RX_USECS_LOW, /* u32 */
410 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW, /* u32 */
411 ETHTOOL_A_COALESCE_TX_USECS_LOW, /* u32 */
412 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW, /* u32 */
413 ETHTOOL_A_COALESCE_PKT_RATE_HIGH, /* u32 */
414 ETHTOOL_A_COALESCE_RX_USECS_HIGH, /* u32 */
415 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH, /* u32 */
416 ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */
417 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */
418 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
419 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX, /* u8 */
420 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX, /* u8 */
421 ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES, /* u32 */
422 ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES, /* u32 */
423 ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS, /* u32 */
424 /* nest - _A_PROFILE_IRQ_MODERATION */
425 ETHTOOL_A_COALESCE_RX_PROFILE,
426 /* nest - _A_PROFILE_IRQ_MODERATION */
427 ETHTOOL_A_COALESCE_TX_PROFILE,
428
429 /* add new constants above here */
430 __ETHTOOL_A_COALESCE_CNT,
431 ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
432};
433
434enum {
435 ETHTOOL_A_PROFILE_UNSPEC,
436 /* nest, _A_IRQ_MODERATION_* */
437 ETHTOOL_A_PROFILE_IRQ_MODERATION,
438 __ETHTOOL_A_PROFILE_CNT,
439 ETHTOOL_A_PROFILE_MAX = (__ETHTOOL_A_PROFILE_CNT - 1)
440};
441
442enum {
443 ETHTOOL_A_IRQ_MODERATION_UNSPEC,
444 ETHTOOL_A_IRQ_MODERATION_USEC, /* u32 */
445 ETHTOOL_A_IRQ_MODERATION_PKTS, /* u32 */
446 ETHTOOL_A_IRQ_MODERATION_COMPS, /* u32 */
447
448 __ETHTOOL_A_IRQ_MODERATION_CNT,
449 ETHTOOL_A_IRQ_MODERATION_MAX = (__ETHTOOL_A_IRQ_MODERATION_CNT - 1)
450};
451
452/* PAUSE */
453
454enum {
455 ETHTOOL_A_PAUSE_UNSPEC,
456 ETHTOOL_A_PAUSE_HEADER, /* nest - _A_HEADER_* */
457 ETHTOOL_A_PAUSE_AUTONEG, /* u8 */
458 ETHTOOL_A_PAUSE_RX, /* u8 */
459 ETHTOOL_A_PAUSE_TX, /* u8 */
460 ETHTOOL_A_PAUSE_STATS, /* nest - _PAUSE_STAT_* */
461 ETHTOOL_A_PAUSE_STATS_SRC, /* u32 */
462
463 /* add new constants above here */
464 __ETHTOOL_A_PAUSE_CNT,
465 ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
466};
467
468enum {
469 ETHTOOL_A_PAUSE_STAT_UNSPEC,
470 ETHTOOL_A_PAUSE_STAT_PAD,
471
472 ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
473 ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
474
475 /* add new constants above here
476 * adjust ETHTOOL_PAUSE_STAT_CNT if adding non-stats!
477 */
478 __ETHTOOL_A_PAUSE_STAT_CNT,
479 ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
480};
481
482/* EEE */
483
484enum {
485 ETHTOOL_A_EEE_UNSPEC,
486 ETHTOOL_A_EEE_HEADER, /* nest - _A_HEADER_* */
487 ETHTOOL_A_EEE_MODES_OURS, /* bitset */
488 ETHTOOL_A_EEE_MODES_PEER, /* bitset */
489 ETHTOOL_A_EEE_ACTIVE, /* u8 */
490 ETHTOOL_A_EEE_ENABLED, /* u8 */
491 ETHTOOL_A_EEE_TX_LPI_ENABLED, /* u8 */
492 ETHTOOL_A_EEE_TX_LPI_TIMER, /* u32 */
493
494 /* add new constants above here */
495 __ETHTOOL_A_EEE_CNT,
496 ETHTOOL_A_EEE_MAX = (__ETHTOOL_A_EEE_CNT - 1)
497};
498
499/* TSINFO */
500
501enum {
502 ETHTOOL_A_TSINFO_UNSPEC,
503 ETHTOOL_A_TSINFO_HEADER, /* nest - _A_HEADER_* */
504 ETHTOOL_A_TSINFO_TIMESTAMPING, /* bitset */
505 ETHTOOL_A_TSINFO_TX_TYPES, /* bitset */
506 ETHTOOL_A_TSINFO_RX_FILTERS, /* bitset */
507 ETHTOOL_A_TSINFO_PHC_INDEX, /* u32 */
508 ETHTOOL_A_TSINFO_STATS, /* nest - _A_TSINFO_STAT */
509
510 /* add new constants above here */
511 __ETHTOOL_A_TSINFO_CNT,
512 ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
513};
514
515enum {
516 ETHTOOL_A_TS_STAT_UNSPEC,
517
518 ETHTOOL_A_TS_STAT_TX_PKTS, /* uint */
519 ETHTOOL_A_TS_STAT_TX_LOST, /* uint */
520 ETHTOOL_A_TS_STAT_TX_ERR, /* uint */
521
522 /* add new constants above here */
523 __ETHTOOL_A_TS_STAT_CNT,
524 ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1)
525
526};
527
528/* PHC VCLOCKS */
529
530enum {
531 ETHTOOL_A_PHC_VCLOCKS_UNSPEC,
532 ETHTOOL_A_PHC_VCLOCKS_HEADER, /* nest - _A_HEADER_* */
533 ETHTOOL_A_PHC_VCLOCKS_NUM, /* u32 */
534 ETHTOOL_A_PHC_VCLOCKS_INDEX, /* array, s32 */
535
536 /* add new constants above here */
537 __ETHTOOL_A_PHC_VCLOCKS_CNT,
538 ETHTOOL_A_PHC_VCLOCKS_MAX = (__ETHTOOL_A_PHC_VCLOCKS_CNT - 1)
539};
540
541/* CABLE TEST */
542
543enum {
544 ETHTOOL_A_CABLE_TEST_UNSPEC,
545 ETHTOOL_A_CABLE_TEST_HEADER, /* nest - _A_HEADER_* */
546
547 /* add new constants above here */
548 __ETHTOOL_A_CABLE_TEST_CNT,
549 ETHTOOL_A_CABLE_TEST_MAX = __ETHTOOL_A_CABLE_TEST_CNT - 1
550};
551
55219/* CABLE TEST NOTIFY */
55320enum {
55421 ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC,
......@@ -582,74 +49,12 @@ enum {
58249 ETHTOOL_A_CABLE_INF_SRC_ALCD,
58350};
58451
585enum {
586 ETHTOOL_A_CABLE_RESULT_UNSPEC,
587 ETHTOOL_A_CABLE_RESULT_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
588 ETHTOOL_A_CABLE_RESULT_CODE, /* u8 ETHTOOL_A_CABLE_RESULT_CODE_ */
589 ETHTOOL_A_CABLE_RESULT_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
590
591 __ETHTOOL_A_CABLE_RESULT_CNT,
592 ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
593};
594
595enum {
596 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
597 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR, /* u8 ETHTOOL_A_CABLE_PAIR_ */
598 ETHTOOL_A_CABLE_FAULT_LENGTH_CM, /* u32 */
599 ETHTOOL_A_CABLE_FAULT_LENGTH_SRC, /* u32 ETHTOOL_A_CABLE_INF_SRC_ */
600
601 __ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
602 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)
603};
604
60552enum {
60653 ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC,
60754 ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED,
60855 ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED
60956};
61057
611enum {
612 ETHTOOL_A_CABLE_NEST_UNSPEC,
613 ETHTOOL_A_CABLE_NEST_RESULT, /* nest - ETHTOOL_A_CABLE_RESULT_ */
614 ETHTOOL_A_CABLE_NEST_FAULT_LENGTH, /* nest - ETHTOOL_A_CABLE_FAULT_LENGTH_ */
615 __ETHTOOL_A_CABLE_NEST_CNT,
616 ETHTOOL_A_CABLE_NEST_MAX = (__ETHTOOL_A_CABLE_NEST_CNT - 1)
617};
618
619enum {
620 ETHTOOL_A_CABLE_TEST_NTF_UNSPEC,
621 ETHTOOL_A_CABLE_TEST_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
622 ETHTOOL_A_CABLE_TEST_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
623 ETHTOOL_A_CABLE_TEST_NTF_NEST, /* nest - of results: */
624
625 __ETHTOOL_A_CABLE_TEST_NTF_CNT,
626 ETHTOOL_A_CABLE_TEST_NTF_MAX = (__ETHTOOL_A_CABLE_TEST_NTF_CNT - 1)
627};
628
629/* CABLE TEST TDR */
630
631enum {
632 ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC,
633 ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST, /* u32 */
634 ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST, /* u32 */
635 ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP, /* u32 */
636 ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR, /* u8 */
637
638 /* add new constants above here */
639 __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT,
640 ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT - 1
641};
642
643enum {
644 ETHTOOL_A_CABLE_TEST_TDR_UNSPEC,
645 ETHTOOL_A_CABLE_TEST_TDR_HEADER, /* nest - _A_HEADER_* */
646 ETHTOOL_A_CABLE_TEST_TDR_CFG, /* nest - *_TDR_CFG_* */
647
648 /* add new constants above here */
649 __ETHTOOL_A_CABLE_TEST_TDR_CNT,
650 ETHTOOL_A_CABLE_TEST_TDR_MAX = __ETHTOOL_A_CABLE_TEST_TDR_CNT - 1
651};
652
65358/* CABLE TEST TDR NOTIFY */
65459
65560enum {
......@@ -689,163 +94,17 @@ enum {
68994 ETHTOOL_A_CABLE_TDR_NEST_MAX = (__ETHTOOL_A_CABLE_TDR_NEST_CNT - 1)
69095};
69196
692enum {
693 ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC,
694 ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER, /* nest - ETHTOOL_A_HEADER_* */
695 ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS, /* u8 - _STARTED/_COMPLETE */
696 ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST, /* nest - of results: */
697
698 /* add new constants above here */
699 __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT,
700 ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT - 1
701};
702
703/* TUNNEL INFO */
704
705enum {
706 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN,
707 ETHTOOL_UDP_TUNNEL_TYPE_GENEVE,
708 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE,
709
710 __ETHTOOL_UDP_TUNNEL_TYPE_CNT
711};
712
713enum {
714 ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC,
715
716 ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, /* be16 */
717 ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE, /* u32 */
718
719 /* add new constants above here */
720 __ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT,
721 ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = (__ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT - 1)
722};
723
724enum {
725 ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC,
726
727 ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE, /* u32 */
728 ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES, /* bitset */
729 ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY, /* nest - _UDP_ENTRY_* */
730
731 /* add new constants above here */
732 __ETHTOOL_A_TUNNEL_UDP_TABLE_CNT,
733 ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = (__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT - 1)
734};
735
736enum {
737 ETHTOOL_A_TUNNEL_UDP_UNSPEC,
738
739 ETHTOOL_A_TUNNEL_UDP_TABLE, /* nest - _UDP_TABLE_* */
740
741 /* add new constants above here */
742 __ETHTOOL_A_TUNNEL_UDP_CNT,
743 ETHTOOL_A_TUNNEL_UDP_MAX = (__ETHTOOL_A_TUNNEL_UDP_CNT - 1)
744};
745
746enum {
747 ETHTOOL_A_TUNNEL_INFO_UNSPEC,
748 ETHTOOL_A_TUNNEL_INFO_HEADER, /* nest - _A_HEADER_* */
749
750 ETHTOOL_A_TUNNEL_INFO_UDP_PORTS, /* nest - _UDP_TABLE */
751
752 /* add new constants above here */
753 __ETHTOOL_A_TUNNEL_INFO_CNT,
754 ETHTOOL_A_TUNNEL_INFO_MAX = (__ETHTOOL_A_TUNNEL_INFO_CNT - 1)
755};
756
757/* FEC */
758
759enum {
760 ETHTOOL_A_FEC_UNSPEC,
761 ETHTOOL_A_FEC_HEADER, /* nest - _A_HEADER_* */
762 ETHTOOL_A_FEC_MODES, /* bitset */
763 ETHTOOL_A_FEC_AUTO, /* u8 */
764 ETHTOOL_A_FEC_ACTIVE, /* u32 */
765 ETHTOOL_A_FEC_STATS, /* nest - _A_FEC_STAT */
766
767 __ETHTOOL_A_FEC_CNT,
768 ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)
769};
770
771enum {
772 ETHTOOL_A_FEC_STAT_UNSPEC,
773 ETHTOOL_A_FEC_STAT_PAD,
774
775 ETHTOOL_A_FEC_STAT_CORRECTED, /* array, u64 */
776 ETHTOOL_A_FEC_STAT_UNCORR, /* array, u64 */
777 ETHTOOL_A_FEC_STAT_CORR_BITS, /* array, u64 */
778
779 /* add new constants above here */
780 __ETHTOOL_A_FEC_STAT_CNT,
781 ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
782};
783
784/* MODULE EEPROM */
785
786enum {
787 ETHTOOL_A_MODULE_EEPROM_UNSPEC,
788 ETHTOOL_A_MODULE_EEPROM_HEADER, /* nest - _A_HEADER_* */
789
790 ETHTOOL_A_MODULE_EEPROM_OFFSET, /* u32 */
791 ETHTOOL_A_MODULE_EEPROM_LENGTH, /* u32 */
792 ETHTOOL_A_MODULE_EEPROM_PAGE, /* u8 */
793 ETHTOOL_A_MODULE_EEPROM_BANK, /* u8 */
794 ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS, /* u8 */
795 ETHTOOL_A_MODULE_EEPROM_DATA, /* binary */
796
797 __ETHTOOL_A_MODULE_EEPROM_CNT,
798 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
799};
800
801/* STATS */
802
803enum {
804 ETHTOOL_A_STATS_UNSPEC,
805 ETHTOOL_A_STATS_PAD,
806 ETHTOOL_A_STATS_HEADER, /* nest - _A_HEADER_* */
807 ETHTOOL_A_STATS_GROUPS, /* bitset */
808
809 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
810
811 ETHTOOL_A_STATS_SRC, /* u32 */
812
813 /* add new constants above here */
814 __ETHTOOL_A_STATS_CNT,
815 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
816};
817
81897enum {
81998 ETHTOOL_STATS_ETH_PHY,
82099 ETHTOOL_STATS_ETH_MAC,
821100 ETHTOOL_STATS_ETH_CTRL,
822101 ETHTOOL_STATS_RMON,
102 ETHTOOL_STATS_PHY,
823103
824104 /* add new constants above here */
825105 __ETHTOOL_STATS_CNT
826106};
827107
828enum {
829 ETHTOOL_A_STATS_GRP_UNSPEC,
830 ETHTOOL_A_STATS_GRP_PAD,
831
832 ETHTOOL_A_STATS_GRP_ID, /* u32 */
833 ETHTOOL_A_STATS_GRP_SS_ID, /* u32 */
834
835 ETHTOOL_A_STATS_GRP_STAT, /* nest */
836
837 ETHTOOL_A_STATS_GRP_HIST_RX, /* nest */
838 ETHTOOL_A_STATS_GRP_HIST_TX, /* nest */
839
840 ETHTOOL_A_STATS_GRP_HIST_BKT_LOW, /* u32 */
841 ETHTOOL_A_STATS_GRP_HIST_BKT_HI, /* u32 */
842 ETHTOOL_A_STATS_GRP_HIST_VAL, /* u64 */
843
844 /* add new constants above here */
845 __ETHTOOL_A_STATS_GRP_CNT,
846 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
847};
848
849108enum {
850109 /* 30.3.2.1.5 aSymbolErrorDuringCarrier */
851110 ETHTOOL_A_STATS_ETH_PHY_5_SYM_ERR,
......@@ -935,160 +194,18 @@ enum {
935194 ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1)
936195};
937196
938/* MODULE */
939
940enum {
941 ETHTOOL_A_MODULE_UNSPEC,
942 ETHTOOL_A_MODULE_HEADER, /* nest - _A_HEADER_* */
943 ETHTOOL_A_MODULE_POWER_MODE_POLICY, /* u8 */
944 ETHTOOL_A_MODULE_POWER_MODE, /* u8 */
945
946 /* add new constants above here */
947 __ETHTOOL_A_MODULE_CNT,
948 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
949};
950
951/* Power Sourcing Equipment */
952enum {
953 ETHTOOL_A_C33_PSE_PW_LIMIT_UNSPEC,
954 ETHTOOL_A_C33_PSE_PW_LIMIT_MIN, /* u32 */
955 ETHTOOL_A_C33_PSE_PW_LIMIT_MAX, /* u32 */
956};
957
958enum {
959 ETHTOOL_A_PSE_UNSPEC,
960 ETHTOOL_A_PSE_HEADER, /* nest - _A_HEADER_* */
961 ETHTOOL_A_PODL_PSE_ADMIN_STATE, /* u32 */
962 ETHTOOL_A_PODL_PSE_ADMIN_CONTROL, /* u32 */
963 ETHTOOL_A_PODL_PSE_PW_D_STATUS, /* u32 */
964 ETHTOOL_A_C33_PSE_ADMIN_STATE, /* u32 */
965 ETHTOOL_A_C33_PSE_ADMIN_CONTROL, /* u32 */
966 ETHTOOL_A_C33_PSE_PW_D_STATUS, /* u32 */
967 ETHTOOL_A_C33_PSE_PW_CLASS, /* u32 */
968 ETHTOOL_A_C33_PSE_ACTUAL_PW, /* u32 */
969 ETHTOOL_A_C33_PSE_EXT_STATE, /* u32 */
970 ETHTOOL_A_C33_PSE_EXT_SUBSTATE, /* u32 */
971 ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT, /* u32 */
972 ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES, /* nest - _C33_PSE_PW_LIMIT_* */
973
974 /* add new constants above here */
975 __ETHTOOL_A_PSE_CNT,
976 ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1)
977};
978
979enum {
980 ETHTOOL_A_RSS_UNSPEC,
981 ETHTOOL_A_RSS_HEADER,
982 ETHTOOL_A_RSS_CONTEXT, /* u32 */
983 ETHTOOL_A_RSS_HFUNC, /* u32 */
984 ETHTOOL_A_RSS_INDIR, /* binary */
985 ETHTOOL_A_RSS_HKEY, /* binary */
986 ETHTOOL_A_RSS_INPUT_XFRM, /* u32 */
987 ETHTOOL_A_RSS_START_CONTEXT, /* u32 */
988
989 __ETHTOOL_A_RSS_CNT,
990 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1),
991};
992
993/* PLCA */
994
995197enum {
996 ETHTOOL_A_PLCA_UNSPEC,
997 ETHTOOL_A_PLCA_HEADER, /* nest - _A_HEADER_* */
998 ETHTOOL_A_PLCA_VERSION, /* u16 */
999 ETHTOOL_A_PLCA_ENABLED, /* u8 */
1000 ETHTOOL_A_PLCA_STATUS, /* u8 */
1001 ETHTOOL_A_PLCA_NODE_CNT, /* u32 */
1002 ETHTOOL_A_PLCA_NODE_ID, /* u32 */
1003 ETHTOOL_A_PLCA_TO_TMR, /* u32 */
1004 ETHTOOL_A_PLCA_BURST_CNT, /* u32 */
1005 ETHTOOL_A_PLCA_BURST_TMR, /* u32 */
198 /* Basic packet counters if PHY has separate counters from the MAC */
199 ETHTOOL_A_STATS_PHY_RX_PKTS,
200 ETHTOOL_A_STATS_PHY_RX_BYTES,
201 ETHTOOL_A_STATS_PHY_RX_ERRORS,
202 ETHTOOL_A_STATS_PHY_TX_PKTS,
203 ETHTOOL_A_STATS_PHY_TX_BYTES,
204 ETHTOOL_A_STATS_PHY_TX_ERRORS,
1006205
1007206 /* add new constants above here */
1008 __ETHTOOL_A_PLCA_CNT,
1009 ETHTOOL_A_PLCA_MAX = (__ETHTOOL_A_PLCA_CNT - 1)
207 __ETHTOOL_A_STATS_PHY_CNT,
208 ETHTOOL_A_STATS_PHY_MAX = (__ETHTOOL_A_STATS_PHY_CNT - 1)
1010209};
1011210
1012/* MAC Merge (802.3) */
1013
1014enum {
1015 ETHTOOL_A_MM_STAT_UNSPEC,
1016 ETHTOOL_A_MM_STAT_PAD,
1017
1018 /* aMACMergeFrameAssErrorCount */
1019 ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS, /* u64 */
1020 /* aMACMergeFrameSmdErrorCount */
1021 ETHTOOL_A_MM_STAT_SMD_ERRORS, /* u64 */
1022 /* aMACMergeFrameAssOkCount */
1023 ETHTOOL_A_MM_STAT_REASSEMBLY_OK, /* u64 */
1024 /* aMACMergeFragCountRx */
1025 ETHTOOL_A_MM_STAT_RX_FRAG_COUNT, /* u64 */
1026 /* aMACMergeFragCountTx */
1027 ETHTOOL_A_MM_STAT_TX_FRAG_COUNT, /* u64 */
1028 /* aMACMergeHoldCount */
1029 ETHTOOL_A_MM_STAT_HOLD_COUNT, /* u64 */
1030
1031 /* add new constants above here */
1032 __ETHTOOL_A_MM_STAT_CNT,
1033 ETHTOOL_A_MM_STAT_MAX = (__ETHTOOL_A_MM_STAT_CNT - 1)
1034};
1035
1036enum {
1037 ETHTOOL_A_MM_UNSPEC,
1038 ETHTOOL_A_MM_HEADER, /* nest - _A_HEADER_* */
1039 ETHTOOL_A_MM_PMAC_ENABLED, /* u8 */
1040 ETHTOOL_A_MM_TX_ENABLED, /* u8 */
1041 ETHTOOL_A_MM_TX_ACTIVE, /* u8 */
1042 ETHTOOL_A_MM_TX_MIN_FRAG_SIZE, /* u32 */
1043 ETHTOOL_A_MM_RX_MIN_FRAG_SIZE, /* u32 */
1044 ETHTOOL_A_MM_VERIFY_ENABLED, /* u8 */
1045 ETHTOOL_A_MM_VERIFY_STATUS, /* u8 */
1046 ETHTOOL_A_MM_VERIFY_TIME, /* u32 */
1047 ETHTOOL_A_MM_MAX_VERIFY_TIME, /* u32 */
1048 ETHTOOL_A_MM_STATS, /* nest - _A_MM_STAT_* */
1049
1050 /* add new constants above here */
1051 __ETHTOOL_A_MM_CNT,
1052 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
1053};
1054
1055/* MODULE_FW_FLASH */
1056
1057enum {
1058 ETHTOOL_A_MODULE_FW_FLASH_UNSPEC,
1059 ETHTOOL_A_MODULE_FW_FLASH_HEADER, /* nest - _A_HEADER_* */
1060 ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME, /* string */
1061 ETHTOOL_A_MODULE_FW_FLASH_PASSWORD, /* u32 */
1062 ETHTOOL_A_MODULE_FW_FLASH_STATUS, /* u32 */
1063 ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG, /* string */
1064 ETHTOOL_A_MODULE_FW_FLASH_DONE, /* uint */
1065 ETHTOOL_A_MODULE_FW_FLASH_TOTAL, /* uint */
1066
1067 /* add new constants above here */
1068 __ETHTOOL_A_MODULE_FW_FLASH_CNT,
1069 ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1)
1070};
1071
1072enum {
1073 ETHTOOL_A_PHY_UNSPEC,
1074 ETHTOOL_A_PHY_HEADER, /* nest - _A_HEADER_* */
1075 ETHTOOL_A_PHY_INDEX, /* u32 */
1076 ETHTOOL_A_PHY_DRVNAME, /* string */
1077 ETHTOOL_A_PHY_NAME, /* string */
1078 ETHTOOL_A_PHY_UPSTREAM_TYPE, /* u32 */
1079 ETHTOOL_A_PHY_UPSTREAM_INDEX, /* u32 */
1080 ETHTOOL_A_PHY_UPSTREAM_SFP_NAME, /* string */
1081 ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME, /* string */
1082
1083 /* add new constants above here */
1084 __ETHTOOL_A_PHY_CNT,
1085 ETHTOOL_A_PHY_MAX = (__ETHTOOL_A_PHY_CNT - 1)
1086};
1087
1088/* generic netlink info */
1089#define ETHTOOL_GENL_NAME "ethtool"
1090#define ETHTOOL_GENL_VERSION 1
1091
1092#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
1093
1094211#endif /* _LINUX_ETHTOOL_NETLINK_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ethtool_netlink_generated.h created+913
......@@ -0,0 +1,913 @@
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/ethtool.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_ETHTOOL_NETLINK_GENERATED_H
7#define _LINUX_ETHTOOL_NETLINK_GENERATED_H
8
9#define ETHTOOL_GENL_NAME "ethtool"
10#define ETHTOOL_GENL_VERSION 1
11
12enum {
13 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN,
14 ETHTOOL_UDP_TUNNEL_TYPE_GENEVE,
15 ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE,
16
17 /* private: */
18 __ETHTOOL_UDP_TUNNEL_TYPE_CNT,
19 ETHTOOL_UDP_TUNNEL_TYPE_MAX = (__ETHTOOL_UDP_TUNNEL_TYPE_CNT - 1)
20};
21
22/**
23 * enum ethtool_header_flags - common ethtool header flags
24 * @ETHTOOL_FLAG_COMPACT_BITSETS: use compact bitsets in reply
25 * @ETHTOOL_FLAG_OMIT_REPLY: provide optional reply for SET or ACT requests
26 * @ETHTOOL_FLAG_STATS: request statistics, if supported by the driver
27 */
28enum ethtool_header_flags {
29 ETHTOOL_FLAG_COMPACT_BITSETS = 1,
30 ETHTOOL_FLAG_OMIT_REPLY = 2,
31 ETHTOOL_FLAG_STATS = 4,
32};
33
34enum ethtool_tcp_data_split {
35 ETHTOOL_TCP_DATA_SPLIT_UNKNOWN,
36 ETHTOOL_TCP_DATA_SPLIT_DISABLED,
37 ETHTOOL_TCP_DATA_SPLIT_ENABLED,
38};
39
40/**
41 * enum hwtstamp_source - Source of the hardware timestamp
42 * @HWTSTAMP_SOURCE_NETDEV: Hardware timestamp comes from a MAC or a device
43 * which has MAC and PHY integrated
44 * @HWTSTAMP_SOURCE_PHYLIB: Hardware timestamp comes from one PHY device of the
45 * network topology
46 */
47enum hwtstamp_source {
48 HWTSTAMP_SOURCE_NETDEV = 1,
49 HWTSTAMP_SOURCE_PHYLIB,
50};
51
52/**
53 * enum ethtool_pse_event - PSE event list for the PSE controller
54 * @ETHTOOL_PSE_EVENT_OVER_CURRENT: PSE output current is too high
55 * @ETHTOOL_PSE_EVENT_OVER_TEMP: PSE in over temperature state
56 * @ETHTOOL_C33_PSE_EVENT_DETECTION: detection process occur on the PSE. IEEE
57 * 802.3-2022 33.2.5 and 145.2.6 PSE detection of PDs. IEEE 802.3-202
58 * 30.9.1.1.5 aPSEPowerDetectionStatus
59 * @ETHTOOL_C33_PSE_EVENT_CLASSIFICATION: classification process occur on the
60 * PSE. IEEE 802.3-2022 33.2.6 and 145.2.8 classification of PDs mutual
61 * identification. IEEE 802.3-2022 30.9.1.1.8 aPSEPowerClassification.
62 * @ETHTOOL_C33_PSE_EVENT_DISCONNECTION: PD has been disconnected on the PSE.
63 * IEEE 802.3-2022 33.3.8 and 145.3.9 PD Maintain Power Signature. IEEE
64 * 802.3-2022 33.5.1.2.9 MPS Absent. IEEE 802.3-2022 30.9.1.1.20
65 * aPSEMPSAbsentCounter.
66 * @ETHTOOL_PSE_EVENT_OVER_BUDGET: PSE turned off due to over budget situation
67 * @ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR: PSE faced an error managing the
68 * power control from software
69 */
70enum ethtool_pse_event {
71 ETHTOOL_PSE_EVENT_OVER_CURRENT = 1,
72 ETHTOOL_PSE_EVENT_OVER_TEMP = 2,
73 ETHTOOL_C33_PSE_EVENT_DETECTION = 4,
74 ETHTOOL_C33_PSE_EVENT_CLASSIFICATION = 8,
75 ETHTOOL_C33_PSE_EVENT_DISCONNECTION = 16,
76 ETHTOOL_PSE_EVENT_OVER_BUDGET = 32,
77 ETHTOOL_PSE_EVENT_SW_PW_CONTROL_ERROR = 64,
78};
79
80enum {
81 ETHTOOL_A_HEADER_UNSPEC,
82 ETHTOOL_A_HEADER_DEV_INDEX,
83 ETHTOOL_A_HEADER_DEV_NAME,
84 ETHTOOL_A_HEADER_FLAGS,
85 ETHTOOL_A_HEADER_PHY_INDEX,
86
87 __ETHTOOL_A_HEADER_CNT,
88 ETHTOOL_A_HEADER_MAX = (__ETHTOOL_A_HEADER_CNT - 1)
89};
90
91enum {
92 ETHTOOL_A_BITSET_BIT_UNSPEC,
93 ETHTOOL_A_BITSET_BIT_INDEX,
94 ETHTOOL_A_BITSET_BIT_NAME,
95 ETHTOOL_A_BITSET_BIT_VALUE,
96
97 __ETHTOOL_A_BITSET_BIT_CNT,
98 ETHTOOL_A_BITSET_BIT_MAX = (__ETHTOOL_A_BITSET_BIT_CNT - 1)
99};
100
101enum {
102 ETHTOOL_A_BITSET_BITS_UNSPEC,
103 ETHTOOL_A_BITSET_BITS_BIT,
104
105 __ETHTOOL_A_BITSET_BITS_CNT,
106 ETHTOOL_A_BITSET_BITS_MAX = (__ETHTOOL_A_BITSET_BITS_CNT - 1)
107};
108
109enum {
110 ETHTOOL_A_BITSET_UNSPEC,
111 ETHTOOL_A_BITSET_NOMASK,
112 ETHTOOL_A_BITSET_SIZE,
113 ETHTOOL_A_BITSET_BITS,
114 ETHTOOL_A_BITSET_VALUE,
115 ETHTOOL_A_BITSET_MASK,
116
117 __ETHTOOL_A_BITSET_CNT,
118 ETHTOOL_A_BITSET_MAX = (__ETHTOOL_A_BITSET_CNT - 1)
119};
120
121enum {
122 ETHTOOL_A_STRING_UNSPEC,
123 ETHTOOL_A_STRING_INDEX,
124 ETHTOOL_A_STRING_VALUE,
125
126 __ETHTOOL_A_STRING_CNT,
127 ETHTOOL_A_STRING_MAX = (__ETHTOOL_A_STRING_CNT - 1)
128};
129
130enum {
131 ETHTOOL_A_STRINGS_UNSPEC,
132 ETHTOOL_A_STRINGS_STRING,
133
134 __ETHTOOL_A_STRINGS_CNT,
135 ETHTOOL_A_STRINGS_MAX = (__ETHTOOL_A_STRINGS_CNT - 1)
136};
137
138enum {
139 ETHTOOL_A_STRINGSET_UNSPEC,
140 ETHTOOL_A_STRINGSET_ID,
141 ETHTOOL_A_STRINGSET_COUNT,
142 ETHTOOL_A_STRINGSET_STRINGS,
143
144 __ETHTOOL_A_STRINGSET_CNT,
145 ETHTOOL_A_STRINGSET_MAX = (__ETHTOOL_A_STRINGSET_CNT - 1)
146};
147
148enum {
149 ETHTOOL_A_STRINGSETS_UNSPEC,
150 ETHTOOL_A_STRINGSETS_STRINGSET,
151
152 __ETHTOOL_A_STRINGSETS_CNT,
153 ETHTOOL_A_STRINGSETS_MAX = (__ETHTOOL_A_STRINGSETS_CNT - 1)
154};
155
156enum {
157 ETHTOOL_A_STRSET_UNSPEC,
158 ETHTOOL_A_STRSET_HEADER,
159 ETHTOOL_A_STRSET_STRINGSETS,
160 ETHTOOL_A_STRSET_COUNTS_ONLY,
161
162 __ETHTOOL_A_STRSET_CNT,
163 ETHTOOL_A_STRSET_MAX = (__ETHTOOL_A_STRSET_CNT - 1)
164};
165
166enum {
167 ETHTOOL_A_PRIVFLAGS_UNSPEC,
168 ETHTOOL_A_PRIVFLAGS_HEADER,
169 ETHTOOL_A_PRIVFLAGS_FLAGS,
170
171 __ETHTOOL_A_PRIVFLAGS_CNT,
172 ETHTOOL_A_PRIVFLAGS_MAX = (__ETHTOOL_A_PRIVFLAGS_CNT - 1)
173};
174
175enum {
176 ETHTOOL_A_RINGS_UNSPEC,
177 ETHTOOL_A_RINGS_HEADER,
178 ETHTOOL_A_RINGS_RX_MAX,
179 ETHTOOL_A_RINGS_RX_MINI_MAX,
180 ETHTOOL_A_RINGS_RX_JUMBO_MAX,
181 ETHTOOL_A_RINGS_TX_MAX,
182 ETHTOOL_A_RINGS_RX,
183 ETHTOOL_A_RINGS_RX_MINI,
184 ETHTOOL_A_RINGS_RX_JUMBO,
185 ETHTOOL_A_RINGS_TX,
186 ETHTOOL_A_RINGS_RX_BUF_LEN,
187 ETHTOOL_A_RINGS_TCP_DATA_SPLIT,
188 ETHTOOL_A_RINGS_CQE_SIZE,
189 ETHTOOL_A_RINGS_TX_PUSH,
190 ETHTOOL_A_RINGS_RX_PUSH,
191 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN,
192 ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX,
193 ETHTOOL_A_RINGS_HDS_THRESH,
194 ETHTOOL_A_RINGS_HDS_THRESH_MAX,
195
196 __ETHTOOL_A_RINGS_CNT,
197 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
198};
199
200enum {
201 ETHTOOL_A_MM_STAT_UNSPEC,
202 ETHTOOL_A_MM_STAT_PAD,
203 ETHTOOL_A_MM_STAT_REASSEMBLY_ERRORS,
204 ETHTOOL_A_MM_STAT_SMD_ERRORS,
205 ETHTOOL_A_MM_STAT_REASSEMBLY_OK,
206 ETHTOOL_A_MM_STAT_RX_FRAG_COUNT,
207 ETHTOOL_A_MM_STAT_TX_FRAG_COUNT,
208 ETHTOOL_A_MM_STAT_HOLD_COUNT,
209
210 __ETHTOOL_A_MM_STAT_CNT,
211 ETHTOOL_A_MM_STAT_MAX = (__ETHTOOL_A_MM_STAT_CNT - 1)
212};
213
214enum {
215 ETHTOOL_A_MM_UNSPEC,
216 ETHTOOL_A_MM_HEADER,
217 ETHTOOL_A_MM_PMAC_ENABLED,
218 ETHTOOL_A_MM_TX_ENABLED,
219 ETHTOOL_A_MM_TX_ACTIVE,
220 ETHTOOL_A_MM_TX_MIN_FRAG_SIZE,
221 ETHTOOL_A_MM_RX_MIN_FRAG_SIZE,
222 ETHTOOL_A_MM_VERIFY_ENABLED,
223 ETHTOOL_A_MM_VERIFY_STATUS,
224 ETHTOOL_A_MM_VERIFY_TIME,
225 ETHTOOL_A_MM_MAX_VERIFY_TIME,
226 ETHTOOL_A_MM_STATS,
227
228 __ETHTOOL_A_MM_CNT,
229 ETHTOOL_A_MM_MAX = (__ETHTOOL_A_MM_CNT - 1)
230};
231
232enum {
233 ETHTOOL_A_LINKINFO_UNSPEC,
234 ETHTOOL_A_LINKINFO_HEADER,
235 ETHTOOL_A_LINKINFO_PORT,
236 ETHTOOL_A_LINKINFO_PHYADDR,
237 ETHTOOL_A_LINKINFO_TP_MDIX,
238 ETHTOOL_A_LINKINFO_TP_MDIX_CTRL,
239 ETHTOOL_A_LINKINFO_TRANSCEIVER,
240
241 __ETHTOOL_A_LINKINFO_CNT,
242 ETHTOOL_A_LINKINFO_MAX = (__ETHTOOL_A_LINKINFO_CNT - 1)
243};
244
245enum {
246 ETHTOOL_A_LINKMODES_UNSPEC,
247 ETHTOOL_A_LINKMODES_HEADER,
248 ETHTOOL_A_LINKMODES_AUTONEG,
249 ETHTOOL_A_LINKMODES_OURS,
250 ETHTOOL_A_LINKMODES_PEER,
251 ETHTOOL_A_LINKMODES_SPEED,
252 ETHTOOL_A_LINKMODES_DUPLEX,
253 ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG,
254 ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE,
255 ETHTOOL_A_LINKMODES_LANES,
256 ETHTOOL_A_LINKMODES_RATE_MATCHING,
257
258 __ETHTOOL_A_LINKMODES_CNT,
259 ETHTOOL_A_LINKMODES_MAX = (__ETHTOOL_A_LINKMODES_CNT - 1)
260};
261
262enum {
263 ETHTOOL_A_LINKSTATE_UNSPEC,
264 ETHTOOL_A_LINKSTATE_HEADER,
265 ETHTOOL_A_LINKSTATE_LINK,
266 ETHTOOL_A_LINKSTATE_SQI,
267 ETHTOOL_A_LINKSTATE_SQI_MAX,
268 ETHTOOL_A_LINKSTATE_EXT_STATE,
269 ETHTOOL_A_LINKSTATE_EXT_SUBSTATE,
270 ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT,
271
272 __ETHTOOL_A_LINKSTATE_CNT,
273 ETHTOOL_A_LINKSTATE_MAX = (__ETHTOOL_A_LINKSTATE_CNT - 1)
274};
275
276enum {
277 ETHTOOL_A_DEBUG_UNSPEC,
278 ETHTOOL_A_DEBUG_HEADER,
279 ETHTOOL_A_DEBUG_MSGMASK,
280
281 __ETHTOOL_A_DEBUG_CNT,
282 ETHTOOL_A_DEBUG_MAX = (__ETHTOOL_A_DEBUG_CNT - 1)
283};
284
285enum {
286 ETHTOOL_A_WOL_UNSPEC,
287 ETHTOOL_A_WOL_HEADER,
288 ETHTOOL_A_WOL_MODES,
289 ETHTOOL_A_WOL_SOPASS,
290
291 __ETHTOOL_A_WOL_CNT,
292 ETHTOOL_A_WOL_MAX = (__ETHTOOL_A_WOL_CNT - 1)
293};
294
295enum {
296 ETHTOOL_A_FEATURES_UNSPEC,
297 ETHTOOL_A_FEATURES_HEADER,
298 ETHTOOL_A_FEATURES_HW,
299 ETHTOOL_A_FEATURES_WANTED,
300 ETHTOOL_A_FEATURES_ACTIVE,
301 ETHTOOL_A_FEATURES_NOCHANGE,
302
303 __ETHTOOL_A_FEATURES_CNT,
304 ETHTOOL_A_FEATURES_MAX = (__ETHTOOL_A_FEATURES_CNT - 1)
305};
306
307enum {
308 ETHTOOL_A_CHANNELS_UNSPEC,
309 ETHTOOL_A_CHANNELS_HEADER,
310 ETHTOOL_A_CHANNELS_RX_MAX,
311 ETHTOOL_A_CHANNELS_TX_MAX,
312 ETHTOOL_A_CHANNELS_OTHER_MAX,
313 ETHTOOL_A_CHANNELS_COMBINED_MAX,
314 ETHTOOL_A_CHANNELS_RX_COUNT,
315 ETHTOOL_A_CHANNELS_TX_COUNT,
316 ETHTOOL_A_CHANNELS_OTHER_COUNT,
317 ETHTOOL_A_CHANNELS_COMBINED_COUNT,
318
319 __ETHTOOL_A_CHANNELS_CNT,
320 ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
321};
322
323enum {
324 ETHTOOL_A_IRQ_MODERATION_UNSPEC,
325 ETHTOOL_A_IRQ_MODERATION_USEC,
326 ETHTOOL_A_IRQ_MODERATION_PKTS,
327 ETHTOOL_A_IRQ_MODERATION_COMPS,
328
329 __ETHTOOL_A_IRQ_MODERATION_CNT,
330 ETHTOOL_A_IRQ_MODERATION_MAX = (__ETHTOOL_A_IRQ_MODERATION_CNT - 1)
331};
332
333enum {
334 ETHTOOL_A_PROFILE_UNSPEC,
335 ETHTOOL_A_PROFILE_IRQ_MODERATION,
336
337 __ETHTOOL_A_PROFILE_CNT,
338 ETHTOOL_A_PROFILE_MAX = (__ETHTOOL_A_PROFILE_CNT - 1)
339};
340
341enum {
342 ETHTOOL_A_COALESCE_UNSPEC,
343 ETHTOOL_A_COALESCE_HEADER,
344 ETHTOOL_A_COALESCE_RX_USECS,
345 ETHTOOL_A_COALESCE_RX_MAX_FRAMES,
346 ETHTOOL_A_COALESCE_RX_USECS_IRQ,
347 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ,
348 ETHTOOL_A_COALESCE_TX_USECS,
349 ETHTOOL_A_COALESCE_TX_MAX_FRAMES,
350 ETHTOOL_A_COALESCE_TX_USECS_IRQ,
351 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ,
352 ETHTOOL_A_COALESCE_STATS_BLOCK_USECS,
353 ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX,
354 ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX,
355 ETHTOOL_A_COALESCE_PKT_RATE_LOW,
356 ETHTOOL_A_COALESCE_RX_USECS_LOW,
357 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW,
358 ETHTOOL_A_COALESCE_TX_USECS_LOW,
359 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW,
360 ETHTOOL_A_COALESCE_PKT_RATE_HIGH,
361 ETHTOOL_A_COALESCE_RX_USECS_HIGH,
362 ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH,
363 ETHTOOL_A_COALESCE_TX_USECS_HIGH,
364 ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH,
365 ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL,
366 ETHTOOL_A_COALESCE_USE_CQE_MODE_TX,
367 ETHTOOL_A_COALESCE_USE_CQE_MODE_RX,
368 ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES,
369 ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES,
370 ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
371 ETHTOOL_A_COALESCE_RX_PROFILE,
372 ETHTOOL_A_COALESCE_TX_PROFILE,
373
374 __ETHTOOL_A_COALESCE_CNT,
375 ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
376};
377
378enum {
379 ETHTOOL_A_PAUSE_STAT_UNSPEC,
380 ETHTOOL_A_PAUSE_STAT_PAD,
381 ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
382 ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
383
384 __ETHTOOL_A_PAUSE_STAT_CNT,
385 ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
386};
387
388enum {
389 ETHTOOL_A_PAUSE_UNSPEC,
390 ETHTOOL_A_PAUSE_HEADER,
391 ETHTOOL_A_PAUSE_AUTONEG,
392 ETHTOOL_A_PAUSE_RX,
393 ETHTOOL_A_PAUSE_TX,
394 ETHTOOL_A_PAUSE_STATS,
395 ETHTOOL_A_PAUSE_STATS_SRC,
396
397 __ETHTOOL_A_PAUSE_CNT,
398 ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
399};
400
401enum {
402 ETHTOOL_A_EEE_UNSPEC,
403 ETHTOOL_A_EEE_HEADER,
404 ETHTOOL_A_EEE_MODES_OURS,
405 ETHTOOL_A_EEE_MODES_PEER,
406 ETHTOOL_A_EEE_ACTIVE,
407 ETHTOOL_A_EEE_ENABLED,
408 ETHTOOL_A_EEE_TX_LPI_ENABLED,
409 ETHTOOL_A_EEE_TX_LPI_TIMER,
410
411 __ETHTOOL_A_EEE_CNT,
412 ETHTOOL_A_EEE_MAX = (__ETHTOOL_A_EEE_CNT - 1)
413};
414
415enum {
416 ETHTOOL_A_TS_STAT_UNSPEC,
417 ETHTOOL_A_TS_STAT_TX_PKTS,
418 ETHTOOL_A_TS_STAT_TX_LOST,
419 ETHTOOL_A_TS_STAT_TX_ERR,
420 ETHTOOL_A_TS_STAT_TX_ONESTEP_PKTS_UNCONFIRMED,
421
422 __ETHTOOL_A_TS_STAT_CNT,
423 ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1)
424};
425
426enum {
427 ETHTOOL_A_TS_HWTSTAMP_PROVIDER_UNSPEC,
428 ETHTOOL_A_TS_HWTSTAMP_PROVIDER_INDEX,
429 ETHTOOL_A_TS_HWTSTAMP_PROVIDER_QUALIFIER,
430
431 __ETHTOOL_A_TS_HWTSTAMP_PROVIDER_CNT,
432 ETHTOOL_A_TS_HWTSTAMP_PROVIDER_MAX = (__ETHTOOL_A_TS_HWTSTAMP_PROVIDER_CNT - 1)
433};
434
435enum {
436 ETHTOOL_A_TSINFO_UNSPEC,
437 ETHTOOL_A_TSINFO_HEADER,
438 ETHTOOL_A_TSINFO_TIMESTAMPING,
439 ETHTOOL_A_TSINFO_TX_TYPES,
440 ETHTOOL_A_TSINFO_RX_FILTERS,
441 ETHTOOL_A_TSINFO_PHC_INDEX,
442 ETHTOOL_A_TSINFO_STATS,
443 ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER,
444 ETHTOOL_A_TSINFO_HWTSTAMP_SOURCE,
445 ETHTOOL_A_TSINFO_HWTSTAMP_PHYINDEX,
446
447 __ETHTOOL_A_TSINFO_CNT,
448 ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1)
449};
450
451enum {
452 ETHTOOL_A_CABLE_RESULT_UNSPEC,
453 ETHTOOL_A_CABLE_RESULT_PAIR,
454 ETHTOOL_A_CABLE_RESULT_CODE,
455 ETHTOOL_A_CABLE_RESULT_SRC,
456
457 __ETHTOOL_A_CABLE_RESULT_CNT,
458 ETHTOOL_A_CABLE_RESULT_MAX = (__ETHTOOL_A_CABLE_RESULT_CNT - 1)
459};
460
461enum {
462 ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC,
463 ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR,
464 ETHTOOL_A_CABLE_FAULT_LENGTH_CM,
465 ETHTOOL_A_CABLE_FAULT_LENGTH_SRC,
466
467 __ETHTOOL_A_CABLE_FAULT_LENGTH_CNT,
468 ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = (__ETHTOOL_A_CABLE_FAULT_LENGTH_CNT - 1)
469};
470
471enum {
472 ETHTOOL_A_CABLE_NEST_UNSPEC,
473 ETHTOOL_A_CABLE_NEST_RESULT,
474 ETHTOOL_A_CABLE_NEST_FAULT_LENGTH,
475
476 __ETHTOOL_A_CABLE_NEST_CNT,
477 ETHTOOL_A_CABLE_NEST_MAX = (__ETHTOOL_A_CABLE_NEST_CNT - 1)
478};
479
480enum {
481 ETHTOOL_A_CABLE_TEST_UNSPEC,
482 ETHTOOL_A_CABLE_TEST_HEADER,
483
484 __ETHTOOL_A_CABLE_TEST_CNT,
485 ETHTOOL_A_CABLE_TEST_MAX = (__ETHTOOL_A_CABLE_TEST_CNT - 1)
486};
487
488enum {
489 ETHTOOL_A_CABLE_TEST_NTF_UNSPEC,
490 ETHTOOL_A_CABLE_TEST_NTF_HEADER,
491 ETHTOOL_A_CABLE_TEST_NTF_STATUS,
492 ETHTOOL_A_CABLE_TEST_NTF_NEST,
493
494 __ETHTOOL_A_CABLE_TEST_NTF_CNT,
495 ETHTOOL_A_CABLE_TEST_NTF_MAX = (__ETHTOOL_A_CABLE_TEST_NTF_CNT - 1)
496};
497
498enum {
499 ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC,
500 ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST,
501 ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST,
502 ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP,
503 ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR,
504
505 __ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT,
506 ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = (__ETHTOOL_A_CABLE_TEST_TDR_CFG_CNT - 1)
507};
508
509enum {
510 ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC,
511 ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER,
512 ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS,
513 ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST,
514
515 __ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT,
516 ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = (__ETHTOOL_A_CABLE_TEST_TDR_NTF_CNT - 1)
517};
518
519enum {
520 ETHTOOL_A_CABLE_TEST_TDR_UNSPEC,
521 ETHTOOL_A_CABLE_TEST_TDR_HEADER,
522 ETHTOOL_A_CABLE_TEST_TDR_CFG,
523
524 __ETHTOOL_A_CABLE_TEST_TDR_CNT,
525 ETHTOOL_A_CABLE_TEST_TDR_MAX = (__ETHTOOL_A_CABLE_TEST_TDR_CNT - 1)
526};
527
528enum {
529 ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC,
530 ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT,
531 ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE,
532
533 __ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT,
534 ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = (__ETHTOOL_A_TUNNEL_UDP_ENTRY_CNT - 1)
535};
536
537enum {
538 ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC,
539 ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE,
540 ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES,
541 ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY,
542
543 __ETHTOOL_A_TUNNEL_UDP_TABLE_CNT,
544 ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = (__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT - 1)
545};
546
547enum {
548 ETHTOOL_A_TUNNEL_UDP_UNSPEC,
549 ETHTOOL_A_TUNNEL_UDP_TABLE,
550
551 __ETHTOOL_A_TUNNEL_UDP_CNT,
552 ETHTOOL_A_TUNNEL_UDP_MAX = (__ETHTOOL_A_TUNNEL_UDP_CNT - 1)
553};
554
555enum {
556 ETHTOOL_A_TUNNEL_INFO_UNSPEC,
557 ETHTOOL_A_TUNNEL_INFO_HEADER,
558 ETHTOOL_A_TUNNEL_INFO_UDP_PORTS,
559
560 __ETHTOOL_A_TUNNEL_INFO_CNT,
561 ETHTOOL_A_TUNNEL_INFO_MAX = (__ETHTOOL_A_TUNNEL_INFO_CNT - 1)
562};
563
564enum {
565 ETHTOOL_A_FEC_STAT_UNSPEC,
566 ETHTOOL_A_FEC_STAT_PAD,
567 ETHTOOL_A_FEC_STAT_CORRECTED,
568 ETHTOOL_A_FEC_STAT_UNCORR,
569 ETHTOOL_A_FEC_STAT_CORR_BITS,
570
571 __ETHTOOL_A_FEC_STAT_CNT,
572 ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
573};
574
575enum {
576 ETHTOOL_A_FEC_UNSPEC,
577 ETHTOOL_A_FEC_HEADER,
578 ETHTOOL_A_FEC_MODES,
579 ETHTOOL_A_FEC_AUTO,
580 ETHTOOL_A_FEC_ACTIVE,
581 ETHTOOL_A_FEC_STATS,
582
583 __ETHTOOL_A_FEC_CNT,
584 ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)
585};
586
587enum {
588 ETHTOOL_A_MODULE_EEPROM_UNSPEC,
589 ETHTOOL_A_MODULE_EEPROM_HEADER,
590 ETHTOOL_A_MODULE_EEPROM_OFFSET,
591 ETHTOOL_A_MODULE_EEPROM_LENGTH,
592 ETHTOOL_A_MODULE_EEPROM_PAGE,
593 ETHTOOL_A_MODULE_EEPROM_BANK,
594 ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS,
595 ETHTOOL_A_MODULE_EEPROM_DATA,
596
597 __ETHTOOL_A_MODULE_EEPROM_CNT,
598 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
599};
600
601enum {
602 ETHTOOL_A_STATS_GRP_UNSPEC,
603 ETHTOOL_A_STATS_GRP_PAD,
604 ETHTOOL_A_STATS_GRP_ID,
605 ETHTOOL_A_STATS_GRP_SS_ID,
606 ETHTOOL_A_STATS_GRP_STAT,
607 ETHTOOL_A_STATS_GRP_HIST_RX,
608 ETHTOOL_A_STATS_GRP_HIST_TX,
609 ETHTOOL_A_STATS_GRP_HIST_BKT_LOW,
610 ETHTOOL_A_STATS_GRP_HIST_BKT_HI,
611 ETHTOOL_A_STATS_GRP_HIST_VAL,
612
613 __ETHTOOL_A_STATS_GRP_CNT,
614 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1)
615};
616
617enum {
618 ETHTOOL_A_STATS_UNSPEC,
619 ETHTOOL_A_STATS_PAD,
620 ETHTOOL_A_STATS_HEADER,
621 ETHTOOL_A_STATS_GROUPS,
622 ETHTOOL_A_STATS_GRP,
623 ETHTOOL_A_STATS_SRC,
624
625 __ETHTOOL_A_STATS_CNT,
626 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
627};
628
629enum {
630 ETHTOOL_A_PHC_VCLOCKS_UNSPEC,
631 ETHTOOL_A_PHC_VCLOCKS_HEADER,
632 ETHTOOL_A_PHC_VCLOCKS_NUM,
633 ETHTOOL_A_PHC_VCLOCKS_INDEX,
634
635 __ETHTOOL_A_PHC_VCLOCKS_CNT,
636 ETHTOOL_A_PHC_VCLOCKS_MAX = (__ETHTOOL_A_PHC_VCLOCKS_CNT - 1)
637};
638
639enum {
640 ETHTOOL_A_MODULE_UNSPEC,
641 ETHTOOL_A_MODULE_HEADER,
642 ETHTOOL_A_MODULE_POWER_MODE_POLICY,
643 ETHTOOL_A_MODULE_POWER_MODE,
644
645 __ETHTOOL_A_MODULE_CNT,
646 ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_CNT - 1)
647};
648
649enum {
650 ETHTOOL_A_C33_PSE_PW_LIMIT_UNSPEC,
651 ETHTOOL_A_C33_PSE_PW_LIMIT_MIN,
652 ETHTOOL_A_C33_PSE_PW_LIMIT_MAX,
653
654 __ETHTOOL_A_C33_PSE_PW_LIMIT_CNT,
655 __ETHTOOL_A_C33_PSE_PW_LIMIT_MAX = (__ETHTOOL_A_C33_PSE_PW_LIMIT_CNT - 1)
656};
657
658enum {
659 ETHTOOL_A_PSE_UNSPEC,
660 ETHTOOL_A_PSE_HEADER,
661 ETHTOOL_A_PODL_PSE_ADMIN_STATE,
662 ETHTOOL_A_PODL_PSE_ADMIN_CONTROL,
663 ETHTOOL_A_PODL_PSE_PW_D_STATUS,
664 ETHTOOL_A_C33_PSE_ADMIN_STATE,
665 ETHTOOL_A_C33_PSE_ADMIN_CONTROL,
666 ETHTOOL_A_C33_PSE_PW_D_STATUS,
667 ETHTOOL_A_C33_PSE_PW_CLASS,
668 ETHTOOL_A_C33_PSE_ACTUAL_PW,
669 ETHTOOL_A_C33_PSE_EXT_STATE,
670 ETHTOOL_A_C33_PSE_EXT_SUBSTATE,
671 ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT,
672 ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES,
673 ETHTOOL_A_PSE_PW_D_ID,
674 ETHTOOL_A_PSE_PRIO_MAX,
675 ETHTOOL_A_PSE_PRIO,
676
677 __ETHTOOL_A_PSE_CNT,
678 ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1)
679};
680
681enum {
682 ETHTOOL_A_FLOW_ETHER = 1,
683 ETHTOOL_A_FLOW_IP4,
684 ETHTOOL_A_FLOW_IP6,
685 ETHTOOL_A_FLOW_TCP4,
686 ETHTOOL_A_FLOW_TCP6,
687 ETHTOOL_A_FLOW_UDP4,
688 ETHTOOL_A_FLOW_UDP6,
689 ETHTOOL_A_FLOW_SCTP4,
690 ETHTOOL_A_FLOW_SCTP6,
691 ETHTOOL_A_FLOW_AH4,
692 ETHTOOL_A_FLOW_AH6,
693 ETHTOOL_A_FLOW_ESP4,
694 ETHTOOL_A_FLOW_ESP6,
695 ETHTOOL_A_FLOW_AH_ESP4,
696 ETHTOOL_A_FLOW_AH_ESP6,
697 ETHTOOL_A_FLOW_GTPU4,
698 ETHTOOL_A_FLOW_GTPU6,
699 ETHTOOL_A_FLOW_GTPC4,
700 ETHTOOL_A_FLOW_GTPC6,
701 ETHTOOL_A_FLOW_GTPC_TEID4,
702 ETHTOOL_A_FLOW_GTPC_TEID6,
703 ETHTOOL_A_FLOW_GTPU_EH4,
704 ETHTOOL_A_FLOW_GTPU_EH6,
705 ETHTOOL_A_FLOW_GTPU_UL4,
706 ETHTOOL_A_FLOW_GTPU_UL6,
707 ETHTOOL_A_FLOW_GTPU_DL4,
708 ETHTOOL_A_FLOW_GTPU_DL6,
709
710 __ETHTOOL_A_FLOW_CNT,
711 ETHTOOL_A_FLOW_MAX = (__ETHTOOL_A_FLOW_CNT - 1)
712};
713
714enum {
715 ETHTOOL_A_RSS_UNSPEC,
716 ETHTOOL_A_RSS_HEADER,
717 ETHTOOL_A_RSS_CONTEXT,
718 ETHTOOL_A_RSS_HFUNC,
719 ETHTOOL_A_RSS_INDIR,
720 ETHTOOL_A_RSS_HKEY,
721 ETHTOOL_A_RSS_INPUT_XFRM,
722 ETHTOOL_A_RSS_START_CONTEXT,
723 ETHTOOL_A_RSS_FLOW_HASH,
724
725 __ETHTOOL_A_RSS_CNT,
726 ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1)
727};
728
729enum {
730 ETHTOOL_A_PLCA_UNSPEC,
731 ETHTOOL_A_PLCA_HEADER,
732 ETHTOOL_A_PLCA_VERSION,
733 ETHTOOL_A_PLCA_ENABLED,
734 ETHTOOL_A_PLCA_STATUS,
735 ETHTOOL_A_PLCA_NODE_CNT,
736 ETHTOOL_A_PLCA_NODE_ID,
737 ETHTOOL_A_PLCA_TO_TMR,
738 ETHTOOL_A_PLCA_BURST_CNT,
739 ETHTOOL_A_PLCA_BURST_TMR,
740
741 __ETHTOOL_A_PLCA_CNT,
742 ETHTOOL_A_PLCA_MAX = (__ETHTOOL_A_PLCA_CNT - 1)
743};
744
745enum {
746 ETHTOOL_A_MODULE_FW_FLASH_UNSPEC,
747 ETHTOOL_A_MODULE_FW_FLASH_HEADER,
748 ETHTOOL_A_MODULE_FW_FLASH_FILE_NAME,
749 ETHTOOL_A_MODULE_FW_FLASH_PASSWORD,
750 ETHTOOL_A_MODULE_FW_FLASH_STATUS,
751 ETHTOOL_A_MODULE_FW_FLASH_STATUS_MSG,
752 ETHTOOL_A_MODULE_FW_FLASH_DONE,
753 ETHTOOL_A_MODULE_FW_FLASH_TOTAL,
754
755 __ETHTOOL_A_MODULE_FW_FLASH_CNT,
756 ETHTOOL_A_MODULE_FW_FLASH_MAX = (__ETHTOOL_A_MODULE_FW_FLASH_CNT - 1)
757};
758
759enum {
760 ETHTOOL_A_PHY_UNSPEC,
761 ETHTOOL_A_PHY_HEADER,
762 ETHTOOL_A_PHY_INDEX,
763 ETHTOOL_A_PHY_DRVNAME,
764 ETHTOOL_A_PHY_NAME,
765 ETHTOOL_A_PHY_UPSTREAM_TYPE,
766 ETHTOOL_A_PHY_UPSTREAM_INDEX,
767 ETHTOOL_A_PHY_UPSTREAM_SFP_NAME,
768 ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME,
769
770 __ETHTOOL_A_PHY_CNT,
771 ETHTOOL_A_PHY_MAX = (__ETHTOOL_A_PHY_CNT - 1)
772};
773
774enum {
775 ETHTOOL_A_TSCONFIG_UNSPEC,
776 ETHTOOL_A_TSCONFIG_HEADER,
777 ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER,
778 ETHTOOL_A_TSCONFIG_TX_TYPES,
779 ETHTOOL_A_TSCONFIG_RX_FILTERS,
780 ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS,
781
782 __ETHTOOL_A_TSCONFIG_CNT,
783 ETHTOOL_A_TSCONFIG_MAX = (__ETHTOOL_A_TSCONFIG_CNT - 1)
784};
785
786enum {
787 ETHTOOL_A_PSE_NTF_HEADER = 1,
788 ETHTOOL_A_PSE_NTF_EVENTS,
789
790 __ETHTOOL_A_PSE_NTF_CNT,
791 ETHTOOL_A_PSE_NTF_MAX = (__ETHTOOL_A_PSE_NTF_CNT - 1)
792};
793
794enum {
795 ETHTOOL_MSG_USER_NONE = 0,
796 ETHTOOL_MSG_STRSET_GET = 1,
797 ETHTOOL_MSG_LINKINFO_GET,
798 ETHTOOL_MSG_LINKINFO_SET,
799 ETHTOOL_MSG_LINKMODES_GET,
800 ETHTOOL_MSG_LINKMODES_SET,
801 ETHTOOL_MSG_LINKSTATE_GET,
802 ETHTOOL_MSG_DEBUG_GET,
803 ETHTOOL_MSG_DEBUG_SET,
804 ETHTOOL_MSG_WOL_GET,
805 ETHTOOL_MSG_WOL_SET,
806 ETHTOOL_MSG_FEATURES_GET,
807 ETHTOOL_MSG_FEATURES_SET,
808 ETHTOOL_MSG_PRIVFLAGS_GET,
809 ETHTOOL_MSG_PRIVFLAGS_SET,
810 ETHTOOL_MSG_RINGS_GET,
811 ETHTOOL_MSG_RINGS_SET,
812 ETHTOOL_MSG_CHANNELS_GET,
813 ETHTOOL_MSG_CHANNELS_SET,
814 ETHTOOL_MSG_COALESCE_GET,
815 ETHTOOL_MSG_COALESCE_SET,
816 ETHTOOL_MSG_PAUSE_GET,
817 ETHTOOL_MSG_PAUSE_SET,
818 ETHTOOL_MSG_EEE_GET,
819 ETHTOOL_MSG_EEE_SET,
820 ETHTOOL_MSG_TSINFO_GET,
821 ETHTOOL_MSG_CABLE_TEST_ACT,
822 ETHTOOL_MSG_CABLE_TEST_TDR_ACT,
823 ETHTOOL_MSG_TUNNEL_INFO_GET,
824 ETHTOOL_MSG_FEC_GET,
825 ETHTOOL_MSG_FEC_SET,
826 ETHTOOL_MSG_MODULE_EEPROM_GET,
827 ETHTOOL_MSG_STATS_GET,
828 ETHTOOL_MSG_PHC_VCLOCKS_GET,
829 ETHTOOL_MSG_MODULE_GET,
830 ETHTOOL_MSG_MODULE_SET,
831 ETHTOOL_MSG_PSE_GET,
832 ETHTOOL_MSG_PSE_SET,
833 ETHTOOL_MSG_RSS_GET,
834 ETHTOOL_MSG_PLCA_GET_CFG,
835 ETHTOOL_MSG_PLCA_SET_CFG,
836 ETHTOOL_MSG_PLCA_GET_STATUS,
837 ETHTOOL_MSG_MM_GET,
838 ETHTOOL_MSG_MM_SET,
839 ETHTOOL_MSG_MODULE_FW_FLASH_ACT,
840 ETHTOOL_MSG_PHY_GET,
841 ETHTOOL_MSG_TSCONFIG_GET,
842 ETHTOOL_MSG_TSCONFIG_SET,
843 ETHTOOL_MSG_RSS_SET,
844 ETHTOOL_MSG_RSS_CREATE_ACT,
845 ETHTOOL_MSG_RSS_DELETE_ACT,
846
847 __ETHTOOL_MSG_USER_CNT,
848 ETHTOOL_MSG_USER_MAX = (__ETHTOOL_MSG_USER_CNT - 1)
849};
850
851enum {
852 ETHTOOL_MSG_KERNEL_NONE = 0,
853 ETHTOOL_MSG_STRSET_GET_REPLY = 1,
854 ETHTOOL_MSG_LINKINFO_GET_REPLY,
855 ETHTOOL_MSG_LINKINFO_NTF,
856 ETHTOOL_MSG_LINKMODES_GET_REPLY,
857 ETHTOOL_MSG_LINKMODES_NTF,
858 ETHTOOL_MSG_LINKSTATE_GET_REPLY,
859 ETHTOOL_MSG_DEBUG_GET_REPLY,
860 ETHTOOL_MSG_DEBUG_NTF,
861 ETHTOOL_MSG_WOL_GET_REPLY,
862 ETHTOOL_MSG_WOL_NTF,
863 ETHTOOL_MSG_FEATURES_GET_REPLY,
864 ETHTOOL_MSG_FEATURES_SET_REPLY,
865 ETHTOOL_MSG_FEATURES_NTF,
866 ETHTOOL_MSG_PRIVFLAGS_GET_REPLY,
867 ETHTOOL_MSG_PRIVFLAGS_NTF,
868 ETHTOOL_MSG_RINGS_GET_REPLY,
869 ETHTOOL_MSG_RINGS_NTF,
870 ETHTOOL_MSG_CHANNELS_GET_REPLY,
871 ETHTOOL_MSG_CHANNELS_NTF,
872 ETHTOOL_MSG_COALESCE_GET_REPLY,
873 ETHTOOL_MSG_COALESCE_NTF,
874 ETHTOOL_MSG_PAUSE_GET_REPLY,
875 ETHTOOL_MSG_PAUSE_NTF,
876 ETHTOOL_MSG_EEE_GET_REPLY,
877 ETHTOOL_MSG_EEE_NTF,
878 ETHTOOL_MSG_TSINFO_GET_REPLY,
879 ETHTOOL_MSG_CABLE_TEST_NTF,
880 ETHTOOL_MSG_CABLE_TEST_TDR_NTF,
881 ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY,
882 ETHTOOL_MSG_FEC_GET_REPLY,
883 ETHTOOL_MSG_FEC_NTF,
884 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
885 ETHTOOL_MSG_STATS_GET_REPLY,
886 ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY,
887 ETHTOOL_MSG_MODULE_GET_REPLY,
888 ETHTOOL_MSG_MODULE_NTF,
889 ETHTOOL_MSG_PSE_GET_REPLY,
890 ETHTOOL_MSG_RSS_GET_REPLY,
891 ETHTOOL_MSG_PLCA_GET_CFG_REPLY,
892 ETHTOOL_MSG_PLCA_GET_STATUS_REPLY,
893 ETHTOOL_MSG_PLCA_NTF,
894 ETHTOOL_MSG_MM_GET_REPLY,
895 ETHTOOL_MSG_MM_NTF,
896 ETHTOOL_MSG_MODULE_FW_FLASH_NTF,
897 ETHTOOL_MSG_PHY_GET_REPLY,
898 ETHTOOL_MSG_PHY_NTF,
899 ETHTOOL_MSG_TSCONFIG_GET_REPLY,
900 ETHTOOL_MSG_TSCONFIG_SET_REPLY,
901 ETHTOOL_MSG_PSE_NTF,
902 ETHTOOL_MSG_RSS_NTF,
903 ETHTOOL_MSG_RSS_CREATE_ACT_REPLY,
904 ETHTOOL_MSG_RSS_CREATE_NTF,
905 ETHTOOL_MSG_RSS_DELETE_NTF,
906
907 __ETHTOOL_MSG_KERNEL_CNT,
908 ETHTOOL_MSG_KERNEL_MAX = (__ETHTOOL_MSG_KERNEL_CNT - 1)
909};
910
911#define ETHTOOL_MCGRP_MONITOR_NAME "monitor"
912
913#endif /* _LINUX_ETHTOOL_NETLINK_GENERATED_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/f2fs.h+7
......@@ -44,6 +44,7 @@
4444#define F2FS_IOC_COMPRESS_FILE _IO(F2FS_IOCTL_MAGIC, 24)
4545#define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25)
4646#define F2FS_IOC_GET_DEV_ALIAS_FILE _IOR(F2FS_IOCTL_MAGIC, 26, __u32)
47#define F2FS_IOC_IO_PRIO _IOW(F2FS_IOCTL_MAGIC, 27, __u32)
4748
4849/*
4950 * should be same as XFS_IOC_GOINGDOWN.
......@@ -63,6 +64,12 @@
6364#define F2FS_TRIM_FILE_ZEROOUT 0x2 /* zero out */
6465#define F2FS_TRIM_FILE_MASK 0x3
6566
67/* for F2FS_IOC_IO_PRIO */
68enum {
69 F2FS_IOPRIO_WRITE = 1, /* high write priority */
70 F2FS_IOPRIO_MAX,
71};
72
6673struct f2fs_gc_range {
6774 __u32 sync;
6875 __u64 start;
lib/libc/include/any-linux-any/linux/falloc.h+17
......@@ -78,4 +78,21 @@
7878 */
7979#define FALLOC_FL_UNSHARE_RANGE 0x40
8080
81/*
82 * FALLOC_FL_WRITE_ZEROES zeroes a specified file range in such a way that
83 * subsequent writes to that range do not require further changes to the file
84 * mapping metadata. This flag is beneficial for subsequent pure overwriting
85 * within this range, as it can save on block allocation and, consequently,
86 * significant metadata changes. Therefore, filesystems that always require
87 * out-of-place writes should not support this flag.
88 *
89 * Different filesystems may implement different limitations on the
90 * granularity of the zeroing operation. Most will preferably be accelerated
91 * by submitting write zeroes command if the backing storage supports, which
92 * may not physically write zeros to the media.
93 *
94 * This flag cannot be specified in conjunction with the FALLOC_FL_KEEP_SIZE.
95 */
96#define FALLOC_FL_WRITE_ZEROES 0x80
97
8198#endif /* _FALLOC_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fanotify.h+28
......@@ -25,6 +25,11 @@
2525#define FAN_OPEN_PERM 0x00010000 /* File open in perm check */
2626#define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */
2727#define FAN_OPEN_EXEC_PERM 0x00040000 /* File open/exec in perm check */
28/* #define FAN_DIR_MODIFY 0x00080000 */ /* Deprecated (reserved) */
29
30#define FAN_PRE_ACCESS 0x00100000 /* Pre-content access hook */
31#define FAN_MNT_ATTACH 0x01000000 /* Mount was attached */
32#define FAN_MNT_DETACH 0x02000000 /* Mount was detached */
2833
2934#define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */
3035
......@@ -61,6 +66,7 @@
6166#define FAN_REPORT_NAME 0x00000800 /* Report events with name */
6267#define FAN_REPORT_TARGET_FID 0x00001000 /* Report dirent target id */
6368#define FAN_REPORT_FD_ERROR 0x00002000 /* event->fd can report error */
69#define FAN_REPORT_MNT 0x00004000 /* Report mount events */
6470
6571/* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */
6672#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)
......@@ -91,6 +97,7 @@
9197#define FAN_MARK_INODE 0x00000000
9298#define FAN_MARK_MOUNT 0x00000010
9399#define FAN_MARK_FILESYSTEM 0x00000100
100#define FAN_MARK_MNTNS 0x00000110
94101
95102/*
96103 * Convenience macro - FAN_MARK_IGNORE requires FAN_MARK_IGNORED_SURV_MODIFY
......@@ -143,6 +150,8 @@ struct fanotify_event_metadata {
143150#define FAN_EVENT_INFO_TYPE_DFID 3
144151#define FAN_EVENT_INFO_TYPE_PIDFD 4
145152#define FAN_EVENT_INFO_TYPE_ERROR 5
153#define FAN_EVENT_INFO_TYPE_RANGE 6
154#define FAN_EVENT_INFO_TYPE_MNT 7
146155
147156/* Special info types for FAN_RENAME */
148157#define FAN_EVENT_INFO_TYPE_OLD_DFID_NAME 10
......@@ -189,6 +198,18 @@ struct fanotify_event_info_error {
189198 __u32 error_count;
190199};
191200
201struct fanotify_event_info_range {
202 struct fanotify_event_info_header hdr;
203 __u32 pad;
204 __u64 offset;
205 __u64 count;
206};
207
208struct fanotify_event_info_mnt {
209 struct fanotify_event_info_header hdr;
210 __u64 mnt_id;
211};
212
192213/*
193214 * User space may need to record additional information about its decision.
194215 * The extra information type records what kind of information is included.
......@@ -224,6 +245,13 @@ struct fanotify_response_info_audit_rule {
224245/* Legit userspace responses to a _PERM event */
225246#define FAN_ALLOW 0x01
226247#define FAN_DENY 0x02
248/* errno other than EPERM can specified in upper byte of deny response */
249#define FAN_ERRNO_BITS 8
250#define FAN_ERRNO_SHIFT (32 - FAN_ERRNO_BITS)
251#define FAN_ERRNO_MASK ((1 << FAN_ERRNO_BITS) - 1)
252#define FAN_DENY_ERRNO(err) \
253 (FAN_DENY | ((((__u32)(err)) & FAN_ERRNO_MASK) << FAN_ERRNO_SHIFT))
254
227255#define FAN_AUDIT 0x10 /* Bitmask to create audit record for result */
228256#define FAN_INFO 0x20 /* Bitmask to indicate additional information */
229257
lib/libc/include/any-linux-any/linux/fcntl.h+22
......@@ -90,10 +90,28 @@
9090#define DN_ATTRIB 0x00000020 /* File changed attibutes */
9191#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
9292
93/* Reserved kernel ranges [-100], [-10000, -40000]. */
9394#define AT_FDCWD -100 /* Special value for dirfd used to
9495 indicate openat should use the
9596 current working directory. */
9697
98/*
99 * The concept of process and threads in userland and the kernel is a confusing
100 * one - within the kernel every thread is a 'task' with its own individual PID,
101 * however from userland's point of view threads are grouped by a single PID,
102 * which is that of the 'thread group leader', typically the first thread
103 * spawned.
104 *
105 * To cut the Gideon knot, for internal kernel usage, we refer to
106 * PIDFD_SELF_THREAD to refer to the current thread (or task from a kernel
107 * perspective), and PIDFD_SELF_THREAD_GROUP to refer to the current thread
108 * group leader...
109 */
110#define PIDFD_SELF_THREAD -10000 /* Current thread. */
111#define PIDFD_SELF_THREAD_GROUP -10001 /* Current thread group leader. */
112
113#define FD_PIDFS_ROOT -10002 /* Root of the pidfs filesystem */
114#define FD_INVALID -10009 /* Invalid file descriptor: -10000 - EBADF = -10009 */
97115
98116/* Generic flags for the *at(2) family of syscalls. */
99117
......@@ -155,4 +173,8 @@
155173#define AT_HANDLE_MNT_ID_UNIQUE 0x001 /* Return the u64 unique mount ID. */
156174#define AT_HANDLE_CONNECTABLE 0x002 /* Request a connectable file handle */
157175
176/* Flags for execveat2(2). */
177#define AT_EXECVE_CHECK 0x10000 /* Only perform a check if execution
178 would be allowed. */
179
158180#endif /* _LINUX_FCNTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/fib_rules.h+5
......@@ -68,6 +68,11 @@ enum {
6868 FRA_SPORT_RANGE, /* sport */
6969 FRA_DPORT_RANGE, /* dport */
7070 FRA_DSCP, /* dscp */
71 FRA_FLOWLABEL, /* flowlabel */
72 FRA_FLOWLABEL_MASK, /* flowlabel mask */
73 FRA_SPORT_MASK, /* sport mask */
74 FRA_DPORT_MASK, /* dport mask */
75 FRA_DSCP_MASK, /* dscp mask */
7176 __FRA_MAX
7277};
7378
lib/libc/include/any-linux-any/linux/fiemap.h+33-14
......@@ -14,37 +14,56 @@
1414
1515#include <linux/types.h>
1616
17/**
18 * struct fiemap_extent - description of one fiemap extent
19 * @fe_logical: byte offset of the extent in the file
20 * @fe_physical: byte offset of extent on disk
21 * @fe_length: length in bytes for this extent
22 * @fe_flags: FIEMAP_EXTENT_* flags for this extent
23 */
1724struct fiemap_extent {
18 __u64 fe_logical; /* logical offset in bytes for the start of
19 * the extent from the beginning of the file */
20 __u64 fe_physical; /* physical offset in bytes for the start
21 * of the extent from the beginning of the disk */
22 __u64 fe_length; /* length in bytes for this extent */
25 __u64 fe_logical;
26 __u64 fe_physical;
27 __u64 fe_length;
28 /* private: */
2329 __u64 fe_reserved64[2];
24 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
30 /* public: */
31 __u32 fe_flags;
32 /* private: */
2533 __u32 fe_reserved[3];
2634};
2735
36/**
37 * struct fiemap - file extent mappings
38 * @fm_start: byte offset (inclusive) at which to start mapping (in)
39 * @fm_length: logical length of mapping which userspace wants (in)
40 * @fm_flags: FIEMAP_FLAG_* flags for request (in/out)
41 * @fm_mapped_extents: number of extents that were mapped (out)
42 * @fm_extent_count: size of fm_extents array (in)
43 * @fm_extents: array of mapped extents (out)
44 */
2845struct fiemap {
29 __u64 fm_start; /* logical offset (inclusive) at
30 * which to start mapping (in) */
31 __u64 fm_length; /* logical length of mapping which
32 * userspace wants (in) */
33 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
34 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
35 __u32 fm_extent_count; /* size of fm_extents array (in) */
46 __u64 fm_start;
47 __u64 fm_length;
48 __u32 fm_flags;
49 __u32 fm_mapped_extents;
50 __u32 fm_extent_count;
51 /* private: */
3652 __u32 fm_reserved;
37 struct fiemap_extent fm_extents[]; /* array of mapped extents (out) */
53 /* public: */
54 struct fiemap_extent fm_extents[];
3855};
3956
4057#define FIEMAP_MAX_OFFSET (~0ULL)
4158
59/* flags used in fm_flags: */
4260#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
4361#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
4462#define FIEMAP_FLAG_CACHE 0x00000004 /* request caching of the extents */
4563
4664#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
4765
66/* flags used in fe_flags: */
4867#define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */
4968#define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */
5069#define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending.
lib/libc/include/any-linux-any/linux/firewire-cdev.h+2-1
......@@ -449,7 +449,8 @@ struct fw_cdev_event_phy_packet {
449449 * which the packet arrived. For %FW_CDEV_EVENT_PHY_PACKET_SENT2 and non-ping packet,
450450 * the time stamp of isochronous cycle at which the packet was sent. For ping packet,
451451 * the tick count for round-trip time measured by 1394 OHCI controller.
452 * The time stamp of isochronous cycle at which either the response was sent for
452 *
453 * The time stamp of isochronous cycle at which either the response was sent for
453454 * %FW_CDEV_EVENT_PHY_PACKET_SENT2 or the request arrived for
454455 * %FW_CDEV_EVENT_PHY_PACKET_RECEIVED2.
455456 * @data: Incoming data
lib/libc/include/any-linux-any/linux/fs.h+105-5
......@@ -36,6 +36,15 @@
3636#define BLOCK_SIZE_BITS 10
3737#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
3838
39/* flags for integrity meta */
40#define IO_INTEGRITY_CHK_GUARD (1U << 0) /* enforce guard check */
41#define IO_INTEGRITY_CHK_REFTAG (1U << 1) /* enforce ref check */
42#define IO_INTEGRITY_CHK_APPTAG (1U << 2) /* enforce app check */
43
44#define IO_INTEGRITY_VALID_FLAGS (IO_INTEGRITY_CHK_GUARD | \
45 IO_INTEGRITY_CHK_REFTAG | \
46 IO_INTEGRITY_CHK_APPTAG)
47
3948#define SEEK_SET 0 /* seek relative to beginning of file */
4049#define SEEK_CUR 1 /* seek relative to current file position */
4150#define SEEK_END 2 /* seek relative to end of file */
......@@ -47,6 +56,17 @@
4756#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
4857#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */
4958
59/*
60 * The root inode of procfs is guaranteed to always have the same inode number.
61 * For programs that make heavy use of procfs, verifying that the root is a
62 * real procfs root and using openat2(RESOLVE_{NO_{XDEV,MAGICLINKS},BENEATH})
63 * will allow you to make sure you are never tricked into operating on the
64 * wrong procfs file.
65 */
66enum procfs_ino {
67 PROCFS_ROOT_INO = 1,
68};
69
5070struct file_clone_range {
5171 __s64 src_fd;
5272 __u64 src_offset;
......@@ -78,6 +98,63 @@ struct fs_sysfs_path {
7898 __u8 name[128];
7999};
80100
101/* Protection info capability flags */
102#define LBMD_PI_CAP_INTEGRITY (1 << 0)
103#define LBMD_PI_CAP_REFTAG (1 << 1)
104
105/* Checksum types for Protection Information */
106#define LBMD_PI_CSUM_NONE 0
107#define LBMD_PI_CSUM_IP 1
108#define LBMD_PI_CSUM_CRC16_T10DIF 2
109#define LBMD_PI_CSUM_CRC64_NVME 4
110
111/* sizeof first published struct */
112#define LBMD_SIZE_VER0 16
113
114/*
115 * Logical block metadata capability descriptor
116 * If the device does not support metadata, all the fields will be zero.
117 * Applications must check lbmd_flags to determine whether metadata is
118 * supported or not.
119 */
120struct logical_block_metadata_cap {
121 /* Bitmask of logical block metadata capability flags */
122 __u32 lbmd_flags;
123 /*
124 * The amount of data described by each unit of logical block
125 * metadata
126 */
127 __u16 lbmd_interval;
128 /*
129 * Size in bytes of the logical block metadata associated with each
130 * interval
131 */
132 __u8 lbmd_size;
133 /*
134 * Size in bytes of the opaque block tag associated with each
135 * interval
136 */
137 __u8 lbmd_opaque_size;
138 /*
139 * Offset in bytes of the opaque block tag within the logical block
140 * metadata
141 */
142 __u8 lbmd_opaque_offset;
143 /* Size in bytes of the T10 PI tuple associated with each interval */
144 __u8 lbmd_pi_size;
145 /* Offset in bytes of T10 PI tuple within the logical block metadata */
146 __u8 lbmd_pi_offset;
147 /* T10 PI guard tag type */
148 __u8 lbmd_guard_tag_type;
149 /* Size in bytes of the T10 PI application tag */
150 __u8 lbmd_app_tag_size;
151 /* Size in bytes of the T10 PI reference tag */
152 __u8 lbmd_ref_tag_size;
153 /* Size in bytes of the T10 PI storage tag */
154 __u8 lbmd_storage_tag_size;
155 __u8 pad;
156};
157
81158/* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
82159#define FILE_DEDUPE_RANGE_SAME 0
83160#define FILE_DEDUPE_RANGE_DIFFERS 1
......@@ -135,6 +212,24 @@ struct fsxattr {
135212 unsigned char fsx_pad[8];
136213};
137214
215/*
216 * Variable size structure for file_[sg]et_attr().
217 *
218 * Note. This is alternative to the structure 'struct file_kattr'/'struct fsxattr'.
219 * As this structure is passed to/from userspace with its size, this can
220 * be versioned based on the size.
221 */
222struct file_attr {
223 __u64 fa_xflags; /* xflags field value (get/set) */
224 __u32 fa_extsize; /* extsize field value (get/set)*/
225 __u32 fa_nextents; /* nextents field value (get) */
226 __u32 fa_projid; /* project identifier (get/set) */
227 __u32 fa_cowextsize; /* CoW extsize field value (get/set) */
228};
229
230#define FILE_ATTR_SIZE_VER0 24
231#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER0
232
138233/*
139234 * Flags for the fsx_xflags field
140235 */
......@@ -199,10 +294,8 @@ struct fsxattr {
199294#define BLKROTATIONAL _IO(0x12,126)
200295#define BLKZEROOUT _IO(0x12,127)
201296#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
202/*
203 * A jump here: 130-136 are reserved for zoned block devices
204 * (see uapi/linux/blkzoned.h)
205 */
297/* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
298/* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */
206299
207300#define BMAP_IOCTL 1 /* obsolete - kept for compatibility */
208301#define FIBMAP _IO(0x00,1) /* bmap access */
......@@ -236,6 +329,8 @@ struct fsxattr {
236329 * also /sys/kernel/debug/ for filesystems with debugfs exports
237330 */
238331#define FS_IOC_GETFSSYSFSPATH _IOR(0x15, 1, struct fs_sysfs_path)
332/* Get logical block metadata capability details */
333#define FS_IOC_GETLBMD_CAP _IOWR(0x15, 2, struct logical_block_metadata_cap)
239334
240335/*
241336 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
......@@ -328,9 +423,13 @@ typedef int __bitwise __kernel_rwf_t;
328423/* Atomic Write */
329424#define RWF_ATOMIC ((__kernel_rwf_t)0x00000040)
330425
426/* buffered IO that drops the cache after reading or writing data */
427#define RWF_DONTCACHE ((__kernel_rwf_t)0x00000080)
428
331429/* mask of flags supported by the kernel */
332430#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
333 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC)
431 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC |\
432 RWF_DONTCACHE)
334433
335434#define PROCFS_IOCTL_MAGIC 'f'
336435
......@@ -346,6 +445,7 @@ typedef int __bitwise __kernel_rwf_t;
346445#define PAGE_IS_PFNZERO (1 << 5)
347446#define PAGE_IS_HUGE (1 << 6)
348447#define PAGE_IS_SOFT_DIRTY (1 << 7)
448#define PAGE_IS_GUARD (1 << 8)
349449
350450/*
351451 * struct page_region - Page region with flags
lib/libc/include/any-linux-any/linux/fscrypt.h+4-2
......@@ -119,7 +119,7 @@ struct fscrypt_key_specifier {
119119 */
120120struct fscrypt_provisioning_key_payload {
121121 __u32 type;
122 __u32 __reserved;
122 __u32 flags;
123123 __u8 raw[];
124124};
125125
......@@ -128,7 +128,9 @@ struct fscrypt_add_key_arg {
128128 struct fscrypt_key_specifier key_spec;
129129 __u32 raw_size;
130130 __u32 key_id;
131 __u32 __reserved[8];
131#define FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED 0x00000001
132 __u32 flags;
133 __u32 __reserved[7];
132134 __u8 raw[];
133135};
134136
lib/libc/include/any-linux-any/linux/fuse.h+87-3
......@@ -220,6 +220,21 @@
220220 *
221221 * 7.41
222222 * - add FUSE_ALLOW_IDMAP
223 * 7.42
224 * - Add FUSE_OVER_IO_URING and all other io-uring related flags and data
225 * structures:
226 * - struct fuse_uring_ent_in_out
227 * - struct fuse_uring_req_header
228 * - struct fuse_uring_cmd_req
229 * - FUSE_URING_IN_OUT_HEADER_SZ
230 * - FUSE_URING_OP_IN_OUT_SZ
231 * - enum fuse_uring_cmd
232 *
233 * 7.43
234 * - add FUSE_REQUEST_TIMEOUT
235 *
236 * 7.44
237 * - add FUSE_NOTIFY_INC_EPOCH
223238 */
224239
225240#ifndef _LINUX_FUSE_H
......@@ -251,7 +266,7 @@
251266#define FUSE_KERNEL_VERSION 7
252267
253268/** Minor version number of this interface */
254#define FUSE_KERNEL_MINOR_VERSION 41
269#define FUSE_KERNEL_MINOR_VERSION 44
255270
256271/** The node ID of the root inode */
257272#define FUSE_ROOT_ID 1
......@@ -421,6 +436,9 @@ struct fuse_file_lock {
421436 * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit
422437 * of the request ID indicates resend requests
423438 * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts
439 * FUSE_OVER_IO_URING: Indicate that client supports io-uring
440 * FUSE_REQUEST_TIMEOUT: kernel supports timing out requests.
441 * init_out.request_timeout contains the timeout (in secs)
424442 */
425443#define FUSE_ASYNC_READ (1 << 0)
426444#define FUSE_POSIX_LOCKS (1 << 1)
......@@ -463,10 +481,11 @@ struct fuse_file_lock {
463481#define FUSE_PASSTHROUGH (1ULL << 37)
464482#define FUSE_NO_EXPORT_SUPPORT (1ULL << 38)
465483#define FUSE_HAS_RESEND (1ULL << 39)
466
467484/* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */
468485#define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP
469486#define FUSE_ALLOW_IDMAP (1ULL << 40)
487#define FUSE_OVER_IO_URING (1ULL << 41)
488#define FUSE_REQUEST_TIMEOUT (1ULL << 42)
470489
471490/**
472491 * CUSE INIT request/reply flags
......@@ -651,6 +670,7 @@ enum fuse_notify_code {
651670 FUSE_NOTIFY_RETRIEVE = 5,
652671 FUSE_NOTIFY_DELETE = 6,
653672 FUSE_NOTIFY_RESEND = 7,
673 FUSE_NOTIFY_INC_EPOCH = 8,
654674 FUSE_NOTIFY_CODE_MAX,
655675};
656676
......@@ -894,7 +914,8 @@ struct fuse_init_out {
894914 uint16_t map_alignment;
895915 uint32_t flags2;
896916 uint32_t max_stack_depth;
897 uint32_t unused[6];
917 uint16_t request_timeout;
918 uint16_t unused[11];
898919};
899920
900921#define CUSE_INIT_INFO_MAX 4096
......@@ -1202,4 +1223,67 @@ struct fuse_supp_groups {
12021223 uint32_t groups[];
12031224};
12041225
1226/**
1227 * Size of the ring buffer header
1228 */
1229#define FUSE_URING_IN_OUT_HEADER_SZ 128
1230#define FUSE_URING_OP_IN_OUT_SZ 128
1231
1232/* Used as part of the fuse_uring_req_header */
1233struct fuse_uring_ent_in_out {
1234 uint64_t flags;
1235
1236 /*
1237 * commit ID to be used in a reply to a ring request (see also
1238 * struct fuse_uring_cmd_req)
1239 */
1240 uint64_t commit_id;
1241
1242 /* size of user payload buffer */
1243 uint32_t payload_sz;
1244 uint32_t padding;
1245
1246 uint64_t reserved;
1247};
1248
1249/**
1250 * Header for all fuse-io-uring requests
1251 */
1252struct fuse_uring_req_header {
1253 /* struct fuse_in_header / struct fuse_out_header */
1254 char in_out[FUSE_URING_IN_OUT_HEADER_SZ];
1255
1256 /* per op code header */
1257 char op_in[FUSE_URING_OP_IN_OUT_SZ];
1258
1259 struct fuse_uring_ent_in_out ring_ent_in_out;
1260};
1261
1262/**
1263 * sqe commands to the kernel
1264 */
1265enum fuse_uring_cmd {
1266 FUSE_IO_URING_CMD_INVALID = 0,
1267
1268 /* register the request buffer and fetch a fuse request */
1269 FUSE_IO_URING_CMD_REGISTER = 1,
1270
1271 /* commit fuse request result and fetch next request */
1272 FUSE_IO_URING_CMD_COMMIT_AND_FETCH = 2,
1273};
1274
1275/**
1276 * In the 80B command area of the SQE.
1277 */
1278struct fuse_uring_cmd_req {
1279 uint64_t flags;
1280
1281 /* entry identifier for commits */
1282 uint64_t commit_id;
1283
1284 /* queue the command is for (queue index) */
1285 uint16_t qid;
1286 uint8_t padding[6];
1287};
1288
12051289#endif /* _LINUX_FUSE_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/futex.h+8-1
......@@ -63,7 +63,7 @@
6363#define FUTEX2_SIZE_U32 0x02
6464#define FUTEX2_SIZE_U64 0x03
6565#define FUTEX2_NUMA 0x04
66 /* 0x08 */
66#define FUTEX2_MPOL 0x08
6767 /* 0x10 */
6868 /* 0x20 */
6969 /* 0x40 */
......@@ -74,6 +74,13 @@
7474/* do not use */
7575#define FUTEX_32 FUTEX2_SIZE_U32 /* historical accident :-( */
7676
77/*
78 * When FUTEX2_NUMA doubles the futex word, the second word is a node value.
79 * The special value -1 indicates no-node. This is the same value as
80 * NUMA_NO_NODE, except that value is not ABI, this is.
81 */
82#define FUTEX_NO_NODE (-1)
83
7784/*
7885 * Max numbers of elements in a futex_waitv array
7986 */
lib/libc/include/any-linux-any/linux/handshake.h+1
......@@ -45,6 +45,7 @@ enum {
4545 HANDSHAKE_A_ACCEPT_PEER_IDENTITY,
4646 HANDSHAKE_A_ACCEPT_CERTIFICATE,
4747 HANDSHAKE_A_ACCEPT_PEERNAME,
48 HANDSHAKE_A_ACCEPT_KEYRING,
4849
4950 __HANDSHAKE_A_ACCEPT_MAX,
5051 HANDSHAKE_A_ACCEPT_MAX = (__HANDSHAKE_A_ACCEPT_MAX - 1)
lib/libc/include/any-linux-any/linux/i2c.h+2-1
......@@ -21,7 +21,8 @@
2121 *
2222 * @flags:
2323 * Supported by all adapters:
24 * %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001!
24 * %I2C_M_RD: read data (from slave to master). Guaranteed to be 0x0001! If
25 * not set, the transaction is interpreted as write.
2526 *
2627 * Optional:
2728 * %I2C_M_DMA_SAFE: the buffer of this message is DMA safe. Makes only sense
lib/libc/include/any-linux-any/linux/if_bridge.h+6-4
......@@ -699,10 +699,11 @@ struct br_mdb_entry {
699699#define MDB_TEMPORARY 0
700700#define MDB_PERMANENT 1
701701 __u8 state;
702#define MDB_FLAGS_OFFLOAD (1 << 0)
703#define MDB_FLAGS_FAST_LEAVE (1 << 1)
704#define MDB_FLAGS_STAR_EXCL (1 << 2)
705#define MDB_FLAGS_BLOCKED (1 << 3)
702#define MDB_FLAGS_OFFLOAD (1 << 0)
703#define MDB_FLAGS_FAST_LEAVE (1 << 1)
704#define MDB_FLAGS_STAR_EXCL (1 << 2)
705#define MDB_FLAGS_BLOCKED (1 << 3)
706#define MDB_FLAGS_OFFLOAD_FAILED (1 << 4)
706707 __u8 flags;
707708 __u16 vid;
708709 struct {
......@@ -830,6 +831,7 @@ enum br_boolopt_id {
830831 BR_BOOLOPT_NO_LL_LEARN,
831832 BR_BOOLOPT_MCAST_VLAN_SNOOPING,
832833 BR_BOOLOPT_MST_ENABLE,
834 BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
833835 BR_BOOLOPT_MAX
834836};
835837
lib/libc/include/any-linux-any/linux/if_cablemodem.h deleted-23
......@@ -1,23 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2#ifndef _LINUX_CABLEMODEM_H_
3#define _LINUX_CABLEMODEM_H_
4/*
5 * Author: Franco Venturi <fventuri@mediaone.net>
6 * Copyright 1998 Franco Venturi
7 *
8 * This program is free software; you can redistribute it
9 * and/or modify it under the terms of the GNU General
10 * Public License as published by the Free Software
11 * Foundation; either version 2 of the License, or (at
12 * your option) any later version.
13 */
14
15/* some useful defines for sb1000.c e cmconfig.c - fv */
16#define SIOCGCMSTATS (SIOCDEVPRIVATE+0) /* get cable modem stats */
17#define SIOCGCMFIRMWARE (SIOCDEVPRIVATE+1) /* get cm firmware version */
18#define SIOCGCMFREQUENCY (SIOCDEVPRIVATE+2) /* get cable modem frequency */
19#define SIOCSCMFREQUENCY (SIOCDEVPRIVATE+3) /* set cable modem frequency */
20#define SIOCGCMPIDS (SIOCDEVPRIVATE+4) /* get cable modem PIDs */
21#define SIOCSCMPIDS (SIOCDEVPRIVATE+5) /* set cable modem PIDs */
22
23#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_link.h+27
......@@ -378,6 +378,7 @@ enum {
378378 IFLA_GRO_IPV4_MAX_SIZE,
379379 IFLA_DPLL_PIN,
380380 IFLA_MAX_PACING_OFFLOAD_HORIZON,
381 IFLA_NETNS_IMMUTABLE,
381382 __IFLA_MAX
382383};
383384
......@@ -1313,6 +1314,8 @@ enum {
13131314 IFLA_NETKIT_MODE,
13141315 IFLA_NETKIT_SCRUB,
13151316 IFLA_NETKIT_PEER_SCRUB,
1317 IFLA_NETKIT_HEADROOM,
1318 IFLA_NETKIT_TAILROOM,
13161319 __IFLA_NETKIT_MAX,
13171320};
13181321#define IFLA_NETKIT_MAX (__IFLA_NETKIT_MAX - 1)
......@@ -1392,6 +1395,8 @@ enum {
13921395 IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
13931396 IFLA_VXLAN_LOCALBYPASS,
13941397 IFLA_VXLAN_LABEL_POLICY, /* IPv6 flow label policy; ifla_vxlan_label_policy */
1398 IFLA_VXLAN_RESERVED_BITS,
1399 IFLA_VXLAN_MC_ROUTE,
13951400 __IFLA_VXLAN_MAX
13961401};
13971402#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
......@@ -1433,6 +1438,7 @@ enum {
14331438 IFLA_GENEVE_TTL_INHERIT,
14341439 IFLA_GENEVE_DF,
14351440 IFLA_GENEVE_INNER_PROTO_INHERIT,
1441 IFLA_GENEVE_PORT_RANGE,
14361442 __IFLA_GENEVE_MAX
14371443};
14381444#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
......@@ -1445,6 +1451,11 @@ enum ifla_geneve_df {
14451451 GENEVE_DF_MAX = __GENEVE_DF_END - 1,
14461452};
14471453
1454struct ifla_geneve_port_range {
1455 __be16 low;
1456 __be16 high;
1457};
1458
14481459/* Bareudp section */
14491460enum {
14501461 IFLA_BAREUDP_UNSPEC,
......@@ -1522,6 +1533,7 @@ enum {
15221533 IFLA_BOND_MISSED_MAX,
15231534 IFLA_BOND_NS_IP6_TARGET,
15241535 IFLA_BOND_COUPLED_CONTROL,
1536 IFLA_BOND_BROADCAST_NEIGH,
15251537 __IFLA_BOND_MAX,
15261538};
15271539
......@@ -1974,4 +1986,19 @@ enum {
19741986
19751987#define IFLA_DSA_MAX (__IFLA_DSA_MAX - 1)
19761988
1989/* OVPN section */
1990
1991enum ovpn_mode {
1992 OVPN_MODE_P2P,
1993 OVPN_MODE_MP,
1994};
1995
1996enum {
1997 IFLA_OVPN_UNSPEC,
1998 IFLA_OVPN_MODE,
1999 __IFLA_OVPN_MAX,
2000};
2001
2002#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1)
2003
19772004#endif /* _LINUX_IF_LINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/if_tun.h+9
......@@ -93,6 +93,15 @@
9393#define TUN_F_USO4 0x20 /* I can handle USO for IPv4 packets */
9494#define TUN_F_USO6 0x40 /* I can handle USO for IPv6 packets */
9595
96/* I can handle TSO/USO for UDP tunneled packets */
97#define TUN_F_UDP_TUNNEL_GSO 0x080
98
99/*
100 * I can handle TSO/USO for UDP tunneled packets requiring csum offload for
101 * the outer header
102 */
103#define TUN_F_UDP_TUNNEL_GSO_CSUM 0x100
104
96105/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
97106#define TUN_PKT_STRIP 0x0001
98107struct tun_pi {
lib/libc/include/any-linux-any/linux/if_xdp.h+11
......@@ -79,6 +79,7 @@ struct xdp_mmap_offsets {
7979#define XDP_UMEM_COMPLETION_RING 6
8080#define XDP_STATISTICS 7
8181#define XDP_OPTIONS 8
82#define XDP_MAX_TX_SKB_BUDGET 9
8283
8384struct xdp_umem_reg {
8485 __u64 addr; /* Start of packet data area */
......@@ -127,6 +128,12 @@ struct xdp_options {
127128 */
128129#define XDP_TXMD_FLAGS_CHECKSUM (1 << 1)
129130
131/* Request launch time hardware offload. The device will schedule the packet for
132 * transmission at a pre-determined time called launch time. The value of
133 * launch time is communicated via launch_time field of struct xsk_tx_metadata.
134 */
135#define XDP_TXMD_FLAGS_LAUNCH_TIME (1 << 2)
136
130137/* AF_XDP offloads request. 'request' union member is consumed by the driver
131138 * when the packet is being transmitted. 'completion' union member is
132139 * filled by the driver when the transmit completion arrives.
......@@ -142,6 +149,10 @@ struct xsk_tx_metadata {
142149 __u16 csum_start;
143150 /* Offset from csum_start where checksum should be stored. */
144151 __u16 csum_offset;
152
153 /* XDP_TXMD_FLAGS_LAUNCH_TIME */
154 /* Launch time in nanosecond against the PTP HW Clock */
155 __u64 launch_time;
145156 } request;
146157
147158 struct {
lib/libc/include/any-linux-any/linux/iio/types.h+2
......@@ -119,6 +119,7 @@ enum iio_event_type {
119119 IIO_EV_TYPE_CHANGE,
120120 IIO_EV_TYPE_MAG_REFERENCED,
121121 IIO_EV_TYPE_GESTURE,
122 IIO_EV_TYPE_FAULT,
122123};
123124
124125enum iio_event_direction {
......@@ -128,6 +129,7 @@ enum iio_event_direction {
128129 IIO_EV_DIR_NONE,
129130 IIO_EV_DIR_SINGLETAP,
130131 IIO_EV_DIR_DOUBLETAP,
132 IIO_EV_DIR_FAULT_OPENWIRE,
131133};
132134
133135#endif /* _IIO_TYPES_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/in.h+2
......@@ -79,6 +79,8 @@ enum {
7979#define IPPROTO_MPLS IPPROTO_MPLS
8080 IPPROTO_ETHERNET = 143, /* Ethernet-within-IPv6 Encapsulation */
8181#define IPPROTO_ETHERNET IPPROTO_ETHERNET
82 IPPROTO_AGGFRAG = 144, /* AGGFRAG in ESP (RFC 9347) */
83#define IPPROTO_AGGFRAG IPPROTO_AGGFRAG
8284 IPPROTO_RAW = 255, /* Raw IP packets */
8385#define IPPROTO_RAW IPPROTO_RAW
8486 IPPROTO_SMC = 256, /* Shared Memory Communications */
lib/libc/include/any-linux-any/linux/in6.h+2-2
......@@ -152,7 +152,6 @@ struct in6_flowlabel_req {
152152/*
153153 * IPV6 socket options
154154 */
155#if __UAPI_DEF_IPV6_OPTIONS
156155#define IPV6_ADDRFORM 1
157156#define IPV6_2292PKTINFO 2
158157#define IPV6_2292HOPOPTS 3
......@@ -169,8 +168,10 @@ struct in6_flowlabel_req {
169168#define IPV6_MULTICAST_IF 17
170169#define IPV6_MULTICAST_HOPS 18
171170#define IPV6_MULTICAST_LOOP 19
171#if __UAPI_DEF_IPV6_OPTIONS
172172#define IPV6_ADD_MEMBERSHIP 20
173173#define IPV6_DROP_MEMBERSHIP 21
174#endif
174175#define IPV6_ROUTER_ALERT 22
175176#define IPV6_MTU_DISCOVER 23
176177#define IPV6_MTU 24
......@@ -203,7 +204,6 @@ struct in6_flowlabel_req {
203204#define IPV6_IPSEC_POLICY 34
204205#define IPV6_XFRM_POLICY 35
205206#define IPV6_HDRINCL 36
206#endif
207207
208208/*
209209 * Multicast:
lib/libc/include/any-linux-any/linux/input-event-codes.h+10-1
......@@ -601,6 +601,11 @@
601601#define BTN_DPAD_LEFT 0x222
602602#define BTN_DPAD_RIGHT 0x223
603603
604#define BTN_GRIPL 0x224
605#define BTN_GRIPR 0x225
606#define BTN_GRIPL2 0x226
607#define BTN_GRIPR2 0x227
608
604609#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
605610#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
606611#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
......@@ -765,6 +770,9 @@
765770#define KEY_KBD_LCD_MENU4 0x2bb
766771#define KEY_KBD_LCD_MENU5 0x2bc
767772
773/* Performance Boost key (Alienware)/G-Mode key (Dell) */
774#define KEY_PERFORMANCE 0x2bd
775
768776#define BTN_TRIGGER_HAPPY 0x2c0
769777#define BTN_TRIGGER_HAPPY1 0x2c0
770778#define BTN_TRIGGER_HAPPY2 0x2c1
......@@ -925,7 +933,8 @@
925933#define SW_MUTE_DEVICE 0x0e /* set = device disabled */
926934#define SW_PEN_INSERTED 0x0f /* set = pen inserted */
927935#define SW_MACHINE_COVER 0x10 /* set = cover closed */
928#define SW_MAX 0x10
936#define SW_USB_INSERT 0x11 /* set = USB audio device connected */
937#define SW_MAX 0x11
929938#define SW_CNT (SW_MAX+1)
930939
931940/*
lib/libc/include/any-linux-any/linux/input.h+1
......@@ -273,6 +273,7 @@ struct input_mask {
273273#define BUS_CEC 0x1E
274274#define BUS_INTEL_ISHTP 0x1F
275275#define BUS_AMD_SFH 0x20
276#define BUS_SDW 0x21
276277
277278/*
278279 * MT_TOOL types
lib/libc/include/any-linux-any/linux/io_uring.h+110-3
......@@ -50,7 +50,7 @@ struct io_uring_sqe {
5050 };
5151 __u32 len; /* buffer size or number of iovecs */
5252 union {
53 __kernel_rwf_t rw_flags;
53 __u32 rw_flags;
5454 __u32 fsync_flags;
5555 __u16 poll_events; /* compatibility */
5656 __u32 poll32_events; /* word-reversed for BE */
......@@ -73,6 +73,7 @@ struct io_uring_sqe {
7373 __u32 futex_flags;
7474 __u32 install_fd_flags;
7575 __u32 nop_flags;
76 __u32 pipe_flags;
7677 };
7778 __u64 user_data; /* data to be passed back at completion time */
7879 /* pack this to avoid bogus arm OABI complaints */
......@@ -87,17 +88,26 @@ struct io_uring_sqe {
8788 union {
8889 __s32 splice_fd_in;
8990 __u32 file_index;
91 __u32 zcrx_ifq_idx;
9092 __u32 optlen;
9193 struct {
9294 __u16 addr_len;
9395 __u16 __pad3[1];
9496 };
97 struct {
98 __u8 write_stream;
99 __u8 __pad4[3];
100 };
95101 };
96102 union {
97103 struct {
98104 __u64 addr3;
99105 __u64 __pad2[1];
100106 };
107 struct {
108 __u64 attr_ptr; /* pointer to attribute information */
109 __u64 attr_type_mask; /* bit mask of attributes */
110 };
101111 __u64 optval;
102112 /*
103113 * If the ring is initialized with IORING_SETUP_SQE128, then
......@@ -107,6 +117,18 @@ struct io_uring_sqe {
107117 };
108118};
109119
120/* sqe->attr_type_mask flags */
121#define IORING_RW_ATTR_FLAG_PI (1U << 0)
122/* PI attribute information */
123struct io_uring_attr_pi {
124 __u16 flags;
125 __u16 app_tag;
126 __u32 len;
127 __u64 addr;
128 __u64 seed;
129 __u64 rsvd;
130};
131
110132/*
111133 * If sqe->file_index is set to this for opcodes that instantiate a new
112134 * direct descriptor (like openat/openat2/accept), then io_uring will allocate
......@@ -262,6 +284,11 @@ enum io_uring_op {
262284 IORING_OP_FTRUNCATE,
263285 IORING_OP_BIND,
264286 IORING_OP_LISTEN,
287 IORING_OP_RECV_ZC,
288 IORING_OP_EPOLL_WAIT,
289 IORING_OP_READV_FIXED,
290 IORING_OP_WRITEV_FIXED,
291 IORING_OP_PIPE,
265292
266293 /* this goes last, obviously */
267294 IORING_OP_LAST,
......@@ -364,13 +391,17 @@ enum io_uring_op {
364391 * result will be the number of buffers send, with
365392 * the starting buffer ID in cqe->flags as per
366393 * usual for provided buffer usage. The buffers
367 * will be contigious from the starting buffer ID.
394 * will be contiguous from the starting buffer ID.
395 *
396 * IORING_SEND_VECTORIZED If set, SEND[_ZC] will take a pointer to a io_vec
397 * to allow vectorized send operations.
368398 */
369399#define IORING_RECVSEND_POLL_FIRST (1U << 0)
370400#define IORING_RECV_MULTISHOT (1U << 1)
371401#define IORING_RECVSEND_FIXED_BUF (1U << 2)
372402#define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
373403#define IORING_RECVSEND_BUNDLE (1U << 4)
404#define IORING_SEND_VECTORIZED (1U << 5)
374405
375406/*
376407 * cqe.res for IORING_CQE_F_NOTIF if
......@@ -422,6 +453,7 @@ enum io_uring_msg_ring_flags {
422453#define IORING_NOP_FILE (1U << 1)
423454#define IORING_NOP_FIXED_FILE (1U << 2)
424455#define IORING_NOP_FIXED_BUFFER (1U << 3)
456#define IORING_NOP_TW (1U << 4)
425457
426458/*
427459 * IO completion data structure (Completion Queue Entry)
......@@ -525,6 +557,7 @@ struct io_cqring_offsets {
525557#define IORING_ENTER_REGISTERED_RING (1U << 4)
526558#define IORING_ENTER_ABS_TIMER (1U << 5)
527559#define IORING_ENTER_EXT_ARG_REG (1U << 6)
560#define IORING_ENTER_NO_IOWAIT (1U << 7)
528561
529562/*
530563 * Passed in for io_uring_setup(2). Copied back with updated info on success
......@@ -561,6 +594,8 @@ struct io_uring_params {
561594#define IORING_FEAT_REG_REG_RING (1U << 13)
562595#define IORING_FEAT_RECVSEND_BUNDLE (1U << 14)
563596#define IORING_FEAT_MIN_TIMEOUT (1U << 15)
597#define IORING_FEAT_RW_ATTR (1U << 16)
598#define IORING_FEAT_NO_IOWAIT (1U << 17)
564599
565600/*
566601 * io_uring_register(2) opcodes and arguments
......@@ -622,7 +657,8 @@ enum io_uring_register_op {
622657 /* send MSG_RING without having a ring */
623658 IORING_REGISTER_SEND_MSG_RING = 31,
624659
625 /* 32 reserved for zc rx */
660 /* register a netdev hw rx queue for zerocopy */
661 IORING_REGISTER_ZCRX_IFQ = 32,
626662
627663 /* resize CQ ring */
628664 IORING_REGISTER_RESIZE_RINGS = 33,
......@@ -937,6 +973,77 @@ enum io_uring_socket_op {
937973 SOCKET_URING_OP_SIOCOUTQ,
938974 SOCKET_URING_OP_GETSOCKOPT,
939975 SOCKET_URING_OP_SETSOCKOPT,
976 SOCKET_URING_OP_TX_TIMESTAMP,
977};
978
979/*
980 * SOCKET_URING_OP_TX_TIMESTAMP definitions
981 */
982
983#define IORING_TIMESTAMP_HW_SHIFT 16
984/* The cqe->flags bit from which the timestamp type is stored */
985#define IORING_TIMESTAMP_TYPE_SHIFT (IORING_TIMESTAMP_HW_SHIFT + 1)
986/* The cqe->flags flag signifying whether it's a hardware timestamp */
987#define IORING_CQE_F_TSTAMP_HW ((__u32)1 << IORING_TIMESTAMP_HW_SHIFT)
988
989struct io_timespec {
990 __u64 tv_sec;
991 __u64 tv_nsec;
992};
993
994/* Zero copy receive refill queue entry */
995struct io_uring_zcrx_rqe {
996 __u64 off;
997 __u32 len;
998 __u32 __pad;
999};
1000
1001struct io_uring_zcrx_cqe {
1002 __u64 off;
1003 __u64 __pad;
1004};
1005
1006/* The bit from which area id is encoded into offsets */
1007#define IORING_ZCRX_AREA_SHIFT 48
1008#define IORING_ZCRX_AREA_MASK (~(((__u64)1 << IORING_ZCRX_AREA_SHIFT) - 1))
1009
1010struct io_uring_zcrx_offsets {
1011 __u32 head;
1012 __u32 tail;
1013 __u32 rqes;
1014 __u32 __resv2;
1015 __u64 __resv[2];
1016};
1017
1018enum io_uring_zcrx_area_flags {
1019 IORING_ZCRX_AREA_DMABUF = 1,
1020};
1021
1022struct io_uring_zcrx_area_reg {
1023 __u64 addr;
1024 __u64 len;
1025 __u64 rq_area_token;
1026 __u32 flags;
1027 __u32 dmabuf_fd;
1028 __u64 __resv2[2];
1029};
1030
1031/*
1032 * Argument for IORING_REGISTER_ZCRX_IFQ
1033 */
1034struct io_uring_zcrx_ifq_reg {
1035 __u32 if_idx;
1036 __u32 if_rxq;
1037 __u32 rq_entries;
1038 __u32 flags;
1039
1040 __u64 area_ptr; /* pointer to struct io_uring_zcrx_area_reg */
1041 __u64 region_ptr; /* struct io_uring_region_desc * */
1042
1043 struct io_uring_zcrx_offsets offsets;
1044 __u32 zcrx_id;
1045 __u32 __resv2;
1046 __u64 __resv[3];
9401047};
9411048
9421049#ifdef __cplusplus
lib/libc/include/any-linux-any/linux/io_uring/mock_file.h created+47
......@@ -0,0 +1,47 @@
1#ifndef LINUX_IO_URING_MOCK_FILE_H
2#define LINUX_IO_URING_MOCK_FILE_H
3
4#include <linux/types.h>
5
6enum {
7 IORING_MOCK_FEAT_CMD_COPY,
8 IORING_MOCK_FEAT_RW_ZERO,
9 IORING_MOCK_FEAT_RW_NOWAIT,
10 IORING_MOCK_FEAT_RW_ASYNC,
11 IORING_MOCK_FEAT_POLL,
12
13 IORING_MOCK_FEAT_END,
14};
15
16struct io_uring_mock_probe {
17 __u64 features;
18 __u64 __resv[9];
19};
20
21enum {
22 IORING_MOCK_CREATE_F_SUPPORT_NOWAIT = 1,
23 IORING_MOCK_CREATE_F_POLL = 2,
24};
25
26struct io_uring_mock_create {
27 __u32 out_fd;
28 __u32 flags;
29 __u64 file_size;
30 __u64 rw_delay_ns;
31 __u64 __resv[13];
32};
33
34enum {
35 IORING_MOCK_MGR_CMD_PROBE,
36 IORING_MOCK_MGR_CMD_CREATE,
37};
38
39enum {
40 IORING_MOCK_CMD_COPY_REGBUF,
41};
42
43enum {
44 IORING_MOCK_COPY_FROM = 1,
45};
46
47#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/iommufd.h+279-4
......@@ -55,6 +55,8 @@ enum {
5555 IOMMUFD_CMD_VIOMMU_ALLOC = 0x90,
5656 IOMMUFD_CMD_VDEVICE_ALLOC = 0x91,
5757 IOMMUFD_CMD_IOAS_CHANGE_PROCESS = 0x92,
58 IOMMUFD_CMD_VEVENTQ_ALLOC = 0x93,
59 IOMMUFD_CMD_HW_QUEUE_ALLOC = 0x94,
5860};
5961
6062/**
......@@ -392,6 +394,9 @@ struct iommu_vfio_ioas {
392394 * Any domain attached to the non-PASID part of the
393395 * device must also be flagged, otherwise attaching a
394396 * PASID will blocked.
397 * For the user that wants to attach PASID, ioas is
398 * not recommended for both the non-PASID part
399 * and PASID part of the device.
395400 * If IOMMU does not support PASID it will return
396401 * error (-EOPNOTSUPP).
397402 */
......@@ -586,17 +591,44 @@ struct iommu_hw_info_arm_smmuv3 {
586591 __u32 aidr;
587592};
588593
594/**
595 * struct iommu_hw_info_tegra241_cmdqv - NVIDIA Tegra241 CMDQV Hardware
596 * Information (IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV)
597 *
598 * @flags: Must be 0
599 * @version: Version number for the CMDQ-V HW for PARAM bits[03:00]
600 * @log2vcmdqs: Log2 of the total number of VCMDQs for PARAM bits[07:04]
601 * @log2vsids: Log2 of the total number of SID replacements for PARAM bits[15:12]
602 * @__reserved: Must be 0
603 *
604 * VMM can use these fields directly in its emulated global PARAM register. Note
605 * that only one Virtual Interface (VINTF) should be exposed to a VM, i.e. PARAM
606 * bits[11:08] should be set to 0 for log2 of the total number of VINTFs.
607 */
608struct iommu_hw_info_tegra241_cmdqv {
609 __u32 flags;
610 __u8 version;
611 __u8 log2vcmdqs;
612 __u8 log2vsids;
613 __u8 __reserved;
614};
615
589616/**
590617 * enum iommu_hw_info_type - IOMMU Hardware Info Types
591 * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware
618 * @IOMMU_HW_INFO_TYPE_NONE: Output by the drivers that do not report hardware
592619 * info
620 * @IOMMU_HW_INFO_TYPE_DEFAULT: Input to request for a default type
593621 * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type
594622 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
623 * @IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV (extension for ARM
624 * SMMUv3) info type
595625 */
596626enum iommu_hw_info_type {
597627 IOMMU_HW_INFO_TYPE_NONE = 0,
628 IOMMU_HW_INFO_TYPE_DEFAULT = 0,
598629 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
599630 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
631 IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV = 3,
600632};
601633
602634/**
......@@ -608,9 +640,26 @@ enum iommu_hw_info_type {
608640 * IOMMU_HWPT_GET_DIRTY_BITMAP
609641 * IOMMU_HWPT_SET_DIRTY_TRACKING
610642 *
643 * @IOMMU_HW_CAP_PCI_PASID_EXEC: Execute Permission Supported, user ignores it
644 * when the struct
645 * iommu_hw_info::out_max_pasid_log2 is zero.
646 * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it
647 * when the struct
648 * iommu_hw_info::out_max_pasid_log2 is zero.
611649 */
612650enum iommufd_hw_capabilities {
613651 IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0,
652 IOMMU_HW_CAP_PCI_PASID_EXEC = 1 << 1,
653 IOMMU_HW_CAP_PCI_PASID_PRIV = 1 << 2,
654};
655
656/**
657 * enum iommufd_hw_info_flags - Flags for iommu_hw_info
658 * @IOMMU_HW_INFO_FLAG_INPUT_TYPE: If set, @in_data_type carries an input type
659 * for user space to request for a specific info
660 */
661enum iommufd_hw_info_flags {
662 IOMMU_HW_INFO_FLAG_INPUT_TYPE = 1 << 0,
614663};
615664
616665/**
......@@ -622,10 +671,19 @@ enum iommufd_hw_capabilities {
622671 * data that kernel supports
623672 * @data_uptr: User pointer to a user-space buffer used by the kernel to fill
624673 * the iommu type specific hardware information data
674 * @in_data_type: This shares the same field with @out_data_type, making it be
675 * a bidirectional field. When IOMMU_HW_INFO_FLAG_INPUT_TYPE is
676 * set, an input type carried via this @in_data_type field will
677 * be valid, requesting for the info data to the given type. If
678 * IOMMU_HW_INFO_FLAG_INPUT_TYPE is unset, any input value will
679 * be seen as IOMMU_HW_INFO_TYPE_DEFAULT
625680 * @out_data_type: Output the iommu hardware info type as defined in the enum
626681 * iommu_hw_info_type.
627682 * @out_capabilities: Output the generic iommu capability info type as defined
628683 * in the enum iommu_hw_capabilities.
684 * @out_max_pasid_log2: Output the width of PASIDs. 0 means no PASID support.
685 * PCI devices turn to out_capabilities to check if the
686 * specific capabilities is supported or not.
629687 * @__reserved: Must be 0
630688 *
631689 * Query an iommu type specific hardware information data from an iommu behind
......@@ -648,8 +706,12 @@ struct iommu_hw_info {
648706 __u32 dev_id;
649707 __u32 data_len;
650708 __aligned_u64 data_uptr;
651 __u32 out_data_type;
652 __u32 __reserved;
709 union {
710 __u32 in_data_type;
711 __u32 out_data_type;
712 };
713 __u8 out_max_pasid_log2;
714 __u8 __reserved[3];
653715 __aligned_u64 out_capabilities;
654716};
655717#define IOMMU_GET_HW_INFO _IO(IOMMUFD_TYPE, IOMMUFD_CMD_GET_HW_INFO)
......@@ -935,10 +997,29 @@ struct iommu_fault_alloc {
935997 * enum iommu_viommu_type - Virtual IOMMU Type
936998 * @IOMMU_VIOMMU_TYPE_DEFAULT: Reserved for future use
937999 * @IOMMU_VIOMMU_TYPE_ARM_SMMUV3: ARM SMMUv3 driver specific type
1000 * @IOMMU_VIOMMU_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV (extension for ARM
1001 * SMMUv3) enabled ARM SMMUv3 type
9381002 */
9391003enum iommu_viommu_type {
9401004 IOMMU_VIOMMU_TYPE_DEFAULT = 0,
9411005 IOMMU_VIOMMU_TYPE_ARM_SMMUV3 = 1,
1006 IOMMU_VIOMMU_TYPE_TEGRA241_CMDQV = 2,
1007};
1008
1009/**
1010 * struct iommu_viommu_tegra241_cmdqv - NVIDIA Tegra241 CMDQV Virtual Interface
1011 * (IOMMU_VIOMMU_TYPE_TEGRA241_CMDQV)
1012 * @out_vintf_mmap_offset: mmap offset argument for VINTF's page0
1013 * @out_vintf_mmap_length: mmap length argument for VINTF's page0
1014 *
1015 * Both @out_vintf_mmap_offset and @out_vintf_mmap_length are reported by kernel
1016 * for user space to mmap the VINTF page0 from the host physical address space
1017 * to the guest physical address space so that a guest kernel can directly R/W
1018 * access to the VINTF page0 in order to control its virtual command queues.
1019 */
1020struct iommu_viommu_tegra241_cmdqv {
1021 __aligned_u64 out_vintf_mmap_offset;
1022 __aligned_u64 out_vintf_mmap_length;
9421023};
9431024
9441025/**
......@@ -949,6 +1030,9 @@ enum iommu_viommu_type {
9491030 * @dev_id: The device's physical IOMMU will be used to back the virtual IOMMU
9501031 * @hwpt_id: ID of a nesting parent HWPT to associate to
9511032 * @out_viommu_id: Output virtual IOMMU ID for the allocated object
1033 * @data_len: Length of the type specific data
1034 * @__reserved: Must be 0
1035 * @data_uptr: User pointer to a driver-specific virtual IOMMU data
9521036 *
9531037 * Allocate a virtual IOMMU object, representing the underlying physical IOMMU's
9541038 * virtualization support that is a security-isolated slice of the real IOMMU HW
......@@ -969,6 +1053,9 @@ struct iommu_viommu_alloc {
9691053 __u32 dev_id;
9701054 __u32 hwpt_id;
9711055 __u32 out_viommu_id;
1056 __u32 data_len;
1057 __u32 __reserved;
1058 __aligned_u64 data_uptr;
9721059};
9731060#define IOMMU_VIOMMU_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_ALLOC)
9741061
......@@ -979,10 +1066,15 @@ struct iommu_viommu_alloc {
9791066 * @dev_id: The physical device to allocate a virtual instance on the vIOMMU
9801067 * @out_vdevice_id: Object handle for the vDevice. Pass to IOMMU_DESTORY
9811068 * @virt_id: Virtual device ID per vIOMMU, e.g. vSID of ARM SMMUv3, vDeviceID
982 * of AMD IOMMU, and vRID of a nested Intel VT-d to a Context Table
1069 * of AMD IOMMU, and vRID of Intel VT-d
9831070 *
9841071 * Allocate a virtual device instance (for a physical device) against a vIOMMU.
9851072 * This instance holds the device's information (related to its vIOMMU) in a VM.
1073 * User should use IOMMU_DESTROY to destroy the virtual device before
1074 * destroying the physical device (by closing vfio_cdev fd). Otherwise the
1075 * virtual device would be forcibly destroyed on physical device destruction,
1076 * its vdevice_id would be permanently leaked (unremovable & unreusable) until
1077 * iommu fd closed.
9861078 */
9871079struct iommu_vdevice_alloc {
9881080 __u32 size;
......@@ -1014,4 +1106,187 @@ struct iommu_ioas_change_process {
10141106#define IOMMU_IOAS_CHANGE_PROCESS \
10151107 _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_CHANGE_PROCESS)
10161108
1109/**
1110 * enum iommu_veventq_flag - flag for struct iommufd_vevent_header
1111 * @IOMMU_VEVENTQ_FLAG_LOST_EVENTS: vEVENTQ has lost vEVENTs
1112 */
1113enum iommu_veventq_flag {
1114 IOMMU_VEVENTQ_FLAG_LOST_EVENTS = (1U << 0),
1115};
1116
1117/**
1118 * struct iommufd_vevent_header - Virtual Event Header for a vEVENTQ Status
1119 * @flags: Combination of enum iommu_veventq_flag
1120 * @sequence: The sequence index of a vEVENT in the vEVENTQ, with a range of
1121 * [0, INT_MAX] where the following index of INT_MAX is 0
1122 *
1123 * Each iommufd_vevent_header reports a sequence index of the following vEVENT:
1124 *
1125 * +----------------------+-------+----------------------+-------+---+-------+
1126 * | header0 {sequence=0} | data0 | header1 {sequence=1} | data1 |...| dataN |
1127 * +----------------------+-------+----------------------+-------+---+-------+
1128 *
1129 * And this sequence index is expected to be monotonic to the sequence index of
1130 * the previous vEVENT. If two adjacent sequence indexes has a delta larger than
1131 * 1, it means that delta - 1 number of vEVENTs has lost, e.g. two lost vEVENTs:
1132 *
1133 * +-----+----------------------+-------+----------------------+-------+-----+
1134 * | ... | header3 {sequence=3} | data3 | header6 {sequence=6} | data6 | ... |
1135 * +-----+----------------------+-------+----------------------+-------+-----+
1136 *
1137 * If a vEVENT lost at the tail of the vEVENTQ and there is no following vEVENT
1138 * providing the next sequence index, an IOMMU_VEVENTQ_FLAG_LOST_EVENTS header
1139 * would be added to the tail, and no data would follow this header:
1140 *
1141 * +--+----------------------+-------+-----------------------------------------+
1142 * |..| header3 {sequence=3} | data3 | header4 {flags=LOST_EVENTS, sequence=4} |
1143 * +--+----------------------+-------+-----------------------------------------+
1144 */
1145struct iommufd_vevent_header {
1146 __u32 flags;
1147 __u32 sequence;
1148};
1149
1150/**
1151 * enum iommu_veventq_type - Virtual Event Queue Type
1152 * @IOMMU_VEVENTQ_TYPE_DEFAULT: Reserved for future use
1153 * @IOMMU_VEVENTQ_TYPE_ARM_SMMUV3: ARM SMMUv3 Virtual Event Queue
1154 * @IOMMU_VEVENTQ_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV Extension IRQ
1155 */
1156enum iommu_veventq_type {
1157 IOMMU_VEVENTQ_TYPE_DEFAULT = 0,
1158 IOMMU_VEVENTQ_TYPE_ARM_SMMUV3 = 1,
1159 IOMMU_VEVENTQ_TYPE_TEGRA241_CMDQV = 2,
1160};
1161
1162/**
1163 * struct iommu_vevent_arm_smmuv3 - ARM SMMUv3 Virtual Event
1164 * (IOMMU_VEVENTQ_TYPE_ARM_SMMUV3)
1165 * @evt: 256-bit ARM SMMUv3 Event record, little-endian.
1166 * Reported event records: (Refer to "7.3 Event records" in SMMUv3 HW Spec)
1167 * - 0x04 C_BAD_STE
1168 * - 0x06 F_STREAM_DISABLED
1169 * - 0x08 C_BAD_SUBSTREAMID
1170 * - 0x0a C_BAD_CD
1171 * - 0x10 F_TRANSLATION
1172 * - 0x11 F_ADDR_SIZE
1173 * - 0x12 F_ACCESS
1174 * - 0x13 F_PERMISSION
1175 *
1176 * StreamID field reports a virtual device ID. To receive a virtual event for a
1177 * device, a vDEVICE must be allocated via IOMMU_VDEVICE_ALLOC.
1178 */
1179struct iommu_vevent_arm_smmuv3 {
1180 __aligned_le64 evt[4];
1181};
1182
1183/**
1184 * struct iommu_vevent_tegra241_cmdqv - Tegra241 CMDQV IRQ
1185 * (IOMMU_VEVENTQ_TYPE_TEGRA241_CMDQV)
1186 * @lvcmdq_err_map: 128-bit logical vcmdq error map, little-endian.
1187 * (Refer to register LVCMDQ_ERR_MAPs per VINTF )
1188 *
1189 * The 128-bit register value from HW exclusively reflect the error bits for a
1190 * Virtual Interface represented by a vIOMMU object. Read and report directly.
1191 */
1192struct iommu_vevent_tegra241_cmdqv {
1193 __aligned_le64 lvcmdq_err_map[2];
1194};
1195
1196/**
1197 * struct iommu_veventq_alloc - ioctl(IOMMU_VEVENTQ_ALLOC)
1198 * @size: sizeof(struct iommu_veventq_alloc)
1199 * @flags: Must be 0
1200 * @viommu_id: virtual IOMMU ID to associate the vEVENTQ with
1201 * @type: Type of the vEVENTQ. Must be defined in enum iommu_veventq_type
1202 * @veventq_depth: Maximum number of events in the vEVENTQ
1203 * @out_veventq_id: The ID of the new vEVENTQ
1204 * @out_veventq_fd: The fd of the new vEVENTQ. User space must close the
1205 * successfully returned fd after using it
1206 * @__reserved: Must be 0
1207 *
1208 * Explicitly allocate a virtual event queue interface for a vIOMMU. A vIOMMU
1209 * can have multiple FDs for different types, but is confined to one per @type.
1210 * User space should open the @out_veventq_fd to read vEVENTs out of a vEVENTQ,
1211 * if there are vEVENTs available. A vEVENTQ will lose events due to overflow,
1212 * if the number of the vEVENTs hits @veventq_depth.
1213 *
1214 * Each vEVENT in a vEVENTQ encloses a struct iommufd_vevent_header followed by
1215 * a type-specific data structure, in a normal case:
1216 *
1217 * +-+---------+-------+---------+-------+-----+---------+-------+-+
1218 * | | header0 | data0 | header1 | data1 | ... | headerN | dataN | |
1219 * +-+---------+-------+---------+-------+-----+---------+-------+-+
1220 *
1221 * unless a tailing IOMMU_VEVENTQ_FLAG_LOST_EVENTS header is logged (refer to
1222 * struct iommufd_vevent_header).
1223 */
1224struct iommu_veventq_alloc {
1225 __u32 size;
1226 __u32 flags;
1227 __u32 viommu_id;
1228 __u32 type;
1229 __u32 veventq_depth;
1230 __u32 out_veventq_id;
1231 __u32 out_veventq_fd;
1232 __u32 __reserved;
1233};
1234#define IOMMU_VEVENTQ_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VEVENTQ_ALLOC)
1235
1236/**
1237 * enum iommu_hw_queue_type - HW Queue Type
1238 * @IOMMU_HW_QUEUE_TYPE_DEFAULT: Reserved for future use
1239 * @IOMMU_HW_QUEUE_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV (extension for ARM
1240 * SMMUv3) Virtual Command Queue (VCMDQ)
1241 */
1242enum iommu_hw_queue_type {
1243 IOMMU_HW_QUEUE_TYPE_DEFAULT = 0,
1244 /*
1245 * TEGRA241_CMDQV requirements (otherwise, allocation will fail)
1246 * - alloc starts from the lowest @index=0 in ascending order
1247 * - destroy starts from the last allocated @index in descending order
1248 * - @base_addr must be aligned to @length in bytes and mapped in IOAS
1249 * - @length must be a power of 2, with a minimum 32 bytes and a maximum
1250 * 2 ^ idr[1].CMDQS * 16 bytes (use GET_HW_INFO call to read idr[1]
1251 * from struct iommu_hw_info_arm_smmuv3)
1252 * - suggest to back the queue memory with contiguous physical pages or
1253 * a single huge page with alignment of the queue size, and limit the
1254 * emulated vSMMU's IDR1.CMDQS to log2(huge page size / 16 bytes)
1255 */
1256 IOMMU_HW_QUEUE_TYPE_TEGRA241_CMDQV = 1,
1257};
1258
1259/**
1260 * struct iommu_hw_queue_alloc - ioctl(IOMMU_HW_QUEUE_ALLOC)
1261 * @size: sizeof(struct iommu_hw_queue_alloc)
1262 * @flags: Must be 0
1263 * @viommu_id: Virtual IOMMU ID to associate the HW queue with
1264 * @type: One of enum iommu_hw_queue_type
1265 * @index: The logical index to the HW queue per virtual IOMMU for a multi-queue
1266 * model
1267 * @out_hw_queue_id: The ID of the new HW queue
1268 * @nesting_parent_iova: Base address of the queue memory in the guest physical
1269 * address space
1270 * @length: Length of the queue memory
1271 *
1272 * Allocate a HW queue object for a vIOMMU-specific HW-accelerated queue, which
1273 * allows HW to access a guest queue memory described using @nesting_parent_iova
1274 * and @length.
1275 *
1276 * A vIOMMU can allocate multiple queues, but it must use a different @index per
1277 * type to separate each allocation, e.g::
1278 *
1279 * Type1 HW queue0, Type1 HW queue1, Type2 HW queue0, ...
1280 */
1281struct iommu_hw_queue_alloc {
1282 __u32 size;
1283 __u32 flags;
1284 __u32 viommu_id;
1285 __u32 type;
1286 __u32 index;
1287 __u32 out_hw_queue_id;
1288 __aligned_u64 nesting_parent_iova;
1289 __aligned_u64 length;
1290};
1291#define IOMMU_HW_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HW_QUEUE_ALLOC)
10171292#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ip.h+16
......@@ -137,6 +137,22 @@ struct ip_beet_phdr {
137137 __u8 reserved;
138138};
139139
140struct ip_iptfs_hdr {
141 __u8 subtype; /* 0*: basic, 1: CC */
142 __u8 flags;
143 __be16 block_offset;
144};
145
146struct ip_iptfs_cc_hdr {
147 __u8 subtype; /* 0: basic, 1*: CC */
148 __u8 flags;
149 __be16 block_offset;
150 __be32 loss_rate;
151 __be64 rtt_adelay_xdelay;
152 __be32 tval;
153 __be32 techo;
154};
155
140156/* index values for the variables in ipv4_devconf */
141157enum
142158{
lib/libc/include/any-linux-any/linux/ipsec.h+2-1
......@@ -14,7 +14,8 @@ enum {
1414 IPSEC_MODE_ANY = 0, /* We do not support this for SA */
1515 IPSEC_MODE_TRANSPORT = 1,
1616 IPSEC_MODE_TUNNEL = 2,
17 IPSEC_MODE_BEET = 3
17 IPSEC_MODE_BEET = 3,
18 IPSEC_MODE_IPTFS = 4
1819};
1920
2021enum {
lib/libc/include/any-linux-any/linux/ipv6.h+1
......@@ -199,6 +199,7 @@ enum {
199199 DEVCONF_NDISC_EVICT_NOCARRIER,
200200 DEVCONF_ACCEPT_UNTRACKED_NA,
201201 DEVCONF_ACCEPT_RA_MIN_LFT,
202 DEVCONF_FORCE_FORWARDING,
202203 DEVCONF_MAX
203204};
204205
lib/libc/include/any-linux-any/linux/isst_if.h+26
......@@ -375,6 +375,30 @@ struct isst_perf_level_data_info {
375375 __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
376376};
377377
378#define MAX_FABRIC_COUNT 8
379
380/**
381 * struct isst_perf_level_fabric_info - Structure to get SST-PP fabric details
382 * @socket_id: Socket/package id
383 * @power_domain_id: Power Domain id
384 * @level: SST-PP level for which caller wants to get information
385 * @max_fabrics: Count of fabrics in resonse
386 * @p0_fabric_freq_mhz: Fabric (Uncore) maximum frequency
387 * @p1_fabric_freq_mhz: Fabric (Uncore) TDP frequency
388 * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency
389 *
390 * Structure used to get information on frequencies for fabrics.
391 */
392struct isst_perf_level_fabric_info {
393 __u8 socket_id;
394 __u8 power_domain_id;
395 __u16 level;
396 __u16 max_fabrics;
397 __u16 p0_fabric_freq_mhz[MAX_FABRIC_COUNT];
398 __u16 p1_fabric_freq_mhz[MAX_FABRIC_COUNT];
399 __u16 pm_fabric_freq_mhz[MAX_FABRIC_COUNT];
400};
401
378402/**
379403 * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask
380404 * @socket_id: Socket/package id
......@@ -471,5 +495,7 @@ struct isst_turbo_freq_info {
471495#define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *)
472496#define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *)
473497#define ISST_IF_GET_TURBO_FREQ_INFO _IOR(ISST_IF_MAGIC, 16, struct isst_turbo_freq_info *)
498#define ISST_IF_GET_PERF_LEVEL_FABRIC_INFO _IOR(ISST_IF_MAGIC, 17,\
499 struct isst_perf_level_fabric_info *)
474500
475501#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/kexec.h+1
......@@ -27,6 +27,7 @@
2727#define KEXEC_FILE_ON_CRASH 0x00000002
2828#define KEXEC_FILE_NO_INITRAMFS 0x00000004
2929#define KEXEC_FILE_DEBUG 0x00000008
30#define KEXEC_FILE_NO_CMA 0x00000010
3031
3132/* These values match the ELF architecture values.
3233 * Unless there is a good reason that should continue to be the case.
lib/libc/include/any-linux-any/linux/kfd_ioctl.h+13-2
......@@ -43,9 +43,10 @@
4343 * - 1.15 - Enable managing mappings in compute VMs with GEM_VA ioctl
4444 * - 1.16 - Add contiguous VRAM allocation flag
4545 * - 1.17 - Add SDMA queue creation with target SDMA engine ID
46 * - 1.18 - Rename pad in set_memory_policy_args to misc_process_flag
4647 */
4748#define KFD_IOCTL_MAJOR_VERSION 1
48#define KFD_IOCTL_MINOR_VERSION 17
49#define KFD_IOCTL_MINOR_VERSION 18
4950
5051struct kfd_ioctl_get_version_args {
5152 __u32 major_version; /* from KFD */
......@@ -62,6 +63,8 @@ struct kfd_ioctl_get_version_args {
6263#define KFD_MAX_QUEUE_PERCENTAGE 100
6364#define KFD_MAX_QUEUE_PRIORITY 15
6465
66#define KFD_MIN_QUEUE_RING_SIZE 1024
67
6568struct kfd_ioctl_create_queue_args {
6669 __u64 ring_base_address; /* to KFD */
6770 __u64 write_pointer_address; /* from KFD */
......@@ -148,6 +151,9 @@ struct kfd_dbg_device_info_entry {
148151#define KFD_IOC_CACHE_POLICY_COHERENT 0
149152#define KFD_IOC_CACHE_POLICY_NONCOHERENT 1
150153
154/* Misc. per process flags */
155#define KFD_PROC_FLAG_MFMA_HIGH_PRECISION (1 << 0)
156
151157struct kfd_ioctl_set_memory_policy_args {
152158 __u64 alternate_aperture_base; /* to KFD */
153159 __u64 alternate_aperture_size; /* to KFD */
......@@ -155,7 +161,7 @@ struct kfd_ioctl_set_memory_policy_args {
155161 __u32 gpu_id; /* to KFD */
156162 __u32 default_policy; /* to KFD */
157163 __u32 alternate_policy; /* to KFD */
158 __u32 pad;
164 __u32 misc_process_flag; /* to KFD */
159165};
160166
161167/*
......@@ -530,6 +536,8 @@ enum kfd_smi_event {
530536 KFD_SMI_EVENT_QUEUE_EVICTION = 9,
531537 KFD_SMI_EVENT_QUEUE_RESTORE = 10,
532538 KFD_SMI_EVENT_UNMAP_FROM_GPU = 11,
539 KFD_SMI_EVENT_PROCESS_START = 12,
540 KFD_SMI_EVENT_PROCESS_END = 13,
533541
534542 /*
535543 * max event number, as a flag bit to get events from all processes,
......@@ -645,6 +653,9 @@ struct kfd_ioctl_smi_events_args {
645653 "%lld -%d @%lx(%lx) %x %d\n", (ns), (pid), (addr), (size),\
646654 (node), (unmap_trigger)
647655
656#define KFD_EVENT_FMT_PROCESS(pid, task_name)\
657 "%x %s\n", (pid), (task_name)
658
648659/**************************************************************************************************
649660 * CRIU IOCTLs (Checkpoint Restore In Userspace)
650661 *
lib/libc/include/any-linux-any/linux/kfd_sysfs.h+3
......@@ -63,6 +63,9 @@
6363#define HSA_CAP_PER_QUEUE_RESET_SUPPORTED 0x80000000
6464#define HSA_CAP_RESERVED 0x000f8000
6565
66#define HSA_CAP2_PER_SDMA_QUEUE_RESET_SUPPORTED 0x00000001
67#define HSA_CAP2_RESERVED 0xfffffffe
68
6669/* debug_prop bits in node properties */
6770#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f
6871#define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_SHIFT 0
lib/libc/include/any-linux-any/linux/kvm.h+37-4
......@@ -178,6 +178,7 @@ struct kvm_xen_exit {
178178#define KVM_EXIT_NOTIFY 37
179179#define KVM_EXIT_LOONGARCH_IOCSR 38
180180#define KVM_EXIT_MEMORY_FAULT 39
181#define KVM_EXIT_TDX 40
181182
182183/* For KVM_EXIT_INTERNAL_ERROR */
183184/* Emulate instruction failed. */
......@@ -369,6 +370,7 @@ struct kvm_run {
369370#define KVM_SYSTEM_EVENT_WAKEUP 4
370371#define KVM_SYSTEM_EVENT_SUSPEND 5
371372#define KVM_SYSTEM_EVENT_SEV_TERM 6
373#define KVM_SYSTEM_EVENT_TDX_FATAL 7
372374 __u32 type;
373375 __u32 ndata;
374376 union {
......@@ -438,6 +440,31 @@ struct kvm_run {
438440 __u64 gpa;
439441 __u64 size;
440442 } memory_fault;
443 /* KVM_EXIT_TDX */
444 struct {
445 __u64 flags;
446 __u64 nr;
447 union {
448 struct {
449 __u64 ret;
450 __u64 data[5];
451 } unknown;
452 struct {
453 __u64 ret;
454 __u64 gpa;
455 __u64 size;
456 } get_quote;
457 struct {
458 __u64 ret;
459 __u64 leaf;
460 __u64 r11, r12, r13, r14;
461 } get_tdvmcall_info;
462 struct {
463 __u64 ret;
464 __u64 vector;
465 } setup_event_notify;
466 };
467 } tdx;
441468 /* Fix the size of the union. */
442469 char padding[256];
443470 };
......@@ -609,10 +636,7 @@ struct kvm_ioeventfd {
609636#define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
610637#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
611638#define KVM_X86_DISABLE_EXITS_CSTATE (1 << 3)
612#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
613 KVM_X86_DISABLE_EXITS_HLT | \
614 KVM_X86_DISABLE_EXITS_PAUSE | \
615 KVM_X86_DISABLE_EXITS_CSTATE)
639#define KVM_X86_DISABLE_EXITS_APERFMPERF (1 << 4)
616640
617641/* for KVM_ENABLE_CAP */
618642struct kvm_enable_cap {
......@@ -925,6 +949,11 @@ struct kvm_enable_cap {
925949#define KVM_CAP_PRE_FAULT_MEMORY 236
926950#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237
927951#define KVM_CAP_X86_GUEST_MODE 238
952#define KVM_CAP_ARM_WRITABLE_IMP_ID_REGS 239
953#define KVM_CAP_ARM_EL2 240
954#define KVM_CAP_ARM_EL2_E2H0 241
955#define KVM_CAP_RISCV_MP_STATE_RESET 242
956#define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243
928957
929958struct kvm_irq_routing_irqchip {
930959 __u32 irqchip;
......@@ -1062,6 +1091,10 @@ struct kvm_dirty_tlb {
10621091
10631092#define KVM_REG_SIZE_SHIFT 52
10641093#define KVM_REG_SIZE_MASK 0x00f0000000000000ULL
1094
1095#define KVM_REG_SIZE(id) \
1096 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
1097
10651098#define KVM_REG_SIZE_U8 0x0000000000000000ULL
10661099#define KVM_REG_SIZE_U16 0x0010000000000000ULL
10671100#define KVM_REG_SIZE_U32 0x0020000000000000ULL
lib/libc/include/any-linux-any/linux/landlock.h+72-6
......@@ -4,6 +4,7 @@
44 *
55 * Copyright © 2017-2020 Mickaël Salaün <mic@digikod.net>
66 * Copyright © 2018-2020 ANSSI
7 * Copyright © 2021-2025 Microsoft Corporation
78 */
89
910#ifndef _LINUX_LANDLOCK_H
......@@ -52,14 +53,75 @@ struct landlock_ruleset_attr {
5253 __u64 scoped;
5354};
5455
55/*
56 * sys_landlock_create_ruleset() flags:
56/**
57 * DOC: landlock_create_ruleset_flags
58 *
59 * **Flags**
5760 *
58 * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI
59 * version.
61 * %LANDLOCK_CREATE_RULESET_VERSION
62 * Get the highest supported Landlock ABI version (starting at 1).
63 *
64 * %LANDLOCK_CREATE_RULESET_ERRATA
65 * Get a bitmask of fixed issues for the current Landlock ABI version.
6066 */
6167/* clang-format off */
6268#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
69#define LANDLOCK_CREATE_RULESET_ERRATA (1U << 1)
70/* clang-format on */
71
72/**
73 * DOC: landlock_restrict_self_flags
74 *
75 * **Flags**
76 *
77 * By default, denied accesses originating from programs that sandbox themselves
78 * are logged via the audit subsystem. Such events typically indicate unexpected
79 * behavior, such as bugs or exploitation attempts. However, to avoid excessive
80 * logging, access requests denied by a domain not created by the originating
81 * program are not logged by default. The rationale is that programs should know
82 * their own behavior, but not necessarily the behavior of other programs. This
83 * default configuration is suitable for most programs that sandbox themselves.
84 * For specific use cases, the following flags allow programs to modify this
85 * default logging behavior.
86 *
87 * The %LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF and
88 * %LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON flags apply to the newly created
89 * Landlock domain.
90 *
91 * %LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF
92 * Disables logging of denied accesses originating from the thread creating
93 * the Landlock domain, as well as its children, as long as they continue
94 * running the same executable code (i.e., without an intervening
95 * :manpage:`execve(2)` call). This is intended for programs that execute
96 * unknown code without invoking :manpage:`execve(2)`, such as script
97 * interpreters. Programs that only sandbox themselves should not set this
98 * flag, so users can be notified of unauthorized access attempts via system
99 * logs.
100 *
101 * %LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON
102 * Enables logging of denied accesses after an :manpage:`execve(2)` call,
103 * providing visibility into unauthorized access attempts by newly executed
104 * programs within the created Landlock domain. This flag is recommended
105 * only when all potential executables in the domain are expected to comply
106 * with the access restrictions, as excessive audit log entries could make
107 * it more difficult to identify critical events.
108 *
109 * %LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF
110 * Disables logging of denied accesses originating from nested Landlock
111 * domains created by the caller or its descendants. This flag should be set
112 * according to runtime configuration, not hardcoded, to avoid suppressing
113 * important security events. It is useful for container runtimes or
114 * sandboxing tools that may launch programs which themselves create
115 * Landlock domains and could otherwise generate excessive logs. Unlike
116 * ``LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF``, this flag only affects
117 * future nested domains, not the one being created. It can also be used
118 * with a @ruleset_fd value of -1 to mute subdomain logs without creating a
119 * domain.
120 */
121/* clang-format off */
122#define LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF (1U << 0)
123#define LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON (1U << 1)
124#define LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF (1U << 2)
63125/* clang-format on */
64126
65127/**
......@@ -268,7 +330,9 @@ struct landlock_net_port_attr {
268330 * ~~~~~~~~~~~~~~~~
269331 *
270332 * These flags enable to restrict a sandboxed process to a set of network
271 * actions. This is supported since the Landlock ABI version 4.
333 * actions.
334 *
335 * This is supported since Landlock ABI version 4.
272336 *
273337 * The following access rights apply to TCP port numbers:
274338 *
......@@ -291,11 +355,13 @@ struct landlock_net_port_attr {
291355 * Setting a flag for a ruleset will isolate the Landlock domain to forbid
292356 * connections to resources outside the domain.
293357 *
358 * This is supported since Landlock ABI version 6.
359 *
294360 * Scopes:
295361 *
296362 * - %LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET: Restrict a sandboxed process from
297363 * connecting to an abstract UNIX socket created by a process outside the
298 * related Landlock domain (e.g. a parent domain or a non-sandboxed process).
364 * related Landlock domain (e.g., a parent domain or a non-sandboxed process).
299365 * - %LANDLOCK_SCOPE_SIGNAL: Restrict a sandboxed process from sending a signal
300366 * to another process outside the domain.
301367 */
lib/libc/include/any-linux-any/linux/lockd_netlink.h created+29
......@@ -0,0 +1,29 @@
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/lockd.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_LOCKD_NETLINK_H
7#define _LINUX_LOCKD_NETLINK_H
8
9#define LOCKD_FAMILY_NAME "lockd"
10#define LOCKD_FAMILY_VERSION 1
11
12enum {
13 LOCKD_A_SERVER_GRACETIME = 1,
14 LOCKD_A_SERVER_TCP_PORT,
15 LOCKD_A_SERVER_UDP_PORT,
16
17 __LOCKD_A_SERVER_MAX,
18 LOCKD_A_SERVER_MAX = (__LOCKD_A_SERVER_MAX - 1)
19};
20
21enum {
22 LOCKD_CMD_SERVER_SET = 1,
23 LOCKD_CMD_SERVER_GET,
24
25 __LOCKD_CMD_MAX,
26 LOCKD_CMD_MAX = (__LOCKD_CMD_MAX - 1)
27};
28
29#endif /* _LINUX_LOCKD_NETLINK_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/mctp.h+8
......@@ -37,6 +37,14 @@ struct sockaddr_mctp_ext {
3737 __u8 smctp_haddr[MAX_ADDR_LEN];
3838};
3939
40/* A "fully qualified" MCTP address, which includes the system-local network ID,
41 * required to uniquely resolve a routable EID.
42 */
43struct mctp_fq_addr {
44 unsigned int net;
45 mctp_eid_t eid;
46};
47
4048#define MCTP_NET_ANY 0x0
4149
4250#define MCTP_ADDR_NULL 0x00
lib/libc/include/any-linux-any/linux/mdio.h+1
......@@ -125,6 +125,7 @@
125125#define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */
126126#define MDIO_STAT1_LSTATUS BMSR_LSTATUS
127127#define MDIO_STAT1_FAULT 0x0080 /* Fault */
128#define MDIO_PCS_STAT1_CLKSTOP_CAP 0x0040
128129#define MDIO_AN_STAT1_LPABLE 0x0001 /* Link partner AN ability */
129130#define MDIO_AN_STAT1_ABLE BMSR_ANEGCAPABLE
130131#define MDIO_AN_STAT1_RFAULT BMSR_RFAULT
lib/libc/include/any-linux-any/linux/media/amlogic/c3-isp-config.h created+564
......@@ -0,0 +1,564 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2024 Amlogic, Inc. All rights reserved
4 */
5
6#ifndef _C3_ISP_CONFIG_H_
7#define _C3_ISP_CONFIG_H_
8
9#include <linux/types.h>
10
11/*
12 * Frames are split into zones of almost equal width and height - a zone is a
13 * rectangular tile of a frame. The metering blocks within the ISP collect
14 * aggregated statistics per zone.
15 */
16#define C3_ISP_AE_MAX_ZONES (17 * 15)
17#define C3_ISP_AF_MAX_ZONES (17 * 15)
18#define C3_ISP_AWB_MAX_ZONES (32 * 24)
19
20/* The maximum number of point on the diagonal of the frame for statistics */
21#define C3_ISP_AE_MAX_PT_NUM 18
22#define C3_ISP_AF_MAX_PT_NUM 18
23#define C3_ISP_AWB_MAX_PT_NUM 33
24
25/**
26 * struct c3_isp_awb_zone_stats - AWB statistics of a zone
27 *
28 * AWB zone stats is aligned with 8 bytes
29 *
30 * @rg: the ratio of R / G in a zone
31 * @bg: the ratio of B / G in a zone
32 * @pixel_sum: the total number of pixels used in a zone
33 */
34struct c3_isp_awb_zone_stats {
35 __u16 rg;
36 __u16 bg;
37 __u32 pixel_sum;
38};
39
40/**
41 * struct c3_isp_awb_stats - Auto white balance statistics information.
42 *
43 * AWB statistical information of all zones.
44 *
45 * @stats: array of auto white balance statistics
46 */
47struct c3_isp_awb_stats {
48 struct c3_isp_awb_zone_stats stats[C3_ISP_AWB_MAX_ZONES];
49} __attribute__((aligned(16)));
50
51/**
52 * struct c3_isp_ae_zone_stats - AE statistics of a zone
53 *
54 * AE zone stats is aligned with 8 bytes.
55 * This is a 5-bin histogram and the total sum is normalized to 0xffff.
56 * So hist2 = 0xffff - (hist0 + hist1 + hist3 + hist4)
57 *
58 * @hist0: the global normalized pixel count for bin 0
59 * @hist1: the global normalized pixel count for bin 1
60 * @hist3: the global normalized pixel count for bin 3
61 * @hist4: the global normalized pixel count for bin 4
62 */
63struct c3_isp_ae_zone_stats {
64 __u16 hist0;
65 __u16 hist1;
66 __u16 hist3;
67 __u16 hist4;
68};
69
70/**
71 * struct c3_isp_ae_stats - Exposure statistics information
72 *
73 * AE statistical information consists of all blocks information and a 1024-bin
74 * histogram.
75 *
76 * @stats: array of auto exposure block statistics
77 * @reserved: undefined buffer space
78 * @hist: a 1024-bin histogram for the entire image
79 */
80struct c3_isp_ae_stats {
81 struct c3_isp_ae_zone_stats stats[C3_ISP_AE_MAX_ZONES];
82 __u32 reserved[2];
83 __u32 hist[1024];
84} __attribute__((aligned(16)));
85
86/**
87 * struct c3_isp_af_zone_stats - AF statistics of a zone
88 *
89 * AF zone stats is aligned with 8 bytes.
90 * The zonal accumulated contrast metrics are stored in floating point format
91 * with 16 bits mantissa and 5 or 6 bits exponent. Apart from contrast metrics
92 * we accumulate squared image and quartic image data over the zone.
93 *
94 * @i2_mat: the mantissa of zonal squared image pixel sum
95 * @i4_mat: the mantissa of zonal quartic image pixel sum
96 * @e4_mat: the mantissa of zonal multi-directional quartic edge sum
97 * @e4_exp: the exponent of zonal multi-directional quartic edge sum
98 * @i2_exp: the exponent of zonal squared image pixel sum
99 * @i4_exp: the exponent of zonal quartic image pixel sum
100 */
101struct c3_isp_af_zone_stats {
102 __u16 i2_mat;
103 __u16 i4_mat;
104 __u16 e4_mat;
105 __u16 e4_exp : 5;
106 __u16 i2_exp : 5;
107 __u16 i4_exp : 6;
108};
109
110/**
111 * struct c3_isp_af_stats - Auto Focus statistics information
112 *
113 * AF statistical information of each zone
114 *
115 * @stats: array of auto focus block statistics
116 * @reserved: undefined buffer space
117 */
118struct c3_isp_af_stats {
119 struct c3_isp_af_zone_stats stats[C3_ISP_AF_MAX_ZONES];
120 __u32 reserved[2];
121} __attribute__((aligned(16)));
122
123/**
124 * struct c3_isp_stats_info - V4L2_META_FMT_C3ISP_STATS
125 *
126 * Contains ISP statistics
127 *
128 * @awb: auto white balance stats
129 * @ae: auto exposure stats
130 * @af: auto focus stats
131 */
132struct c3_isp_stats_info {
133 struct c3_isp_awb_stats awb;
134 struct c3_isp_ae_stats ae;
135 struct c3_isp_af_stats af;
136};
137
138/**
139 * enum c3_isp_params_buffer_version - C3 ISP parameters block versioning
140 *
141 * @C3_ISP_PARAMS_BUFFER_V0: First version of C3 ISP parameters block
142 */
143enum c3_isp_params_buffer_version {
144 C3_ISP_PARAMS_BUFFER_V0,
145};
146
147/**
148 * enum c3_isp_params_block_type - Enumeration of C3 ISP parameter blocks
149 *
150 * Each block configures a specific processing block of the C3 ISP.
151 * The block type allows the driver to correctly interpret the parameters block
152 * data.
153 *
154 * @C3_ISP_PARAMS_BLOCK_AWB_GAINS: White balance gains
155 * @C3_ISP_PARAMS_BLOCK_AWB_CONFIG: AWB statistic format configuration for all
156 * blocks that control how stats are generated
157 * @C3_ISP_PARAMS_BLOCK_AE_CONFIG: AE statistic format configuration for all
158 * blocks that control how stats are generated
159 * @C3_ISP_PARAMS_BLOCK_AF_CONFIG: AF statistic format configuration for all
160 * blocks that control how stats are generated
161 * @C3_ISP_PARAMS_BLOCK_PST_GAMMA: post gamma parameters
162 * @C3_ISP_PARAMS_BLOCK_CCM: Color correction matrix parameters
163 * @C3_ISP_PARAMS_BLOCK_CSC: Color space conversion parameters
164 * @C3_ISP_PARAMS_BLOCK_BLC: Black level correction parameters
165 * @C3_ISP_PARAMS_BLOCK_SENTINEL: First non-valid block index
166 */
167enum c3_isp_params_block_type {
168 C3_ISP_PARAMS_BLOCK_AWB_GAINS,
169 C3_ISP_PARAMS_BLOCK_AWB_CONFIG,
170 C3_ISP_PARAMS_BLOCK_AE_CONFIG,
171 C3_ISP_PARAMS_BLOCK_AF_CONFIG,
172 C3_ISP_PARAMS_BLOCK_PST_GAMMA,
173 C3_ISP_PARAMS_BLOCK_CCM,
174 C3_ISP_PARAMS_BLOCK_CSC,
175 C3_ISP_PARAMS_BLOCK_BLC,
176 C3_ISP_PARAMS_BLOCK_SENTINEL
177};
178
179#define C3_ISP_PARAMS_BLOCK_FL_DISABLE (1U << 0)
180#define C3_ISP_PARAMS_BLOCK_FL_ENABLE (1U << 1)
181
182/**
183 * struct c3_isp_params_block_header - C3 ISP parameter block header
184 *
185 * This structure represents the common part of all the ISP configuration
186 * blocks. Each parameters block shall embed an instance of this structure type
187 * as its first member, followed by the block-specific configuration data. The
188 * driver inspects this common header to discern the block type and its size and
189 * properly handle the block content by casting it to the correct block-specific
190 * type.
191 *
192 * The @type field is one of the values enumerated by
193 * :c:type:`c3_isp_params_block_type` and specifies how the data should be
194 * interpreted by the driver. The @size field specifies the size of the
195 * parameters block and is used by the driver for validation purposes. The
196 * @flags field is a bitmask of per-block flags C3_ISP_PARAMS_FL*.
197 *
198 * When userspace wants to disable an ISP block the
199 * C3_ISP_PARAMS_BLOCK_FL_DISABLED bit should be set in the @flags field. In
200 * this case userspace may optionally omit the remainder of the configuration
201 * block, which will be ignored by the driver.
202 *
203 * When a new configuration of an ISP block needs to be applied userspace
204 * shall fully populate the ISP block and omit setting the
205 * C3_ISP_PARAMS_BLOCK_FL_DISABLED bit in the @flags field.
206 *
207 * Userspace is responsible for correctly populating the parameters block header
208 * fields (@type, @flags and @size) and the block-specific parameters.
209 *
210 * For example:
211 *
212 * .. code-block:: c
213 *
214 * void populate_pst_gamma(struct c3_isp_params_block_header *block) {
215 * struct c3_isp_params_pst_gamma *gamma =
216 * (struct c3_isp_params_pst_gamma *)block;
217 *
218 * gamma->header.type = C3_ISP_PARAMS_BLOCK_PST_GAMMA;
219 * gamma->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
220 * gamma->header.size = sizeof(*gamma);
221 *
222 * for (unsigned int i = 0; i < 129; i++)
223 * gamma->pst_gamma_lut[i] = i;
224 * }
225 *
226 * @type: The parameters block type from :c:type:`c3_isp_params_block_type`
227 * @flags: A bitmask of block flags
228 * @size: Size (in bytes) of the parameters block, including this header
229 */
230struct c3_isp_params_block_header {
231 __u16 type;
232 __u16 flags;
233 __u32 size;
234};
235
236/**
237 * struct c3_isp_params_awb_gains - Gains for auto-white balance
238 *
239 * This struct allows users to configure the gains for white balance.
240 * There are four gain settings corresponding to each colour channel in
241 * the bayer domain. All of the gains are stored in Q4.8 format.
242 *
243 * header.type should be set to C3_ISP_PARAMS_BLOCK_AWB_GAINS
244 * from :c:type:`c3_isp_params_block_type`
245 *
246 * @header: The C3 ISP parameters block header
247 * @gr_gain: Multiplier for Gr channel (Q4.8 format)
248 * @r_gain: Multiplier for R channel (Q4.8 format)
249 * @b_gain: Multiplier for B channel (Q4.8 format)
250 * @gb_gain: Multiplier for Gb channel (Q4.8 format)
251 */
252struct c3_isp_params_awb_gains {
253 struct c3_isp_params_block_header header;
254 __u16 gr_gain;
255 __u16 r_gain;
256 __u16 b_gain;
257 __u16 gb_gain;
258} __attribute__((aligned(8)));
259
260/**
261 * enum c3_isp_params_awb_tap_points - Tap points for the AWB statistics
262 * @C3_ISP_AWB_STATS_TAP_OFE: immediately after the optical frontend block
263 * @C3_ISP_AWB_STATS_TAP_GE: immediately after the green equal block
264 * @C3_ISP_AWB_STATS_TAP_BEFORE_WB: immediately before the white balance block
265 * @C3_ISP_AWB_STATS_TAP_AFTER_WB: immediately after the white balance block
266 */
267enum c3_isp_params_awb_tap_points {
268 C3_ISP_AWB_STATS_TAP_OFE = 0,
269 C3_ISP_AWB_STATS_TAP_GE,
270 C3_ISP_AWB_STATS_TAP_BEFORE_WB,
271 C3_ISP_AWB_STATS_TAP_AFTER_WB,
272};
273
274/**
275 * struct c3_isp_params_awb_config - Stats settings for auto-white balance
276 *
277 * This struct allows the configuration of the statistics generated for auto
278 * white balance.
279 *
280 * header.type should be set to C3_ISP_PARAMS_BLOCK_AWB_CONFIG
281 * from :c:type:`c3_isp_params_block_type`
282 *
283 * @header: the C3 ISP parameters block header
284 * @tap_point: the tap point from enum c3_isp_params_awb_tap_point
285 * @satur_vald: AWB statistic over saturation control
286 * value: 0: disable, 1: enable
287 * @horiz_zones_num: active number of hotizontal zones [0..32]
288 * @vert_zones_num: active number of vertical zones [0..24]
289 * @rg_min: minimum R/G ratio (Q4.8 format)
290 * @rg_max: maximum R/G ratio (Q4.8 format)
291 * @bg_min: minimum B/G ratio (Q4.8 format)
292 * @bg_max: maximum B/G ratio (Q4.8 format)
293 * @rg_low: R/G ratio trim low (Q4.8 format)
294 * @rg_high: R/G ratio trim hight (Q4.8 format)
295 * @bg_low: B/G ratio trim low (Q4.8 format)
296 * @bg_high: B/G ratio trim high (Q4.8 format)
297 * @zone_weight: array of weights for AWB statistics zones [0..15]
298 * @horiz_coord: the horizontal coordinate of points on the diagonal [0..2888]
299 * @vert_coord: the vertical coordinate of points on the diagonal [0..2240]
300 */
301struct c3_isp_params_awb_config {
302 struct c3_isp_params_block_header header;
303 __u8 tap_point;
304 __u8 satur_vald;
305 __u8 horiz_zones_num;
306 __u8 vert_zones_num;
307 __u16 rg_min;
308 __u16 rg_max;
309 __u16 bg_min;
310 __u16 bg_max;
311 __u16 rg_low;
312 __u16 rg_high;
313 __u16 bg_low;
314 __u16 bg_high;
315 __u8 zone_weight[C3_ISP_AWB_MAX_ZONES];
316 __u16 horiz_coord[C3_ISP_AWB_MAX_PT_NUM];
317 __u16 vert_coord[C3_ISP_AWB_MAX_PT_NUM];
318} __attribute__((aligned(8)));
319
320/**
321 * enum c3_isp_params_ae_tap_points - Tap points for the AE statistics
322 * @C3_ISP_AE_STATS_TAP_GE: immediately after the green equal block
323 * @C3_ISP_AE_STATS_TAP_MLS: immediately after the mesh lens shading block
324 */
325enum c3_isp_params_ae_tap_points {
326 C3_ISP_AE_STATS_TAP_GE = 0,
327 C3_ISP_AE_STATS_TAP_MLS,
328};
329
330/**
331 * struct c3_isp_params_ae_config - Stats settings for auto-exposure
332 *
333 * This struct allows the configuration of the statistics generated for
334 * auto exposure.
335 *
336 * header.type should be set to C3_ISP_PARAMS_BLOCK_AE_CONFIG
337 * from :c:type:`c3_isp_params_block_type`
338 *
339 * @header: the C3 ISP parameters block header
340 * @horiz_zones_num: active number of horizontal zones [0..17]
341 * @vert_zones_num: active number of vertical zones [0..15]
342 * @tap_point: the tap point from enum c3_isp_params_ae_tap_point
343 * @zone_weight: array of weights for AE statistics zones [0..15]
344 * @horiz_coord: the horizontal coordinate of points on the diagonal [0..2888]
345 * @vert_coord: the vertical coordinate of points on the diagonal [0..2240]
346 * @reserved: applications must zero this array
347 */
348struct c3_isp_params_ae_config {
349 struct c3_isp_params_block_header header;
350 __u8 tap_point;
351 __u8 horiz_zones_num;
352 __u8 vert_zones_num;
353 __u8 zone_weight[C3_ISP_AE_MAX_ZONES];
354 __u16 horiz_coord[C3_ISP_AE_MAX_PT_NUM];
355 __u16 vert_coord[C3_ISP_AE_MAX_PT_NUM];
356 __u16 reserved[3];
357} __attribute__((aligned(8)));
358
359/**
360 * enum c3_isp_params_af_tap_points - Tap points for the AF statistics
361 * @C3_ISP_AF_STATS_TAP_SNR: immediately after the spatial noise reduce block
362 * @C3_ISP_AF_STATS_TAP_DMS: immediately after the demosaic block
363 */
364enum c3_isp_params_af_tap_points {
365 C3_ISP_AF_STATS_TAP_SNR = 0,
366 C3_ISP_AF_STATS_TAP_DMS,
367};
368
369/**
370 * struct c3_isp_params_af_config - Stats settings for auto-focus
371 *
372 * This struct allows the configuration of the statistics generated for
373 * auto focus.
374 *
375 * header.type should be set to C3_ISP_PARAMS_BLOCK_AF_CONFIG
376 * from :c:type:`c3_isp_params_block_type`
377 *
378 * @header: the C3 ISP parameters block header
379 * @tap_point: the tap point from enum c3_isp_params_af_tap_point
380 * @horiz_zones_num: active number of hotizontal zones [0..17]
381 * @vert_zones_num: active number of vertical zones [0..15]
382 * @reserved: applications must zero this array
383 * @horiz_coord: the horizontal coordinate of points on the diagonal [0..2888]
384 * @vert_coord: the vertical coordinate of points on the diagonal [0..2240]
385 */
386struct c3_isp_params_af_config {
387 struct c3_isp_params_block_header header;
388 __u8 tap_point;
389 __u8 horiz_zones_num;
390 __u8 vert_zones_num;
391 __u8 reserved[5];
392 __u16 horiz_coord[C3_ISP_AF_MAX_PT_NUM];
393 __u16 vert_coord[C3_ISP_AF_MAX_PT_NUM];
394} __attribute__((aligned(8)));
395
396/**
397 * struct c3_isp_params_pst_gamma - Post gamma configuration
398 *
399 * This struct allows the configuration of the look up table for
400 * post gamma. The gamma curve consists of 129 points, so need to
401 * set lut[129].
402 *
403 * header.type should be set to C3_ISP_PARAMS_BLOCK_PST_GAMMA
404 * from :c:type:`c3_isp_params_block_type`
405 *
406 * @header: the C3 ISP parameters block header
407 * @lut: lookup table for P-Stitch gamma [0..1023]
408 * @reserved: applications must zero this array
409 */
410struct c3_isp_params_pst_gamma {
411 struct c3_isp_params_block_header header;
412 __u16 lut[129];
413 __u16 reserved[3];
414} __attribute__((aligned(8)));
415
416/**
417 * struct c3_isp_params_ccm - ISP CCM configuration
418 *
419 * This struct allows the configuration of the matrix for
420 * color correction. The matrix consists of 3 x 3 points,
421 * so need to set matrix[3][3].
422 *
423 * header.type should be set to C3_ISP_PARAMS_BLOCK_CCM
424 * from :c:type:`c3_isp_params_block_type`
425 *
426 * @header: the C3 ISP parameters block header
427 * @matrix: a 3 x 3 matrix used for color correction,
428 * the value of matrix[x][y] is orig_value x 256. [-4096..4095]
429 * @reserved: applications must zero this array
430 */
431struct c3_isp_params_ccm {
432 struct c3_isp_params_block_header header;
433 __s16 matrix[3][3];
434 __u16 reserved[3];
435} __attribute__((aligned(8)));
436
437/**
438 * struct c3_isp_params_csc - ISP Color Space Conversion configuration
439 *
440 * This struct allows the configuration of the matrix for color space
441 * conversion. The matrix consists of 3 x 3 points, so need to set matrix[3][3].
442 *
443 * header.type should be set to C3_ISP_PARAMS_BLOCK_CSC
444 * from :c:type:`c3_isp_params_block_type`
445 *
446 * @header: the C3 ISP parameters block header
447 * @matrix: a 3x3 matrix used for the color space conversion,
448 * the value of matrix[x][y] is orig_value x 256. [-4096..4095]
449 * @reserved: applications must zero this array
450 */
451struct c3_isp_params_csc {
452 struct c3_isp_params_block_header header;
453 __s16 matrix[3][3];
454 __u16 reserved[3];
455} __attribute__((aligned(8)));
456
457/**
458 * struct c3_isp_params_blc - ISP Black Level Correction configuration
459 *
460 * This struct allows the configuration of the block level offset for each
461 * color channel.
462 *
463 * header.type should be set to C3_ISP_PARAMS_BLOCK_BLC
464 * from :c:type:`c3_isp_params_block_type`
465 *
466 * @header: the C3 ISP parameters block header
467 * @gr_ofst: Gr blc offset (Q4.12 format)
468 * @r_ofst: R blc offset (Q4.12 format)
469 * @b_ofst: B blc offset (Q4.12 format)
470 * @gb_ofst: Gb blc offset(Q4.12 format)
471 */
472struct c3_isp_params_blc {
473 struct c3_isp_params_block_header header;
474 __u16 gr_ofst;
475 __u16 r_ofst;
476 __u16 b_ofst;
477 __u16 gb_ofst;
478};
479
480/**
481 * define C3_ISP_PARAMS_MAX_SIZE - Maximum size of all C3 ISP Parameters
482 *
483 * Though the parameters for the C3 ISP are passed as optional blocks, the
484 * driver still needs to know the absolute maximum size so that it can allocate
485 * a buffer sized appropriately to accommodate userspace attempting to set all
486 * possible parameters in a single frame.
487 */
488#define C3_ISP_PARAMS_MAX_SIZE \
489 (sizeof(struct c3_isp_params_awb_gains) + \
490 sizeof(struct c3_isp_params_awb_config) + \
491 sizeof(struct c3_isp_params_ae_config) + \
492 sizeof(struct c3_isp_params_af_config) + \
493 sizeof(struct c3_isp_params_pst_gamma) + \
494 sizeof(struct c3_isp_params_ccm) + \
495 sizeof(struct c3_isp_params_csc) + \
496 sizeof(struct c3_isp_params_blc))
497
498/**
499 * struct c3_isp_params_cfg - C3 ISP configuration parameters
500 *
501 * This struct contains the configuration parameters of the C3 ISP
502 * algorithms, serialized by userspace into an opaque data buffer. Each
503 * configuration parameter block is represented by a block-specific structure
504 * which contains a :c:type:`c3_isp_param_block_header` entry as first
505 * member. Userspace populates the @data buffer with configuration parameters
506 * for the blocks that it intends to configure. As a consequence, the data
507 * buffer effective size changes according to the number of ISP blocks that
508 * userspace intends to configure.
509 *
510 * The parameters buffer is versioned by the @version field to allow modifying
511 * and extending its definition. Userspace should populate the @version field to
512 * inform the driver about the version it intends to use. The driver will parse
513 * and handle the @data buffer according to the data layout specific to the
514 * indicated revision and return an error if the desired revision is not
515 * supported.
516 *
517 * For each ISP block that userspace wants to configure, a block-specific
518 * structure is appended to the @data buffer, one after the other without gaps
519 * in between nor overlaps. Userspace shall populate the @total_size field with
520 * the effective size, in bytes, of the @data buffer.
521 *
522 * The expected memory layout of the parameters buffer is::
523 *
524 * +-------------------- struct c3_isp_params_cfg ---- ------------------+
525 * | version = C3_ISP_PARAM_BUFFER_V0; |
526 * | data_size = sizeof(struct c3_isp_params_awb_gains) + |
527 * | sizeof(struct c3_isp_params_awb_config); |
528 * | +------------------------- data ---------------------------------+ |
529 * | | +------------ struct c3_isp_params_awb_gains) ------------------+ |
530 * | | | +--------- struct c3_isp_params_block_header header -----+ | | |
531 * | | | | type = C3_ISP_PARAMS_BLOCK_AWB_GAINS; | | | |
532 * | | | | flags = C3_ISP_PARAMS_BLOCK_FL_NONE; | | | |
533 * | | | | size = sizeof(struct c3_isp_params_awb_gains); | | | |
534 * | | | +---------------------------------------------------------+ | | |
535 * | | | gr_gain = ...; | | |
536 * | | | r_gain = ...; | | |
537 * | | | b_gain = ...; | | |
538 * | | | gb_gain = ...; | | |
539 * | | +------------------ struct c3_isp_params_awb_config ----------+ | |
540 * | | | +---------- struct c3_isp_param_block_header header ------+ | | |
541 * | | | | type = C3_ISP_PARAMS_BLOCK_AWB_CONFIG; | | | |
542 * | | | | flags = C3_ISP_PARAMS_BLOCK_FL_NONE; | | | |
543 * | | | | size = sizeof(struct c3_isp_params_awb_config) | | | |
544 * | | | +---------------------------------------------------------+ | | |
545 * | | | tap_point = ...; | | |
546 * | | | satur_vald = ...; | | |
547 * | | | horiz_zones_num = ...; | | |
548 * | | | vert_zones_num = ...; | | |
549 * | | +-------------------------------------------------------------+ | |
550 * | +-----------------------------------------------------------------+ |
551 * +---------------------------------------------------------------------+
552 *
553 * @version: The C3 ISP parameters buffer version
554 * @data_size: The C3 ISP configuration data effective size, excluding this
555 * header
556 * @data: The C3 ISP configuration blocks data
557 */
558struct c3_isp_params_cfg {
559 __u32 version;
560 __u32 data_size;
561 __u8 data[C3_ISP_PARAMS_MAX_SIZE];
562};
563
564#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/media/raspberrypi/pisp_be_config.h+5-4
......@@ -21,10 +21,11 @@
2121/* preferred byte alignment for outputs */
2222#define PISP_BACK_END_OUTPUT_MAX_ALIGN 64u
2323
24/* minimum allowed tile width anywhere in the pipeline */
25#define PISP_BACK_END_MIN_TILE_WIDTH 16u
26/* minimum allowed tile width anywhere in the pipeline */
27#define PISP_BACK_END_MIN_TILE_HEIGHT 16u
24/* minimum allowed tile sizes anywhere in the pipeline */
25#define PISP_BACK_END_MIN_TILE_WIDTH 16u
26#define PISP_BACK_END_MIN_TILE_HEIGHT 16u
27#define PISP_BACK_END_MAX_TILE_WIDTH 65536u
28#define PISP_BACK_END_MAX_TILE_HEIGHT 65536u
2829
2930#define PISP_BACK_END_NUM_OUTPUTS 2
3031#define PISP_BACK_END_HOG_OUTPUT 1
lib/libc/include/any-linux-any/linux/mount.h+9-1
......@@ -179,7 +179,12 @@ struct statmount {
179179 __u32 opt_array; /* [str] Array of nul terminated fs options */
180180 __u32 opt_sec_num; /* Number of security options */
181181 __u32 opt_sec_array; /* [str] Array of nul terminated security options */
182 __u64 __spare2[46];
182 __u64 supported_mask; /* Mask flags that this kernel supports */
183 __u32 mnt_uidmap_num; /* Number of uid mappings */
184 __u32 mnt_uidmap; /* [str] Array of uid mappings (as seen from callers namespace) */
185 __u32 mnt_gidmap_num; /* Number of gid mappings */
186 __u32 mnt_gidmap; /* [str] Array of gid mappings (as seen from callers namespace) */
187 __u64 __spare2[43];
183188 char str[]; /* Variable size part containing strings */
184189};
185190
......@@ -217,6 +222,9 @@ struct mnt_id_req {
217222#define STATMOUNT_SB_SOURCE 0x00000200U /* Want/got sb_source */
218223#define STATMOUNT_OPT_ARRAY 0x00000400U /* Want/got opt_... */
219224#define STATMOUNT_OPT_SEC_ARRAY 0x00000800U /* Want/got opt_sec... */
225#define STATMOUNT_SUPPORTED_MASK 0x00001000U /* Want/got supported mask flags */
226#define STATMOUNT_MNT_UIDMAP 0x00002000U /* Want/got uidmap... */
227#define STATMOUNT_MNT_GIDMAP 0x00004000U /* Want/got gidmap... */
220228
221229/*
222230 * Special @mnt_id values that can be passed to listmount
lib/libc/include/any-linux-any/linux/mptcp.h+2
......@@ -29,6 +29,8 @@
2929#define MPTCP_INFO_FLAG_FALLBACK _BITUL(0)
3030#define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED _BITUL(1)
3131
32#define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 _BITUL(0)
33
3234#define MPTCP_PM_ADDR_FLAG_SIGNAL (1 << 0)
3335#define MPTCP_PM_ADDR_FLAG_SUBFLOW (1 << 1)
3436#define MPTCP_PM_ADDR_FLAG_BACKUP (1 << 2)
lib/libc/include/any-linux-any/linux/mptcp_pm.h+5-5
......@@ -16,10 +16,10 @@
1616 * good time to allocate memory and send ADD_ADDR if needed. Depending on the
1717 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
1818 * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
19 * sport, dport, server-side.
19 * sport, dport, server-side, [flags].
2020 * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new
2121 * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
22 * sport, dport, server-side.
22 * sport, dport, server-side, [flags].
2323 * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.
2424 * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.
2525 * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
......@@ -27,14 +27,14 @@
2727 * token, rem_id.
2828 * @MPTCP_EVENT_SUB_ESTABLISHED: A new subflow has been established. 'error'
2929 * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |
30 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].
30 * saddr6, daddr4 | daddr6, sport, dport, backup, if-idx [, error].
3131 * @MPTCP_EVENT_SUB_CLOSED: A subflow has been closed. An error (copy of
3232 * sk_err) could be set if an error has been detected for this subflow.
3333 * Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
34 * daddr6, sport, dport, backup, if_idx [, error].
34 * daddr6, sport, dport, backup, if-idx [, error].
3535 * @MPTCP_EVENT_SUB_PRIORITY: The priority of a subflow has changed. 'error'
3636 * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |
37 * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].
37 * saddr6, daddr4 | daddr6, sport, dport, backup, if-idx [, error].
3838 * @MPTCP_EVENT_LISTENER_CREATED: A new PM listener is created. Attributes:
3939 * family, sport, saddr4 | saddr6.
4040 * @MPTCP_EVENT_LISTENER_CLOSED: A PM listener is closed. Attributes: family,
lib/libc/include/any-linux-any/linux/mshv.h created+291
......@@ -0,0 +1,291 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Userspace interfaces for /dev/mshv* devices and derived fds
4 *
5 * This file is divided into sections containing data structures and IOCTLs for
6 * a particular set of related devices or derived file descriptors.
7 *
8 * The IOCTL definitions are at the end of each section. They are grouped by
9 * device/fd, so that new IOCTLs can easily be added with a monotonically
10 * increasing number.
11 */
12#ifndef _LINUX_MSHV_H
13#define _LINUX_MSHV_H
14
15#include <linux/types.h>
16
17#define MSHV_IOCTL 0xB8
18
19/*
20 *******************************************
21 * Entry point to main VMM APIs: /dev/mshv *
22 *******************************************
23 */
24
25enum {
26 MSHV_PT_BIT_LAPIC,
27 MSHV_PT_BIT_X2APIC,
28 MSHV_PT_BIT_GPA_SUPER_PAGES,
29 MSHV_PT_BIT_COUNT,
30};
31
32#define MSHV_PT_FLAGS_MASK ((1 << MSHV_PT_BIT_COUNT) - 1)
33
34enum {
35 MSHV_PT_ISOLATION_NONE,
36 MSHV_PT_ISOLATION_COUNT,
37};
38
39/**
40 * struct mshv_create_partition - arguments for MSHV_CREATE_PARTITION
41 * @pt_flags: Bitmask of 1 << MSHV_PT_BIT_*
42 * @pt_isolation: MSHV_PT_ISOLATION_*
43 *
44 * Returns a file descriptor to act as a handle to a guest partition.
45 * At this point the partition is not yet initialized in the hypervisor.
46 * Some operations must be done with the partition in this state, e.g. setting
47 * so-called "early" partition properties. The partition can then be
48 * initialized with MSHV_INITIALIZE_PARTITION.
49 */
50struct mshv_create_partition {
51 __u64 pt_flags;
52 __u64 pt_isolation;
53};
54
55/* /dev/mshv */
56#define MSHV_CREATE_PARTITION _IOW(MSHV_IOCTL, 0x00, struct mshv_create_partition)
57
58/*
59 ************************
60 * Child partition APIs *
61 ************************
62 */
63
64struct mshv_create_vp {
65 __u32 vp_index;
66};
67
68enum {
69 MSHV_SET_MEM_BIT_WRITABLE,
70 MSHV_SET_MEM_BIT_EXECUTABLE,
71 MSHV_SET_MEM_BIT_UNMAP,
72 MSHV_SET_MEM_BIT_COUNT
73};
74
75#define MSHV_SET_MEM_FLAGS_MASK ((1 << MSHV_SET_MEM_BIT_COUNT) - 1)
76
77/* The hypervisor's "native" page size */
78#define MSHV_HV_PAGE_SIZE 0x1000
79
80/**
81 * struct mshv_user_mem_region - arguments for MSHV_SET_GUEST_MEMORY
82 * @size: Size of the memory region (bytes). Must be aligned to
83 * MSHV_HV_PAGE_SIZE
84 * @guest_pfn: Base guest page number to map
85 * @userspace_addr: Base address of userspace memory. Must be aligned to
86 * MSHV_HV_PAGE_SIZE
87 * @flags: Bitmask of 1 << MSHV_SET_MEM_BIT_*. If (1 << MSHV_SET_MEM_BIT_UNMAP)
88 * is set, ignore other bits.
89 * @rsvd: MBZ
90 *
91 * Map or unmap a region of userspace memory to Guest Physical Addresses (GPA).
92 * Mappings can't overlap in GPA space or userspace.
93 * To unmap, these fields must match an existing mapping.
94 */
95struct mshv_user_mem_region {
96 __u64 size;
97 __u64 guest_pfn;
98 __u64 userspace_addr;
99 __u8 flags;
100 __u8 rsvd[7];
101};
102
103enum {
104 MSHV_IRQFD_BIT_DEASSIGN,
105 MSHV_IRQFD_BIT_RESAMPLE,
106 MSHV_IRQFD_BIT_COUNT,
107};
108
109#define MSHV_IRQFD_FLAGS_MASK ((1 << MSHV_IRQFD_BIT_COUNT) - 1)
110
111struct mshv_user_irqfd {
112 __s32 fd;
113 __s32 resamplefd;
114 __u32 gsi;
115 __u32 flags;
116};
117
118enum {
119 MSHV_IOEVENTFD_BIT_DATAMATCH,
120 MSHV_IOEVENTFD_BIT_PIO,
121 MSHV_IOEVENTFD_BIT_DEASSIGN,
122 MSHV_IOEVENTFD_BIT_COUNT,
123};
124
125#define MSHV_IOEVENTFD_FLAGS_MASK ((1 << MSHV_IOEVENTFD_BIT_COUNT) - 1)
126
127struct mshv_user_ioeventfd {
128 __u64 datamatch;
129 __u64 addr; /* legal pio/mmio address */
130 __u32 len; /* 1, 2, 4, or 8 bytes */
131 __s32 fd;
132 __u32 flags;
133 __u8 rsvd[4];
134};
135
136struct mshv_user_irq_entry {
137 __u32 gsi;
138 __u32 address_lo;
139 __u32 address_hi;
140 __u32 data;
141};
142
143struct mshv_user_irq_table {
144 __u32 nr;
145 __u32 rsvd; /* MBZ */
146 struct mshv_user_irq_entry entries[];
147};
148
149enum {
150 MSHV_GPAP_ACCESS_TYPE_ACCESSED,
151 MSHV_GPAP_ACCESS_TYPE_DIRTY,
152 MSHV_GPAP_ACCESS_TYPE_COUNT /* Count of enum members */
153};
154
155enum {
156 MSHV_GPAP_ACCESS_OP_NOOP,
157 MSHV_GPAP_ACCESS_OP_CLEAR,
158 MSHV_GPAP_ACCESS_OP_SET,
159 MSHV_GPAP_ACCESS_OP_COUNT /* Count of enum members */
160};
161
162/**
163 * struct mshv_gpap_access_bitmap - arguments for MSHV_GET_GPAP_ACCESS_BITMAP
164 * @access_type: MSHV_GPAP_ACCESS_TYPE_* - The type of access to record in the
165 * bitmap
166 * @access_op: MSHV_GPAP_ACCESS_OP_* - Allows an optional clear or set of all
167 * the access states in the range, after retrieving the current
168 * states.
169 * @rsvd: MBZ
170 * @page_count: Number of pages
171 * @gpap_base: Base gpa page number
172 * @bitmap_ptr: Output buffer for bitmap, at least (page_count + 7) / 8 bytes
173 *
174 * Retrieve a bitmap of either ACCESSED or DIRTY bits for a given range of guest
175 * memory, and optionally clear or set the bits.
176 */
177struct mshv_gpap_access_bitmap {
178 __u8 access_type;
179 __u8 access_op;
180 __u8 rsvd[6];
181 __u64 page_count;
182 __u64 gpap_base;
183 __u64 bitmap_ptr;
184};
185
186/**
187 * struct mshv_root_hvcall - arguments for MSHV_ROOT_HVCALL
188 * @code: Hypercall code (HVCALL_*)
189 * @reps: in: Rep count ('repcount')
190 * out: Reps completed ('repcomp'). MBZ unless rep hvcall
191 * @in_sz: Size of input incl rep data. <= MSHV_HV_PAGE_SIZE
192 * @out_sz: Size of output buffer. <= MSHV_HV_PAGE_SIZE. MBZ if out_ptr is 0
193 * @status: in: MBZ
194 * out: HV_STATUS_* from hypercall
195 * @rsvd: MBZ
196 * @in_ptr: Input data buffer (struct hv_input_*). If used with partition or
197 * vp fd, partition id field is populated by kernel.
198 * @out_ptr: Output data buffer (optional)
199 */
200struct mshv_root_hvcall {
201 __u16 code;
202 __u16 reps;
203 __u16 in_sz;
204 __u16 out_sz;
205 __u16 status;
206 __u8 rsvd[6];
207 __u64 in_ptr;
208 __u64 out_ptr;
209};
210
211/* Partition fds created with MSHV_CREATE_PARTITION */
212#define MSHV_INITIALIZE_PARTITION _IO(MSHV_IOCTL, 0x00)
213#define MSHV_CREATE_VP _IOW(MSHV_IOCTL, 0x01, struct mshv_create_vp)
214#define MSHV_SET_GUEST_MEMORY _IOW(MSHV_IOCTL, 0x02, struct mshv_user_mem_region)
215#define MSHV_IRQFD _IOW(MSHV_IOCTL, 0x03, struct mshv_user_irqfd)
216#define MSHV_IOEVENTFD _IOW(MSHV_IOCTL, 0x04, struct mshv_user_ioeventfd)
217#define MSHV_SET_MSI_ROUTING _IOW(MSHV_IOCTL, 0x05, struct mshv_user_irq_table)
218#define MSHV_GET_GPAP_ACCESS_BITMAP _IOWR(MSHV_IOCTL, 0x06, struct mshv_gpap_access_bitmap)
219/* Generic hypercall */
220#define MSHV_ROOT_HVCALL _IOWR(MSHV_IOCTL, 0x07, struct mshv_root_hvcall)
221
222/*
223 ********************************
224 * VP APIs for child partitions *
225 ********************************
226 */
227
228#define MSHV_RUN_VP_BUF_SZ 256
229
230/*
231 * VP state pages may be mapped to userspace via mmap().
232 * To specify which state page, use MSHV_VP_MMAP_OFFSET_ values multiplied by
233 * the system page size.
234 * e.g.
235 * long page_size = sysconf(_SC_PAGE_SIZE);
236 * void *reg_page = mmap(NULL, MSHV_HV_PAGE_SIZE, PROT_READ|PROT_WRITE,
237 * MAP_SHARED, vp_fd,
238 * MSHV_VP_MMAP_OFFSET_REGISTERS * page_size);
239 */
240enum {
241 MSHV_VP_MMAP_OFFSET_REGISTERS,
242 MSHV_VP_MMAP_OFFSET_INTERCEPT_MESSAGE,
243 MSHV_VP_MMAP_OFFSET_GHCB,
244 MSHV_VP_MMAP_OFFSET_COUNT
245};
246
247/**
248 * struct mshv_run_vp - argument for MSHV_RUN_VP
249 * @msg_buf: On success, the intercept message is copied here. It can be
250 * interpreted using the relevant hypervisor definitions.
251 */
252struct mshv_run_vp {
253 __u8 msg_buf[MSHV_RUN_VP_BUF_SZ];
254};
255
256enum {
257 MSHV_VP_STATE_LAPIC, /* Local interrupt controller state (either arch) */
258 MSHV_VP_STATE_XSAVE, /* XSAVE data in compacted form (x86_64) */
259 MSHV_VP_STATE_SIMP,
260 MSHV_VP_STATE_SIEFP,
261 MSHV_VP_STATE_SYNTHETIC_TIMERS,
262 MSHV_VP_STATE_COUNT,
263};
264
265/**
266 * struct mshv_get_set_vp_state - arguments for MSHV_[GET,SET]_VP_STATE
267 * @type: MSHV_VP_STATE_*
268 * @rsvd: MBZ
269 * @buf_sz: in: 4k page-aligned size of buffer
270 * out: Actual size of data (on EINVAL, check this to see if buffer
271 * was too small)
272 * @buf_ptr: 4k page-aligned data buffer
273 */
274struct mshv_get_set_vp_state {
275 __u8 type;
276 __u8 rsvd[3];
277 __u32 buf_sz;
278 __u64 buf_ptr;
279};
280
281/* VP fds created with MSHV_CREATE_VP */
282#define MSHV_RUN_VP _IOR(MSHV_IOCTL, 0x00, struct mshv_run_vp)
283#define MSHV_GET_VP_STATE _IOWR(MSHV_IOCTL, 0x01, struct mshv_get_set_vp_state)
284#define MSHV_SET_VP_STATE _IOWR(MSHV_IOCTL, 0x02, struct mshv_get_set_vp_state)
285/*
286 * Generic hypercall
287 * Defined above in partition IOCTLs, avoid redefining it here
288 * #define MSHV_ROOT_HVCALL _IOWR(MSHV_IOCTL, 0x07, struct mshv_root_hvcall)
289 */
290
291#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/neighbour.h+5
......@@ -54,6 +54,7 @@ enum {
5454/* Extended flags under NDA_FLAGS_EXT: */
5555#define NTF_EXT_MANAGED (1 << 0)
5656#define NTF_EXT_LOCKED (1 << 1)
57#define NTF_EXT_EXT_VALIDATED (1 << 2)
5758
5859/*
5960 * Neighbor Cache Entry States.
......@@ -92,6 +93,10 @@ enum {
9293 * bridge in response to a host trying to communicate via a locked bridge port
9394 * with MAB enabled. Their purpose is to notify user space that a host requires
9495 * authentication.
96 *
97 * NTF_EXT_EXT_VALIDATED flagged neighbor entries were externally validated by
98 * a user space control plane. The kernel will not remove or invalidate them,
99 * but it can probe them and notify user space when they become reachable.
95100 */
96101
97102struct nda_cacheinfo {
lib/libc/include/any-linux-any/linux/net_dropmon.h-7
......@@ -10,13 +10,6 @@ struct net_dm_drop_point {
1010 __u32 count;
1111};
1212
13#define is_drop_point_hw(x) do {\
14 int ____i, ____j;\
15 for (____i = 0; ____i < 8; i ____i++)\
16 ____j |= x[____i];\
17 ____j;\
18} while (0)
19
2013#define NET_DM_CFG_VERSION 0
2114#define NET_DM_CFG_ALERT_COUNT 1
2215#define NET_DM_CFG_ALERT_DELAY 2
lib/libc/include/any-linux-any/linux/net_tstamp.h+15-2
......@@ -13,6 +13,17 @@
1313#include <linux/types.h>
1414#include <linux/socket.h> /* for SO_TIMESTAMPING */
1515
16/*
17 * Possible type of hwtstamp provider. Mainly "precise" the default one
18 * is for IEEE 1588 quality and "approx" is for NICs DMA point.
19 */
20enum hwtstamp_provider_qualifier {
21 HWTSTAMP_PROVIDER_QUALIFIER_PRECISE,
22 HWTSTAMP_PROVIDER_QUALIFIER_APPROX,
23
24 HWTSTAMP_PROVIDER_QUALIFIER_CNT,
25};
26
1627/* SO_TIMESTAMPING flags */
1728enum {
1829 SOF_TIMESTAMPING_TX_HARDWARE = (1<<0),
......@@ -33,8 +44,9 @@ enum {
3344 SOF_TIMESTAMPING_BIND_PHC = (1 << 15),
3445 SOF_TIMESTAMPING_OPT_ID_TCP = (1 << 16),
3546 SOF_TIMESTAMPING_OPT_RX_FILTER = (1 << 17),
47 SOF_TIMESTAMPING_TX_COMPLETION = (1 << 18),
3648
37 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_RX_FILTER,
49 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_TX_COMPLETION,
3850 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
3951 SOF_TIMESTAMPING_LAST
4052};
......@@ -47,7 +59,8 @@ enum {
4759#define SOF_TIMESTAMPING_TX_RECORD_MASK (SOF_TIMESTAMPING_TX_HARDWARE | \
4860 SOF_TIMESTAMPING_TX_SOFTWARE | \
4961 SOF_TIMESTAMPING_TX_SCHED | \
50 SOF_TIMESTAMPING_TX_ACK)
62 SOF_TIMESTAMPING_TX_ACK | \
63 SOF_TIMESTAMPING_TX_COMPLETION)
5164
5265/**
5366 * struct so_timestamping - SO_TIMESTAMPING parameter
lib/libc/include/any-linux-any/linux/netconf.h+1
......@@ -19,6 +19,7 @@ enum {
1919 NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
2020 NETCONFA_INPUT,
2121 NETCONFA_BC_FORWARDING,
22 NETCONFA_FORCE_FORWARDING,
2223 __NETCONFA_MAX
2324};
2425#define NETCONFA_MAX (__NETCONFA_MAX - 1)
lib/libc/include/any-linux-any/linux/netdev.h+23
......@@ -59,10 +59,13 @@ enum netdev_xdp_rx_metadata {
5959 * by the driver.
6060 * @NETDEV_XSK_FLAGS_TX_CHECKSUM: L3 checksum HW offload is supported by the
6161 * driver.
62 * @NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO: Launch time HW offload is supported
63 * by the driver.
6264 */
6365enum netdev_xsk_flags {
6466 NETDEV_XSK_FLAGS_TX_TIMESTAMP = 1,
6567 NETDEV_XSK_FLAGS_TX_CHECKSUM = 2,
68 NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO = 4,
6669};
6770
6871enum netdev_queue_type {
......@@ -74,6 +77,11 @@ enum netdev_qstats_scope {
7477 NETDEV_QSTATS_SCOPE_QUEUE = 1,
7578};
7679
80enum netdev_napi_threaded {
81 NETDEV_NAPI_THREADED_DISABLED,
82 NETDEV_NAPI_THREADED_ENABLED,
83};
84
7785enum {
7886 NETDEV_A_DEV_IFINDEX = 1,
7987 NETDEV_A_DEV_PAD,
......@@ -86,6 +94,11 @@ enum {
8694 NETDEV_A_DEV_MAX = (__NETDEV_A_DEV_MAX - 1)
8795};
8896
97enum {
98 __NETDEV_A_IO_URING_PROVIDER_INFO_MAX,
99 NETDEV_A_IO_URING_PROVIDER_INFO_MAX = (__NETDEV_A_IO_URING_PROVIDER_INFO_MAX - 1)
100};
101
89102enum {
90103 NETDEV_A_PAGE_POOL_ID = 1,
91104 NETDEV_A_PAGE_POOL_IFINDEX,
......@@ -94,6 +107,7 @@ enum {
94107 NETDEV_A_PAGE_POOL_INFLIGHT_MEM,
95108 NETDEV_A_PAGE_POOL_DETACH_TIME,
96109 NETDEV_A_PAGE_POOL_DMABUF,
110 NETDEV_A_PAGE_POOL_IO_URING,
97111
98112 __NETDEV_A_PAGE_POOL_MAX,
99113 NETDEV_A_PAGE_POOL_MAX = (__NETDEV_A_PAGE_POOL_MAX - 1)
......@@ -125,17 +139,25 @@ enum {
125139 NETDEV_A_NAPI_DEFER_HARD_IRQS,
126140 NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
127141 NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT,
142 NETDEV_A_NAPI_THREADED,
128143
129144 __NETDEV_A_NAPI_MAX,
130145 NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)
131146};
132147
148enum {
149 __NETDEV_A_XSK_INFO_MAX,
150 NETDEV_A_XSK_INFO_MAX = (__NETDEV_A_XSK_INFO_MAX - 1)
151};
152
133153enum {
134154 NETDEV_A_QUEUE_ID = 1,
135155 NETDEV_A_QUEUE_IFINDEX,
136156 NETDEV_A_QUEUE_TYPE,
137157 NETDEV_A_QUEUE_NAPI_ID,
138158 NETDEV_A_QUEUE_DMABUF,
159 NETDEV_A_QUEUE_IO_URING,
160 NETDEV_A_QUEUE_XSK,
139161
140162 __NETDEV_A_QUEUE_MAX,
141163 NETDEV_A_QUEUE_MAX = (__NETDEV_A_QUEUE_MAX - 1)
......@@ -203,6 +225,7 @@ enum {
203225 NETDEV_CMD_QSTATS_GET,
204226 NETDEV_CMD_BIND_RX,
205227 NETDEV_CMD_NAPI_SET,
228 NETDEV_CMD_BIND_TX,
206229
207230 __NETDEV_CMD_MAX,
208231 NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nf_tables.h+14
......@@ -394,6 +394,8 @@ enum nft_set_field_attributes {
394394 * @NFTA_SET_HANDLE: set handle (NLA_U64)
395395 * @NFTA_SET_EXPR: set expression (NLA_NESTED: nft_expr_attributes)
396396 * @NFTA_SET_EXPRESSIONS: list of expressions (NLA_NESTED: nft_list_attributes)
397 * @NFTA_SET_TYPE: set backend type (NLA_STRING)
398 * @NFTA_SET_COUNT: number of set elements (NLA_U32)
397399 */
398400enum nft_set_attributes {
399401 NFTA_SET_UNSPEC,
......@@ -415,6 +417,8 @@ enum nft_set_attributes {
415417 NFTA_SET_HANDLE,
416418 NFTA_SET_EXPR,
417419 NFTA_SET_EXPRESSIONS,
420 NFTA_SET_TYPE,
421 NFTA_SET_COUNT,
418422 __NFTA_SET_MAX
419423};
420424#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
......@@ -1780,10 +1784,12 @@ enum nft_synproxy_attributes {
17801784 * enum nft_device_attributes - nf_tables device netlink attributes
17811785 *
17821786 * @NFTA_DEVICE_NAME: name of this device (NLA_STRING)
1787 * @NFTA_DEVICE_PREFIX: device name prefix, a simple wildcard (NLA_STRING)
17831788 */
17841789enum nft_devices_attributes {
17851790 NFTA_DEVICE_UNSPEC,
17861791 NFTA_DEVICE_NAME,
1792 NFTA_DEVICE_PREFIX,
17871793 __NFTA_DEVICE_MAX
17881794};
17891795#define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1)
......@@ -1837,6 +1843,10 @@ enum nft_xfrm_keys {
18371843 * @NFTA_TRACE_MARK: nfmark (NLA_U32)
18381844 * @NFTA_TRACE_NFPROTO: nf protocol processed (NLA_U32)
18391845 * @NFTA_TRACE_POLICY: policy that decided fate of packet (NLA_U32)
1846 * @NFTA_TRACE_CT_ID: conntrack id (NLA_U32)
1847 * @NFTA_TRACE_CT_DIRECTION: packets direction (NLA_U8)
1848 * @NFTA_TRACE_CT_STATUS: conntrack status (NLA_U32)
1849 * @NFTA_TRACE_CT_STATE: packet state (new, established, ...) (NLA_U32)
18401850 */
18411851enum nft_trace_attributes {
18421852 NFTA_TRACE_UNSPEC,
......@@ -1857,6 +1867,10 @@ enum nft_trace_attributes {
18571867 NFTA_TRACE_NFPROTO,
18581868 NFTA_TRACE_POLICY,
18591869 NFTA_TRACE_PAD,
1870 NFTA_TRACE_CT_ID,
1871 NFTA_TRACE_CT_DIRECTION,
1872 NFTA_TRACE_CT_STATUS,
1873 NFTA_TRACE_CT_STATE,
18601874 __NFTA_TRACE_MAX
18611875};
18621876#define NFTA_TRACE_MAX (__NFTA_TRACE_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_conntrack.h+1
......@@ -57,6 +57,7 @@ enum ctattr_type {
5757 CTA_SYNPROXY,
5858 CTA_FILTER,
5959 CTA_STATUS_MASK,
60 CTA_TIMESTAMP_EVENT,
6061 __CTA_MAX
6162};
6263#define CTA_MAX (__CTA_MAX - 1)
lib/libc/include/any-linux-any/linux/netfilter/nfnetlink_hook.h+2
......@@ -61,10 +61,12 @@ enum nfnl_hook_chain_desc_attributes {
6161 *
6262 * @NFNL_HOOK_TYPE_NFTABLES: nf_tables base chain
6363 * @NFNL_HOOK_TYPE_BPF: bpf program
64 * @NFNL_HOOK_TYPE_NFT_FLOWTABLE: nf_tables flowtable
6465 */
6566enum nfnl_hook_chaintype {
6667 NFNL_HOOK_TYPE_NFTABLES = 0x1,
6768 NFNL_HOOK_TYPE_BPF,
69 NFNL_HOOK_TYPE_NFT_FLOWTABLE,
6870};
6971
7072/**
lib/libc/include/any-linux-any/linux/nfs4.h+5-2
......@@ -58,7 +58,7 @@
5858#define NFS4_SHARE_DENY_BOTH 0x0003
5959
6060/* nfs41 */
61#define NFS4_SHARE_WANT_MASK 0xFF00
61#define NFS4_SHARE_WANT_TYPE_MASK 0xFF00
6262#define NFS4_SHARE_WANT_NO_PREFERENCE 0x0000
6363#define NFS4_SHARE_WANT_READ_DELEG 0x0100
6464#define NFS4_SHARE_WANT_WRITE_DELEG 0x0200
......@@ -66,13 +66,16 @@
6666#define NFS4_SHARE_WANT_NO_DELEG 0x0400
6767#define NFS4_SHARE_WANT_CANCEL 0x0500
6868
69#define NFS4_SHARE_WHEN_MASK 0xF0000
69#define NFS4_SHARE_WHEN_MASK 0xF0000
7070#define NFS4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
7171#define NFS4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED 0x20000
7272
73#define NFS4_SHARE_WANT_MOD_MASK 0xF00000
7374#define NFS4_SHARE_WANT_DELEG_TIMESTAMPS 0x100000
7475#define NFS4_SHARE_WANT_OPEN_XOR_DELEGATION 0x200000
7576
77#define NFS4_SHARE_WANT_MASK (NFS4_SHARE_WANT_TYPE_MASK | NFS4_SHARE_WANT_MOD_MASK)
78
7679#define NFS4_CDFC4_FORE 0x1
7780#define NFS4_CDFC4_BACK 0x2
7881#define NFS4_CDFC4_BOTH 0x3
lib/libc/include/any-linux-any/linux/nilfs2_ondisk.h+2-1
......@@ -188,7 +188,8 @@ struct nilfs_super_block {
188188 __le16 s_segment_usage_size; /* Size of a segment usage */
189189
190190/*98*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */
191/*A8*/ char s_volume_name[80]; /* volume name */
191/*A8*/ char s_volume_name[80] /* volume name */
192 __kernel_nonstring;
192193
193194/*F8*/ __le32 s_c_interval; /* Commit interval of segment */
194195 __le32 s_c_block_max; /*
lib/libc/include/any-linux-any/linux/nl80211.h+133-26
......@@ -11,7 +11,7 @@
1111 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
1212 * Copyright 2008 Colin McCabe <colin@cozybit.com>
1313 * Copyright 2015-2017 Intel Deutschland GmbH
14 * Copyright (C) 2018-2024 Intel Corporation
14 * Copyright (C) 2018-2025 Intel Corporation
1515 *
1616 * Permission to use, copy, modify, and/or distribute this software for any
1717 * purpose with or without fee is hereby granted, provided that the above
......@@ -1329,6 +1329,21 @@
13291329 * %NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the
13301330 * TID to Link mapping for downlink/uplink traffic.
13311331 *
1332 * @NL80211_CMD_ASSOC_MLO_RECONF: For a non-AP MLD station, request to
1333 * add/remove links to/from the association. To indicate link
1334 * reconfiguration request results from the driver, this command is also
1335 * used as an event to notify userspace about the added links information.
1336 * For notifying the removed links information, the existing
1337 * %NL80211_CMD_LINKS_REMOVED command is used. This command is also used to
1338 * notify userspace about newly added links for the current connection in
1339 * case of AP-initiated link recommendation requests, received via
1340 * a BTM (BSS Transition Management) request or a link reconfig notify
1341 * frame, where the driver handles the link recommendation offload.
1342 *
1343 * @NL80211_CMD_EPCS_CFG: EPCS configuration for a station. Used by userland to
1344 * control EPCS configuration. Used to notify userland on the current state
1345 * of EPCS.
1346 *
13321347 * @NL80211_CMD_MAX: highest used command number
13331348 * @__NL80211_CMD_AFTER_LAST: internal use
13341349 */
......@@ -1586,6 +1601,9 @@ enum nl80211_commands {
15861601
15871602 NL80211_CMD_SET_TID_TO_LINK_MAPPING,
15881603
1604 NL80211_CMD_ASSOC_MLO_RECONF,
1605 NL80211_CMD_EPCS_CFG,
1606
15891607 /* add new commands above here */
15901608
15911609 /* used to define NL80211_CMD_MAX below */
......@@ -2871,6 +2889,45 @@ enum nl80211_commands {
28712889 * @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32).
28722890 * A value of 0 means all radios.
28732891 *
2892 * @NL80211_ATTR_SUPPORTED_SELECTORS: supported BSS Membership Selectors, array
2893 * of supported selectors as defined by IEEE Std 802.11-2020 9.4.2.3 but
2894 * without the length restriction (at most %NL80211_MAX_SUPP_SELECTORS).
2895 * This can be used to provide a list of selectors that are implemented
2896 * by the supplicant. If not given, support for SAE_H2E is assumed.
2897 *
2898 * @NL80211_ATTR_MLO_RECONF_REM_LINKS: (u16) A bitmask of the links requested
2899 * to be removed from the MLO association.
2900 *
2901 * @NL80211_ATTR_EPCS: Flag attribute indicating that EPCS is enabled for a
2902 * station interface.
2903 *
2904 * @NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS: Extended MLD capabilities and
2905 * operations that userspace implements to use during association/ML
2906 * link reconfig, currently only "BTM MLD Recommendation For Multiple
2907 * APs Support". Drivers may set additional flags that they support
2908 * in the kernel or device.
2909 *
2910 * @NL80211_ATTR_WIPHY_RADIO_INDEX: (int) Integer attribute denoting the index
2911 * of the radio in interest. Internally a value of -1 is used to
2912 * indicate that the radio id is not given in user-space. This means
2913 * that all the attributes are applicable to all the radios. If there is
2914 * a radio index provided in user-space, the attributes will be
2915 * applicable to that specific radio only. If the radio id is greater
2916 * thank the number of radios, error denoting invalid value is returned.
2917 *
2918 * @NL80211_ATTR_S1G_LONG_BEACON_PERIOD: (u8) Integer attribute that represents
2919 * the number of beacon intervals between each long beacon transmission
2920 * for an S1G BSS with short beaconing enabled. This is a required
2921 * attribute for initialising an S1G short beaconing BSS. When updating
2922 * the short beacon data, this is not required. It has a minimum value of
2923 * 2 (i.e 2 beacon intervals).
2924 *
2925 * @NL80211_ATTR_S1G_SHORT_BEACON: Nested attribute containing the short beacon
2926 * head and tail used to set or update the short beacon templates. When
2927 * bringing up a new interface, %NL80211_ATTR_S1G_LONG_BEACON_PERIOD is
2928 * required alongside this attribute. Refer to
2929 * @enum nl80211_s1g_short_beacon_attrs for the attribute definitions.
2930 *
28742931 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
28752932 * @NL80211_ATTR_MAX: highest attribute number currently defined
28762933 * @__NL80211_ATTR_AFTER_LAST: internal use
......@@ -3421,6 +3478,18 @@ enum nl80211_attrs {
34213478
34223479 NL80211_ATTR_VIF_RADIO_MASK,
34233480
3481 NL80211_ATTR_SUPPORTED_SELECTORS,
3482
3483 NL80211_ATTR_MLO_RECONF_REM_LINKS,
3484 NL80211_ATTR_EPCS,
3485
3486 NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
3487
3488 NL80211_ATTR_WIPHY_RADIO_INDEX,
3489
3490 NL80211_ATTR_S1G_LONG_BEACON_PERIOD,
3491 NL80211_ATTR_S1G_SHORT_BEACON,
3492
34243493 /* add attributes here, update the policy in nl80211.c */
34253494
34263495 __NL80211_ATTR_AFTER_LAST,
......@@ -3465,6 +3534,7 @@ enum nl80211_attrs {
34653534#define NL80211_WIPHY_NAME_MAXLEN 64
34663535
34673536#define NL80211_MAX_SUPP_RATES 32
3537#define NL80211_MAX_SUPP_SELECTORS 128
34683538#define NL80211_MAX_SUPP_HT_RATES 77
34693539#define NL80211_MAX_SUPP_REG_RULES 128
34703540#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
......@@ -4299,6 +4369,8 @@ enum nl80211_wmm_rule {
42994369 * otherwise completely disabled.
43004370 * @NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP: This channel can be used for a
43014371 * very low power (VLP) AP, despite being NO_IR.
4372 * @NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY: This channel can be active in
4373 * 20 MHz bandwidth, despite being NO_IR.
43024374 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
43034375 * currently defined
43044376 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
......@@ -4343,6 +4415,7 @@ enum nl80211_frequency_attr {
43434415 NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,
43444416 NL80211_FREQUENCY_ATTR_CAN_MONITOR,
43454417 NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP,
4418 NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY,
43464419
43474420 /* keep last */
43484421 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
......@@ -4554,31 +4627,34 @@ enum nl80211_sched_scan_match_attr {
45544627 * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed
45554628 * @NL80211_RRF_ALLOW_6GHZ_VLP_AP: Very low power (VLP) AP can be permitted
45564629 * despite NO_IR configuration.
4630 * @NL80211_RRF_ALLOW_20MHZ_ACTIVITY: Allow activity in 20 MHz bandwidth,
4631 * despite NO_IR configuration.
45574632 */
45584633enum nl80211_reg_rule_flags {
4559 NL80211_RRF_NO_OFDM = 1<<0,
4560 NL80211_RRF_NO_CCK = 1<<1,
4561 NL80211_RRF_NO_INDOOR = 1<<2,
4562 NL80211_RRF_NO_OUTDOOR = 1<<3,
4563 NL80211_RRF_DFS = 1<<4,
4564 NL80211_RRF_PTP_ONLY = 1<<5,
4565 NL80211_RRF_PTMP_ONLY = 1<<6,
4566 NL80211_RRF_NO_IR = 1<<7,
4567 __NL80211_RRF_NO_IBSS = 1<<8,
4568 NL80211_RRF_AUTO_BW = 1<<11,
4569 NL80211_RRF_IR_CONCURRENT = 1<<12,
4570 NL80211_RRF_NO_HT40MINUS = 1<<13,
4571 NL80211_RRF_NO_HT40PLUS = 1<<14,
4572 NL80211_RRF_NO_80MHZ = 1<<15,
4573 NL80211_RRF_NO_160MHZ = 1<<16,
4574 NL80211_RRF_NO_HE = 1<<17,
4575 NL80211_RRF_NO_320MHZ = 1<<18,
4576 NL80211_RRF_NO_EHT = 1<<19,
4577 NL80211_RRF_PSD = 1<<20,
4578 NL80211_RRF_DFS_CONCURRENT = 1<<21,
4579 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22,
4580 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23,
4581 NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1<<24,
4634 NL80211_RRF_NO_OFDM = 1 << 0,
4635 NL80211_RRF_NO_CCK = 1 << 1,
4636 NL80211_RRF_NO_INDOOR = 1 << 2,
4637 NL80211_RRF_NO_OUTDOOR = 1 << 3,
4638 NL80211_RRF_DFS = 1 << 4,
4639 NL80211_RRF_PTP_ONLY = 1 << 5,
4640 NL80211_RRF_PTMP_ONLY = 1 << 6,
4641 NL80211_RRF_NO_IR = 1 << 7,
4642 __NL80211_RRF_NO_IBSS = 1 << 8,
4643 NL80211_RRF_AUTO_BW = 1 << 11,
4644 NL80211_RRF_IR_CONCURRENT = 1 << 12,
4645 NL80211_RRF_NO_HT40MINUS = 1 << 13,
4646 NL80211_RRF_NO_HT40PLUS = 1 << 14,
4647 NL80211_RRF_NO_80MHZ = 1 << 15,
4648 NL80211_RRF_NO_160MHZ = 1 << 16,
4649 NL80211_RRF_NO_HE = 1 << 17,
4650 NL80211_RRF_NO_320MHZ = 1 << 18,
4651 NL80211_RRF_NO_EHT = 1 << 19,
4652 NL80211_RRF_PSD = 1 << 20,
4653 NL80211_RRF_DFS_CONCURRENT = 1 << 21,
4654 NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1 << 22,
4655 NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1 << 23,
4656 NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1 << 24,
4657 NL80211_RRF_ALLOW_20MHZ_ACTIVITY = 1 << 25,
45824658};
45834659
45844660#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
......@@ -4699,8 +4775,8 @@ enum nl80211_survey_info {
46994775 * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
47004776 * @NL80211_MNTR_FLAG_CONTROL: pass control frames
47014777 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
4702 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
4703 * overrides all other flags.
4778 * @NL80211_MNTR_FLAG_COOK_FRAMES: deprecated
4779 * will unconditionally be refused
47044780 * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
47054781 * and ACK incoming unicast packets.
47064782 * @NL80211_MNTR_FLAG_SKIP_TX: do not pass local tx packets
......@@ -7994,6 +8070,11 @@ enum nl80211_sar_specs_attrs {
79948070 * Setting this flag is permitted only if the driver advertises EMA support
79958071 * by setting wiphy->ema_max_profile_periodicity to non-zero.
79968072 *
8073 * @NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID: Link ID of the transmitted profile.
8074 * This parameter is mandatory when NL80211_ATTR_MBSSID_CONFIG attributes
8075 * are sent for a non-transmitted profile and if the transmitted profile
8076 * is part of an MLD. For all other cases this parameter is unnecessary.
8077 *
79978078 * @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal
79988079 * @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute
79998080 */
......@@ -8005,6 +8086,7 @@ enum nl80211_mbssid_config_attributes {
80058086 NL80211_MBSSID_CONFIG_ATTR_INDEX,
80068087 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX,
80078088 NL80211_MBSSID_CONFIG_ATTR_EMA,
8089 NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID,
80088090
80098091 /* keep last */
80108092 __NL80211_MBSSID_CONFIG_ATTR_LAST,
......@@ -8040,6 +8122,7 @@ enum nl80211_ap_settings_flags {
80408122 * and contains attributes defined in &enum nl80211_if_combination_attrs.
80418123 * @NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK: bitmask (u32) of antennas
80428124 * connected to this radio.
8125 * @NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD: RTS threshold (u32) of this radio.
80438126 *
80448127 * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
80458128 * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
......@@ -8051,6 +8134,7 @@ enum nl80211_wiphy_radio_attrs {
80518134 NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
80528135 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
80538136 NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
8137 NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD,
80548138
80558139 /* keep last */
80568140 __NL80211_WIPHY_RADIO_ATTR_LAST,
......@@ -8080,4 +8164,27 @@ enum nl80211_wiphy_radio_freq_range {
80808164 NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
80818165};
80828166
8167/**
8168 * enum nl80211_s1g_short_beacon_attrs - S1G short beacon data
8169 *
8170 * @__NL80211_S1G_SHORT_BEACON_ATTR_INVALID: Invalid
8171 *
8172 * @NL80211_S1G_SHORT_BEACON_ATTR_HEAD: Short beacon head (binary).
8173 * @NL80211_S1G_SHORT_BEACON_ATTR_TAIL: Short beacon tail (binary).
8174 *
8175 * @__NL80211_S1G_SHORT_BEACON_ATTR_LAST: Internal
8176 * @NL80211_S1G_SHORT_BEACON_ATTR_MAX: Highest attribute
8177 */
8178enum nl80211_s1g_short_beacon_attrs {
8179 __NL80211_S1G_SHORT_BEACON_ATTR_INVALID,
8180
8181 NL80211_S1G_SHORT_BEACON_ATTR_HEAD,
8182 NL80211_S1G_SHORT_BEACON_ATTR_TAIL,
8183
8184 /* keep last */
8185 __NL80211_S1G_SHORT_BEACON_ATTR_LAST,
8186 NL80211_S1G_SHORT_BEACON_ATTR_MAX =
8187 __NL80211_S1G_SHORT_BEACON_ATTR_LAST - 1
8188};
8189
80838190#endif /* __LINUX_NL80211_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/nsfs.h+11
......@@ -42,4 +42,15 @@ struct mnt_ns_info {
4242/* Get previous namespace. */
4343#define NS_MNT_GET_PREV _IOR(NSIO, 12, struct mnt_ns_info)
4444
45enum init_ns_ino {
46 IPC_NS_INIT_INO = 0xEFFFFFFFU,
47 UTS_NS_INIT_INO = 0xEFFFFFFEU,
48 USER_NS_INIT_INO = 0xEFFFFFFDU,
49 PID_NS_INIT_INO = 0xEFFFFFFCU,
50 CGROUP_NS_INIT_INO = 0xEFFFFFFBU,
51 TIME_NS_INIT_INO = 0xEFFFFFFAU,
52 NET_NS_INIT_INO = 0xEFFFFFF9U,
53 MNT_NS_INIT_INO = 0xEFFFFFF8U,
54};
55
4556#endif /* __LINUX_NSFS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ntsync.h+39-3
......@@ -11,13 +11,49 @@
1111#include <linux/types.h>
1212
1313struct ntsync_sem_args {
14 __u32 sem;
1514 __u32 count;
1615 __u32 max;
1716};
1817
19#define NTSYNC_IOC_CREATE_SEM _IOWR('N', 0x80, struct ntsync_sem_args)
18struct ntsync_mutex_args {
19 __u32 owner;
20 __u32 count;
21};
22
23struct ntsync_event_args {
24 __u32 manual;
25 __u32 signaled;
26};
27
28#define NTSYNC_WAIT_REALTIME 0x1
29
30struct ntsync_wait_args {
31 __u64 timeout;
32 __u64 objs;
33 __u32 count;
34 __u32 index;
35 __u32 flags;
36 __u32 owner;
37 __u32 alert;
38 __u32 pad;
39};
40
41#define NTSYNC_MAX_WAIT_COUNT 64
42
43#define NTSYNC_IOC_CREATE_SEM _IOW ('N', 0x80, struct ntsync_sem_args)
44#define NTSYNC_IOC_WAIT_ANY _IOWR('N', 0x82, struct ntsync_wait_args)
45#define NTSYNC_IOC_WAIT_ALL _IOWR('N', 0x83, struct ntsync_wait_args)
46#define NTSYNC_IOC_CREATE_MUTEX _IOW ('N', 0x84, struct ntsync_mutex_args)
47#define NTSYNC_IOC_CREATE_EVENT _IOW ('N', 0x87, struct ntsync_event_args)
2048
21#define NTSYNC_IOC_SEM_POST _IOWR('N', 0x81, __u32)
49#define NTSYNC_IOC_SEM_RELEASE _IOWR('N', 0x81, __u32)
50#define NTSYNC_IOC_MUTEX_UNLOCK _IOWR('N', 0x85, struct ntsync_mutex_args)
51#define NTSYNC_IOC_MUTEX_KILL _IOW ('N', 0x86, __u32)
52#define NTSYNC_IOC_EVENT_SET _IOR ('N', 0x88, __u32)
53#define NTSYNC_IOC_EVENT_RESET _IOR ('N', 0x89, __u32)
54#define NTSYNC_IOC_EVENT_PULSE _IOR ('N', 0x8a, __u32)
55#define NTSYNC_IOC_SEM_READ _IOR ('N', 0x8b, struct ntsync_sem_args)
56#define NTSYNC_IOC_MUTEX_READ _IOR ('N', 0x8c, struct ntsync_mutex_args)
57#define NTSYNC_IOC_EVENT_READ _IOR ('N', 0x8d, struct ntsync_event_args)
2258
2359#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/openvswitch.h+6
......@@ -186,6 +186,11 @@ enum ovs_packet_cmd {
186186 * %OVS_PACKET_ATTR_USERSPACE action specify the Maximum received fragment
187187 * size.
188188 * @OVS_PACKET_ATTR_HASH: Packet hash info (e.g. hash, sw_hash and l4_hash in skb).
189 * @OVS_PACKET_ATTR_UPCALL_PID: Netlink PID to use for upcalls while
190 * processing %OVS_PACKET_CMD_EXECUTE. Takes precedence over all other ways
191 * to determine the Netlink PID including %OVS_USERSPACE_ATTR_PID,
192 * %OVS_DP_ATTR_UPCALL_PID, %OVS_DP_ATTR_PER_CPU_PIDS and the
193 * %OVS_VPORT_ATTR_UPCALL_PID.
189194 *
190195 * These attributes follow the &struct ovs_header within the Generic Netlink
191196 * payload for %OVS_PACKET_* commands.
......@@ -205,6 +210,7 @@ enum ovs_packet_attr {
205210 OVS_PACKET_ATTR_MRU, /* Maximum received IP fragment size. */
206211 OVS_PACKET_ATTR_LEN, /* Packet size before truncation. */
207212 OVS_PACKET_ATTR_HASH, /* Packet hash. */
213 OVS_PACKET_ATTR_UPCALL_PID, /* u32 Netlink PID. */
208214 __OVS_PACKET_ATTR_MAX
209215};
210216
lib/libc/include/any-linux-any/linux/ovpn.h created+109
......@@ -0,0 +1,109 @@
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/ovpn.yaml */
4/* YNL-GEN uapi header */
5
6#ifndef _LINUX_OVPN_H
7#define _LINUX_OVPN_H
8
9#define OVPN_FAMILY_NAME "ovpn"
10#define OVPN_FAMILY_VERSION 1
11
12#define OVPN_NONCE_TAIL_SIZE 8
13
14enum ovpn_cipher_alg {
15 OVPN_CIPHER_ALG_NONE,
16 OVPN_CIPHER_ALG_AES_GCM,
17 OVPN_CIPHER_ALG_CHACHA20_POLY1305,
18};
19
20enum ovpn_del_peer_reason {
21 OVPN_DEL_PEER_REASON_TEARDOWN,
22 OVPN_DEL_PEER_REASON_USERSPACE,
23 OVPN_DEL_PEER_REASON_EXPIRED,
24 OVPN_DEL_PEER_REASON_TRANSPORT_ERROR,
25 OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT,
26};
27
28enum ovpn_key_slot {
29 OVPN_KEY_SLOT_PRIMARY,
30 OVPN_KEY_SLOT_SECONDARY,
31};
32
33enum {
34 OVPN_A_PEER_ID = 1,
35 OVPN_A_PEER_REMOTE_IPV4,
36 OVPN_A_PEER_REMOTE_IPV6,
37 OVPN_A_PEER_REMOTE_IPV6_SCOPE_ID,
38 OVPN_A_PEER_REMOTE_PORT,
39 OVPN_A_PEER_SOCKET,
40 OVPN_A_PEER_SOCKET_NETNSID,
41 OVPN_A_PEER_VPN_IPV4,
42 OVPN_A_PEER_VPN_IPV6,
43 OVPN_A_PEER_LOCAL_IPV4,
44 OVPN_A_PEER_LOCAL_IPV6,
45 OVPN_A_PEER_LOCAL_PORT,
46 OVPN_A_PEER_KEEPALIVE_INTERVAL,
47 OVPN_A_PEER_KEEPALIVE_TIMEOUT,
48 OVPN_A_PEER_DEL_REASON,
49 OVPN_A_PEER_VPN_RX_BYTES,
50 OVPN_A_PEER_VPN_TX_BYTES,
51 OVPN_A_PEER_VPN_RX_PACKETS,
52 OVPN_A_PEER_VPN_TX_PACKETS,
53 OVPN_A_PEER_LINK_RX_BYTES,
54 OVPN_A_PEER_LINK_TX_BYTES,
55 OVPN_A_PEER_LINK_RX_PACKETS,
56 OVPN_A_PEER_LINK_TX_PACKETS,
57
58 __OVPN_A_PEER_MAX,
59 OVPN_A_PEER_MAX = (__OVPN_A_PEER_MAX - 1)
60};
61
62enum {
63 OVPN_A_KEYCONF_PEER_ID = 1,
64 OVPN_A_KEYCONF_SLOT,
65 OVPN_A_KEYCONF_KEY_ID,
66 OVPN_A_KEYCONF_CIPHER_ALG,
67 OVPN_A_KEYCONF_ENCRYPT_DIR,
68 OVPN_A_KEYCONF_DECRYPT_DIR,
69
70 __OVPN_A_KEYCONF_MAX,
71 OVPN_A_KEYCONF_MAX = (__OVPN_A_KEYCONF_MAX - 1)
72};
73
74enum {
75 OVPN_A_KEYDIR_CIPHER_KEY = 1,
76 OVPN_A_KEYDIR_NONCE_TAIL,
77
78 __OVPN_A_KEYDIR_MAX,
79 OVPN_A_KEYDIR_MAX = (__OVPN_A_KEYDIR_MAX - 1)
80};
81
82enum {
83 OVPN_A_IFINDEX = 1,
84 OVPN_A_PEER,
85 OVPN_A_KEYCONF,
86
87 __OVPN_A_MAX,
88 OVPN_A_MAX = (__OVPN_A_MAX - 1)
89};
90
91enum {
92 OVPN_CMD_PEER_NEW = 1,
93 OVPN_CMD_PEER_SET,
94 OVPN_CMD_PEER_GET,
95 OVPN_CMD_PEER_DEL,
96 OVPN_CMD_PEER_DEL_NTF,
97 OVPN_CMD_KEY_NEW,
98 OVPN_CMD_KEY_GET,
99 OVPN_CMD_KEY_SWAP,
100 OVPN_CMD_KEY_SWAP_NTF,
101 OVPN_CMD_KEY_DEL,
102
103 __OVPN_CMD_MAX,
104 OVPN_CMD_MAX = (__OVPN_CMD_MAX - 1)
105};
106
107#define OVPN_MCGRP_PEERS "peers"
108
109#endif /* _LINUX_OVPN_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pci_regs.h+38-12
......@@ -486,6 +486,7 @@
486486#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
487487#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
488488#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
489#define PCI_EXP_FLAGS_FLIT 0x8000 /* Flit Mode Supported */
489490#define PCI_EXP_DEVCAP 0x04 /* Device capabilities */
490491#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
491492#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
......@@ -533,7 +534,7 @@
533534#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */
534535#define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V1 12 /* v1 endpoints without link end here */
535536#define PCI_EXP_LNKCAP 0x0c /* Link Capabilities */
536#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
537#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Max Link Speed (prior to PCIe r3.0: Supported Link Speeds) */
537538#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
538539#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
539540#define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */
......@@ -665,6 +666,7 @@
665666#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
666667#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
667668#define PCI_EXP_DEVCAP2_EE_PREFIX 0x00200000 /* End-End TLP Prefix */
669#define PCI_EXP_DEVCAP2_EE_PREFIX_MAX 0x00c00000 /* Max End-End TLP Prefixes */
668670#define PCI_EXP_DEVCTL2 0x28 /* Device Control 2 */
669671#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */
670672#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */
......@@ -743,12 +745,14 @@
743745#define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */
744746#define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */
745747#define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */
748#define PCI_EXT_CAP_ID_VF_REBAR 0x24 /* VF Resizable BAR */
746749#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
747750#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
748751#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */
749752#define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */
750753#define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */
751#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE
754#define PCI_EXT_CAP_ID_PL_64GT 0x31 /* Physical Layer 64.0 GT/s */
755#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_64GT
752756
753757#define PCI_EXT_CAP_DSN_SIZEOF 12
754758#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
......@@ -789,10 +793,13 @@
789793 /* Same bits as above */
790794#define PCI_ERR_CAP 0x18 /* Advanced Error Capabilities & Ctrl*/
791795#define PCI_ERR_CAP_FEP(x) ((x) & 0x1f) /* First Error Pointer */
792#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
793#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
794#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
795#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
796#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
797#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
798#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
799#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
800#define PCI_ERR_CAP_PREFIX_LOG_PRESENT 0x00000800 /* TLP Prefix Log Present */
801#define PCI_ERR_CAP_TLP_LOG_FLIT 0x00040000 /* TLP was logged in Flit Mode */
802#define PCI_ERR_CAP_TLP_LOG_SIZE 0x00f80000 /* Logged TLP Size (only in Flit mode) */
796803#define PCI_ERR_HEADER_LOG 0x1c /* Header Log Register (16 bytes) */
797804#define PCI_ERR_ROOT_COMMAND 0x2c /* Root Error Command */
798805#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001 /* Correctable Err Reporting Enable */
......@@ -808,6 +815,7 @@
808815#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
809816#define PCI_ERR_ROOT_AER_IRQ 0xf8000000 /* Advanced Error Interrupt Message Number */
810817#define PCI_ERR_ROOT_ERR_SRC 0x34 /* Error Source Identification */
818#define PCI_ERR_PREFIX_LOG 0x38 /* TLP Prefix LOG Register (up to 16 bytes) */
811819
812820/* Virtual Channel */
813821#define PCI_VC_PORT_CAP1 0x04
......@@ -1001,9 +1009,6 @@
10011009#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
10021010#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
10031011
1004#define PCI_VSEC_HDR 4 /* extended cap - vendor-specific */
1005#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
1006
10071012/* SATA capability */
10081013#define PCI_SATA_REGS 4 /* SATA REGs specifier */
10091014#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
......@@ -1013,7 +1018,7 @@
10131018
10141019/* Resizable BARs */
10151020#define PCI_REBAR_CAP 4 /* capability register */
1016#define PCI_REBAR_CAP_SIZES 0x00FFFFF0 /* supported BAR sizes */
1021#define PCI_REBAR_CAP_SIZES 0xFFFFFFF0 /* supported BAR sizes */
10171022#define PCI_REBAR_CTRL 8 /* control register */
10181023#define PCI_REBAR_CTRL_BAR_IDX 0x00000007 /* BAR index */
10191024#define PCI_REBAR_CTRL_NBAR_MASK 0x000000E0 /* # of resizable BARs */
......@@ -1061,8 +1066,9 @@
10611066#define PCI_EXP_DPC_CAP_RP_EXT 0x0020 /* Root Port Extensions */
10621067#define PCI_EXP_DPC_CAP_POISONED_TLP 0x0040 /* Poisoned TLP Egress Blocking Supported */
10631068#define PCI_EXP_DPC_CAP_SW_TRIGGER 0x0080 /* Software Triggering Supported */
1064#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size */
1069#define PCI_EXP_DPC_RP_PIO_LOG_SIZE 0x0F00 /* RP PIO Log Size [3:0] */
10651070#define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */
1071#define PCI_EXP_DPC_RP_PIO_LOG_SIZE4 0x2000 /* RP PIO Log Size [4] */
10661072
10671073#define PCI_EXP_DPC_CTL 0x06 /* DPC control */
10681074#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */
......@@ -1136,16 +1142,33 @@
11361142#define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */
11371143#define PCI_DVSEC_HEADER2_ID(x) ((x) & 0xffff)
11381144
1145/* VF Resizable BARs, same layout as PCI_REBAR */
1146#define PCI_VF_REBAR_CAP PCI_REBAR_CAP
1147#define PCI_VF_REBAR_CAP_SIZES PCI_REBAR_CAP_SIZES
1148#define PCI_VF_REBAR_CTRL PCI_REBAR_CTRL
1149#define PCI_VF_REBAR_CTRL_BAR_IDX PCI_REBAR_CTRL_BAR_IDX
1150#define PCI_VF_REBAR_CTRL_NBAR_MASK PCI_REBAR_CTRL_NBAR_MASK
1151#define PCI_VF_REBAR_CTRL_BAR_SIZE PCI_REBAR_CTRL_BAR_SIZE
1152
11391153/* Data Link Feature */
11401154#define PCI_DLF_CAP 0x04 /* Capabilities Register */
11411155#define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */
11421156
1157/* Secondary PCIe Capability 8.0 GT/s */
1158#define PCI_SECPCI_LE_CTRL 0x0c /* Lane Equalization Control Register */
1159
11431160/* Physical Layer 16.0 GT/s */
11441161#define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */
11451162#define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F
11461163#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
11471164#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
11481165
1166/* Physical Layer 32.0 GT/s */
1167#define PCI_PL_32GT_LE_CTRL 0x20 /* Lane Equalization Control Register */
1168
1169/* Physical Layer 64.0 GT/s */
1170#define PCI_PL_64GT_LE_CTRL 0x20 /* Lane Equalization Control Register */
1171
11491172/* Native PCIe Enclosure Management */
11501173#define PCI_NPEM_CAP 0x04 /* NPEM capability register */
11511174#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */
......@@ -1205,9 +1228,12 @@
12051228#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff
12061229#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER 0x0000ff00
12071230#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff
1208#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000
1231#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE 0x00ff0000
12091232#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000
12101233
1234/* Deprecated old name, replaced with PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE */
1235#define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL PCI_DOE_DATA_OBJECT_DISC_RSP_3_TYPE
1236
12111237/* Compute Express Link (CXL r3.1, sec 8.1.5) */
12121238#define PCI_DVSEC_CXL_PORT 3
12131239#define PCI_DVSEC_CXL_PORT_CTL 0x0c
lib/libc/include/any-linux-any/linux/pcitest.h+8
......@@ -20,8 +20,16 @@
2020#define PCITEST_MSIX _IOW('P', 0x7, int)
2121#define PCITEST_SET_IRQTYPE _IOW('P', 0x8, int)
2222#define PCITEST_GET_IRQTYPE _IO('P', 0x9)
23#define PCITEST_BARS _IO('P', 0xa)
24#define PCITEST_DOORBELL _IO('P', 0xb)
2325#define PCITEST_CLEAR_IRQ _IO('P', 0x10)
2426
27#define PCITEST_IRQ_TYPE_UNDEFINED -1
28#define PCITEST_IRQ_TYPE_INTX 0
29#define PCITEST_IRQ_TYPE_MSI 1
30#define PCITEST_IRQ_TYPE_MSIX 2
31#define PCITEST_IRQ_TYPE_AUTO 3
32
2533#define PCITEST_FLAGS_USE_DMA 0x00000001
2634
2735struct pci_endpoint_test_xfer_param {
lib/libc/include/any-linux-any/linux/perf_event.h+334-321
......@@ -39,18 +39,21 @@ enum perf_type_id {
3939
4040/*
4141 * attr.config layout for type PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE
42 *
4243 * PERF_TYPE_HARDWARE: 0xEEEEEEEE000000AA
4344 * AA: hardware event ID
4445 * EEEEEEEE: PMU type ID
46 *
4547 * PERF_TYPE_HW_CACHE: 0xEEEEEEEE00DDCCBB
4648 * BB: hardware cache ID
4749 * CC: hardware cache op ID
4850 * DD: hardware cache op result ID
4951 * EEEEEEEE: PMU type ID
50 * If the PMU type ID is 0, the PERF_TYPE_RAW will be applied.
52 *
53 * If the PMU type ID is 0, PERF_TYPE_RAW will be applied.
5154 */
52#define PERF_PMU_TYPE_SHIFT 32
53#define PERF_HW_EVENT_MASK 0xffffffff
55#define PERF_PMU_TYPE_SHIFT 32
56#define PERF_HW_EVENT_MASK 0xffffffff
5457
5558/*
5659 * Generalized performance event event_id types, used by the
......@@ -112,7 +115,7 @@ enum perf_hw_cache_op_result_id {
112115/*
113116 * Special "software" events provided by the kernel, even if the hardware
114117 * does not support performance events. These events measure various
115 * physical and sw events of the kernel (and allow the profiling of them as
118 * physical and SW events of the kernel (and allow the profiling of them as
116119 * well):
117120 */
118121enum perf_sw_ids {
......@@ -167,8 +170,9 @@ enum perf_event_sample_format {
167170};
168171
169172#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
173
170174/*
171 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
175 * Values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set.
172176 *
173177 * If the user does not pass priv level information via branch_sample_type,
174178 * the kernel uses the event's priv level. Branch and event priv levels do
......@@ -178,20 +182,20 @@ enum perf_event_sample_format {
178182 * of branches and therefore it supersedes all the other types.
179183 */
180184enum perf_branch_sample_type_shift {
181 PERF_SAMPLE_BRANCH_USER_SHIFT = 0, /* user branches */
182 PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1, /* kernel branches */
183 PERF_SAMPLE_BRANCH_HV_SHIFT = 2, /* hypervisor branches */
184
185 PERF_SAMPLE_BRANCH_ANY_SHIFT = 3, /* any branch types */
186 PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4, /* any call branch */
187 PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5, /* any return branch */
188 PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6, /* indirect calls */
189 PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7, /* transaction aborts */
190 PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8, /* in transaction */
191 PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9, /* not in transaction */
185 PERF_SAMPLE_BRANCH_USER_SHIFT = 0, /* user branches */
186 PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1, /* kernel branches */
187 PERF_SAMPLE_BRANCH_HV_SHIFT = 2, /* hypervisor branches */
188
189 PERF_SAMPLE_BRANCH_ANY_SHIFT = 3, /* any branch types */
190 PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4, /* any call branch */
191 PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5, /* any return branch */
192 PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6, /* indirect calls */
193 PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7, /* transaction aborts */
194 PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8, /* in transaction */
195 PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9, /* not in transaction */
192196 PERF_SAMPLE_BRANCH_COND_SHIFT = 10, /* conditional branches */
193197
194 PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 11, /* call/ret stack */
198 PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 11, /* CALL/RET stack */
195199 PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT = 12, /* indirect jumps */
196200 PERF_SAMPLE_BRANCH_CALL_SHIFT = 13, /* direct call */
197201
......@@ -210,96 +214,95 @@ enum perf_branch_sample_type_shift {
210214};
211215
212216enum perf_branch_sample_type {
213 PERF_SAMPLE_BRANCH_USER = 1U << PERF_SAMPLE_BRANCH_USER_SHIFT,
214 PERF_SAMPLE_BRANCH_KERNEL = 1U << PERF_SAMPLE_BRANCH_KERNEL_SHIFT,
215 PERF_SAMPLE_BRANCH_HV = 1U << PERF_SAMPLE_BRANCH_HV_SHIFT,
217 PERF_SAMPLE_BRANCH_USER = 1U << PERF_SAMPLE_BRANCH_USER_SHIFT,
218 PERF_SAMPLE_BRANCH_KERNEL = 1U << PERF_SAMPLE_BRANCH_KERNEL_SHIFT,
219 PERF_SAMPLE_BRANCH_HV = 1U << PERF_SAMPLE_BRANCH_HV_SHIFT,
216220
217 PERF_SAMPLE_BRANCH_ANY = 1U << PERF_SAMPLE_BRANCH_ANY_SHIFT,
218 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT,
219 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT,
220 PERF_SAMPLE_BRANCH_IND_CALL = 1U << PERF_SAMPLE_BRANCH_IND_CALL_SHIFT,
221 PERF_SAMPLE_BRANCH_ABORT_TX = 1U << PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT,
222 PERF_SAMPLE_BRANCH_IN_TX = 1U << PERF_SAMPLE_BRANCH_IN_TX_SHIFT,
223 PERF_SAMPLE_BRANCH_NO_TX = 1U << PERF_SAMPLE_BRANCH_NO_TX_SHIFT,
224 PERF_SAMPLE_BRANCH_COND = 1U << PERF_SAMPLE_BRANCH_COND_SHIFT,
221 PERF_SAMPLE_BRANCH_ANY = 1U << PERF_SAMPLE_BRANCH_ANY_SHIFT,
222 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT,
223 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT,
224 PERF_SAMPLE_BRANCH_IND_CALL = 1U << PERF_SAMPLE_BRANCH_IND_CALL_SHIFT,
225 PERF_SAMPLE_BRANCH_ABORT_TX = 1U << PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT,
226 PERF_SAMPLE_BRANCH_IN_TX = 1U << PERF_SAMPLE_BRANCH_IN_TX_SHIFT,
227 PERF_SAMPLE_BRANCH_NO_TX = 1U << PERF_SAMPLE_BRANCH_NO_TX_SHIFT,
228 PERF_SAMPLE_BRANCH_COND = 1U << PERF_SAMPLE_BRANCH_COND_SHIFT,
225229
226 PERF_SAMPLE_BRANCH_CALL_STACK = 1U << PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT,
227 PERF_SAMPLE_BRANCH_IND_JUMP = 1U << PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT,
228 PERF_SAMPLE_BRANCH_CALL = 1U << PERF_SAMPLE_BRANCH_CALL_SHIFT,
230 PERF_SAMPLE_BRANCH_CALL_STACK = 1U << PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT,
231 PERF_SAMPLE_BRANCH_IND_JUMP = 1U << PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT,
232 PERF_SAMPLE_BRANCH_CALL = 1U << PERF_SAMPLE_BRANCH_CALL_SHIFT,
229233
230 PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT,
231 PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT,
234 PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT,
235 PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT,
232236
233 PERF_SAMPLE_BRANCH_TYPE_SAVE =
234 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT,
237 PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT,
235238
236 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
239 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
237240
238 PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
241 PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
239242
240 PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT,
243 PERF_SAMPLE_BRANCH_COUNTERS = 1U << PERF_SAMPLE_BRANCH_COUNTERS_SHIFT,
241244
242 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
245 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
243246};
244247
245248/*
246 * Common flow change classification
249 * Common control flow change classifications:
247250 */
248251enum {
249 PERF_BR_UNKNOWN = 0, /* unknown */
250 PERF_BR_COND = 1, /* conditional */
251 PERF_BR_UNCOND = 2, /* unconditional */
252 PERF_BR_IND = 3, /* indirect */
253 PERF_BR_CALL = 4, /* function call */
254 PERF_BR_IND_CALL = 5, /* indirect function call */
255 PERF_BR_RET = 6, /* function return */
256 PERF_BR_SYSCALL = 7, /* syscall */
257 PERF_BR_SYSRET = 8, /* syscall return */
258 PERF_BR_COND_CALL = 9, /* conditional function call */
259 PERF_BR_COND_RET = 10, /* conditional function return */
260 PERF_BR_ERET = 11, /* exception return */
261 PERF_BR_IRQ = 12, /* irq */
262 PERF_BR_SERROR = 13, /* system error */
263 PERF_BR_NO_TX = 14, /* not in transaction */
264 PERF_BR_EXTEND_ABI = 15, /* extend ABI */
252 PERF_BR_UNKNOWN = 0, /* Unknown */
253 PERF_BR_COND = 1, /* Conditional */
254 PERF_BR_UNCOND = 2, /* Unconditional */
255 PERF_BR_IND = 3, /* Indirect */
256 PERF_BR_CALL = 4, /* Function call */
257 PERF_BR_IND_CALL = 5, /* Indirect function call */
258 PERF_BR_RET = 6, /* Function return */
259 PERF_BR_SYSCALL = 7, /* Syscall */
260 PERF_BR_SYSRET = 8, /* Syscall return */
261 PERF_BR_COND_CALL = 9, /* Conditional function call */
262 PERF_BR_COND_RET = 10, /* Conditional function return */
263 PERF_BR_ERET = 11, /* Exception return */
264 PERF_BR_IRQ = 12, /* IRQ */
265 PERF_BR_SERROR = 13, /* System error */
266 PERF_BR_NO_TX = 14, /* Not in transaction */
267 PERF_BR_EXTEND_ABI = 15, /* Extend ABI */
265268 PERF_BR_MAX,
266269};
267270
268271/*
269 * Common branch speculation outcome classification
272 * Common branch speculation outcome classifications:
270273 */
271274enum {
272 PERF_BR_SPEC_NA = 0, /* Not available */
273 PERF_BR_SPEC_WRONG_PATH = 1, /* Speculative but on wrong path */
274 PERF_BR_NON_SPEC_CORRECT_PATH = 2, /* Non-speculative but on correct path */
275 PERF_BR_SPEC_CORRECT_PATH = 3, /* Speculative and on correct path */
275 PERF_BR_SPEC_NA = 0, /* Not available */
276 PERF_BR_SPEC_WRONG_PATH = 1, /* Speculative but on wrong path */
277 PERF_BR_NON_SPEC_CORRECT_PATH = 2, /* Non-speculative but on correct path */
278 PERF_BR_SPEC_CORRECT_PATH = 3, /* Speculative and on correct path */
276279 PERF_BR_SPEC_MAX,
277280};
278281
279282enum {
280 PERF_BR_NEW_FAULT_ALGN = 0, /* Alignment fault */
281 PERF_BR_NEW_FAULT_DATA = 1, /* Data fault */
282 PERF_BR_NEW_FAULT_INST = 2, /* Inst fault */
283 PERF_BR_NEW_ARCH_1 = 3, /* Architecture specific */
284 PERF_BR_NEW_ARCH_2 = 4, /* Architecture specific */
285 PERF_BR_NEW_ARCH_3 = 5, /* Architecture specific */
286 PERF_BR_NEW_ARCH_4 = 6, /* Architecture specific */
287 PERF_BR_NEW_ARCH_5 = 7, /* Architecture specific */
283 PERF_BR_NEW_FAULT_ALGN = 0, /* Alignment fault */
284 PERF_BR_NEW_FAULT_DATA = 1, /* Data fault */
285 PERF_BR_NEW_FAULT_INST = 2, /* Inst fault */
286 PERF_BR_NEW_ARCH_1 = 3, /* Architecture specific */
287 PERF_BR_NEW_ARCH_2 = 4, /* Architecture specific */
288 PERF_BR_NEW_ARCH_3 = 5, /* Architecture specific */
289 PERF_BR_NEW_ARCH_4 = 6, /* Architecture specific */
290 PERF_BR_NEW_ARCH_5 = 7, /* Architecture specific */
288291 PERF_BR_NEW_MAX,
289292};
290293
291294enum {
292 PERF_BR_PRIV_UNKNOWN = 0,
293 PERF_BR_PRIV_USER = 1,
294 PERF_BR_PRIV_KERNEL = 2,
295 PERF_BR_PRIV_HV = 3,
295 PERF_BR_PRIV_UNKNOWN = 0,
296 PERF_BR_PRIV_USER = 1,
297 PERF_BR_PRIV_KERNEL = 2,
298 PERF_BR_PRIV_HV = 3,
296299};
297300
298#define PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1
299#define PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2
300#define PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3
301#define PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4
302#define PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5
301#define PERF_BR_ARM64_FIQ PERF_BR_NEW_ARCH_1
302#define PERF_BR_ARM64_DEBUG_HALT PERF_BR_NEW_ARCH_2
303#define PERF_BR_ARM64_DEBUG_EXIT PERF_BR_NEW_ARCH_3
304#define PERF_BR_ARM64_DEBUG_INST PERF_BR_NEW_ARCH_4
305#define PERF_BR_ARM64_DEBUG_DATA PERF_BR_NEW_ARCH_5
303306
304307#define PERF_SAMPLE_BRANCH_PLM_ALL \
305308 (PERF_SAMPLE_BRANCH_USER|\
......@@ -310,9 +313,9 @@ enum {
310313 * Values to determine ABI of the registers dump.
311314 */
312315enum perf_sample_regs_abi {
313 PERF_SAMPLE_REGS_ABI_NONE = 0,
314 PERF_SAMPLE_REGS_ABI_32 = 1,
315 PERF_SAMPLE_REGS_ABI_64 = 2,
316 PERF_SAMPLE_REGS_ABI_NONE = 0,
317 PERF_SAMPLE_REGS_ABI_32 = 1,
318 PERF_SAMPLE_REGS_ABI_64 = 2,
316319};
317320
318321/*
......@@ -320,21 +323,21 @@ enum perf_sample_regs_abi {
320323 * abort events. Multiple bits can be set.
321324 */
322325enum {
323 PERF_TXN_ELISION = (1 << 0), /* From elision */
324 PERF_TXN_TRANSACTION = (1 << 1), /* From transaction */
325 PERF_TXN_SYNC = (1 << 2), /* Instruction is related */
326 PERF_TXN_ASYNC = (1 << 3), /* Instruction not related */
327 PERF_TXN_RETRY = (1 << 4), /* Retry possible */
328 PERF_TXN_CONFLICT = (1 << 5), /* Conflict abort */
329 PERF_TXN_CAPACITY_WRITE = (1 << 6), /* Capacity write abort */
330 PERF_TXN_CAPACITY_READ = (1 << 7), /* Capacity read abort */
326 PERF_TXN_ELISION = (1 << 0), /* From elision */
327 PERF_TXN_TRANSACTION = (1 << 1), /* From transaction */
328 PERF_TXN_SYNC = (1 << 2), /* Instruction is related */
329 PERF_TXN_ASYNC = (1 << 3), /* Instruction is not related */
330 PERF_TXN_RETRY = (1 << 4), /* Retry possible */
331 PERF_TXN_CONFLICT = (1 << 5), /* Conflict abort */
332 PERF_TXN_CAPACITY_WRITE = (1 << 6), /* Capacity write abort */
333 PERF_TXN_CAPACITY_READ = (1 << 7), /* Capacity read abort */
331334
332 PERF_TXN_MAX = (1 << 8), /* non-ABI */
335 PERF_TXN_MAX = (1 << 8), /* non-ABI */
333336
334 /* bits 32..63 are reserved for the abort code */
337 /* Bits 32..63 are reserved for the abort code */
335338
336 PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
337 PERF_TXN_ABORT_SHIFT = 32,
339 PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
340 PERF_TXN_ABORT_SHIFT = 32,
338341};
339342
340343/*
......@@ -369,22 +372,22 @@ enum perf_event_read_format {
369372 PERF_FORMAT_MAX = 1U << 5, /* non-ABI */
370373};
371374
372#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
373#define PERF_ATTR_SIZE_VER1 72 /* add: config2 */
374#define PERF_ATTR_SIZE_VER2 80 /* add: branch_sample_type */
375#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
376 /* add: sample_stack_user */
377#define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */
378#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */
379#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */
380#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */
381#define PERF_ATTR_SIZE_VER8 136 /* add: config3 */
375#define PERF_ATTR_SIZE_VER0 64 /* Size of first published 'struct perf_event_attr' */
376#define PERF_ATTR_SIZE_VER1 72 /* Add: config2 */
377#define PERF_ATTR_SIZE_VER2 80 /* Add: branch_sample_type */
378#define PERF_ATTR_SIZE_VER3 96 /* Add: sample_regs_user */
379 /* Add: sample_stack_user */
380#define PERF_ATTR_SIZE_VER4 104 /* Add: sample_regs_intr */
381#define PERF_ATTR_SIZE_VER5 112 /* Add: aux_watermark */
382#define PERF_ATTR_SIZE_VER6 120 /* Add: aux_sample_size */
383#define PERF_ATTR_SIZE_VER7 128 /* Add: sig_data */
384#define PERF_ATTR_SIZE_VER8 136 /* Add: config3 */
382385
383386/*
384 * Hardware event_id to monitor via a performance monitoring event:
385 *
386 * @sample_max_stack: Max number of frame pointers in a callchain,
387 * should be < /proc/sys/kernel/perf_event_max_stack
387 * 'struct perf_event_attr' contains various attributes that define
388 * a performance event - most of them hardware related configuration
389 * details, but also a lot of behavioral switches and values implemented
390 * by the kernel.
388391 */
389392struct perf_event_attr {
390393
......@@ -394,7 +397,7 @@ struct perf_event_attr {
394397 __u32 type;
395398
396399 /*
397 * Size of the attr structure, for fwd/bwd compat.
400 * Size of the attr structure, for forward/backwards compatibility.
398401 */
399402 __u32 size;
400403
......@@ -449,21 +452,21 @@ struct perf_event_attr {
449452 comm_exec : 1, /* flag comm events that are due to an exec */
450453 use_clockid : 1, /* use @clockid for time fields */
451454 context_switch : 1, /* context switch data */
452 write_backward : 1, /* Write ring buffer from end to beginning */
455 write_backward : 1, /* write ring buffer from end to beginning */
453456 namespaces : 1, /* include namespaces data */
454457 ksymbol : 1, /* include ksymbol events */
455 bpf_event : 1, /* include bpf events */
458 bpf_event : 1, /* include BPF events */
456459 aux_output : 1, /* generate AUX records instead of events */
457460 cgroup : 1, /* include cgroup events */
458461 text_poke : 1, /* include text poke events */
459 build_id : 1, /* use build id in mmap2 events */
462 build_id : 1, /* use build ID in mmap2 events */
460463 inherit_thread : 1, /* children only inherit if cloned with CLONE_THREAD */
461464 remove_on_exec : 1, /* event is removed from task on exec */
462465 sigtrap : 1, /* send synchronous SIGTRAP on event */
463466 __reserved_1 : 26;
464467
465468 union {
466 __u32 wakeup_events; /* wakeup every n events */
469 __u32 wakeup_events; /* wake up every n events */
467470 __u32 wakeup_watermark; /* bytes before wakeup */
468471 };
469472
......@@ -472,13 +475,13 @@ struct perf_event_attr {
472475 __u64 bp_addr;
473476 __u64 kprobe_func; /* for perf_kprobe */
474477 __u64 uprobe_path; /* for perf_uprobe */
475 __u64 config1; /* extension of config */
478 __u64 config1; /* extension of config */
476479 };
477480 union {
478481 __u64 bp_len;
479 __u64 kprobe_addr; /* when kprobe_func == NULL */
482 __u64 kprobe_addr; /* when kprobe_func == NULL */
480483 __u64 probe_offset; /* for perf_[k,u]probe */
481 __u64 config2; /* extension of config1 */
484 __u64 config2; /* extension of config1 */
482485 };
483486 __u64 branch_sample_type; /* enum perf_branch_sample_type */
484487
......@@ -508,7 +511,16 @@ struct perf_event_attr {
508511 * Wakeup watermark for AUX area
509512 */
510513 __u32 aux_watermark;
514
515 /*
516 * Max number of frame pointers in a callchain, should be
517 * lower than /proc/sys/kernel/perf_event_max_stack.
518 *
519 * Max number of entries of branch stack should be lower
520 * than the hardware limit.
521 */
511522 __u16 sample_max_stack;
523
512524 __u16 __reserved_2;
513525 __u32 aux_sample_size;
514526
......@@ -535,7 +547,7 @@ struct perf_event_attr {
535547
536548/*
537549 * Structure used by below PERF_EVENT_IOC_QUERY_BPF command
538 * to query bpf programs attached to the same perf tracepoint
550 * to query BPF programs attached to the same perf tracepoint
539551 * as the given perf event.
540552 */
541553struct perf_event_query_bpf {
......@@ -557,21 +569,21 @@ struct perf_event_query_bpf {
557569/*
558570 * Ioctls that can be done on a perf event fd:
559571 */
560#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
561#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
562#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
563#define PERF_EVENT_IOC_RESET _IO ('$', 3)
564#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
565#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
566#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
567#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
568#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
569#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
572#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
573#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
574#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
575#define PERF_EVENT_IOC_RESET _IO ('$', 3)
576#define PERF_EVENT_IOC_PERIOD _IOW ('$', 4, __u64)
577#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
578#define PERF_EVENT_IOC_SET_FILTER _IOW ('$', 6, char *)
579#define PERF_EVENT_IOC_ID _IOR ('$', 7, __u64 *)
580#define PERF_EVENT_IOC_SET_BPF _IOW ('$', 8, __u32)
581#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW ('$', 9, __u32)
570582#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
571#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *)
583#define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW ('$', 11, struct perf_event_attr *)
572584
573585enum perf_event_ioc_flags {
574 PERF_IOC_FLAG_GROUP = 1U << 0,
586 PERF_IOC_FLAG_GROUP = 1U << 0,
575587};
576588
577589/*
......@@ -582,7 +594,7 @@ struct perf_event_mmap_page {
582594 __u32 compat_version; /* lowest version this is compat with */
583595
584596 /*
585 * Bits needed to read the hw events in user-space.
597 * Bits needed to read the HW events in user-space.
586598 *
587599 * u32 seq, time_mult, time_shift, index, width;
588600 * u64 count, enabled, running;
......@@ -620,7 +632,7 @@ struct perf_event_mmap_page {
620632 __u32 index; /* hardware event identifier */
621633 __s64 offset; /* add to hardware event value */
622634 __u64 time_enabled; /* time event active */
623 __u64 time_running; /* time event on cpu */
635 __u64 time_running; /* time event on CPU */
624636 union {
625637 __u64 capabilities;
626638 struct {
......@@ -648,7 +660,7 @@ struct perf_event_mmap_page {
648660
649661 /*
650662 * If cap_usr_time the below fields can be used to compute the time
651 * delta since time_enabled (in ns) using rdtsc or similar.
663 * delta since time_enabled (in ns) using RDTSC or similar.
652664 *
653665 * u64 quot, rem;
654666 * u64 delta;
......@@ -721,7 +733,7 @@ struct perf_event_mmap_page {
721733 * after reading this value.
722734 *
723735 * When the mapping is PROT_WRITE the @data_tail value should be
724 * written by userspace to reflect the last read data, after issueing
736 * written by user-space to reflect the last read data, after issuing
725737 * an smp_mb() to separate the data read from the ->data_tail store.
726738 * In this case the kernel will not over-write unread data.
727739 *
......@@ -737,7 +749,7 @@ struct perf_event_mmap_page {
737749
738750 /*
739751 * AUX area is defined by aux_{offset,size} fields that should be set
740 * by the userspace, so that
752 * by the user-space, so that
741753 *
742754 * aux_offset >= data_offset + data_size
743755 *
......@@ -811,7 +823,7 @@ struct perf_event_mmap_page {
811823 * Indicates that thread was preempted in TASK_RUNNING state.
812824 *
813825 * PERF_RECORD_MISC_MMAP_BUILD_ID:
814 * Indicates that mmap2 event carries build id data.
826 * Indicates that mmap2 event carries build ID data.
815827 */
816828#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
817829#define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)
......@@ -822,26 +834,26 @@ struct perf_event_mmap_page {
822834#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
823835
824836struct perf_event_header {
825 __u32 type;
826 __u16 misc;
827 __u16 size;
837 __u32 type;
838 __u16 misc;
839 __u16 size;
828840};
829841
830842struct perf_ns_link_info {
831 __u64 dev;
832 __u64 ino;
843 __u64 dev;
844 __u64 ino;
833845};
834846
835847enum {
836 NET_NS_INDEX = 0,
837 UTS_NS_INDEX = 1,
838 IPC_NS_INDEX = 2,
839 PID_NS_INDEX = 3,
840 USER_NS_INDEX = 4,
841 MNT_NS_INDEX = 5,
842 CGROUP_NS_INDEX = 6,
843
844 NR_NAMESPACES, /* number of available namespaces */
848 NET_NS_INDEX = 0,
849 UTS_NS_INDEX = 1,
850 IPC_NS_INDEX = 2,
851 PID_NS_INDEX = 3,
852 USER_NS_INDEX = 4,
853 MNT_NS_INDEX = 5,
854 CGROUP_NS_INDEX = 6,
855
856 NR_NAMESPACES, /* number of available namespaces */
845857};
846858
847859enum perf_event_type {
......@@ -857,11 +869,11 @@ enum perf_event_type {
857869 * optional fields being ignored.
858870 *
859871 * struct sample_id {
860 * { u32 pid, tid; } && PERF_SAMPLE_TID
861 * { u64 time; } && PERF_SAMPLE_TIME
862 * { u64 id; } && PERF_SAMPLE_ID
863 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
864 * { u32 cpu, res; } && PERF_SAMPLE_CPU
872 * { u32 pid, tid; } && PERF_SAMPLE_TID
873 * { u64 time; } && PERF_SAMPLE_TIME
874 * { u64 id; } && PERF_SAMPLE_ID
875 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
876 * { u32 cpu, res; } && PERF_SAMPLE_CPU
865877 * { u64 id; } && PERF_SAMPLE_IDENTIFIER
866878 * } && perf_event_attr::sample_id_all
867879 *
......@@ -872,7 +884,7 @@ enum perf_event_type {
872884
873885 /*
874886 * The MMAP events record the PROT_EXEC mappings so that we can
875 * correlate userspace IPs to code. They have the following structure:
887 * correlate user-space IPs to code. They have the following structure:
876888 *
877889 * struct {
878890 * struct perf_event_header header;
......@@ -882,7 +894,7 @@ enum perf_event_type {
882894 * u64 len;
883895 * u64 pgoff;
884896 * char filename[];
885 * struct sample_id sample_id;
897 * struct sample_id sample_id;
886898 * };
887899 */
888900 PERF_RECORD_MMAP = 1,
......@@ -892,7 +904,7 @@ enum perf_event_type {
892904 * struct perf_event_header header;
893905 * u64 id;
894906 * u64 lost;
895 * struct sample_id sample_id;
907 * struct sample_id sample_id;
896908 * };
897909 */
898910 PERF_RECORD_LOST = 2,
......@@ -903,7 +915,7 @@ enum perf_event_type {
903915 *
904916 * u32 pid, tid;
905917 * char comm[];
906 * struct sample_id sample_id;
918 * struct sample_id sample_id;
907919 * };
908920 */
909921 PERF_RECORD_COMM = 3,
......@@ -914,7 +926,7 @@ enum perf_event_type {
914926 * u32 pid, ppid;
915927 * u32 tid, ptid;
916928 * u64 time;
917 * struct sample_id sample_id;
929 * struct sample_id sample_id;
918930 * };
919931 */
920932 PERF_RECORD_EXIT = 4,
......@@ -925,7 +937,7 @@ enum perf_event_type {
925937 * u64 time;
926938 * u64 id;
927939 * u64 stream_id;
928 * struct sample_id sample_id;
940 * struct sample_id sample_id;
929941 * };
930942 */
931943 PERF_RECORD_THROTTLE = 5,
......@@ -937,7 +949,7 @@ enum perf_event_type {
937949 * u32 pid, ppid;
938950 * u32 tid, ptid;
939951 * u64 time;
940 * struct sample_id sample_id;
952 * struct sample_id sample_id;
941953 * };
942954 */
943955 PERF_RECORD_FORK = 7,
......@@ -948,7 +960,7 @@ enum perf_event_type {
948960 * u32 pid, tid;
949961 *
950962 * struct read_format values;
951 * struct sample_id sample_id;
963 * struct sample_id sample_id;
952964 * };
953965 */
954966 PERF_RECORD_READ = 8,
......@@ -1003,12 +1015,12 @@ enum perf_event_type {
10031015 * { u64 counters; } cntr[nr] && PERF_SAMPLE_BRANCH_COUNTERS
10041016 * } && PERF_SAMPLE_BRANCH_STACK
10051017 *
1006 * { u64 abi; # enum perf_sample_regs_abi
1007 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
1018 * { u64 abi; # enum perf_sample_regs_abi
1019 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_USER
10081020 *
1009 * { u64 size;
1010 * char data[size];
1011 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
1021 * { u64 size;
1022 * char data[size];
1023 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
10121024 *
10131025 * { union perf_sample_weight
10141026 * {
......@@ -1033,10 +1045,11 @@ enum perf_event_type {
10331045 * { u64 abi; # enum perf_sample_regs_abi
10341046 * u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
10351047 * { u64 phys_addr;} && PERF_SAMPLE_PHYS_ADDR
1036 * { u64 size;
1037 * char data[size]; } && PERF_SAMPLE_AUX
1048 * { u64 cgroup;} && PERF_SAMPLE_CGROUP
10381049 * { u64 data_page_size;} && PERF_SAMPLE_DATA_PAGE_SIZE
10391050 * { u64 code_page_size;} && PERF_SAMPLE_CODE_PAGE_SIZE
1051 * { u64 size;
1052 * char data[size]; } && PERF_SAMPLE_AUX
10401053 * };
10411054 */
10421055 PERF_RECORD_SAMPLE = 9,
......@@ -1068,7 +1081,7 @@ enum perf_event_type {
10681081 * };
10691082 * u32 prot, flags;
10701083 * char filename[];
1071 * struct sample_id sample_id;
1084 * struct sample_id sample_id;
10721085 * };
10731086 */
10741087 PERF_RECORD_MMAP2 = 10,
......@@ -1077,12 +1090,12 @@ enum perf_event_type {
10771090 * Records that new data landed in the AUX buffer part.
10781091 *
10791092 * struct {
1080 * struct perf_event_header header;
1093 * struct perf_event_header header;
10811094 *
1082 * u64 aux_offset;
1083 * u64 aux_size;
1095 * u64 aux_offset;
1096 * u64 aux_size;
10841097 * u64 flags;
1085 * struct sample_id sample_id;
1098 * struct sample_id sample_id;
10861099 * };
10871100 */
10881101 PERF_RECORD_AUX = 11,
......@@ -1165,7 +1178,7 @@ enum perf_event_type {
11651178 PERF_RECORD_KSYMBOL = 17,
11661179
11671180 /*
1168 * Record bpf events:
1181 * Record BPF events:
11691182 * enum perf_bpf_event_type {
11701183 * PERF_BPF_EVENT_UNKNOWN = 0,
11711184 * PERF_BPF_EVENT_PROG_LOAD = 1,
......@@ -1243,181 +1256,181 @@ enum perf_record_ksymbol_type {
12431256#define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0)
12441257
12451258enum perf_bpf_event_type {
1246 PERF_BPF_EVENT_UNKNOWN = 0,
1247 PERF_BPF_EVENT_PROG_LOAD = 1,
1248 PERF_BPF_EVENT_PROG_UNLOAD = 2,
1249 PERF_BPF_EVENT_MAX, /* non-ABI */
1259 PERF_BPF_EVENT_UNKNOWN = 0,
1260 PERF_BPF_EVENT_PROG_LOAD = 1,
1261 PERF_BPF_EVENT_PROG_UNLOAD = 2,
1262 PERF_BPF_EVENT_MAX, /* non-ABI */
12501263};
12511264
1252#define PERF_MAX_STACK_DEPTH 127
1253#define PERF_MAX_CONTEXTS_PER_STACK 8
1265#define PERF_MAX_STACK_DEPTH 127
1266#define PERF_MAX_CONTEXTS_PER_STACK 8
12541267
12551268enum perf_callchain_context {
1256 PERF_CONTEXT_HV = (__u64)-32,
1257 PERF_CONTEXT_KERNEL = (__u64)-128,
1258 PERF_CONTEXT_USER = (__u64)-512,
1269 PERF_CONTEXT_HV = (__u64)-32,
1270 PERF_CONTEXT_KERNEL = (__u64)-128,
1271 PERF_CONTEXT_USER = (__u64)-512,
12591272
1260 PERF_CONTEXT_GUEST = (__u64)-2048,
1261 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
1262 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
1273 PERF_CONTEXT_GUEST = (__u64)-2048,
1274 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
1275 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
12631276
1264 PERF_CONTEXT_MAX = (__u64)-4095,
1277 PERF_CONTEXT_MAX = (__u64)-4095,
12651278};
12661279
12671280/**
12681281 * PERF_RECORD_AUX::flags bits
12691282 */
1270#define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */
1271#define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */
1272#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */
1273#define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */
1283#define PERF_AUX_FLAG_TRUNCATED 0x0001 /* Record was truncated to fit */
1284#define PERF_AUX_FLAG_OVERWRITE 0x0002 /* Snapshot from overwrite mode */
1285#define PERF_AUX_FLAG_PARTIAL 0x0004 /* Record contains gaps */
1286#define PERF_AUX_FLAG_COLLISION 0x0008 /* Sample collided with another */
12741287#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 /* PMU specific trace format type */
12751288
12761289/* CoreSight PMU AUX buffer formats */
1277#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 /* Default for backward compatibility */
1278#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 /* Raw format of the source */
1290#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 /* Default for backward compatibility */
1291#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 /* Raw format of the source */
12791292
1280#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
1281#define PERF_FLAG_FD_OUTPUT (1UL << 1)
1282#define PERF_FLAG_PID_CGROUP (1UL << 2) /* pid=cgroup id, per-cpu mode only */
1283#define PERF_FLAG_FD_CLOEXEC (1UL << 3) /* O_CLOEXEC */
1293#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
1294#define PERF_FLAG_FD_OUTPUT (1UL << 1)
1295#define PERF_FLAG_PID_CGROUP (1UL << 2) /* pid=cgroup ID, per-CPU mode only */
1296#define PERF_FLAG_FD_CLOEXEC (1UL << 3) /* O_CLOEXEC */
12841297
12851298#if defined(__LITTLE_ENDIAN_BITFIELD)
12861299union perf_mem_data_src {
12871300 __u64 val;
12881301 struct {
1289 __u64 mem_op:5, /* type of opcode */
1290 mem_lvl:14, /* memory hierarchy level */
1291 mem_snoop:5, /* snoop mode */
1292 mem_lock:2, /* lock instr */
1293 mem_dtlb:7, /* tlb access */
1294 mem_lvl_num:4, /* memory hierarchy level number */
1295 mem_remote:1, /* remote */
1296 mem_snoopx:2, /* snoop mode, ext */
1297 mem_blk:3, /* access blocked */
1298 mem_hops:3, /* hop level */
1299 mem_rsvd:18;
1302 __u64 mem_op : 5, /* Type of opcode */
1303 mem_lvl : 14, /* Memory hierarchy level */
1304 mem_snoop : 5, /* Snoop mode */
1305 mem_lock : 2, /* Lock instr */
1306 mem_dtlb : 7, /* TLB access */
1307 mem_lvl_num : 4, /* Memory hierarchy level number */
1308 mem_remote : 1, /* Remote */
1309 mem_snoopx : 2, /* Snoop mode, ext */
1310 mem_blk : 3, /* Access blocked */
1311 mem_hops : 3, /* Hop level */
1312 mem_rsvd : 18;
13001313 };
13011314};
13021315#elif defined(__BIG_ENDIAN_BITFIELD)
13031316union perf_mem_data_src {
13041317 __u64 val;
13051318 struct {
1306 __u64 mem_rsvd:18,
1307 mem_hops:3, /* hop level */
1308 mem_blk:3, /* access blocked */
1309 mem_snoopx:2, /* snoop mode, ext */
1310 mem_remote:1, /* remote */
1311 mem_lvl_num:4, /* memory hierarchy level number */
1312 mem_dtlb:7, /* tlb access */
1313 mem_lock:2, /* lock instr */
1314 mem_snoop:5, /* snoop mode */
1315 mem_lvl:14, /* memory hierarchy level */
1316 mem_op:5; /* type of opcode */
1319 __u64 mem_rsvd : 18,
1320 mem_hops : 3, /* Hop level */
1321 mem_blk : 3, /* Access blocked */
1322 mem_snoopx : 2, /* Snoop mode, ext */
1323 mem_remote : 1, /* Remote */
1324 mem_lvl_num : 4, /* Memory hierarchy level number */
1325 mem_dtlb : 7, /* TLB access */
1326 mem_lock : 2, /* Lock instr */
1327 mem_snoop : 5, /* Snoop mode */
1328 mem_lvl : 14, /* Memory hierarchy level */
1329 mem_op : 5; /* Type of opcode */
13171330 };
13181331};
13191332#else
1320#error "Unknown endianness"
1333# error "Unknown endianness"
13211334#endif
13221335
1323/* type of opcode (load/store/prefetch,code) */
1324#define PERF_MEM_OP_NA 0x01 /* not available */
1325#define PERF_MEM_OP_LOAD 0x02 /* load instruction */
1326#define PERF_MEM_OP_STORE 0x04 /* store instruction */
1327#define PERF_MEM_OP_PFETCH 0x08 /* prefetch */
1328#define PERF_MEM_OP_EXEC 0x10 /* code (execution) */
1329#define PERF_MEM_OP_SHIFT 0
1336/* Type of memory opcode: */
1337#define PERF_MEM_OP_NA 0x0001 /* Not available */
1338#define PERF_MEM_OP_LOAD 0x0002 /* Load instruction */
1339#define PERF_MEM_OP_STORE 0x0004 /* Store instruction */
1340#define PERF_MEM_OP_PFETCH 0x0008 /* Prefetch */
1341#define PERF_MEM_OP_EXEC 0x0010 /* Code (execution) */
1342#define PERF_MEM_OP_SHIFT 0
13301343
13311344/*
1332 * PERF_MEM_LVL_* namespace being depricated to some extent in the
1345 * The PERF_MEM_LVL_* namespace is being deprecated to some extent in
13331346 * favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_} fields.
1334 * Supporting this namespace inorder to not break defined ABIs.
1347 * We support this namespace in order to not break defined ABIs.
13351348 *
1336 * memory hierarchy (memory level, hit or miss)
1349 * Memory hierarchy (memory level, hit or miss)
13371350 */
1338#define PERF_MEM_LVL_NA 0x01 /* not available */
1339#define PERF_MEM_LVL_HIT 0x02 /* hit level */
1340#define PERF_MEM_LVL_MISS 0x04 /* miss level */
1341#define PERF_MEM_LVL_L1 0x08 /* L1 */
1342#define PERF_MEM_LVL_LFB 0x10 /* Line Fill Buffer */
1343#define PERF_MEM_LVL_L2 0x20 /* L2 */
1344#define PERF_MEM_LVL_L3 0x40 /* L3 */
1345#define PERF_MEM_LVL_LOC_RAM 0x80 /* Local DRAM */
1346#define PERF_MEM_LVL_REM_RAM1 0x100 /* Remote DRAM (1 hop) */
1347#define PERF_MEM_LVL_REM_RAM2 0x200 /* Remote DRAM (2 hops) */
1348#define PERF_MEM_LVL_REM_CCE1 0x400 /* Remote Cache (1 hop) */
1349#define PERF_MEM_LVL_REM_CCE2 0x800 /* Remote Cache (2 hops) */
1350#define PERF_MEM_LVL_IO 0x1000 /* I/O memory */
1351#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
1352#define PERF_MEM_LVL_SHIFT 5
1353
1354#define PERF_MEM_REMOTE_REMOTE 0x01 /* Remote */
1355#define PERF_MEM_REMOTE_SHIFT 37
1356
1357#define PERF_MEM_LVLNUM_L1 0x01 /* L1 */
1358#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
1359#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
1360#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
1361#define PERF_MEM_LVLNUM_L2_MHB 0x05 /* L2 Miss Handling Buffer */
1362#define PERF_MEM_LVLNUM_MSC 0x06 /* Memory-side Cache */
1363/* 0x7 available */
1364#define PERF_MEM_LVLNUM_UNC 0x08 /* Uncached */
1365#define PERF_MEM_LVLNUM_CXL 0x09 /* CXL */
1366#define PERF_MEM_LVLNUM_IO 0x0a /* I/O */
1367#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
1368#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB / L1 Miss Handling Buffer */
1369#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */
1370#define PERF_MEM_LVLNUM_PMEM 0x0e /* PMEM */
1371#define PERF_MEM_LVLNUM_NA 0x0f /* N/A */
1372
1373#define PERF_MEM_LVLNUM_SHIFT 33
1374
1375/* snoop mode */
1376#define PERF_MEM_SNOOP_NA 0x01 /* not available */
1377#define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
1378#define PERF_MEM_SNOOP_HIT 0x04 /* snoop hit */
1379#define PERF_MEM_SNOOP_MISS 0x08 /* snoop miss */
1380#define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
1381#define PERF_MEM_SNOOP_SHIFT 19
1382
1383#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1384#define PERF_MEM_SNOOPX_PEER 0x02 /* xfer from peer */
1385#define PERF_MEM_SNOOPX_SHIFT 38
1386
1387/* locked instruction */
1388#define PERF_MEM_LOCK_NA 0x01 /* not available */
1389#define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
1390#define PERF_MEM_LOCK_SHIFT 24
1351#define PERF_MEM_LVL_NA 0x0001 /* Not available */
1352#define PERF_MEM_LVL_HIT 0x0002 /* Hit level */
1353#define PERF_MEM_LVL_MISS 0x0004 /* Miss level */
1354#define PERF_MEM_LVL_L1 0x0008 /* L1 */
1355#define PERF_MEM_LVL_LFB 0x0010 /* Line Fill Buffer */
1356#define PERF_MEM_LVL_L2 0x0020 /* L2 */
1357#define PERF_MEM_LVL_L3 0x0040 /* L3 */
1358#define PERF_MEM_LVL_LOC_RAM 0x0080 /* Local DRAM */
1359#define PERF_MEM_LVL_REM_RAM1 0x0100 /* Remote DRAM (1 hop) */
1360#define PERF_MEM_LVL_REM_RAM2 0x0200 /* Remote DRAM (2 hops) */
1361#define PERF_MEM_LVL_REM_CCE1 0x0400 /* Remote Cache (1 hop) */
1362#define PERF_MEM_LVL_REM_CCE2 0x0800 /* Remote Cache (2 hops) */
1363#define PERF_MEM_LVL_IO 0x1000 /* I/O memory */
1364#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
1365#define PERF_MEM_LVL_SHIFT 5
1366
1367#define PERF_MEM_REMOTE_REMOTE 0x0001 /* Remote */
1368#define PERF_MEM_REMOTE_SHIFT 37
1369
1370#define PERF_MEM_LVLNUM_L1 0x0001 /* L1 */
1371#define PERF_MEM_LVLNUM_L2 0x0002 /* L2 */
1372#define PERF_MEM_LVLNUM_L3 0x0003 /* L3 */
1373#define PERF_MEM_LVLNUM_L4 0x0004 /* L4 */
1374#define PERF_MEM_LVLNUM_L2_MHB 0x0005 /* L2 Miss Handling Buffer */
1375#define PERF_MEM_LVLNUM_MSC 0x0006 /* Memory-side Cache */
1376/* 0x007 available */
1377#define PERF_MEM_LVLNUM_UNC 0x0008 /* Uncached */
1378#define PERF_MEM_LVLNUM_CXL 0x0009 /* CXL */
1379#define PERF_MEM_LVLNUM_IO 0x000a /* I/O */
1380#define PERF_MEM_LVLNUM_ANY_CACHE 0x000b /* Any cache */
1381#define PERF_MEM_LVLNUM_LFB 0x000c /* LFB / L1 Miss Handling Buffer */
1382#define PERF_MEM_LVLNUM_RAM 0x000d /* RAM */
1383#define PERF_MEM_LVLNUM_PMEM 0x000e /* PMEM */
1384#define PERF_MEM_LVLNUM_NA 0x000f /* N/A */
1385
1386#define PERF_MEM_LVLNUM_SHIFT 33
1387
1388/* Snoop mode */
1389#define PERF_MEM_SNOOP_NA 0x0001 /* Not available */
1390#define PERF_MEM_SNOOP_NONE 0x0002 /* No snoop */
1391#define PERF_MEM_SNOOP_HIT 0x0004 /* Snoop hit */
1392#define PERF_MEM_SNOOP_MISS 0x0008 /* Snoop miss */
1393#define PERF_MEM_SNOOP_HITM 0x0010 /* Snoop hit modified */
1394#define PERF_MEM_SNOOP_SHIFT 19
1395
1396#define PERF_MEM_SNOOPX_FWD 0x0001 /* Forward */
1397#define PERF_MEM_SNOOPX_PEER 0x0002 /* Transfer from peer */
1398#define PERF_MEM_SNOOPX_SHIFT 38
1399
1400/* Locked instruction */
1401#define PERF_MEM_LOCK_NA 0x0001 /* Not available */
1402#define PERF_MEM_LOCK_LOCKED 0x0002 /* Locked transaction */
1403#define PERF_MEM_LOCK_SHIFT 24
13911404
13921405/* TLB access */
1393#define PERF_MEM_TLB_NA 0x01 /* not available */
1394#define PERF_MEM_TLB_HIT 0x02 /* hit level */
1395#define PERF_MEM_TLB_MISS 0x04 /* miss level */
1396#define PERF_MEM_TLB_L1 0x08 /* L1 */
1397#define PERF_MEM_TLB_L2 0x10 /* L2 */
1398#define PERF_MEM_TLB_WK 0x20 /* Hardware Walker*/
1399#define PERF_MEM_TLB_OS 0x40 /* OS fault handler */
1400#define PERF_MEM_TLB_SHIFT 26
1406#define PERF_MEM_TLB_NA 0x0001 /* Not available */
1407#define PERF_MEM_TLB_HIT 0x0002 /* Hit level */
1408#define PERF_MEM_TLB_MISS 0x0004 /* Miss level */
1409#define PERF_MEM_TLB_L1 0x0008 /* L1 */
1410#define PERF_MEM_TLB_L2 0x0010 /* L2 */
1411#define PERF_MEM_TLB_WK 0x0020 /* Hardware Walker*/
1412#define PERF_MEM_TLB_OS 0x0040 /* OS fault handler */
1413#define PERF_MEM_TLB_SHIFT 26
14011414
14021415/* Access blocked */
1403#define PERF_MEM_BLK_NA 0x01 /* not available */
1404#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */
1405#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */
1406#define PERF_MEM_BLK_SHIFT 40
1407
1408/* hop level */
1409#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */
1410#define PERF_MEM_HOPS_1 0x02 /* remote node, same socket */
1411#define PERF_MEM_HOPS_2 0x03 /* remote socket, same board */
1412#define PERF_MEM_HOPS_3 0x04 /* remote board */
1416#define PERF_MEM_BLK_NA 0x0001 /* Not available */
1417#define PERF_MEM_BLK_DATA 0x0002 /* Data could not be forwarded */
1418#define PERF_MEM_BLK_ADDR 0x0004 /* Address conflict */
1419#define PERF_MEM_BLK_SHIFT 40
1420
1421/* Hop level */
1422#define PERF_MEM_HOPS_0 0x0001 /* Remote core, same node */
1423#define PERF_MEM_HOPS_1 0x0002 /* Remote node, same socket */
1424#define PERF_MEM_HOPS_2 0x0003 /* Remote socket, same board */
1425#define PERF_MEM_HOPS_3 0x0004 /* Remote board */
14131426/* 5-7 available */
1414#define PERF_MEM_HOPS_SHIFT 43
1427#define PERF_MEM_HOPS_SHIFT 43
14151428
14161429#define PERF_MEM_S(a, s) \
14171430 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
14181431
14191432/*
1420 * single taken branch record layout:
1433 * Layout of single taken branch records:
14211434 *
14221435 * from: source instruction (may not always be a branch insn)
14231436 * to: branch target
......@@ -1436,37 +1449,37 @@ union perf_mem_data_src {
14361449struct perf_branch_entry {
14371450 __u64 from;
14381451 __u64 to;
1439 __u64 mispred:1, /* target mispredicted */
1440 predicted:1,/* target predicted */
1441 in_tx:1, /* in transaction */
1442 abort:1, /* transaction abort */
1443 cycles:16, /* cycle count to last branch */
1444 type:4, /* branch type */
1445 spec:2, /* branch speculation info */
1446 new_type:4, /* additional branch type */
1447 priv:3, /* privilege level */
1448 reserved:31;
1452 __u64 mispred : 1, /* target mispredicted */
1453 predicted : 1, /* target predicted */
1454 in_tx : 1, /* in transaction */
1455 abort : 1, /* transaction abort */
1456 cycles : 16, /* cycle count to last branch */
1457 type : 4, /* branch type */
1458 spec : 2, /* branch speculation info */
1459 new_type : 4, /* additional branch type */
1460 priv : 3, /* privilege level */
1461 reserved : 31;
14491462};
14501463
14511464/* Size of used info bits in struct perf_branch_entry */
14521465#define PERF_BRANCH_ENTRY_INFO_BITS_MAX 33
14531466
14541467union perf_sample_weight {
1455 __u64 full;
1468 __u64 full;
14561469#if defined(__LITTLE_ENDIAN_BITFIELD)
14571470 struct {
1458 __u32 var1_dw;
1459 __u16 var2_w;
1460 __u16 var3_w;
1471 __u32 var1_dw;
1472 __u16 var2_w;
1473 __u16 var3_w;
14611474 };
14621475#elif defined(__BIG_ENDIAN_BITFIELD)
14631476 struct {
1464 __u16 var3_w;
1465 __u16 var2_w;
1466 __u32 var1_dw;
1477 __u16 var3_w;
1478 __u16 var2_w;
1479 __u32 var1_dw;
14671480 };
14681481#else
1469#error "Unknown endianness"
1482# error "Unknown endianness"
14701483#endif
14711484};
14721485
lib/libc/include/any-linux-any/linux/pfrut.h+1
......@@ -89,6 +89,7 @@ struct pfru_payload_hdr {
8989 __u32 hw_ver;
9090 __u32 rt_ver;
9191 __u8 platform_id[16];
92 __u32 svn_ver;
9293};
9394
9495enum pfru_dsm_status {
lib/libc/include/any-linux-any/linux/pidfd.h+27-1
......@@ -20,9 +20,33 @@
2020#define PIDFD_INFO_PID (1UL << 0) /* Always returned, even if not requested */
2121#define PIDFD_INFO_CREDS (1UL << 1) /* Always returned, even if not requested */
2222#define PIDFD_INFO_CGROUPID (1UL << 2) /* Always returned if available, even if not requested */
23#define PIDFD_INFO_EXIT (1UL << 3) /* Only returned if requested. */
24#define PIDFD_INFO_COREDUMP (1UL << 4) /* Only returned if requested. */
2325
2426#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */
2527
28/*
29 * Values for @coredump_mask in pidfd_info.
30 * Only valid if PIDFD_INFO_COREDUMP is set in @mask.
31 *
32 * Note, the @PIDFD_COREDUMP_ROOT flag indicates that the generated
33 * coredump should be treated as sensitive and access should only be
34 * granted to privileged users.
35 */
36#define PIDFD_COREDUMPED (1U << 0) /* Did crash and... */
37#define PIDFD_COREDUMP_SKIP (1U << 1) /* coredumping generation was skipped. */
38#define PIDFD_COREDUMP_USER (1U << 2) /* coredump was done as the user. */
39#define PIDFD_COREDUMP_ROOT (1U << 3) /* coredump was done as root. */
40
41/*
42 * ...and for userland we make life simpler - PIDFD_SELF refers to the current
43 * thread, PIDFD_SELF_PROCESS refers to the process thread group leader.
44 *
45 * For nearly all practical uses, a user will want to use PIDFD_SELF.
46 */
47#define PIDFD_SELF PIDFD_SELF_THREAD
48#define PIDFD_SELF_PROCESS PIDFD_SELF_THREAD_GROUP
49
2650struct pidfd_info {
2751 /*
2852 * This mask is similar to the request_mask in statx(2).
......@@ -62,7 +86,9 @@ struct pidfd_info {
6286 __u32 sgid;
6387 __u32 fsuid;
6488 __u32 fsgid;
65 __u32 spare0[1];
89 __s32 exit_code;
90 __u32 coredump_mask;
91 __u32 __spare1;
6692};
6793
6894#define PIDFS_IOCTL_MAGIC 0xFF
lib/libc/include/any-linux-any/linux/pkt_cls.h+1
......@@ -697,6 +697,7 @@ enum {
697697};
698698
699699#define TCA_FLOWER_KEY_CFM_OPT_MAX (__TCA_FLOWER_KEY_CFM_OPT_MAX - 1)
700#define TCA_FLOWER_KEY_CFM_MAX (__TCA_FLOWER_KEY_CFM_OPT_MAX - 1)
700701
701702#define TCA_FLOWER_MASK_FLAGS_RANGE (1 << 0) /* Range-based match */
702703
lib/libc/include/any-linux-any/linux/pkt_sched.h+69
......@@ -1182,6 +1182,7 @@ enum {
11821182 TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY, /* single entry */
11831183 TCA_TAPRIO_ATTR_SCHED_CLOCKID, /* s32 */
11841184 TCA_TAPRIO_PAD,
1185 TCA_TAPRIO_ATTR_PAD = TCA_TAPRIO_PAD,
11851186 TCA_TAPRIO_ATTR_ADMIN_SCHED, /* The admin sched, only used in dump */
11861187 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
11871188 TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
......@@ -1210,4 +1211,72 @@ enum {
12101211
12111212#define TCA_ETS_MAX (__TCA_ETS_MAX - 1)
12121213
1214/* DUALPI2 */
1215enum tc_dualpi2_drop_overload {
1216 TC_DUALPI2_DROP_OVERLOAD_OVERFLOW = 0,
1217 TC_DUALPI2_DROP_OVERLOAD_DROP = 1,
1218 __TCA_DUALPI2_DROP_OVERLOAD_MAX,
1219};
1220#define TCA_DUALPI2_DROP_OVERLOAD_MAX (__TCA_DUALPI2_DROP_OVERLOAD_MAX - 1)
1221
1222enum tc_dualpi2_drop_early {
1223 TC_DUALPI2_DROP_EARLY_DROP_DEQUEUE = 0,
1224 TC_DUALPI2_DROP_EARLY_DROP_ENQUEUE = 1,
1225 __TCA_DUALPI2_DROP_EARLY_MAX,
1226};
1227#define TCA_DUALPI2_DROP_EARLY_MAX (__TCA_DUALPI2_DROP_EARLY_MAX - 1)
1228
1229enum tc_dualpi2_ecn_mask {
1230 TC_DUALPI2_ECN_MASK_L4S_ECT = 1,
1231 TC_DUALPI2_ECN_MASK_CLA_ECT = 2,
1232 TC_DUALPI2_ECN_MASK_ANY_ECT = 3,
1233 __TCA_DUALPI2_ECN_MASK_MAX,
1234};
1235#define TCA_DUALPI2_ECN_MASK_MAX (__TCA_DUALPI2_ECN_MASK_MAX - 1)
1236
1237enum tc_dualpi2_split_gso {
1238 TC_DUALPI2_SPLIT_GSO_NO_SPLIT_GSO = 0,
1239 TC_DUALPI2_SPLIT_GSO_SPLIT_GSO = 1,
1240 __TCA_DUALPI2_SPLIT_GSO_MAX,
1241};
1242#define TCA_DUALPI2_SPLIT_GSO_MAX (__TCA_DUALPI2_SPLIT_GSO_MAX - 1)
1243
1244enum {
1245 TCA_DUALPI2_UNSPEC,
1246 TCA_DUALPI2_LIMIT, /* Packets */
1247 TCA_DUALPI2_MEMORY_LIMIT, /* Bytes */
1248 TCA_DUALPI2_TARGET, /* us */
1249 TCA_DUALPI2_TUPDATE, /* us */
1250 TCA_DUALPI2_ALPHA, /* Hz scaled up by 256 */
1251 TCA_DUALPI2_BETA, /* Hz scaled up by 256 */
1252 TCA_DUALPI2_STEP_THRESH_PKTS, /* Step threshold in packets */
1253 TCA_DUALPI2_STEP_THRESH_US, /* Step threshold in microseconds */
1254 TCA_DUALPI2_MIN_QLEN_STEP, /* Minimum qlen to apply STEP_THRESH */
1255 TCA_DUALPI2_COUPLING, /* Coupling factor between queues */
1256 TCA_DUALPI2_DROP_OVERLOAD, /* Whether to drop on overload */
1257 TCA_DUALPI2_DROP_EARLY, /* Whether to drop on enqueue */
1258 TCA_DUALPI2_C_PROTECTION, /* Percentage */
1259 TCA_DUALPI2_ECN_MASK, /* L4S queue classification mask */
1260 TCA_DUALPI2_SPLIT_GSO, /* Split GSO packets at enqueue */
1261 TCA_DUALPI2_PAD,
1262 __TCA_DUALPI2_MAX
1263};
1264
1265#define TCA_DUALPI2_MAX (__TCA_DUALPI2_MAX - 1)
1266
1267struct tc_dualpi2_xstats {
1268 __u32 prob; /* current probability */
1269 __u32 delay_c; /* current delay in C queue */
1270 __u32 delay_l; /* current delay in L queue */
1271 __u32 packets_in_c; /* number of packets enqueued in C queue */
1272 __u32 packets_in_l; /* number of packets enqueued in L queue */
1273 __u32 maxq; /* maximum queue size */
1274 __u32 ecn_mark; /* packets marked with ecn*/
1275 __u32 step_marks; /* ECN marks due to the step AQM */
1276 __s32 credit; /* current c_protection credit */
1277 __u32 memory_used; /* Memory used by both queues */
1278 __u32 max_memory_used; /* Maximum used memory */
1279 __u32 memory_limit; /* Memory limit of both queues */
1280};
1281
12131282#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/pps_gen.h created+37
......@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * PPS generator API header
4 *
5 * Copyright (C) 2024 Rodolfo Giometti <giometti@enneenne.com>
6 */
7
8#ifndef _PPS_GEN_H_
9#define _PPS_GEN_H_
10
11#include <linux/types.h>
12#include <linux/ioctl.h>
13
14/**
15 * struct pps_gen_event - the PPS generator events
16 * @event: the event type
17 * @sequence: the event sequence number
18 *
19 * Userspace can get the last PPS generator event by using the
20 * ioctl(pps_gen, PPS_GEN_FETCHEVENT, ...) syscall.
21 * The sequence field can be used to save the last event ID, while in the
22 * event field is stored the last event type. Currently known event is:
23 *
24 * PPS_GEN_EVENT_MISSEDPULSE : last pulse was not generated
25 */
26struct pps_gen_event {
27 unsigned int event;
28 unsigned int sequence;
29};
30
31#define PPS_GEN_EVENT_MISSEDPULSE 1
32
33#define PPS_GEN_SETENABLE _IOW('p', 0xb1, unsigned int *)
34#define PPS_GEN_USESYSTEMCLOCK _IOR('p', 0xb2, unsigned int *)
35#define PPS_GEN_FETCHEVENT _IOR('p', 0xb3, struct pps_gen_event *)
36
37#endif /* _PPS_GEN_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/prctl.h+24-1
......@@ -244,6 +244,8 @@ struct prctl_mm_map {
244244# define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT)
245245/* Unused; kept only for source compatibility */
246246# define PR_MTE_TCF_SHIFT 1
247/* MTE tag check store only */
248# define PR_MTE_STORE_ONLY (1UL << 19)
247249/* RISC-V pointer masking tag length */
248250# define PR_PMLEN_SHIFT 24
249251# define PR_PMLEN_MASK (0x7fUL << PR_PMLEN_SHIFT)
......@@ -255,7 +257,12 @@ struct prctl_mm_map {
255257/* Dispatch syscalls to a userspace handler */
256258#define PR_SET_SYSCALL_USER_DISPATCH 59
257259# define PR_SYS_DISPATCH_OFF 0
258# define PR_SYS_DISPATCH_ON 1
260/* Enable dispatch except for the specified range */
261# define PR_SYS_DISPATCH_EXCLUSIVE_ON 1
262/* Enable dispatch for the specified range */
263# define PR_SYS_DISPATCH_INCLUSIVE_ON 2
264/* Legacy name for backwards compatibility */
265# define PR_SYS_DISPATCH_ON PR_SYS_DISPATCH_EXCLUSIVE_ON
259266/* The control values for the user space selector when dispatch is enabled */
260267# define SYSCALL_DISPATCH_FILTER_ALLOW 0
261268# define SYSCALL_DISPATCH_FILTER_BLOCK 1
......@@ -353,4 +360,20 @@ struct prctl_mm_map {
353360 */
354361#define PR_LOCK_SHADOW_STACK_STATUS 76
355362
363/*
364 * Controls the mode of timer_create() for CRIU restore operations.
365 * Enabling this allows CRIU to restore timers with explicit IDs.
366 *
367 * Don't use for normal operations as the result might be undefined.
368 */
369#define PR_TIMER_CREATE_RESTORE_IDS 77
370# define PR_TIMER_CREATE_RESTORE_IDS_OFF 0
371# define PR_TIMER_CREATE_RESTORE_IDS_ON 1
372# define PR_TIMER_CREATE_RESTORE_IDS_GET 2
373
374/* FUTEX hash management */
375#define PR_FUTEX_HASH 78
376# define PR_FUTEX_HASH_SET_SLOTS 1
377# define PR_FUTEX_HASH_GET_SLOTS 2
378
356379#endif /* _LINUX_PRCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/psp-sev.h+14-7
......@@ -73,13 +73,20 @@ typedef enum {
7373 SEV_RET_INVALID_PARAM,
7474 SEV_RET_RESOURCE_LIMIT,
7575 SEV_RET_SECURE_DATA_INVALID,
76 SEV_RET_INVALID_KEY = 0x27,
77 SEV_RET_INVALID_PAGE_SIZE,
78 SEV_RET_INVALID_PAGE_STATE,
79 SEV_RET_INVALID_MDATA_ENTRY,
80 SEV_RET_INVALID_PAGE_OWNER,
81 SEV_RET_INVALID_PAGE_AEAD_OFLOW,
82 SEV_RET_RMP_INIT_REQUIRED,
76 SEV_RET_INVALID_PAGE_SIZE = 0x0019,
77 SEV_RET_INVALID_PAGE_STATE = 0x001A,
78 SEV_RET_INVALID_MDATA_ENTRY = 0x001B,
79 SEV_RET_INVALID_PAGE_OWNER = 0x001C,
80 SEV_RET_AEAD_OFLOW = 0x001D,
81 SEV_RET_EXIT_RING_BUFFER = 0x001F,
82 SEV_RET_RMP_INIT_REQUIRED = 0x0020,
83 SEV_RET_BAD_SVN = 0x0021,
84 SEV_RET_BAD_VERSION = 0x0022,
85 SEV_RET_SHUTDOWN_REQUIRED = 0x0023,
86 SEV_RET_UPDATE_FAILED = 0x0024,
87 SEV_RET_RESTORE_REQUIRED = 0x0025,
88 SEV_RET_RMP_INITIALIZATION_FAILED = 0x0026,
89 SEV_RET_INVALID_KEY = 0x0027,
8390 SEV_RET_MAX,
8491} sev_ret_code;
8592
lib/libc/include/any-linux-any/linux/ptp_clock.h+3
......@@ -37,6 +37,9 @@
3737
3838/*
3939 * flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl.
40 *
41 * Note: PTP_STRICT_FLAGS is always enabled by the kernel for
42 * PTP_EXTTS_REQUEST2 regardless of whether it is set by userspace.
4043 */
4144#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
4245 PTP_RISING_EDGE | \
lib/libc/include/any-linux-any/linux/ptrace.h+6-1
......@@ -74,6 +74,7 @@ struct seccomp_metadata {
7474};
7575
7676#define PTRACE_GET_SYSCALL_INFO 0x420e
77#define PTRACE_SET_SYSCALL_INFO 0x4212
7778#define PTRACE_SYSCALL_INFO_NONE 0
7879#define PTRACE_SYSCALL_INFO_ENTRY 1
7980#define PTRACE_SYSCALL_INFO_EXIT 2
......@@ -81,7 +82,8 @@ struct seccomp_metadata {
8182
8283struct ptrace_syscall_info {
8384 __u8 op; /* PTRACE_SYSCALL_INFO_* */
84 __u8 pad[3];
85 __u8 reserved;
86 __u16 flags;
8587 __u32 arch;
8688 __u64 instruction_pointer;
8789 __u64 stack_pointer;
......@@ -98,6 +100,7 @@ struct ptrace_syscall_info {
98100 __u64 nr;
99101 __u64 args[6];
100102 __u32 ret_data;
103 __u32 reserved2;
101104 } seccomp;
102105 };
103106};
......@@ -142,6 +145,8 @@ struct ptrace_sud_config {
142145 __u64 len;
143146};
144147
148/* 0x4212 is PTRACE_SET_SYSCALL_INFO */
149
145150/*
146151 * These values are stored in task->ptrace_message
147152 * by ptrace_stop to describe the current syscall-stop.
lib/libc/include/any-linux-any/linux/pwm.h created+53
......@@ -0,0 +1,53 @@
1/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2
3#ifndef _PWM_H_
4#define _PWM_H_
5
6#include <linux/ioctl.h>
7#include <linux/types.h>
8
9/**
10 * struct pwmchip_waveform - Describe a PWM waveform for a pwm_chip's PWM channel
11 * @hwpwm: per-chip relative index of the PWM device
12 * @__pad: padding, must be zero
13 * @period_length_ns: duration of the repeating period.
14 * A value of 0 represents a disabled PWM.
15 * @duty_length_ns: duration of the active part in each period
16 * @duty_offset_ns: offset of the rising edge from a period's start
17 */
18struct pwmchip_waveform {
19 __u32 hwpwm;
20 __u32 __pad;
21 __u64 period_length_ns;
22 __u64 duty_length_ns;
23 __u64 duty_offset_ns;
24};
25
26/* Reserves the passed hwpwm for exclusive control. */
27#define PWM_IOCTL_REQUEST _IO(0x75, 1)
28
29/* counter part to PWM_IOCTL_REQUEST */
30#define PWM_IOCTL_FREE _IO(0x75, 2)
31
32/*
33 * Modifies the passed wf according to hardware constraints. All parameters are
34 * rounded down to the next possible value, unless there is no such value, then
35 * values are rounded up. Note that zero isn't considered for rounding down
36 * period_length_ns.
37 */
38#define PWM_IOCTL_ROUNDWF _IOWR(0x75, 3, struct pwmchip_waveform)
39
40/* Get the currently implemented waveform */
41#define PWM_IOCTL_GETWF _IOWR(0x75, 4, struct pwmchip_waveform)
42
43/* Like PWM_IOCTL_ROUNDWF + PWM_IOCTL_SETEXACTWF in one go. */
44#define PWM_IOCTL_SETROUNDEDWF _IOW(0x75, 5, struct pwmchip_waveform)
45
46/*
47 * Program the PWM to emit exactly the passed waveform, subject only to rounding
48 * down each value less than 1 ns. Returns 0 on success, -EDOM if the waveform
49 * cannot be implemented exactly, or other negative error codes.
50 */
51#define PWM_IOCTL_SETEXACTWF _IOW(0x75, 6, struct pwmchip_waveform)
52
53#endif /* _PWM_H_ */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/raid/md_p.h+1-1
......@@ -173,7 +173,7 @@ typedef struct mdp_superblock_s {
173173#else
174174#error unspecified endianness
175175#endif
176 __u32 recovery_cp; /* 11 recovery checkpoint sector count */
176 __u32 recovery_cp; /* 11 resync checkpoint sector count */
177177 /* There are only valid for minor_version > 90 */
178178 __u64 reshape_position; /* 12,13 next address in array-space for reshape */
179179 __u32 new_level; /* 14 new level we are reshaping to */
lib/libc/include/any-linux-any/linux/rkisp1-config.h+106-2
......@@ -169,6 +169,13 @@
169169 */
170170#define RKISP1_CIF_ISP_COMPAND_NUM_POINTS 64
171171
172/*
173 * Wide Dynamic Range
174 */
175#define RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV 32
176#define RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF (RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV + 1)
177#define RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS 4
178
172179/*
173180 * Measurement types
174181 */
......@@ -889,6 +896,72 @@ struct rkisp1_cif_isp_compand_curve_config {
889896 __u32 y[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];
890897};
891898
899/**
900 * struct rkisp1_cif_isp_wdr_tone_curve - Tone mapping curve definition for WDR.
901 *
902 * @dY: the dYn increments for horizontal (input) axis of the tone curve.
903 * each 3-bit dY value represents an increment of 2**(value+3).
904 * dY[0] bits 0:2 is increment dY1, bit 3 unused
905 * dY[0] bits 4:6 is increment dY2, bit 7 unused
906 * ...
907 * dY[0] bits 28:30 is increment dY8, bit 31 unused
908 * ... and so on till dY[3] bits 28:30 is increment dY32, bit 31 unused.
909 * @ym: the Ym values for the vertical (output) axis of the tone curve.
910 * each value is 13 bit.
911 */
912struct rkisp1_cif_isp_wdr_tone_curve {
913 __u32 dY[RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS];
914 __u16 ym[RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF];
915};
916
917/**
918 * struct rkisp1_cif_isp_wdr_iref_config - Illumination reference config for WDR.
919 *
920 * Use illumination reference value as described below, instead of only the
921 * luminance (Y) value for tone mapping and gain calculations:
922 * IRef = (rgb_factor * RGBMax_tr + (8 - rgb_factor) * Y)/8
923 *
924 * @rgb_factor: defines how much influence the RGBmax approach has in
925 * comparison to Y (valid values are 0..8).
926 * @use_y9_8: use Y*9/8 for maximum value calculation along with the
927 * default of R, G, B for noise reduction.
928 * @use_rgb7_8: decrease RGBMax by 7/8 for noise reduction.
929 * @disable_transient: disable transient calculation between Y and RGBY_max.
930 */
931struct rkisp1_cif_isp_wdr_iref_config {
932 __u8 rgb_factor;
933 __u8 use_y9_8;
934 __u8 use_rgb7_8;
935 __u8 disable_transient;
936};
937
938/**
939 * struct rkisp1_cif_isp_wdr_config - Configuration for wide dynamic range.
940 *
941 * @tone_curve: tone mapping curve.
942 * @iref_config: illumination reference configuration. (when use_iref is true)
943 * @rgb_offset: RGB offset value for RGB operation mode. (12 bits)
944 * @luma_offset: luminance offset value for RGB operation mode. (12 bits)
945 * @dmin_thresh: lower threshold for deltaMin value. (12 bits)
946 * @dmin_strength: strength factor for deltaMin. (valid range is 0x00..0x10)
947 * @use_rgb_colorspace: use RGB instead of luminance/chrominance colorspace.
948 * @bypass_chroma_mapping: disable chrominance mapping (only valid if
949 * use_rgb_colorspace = 0)
950 * @use_iref: use illumination reference instead of Y for tone mapping
951 * and gain calculations.
952 */
953struct rkisp1_cif_isp_wdr_config {
954 struct rkisp1_cif_isp_wdr_tone_curve tone_curve;
955 struct rkisp1_cif_isp_wdr_iref_config iref_config;
956 __u16 rgb_offset;
957 __u16 luma_offset;
958 __u16 dmin_thresh;
959 __u8 dmin_strength;
960 __u8 use_rgb_colorspace;
961 __u8 bypass_chroma_mapping;
962 __u8 use_iref;
963};
964
892965/*---------- PART2: Measurement Statistics ------------*/
893966
894967/**
......@@ -1059,6 +1132,7 @@ struct rkisp1_stat_buffer {
10591132 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS: BLS in the compand block
10601133 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve
10611134 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve
1135 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR: Wide dynamic range
10621136 */
10631137enum rkisp1_ext_params_block_type {
10641138 RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS,
......@@ -1081,11 +1155,15 @@ enum rkisp1_ext_params_block_type {
10811155 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS,
10821156 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND,
10831157 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS,
1158 RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR,
10841159};
10851160
10861161#define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE (1U << 0)
10871162#define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE (1U << 1)
10881163
1164/* A bitmask of parameters blocks supported on the current hardware. */
1165#define RKISP1_CID_SUPPORTED_PARAMS_BLOCKS (V4L2_CID_USER_RKISP1_BASE + 0x01)
1166
10891167/**
10901168 * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block
10911169 * header
......@@ -1460,6 +1538,23 @@ struct rkisp1_ext_params_compand_curve_config {
14601538 struct rkisp1_cif_isp_compand_curve_config config;
14611539} __attribute__((aligned(8)));
14621540
1541/**
1542 * struct rkisp1_ext_params_wdr_config - RkISP1 extensible params
1543 * Wide dynamic range config
1544 *
1545 * RkISP1 extensible parameters WDR block.
1546 * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR`
1547 *
1548 * @header: The RkISP1 extensible parameters header, see
1549 * :c:type:`rkisp1_ext_params_block_header`
1550 * @config: WDR configuration, see
1551 * :c:type:`rkisp1_cif_isp_wdr_config`
1552 */
1553struct rkisp1_ext_params_wdr_config {
1554 struct rkisp1_ext_params_block_header header;
1555 struct rkisp1_cif_isp_wdr_config config;
1556} __attribute__((aligned(8)));
1557
14631558/*
14641559 * The rkisp1_ext_params_compand_curve_config structure is counted twice as it
14651560 * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types.
......@@ -1484,7 +1579,8 @@ struct rkisp1_ext_params_compand_curve_config {
14841579 sizeof(struct rkisp1_ext_params_afc_config) +\
14851580 sizeof(struct rkisp1_ext_params_compand_bls_config) +\
14861581 sizeof(struct rkisp1_ext_params_compand_curve_config) +\
1487 sizeof(struct rkisp1_ext_params_compand_curve_config))
1582 sizeof(struct rkisp1_ext_params_compand_curve_config) +\
1583 sizeof(struct rkisp1_ext_params_wdr_config))
14881584
14891585/**
14901586 * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version
......@@ -1520,6 +1616,14 @@ enum rksip1_ext_param_buffer_version {
15201616 * V4L2 control. If such control is not available, userspace should assume only
15211617 * RKISP1_EXT_PARAM_BUFFER_V1 is supported by the driver.
15221618 *
1619 * The read-only V4L2 control ``RKISP1_CID_SUPPORTED_PARAMS_BLOCKS`` can be used
1620 * to query the blocks supported by the device. It contains a bitmask where each
1621 * bit represents the availability of the corresponding entry from the
1622 * :c:type:`rkisp1_ext_params_block_type` enum. The current and default values
1623 * of the control represents the blocks supported by the device instance, while
1624 * the maximum value represents the blocks supported by the kernel driver,
1625 * independently of the device instance.
1626 *
15231627 * For each ISP block that userspace wants to configure, a block-specific
15241628 * structure is appended to the @data buffer, one after the other without gaps
15251629 * in between nor overlaps. Userspace shall populate the @data_size field with
......@@ -1528,7 +1632,7 @@ enum rksip1_ext_param_buffer_version {
15281632 * The expected memory layout of the parameters buffer is::
15291633 *
15301634 * +-------------------- struct rkisp1_ext_params_cfg -------------------+
1531 * | version = RKISP_EXT_PARAMS_BUFFER_V1; |
1635 * | version = RKISP1_EXT_PARAM_BUFFER_V1; |
15321636 * | data_size = sizeof(struct rkisp1_ext_params_bls_config) |
15331637 * | + sizeof(struct rkisp1_ext_params_dpcc_config); |
15341638 * | +------------------------- data ---------------------------------+ |
lib/libc/include/any-linux-any/linux/rtnetlink.h+18-2
......@@ -93,10 +93,18 @@ enum {
9393 RTM_NEWPREFIX = 52,
9494#define RTM_NEWPREFIX RTM_NEWPREFIX
9595
96 RTM_GETMULTICAST = 58,
96 RTM_NEWMULTICAST = 56,
97#define RTM_NEWMULTICAST RTM_NEWMULTICAST
98 RTM_DELMULTICAST,
99#define RTM_DELMULTICAST RTM_DELMULTICAST
100 RTM_GETMULTICAST,
97101#define RTM_GETMULTICAST RTM_GETMULTICAST
98102
99 RTM_GETANYCAST = 62,
103 RTM_NEWANYCAST = 60,
104#define RTM_NEWANYCAST RTM_NEWANYCAST
105 RTM_DELANYCAST,
106#define RTM_DELANYCAST RTM_DELANYCAST
107 RTM_GETANYCAST,
100108#define RTM_GETANYCAST RTM_GETANYCAST
101109
102110 RTM_NEWNEIGHTBL = 64,
......@@ -299,6 +307,7 @@ enum {
299307#define RTPROT_MROUTED 17 /* Multicast daemon */
300308#define RTPROT_KEEPALIVED 18 /* Keepalived daemon */
301309#define RTPROT_BABEL 42 /* Babel daemon */
310#define RTPROT_OVN 84 /* OVN daemon */
302311#define RTPROT_OPENR 99 /* Open Routing (Open/R) Routes */
303312#define RTPROT_BGP 186 /* BGP Routes */
304313#define RTPROT_ISIS 187 /* ISIS Routes */
......@@ -389,6 +398,7 @@ enum rtattr_type_t {
389398 RTA_SPORT,
390399 RTA_DPORT,
391400 RTA_NH_ID,
401 RTA_FLOWLABEL,
392402 __RTA_MAX
393403};
394404
......@@ -772,6 +782,12 @@ enum rtnetlink_groups {
772782#define RTNLGRP_TUNNEL RTNLGRP_TUNNEL
773783 RTNLGRP_STATS,
774784#define RTNLGRP_STATS RTNLGRP_STATS
785 RTNLGRP_IPV4_MCADDR,
786#define RTNLGRP_IPV4_MCADDR RTNLGRP_IPV4_MCADDR
787 RTNLGRP_IPV6_MCADDR,
788#define RTNLGRP_IPV6_MCADDR RTNLGRP_IPV6_MCADDR
789 RTNLGRP_IPV6_ACADDR,
790#define RTNLGRP_IPV6_ACADDR RTNLGRP_IPV6_ACADDR
775791 __RTNLGRP_MAX
776792};
777793#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
lib/libc/include/any-linux-any/linux/rxrpc.h+65-12
......@@ -36,26 +36,33 @@ struct sockaddr_rxrpc {
3636#define RXRPC_MIN_SECURITY_LEVEL 4 /* minimum security level */
3737#define RXRPC_UPGRADEABLE_SERVICE 5 /* Upgrade service[0] -> service[1] */
3838#define RXRPC_SUPPORTED_CMSG 6 /* Get highest supported control message type */
39#define RXRPC_MANAGE_RESPONSE 7 /* [clnt] Want to manage RESPONSE packets */
3940
4041/*
4142 * RxRPC control messages
4243 * - If neither abort or accept are specified, the message is a data message.
4344 * - terminal messages mean that a user call ID tag can be recycled
45 * - C/S/- indicate whether these are applicable to client, server or both
4446 * - s/r/- indicate whether these are applicable to sendmsg() and/or recvmsg()
4547 */
4648enum rxrpc_cmsg_type {
47 RXRPC_USER_CALL_ID = 1, /* sr: user call ID specifier */
48 RXRPC_ABORT = 2, /* sr: abort request / notification [terminal] */
49 RXRPC_ACK = 3, /* -r: [Service] RPC op final ACK received [terminal] */
50 RXRPC_NET_ERROR = 5, /* -r: network error received [terminal] */
51 RXRPC_BUSY = 6, /* -r: server busy received [terminal] */
52 RXRPC_LOCAL_ERROR = 7, /* -r: local error generated [terminal] */
53 RXRPC_NEW_CALL = 8, /* -r: [Service] new incoming call notification */
54 RXRPC_EXCLUSIVE_CALL = 10, /* s-: Call should be on exclusive connection */
55 RXRPC_UPGRADE_SERVICE = 11, /* s-: Request service upgrade for client call */
56 RXRPC_TX_LENGTH = 12, /* s-: Total length of Tx data */
57 RXRPC_SET_CALL_TIMEOUT = 13, /* s-: Set one or more call timeouts */
58 RXRPC_CHARGE_ACCEPT = 14, /* s-: Charge the accept pool with a user call ID */
49 RXRPC_USER_CALL_ID = 1, /* -sr: User call ID specifier */
50 RXRPC_ABORT = 2, /* -sr: Abort request / notification [terminal] */
51 RXRPC_ACK = 3, /* S-r: RPC op final ACK received [terminal] */
52 RXRPC_NET_ERROR = 5, /* --r: Network error received [terminal] */
53 RXRPC_BUSY = 6, /* C-r: Server busy received [terminal] */
54 RXRPC_LOCAL_ERROR = 7, /* --r: Local error generated [terminal] */
55 RXRPC_NEW_CALL = 8, /* S-r: New incoming call notification */
56 RXRPC_EXCLUSIVE_CALL = 10, /* Cs-: Call should be on exclusive connection */
57 RXRPC_UPGRADE_SERVICE = 11, /* Cs-: Request service upgrade for client call */
58 RXRPC_TX_LENGTH = 12, /* -s-: Total length of Tx data */
59 RXRPC_SET_CALL_TIMEOUT = 13, /* -s-: Set one or more call timeouts */
60 RXRPC_CHARGE_ACCEPT = 14, /* Ss-: Charge the accept pool with a user call ID */
61 RXRPC_OOB_ID = 15, /* -sr: OOB message ID */
62 RXRPC_CHALLENGED = 16, /* C-r: Info on a received CHALLENGE */
63 RXRPC_RESPOND = 17, /* Cs-: Respond to a challenge */
64 RXRPC_RESPONDED = 18, /* S-r: Data received in RESPONSE */
65 RXRPC_RESP_RXGK_APPDATA = 19, /* Cs-: RESPONSE: RxGK app data to include */
5966 RXRPC__SUPPORTED
6067};
6168
......@@ -73,6 +80,7 @@ enum rxrpc_cmsg_type {
7380#define RXRPC_SECURITY_RXKAD 2 /* kaserver or kerberos 4 */
7481#define RXRPC_SECURITY_RXGK 4 /* gssapi-based */
7582#define RXRPC_SECURITY_RXK5 5 /* kerberos 5 */
83#define RXRPC_SECURITY_YFS_RXGK 6 /* YFS gssapi-based */
7684
7785/*
7886 * RxRPC-level abort codes
......@@ -118,4 +126,49 @@ enum rxrpc_cmsg_type {
118126#define RXKADDATALEN 19270411 /* user data too long */
119127#define RXKADILLEGALLEVEL 19270412 /* caller not authorised to use encrypted conns */
120128
129/*
130 * RxGK GSSAPI security abort codes.
131 */
132#if 0 /* Original standard abort codes (used by OpenAFS) */
133#define RXGK_INCONSISTENCY 1233242880 /* Security module structure inconsistent */
134#define RXGK_PACKETSHORT 1233242881 /* Packet too short for security challenge */
135#define RXGK_BADCHALLENGE 1233242882 /* Invalid security challenge */
136#define RXGK_BADETYPE 1233242883 /* Invalid or impermissible encryption type */
137#define RXGK_BADLEVEL 1233242884 /* Invalid or impermissible security level */
138#define RXGK_BADKEYNO 1233242885 /* Key version number not found */
139#define RXGK_EXPIRED 1233242886 /* Token has expired */
140#define RXGK_NOTAUTH 1233242887 /* Caller not authorized */
141#define RXGK_BAD_TOKEN 1233242888 /* Security object was passed a bad token */
142#define RXGK_SEALED_INCON 1233242889 /* Sealed data inconsistent */
143#define RXGK_DATA_LEN 1233242890 /* User data too long */
144#define RXGK_BAD_QOP 1233242891 /* Inadequate quality of protection available */
145#else /* Revised standard abort codes (used by YFS) */
146#define RXGK_INCONSISTENCY 1233242880 /* Security module structure inconsistent */
147#define RXGK_PACKETSHORT 1233242881 /* Packet too short for security challenge */
148#define RXGK_BADCHALLENGE 1233242882 /* Security challenge/response failed */
149#define RXGK_SEALEDINCON 1233242883 /* Sealed data is inconsistent */
150#define RXGK_NOTAUTH 1233242884 /* Caller not authorised */
151#define RXGK_EXPIRED 1233242885 /* Authentication expired */
152#define RXGK_BADLEVEL 1233242886 /* Unsupported or not permitted security level */
153#define RXGK_BADKEYNO 1233242887 /* Bad transport key number */
154#define RXGK_NOTRXGK 1233242888 /* Security layer is not rxgk */
155#define RXGK_UNSUPPORTED 1233242889 /* Endpoint does not support rxgk */
156#define RXGK_GSSERROR 1233242890 /* GSSAPI mechanism error */
157#endif
158
159/*
160 * Challenge information in the RXRPC_CHALLENGED control message.
161 */
162struct rxrpc_challenge {
163 __u16 service_id; /* The service ID of the connection (may be upgraded) */
164 __u8 security_index; /* The security index of the connection */
165 __u8 pad; /* Round out to a multiple of 4 bytes. */
166 /* ... The security class gets to append extra information ... */
167};
168
169struct rxgk_challenge {
170 struct rxrpc_challenge base;
171 __u32 enctype; /* Krb5 encoding type */
172};
173
121174#endif /* _LINUX_RXRPC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/securebits.h+23-1
......@@ -52,10 +52,32 @@
5252#define SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED \
5353 (issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE_LOCKED))
5454
55/* See Documentation/userspace-api/check_exec.rst */
56#define SECURE_EXEC_RESTRICT_FILE 8
57#define SECURE_EXEC_RESTRICT_FILE_LOCKED 9 /* make bit-8 immutable */
58
59#define SECBIT_EXEC_RESTRICT_FILE (issecure_mask(SECURE_EXEC_RESTRICT_FILE))
60#define SECBIT_EXEC_RESTRICT_FILE_LOCKED \
61 (issecure_mask(SECURE_EXEC_RESTRICT_FILE_LOCKED))
62
63/* See Documentation/userspace-api/check_exec.rst */
64#define SECURE_EXEC_DENY_INTERACTIVE 10
65#define SECURE_EXEC_DENY_INTERACTIVE_LOCKED 11 /* make bit-10 immutable */
66
67#define SECBIT_EXEC_DENY_INTERACTIVE \
68 (issecure_mask(SECURE_EXEC_DENY_INTERACTIVE))
69#define SECBIT_EXEC_DENY_INTERACTIVE_LOCKED \
70 (issecure_mask(SECURE_EXEC_DENY_INTERACTIVE_LOCKED))
71
5572#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \
5673 issecure_mask(SECURE_NO_SETUID_FIXUP) | \
5774 issecure_mask(SECURE_KEEP_CAPS) | \
58 issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE))
75 issecure_mask(SECURE_NO_CAP_AMBIENT_RAISE) | \
76 issecure_mask(SECURE_EXEC_RESTRICT_FILE) | \
77 issecure_mask(SECURE_EXEC_DENY_INTERACTIVE))
5978#define SECURE_ALL_LOCKS (SECURE_ALL_BITS << 1)
6079
80#define SECURE_ALL_UNPRIVILEGED (issecure_mask(SECURE_EXEC_RESTRICT_FILE) | \
81 issecure_mask(SECURE_EXEC_DENY_INTERACTIVE))
82
6183#endif /* _LINUX_SECUREBITS_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/snmp.h+17-6
......@@ -23,9 +23,14 @@ enum
2323 IPSTATS_MIB_INPKTS, /* InReceives */
2424 IPSTATS_MIB_INOCTETS, /* InOctets */
2525 IPSTATS_MIB_INDELIVERS, /* InDelivers */
26 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
26 IPSTATS_MIB_NOECTPKTS, /* InNoECTPkts */
27 IPSTATS_MIB_ECT1PKTS, /* InECT1Pkts */
28 IPSTATS_MIB_ECT0PKTS, /* InECT0Pkts */
29 IPSTATS_MIB_CEPKTS, /* InCEPkts */
2730 IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
31 IPSTATS_MIB_OUTPKTS, /* OutTransmits */
2832 IPSTATS_MIB_OUTOCTETS, /* OutOctets */
33 IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
2934/* other fields */
3035 IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
3136 IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
......@@ -52,12 +57,7 @@ enum
5257 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
5358 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */
5459 IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */
55 IPSTATS_MIB_NOECTPKTS, /* InNoECTPkts */
56 IPSTATS_MIB_ECT1PKTS, /* InECT1Pkts */
57 IPSTATS_MIB_ECT0PKTS, /* InECT0Pkts */
58 IPSTATS_MIB_CEPKTS, /* InCEPkts */
5960 IPSTATS_MIB_REASM_OVERLAPS, /* ReasmOverlaps */
60 IPSTATS_MIB_OUTPKTS, /* OutTransmits */
6161 __IPSTATS_MIB_MAX
6262};
6363
......@@ -186,6 +186,10 @@ enum
186186 LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
187187 LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
188188 LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
189 LINUX_MIB_BEYOND_WINDOW, /* BeyondWindow */
190 LINUX_MIB_TSECRREJECTED, /* TSEcrRejected */
191 LINUX_MIB_PAWS_OLD_ACK, /* PAWSOldAck */
192 LINUX_MIB_PAWS_TW_REJECTED, /* PAWSTimewait */
189193 LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
190194 LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
191195 LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
......@@ -339,6 +343,8 @@ enum
339343 LINUX_MIB_XFRMACQUIREERROR, /* XfrmAcquireError */
340344 LINUX_MIB_XFRMOUTSTATEDIRERROR, /* XfrmOutStateDirError */
341345 LINUX_MIB_XFRMINSTATEDIRERROR, /* XfrmInStateDirError */
346 LINUX_MIB_XFRMINIPTFSERROR, /* XfrmInIptfsError */
347 LINUX_MIB_XFRMOUTNOQSPACE, /* XfrmOutNoQueueSpace */
342348 __LINUX_MIB_XFRMMAX
343349};
344350
......@@ -358,6 +364,11 @@ enum
358364 LINUX_MIB_TLSRXDEVICERESYNC, /* TlsRxDeviceResync */
359365 LINUX_MIB_TLSDECRYPTRETRY, /* TlsDecryptRetry */
360366 LINUX_MIB_TLSRXNOPADVIOL, /* TlsRxNoPadViolation */
367 LINUX_MIB_TLSRXREKEYOK, /* TlsRxRekeyOk */
368 LINUX_MIB_TLSRXREKEYERROR, /* TlsRxRekeyError */
369 LINUX_MIB_TLSTXREKEYOK, /* TlsTxRekeyOk */
370 LINUX_MIB_TLSTXREKEYERROR, /* TlsTxRekeyError */
371 LINUX_MIB_TLSRXREKEYRECEIVED, /* TlsRxRekeyReceived */
361372 __LINUX_MIB_TLSMAX
362373};
363374
lib/libc/include/any-linux-any/linux/stat.h+81-26
......@@ -98,43 +98,97 @@ struct statx_timestamp {
9898 */
9999struct statx {
100100 /* 0x00 */
101 __u32 stx_mask; /* What results were written [uncond] */
102 __u32 stx_blksize; /* Preferred general I/O size [uncond] */
103 __u64 stx_attributes; /* Flags conveying information about the file [uncond] */
101 /* What results were written [uncond] */
102 __u32 stx_mask;
103
104 /* Preferred general I/O size [uncond] */
105 __u32 stx_blksize;
106
107 /* Flags conveying information about the file [uncond] */
108 __u64 stx_attributes;
109
104110 /* 0x10 */
105 __u32 stx_nlink; /* Number of hard links */
106 __u32 stx_uid; /* User ID of owner */
107 __u32 stx_gid; /* Group ID of owner */
108 __u16 stx_mode; /* File mode */
111 /* Number of hard links */
112 __u32 stx_nlink;
113
114 /* User ID of owner */
115 __u32 stx_uid;
116
117 /* Group ID of owner */
118 __u32 stx_gid;
119
120 /* File mode */
121 __u16 stx_mode;
109122 __u16 __spare0[1];
123
110124 /* 0x20 */
111 __u64 stx_ino; /* Inode number */
112 __u64 stx_size; /* File size */
113 __u64 stx_blocks; /* Number of 512-byte blocks allocated */
114 __u64 stx_attributes_mask; /* Mask to show what's supported in stx_attributes */
125 /* Inode number */
126 __u64 stx_ino;
127
128 /* File size */
129 __u64 stx_size;
130
131 /* Number of 512-byte blocks allocated */
132 __u64 stx_blocks;
133
134 /* Mask to show what's supported in stx_attributes */
135 __u64 stx_attributes_mask;
136
115137 /* 0x40 */
116 struct statx_timestamp stx_atime; /* Last access time */
117 struct statx_timestamp stx_btime; /* File creation time */
118 struct statx_timestamp stx_ctime; /* Last attribute change time */
119 struct statx_timestamp stx_mtime; /* Last data modification time */
138 /* Last access time */
139 struct statx_timestamp stx_atime;
140
141 /* File creation time */
142 struct statx_timestamp stx_btime;
143
144 /* Last attribute change time */
145 struct statx_timestamp stx_ctime;
146
147 /* Last data modification time */
148 struct statx_timestamp stx_mtime;
149
120150 /* 0x80 */
121 __u32 stx_rdev_major; /* Device ID of special file [if bdev/cdev] */
151 /* Device ID of special file [if bdev/cdev] */
152 __u32 stx_rdev_major;
122153 __u32 stx_rdev_minor;
123 __u32 stx_dev_major; /* ID of device containing file [uncond] */
154
155 /* ID of device containing file [uncond] */
156 __u32 stx_dev_major;
124157 __u32 stx_dev_minor;
158
125159 /* 0x90 */
126160 __u64 stx_mnt_id;
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 */
161
162 /* Memory buffer alignment for direct I/O */
163 __u32 stx_dio_mem_align;
164
165 /* File offset alignment for direct I/O */
166 __u32 stx_dio_offset_align;
167
129168 /* 0xa0 */
130 __u64 stx_subvol; /* Subvolume identifier */
131 __u32 stx_atomic_write_unit_min; /* Min atomic write unit in bytes */
132 __u32 stx_atomic_write_unit_max; /* Max atomic write unit in bytes */
169 /* Subvolume identifier */
170 __u64 stx_subvol;
171
172 /* Min atomic write unit in bytes */
173 __u32 stx_atomic_write_unit_min;
174
175 /* Max atomic write unit in bytes */
176 __u32 stx_atomic_write_unit_max;
177
133178 /* 0xb0 */
134 __u32 stx_atomic_write_segments_max; /* Max atomic write segment count */
135 __u32 __spare1[1];
136 /* 0xb8 */
137 __u64 __spare3[9]; /* Spare space for future expansion */
179 /* Max atomic write segment count */
180 __u32 stx_atomic_write_segments_max;
181
182 /* File offset alignment for direct I/O reads */
183 __u32 stx_dio_read_offset_align;
184
185 /* Optimised max atomic write unit in bytes */
186 __u32 stx_atomic_write_unit_max_opt;
187 __u32 __spare2[1];
188
189 /* 0xc0 */
190 __u64 __spare3[8]; /* Spare space for future expansion */
191
138192 /* 0x100 */
139193};
140194
......@@ -164,6 +218,7 @@ struct statx {
164218#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
165219#define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
166220#define STATX_WRITE_ATOMIC 0x00010000U /* Want/got atomic_write_* fields */
221#define STATX_DIO_READ_ALIGN 0x00020000U /* Want/got dio read alignment info */
167222
168223#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
169224
lib/libc/include/any-linux-any/linux/stddef.h+2
......@@ -70,4 +70,6 @@
7070#define __counted_by_be(m)
7171#endif
7272
73#define __kernel_nonstring
74
7375#endif /* _LINUX_STDDEF_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/sysctl.h+1
......@@ -573,6 +573,7 @@ enum {
573573 NET_IPV6_ACCEPT_RA_FROM_LOCAL=26,
574574 NET_IPV6_ACCEPT_RA_RT_INFO_MIN_PLEN=27,
575575 NET_IPV6_RA_DEFRTR_METRIC=28,
576 NET_IPV6_FORCE_FORWARDING=29,
576577 __NET_IPV6_MAX
577578};
578579
lib/libc/include/any-linux-any/linux/taskstats.h+29-1
......@@ -34,7 +34,7 @@
3434 */
3535
3636
37#define TASKSTATS_VERSION 14
37#define TASKSTATS_VERSION 16
3838#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
3939 * in linux/sched.h */
4040
......@@ -167,6 +167,7 @@ struct taskstats {
167167 __u64 freepages_count;
168168 __u64 freepages_delay_total;
169169
170
170171 /* Delay waiting for thrashing page */
171172 __u64 thrashing_count;
172173 __u64 thrashing_delay_total;
......@@ -202,6 +203,33 @@ struct taskstats {
202203 /* v14: Delay waiting for IRQ/SOFTIRQ */
203204 __u64 irq_count;
204205 __u64 irq_delay_total;
206
207 /* v15: add Delay max and Delay min */
208
209 /* v16: move Delay max and Delay min to the end of taskstat */
210 __u64 cpu_delay_max;
211 __u64 cpu_delay_min;
212
213 __u64 blkio_delay_max;
214 __u64 blkio_delay_min;
215
216 __u64 swapin_delay_max;
217 __u64 swapin_delay_min;
218
219 __u64 freepages_delay_max;
220 __u64 freepages_delay_min;
221
222 __u64 thrashing_delay_max;
223 __u64 thrashing_delay_min;
224
225 __u64 compact_delay_max;
226 __u64 compact_delay_min;
227
228 __u64 wpcopy_delay_max;
229 __u64 wpcopy_delay_min;
230
231 __u64 irq_delay_max;
232 __u64 irq_delay_min;
205233};
206234
207235
lib/libc/include/any-linux-any/linux/tcp.h+10-3
......@@ -28,7 +28,8 @@ struct tcphdr {
2828 __be32 seq;
2929 __be32 ack_seq;
3030#if defined(__LITTLE_ENDIAN_BITFIELD)
31 __u16 res1:4,
31 __u16 ae:1,
32 res1:3,
3233 doff:4,
3334 fin:1,
3435 syn:1,
......@@ -40,7 +41,8 @@ struct tcphdr {
4041 cwr:1;
4142#elif defined(__BIG_ENDIAN_BITFIELD)
4243 __u16 doff:4,
43 res1:4,
44 res1:3,
45 ae:1,
4446 cwr:1,
4547 ece:1,
4648 urg:1,
......@@ -70,6 +72,7 @@ union tcp_word_hdr {
7072#define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3])
7173
7274enum {
75 TCP_FLAG_AE = __constant_cpu_to_be32(0x01000000),
7376 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
7477 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
7578 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
......@@ -78,7 +81,7 @@ enum {
7881 TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
7982 TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
8083 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
81 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
84 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0E000000),
8285 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
8386};
8487
......@@ -136,6 +139,9 @@ enum {
136139#define TCP_AO_REPAIR 42 /* Get/Set SNEs and ISNs */
137140
138141#define TCP_IS_MPTCP 43 /* Is MPTCP being used? */
142#define TCP_RTO_MAX_MS 44 /* max rto time in ms */
143#define TCP_RTO_MIN_US 45 /* min rto time in us */
144#define TCP_DELACK_MAX_US 46 /* max delayed ack time in us */
139145
140146#define TCP_REPAIR_ON 1
141147#define TCP_REPAIR_OFF 0
......@@ -178,6 +184,7 @@ enum tcp_fastopen_client_fail {
178184#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
179185#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
180186#define TCPI_OPT_USEC_TS 64 /* usec timestamps */
187#define TCPI_OPT_TFO_CHILD 128 /* child from a Fast Open option on SYN */
181188
182189/*
183190 * Sender's congestion state indicating normal or abnormal situations
lib/libc/include/any-linux-any/linux/time.h+11
......@@ -62,6 +62,17 @@ struct timezone {
6262#define CLOCK_TAI 11
6363
6464#define MAX_CLOCKS 16
65
66/*
67 * AUX clock support. AUXiliary clocks are dynamically configured by
68 * enabling a clock ID. These clock can be steered independently of the
69 * core timekeeper. The kernel can support up to 8 auxiliary clocks, but
70 * the actual limit depends on eventual architecture constraints vs. VDSO.
71 */
72#define CLOCK_AUX MAX_CLOCKS
73#define MAX_AUX_CLOCKS 8
74#define CLOCK_AUX_LAST (CLOCK_AUX + MAX_AUX_CLOCKS - 1)
75
6576#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
6677#define CLOCKS_MONO CLOCK_MONOTONIC
6778
lib/libc/include/any-linux-any/linux/tiocl.h+1
......@@ -36,5 +36,6 @@ struct tiocl_selection {
3636#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
3737#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
3838#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
39#define TIOCL_GETBRACKETEDPASTE 18 /* get whether paste may be bracketed */
3940
4041#endif /* _LINUX_TIOCL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/ublk_cmd.h+205-2
......@@ -51,6 +51,10 @@
5151 _IOR('u', 0x13, struct ublksrv_ctrl_cmd)
5252#define UBLK_U_CMD_DEL_DEV_ASYNC \
5353 _IOR('u', 0x14, struct ublksrv_ctrl_cmd)
54#define UBLK_U_CMD_UPDATE_SIZE \
55 _IOWR('u', 0x15, struct ublksrv_ctrl_cmd)
56#define UBLK_U_CMD_QUIESCE_DEV \
57 _IOWR('u', 0x16, struct ublksrv_ctrl_cmd)
5458
5559/*
5660 * 64bits are enough now, and it should be easy to extend in case of
......@@ -94,6 +98,10 @@
9498 _IOWR('u', UBLK_IO_COMMIT_AND_FETCH_REQ, struct ublksrv_io_cmd)
9599#define UBLK_U_IO_NEED_GET_DATA \
96100 _IOWR('u', UBLK_IO_NEED_GET_DATA, struct ublksrv_io_cmd)
101#define UBLK_U_IO_REGISTER_IO_BUF \
102 _IOWR('u', 0x23, struct ublksrv_io_cmd)
103#define UBLK_U_IO_UNREGISTER_IO_BUF \
104 _IOWR('u', 0x24, struct ublksrv_io_cmd)
97105
98106/* only ABORT means that no re-fetch */
99107#define UBLK_IO_RES_OK 0
......@@ -127,8 +135,28 @@
127135#define UBLKSRV_IO_BUF_TOTAL_SIZE (1ULL << UBLKSRV_IO_BUF_TOTAL_BITS)
128136
129137/*
130 * zero copy requires 4k block size, and can remap ublk driver's io
131 * request into ublksrv's vm space
138 * ublk server can register data buffers for incoming I/O requests with a sparse
139 * io_uring buffer table. The request buffer can then be used as the data buffer
140 * for io_uring operations via the fixed buffer index.
141 * Note that the ublk server can never directly access the request data memory.
142 *
143 * To use this feature, the ublk server must first register a sparse buffer
144 * table on an io_uring instance.
145 * When an incoming ublk request is received, the ublk server submits a
146 * UBLK_U_IO_REGISTER_IO_BUF command to that io_uring instance. The
147 * ublksrv_io_cmd's q_id and tag specify the request whose buffer to register
148 * and addr is the index in the io_uring's buffer table to install the buffer.
149 * SQEs can now be submitted to the io_uring to read/write the request's buffer
150 * by enabling fixed buffers (e.g. using IORING_OP_{READ,WRITE}_FIXED or
151 * IORING_URING_CMD_FIXED) and passing the registered buffer index in buf_index.
152 * Once the last io_uring operation using the request's buffer has completed,
153 * the ublk server submits a UBLK_U_IO_UNREGISTER_IO_BUF command with q_id, tag,
154 * and addr again specifying the request buffer to unregister.
155 * The ublk request is completed when its buffer is unregistered from all
156 * io_uring instances and the ublk server issues UBLK_U_IO_COMMIT_AND_FETCH_REQ.
157 *
158 * Not available for UBLK_F_UNPRIVILEGED_DEV, as a ublk server can leak
159 * uninitialized kernel memory by not reading into the full request buffer.
132160 */
133161#define UBLK_F_SUPPORT_ZERO_COPY (1ULL << 0)
134162
......@@ -207,6 +235,82 @@
207235 */
208236#define UBLK_F_USER_RECOVERY_FAIL_IO (1ULL << 9)
209237
238/*
239 * Resizing a block device is possible with UBLK_U_CMD_UPDATE_SIZE
240 * New size is passed in cmd->data[0] and is in units of sectors
241 */
242#define UBLK_F_UPDATE_SIZE (1ULL << 10)
243
244/*
245 * request buffer is registered automatically to uring_cmd's io_uring
246 * context before delivering this io command to ublk server, meantime
247 * it is un-registered automatically when completing this io command.
248 *
249 * For using this feature:
250 *
251 * - ublk server has to create sparse buffer table on the same `io_ring_ctx`
252 * for issuing `UBLK_IO_FETCH_REQ` and `UBLK_IO_COMMIT_AND_FETCH_REQ`.
253 * If uring_cmd isn't issued on same `io_ring_ctx`, it is ublk server's
254 * responsibility to unregister the buffer by issuing `IO_UNREGISTER_IO_BUF`
255 * manually, otherwise this ublk request won't complete.
256 *
257 * - ublk server passes auto buf register data via uring_cmd's sqe->addr,
258 * `struct ublk_auto_buf_reg` is populated from sqe->addr, please see
259 * the definition of ublk_sqe_addr_to_auto_buf_reg()
260 *
261 * - pass buffer index from `ublk_auto_buf_reg.index`
262 *
263 * - all reserved fields in `ublk_auto_buf_reg` need to be zeroed
264 *
265 * - pass flags from `ublk_auto_buf_reg.flags` if needed
266 *
267 * This way avoids extra cost from two uring_cmd, but also simplifies backend
268 * implementation, such as, the dependency on IO_REGISTER_IO_BUF and
269 * IO_UNREGISTER_IO_BUF becomes not necessary.
270 *
271 * If wrong data or flags are provided, both IO_FETCH_REQ and
272 * IO_COMMIT_AND_FETCH_REQ are failed, for the latter, the ublk IO request
273 * won't be completed until new IO_COMMIT_AND_FETCH_REQ command is issued
274 * successfully
275 */
276#define UBLK_F_AUTO_BUF_REG (1ULL << 11)
277
278/*
279 * Control command `UBLK_U_CMD_QUIESCE_DEV` is added for quiescing device,
280 * which state can be transitioned to `UBLK_S_DEV_QUIESCED` or
281 * `UBLK_S_DEV_FAIL_IO` finally, and it needs ublk server cooperation for
282 * handling `UBLK_IO_RES_ABORT` correctly.
283 *
284 * Typical use case is for supporting to upgrade ublk server application,
285 * meantime keep ublk block device persistent during the period.
286 *
287 * This feature is only available when UBLK_F_USER_RECOVERY is enabled.
288 *
289 * Note, this command returns -EBUSY in case that all IO commands are being
290 * handled by ublk server and not completed in specified time period which
291 * is passed from the control command parameter.
292 */
293#define UBLK_F_QUIESCE (1ULL << 12)
294
295/*
296 * If this feature is set, ublk_drv supports each (qid,tag) pair having
297 * its own independent daemon task that is responsible for handling it.
298 * If it is not set, daemons are per-queue instead, so for two pairs
299 * (qid1,tag1) and (qid2,tag2), if qid1 == qid2, then the same task must
300 * be responsible for handling (qid1,tag1) and (qid2,tag2).
301 */
302#define UBLK_F_PER_IO_DAEMON (1ULL << 13)
303
304/*
305 * If this feature is set, UBLK_U_IO_REGISTER_IO_BUF/UBLK_U_IO_UNREGISTER_IO_BUF
306 * can be issued for an I/O on any task. q_id and tag are also ignored in
307 * UBLK_U_IO_UNREGISTER_IO_BUF's ublksrv_io_cmd.
308 * If it is unset, zero-copy buffers can only be registered and unregistered by
309 * the I/O's daemon task. The q_id and tag of the registered buffer are required
310 * in UBLK_U_IO_UNREGISTER_IO_BUF's ublksrv_io_cmd.
311 */
312#define UBLK_F_BUF_REG_OFF_DAEMON (1ULL << 14)
313
210314/* device state */
211315#define UBLK_S_DEV_DEAD 0
212316#define UBLK_S_DEV_LIVE 1
......@@ -293,6 +397,17 @@ struct ublksrv_ctrl_dev_info {
293397#define UBLK_IO_F_FUA (1U << 13)
294398#define UBLK_IO_F_NOUNMAP (1U << 15)
295399#define UBLK_IO_F_SWAP (1U << 16)
400/*
401 * For UBLK_F_AUTO_BUF_REG & UBLK_AUTO_BUF_REG_FALLBACK only.
402 *
403 * This flag is set if auto buffer register is failed & ublk server passes
404 * UBLK_AUTO_BUF_REG_FALLBACK, and ublk server need to register buffer
405 * manually for handling the delivered IO command if this flag is observed
406 *
407 * ublk server has to check this flag if UBLK_AUTO_BUF_REG_FALLBACK is
408 * passed in.
409 */
410#define UBLK_IO_F_NEED_REG_BUF (1U << 17)
296411
297412/*
298413 * io cmd is described by this structure, and stored in share memory, indexed
......@@ -327,6 +442,62 @@ static __inline__ __u32 ublksrv_get_flags(const struct ublksrv_io_desc *iod)
327442 return iod->op_flags >> 8;
328443}
329444
445/*
446 * If this flag is set, fallback by completing the uring_cmd and setting
447 * `UBLK_IO_F_NEED_REG_BUF` in case of auto-buf-register failure;
448 * otherwise the client ublk request is failed silently
449 *
450 * If ublk server passes this flag, it has to check if UBLK_IO_F_NEED_REG_BUF
451 * is set in `ublksrv_io_desc.op_flags`. If UBLK_IO_F_NEED_REG_BUF is set,
452 * ublk server needs to register io buffer manually for handling IO command.
453 */
454#define UBLK_AUTO_BUF_REG_FALLBACK (1 << 0)
455#define UBLK_AUTO_BUF_REG_F_MASK UBLK_AUTO_BUF_REG_FALLBACK
456
457struct ublk_auto_buf_reg {
458 /* index for registering the delivered request buffer */
459 __u16 index;
460 __u8 flags;
461 __u8 reserved0;
462
463 /*
464 * io_ring FD can be passed via the reserve field in future for
465 * supporting to register io buffer to external io_uring
466 */
467 __u32 reserved1;
468};
469
470/*
471 * For UBLK_F_AUTO_BUF_REG, auto buffer register data is carried via
472 * uring_cmd's sqe->addr:
473 *
474 * - bit0 ~ bit15: buffer index
475 * - bit16 ~ bit23: flags
476 * - bit24 ~ bit31: reserved0
477 * - bit32 ~ bit63: reserved1
478 */
479static __inline__ struct ublk_auto_buf_reg ublk_sqe_addr_to_auto_buf_reg(
480 __u64 sqe_addr)
481{
482 struct ublk_auto_buf_reg reg = {
483 .index = (__u16)sqe_addr,
484 .flags = (__u8)(sqe_addr >> 16),
485 .reserved0 = (__u8)(sqe_addr >> 24),
486 .reserved1 = (__u32)(sqe_addr >> 32),
487 };
488
489 return reg;
490}
491
492static __inline__ __u64
493ublk_auto_buf_reg_to_sqe_addr(const struct ublk_auto_buf_reg *buf)
494{
495 __u64 addr = buf->index | (__u64)buf->flags << 16 | (__u64)buf->reserved0 << 24 |
496 (__u64)buf->reserved1 << 32;
497
498 return addr;
499}
500
330501/* issued to ublk driver via /dev/ublkcN */
331502struct ublksrv_io_cmd {
332503 __u16 q_id;
......@@ -401,6 +572,34 @@ struct ublk_param_zoned {
401572 __u8 reserved[20];
402573};
403574
575struct ublk_param_dma_align {
576 __u32 alignment;
577 __u8 pad[4];
578};
579
580#define UBLK_MIN_SEGMENT_SIZE 4096
581/*
582 * If any one of the three segment parameter is set as 0, the behavior is
583 * undefined.
584 */
585struct ublk_param_segment {
586 /*
587 * seg_boundary_mask + 1 needs to be power_of_2(), and the sum has
588 * to be >= UBLK_MIN_SEGMENT_SIZE(4096)
589 */
590 __u64 seg_boundary_mask;
591
592 /*
593 * max_segment_size could be override by virt_boundary_mask, so be
594 * careful when setting both.
595 *
596 * max_segment_size has to be >= UBLK_MIN_SEGMENT_SIZE(4096)
597 */
598 __u32 max_segment_size;
599 __u16 max_segments;
600 __u8 pad[2];
601};
602
404603struct ublk_params {
405604 /*
406605 * Total length of parameters, userspace has to set 'len' for both
......@@ -413,12 +612,16 @@ struct ublk_params {
413612#define UBLK_PARAM_TYPE_DISCARD (1 << 1)
414613#define UBLK_PARAM_TYPE_DEVT (1 << 2)
415614#define UBLK_PARAM_TYPE_ZONED (1 << 3)
615#define UBLK_PARAM_TYPE_DMA_ALIGN (1 << 4)
616#define UBLK_PARAM_TYPE_SEGMENT (1 << 5)
416617 __u32 types; /* types of parameter included */
417618
418619 struct ublk_param_basic basic;
419620 struct ublk_param_discard discard;
420621 struct ublk_param_devt devt;
421622 struct ublk_param_zoned zoned;
623 struct ublk_param_dma_align dma;
624 struct ublk_param_segment seg;
422625};
423626
424627#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/udp.h+1
......@@ -43,5 +43,6 @@ struct udphdr {
4343#define UDP_ENCAP_GTP1U 5 /* 3GPP TS 29.060 */
4444#define UDP_ENCAP_RXRPC 6
4545#define TCP_ENCAP_ESPINTCP 7 /* Yikes, this is really xfrm encap types. */
46#define UDP_ENCAP_OVPNINUDP 8 /* OpenVPN traffic */
4647
4748#endif /* _LINUX_UDP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/usb/ch9.h+16
......@@ -253,6 +253,9 @@ struct usb_ctrlrequest {
253253#define USB_DT_BOS 0x0f
254254#define USB_DT_DEVICE_CAPABILITY 0x10
255255#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
256/* From the eUSB2 spec */
257#define USB_DT_EUSB2_ISOC_ENDPOINT_COMP 0x12
258/* From Wireless USB spec */
256259#define USB_DT_WIRE_ADAPTER 0x21
257260/* From USB Device Firmware Upgrade Specification, Revision 1.1 */
258261#define USB_DT_DFU_FUNCTIONAL 0x21
......@@ -330,6 +333,7 @@ struct usb_device_descriptor {
330333#define USB_CLASS_AUDIO_VIDEO 0x10
331334#define USB_CLASS_BILLBOARD 0x11
332335#define USB_CLASS_USB_TYPE_C_BRIDGE 0x12
336#define USB_CLASS_MCTP 0x14
333337#define USB_CLASS_MISC 0xef
334338#define USB_CLASS_APP_SPEC 0xfe
335339#define USB_SUBCLASS_DFU 0x01
......@@ -675,6 +679,18 @@ static __inline__ int usb_endpoint_interrupt_type(
675679
676680/*-------------------------------------------------------------------------*/
677681
682/* USB_DT_EUSB2_ISOC_ENDPOINT_COMP: eUSB2 Isoch Endpoint Companion descriptor */
683struct usb_eusb2_isoc_ep_comp_descriptor {
684 __u8 bLength;
685 __u8 bDescriptorType;
686 __le16 wMaxPacketSize;
687 __le32 dwBytesPerInterval;
688} __attribute__ ((packed));
689
690#define USB_DT_EUSB2_ISOC_EP_COMP_SIZE 8
691
692/*-------------------------------------------------------------------------*/
693
678694/* USB_DT_SSP_ISOC_ENDPOINT_COMP: SuperSpeedPlus Isochronous Endpoint Companion
679695 * descriptor
680696 */
lib/libc/include/any-linux-any/linux/usb/functionfs.h+4-4
......@@ -205,7 +205,7 @@ struct usb_ffs_dmabuf_transfer_req {
205205 * +-----+-----------------+------+--------------------------+
206206 * | off | name | type | description |
207207 * +-----+-----------------+------+--------------------------+
208 * | 0 | inteface | U8 | related interface number |
208 * | 0 | interface | U8 | related interface number |
209209 * +-----+-----------------+------+--------------------------+
210210 * | 1 | dwLength | U32 | length of the descriptor |
211211 * +-----+-----------------+------+--------------------------+
......@@ -223,7 +223,7 @@ struct usb_ffs_dmabuf_transfer_req {
223223 * +-----+-----------------+------+--------------------------+
224224 * | off | name | type | description |
225225 * +-----+-----------------+------+--------------------------+
226 * | 0 | inteface | U8 | related interface number |
226 * | 0 | interface | U8 | related interface number |
227227 * +-----+-----------------+------+--------------------------+
228228 * | 1 | dwLength | U32 | length of the descriptor |
229229 * +-----+-----------------+------+--------------------------+
......@@ -236,7 +236,7 @@ struct usb_ffs_dmabuf_transfer_req {
236236 * | 11 | ExtProp[] | | list of ext. prop. d. |
237237 * +-----+-----------------+------+--------------------------+
238238 *
239 * ExtCompat[] is an array of valid Extended Compatiblity descriptors
239 * ExtCompat[] is an array of valid Extended Compatibility descriptors
240240 * which have the following format:
241241 *
242242 * +-----+-----------------------+------+-------------------------------------+
......@@ -294,7 +294,7 @@ struct usb_functionfs_strings_head {
294294 * | 16 | stringtab | StringTab[lang_count] | table of strings per lang |
295295 *
296296 * For each language there is one stringtab entry (ie. there are lang_count
297 * stringtab entires). Each StringTab has following format:
297 * stringtab entries). Each StringTab has following format:
298298 *
299299 * | off | name | type | description |
300300 * |-----+---------+-------------------+------------------------------------|
lib/libc/include/any-linux-any/linux/usb/video.h+1
......@@ -104,6 +104,7 @@
104104#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
105105#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
106106#define UVC_CT_PRIVACY_CONTROL 0x11
107#define UVC_CT_REGION_OF_INTEREST_CONTROL 0x14
107108
108109/* A.9.5. Processing Unit Control Selectors */
109110#define UVC_PU_CONTROL_UNDEFINED 0x00
lib/libc/include/any-linux-any/linux/uvcvideo.h+13
......@@ -16,6 +16,7 @@
1616#define UVC_CTRL_DATA_TYPE_BOOLEAN 3
1717#define UVC_CTRL_DATA_TYPE_ENUM 4
1818#define UVC_CTRL_DATA_TYPE_BITMASK 5
19#define UVC_CTRL_DATA_TYPE_RECT 6
1920
2021/* Control flags */
2122#define UVC_CTRL_FLAG_SET_CUR (1 << 0)
......@@ -38,6 +39,18 @@
3839
3940#define UVC_MENU_NAME_LEN 32
4041
42/* V4L2 driver-specific controls */
43#define V4L2_CID_UVC_REGION_OF_INTEREST_RECT (V4L2_CID_USER_UVC_BASE + 1)
44#define V4L2_CID_UVC_REGION_OF_INTEREST_AUTO (V4L2_CID_USER_UVC_BASE + 2)
45#define V4L2_UVC_REGION_OF_INTEREST_AUTO_EXPOSURE (1 << 0)
46#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IRIS (1 << 1)
47#define V4L2_UVC_REGION_OF_INTEREST_AUTO_WHITE_BALANCE (1 << 2)
48#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FOCUS (1 << 3)
49#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FACE_DETECT (1 << 4)
50#define V4L2_UVC_REGION_OF_INTEREST_AUTO_DETECT_AND_TRACK (1 << 5)
51#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IMAGE_STABILIZATION (1 << 6)
52#define V4L2_UVC_REGION_OF_INTEREST_AUTO_HIGHER_QUALITY (1 << 7)
53
4154struct uvc_menu_info {
4255 __u32 value;
4356 __u8 name[UVC_MENU_NAME_LEN];
lib/libc/include/any-linux-any/linux/v4l2-controls.h+13
......@@ -213,6 +213,19 @@ enum v4l2_colorfx {
213213 */
214214#define V4L2_CID_USER_THP7312_BASE (V4L2_CID_USER_BASE + 0x11c0)
215215
216/*
217 * The base for the uvc driver controls.
218 * See linux/uvcvideo.h for the list of controls.
219 * We reserve 64 controls for this driver.
220 */
221#define V4L2_CID_USER_UVC_BASE (V4L2_CID_USER_BASE + 0x11e0)
222
223/*
224 * The base for Rockchip ISP1 driver controls.
225 * We reserve 16 controls for this driver.
226 */
227#define V4L2_CID_USER_RKISP1_BASE (V4L2_CID_USER_BASE + 0x1220)
228
216229/* MPEG-class control IDs */
217230/* The MPEG controls are applicable to all codec controls
218231 * and the 'MPEG' part of the define is historical */
lib/libc/include/any-linux-any/linux/vduse.h+2-2
......@@ -1,4 +1,4 @@
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) */
22#ifndef _VDUSE_H_
33#define _VDUSE_H_
44
......@@ -237,7 +237,7 @@ struct vduse_iova_umem {
237237 * struct vduse_iova_info - information of one IOVA region
238238 * @start: start of the IOVA region
239239 * @last: last of the IOVA region
240 * @capability: capability of the IOVA regsion
240 * @capability: capability of the IOVA region
241241 * @reserved: for future use, needs to be initialized to zero
242242 *
243243 * Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
lib/libc/include/any-linux-any/linux/version.h+3-3
......@@ -1,5 +1,5 @@
1#define LINUX_VERSION_CODE 396548
1#define LINUX_VERSION_CODE 397568
22#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))
33#define LINUX_VERSION_MAJOR 6
4#define LINUX_VERSION_PATCHLEVEL 13
5#define LINUX_VERSION_SUBLEVEL 4
\ No newline at end of file
4#define LINUX_VERSION_PATCHLEVEL 17
5#define LINUX_VERSION_SUBLEVEL 0
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vfio.h+31-11
......@@ -671,6 +671,7 @@ enum {
671671 */
672672enum {
673673 VFIO_AP_REQ_IRQ_INDEX,
674 VFIO_AP_CFG_CHG_IRQ_INDEX,
674675 VFIO_AP_NUM_IRQS
675676};
676677
......@@ -904,10 +905,12 @@ struct vfio_device_feature {
904905 * VFIO_DEVICE_BIND_IOMMUFD - _IOR(VFIO_TYPE, VFIO_BASE + 18,
905906 * struct vfio_device_bind_iommufd)
906907 * @argsz: User filled size of this data.
907 * @flags: Must be 0.
908 * @flags: Must be 0 or a bit flags of VFIO_DEVICE_BIND_*
908909 * @iommufd: iommufd to bind.
909910 * @out_devid: The device id generated by this bind. devid is a handle for
910911 * this device/iommufd bond and can be used in IOMMUFD commands.
912 * @token_uuid_ptr: Valid if VFIO_DEVICE_BIND_FLAG_TOKEN. Points to a 16 byte
913 * UUID in the same format as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN.
911914 *
912915 * Bind a vfio_device to the specified iommufd.
913916 *
......@@ -916,13 +919,21 @@ struct vfio_device_feature {
916919 *
917920 * Unbind is automatically conducted when device fd is closed.
918921 *
922 * A token is sometimes required to open the device, unless this is known to be
923 * needed VFIO_DEVICE_BIND_FLAG_TOKEN should not be set and token_uuid_ptr is
924 * ignored. The only case today is a PF/VF relationship where the VF bind must
925 * be provided the same token as VFIO_DEVICE_FEATURE_PCI_VF_TOKEN provided to
926 * the PF.
927 *
919928 * Return: 0 on success, -errno on failure.
920929 */
921930struct vfio_device_bind_iommufd {
922931 __u32 argsz;
923932 __u32 flags;
933#define VFIO_DEVICE_BIND_FLAG_TOKEN (1 << 0)
924934 __s32 iommufd;
925935 __u32 out_devid;
936 __aligned_u64 token_uuid_ptr;
926937};
927938
928939#define VFIO_DEVICE_BIND_IOMMUFD _IO(VFIO_TYPE, VFIO_BASE + 18)
......@@ -931,29 +942,34 @@ struct vfio_device_bind_iommufd {
931942 * VFIO_DEVICE_ATTACH_IOMMUFD_PT - _IOW(VFIO_TYPE, VFIO_BASE + 19,
932943 * struct vfio_device_attach_iommufd_pt)
933944 * @argsz: User filled size of this data.
934 * @flags: Must be 0.
945 * @flags: Flags for attach.
935946 * @pt_id: Input the target id which can represent an ioas or a hwpt
936947 * allocated via iommufd subsystem.
937948 * Output the input ioas id or the attached hwpt id which could
938949 * be the specified hwpt itself or a hwpt automatically created
939950 * for the specified ioas by kernel during the attachment.
951 * @pasid: The pasid to be attached, only meaningful when
952 * VFIO_DEVICE_ATTACH_PASID is set in @flags
940953 *
941954 * Associate the device with an address space within the bound iommufd.
942955 * Undo by VFIO_DEVICE_DETACH_IOMMUFD_PT or device fd close. This is only
943956 * allowed on cdev fds.
944957 *
945 * If a vfio device is currently attached to a valid hw_pagetable, without doing
946 * a VFIO_DEVICE_DETACH_IOMMUFD_PT, a second VFIO_DEVICE_ATTACH_IOMMUFD_PT ioctl
947 * passing in another hw_pagetable (hwpt) id is allowed. This action, also known
948 * as a hw_pagetable replacement, will replace the device's currently attached
949 * hw_pagetable with a new hw_pagetable corresponding to the given pt_id.
958 * If a vfio device or a pasid of this device is currently attached to a valid
959 * hw_pagetable (hwpt), without doing a VFIO_DEVICE_DETACH_IOMMUFD_PT, a second
960 * VFIO_DEVICE_ATTACH_IOMMUFD_PT ioctl passing in another hwpt id is allowed.
961 * This action, also known as a hw_pagetable replacement, will replace the
962 * currently attached hwpt of the device or the pasid of this device with a new
963 * hwpt corresponding to the given pt_id.
950964 *
951965 * Return: 0 on success, -errno on failure.
952966 */
953967struct vfio_device_attach_iommufd_pt {
954968 __u32 argsz;
955969 __u32 flags;
970#define VFIO_DEVICE_ATTACH_PASID (1 << 0)
956971 __u32 pt_id;
972 __u32 pasid;
957973};
958974
959975#define VFIO_DEVICE_ATTACH_IOMMUFD_PT _IO(VFIO_TYPE, VFIO_BASE + 19)
......@@ -962,17 +978,21 @@ struct vfio_device_attach_iommufd_pt {
962978 * VFIO_DEVICE_DETACH_IOMMUFD_PT - _IOW(VFIO_TYPE, VFIO_BASE + 20,
963979 * struct vfio_device_detach_iommufd_pt)
964980 * @argsz: User filled size of this data.
965 * @flags: Must be 0.
981 * @flags: Flags for detach.
982 * @pasid: The pasid to be detached, only meaningful when
983 * VFIO_DEVICE_DETACH_PASID is set in @flags
966984 *
967 * Remove the association of the device and its current associated address
968 * space. After it, the device should be in a blocking DMA state. This is only
969 * allowed on cdev fds.
985 * Remove the association of the device or a pasid of the device and its current
986 * associated address space. After it, the device or the pasid should be in a
987 * blocking DMA state. This is only allowed on cdev fds.
970988 *
971989 * Return: 0 on success, -errno on failure.
972990 */
973991struct vfio_device_detach_iommufd_pt {
974992 __u32 argsz;
975993 __u32 flags;
994#define VFIO_DEVICE_DETACH_PASID (1 << 0)
995 __u32 pasid;
976996};
977997
978998#define VFIO_DEVICE_DETACH_IOMMUFD_PT _IO(VFIO_TYPE, VFIO_BASE + 20)
lib/libc/include/any-linux-any/linux/vhost.h+37-2
......@@ -28,10 +28,10 @@
2828
2929/* Set current process as the (exclusive) owner of this file descriptor. This
3030 * must be called before any other vhost command. Further calls to
31 * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */
31 * VHOST_SET_OWNER fail until VHOST_RESET_OWNER is called. */
3232#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
3333/* Give up ownership, and reset the device to default values.
34 * Allows subsequent call to VHOST_OWNER_SET to succeed. */
34 * Allows subsequent call to VHOST_SET_OWNER to succeed. */
3535#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
3636
3737/* Set up/modify memory layout */
......@@ -235,4 +235,39 @@
235235 */
236236#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x82, \
237237 struct vhost_vring_state)
238
239/* Extended features manipulation */
240#define VHOST_GET_FEATURES_ARRAY _IOR(VHOST_VIRTIO, 0x83, \
241 struct vhost_features_array)
242#define VHOST_SET_FEATURES_ARRAY _IOW(VHOST_VIRTIO, 0x83, \
243 struct vhost_features_array)
244
245/* fork_owner values for vhost */
246#define VHOST_FORK_OWNER_KTHREAD 0
247#define VHOST_FORK_OWNER_TASK 1
248
249/**
250 * VHOST_SET_FORK_FROM_OWNER - Set the fork_owner flag for the vhost device,
251 * This ioctl must called before VHOST_SET_OWNER.
252 * Only available when CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y
253 *
254 * @param fork_owner: An 8-bit value that determines the vhost thread mode
255 *
256 * When fork_owner is set to VHOST_FORK_OWNER_TASK(default value):
257 * - Vhost will create vhost worker as tasks forked from the owner,
258 * inheriting all of the owner's attributes.
259 *
260 * When fork_owner is set to VHOST_FORK_OWNER_KTHREAD:
261 * - Vhost will create vhost workers as kernel threads.
262 */
263#define VHOST_SET_FORK_FROM_OWNER _IOW(VHOST_VIRTIO, 0x84, __u8)
264
265/**
266 * VHOST_GET_FORK_OWNER - Get the current fork_owner flag for the vhost device.
267 * Only available when CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y
268 *
269 * @return: An 8-bit value indicating the current thread mode.
270 */
271#define VHOST_GET_FORK_FROM_OWNER _IOR(VHOST_VIRTIO, 0x85, __u8)
272
238273#endif
\ No newline at end of file
lib/libc/include/any-linux-any/linux/vhost_types.h+5
......@@ -110,6 +110,11 @@ struct vhost_msg_v2 {
110110 };
111111};
112112
113struct vhost_features_array {
114 __u64 count; /* number of entries present in features array */
115 __u64 features[] __counted_by(count);
116};
117
113118struct vhost_memory_region {
114119 __u64 guest_phys_addr;
115120 __u64 memory_size; /* bytes */
lib/libc/include/any-linux-any/linux/videodev2.h+29-3
......@@ -151,10 +151,18 @@ enum v4l2_buf_type {
151151 V4L2_BUF_TYPE_SDR_OUTPUT = 12,
152152 V4L2_BUF_TYPE_META_CAPTURE = 13,
153153 V4L2_BUF_TYPE_META_OUTPUT = 14,
154 /*
155 * Note: V4L2_TYPE_IS_VALID and V4L2_TYPE_IS_OUTPUT must
156 * be updated if a new type is added.
157 */
154158 /* Deprecated, do not use */
155159 V4L2_BUF_TYPE_PRIVATE = 0x80,
156160};
157161
162#define V4L2_TYPE_IS_VALID(type) \
163 ((type) >= V4L2_BUF_TYPE_VIDEO_CAPTURE &&\
164 (type) <= V4L2_BUF_TYPE_META_OUTPUT)
165
158166#define V4L2_TYPE_IS_MULTIPLANAR(type) \
159167 ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
160168 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
......@@ -162,14 +170,14 @@ enum v4l2_buf_type {
162170#define V4L2_TYPE_IS_OUTPUT(type) \
163171 ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
164172 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
165 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
166173 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
167174 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
168175 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \
169176 || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \
170177 || (type) == V4L2_BUF_TYPE_META_OUTPUT)
171178
172#define V4L2_TYPE_IS_CAPTURE(type) (!V4L2_TYPE_IS_OUTPUT(type))
179#define V4L2_TYPE_IS_CAPTURE(type) \
180 (V4L2_TYPE_IS_VALID(type) && !V4L2_TYPE_IS_OUTPUT(type))
173181
174182enum v4l2_tuner_type {
175183 V4L2_TUNER_RADIO = 1,
......@@ -616,8 +624,10 @@ struct v4l2_pix_format {
616624/* two planes -- one Y, one Cr + Cb interleaved */
617625#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
618626#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
627#define V4L2_PIX_FMT_NV15 v4l2_fourcc('N', 'V', '1', '5') /* 15 Y/CbCr 4:2:0 10-bit packed */
619628#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
620629#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
630#define V4L2_PIX_FMT_NV20 v4l2_fourcc('N', 'V', '2', '0') /* 20 Y/CbCr 4:2:2 10-bit packed */
621631#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
622632#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
623633#define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */
......@@ -689,7 +699,7 @@ struct v4l2_pix_format {
689699#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
690700#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
691701#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
692 /* 12bit raw bayer packed, 6 bytes for every 4 pixels */
702 /* 12bit raw bayer packed, 3 bytes for every 2 pixels */
693703#define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
694704#define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
695705#define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
......@@ -803,6 +813,12 @@ struct v4l2_pix_format {
803813#define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */
804814#define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */
805815
816/* Renesas RZ/V2H CRU packed formats. 64-bit units with contiguous pixels */
817#define V4L2_PIX_FMT_RAW_CRU10 v4l2_fourcc('C', 'R', '1', '0')
818#define V4L2_PIX_FMT_RAW_CRU12 v4l2_fourcc('C', 'R', '1', '2')
819#define V4L2_PIX_FMT_RAW_CRU14 v4l2_fourcc('C', 'R', '1', '4')
820#define V4L2_PIX_FMT_RAW_CRU20 v4l2_fourcc('C', 'R', '2', '0')
821
806822/* SDR formats - used only for Software Defined Radio devices */
807823#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
808824#define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
......@@ -824,6 +840,7 @@ struct v4l2_pix_format {
824840#define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
825841#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
826842#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
843#define V4L2_META_FMT_UVC_MSXU_1_5 v4l2_fourcc('U', 'V', 'C', 'M') /* UVC MSXU metadata */
827844#define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
828845
829846/* Vendor specific - used for RK_ISP1 camera sub-system */
......@@ -831,6 +848,10 @@ struct v4l2_pix_format {
831848#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */
832849#define V4L2_META_FMT_RK_ISP1_EXT_PARAMS v4l2_fourcc('R', 'K', '1', 'E') /* Rockchip ISP1 3a Extensible Parameters */
833850
851/* Vendor specific - used for C3_ISP */
852#define V4L2_META_FMT_C3ISP_PARAMS v4l2_fourcc('C', '3', 'P', 'M') /* Amlogic C3 ISP Parameters */
853#define V4L2_META_FMT_C3ISP_STATS v4l2_fourcc('C', '3', 'S', 'T') /* Amlogic C3 ISP Statistics */
854
834855/* Vendor specific - used for RaspberryPi PiSP */
835856#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C') /* PiSP BE configuration */
836857#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C') /* PiSP FE configuration */
......@@ -1794,6 +1815,7 @@ struct v4l2_ext_control {
17941815 __s32 *p_s32;
17951816 __s64 *p_s64;
17961817 struct v4l2_area *p_area;
1818 struct v4l2_rect *p_rect;
17971819 struct v4l2_ctrl_h264_sps *p_h264_sps;
17981820 struct v4l2_ctrl_h264_pps *p_h264_pps;
17991821 struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
......@@ -1842,6 +1864,8 @@ struct v4l2_ext_controls {
18421864#define V4L2_CTRL_WHICH_CUR_VAL 0
18431865#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000
18441866#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000
1867#define V4L2_CTRL_WHICH_MIN_VAL 0x0f020000
1868#define V4L2_CTRL_WHICH_MAX_VAL 0x0f030000
18451869
18461870enum v4l2_ctrl_type {
18471871 V4L2_CTRL_TYPE_INTEGER = 1,
......@@ -1860,6 +1884,7 @@ enum v4l2_ctrl_type {
18601884 V4L2_CTRL_TYPE_U16 = 0x0101,
18611885 V4L2_CTRL_TYPE_U32 = 0x0102,
18621886 V4L2_CTRL_TYPE_AREA = 0x0106,
1887 V4L2_CTRL_TYPE_RECT = 0x0107,
18631888
18641889 V4L2_CTRL_TYPE_HDR10_CLL_INFO = 0x0110,
18651890 V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY = 0x0111,
......@@ -1948,6 +1973,7 @@ struct v4l2_querymenu {
19481973#define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
19491974#define V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400
19501975#define V4L2_CTRL_FLAG_DYNAMIC_ARRAY 0x0800
1976#define V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX 0x1000
19511977
19521978/* Query flags, to be ORed with the control ID */
19531979#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
lib/libc/include/any-linux-any/linux/virtio_gpu.h+2-1
......@@ -309,8 +309,9 @@ struct virtio_gpu_cmd_submit {
309309
310310#define VIRTIO_GPU_CAPSET_VIRGL 1
311311#define VIRTIO_GPU_CAPSET_VIRGL2 2
312/* 3 is reserved for gfxstream */
312#define VIRTIO_GPU_CAPSET_GFXSTREAM_VULKAN 3
313313#define VIRTIO_GPU_CAPSET_VENUS 4
314#define VIRTIO_GPU_CAPSET_CROSS_DOMAIN 5
314315#define VIRTIO_GPU_CAPSET_DRM 6
315316
316317/* VIRTIO_GPU_CMD_GET_CAPSET_INFO */
lib/libc/include/any-linux-any/linux/virtio_net.h+46
......@@ -70,6 +70,28 @@
7070 * with the same MAC.
7171 */
7272#define VIRTIO_NET_F_SPEED_DUPLEX 63 /* Device set linkspeed and duplex */
73#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 65 /* Driver can receive
74 * GSO-over-UDP-tunnel packets
75 */
76#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 66 /* Driver handles
77 * GSO-over-UDP-tunnel
78 * packets with partial csum
79 * for the outer header
80 */
81#define VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO 67 /* Device can receive
82 * GSO-over-UDP-tunnel packets
83 */
84#define VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO_CSUM 68 /* Device handles
85 * GSO-over-UDP-tunnel
86 * packets with partial csum
87 * for the outer header
88 */
89
90/* Offloads bits corresponding to VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO{,_CSUM}
91 * features
92 */
93#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46
94#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
7395
7496#ifndef VIRTIO_NET_NO_LEGACY
7597#define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */
......@@ -131,12 +153,17 @@ struct virtio_net_hdr_v1 {
131153#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */
132154#define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */
133155#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc info in csum_ fields */
156#define VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM 8 /* UDP tunnel csum offload */
134157 __u8 flags;
135158#define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */
136159#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */
137160#define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */
138161#define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */
139162#define VIRTIO_NET_HDR_GSO_UDP_L4 5 /* GSO frame, IPv4& IPv6 UDP (USO) */
163#define VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 0x20 /* UDPv4 tunnel present */
164#define VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6 0x40 /* UDPv6 tunnel present */
165#define VIRTIO_NET_HDR_GSO_UDP_TUNNEL (VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV4 | \
166 VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6)
140167#define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */
141168 __u8 gso_type;
142169 __virtio16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
......@@ -181,6 +208,12 @@ struct virtio_net_hdr_v1_hash {
181208 __le16 padding;
182209};
183210
211struct virtio_net_hdr_v1_hash_tunnel {
212 struct virtio_net_hdr_v1_hash hash_hdr;
213 __le16 outer_th_offset;
214 __le16 inner_nh_offset;
215};
216
184217#ifndef VIRTIO_NET_NO_LEGACY
185218/* This header comes first in the scatter-gather list.
186219 * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
......@@ -327,6 +360,19 @@ struct virtio_net_rss_config {
327360 __u8 hash_key_data[/* hash_key_length */];
328361};
329362
363struct virtio_net_rss_config_hdr {
364 __le32 hash_types;
365 __le16 indirection_table_mask;
366 __le16 unclassified_queue;
367 __le16 indirection_table[/* 1 + indirection_table_mask */];
368};
369
370struct virtio_net_rss_config_trailer {
371 __le16 max_tx_vq;
372 __u8 hash_key_length;
373 __u8 hash_key_data[/* hash_key_length */];
374};
375
330376 #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG 1
331377
332378/*
lib/libc/include/any-linux-any/linux/virtio_pci.h+15
......@@ -116,6 +116,8 @@
116116#define VIRTIO_PCI_CAP_PCI_CFG 5
117117/* Additional shared memory capability */
118118#define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
119/* PCI vendor data configuration */
120#define VIRTIO_PCI_CAP_VENDOR_CFG 9
119121
120122/* This is the PCI capability header: */
121123struct virtio_pci_cap {
......@@ -130,6 +132,18 @@ struct virtio_pci_cap {
130132 __le32 length; /* Length of the structure, in bytes. */
131133};
132134
135/* This is the PCI vendor data capability header: */
136struct virtio_pci_vndr_data {
137 __u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
138 __u8 cap_next; /* Generic PCI field: next ptr. */
139 __u8 cap_len; /* Generic PCI field: capability length */
140 __u8 cfg_type; /* Identifies the structure. */
141 __u16 vendor_id; /* Identifies the vendor-specific format. */
142 /* For Vendor Definition */
143 /* Pads structure to a multiple of 4 bytes */
144 /* Reads must not have side effects */
145};
146
133147struct virtio_pci_cap64 {
134148 struct virtio_pci_cap cap;
135149 __le32 offset_hi; /* Most sig 32 bits of offset */
......@@ -232,6 +246,7 @@ struct virtio_pci_cfg_cap {
232246#define VIRTIO_ADMIN_CMD_LIST_USE 0x1
233247
234248/* Admin command group type. */
249#define VIRTIO_ADMIN_GROUP_TYPE_SELF 0x0
235250#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1
236251
237252/* Transitional device admin command. */
lib/libc/include/any-linux-any/linux/virtio_rtc.h created+237
......@@ -0,0 +1,237 @@
1/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2/*
3 * Copyright (C) 2022-2024 OpenSynergy GmbH
4 * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
5 */
6
7#ifndef _LINUX_VIRTIO_RTC_H
8#define _LINUX_VIRTIO_RTC_H
9
10#include <linux/types.h>
11
12/* alarm feature */
13#define VIRTIO_RTC_F_ALARM 0
14
15/* read request message types */
16
17#define VIRTIO_RTC_REQ_READ 0x0001
18#define VIRTIO_RTC_REQ_READ_CROSS 0x0002
19
20/* control request message types */
21
22#define VIRTIO_RTC_REQ_CFG 0x1000
23#define VIRTIO_RTC_REQ_CLOCK_CAP 0x1001
24#define VIRTIO_RTC_REQ_CROSS_CAP 0x1002
25#define VIRTIO_RTC_REQ_READ_ALARM 0x1003
26#define VIRTIO_RTC_REQ_SET_ALARM 0x1004
27#define VIRTIO_RTC_REQ_SET_ALARM_ENABLED 0x1005
28
29/* alarmq message types */
30
31#define VIRTIO_RTC_NOTIF_ALARM 0x2000
32
33/* Message headers */
34
35/** common request header */
36struct virtio_rtc_req_head {
37 __le16 msg_type;
38 __u8 reserved[6];
39};
40
41/** common response header */
42struct virtio_rtc_resp_head {
43#define VIRTIO_RTC_S_OK 0
44#define VIRTIO_RTC_S_EOPNOTSUPP 2
45#define VIRTIO_RTC_S_ENODEV 3
46#define VIRTIO_RTC_S_EINVAL 4
47#define VIRTIO_RTC_S_EIO 5
48 __u8 status;
49 __u8 reserved[7];
50};
51
52/** common notification header */
53struct virtio_rtc_notif_head {
54 __le16 msg_type;
55 __u8 reserved[6];
56};
57
58/* read requests */
59
60/* VIRTIO_RTC_REQ_READ message */
61
62struct virtio_rtc_req_read {
63 struct virtio_rtc_req_head head;
64 __le16 clock_id;
65 __u8 reserved[6];
66};
67
68struct virtio_rtc_resp_read {
69 struct virtio_rtc_resp_head head;
70 __le64 clock_reading;
71};
72
73/* VIRTIO_RTC_REQ_READ_CROSS message */
74
75struct virtio_rtc_req_read_cross {
76 struct virtio_rtc_req_head head;
77 __le16 clock_id;
78/* Arm Generic Timer Counter-timer Virtual Count Register (CNTVCT_EL0) */
79#define VIRTIO_RTC_COUNTER_ARM_VCT 0
80/* x86 Time-Stamp Counter */
81#define VIRTIO_RTC_COUNTER_X86_TSC 1
82/* Invalid */
83#define VIRTIO_RTC_COUNTER_INVALID 0xFF
84 __u8 hw_counter;
85 __u8 reserved[5];
86};
87
88struct virtio_rtc_resp_read_cross {
89 struct virtio_rtc_resp_head head;
90 __le64 clock_reading;
91 __le64 counter_cycles;
92};
93
94/* control requests */
95
96/* VIRTIO_RTC_REQ_CFG message */
97
98struct virtio_rtc_req_cfg {
99 struct virtio_rtc_req_head head;
100 /* no request params */
101};
102
103struct virtio_rtc_resp_cfg {
104 struct virtio_rtc_resp_head head;
105 /** # of clocks -> clock ids < num_clocks are valid */
106 __le16 num_clocks;
107 __u8 reserved[6];
108};
109
110/* VIRTIO_RTC_REQ_CLOCK_CAP message */
111
112struct virtio_rtc_req_clock_cap {
113 struct virtio_rtc_req_head head;
114 __le16 clock_id;
115 __u8 reserved[6];
116};
117
118struct virtio_rtc_resp_clock_cap {
119 struct virtio_rtc_resp_head head;
120#define VIRTIO_RTC_CLOCK_UTC 0
121#define VIRTIO_RTC_CLOCK_TAI 1
122#define VIRTIO_RTC_CLOCK_MONOTONIC 2
123#define VIRTIO_RTC_CLOCK_UTC_SMEARED 3
124#define VIRTIO_RTC_CLOCK_UTC_MAYBE_SMEARED 4
125 __u8 type;
126#define VIRTIO_RTC_SMEAR_UNSPECIFIED 0
127#define VIRTIO_RTC_SMEAR_NOON_LINEAR 1
128#define VIRTIO_RTC_SMEAR_UTC_SLS 2
129 __u8 leap_second_smearing;
130#define VIRTIO_RTC_FLAG_ALARM_CAP (1 << 0)
131 __u8 flags;
132 __u8 reserved[5];
133};
134
135/* VIRTIO_RTC_REQ_CROSS_CAP message */
136
137struct virtio_rtc_req_cross_cap {
138 struct virtio_rtc_req_head head;
139 __le16 clock_id;
140 __u8 hw_counter;
141 __u8 reserved[5];
142};
143
144struct virtio_rtc_resp_cross_cap {
145 struct virtio_rtc_resp_head head;
146#define VIRTIO_RTC_FLAG_CROSS_CAP (1 << 0)
147 __u8 flags;
148 __u8 reserved[7];
149};
150
151/* VIRTIO_RTC_REQ_READ_ALARM message */
152
153struct virtio_rtc_req_read_alarm {
154 struct virtio_rtc_req_head head;
155 __le16 clock_id;
156 __u8 reserved[6];
157};
158
159struct virtio_rtc_resp_read_alarm {
160 struct virtio_rtc_resp_head head;
161 __le64 alarm_time;
162#define VIRTIO_RTC_FLAG_ALARM_ENABLED (1 << 0)
163 __u8 flags;
164 __u8 reserved[7];
165};
166
167/* VIRTIO_RTC_REQ_SET_ALARM message */
168
169struct virtio_rtc_req_set_alarm {
170 struct virtio_rtc_req_head head;
171 __le64 alarm_time;
172 __le16 clock_id;
173 /* flag VIRTIO_RTC_FLAG_ALARM_ENABLED */
174 __u8 flags;
175 __u8 reserved[5];
176};
177
178struct virtio_rtc_resp_set_alarm {
179 struct virtio_rtc_resp_head head;
180 /* no response params */
181};
182
183/* VIRTIO_RTC_REQ_SET_ALARM_ENABLED message */
184
185struct virtio_rtc_req_set_alarm_enabled {
186 struct virtio_rtc_req_head head;
187 __le16 clock_id;
188 /* flag VIRTIO_RTC_ALARM_ENABLED */
189 __u8 flags;
190 __u8 reserved[5];
191};
192
193struct virtio_rtc_resp_set_alarm_enabled {
194 struct virtio_rtc_resp_head head;
195 /* no response params */
196};
197
198/** Union of request types for requestq */
199union virtio_rtc_req_requestq {
200 struct virtio_rtc_req_read read;
201 struct virtio_rtc_req_read_cross read_cross;
202 struct virtio_rtc_req_cfg cfg;
203 struct virtio_rtc_req_clock_cap clock_cap;
204 struct virtio_rtc_req_cross_cap cross_cap;
205 struct virtio_rtc_req_read_alarm read_alarm;
206 struct virtio_rtc_req_set_alarm set_alarm;
207 struct virtio_rtc_req_set_alarm_enabled set_alarm_enabled;
208};
209
210/** Union of response types for requestq */
211union virtio_rtc_resp_requestq {
212 struct virtio_rtc_resp_read read;
213 struct virtio_rtc_resp_read_cross read_cross;
214 struct virtio_rtc_resp_cfg cfg;
215 struct virtio_rtc_resp_clock_cap clock_cap;
216 struct virtio_rtc_resp_cross_cap cross_cap;
217 struct virtio_rtc_resp_read_alarm read_alarm;
218 struct virtio_rtc_resp_set_alarm set_alarm;
219 struct virtio_rtc_resp_set_alarm_enabled set_alarm_enabled;
220};
221
222/* alarmq notifications */
223
224/* VIRTIO_RTC_NOTIF_ALARM notification */
225
226struct virtio_rtc_notif_alarm {
227 struct virtio_rtc_notif_head head;
228 __le16 clock_id;
229 __u8 reserved[6];
230};
231
232/** Union of notification types for alarmq */
233union virtio_rtc_notif_alarmq {
234 struct virtio_rtc_notif_alarm alarm;
235};
236
237#endif /* _LINUX_VIRTIO_RTC_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/virtio_snd.h+1-1
......@@ -25,7 +25,7 @@ struct virtio_snd_config {
2525 __le32 streams;
2626 /* # of available channel maps */
2727 __le32 chmaps;
28 /* # of available control elements */
28 /* # of available control elements (if VIRTIO_SND_F_CTLS) */
2929 __le32 controls;
3030};
3131
lib/libc/include/any-linux-any/linux/vm_sockets.h+2
......@@ -17,6 +17,8 @@
1717#ifndef _VM_SOCKETS_H
1818#define _VM_SOCKETS_H
1919
20#include <sys/socket.h> /* for struct sockaddr and sa_family_t */
21
2022#include <linux/socket.h>
2123#include <linux/types.h>
2224
lib/libc/include/any-linux-any/linux/vt.h+33-22
......@@ -2,6 +2,8 @@
22#ifndef _LINUX_VT_H
33#define _LINUX_VT_H
44
5#include <linux/ioctl.h>
6#include <linux/types.h>
57
68/*
79 * These constants are also useful for user-level apps (e.g., VC
......@@ -17,11 +19,11 @@
1719#define VT_OPENQRY 0x5600 /* find available vt */
1820
1921struct vt_mode {
20 char mode; /* vt mode */
21 char waitv; /* if set, hang on writes if not active */
22 short relsig; /* signal to raise on release req */
23 short acqsig; /* signal to raise on acquisition */
24 short frsig; /* unused (set to 0) */
22 __u8 mode; /* vt mode */
23 __u8 waitv; /* if set, hang on writes if not active */
24 __s16 relsig; /* signal to raise on release req */
25 __s16 acqsig; /* signal to raise on acquisition */
26 __s16 frsig; /* unused (set to 0) */
2527};
2628#define VT_GETMODE 0x5601 /* get mode of active vt */
2729#define VT_SETMODE 0x5602 /* set mode of active vt */
......@@ -30,9 +32,9 @@ struct vt_mode {
3032#define VT_ACKACQ 0x02 /* acknowledge switch */
3133
3234struct vt_stat {
33 unsigned short v_active; /* active vt */
34 unsigned short v_signal; /* signal to send */
35 unsigned short v_state; /* vt bitmask */
35 __u16 v_active; /* active vt */
36 __u16 v_signal; /* signal to send */
37 __u16 v_state; /* vt bitmask */
3638};
3739#define VT_GETSTATE 0x5603 /* get global vt state info */
3840#define VT_SENDSIG 0x5604 /* signal to send to bitmask of vts */
......@@ -44,19 +46,19 @@ struct vt_stat {
4446#define VT_DISALLOCATE 0x5608 /* free memory associated to vt */
4547
4648struct vt_sizes {
47 unsigned short v_rows; /* number of rows */
48 unsigned short v_cols; /* number of columns */
49 unsigned short v_scrollsize; /* number of lines of scrollback */
49 __u16 v_rows; /* number of rows */
50 __u16 v_cols; /* number of columns */
51 __u16 v_scrollsize; /* number of lines of scrollback */
5052};
5153#define VT_RESIZE 0x5609 /* set kernel's idea of screensize */
5254
5355struct vt_consize {
54 unsigned short v_rows; /* number of rows */
55 unsigned short v_cols; /* number of columns */
56 unsigned short v_vlin; /* number of pixel rows on screen */
57 unsigned short v_clin; /* number of pixel rows per character */
58 unsigned short v_vcol; /* number of pixel columns on screen */
59 unsigned short v_ccol; /* number of pixel columns per character */
56 __u16 v_rows; /* number of rows */
57 __u16 v_cols; /* number of columns */
58 __u16 v_vlin; /* number of pixel rows on screen */
59 __u16 v_clin; /* number of pixel rows per character */
60 __u16 v_vcol; /* number of pixel columns on screen */
61 __u16 v_ccol; /* number of pixel columns per character */
6062};
6163#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
6264#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
......@@ -64,24 +66,33 @@ struct vt_consize {
6466#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
6567
6668struct vt_event {
67 unsigned int event;
69 __u32 event;
6870#define VT_EVENT_SWITCH 0x0001 /* Console switch */
6971#define VT_EVENT_BLANK 0x0002 /* Screen blank */
7072#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
7173#define VT_EVENT_RESIZE 0x0008 /* Resize display */
7274#define VT_MAX_EVENT 0x000F
73 unsigned int oldev; /* Old console */
74 unsigned int newev; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */
75 __u32 oldev; /* Old console */
76 __u32 newev; /* New console (if changing) */
77 __u32 pad[4]; /* Padding for expansion */
7678};
7779
7880#define VT_WAITEVENT 0x560E /* Wait for an event */
7981
8082struct vt_setactivate {
81 unsigned int console;
83 __u32 console;
8284 struct vt_mode mode;
8385};
8486
8587#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
8688
89/* get console size and cursor position */
90struct vt_consizecsrpos {
91 __u16 con_rows; /* number of console rows */
92 __u16 con_cols; /* number of console columns */
93 __u16 csr_row; /* current cursor's row */
94 __u16 csr_col; /* current cursor's column */
95};
96#define VT_GETCONSIZECSRPOS _IOR('V', 0x10, struct vt_consizecsrpos)
97
8798#endif /* _LINUX_VT_H */
\ No newline at end of file
lib/libc/include/any-linux-any/linux/wireguard.h+9
......@@ -101,6 +101,10 @@
101101 * WGALLOWEDIP_A_FAMILY: NLA_U16
102102 * WGALLOWEDIP_A_IPADDR: struct in_addr or struct in6_addr
103103 * WGALLOWEDIP_A_CIDR_MASK: NLA_U8
104 * WGALLOWEDIP_A_FLAGS: NLA_U32, WGALLOWEDIP_F_REMOVE_ME if
105 * the specified IP should be removed;
106 * otherwise, this IP will be added if
107 * it is not already present.
104108 * 0: NLA_NESTED
105109 * ...
106110 * 0: NLA_NESTED
......@@ -184,11 +188,16 @@ enum wgpeer_attribute {
184188};
185189#define WGPEER_A_MAX (__WGPEER_A_LAST - 1)
186190
191enum wgallowedip_flag {
192 WGALLOWEDIP_F_REMOVE_ME = 1U << 0,
193 __WGALLOWEDIP_F_ALL = WGALLOWEDIP_F_REMOVE_ME
194};
187195enum wgallowedip_attribute {
188196 WGALLOWEDIP_A_UNSPEC,
189197 WGALLOWEDIP_A_FAMILY,
190198 WGALLOWEDIP_A_IPADDR,
191199 WGALLOWEDIP_A_CIDR_MASK,
200 WGALLOWEDIP_A_FLAGS,
192201 __WGALLOWEDIP_A_LAST
193202};
194203#define WGALLOWEDIP_A_MAX (__WGALLOWEDIP_A_LAST - 1)
lib/libc/include/any-linux-any/linux/xattr.h+4
......@@ -83,6 +83,10 @@ struct xattr_args {
8383#define XATTR_CAPS_SUFFIX "capability"
8484#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
8585
86#define XATTR_BPF_LSM_SUFFIX "bpf."
87#define XATTR_NAME_BPF_LSM (XATTR_SECURITY_PREFIX XATTR_BPF_LSM_SUFFIX)
88#define XATTR_NAME_BPF_LSM_LEN (sizeof(XATTR_NAME_BPF_LSM) - 1)
89
8690#define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
8791#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
8892#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
lib/libc/include/any-linux-any/linux/xfrm.h+8-1
......@@ -158,7 +158,8 @@ enum {
158158#define XFRM_MODE_ROUTEOPTIMIZATION 2
159159#define XFRM_MODE_IN_TRIGGER 3
160160#define XFRM_MODE_BEET 4
161#define XFRM_MODE_MAX 5
161#define XFRM_MODE_IPTFS 5
162#define XFRM_MODE_MAX 6
162163
163164/* Netlink configuration messages. */
164165enum {
......@@ -323,6 +324,12 @@ enum xfrm_attr_type_t {
323324 XFRMA_SA_DIR, /* __u8 */
324325 XFRMA_NAT_KEEPALIVE_INTERVAL, /* __u32 in seconds for NAT keepalive */
325326 XFRMA_SA_PCPU, /* __u32 */
327 XFRMA_IPTFS_DROP_TIME, /* __u32 in: usec to wait for next seq */
328 XFRMA_IPTFS_REORDER_WINDOW, /* __u16 in: reorder window size (pkts) */
329 XFRMA_IPTFS_DONT_FRAG, /* out: don't use fragmentation */
330 XFRMA_IPTFS_INIT_DELAY, /* __u32 out: initial packet wait delay (usec) */
331 XFRMA_IPTFS_MAX_QSIZE, /* __u32 out: max ingress queue size (octets) */
332 XFRMA_IPTFS_PKT_SIZE, /* __u32 out: size of outer packet, 0 for PMTU */
326333 __XFRMA_MAX
327334
328335#define XFRMA_OUTPUT_MARK XFRMA_SET_MARK /* Compatibility */
lib/libc/include/any-linux-any/misc/amd-apml.h created+152
......@@ -0,0 +1,152 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (C) 2021-2024 Advanced Micro Devices, Inc.
4 */
5#ifndef _AMD_APML_H_
6#define _AMD_APML_H_
7
8#include <linux/types.h>
9
10/* Mailbox data size for data_in and data_out */
11#define AMD_SBI_MB_DATA_SIZE 4
12
13struct apml_mbox_msg {
14 /*
15 * Mailbox Message ID
16 */
17 __u32 cmd;
18 /*
19 * [0]...[3] mailbox 32bit input/output data
20 */
21 __u32 mb_in_out;
22 /*
23 * Error code is returned in case of soft mailbox error
24 */
25 __u32 fw_ret_code;
26};
27
28struct apml_cpuid_msg {
29 /*
30 * CPUID input
31 * [0]...[3] cpuid func,
32 * [4][5] cpuid: thread
33 * [6] cpuid: ext function & read eax/ebx or ecx/edx
34 * [7:0] -> bits [7:4] -> ext function &
35 * bit [0] read eax/ebx or ecx/edx
36 * CPUID output
37 */
38 __u64 cpu_in_out;
39 /*
40 * Status code for CPUID read
41 */
42 __u32 fw_ret_code;
43 __u32 pad;
44};
45
46struct apml_mcamsr_msg {
47 /*
48 * MCAMSR input
49 * [0]...[3] mca msr func,
50 * [4][5] thread
51 * MCAMSR output
52 */
53 __u64 mcamsr_in_out;
54 /*
55 * Status code for MCA/MSR access
56 */
57 __u32 fw_ret_code;
58 __u32 pad;
59};
60
61struct apml_reg_xfer_msg {
62 /*
63 * RMI register address offset
64 */
65 __u16 reg_addr;
66 /*
67 * Register data for read/write
68 */
69 __u8 data_in_out;
70 /*
71 * Register read or write
72 */
73 __u8 rflag;
74};
75
76/*
77 * AMD sideband interface base IOCTL
78 */
79#define SB_BASE_IOCTL_NR 0xF9
80
81/**
82 * DOC: SBRMI_IOCTL_MBOX_CMD
83 *
84 * @Parameters
85 *
86 * @struct apml_mbox_msg
87 * Pointer to the &struct apml_mbox_msg that will contain the protocol
88 * information
89 *
90 * @Description
91 * IOCTL command for APML messages using generic _IOWR
92 * The IOCTL provides userspace access to AMD sideband mailbox protocol
93 * - Mailbox message read/write(0x0~0xFF)
94 * - returning "-EFAULT" if none of the above
95 * "-EPROTOTYPE" error is returned to provide additional error details
96 */
97#define SBRMI_IOCTL_MBOX_CMD _IOWR(SB_BASE_IOCTL_NR, 0, struct apml_mbox_msg)
98
99/**
100 * DOC: SBRMI_IOCTL_CPUID_CMD
101 *
102 * @Parameters
103 *
104 * @struct apml_cpuid_msg
105 * Pointer to the &struct apml_cpuid_msg that will contain the protocol
106 * information
107 *
108 * @Description
109 * IOCTL command for APML messages using generic _IOWR
110 * The IOCTL provides userspace access to AMD sideband cpuid protocol
111 * - CPUID protocol to get CPU details for Function/Ext Function
112 * at thread level
113 * - returning "-EFAULT" if none of the above
114 * "-EPROTOTYPE" error is returned to provide additional error details
115 */
116#define SBRMI_IOCTL_CPUID_CMD _IOWR(SB_BASE_IOCTL_NR, 1, struct apml_cpuid_msg)
117
118/**
119 * DOC: SBRMI_IOCTL_MCAMSR_CMD
120 *
121 * @Parameters
122 *
123 * @struct apml_mcamsr_msg
124 * Pointer to the &struct apml_mcamsr_msg that will contain the protocol
125 * information
126 *
127 * @Description
128 * IOCTL command for APML messages using generic _IOWR
129 * The IOCTL provides userspace access to AMD sideband MCAMSR protocol
130 * - MCAMSR protocol to get MCA bank details for Function at thread level
131 * - returning "-EFAULT" if none of the above
132 * "-EPROTOTYPE" error is returned to provide additional error details
133 */
134#define SBRMI_IOCTL_MCAMSR_CMD _IOWR(SB_BASE_IOCTL_NR, 2, struct apml_mcamsr_msg)
135
136/**
137 * DOC: SBRMI_IOCTL_REG_XFER_CMD
138 *
139 * @Parameters
140 *
141 * @struct apml_reg_xfer_msg
142 * Pointer to the &struct apml_reg_xfer_msg that will contain the protocol
143 * information
144 *
145 * @Description
146 * IOCTL command for APML messages using generic _IOWR
147 * The IOCTL provides userspace access to AMD sideband register xfer protocol
148 * - Register xfer protocol to get/set hardware register for given offset
149 */
150#define SBRMI_IOCTL_REG_XFER_CMD _IOWR(SB_BASE_IOCTL_NR, 3, struct apml_reg_xfer_msg)
151
152#endif /*_AMD_APML_H_*/
\ No newline at end of file
lib/libc/include/any-linux-any/misc/cxl.h deleted-156
......@@ -1,156 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * Copyright 2014 IBM Corp.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#ifndef _MISC_CXL_H
12#define _MISC_CXL_H
13
14#include <linux/types.h>
15#include <linux/ioctl.h>
16
17
18struct cxl_ioctl_start_work {
19 __u64 flags;
20 __u64 work_element_descriptor;
21 __u64 amr;
22 __s16 num_interrupts;
23 __u16 tid;
24 __s32 reserved1;
25 __u64 reserved2;
26 __u64 reserved3;
27 __u64 reserved4;
28 __u64 reserved5;
29};
30
31#define CXL_START_WORK_AMR 0x0000000000000001ULL
32#define CXL_START_WORK_NUM_IRQS 0x0000000000000002ULL
33#define CXL_START_WORK_ERR_FF 0x0000000000000004ULL
34#define CXL_START_WORK_TID 0x0000000000000008ULL
35#define CXL_START_WORK_ALL (CXL_START_WORK_AMR |\
36 CXL_START_WORK_NUM_IRQS |\
37 CXL_START_WORK_ERR_FF |\
38 CXL_START_WORK_TID)
39
40
41/* Possible modes that an afu can be in */
42#define CXL_MODE_DEDICATED 0x1
43#define CXL_MODE_DIRECTED 0x2
44
45/* possible flags for the cxl_afu_id flags field */
46#define CXL_AFUID_FLAG_SLAVE 0x1 /* In directed-mode afu is in slave mode */
47
48struct cxl_afu_id {
49 __u64 flags; /* One of CXL_AFUID_FLAG_X */
50 __u32 card_id;
51 __u32 afu_offset;
52 __u32 afu_mode; /* one of the CXL_MODE_X */
53 __u32 reserved1;
54 __u64 reserved2;
55 __u64 reserved3;
56 __u64 reserved4;
57 __u64 reserved5;
58 __u64 reserved6;
59};
60
61/* base adapter image header is included in the image */
62#define CXL_AI_NEED_HEADER 0x0000000000000001ULL
63#define CXL_AI_ALL CXL_AI_NEED_HEADER
64
65#define CXL_AI_HEADER_SIZE 128
66#define CXL_AI_BUFFER_SIZE 4096
67#define CXL_AI_MAX_ENTRIES 256
68#define CXL_AI_MAX_CHUNK_SIZE (CXL_AI_BUFFER_SIZE * CXL_AI_MAX_ENTRIES)
69
70struct cxl_adapter_image {
71 __u64 flags;
72 __u64 data;
73 __u64 len_data;
74 __u64 len_image;
75 __u64 reserved1;
76 __u64 reserved2;
77 __u64 reserved3;
78 __u64 reserved4;
79};
80
81/* ioctl numbers */
82#define CXL_MAGIC 0xCA
83/* AFU devices */
84#define CXL_IOCTL_START_WORK _IOW(CXL_MAGIC, 0x00, struct cxl_ioctl_start_work)
85#define CXL_IOCTL_GET_PROCESS_ELEMENT _IOR(CXL_MAGIC, 0x01, __u32)
86#define CXL_IOCTL_GET_AFU_ID _IOR(CXL_MAGIC, 0x02, struct cxl_afu_id)
87/* adapter devices */
88#define CXL_IOCTL_DOWNLOAD_IMAGE _IOW(CXL_MAGIC, 0x0A, struct cxl_adapter_image)
89#define CXL_IOCTL_VALIDATE_IMAGE _IOW(CXL_MAGIC, 0x0B, struct cxl_adapter_image)
90
91#define CXL_READ_MIN_SIZE 0x1000 /* 4K */
92
93/* Events from read() */
94enum cxl_event_type {
95 CXL_EVENT_RESERVED = 0,
96 CXL_EVENT_AFU_INTERRUPT = 1,
97 CXL_EVENT_DATA_STORAGE = 2,
98 CXL_EVENT_AFU_ERROR = 3,
99 CXL_EVENT_AFU_DRIVER = 4,
100};
101
102struct cxl_event_header {
103 __u16 type;
104 __u16 size;
105 __u16 process_element;
106 __u16 reserved1;
107};
108
109struct cxl_event_afu_interrupt {
110 __u16 flags;
111 __u16 irq; /* Raised AFU interrupt number */
112 __u32 reserved1;
113};
114
115struct cxl_event_data_storage {
116 __u16 flags;
117 __u16 reserved1;
118 __u32 reserved2;
119 __u64 addr;
120 __u64 dsisr;
121 __u64 reserved3;
122};
123
124struct cxl_event_afu_error {
125 __u16 flags;
126 __u16 reserved1;
127 __u32 reserved2;
128 __u64 error;
129};
130
131struct cxl_event_afu_driver_reserved {
132 /*
133 * Defines the buffer passed to the cxl driver by the AFU driver.
134 *
135 * This is not ABI since the event header.size passed to the user for
136 * existing events is set in the read call to sizeof(cxl_event_header)
137 * + sizeof(whatever event is being dispatched) and the user is already
138 * required to use a 4K buffer on the read call.
139 *
140 * Of course the contents will be ABI, but that's up the AFU driver.
141 */
142 __u32 data_size;
143 __u8 data[];
144};
145
146struct cxl_event {
147 struct cxl_event_header header;
148 union {
149 struct cxl_event_afu_interrupt irq;
150 struct cxl_event_data_storage fault;
151 struct cxl_event_afu_error afu_error;
152 struct cxl_event_afu_driver_reserved afu_driver_event;
153 };
154};
155
156#endif /* _MISC_CXL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/mtd/ubi-user.h+33
......@@ -175,6 +175,8 @@
175175#define UBI_IOCRPEB _IOW(UBI_IOC_MAGIC, 4, __s32)
176176/* Force scrubbing on the specified PEB */
177177#define UBI_IOCSPEB _IOW(UBI_IOC_MAGIC, 5, __s32)
178/* Read detailed device erase counter information */
179#define UBI_IOCECNFO _IOWR(UBI_IOC_MAGIC, 6, struct ubi_ecinfo_req)
178180
179181/* ioctl commands of the UBI control character device */
180182
......@@ -412,6 +414,37 @@ struct ubi_rnvol_req {
412414 } ents[UBI_MAX_RNVOL];
413415} __attribute__((packed));
414416
417/**
418 * struct ubi_ecinfo_req - a data structure used for requesting and receiving
419 * erase block counter information from a UBI device.
420 *
421 * @start: index of first physical erase block to read (in)
422 * @length: number of erase counters to read (in)
423 * @read_length: number of erase counters that was actually read (out)
424 * @padding: reserved for future, not used, has to be zeroed
425 * @erase_counters: array of erase counter values (out)
426 *
427 * This structure is used to retrieve erase counter information for a specified
428 * range of PEBs on a UBI device.
429 * Erase counters are read from @start and attempts to read @length number of
430 * erase counters.
431 * The retrieved values are stored in the @erase_counters array. It is the
432 * responsibility of the caller to allocate enough memory for storing @length
433 * elements in the @erase_counters array.
434 * If a block is bad or if the erase counter is unknown the corresponding value
435 * in the array will be set to -1.
436 * The @read_length field will indicate the number of erase counters actually
437 * read. Typically @read_length will be limited due to memory or the number of
438 * PEBs on the UBI device.
439 */
440struct ubi_ecinfo_req {
441 __s32 start;
442 __s32 length;
443 __s32 read_length;
444 __s8 padding[16];
445 __s32 erase_counters[];
446} __attribute__((packed));
447
415448/**
416449 * struct ubi_leb_change_req - a data structure used in atomic LEB change
417450 * requests.
lib/libc/include/any-linux-any/rdma/efa-abi.h+2-1
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
22/*
3 * Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
3 * Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
44 */
55
66#ifndef EFA_ABI_USER_H
......@@ -131,6 +131,7 @@ enum {
131131 EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
132132 EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
133133 EFA_QUERY_DEVICE_CAPS_UNSOLICITED_WRITE_RECV = 1 << 6,
134 EFA_QUERY_DEVICE_CAPS_CQ_WITH_EXT_MEM = 1 << 7,
134135};
135136
136137struct efa_ibv_ex_query_device_resp {
lib/libc/include/any-linux-any/rdma/ib_user_ioctl_cmds.h+37
......@@ -55,6 +55,7 @@ enum uverbs_default_objects {
5555 UVERBS_OBJECT_DM,
5656 UVERBS_OBJECT_COUNTERS,
5757 UVERBS_OBJECT_ASYNC_EVENT,
58 UVERBS_OBJECT_DMAH,
5859};
5960
6061enum {
......@@ -88,6 +89,7 @@ enum uverbs_attrs_query_port_cmd_attr_ids {
8889enum uverbs_attrs_get_context_attr_ids {
8990 UVERBS_ATTR_GET_CONTEXT_NUM_COMP_VECTORS,
9091 UVERBS_ATTR_GET_CONTEXT_CORE_SUPPORT,
92 UVERBS_ATTR_GET_CONTEXT_FD_ARR,
9193};
9294
9395enum uverbs_attrs_query_context_attr_ids {
......@@ -104,6 +106,10 @@ enum uverbs_attrs_create_cq_cmd_attr_ids {
104106 UVERBS_ATTR_CREATE_CQ_FLAGS,
105107 UVERBS_ATTR_CREATE_CQ_RESP_CQE,
106108 UVERBS_ATTR_CREATE_CQ_EVENT_FD,
109 UVERBS_ATTR_CREATE_CQ_BUFFER_VA,
110 UVERBS_ATTR_CREATE_CQ_BUFFER_LENGTH,
111 UVERBS_ATTR_CREATE_CQ_BUFFER_FD,
112 UVERBS_ATTR_CREATE_CQ_BUFFER_OFFSET,
107113};
108114
109115enum uverbs_attrs_destroy_cq_cmd_attr_ids {
......@@ -235,6 +241,22 @@ enum uverbs_methods_dm {
235241 UVERBS_METHOD_DM_FREE,
236242};
237243
244enum uverbs_attrs_alloc_dmah_cmd_attr_ids {
245 UVERBS_ATTR_ALLOC_DMAH_HANDLE,
246 UVERBS_ATTR_ALLOC_DMAH_CPU_ID,
247 UVERBS_ATTR_ALLOC_DMAH_TPH_MEM_TYPE,
248 UVERBS_ATTR_ALLOC_DMAH_PH,
249};
250
251enum uverbs_attrs_free_dmah_cmd_attr_ids {
252 UVERBS_ATTR_FREE_DMA_HANDLE,
253};
254
255enum uverbs_methods_dmah {
256 UVERBS_METHOD_DMAH_ALLOC,
257 UVERBS_METHOD_DMAH_FREE,
258};
259
238260enum uverbs_attrs_reg_dm_mr_cmd_attr_ids {
239261 UVERBS_ATTR_REG_DM_MR_HANDLE,
240262 UVERBS_ATTR_REG_DM_MR_OFFSET,
......@@ -252,6 +274,7 @@ enum uverbs_methods_mr {
252274 UVERBS_METHOD_ADVISE_MR,
253275 UVERBS_METHOD_QUERY_MR,
254276 UVERBS_METHOD_REG_DMABUF_MR,
277 UVERBS_METHOD_REG_MR,
255278};
256279
257280enum uverbs_attrs_mr_destroy_ids {
......@@ -285,6 +308,20 @@ enum uverbs_attrs_reg_dmabuf_mr_cmd_attr_ids {
285308 UVERBS_ATTR_REG_DMABUF_MR_RESP_RKEY,
286309};
287310
311enum uverbs_attrs_reg_mr_cmd_attr_ids {
312 UVERBS_ATTR_REG_MR_HANDLE,
313 UVERBS_ATTR_REG_MR_PD_HANDLE,
314 UVERBS_ATTR_REG_MR_DMA_HANDLE,
315 UVERBS_ATTR_REG_MR_IOVA,
316 UVERBS_ATTR_REG_MR_ADDR,
317 UVERBS_ATTR_REG_MR_LENGTH,
318 UVERBS_ATTR_REG_MR_ACCESS_FLAGS,
319 UVERBS_ATTR_REG_MR_FD,
320 UVERBS_ATTR_REG_MR_FD_OFFSET,
321 UVERBS_ATTR_REG_MR_RESP_LKEY,
322 UVERBS_ATTR_REG_MR_RESP_RKEY,
323};
324
288325enum uverbs_attrs_create_counters_cmd_attr_ids {
289326 UVERBS_ATTR_CREATE_COUNTERS_HANDLE,
290327};
lib/libc/include/any-linux-any/rdma/ib_user_verbs.h+16
......@@ -233,6 +233,22 @@ struct ib_uverbs_ex_query_device {
233233 __u32 reserved;
234234};
235235
236enum ib_uverbs_odp_general_cap_bits {
237 IB_UVERBS_ODP_SUPPORT = 1 << 0,
238 IB_UVERBS_ODP_SUPPORT_IMPLICIT = 1 << 1,
239};
240
241enum ib_uverbs_odp_transport_cap_bits {
242 IB_UVERBS_ODP_SUPPORT_SEND = 1 << 0,
243 IB_UVERBS_ODP_SUPPORT_RECV = 1 << 1,
244 IB_UVERBS_ODP_SUPPORT_WRITE = 1 << 2,
245 IB_UVERBS_ODP_SUPPORT_READ = 1 << 3,
246 IB_UVERBS_ODP_SUPPORT_ATOMIC = 1 << 4,
247 IB_UVERBS_ODP_SUPPORT_SRQ_RECV = 1 << 5,
248 IB_UVERBS_ODP_SUPPORT_FLUSH = 1 << 6,
249 IB_UVERBS_ODP_SUPPORT_ATOMIC_WRITE = 1 << 7,
250};
251
236252struct ib_uverbs_odp_caps {
237253 __aligned_u64 general_caps;
238254 struct {
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_cmds.h+1
......@@ -239,6 +239,7 @@ enum mlx5_ib_flow_matcher_create_attrs {
239239 MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
240240 MLX5_IB_ATTR_FLOW_MATCHER_FLOW_FLAGS,
241241 MLX5_IB_ATTR_FLOW_MATCHER_FT_TYPE,
242 MLX5_IB_ATTR_FLOW_MATCHER_IB_PORT,
242243};
243244
244245enum mlx5_ib_flow_matcher_destroy_attrs {
lib/libc/include/any-linux-any/rdma/mlx5_user_ioctl_verbs.h+2
......@@ -45,6 +45,8 @@ enum mlx5_ib_uapi_flow_table_type {
4545 MLX5_IB_UAPI_FLOW_TABLE_TYPE_FDB = 0x2,
4646 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_RX = 0x3,
4747 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_TX = 0x4,
48 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_TRANSPORT_RX = 0x5,
49 MLX5_IB_UAPI_FLOW_TABLE_TYPE_RDMA_TRANSPORT_TX = 0x6,
4850};
4951
5052enum mlx5_ib_uapi_flow_action_packet_reformat_type {
lib/libc/include/any-linux-any/rdma/rdma_netlink.h+2
......@@ -580,6 +580,8 @@ enum rdma_nldev_attr {
580580 RDMA_NLDEV_ATTR_EVENT_TYPE, /* u8 */
581581
582582 RDMA_NLDEV_SYS_ATTR_MONITOR_MODE, /* u8 */
583
584 RDMA_NLDEV_ATTR_STAT_OPCOUNTER_ENABLED, /* u8 */
583585 /*
584586 * Always the end
585587 */
lib/libc/include/any-linux-any/scsi/cxlflash_ioctl.h deleted-276
......@@ -1,276 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2/*
3 * CXL Flash Device Driver
4 *
5 * Written by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>, IBM Corporation
6 * Matthew R. Ochs <mrochs@linux.vnet.ibm.com>, IBM Corporation
7 *
8 * Copyright (C) 2015 IBM Corporation
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 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#ifndef _CXLFLASH_IOCTL_H
17#define _CXLFLASH_IOCTL_H
18
19#include <linux/types.h>
20
21/*
22 * Structure and definitions for all CXL Flash ioctls
23 */
24#define CXLFLASH_WWID_LEN 16
25
26/*
27 * Structure and flag definitions CXL Flash superpipe ioctls
28 */
29
30#define DK_CXLFLASH_VERSION_0 0
31
32struct dk_cxlflash_hdr {
33 __u16 version; /* Version data */
34 __u16 rsvd[3]; /* Reserved for future use */
35 __u64 flags; /* Input flags */
36 __u64 return_flags; /* Returned flags */
37};
38
39/*
40 * Return flag definitions available to all superpipe ioctls
41 *
42 * Similar to the input flags, these are grown from the bottom-up with the
43 * intention that ioctl-specific return flag definitions would grow from the
44 * top-down, allowing the two sets to co-exist. While not required/enforced
45 * at this time, this provides future flexibility.
46 */
47#define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL
48#define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL
49#define DK_CXLFLASH_CONTEXT_SQ_CMD_MODE 0x0000000000000004ULL
50
51/*
52 * General Notes:
53 * -------------
54 * The 'context_id' field of all ioctl structures contains the context
55 * identifier for a context in the lower 32-bits (upper 32-bits are not
56 * to be used when identifying a context to the AFU). That said, the value
57 * in its entirety (all 64-bits) is to be treated as an opaque cookie and
58 * should be presented as such when issuing ioctls.
59 */
60
61/*
62 * DK_CXLFLASH_ATTACH Notes:
63 * ------------------------
64 * Read/write access permissions are specified via the O_RDONLY, O_WRONLY,
65 * and O_RDWR flags defined in the fcntl.h header file.
66 *
67 * A valid adapter file descriptor (fd >= 0) is only returned on the initial
68 * attach (successful) of a context. When a context is shared(reused), the user
69 * is expected to already 'know' the adapter file descriptor associated with the
70 * context.
71 */
72#define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL
73
74struct dk_cxlflash_attach {
75 struct dk_cxlflash_hdr hdr; /* Common fields */
76 __u64 num_interrupts; /* Requested number of interrupts */
77 __u64 context_id; /* Returned context */
78 __u64 mmio_size; /* Returned size of MMIO area */
79 __u64 block_size; /* Returned block size, in bytes */
80 __u64 adap_fd; /* Returned adapter file descriptor */
81 __u64 last_lba; /* Returned last LBA on the device */
82 __u64 max_xfer; /* Returned max transfer size, blocks */
83 __u64 reserved[8]; /* Reserved for future use */
84};
85
86struct dk_cxlflash_detach {
87 struct dk_cxlflash_hdr hdr; /* Common fields */
88 __u64 context_id; /* Context to detach */
89 __u64 reserved[8]; /* Reserved for future use */
90};
91
92struct dk_cxlflash_udirect {
93 struct dk_cxlflash_hdr hdr; /* Common fields */
94 __u64 context_id; /* Context to own physical resources */
95 __u64 rsrc_handle; /* Returned resource handle */
96 __u64 last_lba; /* Returned last LBA on the device */
97 __u64 reserved[8]; /* Reserved for future use */
98};
99
100#define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL
101
102struct dk_cxlflash_uvirtual {
103 struct dk_cxlflash_hdr hdr; /* Common fields */
104 __u64 context_id; /* Context to own virtual resources */
105 __u64 lun_size; /* Requested size, in 4K blocks */
106 __u64 rsrc_handle; /* Returned resource handle */
107 __u64 last_lba; /* Returned last LBA of LUN */
108 __u64 reserved[8]; /* Reserved for future use */
109};
110
111struct dk_cxlflash_release {
112 struct dk_cxlflash_hdr hdr; /* Common fields */
113 __u64 context_id; /* Context owning resources */
114 __u64 rsrc_handle; /* Resource handle to release */
115 __u64 reserved[8]; /* Reserved for future use */
116};
117
118struct dk_cxlflash_resize {
119 struct dk_cxlflash_hdr hdr; /* Common fields */
120 __u64 context_id; /* Context owning resources */
121 __u64 rsrc_handle; /* Resource handle of LUN to resize */
122 __u64 req_size; /* New requested size, in 4K blocks */
123 __u64 last_lba; /* Returned last LBA of LUN */
124 __u64 reserved[8]; /* Reserved for future use */
125};
126
127struct dk_cxlflash_clone {
128 struct dk_cxlflash_hdr hdr; /* Common fields */
129 __u64 context_id_src; /* Context to clone from */
130 __u64 context_id_dst; /* Context to clone to */
131 __u64 adap_fd_src; /* Source context adapter fd */
132 __u64 reserved[8]; /* Reserved for future use */
133};
134
135#define DK_CXLFLASH_VERIFY_SENSE_LEN 18
136#define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL
137
138struct dk_cxlflash_verify {
139 struct dk_cxlflash_hdr hdr; /* Common fields */
140 __u64 context_id; /* Context owning resources to verify */
141 __u64 rsrc_handle; /* Resource handle of LUN */
142 __u64 hint; /* Reasons for verify */
143 __u64 last_lba; /* Returned last LBA of device */
144 __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN]; /* SCSI sense data */
145 __u8 pad[6]; /* Pad to next 8-byte boundary */
146 __u64 reserved[8]; /* Reserved for future use */
147};
148
149#define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL
150
151struct dk_cxlflash_recover_afu {
152 struct dk_cxlflash_hdr hdr; /* Common fields */
153 __u64 reason; /* Reason for recovery request */
154 __u64 context_id; /* Context to recover / updated ID */
155 __u64 mmio_size; /* Returned size of MMIO area */
156 __u64 adap_fd; /* Returned adapter file descriptor */
157 __u64 reserved[8]; /* Reserved for future use */
158};
159
160#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN
161#define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL
162#define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL
163#define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL
164
165struct dk_cxlflash_manage_lun {
166 struct dk_cxlflash_hdr hdr; /* Common fields */
167 __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN]; /* Page83 WWID, NAA-6 */
168 __u64 reserved[8]; /* Rsvd, future use */
169};
170
171union cxlflash_ioctls {
172 struct dk_cxlflash_attach attach;
173 struct dk_cxlflash_detach detach;
174 struct dk_cxlflash_udirect udirect;
175 struct dk_cxlflash_uvirtual uvirtual;
176 struct dk_cxlflash_release release;
177 struct dk_cxlflash_resize resize;
178 struct dk_cxlflash_clone clone;
179 struct dk_cxlflash_verify verify;
180 struct dk_cxlflash_recover_afu recover_afu;
181 struct dk_cxlflash_manage_lun manage_lun;
182};
183
184#define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls))
185
186#define CXL_MAGIC 0xCA
187#define CXL_IOWR(_n, _s) _IOWR(CXL_MAGIC, _n, struct _s)
188
189/*
190 * CXL Flash superpipe ioctls start at base of the reserved CXL_MAGIC
191 * region (0x80) and grow upwards.
192 */
193#define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach)
194#define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect)
195#define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release)
196#define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach)
197#define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify)
198#define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu)
199#define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun)
200#define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual)
201#define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize)
202#define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone)
203
204/*
205 * Structure and flag definitions CXL Flash host ioctls
206 */
207
208#define HT_CXLFLASH_VERSION_0 0
209
210struct ht_cxlflash_hdr {
211 __u16 version; /* Version data */
212 __u16 subcmd; /* Sub-command */
213 __u16 rsvd[2]; /* Reserved for future use */
214 __u64 flags; /* Input flags */
215 __u64 return_flags; /* Returned flags */
216};
217
218/*
219 * Input flag definitions available to all host ioctls
220 *
221 * These are grown from the bottom-up with the intention that ioctl-specific
222 * input flag definitions would grow from the top-down, allowing the two sets
223 * to co-exist. While not required/enforced at this time, this provides future
224 * flexibility.
225 */
226#define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL
227#define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL
228
229#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001
230#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002
231#define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003
232
233struct ht_cxlflash_lun_provision {
234 struct ht_cxlflash_hdr hdr; /* Common fields */
235 __u16 port; /* Target port for provision request */
236 __u16 reserved16[3]; /* Reserved for future use */
237 __u64 size; /* Size of LUN (4K blocks) */
238 __u64 lun_id; /* SCSI LUN ID */
239 __u8 wwid[CXLFLASH_WWID_LEN];/* Page83 WWID, NAA-6 */
240 __u64 max_num_luns; /* Maximum number of LUNs provisioned */
241 __u64 cur_num_luns; /* Current number of LUNs provisioned */
242 __u64 max_cap_port; /* Total capacity for port (4K blocks) */
243 __u64 cur_cap_port; /* Current capacity for port (4K blocks) */
244 __u64 reserved[8]; /* Reserved for future use */
245};
246
247#define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 /* 256K */
248#define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12
249struct ht_cxlflash_afu_debug {
250 struct ht_cxlflash_hdr hdr; /* Common fields */
251 __u8 reserved8[4]; /* Reserved for future use */
252 __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; /* AFU subcommand,
253 * (pass through)
254 */
255 __u64 data_ea; /* Data buffer effective address */
256 __u32 data_len; /* Data buffer length */
257 __u32 reserved32; /* Reserved for future use */
258 __u64 reserved[8]; /* Reserved for future use */
259};
260
261union cxlflash_ht_ioctls {
262 struct ht_cxlflash_lun_provision lun_provision;
263 struct ht_cxlflash_afu_debug afu_debug;
264};
265
266#define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls))
267
268/*
269 * CXL Flash host ioctls start at the top of the reserved CXL_MAGIC
270 * region (0xBF) and grow downwards.
271 */
272#define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision)
273#define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug)
274
275
276#endif /* ifndef _CXLFLASH_IOCTL_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/asequencer.h+11-1
......@@ -10,7 +10,7 @@
1010#include <sound/asound.h>
1111
1212/** version of the sequencer */
13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
13#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 5)
1414
1515/**
1616 * definition of sequencer event types
......@@ -92,6 +92,9 @@
9292#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
9393#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
9494
95#define SNDRV_SEQ_EVENT_UMP_EP_CHANGE 68 /* UMP EP info has changed */
96#define SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE 69 /* UMP block info has changed */
97
9598/* 70-89: synthesizer events - obsoleted */
9699
97100/** user-defined events with fixed length
......@@ -253,6 +256,12 @@ struct snd_seq_ev_quote {
253256 struct snd_seq_event *event; /* quoted event */
254257} __attribute__((packed));
255258
259 /* UMP info change notify */
260struct snd_seq_ev_ump_notify {
261 unsigned char client; /**< Client number */
262 unsigned char block; /**< Block number (optional) */
263};
264
256265union snd_seq_event_data { /* event data... */
257266 struct snd_seq_ev_note note;
258267 struct snd_seq_ev_ctrl control;
......@@ -265,6 +274,7 @@ union snd_seq_event_data { /* event data... */
265274 struct snd_seq_connect connect;
266275 struct snd_seq_result result;
267276 struct snd_seq_ev_quote quote;
277 struct snd_seq_ev_ump_notify ump_notify;
268278};
269279
270280 /* sequencer event */
lib/libc/include/any-linux-any/sound/asound.h+6-2
......@@ -708,7 +708,7 @@ enum {
708708 * Raw MIDI section - /dev/snd/midi??
709709 */
710710
711#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
711#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
712712
713713enum {
714714 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
......@@ -720,6 +720,9 @@ enum {
720720#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
721721#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
722722#define SNDRV_RAWMIDI_INFO_UMP 0x00000008
723#define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010
724
725#define SNDRV_RAWMIDI_DEVICE_UNKNOWN 0
723726
724727struct snd_rawmidi_info {
725728 unsigned int device; /* RO/WR (control): device number */
......@@ -732,7 +735,8 @@ struct snd_rawmidi_info {
732735 unsigned char subname[32]; /* name of active or selected subdevice */
733736 unsigned int subdevices_count;
734737 unsigned int subdevices_avail;
735 unsigned char reserved[64]; /* reserved for future use */
738 int tied_device; /* R: tied rawmidi device (UMP/legacy) */
739 unsigned char reserved[60]; /* reserved for future use */
736740};
737741
738742#define SNDRV_RAWMIDI_MODE_FRAMING_MASK (7<<0)
lib/libc/include/any-linux-any/sound/compress_params.h+21-2
......@@ -334,6 +334,14 @@ union snd_codec_options {
334334 struct snd_dec_wma wma_d;
335335 struct snd_dec_alac alac_d;
336336 struct snd_dec_ape ape_d;
337 struct {
338 __u32 out_sample_rate;
339 } src_d;
340} __attribute__((packed, aligned(4)));
341
342struct snd_codec_desc_src {
343 __u32 out_sample_rate_min;
344 __u32 out_sample_rate_max;
337345} __attribute__((packed, aligned(4)));
338346
339347/** struct snd_codec_desc - description of codec capabilities
......@@ -347,6 +355,9 @@ union snd_codec_options {
347355 * @modes: Supported modes. See SND_AUDIOMODE defines
348356 * @formats: Supported formats. See SND_AUDIOSTREAMFORMAT defines
349357 * @min_buffer: Minimum buffer size handled by codec implementation
358 * @pcm_formats: Output (for decoders) or input (for encoders)
359 * PCM formats (required to accel mode, 0 for other modes)
360 * @u_space: union space (for codec dependent data)
350361 * @reserved: reserved for future use
351362 *
352363 * This structure provides a scalar value for profiles, modes and stream
......@@ -370,7 +381,12 @@ struct snd_codec_desc {
370381 __u32 modes;
371382 __u32 formats;
372383 __u32 min_buffer;
373 __u32 reserved[15];
384 __u32 pcm_formats;
385 union {
386 __u32 u_space[6];
387 struct snd_codec_desc_src src;
388 } __attribute__((packed, aligned(4)));
389 __u32 reserved[8];
374390} __attribute__((packed, aligned(4)));
375391
376392/** struct snd_codec
......@@ -395,6 +411,8 @@ struct snd_codec_desc {
395411 * @align: Block alignment in bytes of an audio sample.
396412 * Only required for PCM or IEC formats.
397413 * @options: encoder-specific settings
414 * @pcm_format: Output (for decoders) or input (for encoders)
415 * PCM formats (required to accel mode, 0 for other modes)
398416 * @reserved: reserved for future use
399417 */
400418
......@@ -411,7 +429,8 @@ struct snd_codec {
411429 __u32 format;
412430 __u32 align;
413431 union snd_codec_options options;
414 __u32 reserved[3];
432 __u32 pcm_format;
433 __u32 reserved[2];
415434} __attribute__((packed, aligned(4)));
416435
417436#endif
\ No newline at end of file
lib/libc/include/any-linux-any/sound/fcp.h created+120
......@@ -0,0 +1,120 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Focusrite Control Protocol Driver for ALSA
4 *
5 * Copyright (c) 2024-2025 by Geoffrey D. Bennett <g at b4.vu>
6 */
7/*
8 * DOC: FCP (Focusrite Control Protocol) User-Space API
9 *
10 * This header defines the interface between the FCP kernel driver and
11 * user-space programs to enable the use of the proprietary features
12 * available in Focusrite USB audio interfaces. This includes Scarlett
13 * 2nd Gen, 3rd Gen, 4th Gen, Clarett USB, Clarett+, and Vocaster
14 * series devices.
15 *
16 * The interface is provided via ALSA's hwdep interface. Opening the
17 * hwdep device requires CAP_SYS_RAWIO privileges as this interface
18 * provides near-direct access.
19 *
20 * For details on the FCP protocol, refer to the kernel scarlett2
21 * driver in sound/usb/mixer_scarlett2.c and the fcp-support project
22 * at https://github.com/geoffreybennett/fcp-support
23 *
24 * For examples of using these IOCTLs, see the fcp-server source in
25 * the fcp-support project.
26 *
27 * IOCTL Interface
28 * --------------
29 * FCP_IOCTL_PVERSION:
30 * Returns the protocol version supported by the driver.
31 *
32 * FCP_IOCTL_INIT:
33 * Initialises the protocol and synchronises sequence numbers
34 * between the driver and device. Must be called at least once
35 * before sending commands. Can be safely called again at any time.
36 *
37 * FCP_IOCTL_CMD:
38 * Sends an FCP command to the device and returns the response.
39 * Requires prior initialisation via FCP_IOCTL_INIT.
40 *
41 * FCP_IOCTL_SET_METER_MAP:
42 * Configures the Level Meter control's mapping between device
43 * meters and control channels. Requires FCP_IOCTL_INIT to have been
44 * called first. The map size and number of slots cannot be changed
45 * after initial configuration, although the map itself can be
46 * updated. Once configured, the Level Meter remains functional even
47 * after the hwdep device is closed.
48 *
49 * FCP_IOCTL_SET_METER_LABELS:
50 * Set the labels for the Level Meter control. Requires
51 * FCP_IOCTL_SET_METER_MAP to have been called first. labels[]
52 * should contain a sequence of null-terminated labels corresponding
53 * to the control's channels.
54 */
55#ifndef __UAPI_SOUND_FCP_H
56#define __UAPI_SOUND_FCP_H
57
58#include <linux/types.h>
59#include <linux/ioctl.h>
60
61#define FCP_HWDEP_MAJOR 2
62#define FCP_HWDEP_MINOR 0
63#define FCP_HWDEP_SUBMINOR 0
64
65#define FCP_HWDEP_VERSION \
66 ((FCP_HWDEP_MAJOR << 16) | \
67 (FCP_HWDEP_MINOR << 8) | \
68 FCP_HWDEP_SUBMINOR)
69
70#define FCP_HWDEP_VERSION_MAJOR(v) (((v) >> 16) & 0xFF)
71#define FCP_HWDEP_VERSION_MINOR(v) (((v) >> 8) & 0xFF)
72#define FCP_HWDEP_VERSION_SUBMINOR(v) ((v) & 0xFF)
73
74/* Get protocol version */
75#define FCP_IOCTL_PVERSION _IOR('S', 0x60, int)
76
77/* Start the protocol */
78
79/* Step 0 and step 2 responses are variable length and placed in
80 * resp[] one after the other.
81 */
82struct fcp_init {
83 __u16 step0_resp_size;
84 __u16 step2_resp_size;
85 __u32 init1_opcode;
86 __u32 init2_opcode;
87 __u8 resp[];
88} __attribute__((packed));
89
90#define FCP_IOCTL_INIT _IOWR('S', 0x64, struct fcp_init)
91
92/* Perform a command */
93
94/* The request data is placed in data[] and the response data will
95 * overwrite it.
96 */
97struct fcp_cmd {
98 __u32 opcode;
99 __u16 req_size;
100 __u16 resp_size;
101 __u8 data[];
102} __attribute__((packed));
103#define FCP_IOCTL_CMD _IOWR('S', 0x65, struct fcp_cmd)
104
105/* Set the meter map */
106struct fcp_meter_map {
107 __u16 map_size;
108 __u16 meter_slots;
109 __s16 map[];
110} __attribute__((packed));
111#define FCP_IOCTL_SET_METER_MAP _IOW('S', 0x66, struct fcp_meter_map)
112
113/* Set the meter labels */
114struct fcp_meter_labels {
115 __u16 labels_size;
116 char labels[];
117} __attribute__((packed));
118#define FCP_IOCTL_SET_METER_LABELS _IOW('S', 0x67, struct fcp_meter_labels)
119
120#endif /* __UAPI_SOUND_FCP_H */
\ No newline at end of file
lib/libc/include/any-linux-any/sound/intel/avs/tokens.h+11
......@@ -77,6 +77,17 @@ enum avs_tplg_token {
7777 AVS_TKN_MODCFG_UPDOWN_MIX_CHAN_MAP_U32 = 430,
7878 AVS_TKN_MODCFG_EXT_NUM_INPUT_PINS_U16 = 431,
7979 AVS_TKN_MODCFG_EXT_NUM_OUTPUT_PINS_U16 = 432,
80 AVS_TKN_MODCFG_WHM_REF_AFMT_ID_U32 = 433,
81 AVS_TKN_MODCFG_WHM_OUT_AFMT_ID_U32 = 434,
82 AVS_TKN_MODCFG_WHM_WAKE_TICK_PERIOD_U32 = 435,
83 AVS_TKN_MODCFG_WHM_VINDEX_U8 = 436,
84 AVS_TKN_MODCFG_WHM_DMA_TYPE_U32 = 437,
85 AVS_TKN_MODCFG_WHM_DMABUFF_SIZE_U32 = 438,
86 AVS_TKN_MODCFG_WHM_BLOB_AFMT_ID_U32 = 439,
87 AVS_TKN_MODCFG_PEAKVOL_VOLUME_U32 = 440,
88 AVS_TKN_MODCFG_PEAKVOL_CHANNEL_ID_U32 = 441, /* reserved */
89 AVS_TKN_MODCFG_PEAKVOL_CURVE_TYPE_U32 = 442,
90 AVS_TKN_MODCFG_PEAKVOL_CURVE_DURATION_U32 = 443,
8091
8192 /* struct avs_tplg_pplcfg */
8293 AVS_TKN_PPLCFG_ID_U32 = 1401,
lib/libc/include/any-linux-any/sound/sof/tokens.h+2
......@@ -153,6 +153,8 @@
153153/* Stream */
154154#define SOF_TKN_STREAM_PLAYBACK_COMPATIBLE_D0I3 1200
155155#define SOF_TKN_STREAM_CAPTURE_COMPATIBLE_D0I3 1201
156#define SOF_TKN_STREAM_PLAYBACK_PAUSE_SUPPORTED 1202
157#define SOF_TKN_STREAM_CAPTURE_PAUSE_SUPPORTED 1203
156158
157159/* Led control for mute switches */
158160#define SOF_TKN_MUTE_LED_USE 1300
lib/libc/include/any-linux-any/sound/tlv.h+2
......@@ -18,6 +18,8 @@
1818#define SNDRV_CTL_TLVT_CHMAP_VAR 0x102 /* channels freely swappable */
1919#define SNDRV_CTL_TLVT_CHMAP_PAIRED 0x103 /* pair-wise swappable */
2020
21#define SNDRV_CTL_TLVT_FCP_CHANNEL_LABELS 0x110 /* channel labels */
22
2123/*
2224 * TLV structure is right behind the struct snd_ctl_tlv:
2325 * unsigned int type - see SNDRV_CTL_TLVT_*
lib/libc/include/arc-linux-any/asm/ptrace.h+2-2
......@@ -14,7 +14,7 @@
1414
1515#define PTRACE_GET_THREAD_AREA 25
1616
17#ifndef __ASSEMBLY__
17#ifndef __ASSEMBLER__
1818/*
1919 * Userspace ABI: Register state needed by
2020 * -ptrace (gdbserver)
......@@ -53,6 +53,6 @@ struct user_regs_arcv2 {
5353 unsigned long r30, r58, r59;
5454};
5555
56#endif /* !__ASSEMBLY__ */
56#endif /* !__ASSEMBLER__ */
5757
5858#endif /* __ASM_ARC_PTRACE_H */
\ No newline at end of file
lib/libc/include/arc-linux-any/asm/unistd_32.h+3
......@@ -347,6 +347,9 @@
347347#define __NR_getxattrat 464
348348#define __NR_listxattrat 465
349349#define __NR_removexattrat 466
350#define __NR_open_tree_attr 467
351#define __NR_file_getattr 468
352#define __NR_file_setattr 469
350353
351354
352355#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-eabi.h+3
......@@ -420,5 +420,8 @@
420420#define __NR_getxattrat (__NR_SYSCALL_BASE + 464)
421421#define __NR_listxattrat (__NR_SYSCALL_BASE + 465)
422422#define __NR_removexattrat (__NR_SYSCALL_BASE + 466)
423#define __NR_open_tree_attr (__NR_SYSCALL_BASE + 467)
424#define __NR_file_getattr (__NR_SYSCALL_BASE + 468)
425#define __NR_file_setattr (__NR_SYSCALL_BASE + 469)
423426
424427#endif /* _ASM_UNISTD_EABI_H */
\ No newline at end of file
lib/libc/include/arm-linux-any/asm/unistd-oabi.h+3
......@@ -432,5 +432,8 @@
432432#define __NR_getxattrat (__NR_SYSCALL_BASE + 464)
433433#define __NR_listxattrat (__NR_SYSCALL_BASE + 465)
434434#define __NR_removexattrat (__NR_SYSCALL_BASE + 466)
435#define __NR_open_tree_attr (__NR_SYSCALL_BASE + 467)
436#define __NR_file_getattr (__NR_SYSCALL_BASE + 468)
437#define __NR_file_setattr (__NR_SYSCALL_BASE + 469)
435438
436439#endif /* _ASM_UNISTD_OABI_H */
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/setup.h created+1
......@@ -0,0 +1 @@
1#include <asm-generic/setup.h>
\ No newline at end of file
lib/libc/include/csky-linux-any/asm/unistd_32.h+3
......@@ -343,6 +343,9 @@
343343#define __NR_getxattrat 464
344344#define __NR_listxattrat 465
345345#define __NR_removexattrat 466
346#define __NR_open_tree_attr 467
347#define __NR_file_getattr 468
348#define __NR_file_setattr 469
346349
347350
348351#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/setup.h+2-8
......@@ -17,15 +17,9 @@
1717 * 02110-1301, USA.
1818 */
1919
20#ifndef _ASM_SETUP_H
21#define _ASM_SETUP_H
22
23#define __init
20#ifndef _ASM_HEXAGON_SETUP_H
21#define _ASM_HEXAGON_SETUP_H
2422
2523#include <asm-generic/setup.h>
2624
27extern char external_cmdline_buffer;
28
29void __init setup_arch_memory(void);
30
3125#endif
\ No newline at end of file
lib/libc/include/hexagon-linux-any/asm/unistd_32.h+3
......@@ -342,6 +342,9 @@
342342#define __NR_getxattrat 464
343343#define __NR_listxattrat 465
344344#define __NR_removexattrat 466
345#define __NR_open_tree_attr 467
346#define __NR_file_getattr 468
347#define __NR_file_setattr 469
345348
346349
347350#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/kvm_para.h+1
......@@ -17,5 +17,6 @@
1717#define KVM_FEATURE_STEAL_TIME 2
1818/* BIT 24 - 31 are features configurable by user space vmm */
1919#define KVM_FEATURE_VIRT_EXTIOI 24
20#define KVM_FEATURE_USER_HCALL 25
2021
2122#endif /* _ASM_KVM_PARA_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/setup.h created+8
......@@ -0,0 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#ifndef _ASM_LOONGARCH_SETUP_H
4#define _ASM_LOONGARCH_SETUP_H
5
6#define COMMAND_LINE_SIZE 4096
7
8#endif /* _ASM_LOONGARCH_SETUP_H */
\ No newline at end of file
lib/libc/include/loongarch-linux-any/asm/unistd_64.h+3
......@@ -319,6 +319,9 @@
319319#define __NR_getxattrat 464
320320#define __NR_listxattrat 465
321321#define __NR_removexattrat 466
322#define __NR_open_tree_attr 467
323#define __NR_file_getattr 468
324#define __NR_file_setattr 469
322325
323326
324327#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/bootinfo-vme.h+2-2
......@@ -33,7 +33,7 @@
3333#define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */
3434
3535
36#ifndef __ASSEMBLY__
36#ifndef __ASSEMBLER__
3737
3838/*
3939 * Board ID data structure - pointer to this retrieved from Bug by head.S
......@@ -56,7 +56,7 @@ typedef struct {
5656 __be32 option2;
5757} t_bdid, *p_bdid;
5858
59#endif /* __ASSEMBLY__ */
59#endif /* __ASSEMBLER__ */
6060
6161
6262 /*
lib/libc/include/m68k-linux-any/asm/bootinfo.h+4-4
......@@ -16,7 +16,7 @@
1616#include <linux/types.h>
1717
1818
19#ifndef __ASSEMBLY__
19#ifndef __ASSEMBLER__
2020
2121 /*
2222 * Bootinfo definitions
......@@ -43,7 +43,7 @@ struct mem_info {
4343 __be32 size; /* length of memory chunk (in bytes) */
4444};
4545
46#endif /* __ASSEMBLY__ */
46#endif /* __ASSEMBLER__ */
4747
4848
4949 /*
......@@ -167,7 +167,7 @@ struct mem_info {
167167#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
168168#define BI_VERSION_MINOR(v) ((v) & 0xffff)
169169
170#ifndef __ASSEMBLY__
170#ifndef __ASSEMBLER__
171171
172172struct bootversion {
173173 __be16 branch;
......@@ -178,7 +178,7 @@ struct bootversion {
178178 } machversions[];
179179} __attribute__((packed));
180180
181#endif /* __ASSEMBLY__ */
181#endif /* __ASSEMBLER__ */
182182
183183
184184#endif /* _ASM_M68K_BOOTINFO_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/ptrace.h+2-2
......@@ -22,7 +22,7 @@
2222#define PT_SR 17
2323#define PT_PC 18
2424
25#ifndef __ASSEMBLY__
25#ifndef __ASSEMBLER__
2626
2727/* this struct defines the way the registers are stored on the
2828 stack during a system call. */
......@@ -81,5 +81,5 @@ struct switch_stack {
8181#define PTRACE_GETFDPIC_EXEC 0
8282#define PTRACE_GETFDPIC_INTERP 1
8383
84#endif /* __ASSEMBLY__ */
84#endif /* __ASSEMBLER__ */
8585#endif /* _M68K_PTRACE_H */
\ No newline at end of file
lib/libc/include/m68k-linux-any/asm/unistd_32.h+3
......@@ -439,6 +439,9 @@
439439#define __NR_getxattrat 464
440440#define __NR_listxattrat 465
441441#define __NR_removexattrat 466
442#define __NR_open_tree_attr 467
443#define __NR_file_getattr 468
444#define __NR_file_setattr 469
442445
443446
444447#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/socket.h+7
......@@ -159,6 +159,13 @@
159159
160160#define SCM_TS_OPT_ID 81
161161
162#define SO_RCVPRIORITY 82
163
164#define SO_PASSRIGHTS 83
165
166#define SO_INQ 84
167#define SCM_INQ SO_INQ
168
162169
163170#if __BITS_PER_LONG == 64
164171#define SO_TIMESTAMP SO_TIMESTAMP_OLD
lib/libc/include/mips-linux-any/asm/unistd_n32.h+3
......@@ -395,5 +395,8 @@
395395#define __NR_getxattrat (__NR_Linux + 464)
396396#define __NR_listxattrat (__NR_Linux + 465)
397397#define __NR_removexattrat (__NR_Linux + 466)
398#define __NR_open_tree_attr (__NR_Linux + 467)
399#define __NR_file_getattr (__NR_Linux + 468)
400#define __NR_file_setattr (__NR_Linux + 469)
398401
399402#endif /* _ASM_UNISTD_N32_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_n64.h+3
......@@ -371,5 +371,8 @@
371371#define __NR_getxattrat (__NR_Linux + 464)
372372#define __NR_listxattrat (__NR_Linux + 465)
373373#define __NR_removexattrat (__NR_Linux + 466)
374#define __NR_open_tree_attr (__NR_Linux + 467)
375#define __NR_file_getattr (__NR_Linux + 468)
376#define __NR_file_setattr (__NR_Linux + 469)
374377
375378#endif /* _ASM_UNISTD_N64_H */
\ No newline at end of file
lib/libc/include/mips-linux-any/asm/unistd_o32.h+3
......@@ -441,5 +441,8 @@
441441#define __NR_getxattrat (__NR_Linux + 464)
442442#define __NR_listxattrat (__NR_Linux + 465)
443443#define __NR_removexattrat (__NR_Linux + 466)
444#define __NR_open_tree_attr (__NR_Linux + 467)
445#define __NR_file_getattr (__NR_Linux + 468)
446#define __NR_file_setattr (__NR_Linux + 469)
444447
445448#endif /* _ASM_UNISTD_O32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/eeh.h-13
......@@ -1,18 +1,5 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
163 * Copyright IBM Corp. 2015
174 *
185 * Authors: Gavin Shan <gwshan@linux.vnet.ibm.com>
lib/libc/include/powerpc-linux-any/asm/ioctls.h+4-4
......@@ -23,10 +23,10 @@
2323#define TCSETSW _IOW('t', 21, struct termios)
2424#define TCSETSF _IOW('t', 22, struct termios)
2525
26#define TCGETA _IOR('t', 23, struct termio)
27#define TCSETA _IOW('t', 24, struct termio)
28#define TCSETAW _IOW('t', 25, struct termio)
29#define TCSETAF _IOW('t', 28, struct termio)
26#define TCGETA 0x40147417 /* _IOR('t', 23, struct termio) */
27#define TCSETA 0x80147418 /* _IOW('t', 24, struct termio) */
28#define TCSETAW 0x80147419 /* _IOW('t', 25, struct termio) */
29#define TCSETAF 0x8014741c /* _IOW('t', 28, struct termio) */
3030
3131#define TCSBRK _IO('t', 29)
3232#define TCXONC _IO('t', 30)
lib/libc/include/powerpc-linux-any/asm/kvm.h-13
......@@ -1,18 +1,5 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
163 * Copyright IBM Corp. 2007
174 *
185 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
lib/libc/include/powerpc-linux-any/asm/kvm_para.h-13
......@@ -1,18 +1,5 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License, version 2, as
5 * published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15 *
163 * Copyright IBM Corp. 2008
174 *
185 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
lib/libc/include/powerpc-linux-any/asm/papr-indices.h created+41
......@@ -0,0 +1,41 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_INDICES_H_
3#define _PAPR_INDICES_H_
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7#include <asm/papr-miscdev.h>
8
9#define LOC_CODE_SIZE 80
10#define RTAS_GET_INDICES_BUF_SIZE SZ_4K
11
12struct papr_indices_io_block {
13 union {
14 struct {
15 __u8 is_sensor; /* 0 for indicator and 1 for sensor */
16 __u32 indice_type;
17 } indices;
18 struct {
19 __u32 token; /* Sensor or indicator token */
20 __u32 state; /* get / set state */
21 /*
22 * PAPR+ 12.3.2.4 Converged Location Code Rules - Length
23 * Restrictions. 79 characters plus null.
24 */
25 char location_code_str[LOC_CODE_SIZE]; /* location code */
26 } dynamic_param;
27 };
28};
29
30/*
31 * ioctls for /dev/papr-indices.
32 * PAPR_INDICES_IOC_GET: Returns a get-indices handle fd to read data
33 * PAPR_DYNAMIC_SENSOR_IOC_GET: Gets the state of the input sensor
34 * PAPR_DYNAMIC_INDICATOR_IOC_SET: Sets the new state for the input indicator
35 */
36#define PAPR_INDICES_IOC_GET _IOW(PAPR_MISCDEV_IOC_ID, 3, struct papr_indices_io_block)
37#define PAPR_DYNAMIC_SENSOR_IOC_GET _IOWR(PAPR_MISCDEV_IOC_ID, 4, struct papr_indices_io_block)
38#define PAPR_DYNAMIC_INDICATOR_IOC_SET _IOW(PAPR_MISCDEV_IOC_ID, 5, struct papr_indices_io_block)
39
40
41#endif /* _PAPR_INDICES_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-physical-attestation.h created+31
......@@ -0,0 +1,31 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_PHYSICAL_ATTESTATION_H_
3#define _PAPR_PHYSICAL_ATTESTATION_H_
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7#include <asm/papr-miscdev.h>
8
9#define PAPR_PHYATTEST_MAX_INPUT 4084 /* Max 4K buffer: 4K-12 */
10
11/*
12 * Defined in PAPR 2.13+ 21.6 Attestation Command Structures.
13 * User space pass this struct and the max size should be 4K.
14 */
15struct papr_phy_attest_io_block {
16 __u8 version;
17 __u8 command;
18 __u8 TCG_major_ver;
19 __u8 TCG_minor_ver;
20 __be32 length;
21 __be32 correlator;
22 __u8 payload[PAPR_PHYATTEST_MAX_INPUT];
23};
24
25/*
26 * ioctl for /dev/papr-physical-attestation. Returns a attestation
27 * command fd handle
28 */
29#define PAPR_PHY_ATTEST_IOC_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 8, struct papr_phy_attest_io_block)
30
31#endif /* _PAPR_PHYSICAL_ATTESTATION_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/papr-platform-dump.h created+16
......@@ -0,0 +1,16 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _PAPR_PLATFORM_DUMP_H_
3#define _PAPR_PLATFORM_DUMP_H_
4
5#include <linux/types.h>
6#include <asm/ioctl.h>
7#include <asm/papr-miscdev.h>
8
9/*
10 * ioctl for /dev/papr-platform-dump. Returns a platform-dump handle fd
11 * corresponding to dump tag.
12 */
13#define PAPR_PLATFORM_DUMP_IOC_CREATE_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 6, __u64)
14#define PAPR_PLATFORM_DUMP_IOC_INVALIDATE _IOW(PAPR_MISCDEV_IOC_ID, 7, __u64)
15
16#endif /* _PAPR_PLATFORM_DUMP_H_ */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/ps3fb.h-13
......@@ -2,19 +2,6 @@
22/*
33 * Copyright (C) 2006 Sony Computer Entertainment Inc.
44 * Copyright 2006, 2007 Sony Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; version 2 of the License.
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
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
185 */
196
207#ifndef _ASM_POWERPC_PS3FB_H_
lib/libc/include/powerpc-linux-any/asm/unistd_32.h+3
......@@ -448,6 +448,9 @@
448448#define __NR_getxattrat 464
449449#define __NR_listxattrat 465
450450#define __NR_removexattrat 466
451#define __NR_open_tree_attr 467
452#define __NR_file_getattr 468
453#define __NR_file_setattr 469
451454
452455
453456#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/powerpc-linux-any/asm/unistd_64.h+3
......@@ -420,6 +420,9 @@
420420#define __NR_getxattrat 464
421421#define __NR_listxattrat 465
422422#define __NR_removexattrat 466
423#define __NR_open_tree_attr 467
424#define __NR_file_getattr 468
425#define __NR_file_setattr 469
423426
424427
425428#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/hwprobe.h+13-1
......@@ -1,6 +1,6 @@
11/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22/*
3 * Copyright 2023 Rivos, Inc
3 * Copyright 2023-2024 Rivos, Inc
44 */
55
66#ifndef _ASM_HWPROBE_H
......@@ -73,6 +73,15 @@ struct riscv_hwprobe {
7373#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47)
7474#define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48)
7575#define RISCV_HWPROBE_EXT_SUPM (1ULL << 49)
76#define RISCV_HWPROBE_EXT_ZICNTR (1ULL << 50)
77#define RISCV_HWPROBE_EXT_ZIHPM (1ULL << 51)
78#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 52)
79#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 53)
80#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54)
81#define RISCV_HWPROBE_EXT_ZICBOM (1ULL << 55)
82#define RISCV_HWPROBE_EXT_ZAAMO (1ULL << 56)
83#define RISCV_HWPROBE_EXT_ZALRSC (1ULL << 57)
84#define RISCV_HWPROBE_EXT_ZABHA (1ULL << 58)
7685#define RISCV_HWPROBE_KEY_CPUPERF_0 5
7786#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
7887#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)
......@@ -94,6 +103,9 @@ struct riscv_hwprobe {
94103#define RISCV_HWPROBE_MISALIGNED_VECTOR_SLOW 2
95104#define RISCV_HWPROBE_MISALIGNED_VECTOR_FAST 3
96105#define RISCV_HWPROBE_MISALIGNED_VECTOR_UNSUPPORTED 4
106#define RISCV_HWPROBE_KEY_VENDOR_EXT_THEAD_0 11
107#define RISCV_HWPROBE_KEY_ZICBOM_BLOCK_SIZE 12
108#define RISCV_HWPROBE_KEY_VENDOR_EXT_SIFIVE_0 13
97109/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
98110
99111/* Flags */
lib/libc/include/riscv-linux-any/asm/kvm.h+7-3
......@@ -18,6 +18,7 @@
1818#define __KVM_HAVE_IRQ_LINE
1919
2020#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
21#define KVM_DIRTY_LOG_PAGE_OFFSET 64
2122
2223#define KVM_INTERRUPT_SET -1U
2324#define KVM_INTERRUPT_UNSET -2U
......@@ -179,6 +180,11 @@ enum KVM_RISCV_ISA_EXT_ID {
179180 KVM_RISCV_ISA_EXT_SSNPM,
180181 KVM_RISCV_ISA_EXT_SVADE,
181182 KVM_RISCV_ISA_EXT_SVADU,
183 KVM_RISCV_ISA_EXT_SVVPTC,
184 KVM_RISCV_ISA_EXT_ZABHA,
185 KVM_RISCV_ISA_EXT_ZICCRSE,
186 KVM_RISCV_ISA_EXT_ZAAMO,
187 KVM_RISCV_ISA_EXT_ZALRSC,
182188 KVM_RISCV_ISA_EXT_MAX,
183189};
184190
......@@ -198,6 +204,7 @@ enum KVM_RISCV_SBI_EXT_ID {
198204 KVM_RISCV_SBI_EXT_VENDOR,
199205 KVM_RISCV_SBI_EXT_DBCN,
200206 KVM_RISCV_SBI_EXT_STA,
207 KVM_RISCV_SBI_EXT_SUSP,
201208 KVM_RISCV_SBI_EXT_MAX,
202209};
203210
......@@ -211,9 +218,6 @@ struct kvm_riscv_sbi_sta {
211218#define KVM_RISCV_TIMER_STATE_OFF 0
212219#define KVM_RISCV_TIMER_STATE_ON 1
213220
214#define KVM_REG_SIZE(id) \
215 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
216
217221/* If you need to interpret the index values, here is the key: */
218222#define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
219223#define KVM_REG_RISCV_TYPE_SHIFT 24
lib/libc/include/riscv-linux-any/asm/unistd_32.h+3
......@@ -314,6 +314,9 @@
314314#define __NR_getxattrat 464
315315#define __NR_listxattrat 465
316316#define __NR_removexattrat 466
317#define __NR_open_tree_attr 467
318#define __NR_file_getattr 468
319#define __NR_file_setattr 469
317320
318321
319322#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/unistd_64.h+3
......@@ -324,6 +324,9 @@
324324#define __NR_getxattrat 464
325325#define __NR_listxattrat 465
326326#define __NR_removexattrat 466
327#define __NR_open_tree_attr 467
328#define __NR_file_getattr 468
329#define __NR_file_setattr 469
327330
328331
329332#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/vendor/sifive.h created+6
......@@ -0,0 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCDOD (1 << 0)
4#define RISCV_HWPROBE_VENDOR_EXT_XSFVQMACCQOQ (1 << 1)
5#define RISCV_HWPROBE_VENDOR_EXT_XSFVFNRCLIPXFQF (1 << 2)
6#define RISCV_HWPROBE_VENDOR_EXT_XSFVFWMACCQQQ (1 << 3)
\ No newline at end of file
lib/libc/include/riscv-linux-any/asm/vendor/thead.h created+3
......@@ -0,0 +1,3 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2
3#define RISCV_HWPROBE_VENDOR_EXT_XTHEADVECTOR (1 << 0)
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/diag.h created+32
......@@ -0,0 +1,32 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Diag ioctls and its associated structures definitions.
4 *
5 * Copyright IBM Corp. 2024
6 */
7
8#ifndef __S390_UAPI_ASM_DIAG_H
9#define __S390_UAPI_ASM_DIAG_H
10
11#include <linux/types.h>
12
13#define DIAG_MAGIC_STR 'D'
14
15struct diag324_pib {
16 __u64 address;
17 __u64 sequence;
18};
19
20struct diag310_memtop {
21 __u64 address;
22 __u64 nesting_lvl;
23};
24
25/* Diag ioctl definitions */
26#define DIAG324_GET_PIBBUF _IOWR(DIAG_MAGIC_STR, 0x77, struct diag324_pib)
27#define DIAG324_GET_PIBLEN _IOR(DIAG_MAGIC_STR, 0x78, size_t)
28#define DIAG310_GET_STRIDE _IOR(DIAG_MAGIC_STR, 0x79, size_t)
29#define DIAG310_GET_MEMTOPLEN _IOWR(DIAG_MAGIC_STR, 0x7a, size_t)
30#define DIAG310_GET_MEMTOPBUF _IOWR(DIAG_MAGIC_STR, 0x7b, struct diag310_memtop)
31
32#endif /* __S390_UAPI_ASM_DIAG_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/ptrace.h+3-2
......@@ -242,7 +242,8 @@
242242#define PTRACE_OLDSETOPTIONS 21
243243#define PTRACE_SYSEMU 31
244244#define PTRACE_SYSEMU_SINGLESTEP 32
245#ifndef __ASSEMBLY__
245
246#ifndef __ASSEMBLER__
246247#include <linux/stddef.h>
247248#include <linux/types.h>
248249
......@@ -450,6 +451,6 @@ struct user_regs_struct {
450451 unsigned long ieee_instruction_pointer; /* obsolete, always 0 */
451452};
452453
453#endif /* __ASSEMBLY__ */
454#endif /* __ASSEMBLER__ */
454455
455456#endif /* _S390_PTRACE_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/schid.h+2-2
......@@ -4,7 +4,7 @@
44
55#include <linux/types.h>
66
7#ifndef __ASSEMBLY__
7#ifndef __ASSEMBLER__
88
99struct subchannel_id {
1010 __u32 cssid : 8;
......@@ -15,6 +15,6 @@ struct subchannel_id {
1515 __u32 sch_no : 16;
1616} __attribute__ ((packed, aligned(4)));
1717
18#endif /* __ASSEMBLY__ */
18#endif /* __ASSEMBLER__ */
1919
2020#endif /* ASM_SCHID_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/types.h+2-2
......@@ -10,7 +10,7 @@
1010
1111#include <asm-generic/int-ll64.h>
1212
13#ifndef __ASSEMBLY__
13#ifndef __ASSEMBLER__
1414
1515typedef unsigned long addr_t;
1616typedef __signed__ long saddr_t;
......@@ -25,6 +25,6 @@ typedef struct {
2525 };
2626} __attribute__((packed, aligned(4))) __vector128;
2727
28#endif /* __ASSEMBLY__ */
28#endif /* __ASSEMBLER__ */
2929
3030#endif /* _S390_TYPES_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_32.h+3
......@@ -439,5 +439,8 @@
439439#define __NR_getxattrat 464
440440#define __NR_listxattrat 465
441441#define __NR_removexattrat 466
442#define __NR_open_tree_attr 467
443#define __NR_file_getattr 468
444#define __NR_file_setattr 469
442445
443446#endif /* _ASM_S390_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/s390x-linux-any/asm/unistd_64.h+3
......@@ -387,5 +387,8 @@
387387#define __NR_getxattrat 464
388388#define __NR_listxattrat 465
389389#define __NR_removexattrat 466
390#define __NR_open_tree_attr 467
391#define __NR_file_getattr 468
392#define __NR_file_setattr 469
390393
391394#endif /* _ASM_S390_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/socket.h+7
......@@ -141,6 +141,13 @@
141141
142142#define SCM_TS_OPT_ID 0x005a
143143
144#define SO_RCVPRIORITY 0x005b
145
146#define SO_PASSRIGHTS 0x005c
147
148#define SO_INQ 0x005d
149#define SCM_INQ SO_INQ
150
144151
145152
146153#if __BITS_PER_LONG == 64
lib/libc/include/sparc-linux-any/asm/unistd_32.h+3
......@@ -436,6 +436,9 @@
436436#define __NR_getxattrat 464
437437#define __NR_listxattrat 465
438438#define __NR_removexattrat 466
439#define __NR_open_tree_attr 467
440#define __NR_file_getattr 468
441#define __NR_file_setattr 469
439442
440443
441444#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/sparc-linux-any/asm/unistd_64.h+3
......@@ -399,6 +399,9 @@
399399#define __NR_getxattrat 464
400400#define __NR_listxattrat 465
401401#define __NR_removexattrat 466
402#define __NR_open_tree_attr 467
403#define __NR_file_getattr 468
404#define __NR_file_setattr 469
402405
403406
404407#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/amd_hsmp.h+62-2
......@@ -50,6 +50,12 @@ enum hsmp_message_ids {
5050 HSMP_GET_METRIC_TABLE_VER, /* 23h Get metrics table version */
5151 HSMP_GET_METRIC_TABLE, /* 24h Get metrics table */
5252 HSMP_GET_METRIC_TABLE_DRAM_ADDR,/* 25h Get metrics table dram address */
53 HSMP_SET_XGMI_PSTATE_RANGE, /* 26h Set xGMI P-state range */
54 HSMP_CPU_RAIL_ISO_FREQ_POLICY, /* 27h Get/Set Cpu Iso frequency policy */
55 HSMP_DFC_ENABLE_CTRL, /* 28h Enable/Disable DF C-state */
56 HSMP_GET_RAPL_UNITS = 0x30, /* 30h Get scaling factor for energy */
57 HSMP_GET_RAPL_CORE_COUNTER, /* 31h Get core energy counter value */
58 HSMP_GET_RAPL_PACKAGE_COUNTER, /* 32h Get package energy counter value */
5359 HSMP_MSG_ID_MAX,
5460};
5561
......@@ -65,6 +71,7 @@ enum hsmp_msg_type {
6571 HSMP_RSVD = -1,
6672 HSMP_SET = 0,
6773 HSMP_GET = 1,
74 HSMP_SET_GET = 2,
6875};
6976
7077enum hsmp_proto_versions {
......@@ -72,7 +79,8 @@ enum hsmp_proto_versions {
7279 HSMP_PROTO_VER3,
7380 HSMP_PROTO_VER4,
7481 HSMP_PROTO_VER5,
75 HSMP_PROTO_VER6
82 HSMP_PROTO_VER6,
83 HSMP_PROTO_VER7
7684};
7785
7886struct hsmp_msg_desc {
......@@ -300,7 +308,7 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[]
300308 * HSMP_SET_POWER_MODE, num_args = 1, response_sz = 0
301309 * input: args[0] = power efficiency mode[2:0]
302310 */
303 {1, 0, HSMP_SET},
311 {1, 1, HSMP_SET_GET},
304312
305313 /*
306314 * HSMP_SET_PSTATE_MAX_MIN, num_args = 1, response_sz = 0
......@@ -325,6 +333,58 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[]
325333 * output: args[1] = upper 32 bits of the address
326334 */
327335 {0, 2, HSMP_GET},
336
337 /*
338 * HSMP_SET_XGMI_PSTATE_RANGE, num_args = 1, response_sz = 0
339 * input: args[0] = min xGMI p-state[15:8] + max xGMI p-state[7:0]
340 */
341 {1, 0, HSMP_SET},
342
343 /*
344 * HSMP_CPU_RAIL_ISO_FREQ_POLICY, num_args = 1, response_sz = 1
345 * input: args[0] = set/get policy[31] +
346 * disable/enable independent control[0]
347 * output: args[0] = current policy[0]
348 */
349 {1, 1, HSMP_SET_GET},
350
351 /*
352 * HSMP_DFC_ENABLE_CTRL, num_args = 1, response_sz = 1
353 * input: args[0] = set/get policy[31] + enable/disable DFC[0]
354 * output: args[0] = current policy[0]
355 */
356 {1, 1, HSMP_SET_GET},
357
358 /* RESERVED(0x29-0x2f) */
359 {0, 0, HSMP_RSVD},
360 {0, 0, HSMP_RSVD},
361 {0, 0, HSMP_RSVD},
362 {0, 0, HSMP_RSVD},
363 {0, 0, HSMP_RSVD},
364 {0, 0, HSMP_RSVD},
365 {0, 0, HSMP_RSVD},
366
367 /*
368 * HSMP_GET_RAPL_UNITS, response_sz = 1
369 * output: args[0] = tu value[19:16] + esu value[12:8]
370 */
371 {0, 1, HSMP_GET},
372
373 /*
374 * HSMP_GET_RAPL_CORE_COUNTER, num_args = 1, response_sz = 1
375 * input: args[0] = apic id[15:0]
376 * output: args[0] = lower 32 bits of energy
377 * output: args[1] = upper 32 bits of energy
378 */
379 {1, 2, HSMP_GET},
380
381 /*
382 * HSMP_GET_RAPL_PACKAGE_COUNTER, num_args = 0, response_sz = 1
383 * output: args[0] = lower 32 bits of energy
384 * output: args[1] = upper 32 bits of energy
385 */
386 {0, 2, HSMP_GET},
387
328388};
329389
330390/* Metrics table (supported only with proto version 6) */
lib/libc/include/x86-linux-any/asm/bootparam.h+2-2
......@@ -26,7 +26,7 @@
2626#define XLF_5LEVEL_ENABLED (1<<6)
2727#define XLF_MEM_ENCRYPTION (1<<7)
2828
29#ifndef __ASSEMBLY__
29#ifndef __ASSEMBLER__
3030
3131#include <linux/types.h>
3232#include <linux/screen_info.h>
......@@ -210,6 +210,6 @@ enum x86_hardware_subarch {
210210 X86_NR_SUBARCHS,
211211};
212212
213#endif /* __ASSEMBLY__ */
213#endif /* __ASSEMBLER__ */
214214
215215#endif /* _ASM_X86_BOOTPARAM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/debugreg.h+20-1
......@@ -15,7 +15,26 @@
1515 which debugging register was responsible for the trap. The other bits
1616 are either reserved or not of interest to us. */
1717
18/* Define reserved bits in DR6 which are always set to 1 */
18/*
19 * Define bits in DR6 which are set to 1 by default.
20 *
21 * This is also the DR6 architectural value following Power-up, Reset or INIT.
22 *
23 * Note, with the introduction of Bus Lock Detection (BLD) and Restricted
24 * Transactional Memory (RTM), the DR6 register has been modified:
25 *
26 * 1) BLD flag (bit 11) is no longer reserved to 1 if the CPU supports
27 * Bus Lock Detection. The assertion of a bus lock could clear it.
28 *
29 * 2) RTM flag (bit 16) is no longer reserved to 1 if the CPU supports
30 * restricted transactional memory. #DB occurred inside an RTM region
31 * could clear it.
32 *
33 * Apparently, DR6.BLD and DR6.RTM are active low bits.
34 *
35 * As a result, DR6_RESERVED is an incorrect name now, but it is kept for
36 * compatibility.
37 */
1938#define DR6_RESERVED (0xFFFF0FF0)
2039
2140#define DR_TRAP0 (0x1) /* db0 */
lib/libc/include/x86-linux-any/asm/e820.h+2-2
......@@ -52,7 +52,7 @@
5252 */
5353#define E820_RESERVED_KERN 128
5454
55#ifndef __ASSEMBLY__
55#ifndef __ASSEMBLER__
5656#include <linux/types.h>
5757struct e820entry {
5858 __u64 addr; /* start of memory segment */
......@@ -74,7 +74,7 @@ struct e820map {
7474#define BIOS_ROM_BASE 0xffe00000
7575#define BIOS_ROM_END 0xffffffff
7676
77#endif /* __ASSEMBLY__ */
77#endif /* __ASSEMBLER__ */
7878
7979
8080#endif /* _ASM_X86_E820_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/kvm.h+82
......@@ -439,6 +439,7 @@ struct kvm_sync_regs {
439439#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)
440440#define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7)
441441#define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8)
442#define KVM_X86_QUIRK_IGNORE_GUEST_PAT (1 << 9)
442443
443444#define KVM_STATE_NESTED_FORMAT_VMX 0
444445#define KVM_STATE_NESTED_FORMAT_SVM 1
......@@ -557,6 +558,9 @@ struct kvm_x86_mce {
557558#define KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE (1 << 7)
558559#define KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA (1 << 8)
559560
561#define KVM_XEN_MSR_MIN_INDEX 0x40000000u
562#define KVM_XEN_MSR_MAX_INDEX 0x4fffffffu
563
560564struct kvm_xen_hvm_config {
561565 __u32 flags;
562566 __u32 msr;
......@@ -839,6 +843,7 @@ struct kvm_sev_snp_launch_start {
839843};
840844
841845/* Kept in sync with firmware values for simplicity. */
846#define KVM_SEV_PAGE_TYPE_INVALID 0x0
842847#define KVM_SEV_SNP_PAGE_TYPE_NORMAL 0x1
843848#define KVM_SEV_SNP_PAGE_TYPE_ZERO 0x3
844849#define KVM_SEV_SNP_PAGE_TYPE_UNMEASURED 0x4
......@@ -923,5 +928,82 @@ struct kvm_hyperv_eventfd {
923928#define KVM_X86_SEV_VM 2
924929#define KVM_X86_SEV_ES_VM 3
925930#define KVM_X86_SNP_VM 4
931#define KVM_X86_TDX_VM 5
932
933/* Trust Domain eXtension sub-ioctl() commands. */
934enum kvm_tdx_cmd_id {
935 KVM_TDX_CAPABILITIES = 0,
936 KVM_TDX_INIT_VM,
937 KVM_TDX_INIT_VCPU,
938 KVM_TDX_INIT_MEM_REGION,
939 KVM_TDX_FINALIZE_VM,
940 KVM_TDX_GET_CPUID,
941
942 KVM_TDX_CMD_NR_MAX,
943};
944
945struct kvm_tdx_cmd {
946 /* enum kvm_tdx_cmd_id */
947 __u32 id;
948 /* flags for sub-commend. If sub-command doesn't use this, set zero. */
949 __u32 flags;
950 /*
951 * data for each sub-command. An immediate or a pointer to the actual
952 * data in process virtual address. If sub-command doesn't use it,
953 * set zero.
954 */
955 __u64 data;
956 /*
957 * Auxiliary error code. The sub-command may return TDX SEAMCALL
958 * status code in addition to -Exxx.
959 */
960 __u64 hw_error;
961};
962
963struct kvm_tdx_capabilities {
964 __u64 supported_attrs;
965 __u64 supported_xfam;
966
967 __u64 kernel_tdvmcallinfo_1_r11;
968 __u64 user_tdvmcallinfo_1_r11;
969 __u64 kernel_tdvmcallinfo_1_r12;
970 __u64 user_tdvmcallinfo_1_r12;
971
972 __u64 reserved[250];
973
974 /* Configurable CPUID bits for userspace */
975 struct kvm_cpuid2 cpuid;
976};
977
978struct kvm_tdx_init_vm {
979 __u64 attributes;
980 __u64 xfam;
981 __u64 mrconfigid[6]; /* sha384 digest */
982 __u64 mrowner[6]; /* sha384 digest */
983 __u64 mrownerconfig[6]; /* sha384 digest */
984
985 /* The total space for TD_PARAMS before the CPUIDs is 256 bytes */
986 __u64 reserved[12];
987
988 /*
989 * Call KVM_TDX_INIT_VM before vcpu creation, thus before
990 * KVM_SET_CPUID2.
991 * This configuration supersedes KVM_SET_CPUID2s for VCPUs because the
992 * TDX module directly virtualizes those CPUIDs without VMM. The user
993 * space VMM, e.g. qemu, should make KVM_SET_CPUID2 consistent with
994 * those values. If it doesn't, KVM may have wrong idea of vCPUIDs of
995 * the guest, and KVM may wrongly emulate CPUIDs or MSRs that the TDX
996 * module doesn't virtualize.
997 */
998 struct kvm_cpuid2 cpuid;
999};
1000
1001#define KVM_TDX_MEASURE_MEMORY_REGION _BITULL(0)
1002
1003struct kvm_tdx_init_mem_region {
1004 __u64 source_addr;
1005 __u64 gpa;
1006 __u64 nr_pages;
1007};
9261008
9271009#endif /* _ASM_X86_KVM_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ldt.h+2-2
......@@ -12,7 +12,7 @@
1212/* The size of each LDT entry. */
1313#define LDT_ENTRY_SIZE 8
1414
15#ifndef __ASSEMBLY__
15#ifndef __ASSEMBLER__
1616/*
1717 * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS
1818 * not to the default values if you still want to do syscalls. This
......@@ -44,5 +44,5 @@ struct user_desc {
4444#define MODIFY_LDT_CONTENTS_STACK 1
4545#define MODIFY_LDT_CONTENTS_CODE 2
4646
47#endif /* !__ASSEMBLY__ */
47#endif /* !__ASSEMBLER__ */
4848#endif /* _ASM_X86_LDT_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/msr.h+2-2
......@@ -2,7 +2,7 @@
22#ifndef _ASM_X86_MSR_H
33#define _ASM_X86_MSR_H
44
5#ifndef __ASSEMBLY__
5#ifndef __ASSEMBLER__
66
77#include <linux/types.h>
88#include <linux/ioctl.h>
......@@ -10,5 +10,5 @@
1010#define X86_IOC_RDMSR_REGS _IOWR('c', 0xA0, __u32[8])
1111#define X86_IOC_WRMSR_REGS _IOWR('c', 0xA1, __u32[8])
1212
13#endif /* __ASSEMBLY__ */
13#endif /* __ASSEMBLER__ */
1414#endif /* _ASM_X86_MSR_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/ptrace-abi.h+3-3
......@@ -25,7 +25,7 @@
2525
2626#else /* __i386__ */
2727
28#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
28#if defined(__ASSEMBLER__) || defined(__FRAME_OFFSETS)
2929/*
3030 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
3131 * unless syscall needs a complete, fully filled "struct pt_regs".
......@@ -57,7 +57,7 @@
5757#define EFLAGS 144
5858#define RSP 152
5959#define SS 160
60#endif /* __ASSEMBLY__ */
60#endif /* __ASSEMBLER__ */
6161
6262/* top of stack page */
6363#define FRAME_SIZE 168
......@@ -87,7 +87,7 @@
8787
8888#define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */
8989
90#ifndef __ASSEMBLY__
90#ifndef __ASSEMBLER__
9191#include <linux/types.h>
9292#endif
9393
lib/libc/include/x86-linux-any/asm/ptrace.h+2-2
......@@ -7,7 +7,7 @@
77#include <asm/processor-flags.h>
88
99
10#ifndef __ASSEMBLY__
10#ifndef __ASSEMBLER__
1111
1212#ifdef __i386__
1313/* this struct defines the way the registers are stored on the
......@@ -77,6 +77,6 @@ struct pt_regs {
7777
7878
7979
80#endif /* !__ASSEMBLY__ */
80#endif /* !__ASSEMBLER__ */
8181
8282#endif /* _ASM_X86_PTRACE_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/setup_data.h+14-3
......@@ -13,12 +13,13 @@
1313#define SETUP_CC_BLOB 7
1414#define SETUP_IMA 8
1515#define SETUP_RNG_SEED 9
16#define SETUP_ENUM_MAX SETUP_RNG_SEED
16#define SETUP_KEXEC_KHO 10
17#define SETUP_ENUM_MAX SETUP_KEXEC_KHO
1718
1819#define SETUP_INDIRECT (1<<31)
1920#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
2021
21#ifndef __ASSEMBLY__
22#ifndef __ASSEMBLER__
2223
2324#include <linux/types.h>
2425
......@@ -78,6 +79,16 @@ struct ima_setup_data {
7879 __u64 size;
7980} __attribute__((packed));
8081
81#endif /* __ASSEMBLY__ */
82/*
83 * Locations of kexec handover metadata
84 */
85struct kho_data {
86 __u64 fdt_addr;
87 __u64 fdt_size;
88 __u64 scratch_addr;
89 __u64 scratch_size;
90} __attribute__((packed));
91
92#endif /* __ASSEMBLER__ */
8293
8394#endif /* _ASM_X86_SETUP_DATA_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/signal.h+4-4
......@@ -2,7 +2,7 @@
22#ifndef _ASM_X86_SIGNAL_H
33#define _ASM_X86_SIGNAL_H
44
5#ifndef __ASSEMBLY__
5#ifndef __ASSEMBLER__
66#include <linux/types.h>
77
88
......@@ -14,7 +14,7 @@ struct siginfo;
1414#define NSIG 32
1515typedef unsigned long sigset_t;
1616
17#endif /* __ASSEMBLY__ */
17#endif /* __ASSEMBLER__ */
1818
1919
2020#define SIGHUP 1
......@@ -66,7 +66,7 @@ typedef unsigned long sigset_t;
6666
6767#include <asm-generic/signal-defs.h>
6868
69#ifndef __ASSEMBLY__
69#ifndef __ASSEMBLER__
7070
7171
7272/* Here we must cater to libcs that poke about in kernel headers. */
......@@ -102,6 +102,6 @@ typedef struct sigaltstack {
102102 __kernel_size_t ss_size;
103103} stack_t;
104104
105#endif /* __ASSEMBLY__ */
105#endif /* __ASSEMBLER__ */
106106
107107#endif /* _ASM_X86_SIGNAL_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/svm.h+4
......@@ -95,6 +95,8 @@
9595#define SVM_EXIT_CR14_WRITE_TRAP 0x09e
9696#define SVM_EXIT_CR15_WRITE_TRAP 0x09f
9797#define SVM_EXIT_INVPCID 0x0a2
98#define SVM_EXIT_BUS_LOCK 0x0a5
99#define SVM_EXIT_IDLE_HLT 0x0a6
98100#define SVM_EXIT_NPF 0x400
99101#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
100102#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
......@@ -224,6 +226,8 @@
224226 { SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \
225227 { SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \
226228 { SVM_EXIT_INVPCID, "invpcid" }, \
229 { SVM_EXIT_BUS_LOCK, "buslock" }, \
230 { SVM_EXIT_IDLE_HLT, "idle-halt" }, \
227231 { SVM_EXIT_NPF, "npf" }, \
228232 { SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
229233 { SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \
lib/libc/include/x86-linux-any/asm/unistd_32.h+3
......@@ -457,6 +457,9 @@
457457#define __NR_getxattrat 464
458458#define __NR_listxattrat 465
459459#define __NR_removexattrat 466
460#define __NR_open_tree_attr 467
461#define __NR_file_getattr 468
462#define __NR_file_setattr 469
460463
461464
462465#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_64.h+3
......@@ -380,6 +380,9 @@
380380#define __NR_getxattrat 464
381381#define __NR_listxattrat 465
382382#define __NR_removexattrat 466
383#define __NR_open_tree_attr 467
384#define __NR_file_getattr 468
385#define __NR_file_setattr 469
383386
384387
385388#endif /* _ASM_UNISTD_64_H */
\ No newline at end of file
lib/libc/include/x86-linux-any/asm/unistd_x32.h+3
......@@ -333,6 +333,9 @@
333333#define __NR_getxattrat (__X32_SYSCALL_BIT + 464)
334334#define __NR_listxattrat (__X32_SYSCALL_BIT + 465)
335335#define __NR_removexattrat (__X32_SYSCALL_BIT + 466)
336#define __NR_open_tree_attr (__X32_SYSCALL_BIT + 467)
337#define __NR_file_getattr (__X32_SYSCALL_BIT + 468)
338#define __NR_file_setattr (__X32_SYSCALL_BIT + 469)
336339#define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
337340#define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
338341#define __NR_ioctl (__X32_SYSCALL_BIT + 514)
lib/libc/include/x86-linux-any/asm/vmx.h+4-1
......@@ -34,6 +34,7 @@
3434#define EXIT_REASON_TRIPLE_FAULT 2
3535#define EXIT_REASON_INIT_SIGNAL 3
3636#define EXIT_REASON_SIPI_SIGNAL 4
37#define EXIT_REASON_OTHER_SMI 6
3738
3839#define EXIT_REASON_INTERRUPT_WINDOW 7
3940#define EXIT_REASON_NMI_WINDOW 8
......@@ -92,6 +93,7 @@
9293#define EXIT_REASON_TPAUSE 68
9394#define EXIT_REASON_BUS_LOCK 74
9495#define EXIT_REASON_NOTIFY 75
96#define EXIT_REASON_TDCALL 77
9597
9698#define VMX_EXIT_REASONS \
9799 { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
......@@ -155,7 +157,8 @@
155157 { EXIT_REASON_UMWAIT, "UMWAIT" }, \
156158 { EXIT_REASON_TPAUSE, "TPAUSE" }, \
157159 { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
158 { EXIT_REASON_NOTIFY, "NOTIFY" }
160 { EXIT_REASON_NOTIFY, "NOTIFY" }, \
161 { EXIT_REASON_TDCALL, "TDCALL" }
159162
160163#define VMX_EXIT_REASON_FLAGS \
161164 { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }
lib/libc/include/xtensa-linux-any/asm/param.h deleted-29
......@@ -1,29 +0,0 @@
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/ptrace.h+1-1
......@@ -42,7 +42,7 @@
4242#define PTRACE_GETFDPIC_EXEC 0
4343#define PTRACE_GETFDPIC_INTERP 1
4444
45#ifndef __ASSEMBLY__
45#ifndef __ASSEMBLER__
4646
4747struct user_pt_regs {
4848 __u32 pc;
lib/libc/include/xtensa-linux-any/asm/signal.h+3-3
......@@ -19,7 +19,7 @@
1919#define _NSIG_BPW 32
2020#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
2121
22#ifndef __ASSEMBLY__
22#ifndef __ASSEMBLER__
2323
2424#include <linux/types.h>
2525
......@@ -77,7 +77,7 @@ typedef struct {
7777#define MINSIGSTKSZ 2048
7878#define SIGSTKSZ 8192
7979
80#ifndef __ASSEMBLY__
80#ifndef __ASSEMBLER__
8181
8282#include <asm-generic/signal-defs.h>
8383
......@@ -104,5 +104,5 @@ typedef struct sigaltstack {
104104 __kernel_size_t ss_size;
105105} stack_t;
106106
107#endif /* __ASSEMBLY__ */
107#endif /* __ASSEMBLER__ */
108108#endif /* _XTENSA_SIGNAL_H */
\ No newline at end of file
lib/libc/include/xtensa-linux-any/asm/types.h+2-2
......@@ -14,7 +14,7 @@
1414
1515#include <asm-generic/int-ll64.h>
1616
17#ifdef __ASSEMBLY__
17#ifdef __ASSEMBLER__
1818# define __XTENSA_UL(x) (x)
1919# define __XTENSA_UL_CONST(x) x
2020#else
......@@ -23,7 +23,7 @@
2323# define __XTENSA_UL_CONST(x) ___XTENSA_UL_CONST(x)
2424#endif
2525
26#ifndef __ASSEMBLY__
26#ifndef __ASSEMBLER__
2727
2828#endif
2929
lib/libc/include/xtensa-linux-any/asm/unistd_32.h+3
......@@ -413,6 +413,9 @@
413413#define __NR_getxattrat 464
414414#define __NR_listxattrat 465
415415#define __NR_removexattrat 466
416#define __NR_open_tree_attr 467
417#define __NR_file_getattr 468
418#define __NR_file_setattr 469
416419
417420
418421#endif /* _ASM_UNISTD_32_H */
\ No newline at end of file